@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
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
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
\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