A third commit where there should have been one.... Everything is here
authorDaniel Barton <daluke.barton@gmail.com>
Wed, 21 Aug 2013 10:57:21 +0000 (11:57 +0100)
committerDaniel Barton <daluke.barton@gmail.com>
Wed, 21 Aug 2013 10:57:21 +0000 (11:57 +0100)
now I hope.

datamodel/compbio/data/sequence/RNAStructScoreManager.java
datamodel/compbio/data/sequence/ScoreManager.java

index 3fb856c..e792969 100644 (file)
@@ -38,7 +38,7 @@ public class RNAStructScoreManager extends ScoreManager {
                this.seqScores = seqScores;\r
        }\r
        \r
-       // I put this in purely because it mirrors a method in ScoreManager, not because I need it :/\r
+       // I put this in purely because it mirrors a method in ScoreManager, not because I need it \r
        public static RNAStructScoreManager newInstance(List<String> structs, List<TreeSet<Score>> data) {\r
                return new RNAStructScoreManager(structs, data);\r
        }\r
index c3b6a85..9b1803d 100644 (file)
@@ -36,9 +36,10 @@ public class ScoreManager {
        @XmlTransient\r
        public static final String SINGLE_ENTRY_KEY = "Alignment";\r
 \r
-       private List<ScoreHolder> seqScores;\r
+       protected List<ScoreHolder> seqScores;\r
 \r
-       private ScoreManager() {\r
+       // Do I have to change this to protected?\r
+       protected ScoreManager() {\r
                // Default JAXB constructor\r
        }\r
 \r
@@ -56,27 +57,6 @@ public class ScoreManager {
                this.seqScores = seqScores;\r
        }\r
 \r
-       /*\r
-        *  Next constructor added by Daniel\r
-        *  a constructor for using ScoreManager to represent RNAalifold output\r
-           \r
-        */\r
-       \r
-       public ScoreManager(RNAStruct rnaStruct) {\r
-               assert(rnaStruct.getStructs().size() == rnaStruct.getData().size());\r
-               // This had better be used to create a RNAalifold output structure\r
-               assert(java.util.regex.Pattern.matches(\r
-                               "^[\\.)(]*$", rnaStruct.getStructs().get(1)));\r
-               List<ScoreHolder> seqScores = new ArrayList<ScoreHolder>();\r
-               \r
-               for (int i = 0; i < rnaStruct.getStructs().size(); i++) {\r
-                       seqScores.add(new ScoreHolder(rnaStruct.getStructs().get(i),\r
-                                       rnaStruct.getData().get(i)));\r
-               }\r
-               this.seqScores = seqScores;\r
-       }\r
-       \r
-       \r
        public static ScoreManager newInstance(Map<String, Set<Score>> data) {\r
                return new ScoreManager(data);\r
        }\r
@@ -96,19 +76,6 @@ public class ScoreManager {
                return new ScoreManager(ScoreManager.SINGLE_ENTRY_KEY,\r
                                new TreeSet(data));\r
        }\r
-\r
-       // Also Daniel's. Check this with Jim to make sure that I am not compromising\r
-       // the security of this class\r
-               public RNAStruct asRNAStruct() {\r
-                       List<String> structs = new ArrayList<String>();\r
-                       List<TreeSet<Score>> data = new ArrayList<TreeSet<Score>>();\r
-                       for (ScoreHolder sch : this.seqScores) {\r
-                               structs.add(sch.id);\r
-                               data.add(sch.scores);\r
-                       }\r
-                       return new RNAStruct(structs, data);\r
-               }\r
-                \r
        \r
        public Map<String, TreeSet<Score>> asMap() {\r
                Map<String, TreeSet<Score>> seqScoresMap = new TreeMap<String, TreeSet<Score>>();\r
@@ -199,8 +166,7 @@ public class ScoreManager {
 \r
                ScoreHolder(String id, Set<Score> scores) {\r
                        this.id = id;\r
-                       this.scores = new TreeSet<Score>(scores);\r
-               }\r
+                       this.scores = new TreeSet<Score>(scores);               }\r
 \r
                public void writeOut(Writer writer) throws IOException {\r
                        writer.write(">" + id + "\n");\r