JAL-674 add RNA sequence associated annotation to alignment as hidden annotation
authorJim Procter <jprocter@dundee.ac.uk>
Fri, 21 Nov 2014 09:01:03 +0000 (09:01 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Fri, 21 Nov 2014 09:01:03 +0000 (09:01 +0000)
src/jalview/io/StockholmFile.java

index 1c84f00..7ca07c8 100644 (file)
@@ -366,6 +366,7 @@ public class StockholmFile extends AlignFile
                     AlignmentAnnotation an = (AlignmentAnnotation) vv
                             .elementAt(ii);
                     seqO.addAlignmentAnnotation(an);
+                    annotations.add(an);
                   }
                 }
               }
@@ -635,9 +636,13 @@ public class StockholmFile extends AlignFile
               strucAnn = new Hashtable();
             }
 
-            Vector newStruc = new Vector();
+            Vector<AlignmentAnnotation> newStruc = new Vector<AlignmentAnnotation>();
             parseAnnotationRow(newStruc, type, ns);
-
+            for (AlignmentAnnotation alan : newStruc)
+            {
+              alan.visible = false;
+            }
+            // annotations.addAll(newStruc);
             strucAnn.put(type, newStruc);
             seqAnn.put(acc, strucAnn);
           }
@@ -1041,11 +1046,12 @@ public class StockholmFile extends AlignFile
 
         out.append(new Format("%-" + maxid + "s").form("#=GC " + label
                 + " "));
+        boolean isrna = aa.isValidStruc();
         for (int j = 0; j < aa.annotations.length; j++)
         {
           String ch = (aa.annotations[j] == null) ? "-"
                   : aa.annotations[j].displayCharacter;
-          if (ch.length() == 0)
+          if (ch.length() == 0 || isrna)
           {
             char ll = aa.annotations[j].secondaryStructure;
             if (Character.toString(ll).equals(" "))