JAL-1233 JAL-1576 copy constructor to propagate helix colours and applyTo implementat...
[jalview.git] / src / jalview / io / StockholmFile.java
index 96c462c..f652035 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -533,9 +533,9 @@ public class StockholmFile extends AlignFile
           }
           else
           {
-            throw new IOException(MessageManager.formatMessage(
-                    "exception.error_parsing_line", new String[]
-                    { line }));
+            // throw new IOException(MessageManager.formatMessage(
+            // "exception.error_parsing_line", new String[] { line }));
+            System.err.println(">> missing annotation: " + line);
           }
         }
         else if (annType.equals("GC"))
@@ -978,6 +978,7 @@ public class StockholmFile extends AlignFile
             {
               feature = ds.getSequenceFeatures()[0].type;
             }
+            // ?bug - feature may still have previous loop value
             String key = type2id(feature);
 
             if (key == null)
@@ -1027,13 +1028,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 +1076,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)
       {