JAL-2507 output secondary structure regardless of presence of dataset sequence
authorJim Procter <jprocter@issues.jalview.org>
Tue, 9 May 2017 15:54:15 +0000 (16:54 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 9 May 2017 15:54:15 +0000 (16:54 +0100)
src/jalview/io/StockholmFile.java

index a47e1ea..32e6ff7 100644 (file)
@@ -966,46 +966,39 @@ public class StockholmFile extends AlignFile
     // output annotations
     while (i < s.length && s[i] != null)
     {
-      if (s[i].getDatasetSequence() != null)
+      AlignmentAnnotation[] alAnot = s[i].getAnnotation();
+      if (alAnot != null)
       {
-        SequenceI ds = s[i].getDatasetSequence();
-        AlignmentAnnotation[] alAnot;
         Annotation[] ann;
-        Annotation annot;
-        alAnot = s[i].getAnnotation();
-        String feature = "";
-        if (alAnot != null)
+        for (int j = 0; j < alAnot.length; j++)
         {
-          for (int j = 0; j < alAnot.length; j++)
-          {
 
-            String key = type2id(alAnot[j].label);
-            boolean isrna = alAnot[j].isValidStruc();
+          String key = type2id(alAnot[j].label);
+          boolean isrna = alAnot[j].isValidStruc();
 
-            if (isrna)
-            {
-              // hardwire to secondary structure if there is RNA secondary
-              // structure on the annotation
-              key = "SS";
-            }
-            if (key == null)
-            {
+          if (isrna)
+          {
+            // hardwire to secondary structure if there is RNA secondary
+            // structure on the annotation
+            key = "SS";
+          }
+          if (key == null)
+          {
 
-              continue;
-            }
+            continue;
+          }
 
-            // out.append("#=GR ");
-            out.append(new Format("%-" + maxid + "s").form("#=GR "
-                    + printId(s[i], jvSuffix) + " " + key + " "));
-            ann = alAnot[j].annotations;
-            String seq = "";
-            for (int k = 0; k < ann.length; k++)
-            {
-              seq += outputCharacter(key, k, isrna, ann, s[i]);
-            }
-            out.append(seq);
-            out.append(newline);
+          // out.append("#=GR ");
+          out.append(new Format("%-" + maxid + "s").form("#=GR "
+                  + printId(s[i], jvSuffix) + " " + key + " "));
+          ann = alAnot[j].annotations;
+          String seq = "";
+          for (int k = 0; k < ann.length; k++)
+          {
+            seq += outputCharacter(key, k, isrna, ann, s[i]);
           }
+          out.append(seq);
+          out.append(newline);
         }
       }