JAL-2629 add documentation to previous work
[jalview.git] / src / jalview / io / StockholmFile.java
index 8d340f2..dea0789 100644 (file)
@@ -916,13 +916,6 @@ public class StockholmFile extends AlignFile
   @Override
   public String print(SequenceI[] s, boolean jvSuffix)
   {
-    String string = print(s, jvSuffix, false);
-    return string;
-  }
-
-  public String print(SequenceI[] s, boolean jvSuffix,
-          boolean removeAnnotations)
-  {
     out = new StringBuffer();
     out.append("# STOCKHOLM 1.0");
     out.append(newline);
@@ -1007,7 +1000,7 @@ public class StockholmFile extends AlignFile
       while (i < s.length && s[i] != null)
       {
         AlignmentAnnotation[] alAnot = s[i].getAnnotation();
-      if (alAnot != null && !removeAnnotations)
+      if (alAnot != null)
         {
           Annotation[] ann;
           for (int j = 0; j < alAnot.length; j++)
@@ -1049,57 +1042,55 @@ public class StockholmFile extends AlignFile
         i++;
       }
 
-    if (!removeAnnotations)
+    // alignment annotation
+    AlignmentAnnotation aa;
+    if (al.getAlignmentAnnotation() != null)
     {
-      // alignment annotation
-      AlignmentAnnotation aa;
-      if (al.getAlignmentAnnotation() != null)
+      for (int ia = 0; ia < al.getAlignmentAnnotation().length; ia++)
       {
-        for (int ia = 0; ia < al.getAlignmentAnnotation().length; ia++)
+        aa = al.getAlignmentAnnotation()[ia];
+        if (aa.autoCalculated || !aa.visible || aa.sequenceRef != null)
         {
-          aa = al.getAlignmentAnnotation()[ia];
-          if (aa.autoCalculated || !aa.visible || aa.sequenceRef != null)
-          {
-            continue;
-          }
-          String seq = "";
-          String label;
-          String key = "";
-          if (aa.label.equals("seq"))
+          continue;
+        }
+        String seq = "";
+        String label;
+        String key = "";
+        if (aa.label.equals("seq"))
+        {
+          label = "seq_cons";
+        }
+        else
+        {
+          key = type2id(aa.label.toLowerCase());
+          if (key == null)
           {
-            label = "seq_cons";
+            label = aa.label;
           }
           else
           {
-            key = type2id(aa.label.toLowerCase());
-            if (key == null)
-            {
-              label = aa.label;
-            }
-            else
-            {
-              label = key + "_cons";
-            }
+            label = key + "_cons";
           }
-          if (label == null)
-          {
-            label = aa.label;
-          }
-          label = label.replace(" ", "_");
+        }
+        if (label == null)
+        {
+          label = aa.label;
+        }
+        label = label.replace(" ", "_");
 
-          out.append(new Format("%-" + maxid + "s")
-                  .form("#=GC " + label + " "));
-          boolean isrna = aa.isValidStruc();
-          for (int j = 0; j < aa.annotations.length; j++)
-          {
-            seq += outputCharacter(key, j, isrna, aa.annotations, null);
-          }
-          out.append(seq);
-          out.append(newline);
+        out.append(
+                new Format("%-" + maxid + "s").form("#=GC " + label + " "));
+        boolean isrna = aa.isValidStruc();
+        for (int j = 0; j < aa.annotations.length; j++)
+        {
+          seq += outputCharacter(key, j, isrna, aa.annotations, null);
         }
+        out.append(seq);
+        out.append(newline);
       }
     }
 
+
     out.append("//");
     out.append(newline);