JAL-674 add sequence associated annotation rows to flanking alignment
authorJim Procter <jprocter@dundee.ac.uk>
Thu, 27 Nov 2014 15:59:39 +0000 (15:59 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Thu, 27 Nov 2014 15:59:48 +0000 (15:59 +0000)
src/jalview/analysis/AlignmentUtils.java

index 929a855..6385fa7 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.analysis;
 
+import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
 
@@ -121,6 +122,16 @@ public class AlignmentUtils
     }
     AlignmentI newAl = new jalview.datamodel.Alignment(
             sq.toArray(new SequenceI[0]));
+    for (SequenceI s : sq)
+    {
+      if (s.getAnnotation() != null)
+      {
+        for (AlignmentAnnotation aa : s.getAnnotation())
+        {
+          newAl.addAnnotation(aa);
+        }
+      }
+    }
     newAl.setDataset(core.getDataset());
     return newAl;
   }