*/
package jalview.analysis;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.HiddenMarkovModel;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceFeature;
/**
* Store essential properties of a sequence in a hashtable for later recovery
- * Keys are Name, Start, End, SeqFeatures, PdbId
+ * Keys are Name, Start, End, SeqFeatures, PdbId, HMM
*
* @param seq
* SequenceI
{
Hashtable sqinfo = new Hashtable();
sqinfo.put("Name", seq.getName());
- sqinfo.put("Start", new Integer(seq.getStart()));
- sqinfo.put("End", new Integer(seq.getEnd()));
+ sqinfo.put("Start", Integer.valueOf(seq.getStart()));
+ sqinfo.put("End", Integer.valueOf(seq.getEnd()));
if (seq.getDescription() != null)
{
sqinfo.put("Description", seq.getDescription());
}
- Vector<SequenceFeature> sfeat = new Vector<SequenceFeature>();
+ Vector<SequenceFeature> sfeat = new Vector<>();
List<SequenceFeature> sfs = seq.getFeatures().getAllFeatures();
sfeat.addAll(sfs);
(seq.getDatasetSequence() != null) ? seq.getDatasetSequence()
: new Sequence("THISISAPLACEHOLDER", ""));
}
+ if (seq.hasHMMProfile())
+ {
+ sqinfo.put("HMM", seq.getHMM());
+ }
+
+ if (seq.getAnnotation("Search Scores") != null)
+ {
+ sqinfo.put("Score", seq.getAnnotation("Search Scores"));
+ }
+
return sqinfo;
}
Vector<PDBEntry> pdbid = (Vector<PDBEntry>) sqinfo.get("PdbId");
String description = (String) sqinfo.get("Description");
Sequence seqds = (Sequence) sqinfo.get("datasetSequence");
+ HiddenMarkovModel hmm = (HiddenMarkovModel) sqinfo.get("HMM");
+ AlignmentAnnotation[] scores = (AlignmentAnnotation[]) sqinfo
+ .get("Score");
+
if (oldname == null)
{
namePresent = false;
sq.setDatasetSequence(seqds);
}
+ if (hmm != null)
+ {
+ sq.setHMM(new HiddenMarkovModel(hmm, sq));
+ }
+
+ if (scores != null)
+ {
+ for (AlignmentAnnotation score : scores)
+ {
+ sq.addAlignmentAnnotation(score);
+ }
+ }
return namePresent;
}