JAL-1199 JAL-1569 incremental patch allow non-standard annotation to be output
authorJim Procter <jprocter@dundee.ac.uk>
Mon, 1 Dec 2014 21:49:16 +0000 (21:49 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Mon, 1 Dec 2014 21:49:16 +0000 (21:49 +0000)
src/jalview/io/StockholmFile.java

index 96c462c..3b9fb00 100644 (file)
@@ -1027,13 +1027,21 @@ public class StockholmFile extends AlignFile
         }
         else
         {
-          label = (key = type2id(aa.label.toLowerCase())) + "_cons";
+          key = type2id(aa.label.toLowerCase());
+          if (key == null)
+          {
+            label = aa.label;
+          }
+          else
+          {
+            label = key + "_cons";
+          }
         }
-
         if (label == null)
         {
           label = aa.label;
         }
+        label = label.replace(" ", "_");
 
         out.append(new Format("%-" + maxid + "s").form("#=GC " + label
                 + " "));
@@ -1067,7 +1075,7 @@ public class StockholmFile extends AlignFile
     String ch = (annot == null) ? ((sequenceI == null) ? "-" : Character
             .toString(sequenceI.getCharAt(k)))
             : annot.displayCharacter;
-    if (key.equals("SS"))
+    if (key != null && key.equals("SS"))
     {
       if (annot == null)
       {