Merge branch 'develop' into features/mchmmer
[jalview.git] / src / jalview / io / StockholmFile.java
index f5b5177..afbdf16 100644 (file)
@@ -197,7 +197,7 @@ public class StockholmFile extends AlignFile
     String version;
     // String id;
     Hashtable seqAnn = new Hashtable(); // Sequence related annotations
-    LinkedHashMap<String, String> seqs = new LinkedHashMap<String, String>();
+    LinkedHashMap<String, String> seqs = new LinkedHashMap<>();
     Regex p, r, rend, s, x;
     // Temporary line for processing RNA annotation
     // String RNAannot = "";
@@ -658,7 +658,7 @@ public class StockholmFile extends AlignFile
               strucAnn = new Hashtable();
             }
 
-            Vector<AlignmentAnnotation> newStruc = new Vector<AlignmentAnnotation>();
+            Vector<AlignmentAnnotation> newStruc = new Vector<>();
             parseAnnotationRow(newStruc, type, ns);
             for (AlignmentAnnotation alan : newStruc)
             {
@@ -710,7 +710,7 @@ public class StockholmFile extends AlignFile
   private void guessDatabaseFor(Sequence seqO, String dbr, String dbsource)
   {
     DBRefEntry dbrf = null;
-    List<DBRefEntry> dbrs = new ArrayList<DBRefEntry>();
+    List<DBRefEntry> dbrs = new ArrayList<>();
     String seqdb = "Unknown", sdbac = "" + dbr;
     int st = -1, en = -1, p;
     if ((st = sdbac.indexOf("/")) > -1)
@@ -996,6 +996,7 @@ public class StockholmFile extends AlignFile
       }
     }
 
+
     // output annotations
     while (i < s.length && s[i] != null)
     {
@@ -1008,7 +1009,6 @@ public class StockholmFile extends AlignFile
 
           String key = type2id(alAnot[j].label);
           boolean isrna = alAnot[j].isValidStruc();
-
           if (isrna)
           {
             // hardwire to secondary structure if there is RNA secondary
@@ -1029,7 +1029,8 @@ public class StockholmFile extends AlignFile
           for (int k = 0; k < ann.length; k++)
           {
             seq += outputCharacter(key, k, isrna, ann, s[i]);
-          }
+
+        }
           out.append(seq);
           out.append(newline);
         }
@@ -1067,6 +1068,10 @@ public class StockholmFile extends AlignFile
           {
             label = aa.label;
           }
+          else if ("RF".equals(key))
+          {
+            label = key;
+          }
           else
           {
             label = key + "_cons";
@@ -1089,6 +1094,8 @@ public class StockholmFile extends AlignFile
         out.append(newline);
       }
     }
+    
+
 
     out.append("//");
     out.append(newline);
@@ -1153,9 +1160,6 @@ public class StockholmFile extends AlignFile
     out.append("# STOCKHOLM 1.0");
     out.append(newline);
     print(getSeqsAsArray(), false);
-
-    out.append("//");
-    out.append(newline);
     return out.toString();
   }