JAL-2629 evalues and bit scores now conserved after hmmalign is run
[jalview.git] / src / jalview / analysis / SeqsetUtils.java
index b50a2ce..61fc747 100755 (executable)
@@ -20,6 +20,7 @@
  */
 package jalview.analysis;
 
+import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.HiddenMarkovModel;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.Sequence;
@@ -74,6 +75,12 @@ public class SeqsetUtils
     {
       sqinfo.put("HMM", seq.getHMM());
     }
+
+    if (seq.getAnnotation("Search Scores") != null)
+    {
+      sqinfo.put("Score", seq.getAnnotation("Search Scores"));
+    }
+
     return sqinfo;
   }
 
@@ -103,6 +110,9 @@ public class SeqsetUtils
     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;
@@ -145,6 +155,14 @@ public class SeqsetUtils
     {
       sq.setHMM(new HiddenMarkovModel(hmm, sq));
     }
+
+    if (scores != null)
+    {
+      for (AlignmentAnnotation score : scores)
+      {
+        sq.addAlignmentAnnotation(score);
+      }
+    }
     return namePresent;
   }