Merge remote-tracking branch 'origin/releases/Release_2_10_2b1_Branch'
[jalview.git] / src / jalview / io / StockholmFile.java
index c2f3683..e22ee0a 100644 (file)
@@ -163,8 +163,8 @@ public class StockholmFile extends AlignFile
 
       for (int k = 0; k < rna.length(); k++)
       {
-        ann[k] = new Annotation(annot[k], "", Rna.getRNASecStrucState(
-                annot[k]).charAt(0), 0f);
+        ann[k] = new Annotation(annot[k], "",
+                Rna.getRNASecStrucState(annot[k]).charAt(0), 0f);
 
       }
       AlignmentAnnotation align = new AlignmentAnnotation("Sec. str.",
@@ -207,9 +207,8 @@ public class StockholmFile extends AlignFile
     r = new Regex("# STOCKHOLM ([\\d\\.]+)");
     if (!r.search(nextLine()))
     {
-      throw new IOException(
-              MessageManager
-                      .getString("exception.stockholm_invalid_format"));
+      throw new IOException(MessageManager
+              .getString("exception.stockholm_invalid_format"));
     }
     else
     {
@@ -439,8 +438,8 @@ public class StockholmFile extends AlignFile
         {
           // logger.error("Could not parse sequence line: " + line);
           throw new IOException(MessageManager.formatMessage(
-                  "exception.couldnt_parse_sequence_line",
-                  new String[] { line }));
+                  "exception.couldnt_parse_sequence_line", new String[]
+                  { line }));
         }
         String ns = seqs.get(x.stringMatched(1));
         if (ns == null)
@@ -671,8 +670,8 @@ public class StockholmFile extends AlignFile
           // }
           else
           {
-            System.err
-                    .println("Warning - couldn't parse sequence annotation row line:\n"
+            System.err.println(
+                    "Warning - couldn't parse sequence annotation row line:\n"
                             + line);
             // throw new IOException("Error parsing " + line);
           }
@@ -680,8 +679,8 @@ public class StockholmFile extends AlignFile
         else
         {
           throw new IOException(MessageManager.formatMessage(
-                  "exception.unknown_annotation_detected", new String[] {
-                      annType, annContent }));
+                  "exception.unknown_annotation_detected", new String[]
+                  { annType, annContent }));
         }
       }
     }
@@ -794,8 +793,10 @@ public class StockholmFile extends AlignFile
     {
       for (DBRefEntry d : dbrs)
       {
-        jalview.util.MapList mp = new jalview.util.MapList(new int[] {
-            seqO.getStart(), seqO.getEnd() }, new int[] { st, en }, 1, 1);
+        jalview.util.MapList mp = new jalview.util.MapList(
+                new int[]
+                { seqO.getStart(), seqO.getEnd() }, new int[] { st, en }, 1,
+                1);
         jalview.datamodel.Mapping mping = new Mapping(mp);
         d.setMap(mping);
       }
@@ -815,8 +816,9 @@ public class StockholmFile extends AlignFile
     String type = label;
     if (label.contains("_cons"))
     {
-      type = (label.indexOf("_cons") == label.length() - 5) ? label
-              .substring(0, label.length() - 5) : label;
+      type = (label.indexOf("_cons") == label.length() - 5)
+              ? label.substring(0, label.length() - 5)
+              : label;
     }
     boolean ss = false, posterior = false;
     type = id2type(type);
@@ -850,14 +852,14 @@ public class StockholmFile extends AlignFile
             ann.secondaryStructure = ResidueProperties.getDssp3state(pos)
                     .charAt(0);
 
-          if (ann.secondaryStructure == pos.charAt(0))
-          {
-            ann.displayCharacter = ""; // null; // " ";
-          }
-          else
-          {
-            ann.displayCharacter = " " + ann.displayCharacter;
-          }
+            if (ann.secondaryStructure == pos.charAt(0))
+            {
+              ann.displayCharacter = ""; // null; // " ";
+            }
+            else
+            {
+              ann.displayCharacter = " " + ann.displayCharacter;
+            }
           }
         }
 
@@ -980,8 +982,8 @@ public class StockholmFile extends AlignFile
       {
         Object idd = en.nextElement();
         String type = (String) dataRef.remove(idd);
-        out.append(new Format("%-" + (maxid - 2) + "s").form("#=GS "
-                + idd.toString() + " "));
+        out.append(new Format("%-" + (maxid - 2) + "s")
+                .form("#=GS " + idd.toString() + " "));
         if (type.contains("PFAM") || type.contains("RFAM"))
         {
 
@@ -1021,8 +1023,8 @@ public class StockholmFile extends AlignFile
           }
 
           // out.append("#=GR ");
-          out.append(new Format("%-" + maxid + "s").form("#=GR "
-                  + printId(s[i], jvSuffix) + " " + key + " "));
+          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++)
@@ -1077,8 +1079,8 @@ public class StockholmFile extends AlignFile
         }
         label = label.replace(" ", "_");
 
-        out.append(new Format("%-" + maxid + "s").form("#=GC " + label
-                + " "));
+        out.append(
+                new Format("%-" + maxid + "s").form("#=GC " + label + " "));
         boolean isrna = aa.isValidStruc();
         for (int j = 0; j < aa.annotations.length; j++)
         {
@@ -1110,8 +1112,10 @@ public class StockholmFile extends AlignFile
   {
     char seq = ' ';
     Annotation annot = ann[k];
-    String ch = (annot == null) ? ((sequenceI == null) ? "-" : Character
-            .toString(sequenceI.getCharAt(k))) : annot.displayCharacter;
+    String ch = (annot == null)
+            ? ((sequenceI == null) ? "-"
+                    : Character.toString(sequenceI.getCharAt(k)))
+            : annot.displayCharacter;
     if (key != null && key.equals("SS"))
     {
       if (annot == null)
@@ -1188,8 +1192,8 @@ public class StockholmFile extends AlignFile
     {
       return (String) typeIds.get(id);
     }
-    System.err.println("Warning : Unknown Stockholm annotation type code "
-            + id);
+    System.err.println(
+            "Warning : Unknown Stockholm annotation type code " + id);
     return id;
   }
 
@@ -1210,8 +1214,8 @@ public class StockholmFile extends AlignFile
     {
       return key;
     }
-    System.err.println("Warning : Unknown Stockholm annotation type: "
-            + type);
+    System.err.println(
+            "Warning : Unknown Stockholm annotation type: " + type);
     return key;
   }