formatting
[jalview.git] / src / jalview / io / StockholmFile.java
index 3a7a739..a9124d9 100644 (file)
@@ -150,15 +150,15 @@ public class StockholmFile extends AlignFile
           int end = -1;\r
           String sid = acc;\r
           /*\r
-           * Retrieve hash of annotations for this accession\r
-           * Associate Annotation with accession\r
+           * Retrieve hash of annotations for this accession Associate\r
+           * Annotation with accession\r
            */\r
           Hashtable accAnnotations = null;\r
 \r
           if (seqAnn != null && seqAnn.containsKey(acc))\r
           {\r
             accAnnotations = (Hashtable) seqAnn.remove(acc);\r
-            //TODO: add structures to sequence\r
+            // TODO: add structures to sequence\r
           }\r
 \r
           // Split accession in id and from/to\r
@@ -188,19 +188,19 @@ public class StockholmFile extends AlignFile
               jalview.util.DBRefUtils.parseToDbRef(seqO, src, "0", acn);\r
               // seqO.addDBRef(dbref);\r
             }\r
-          }        \r
+          }\r
           if (accAnnotations != null && accAnnotations.containsKey("SS"))\r
           {\r
-                 Vector v = (Vector) accAnnotations.get("SS");\r
-                 \r
-                 for (int i = 0; i < v.size(); i++)\r
-                   {\r
-                         AlignmentAnnotation an = (AlignmentAnnotation) v.elementAt(i);\r
-                         seqO.addAlignmentAnnotation(an);\r
-                         //annotations.add(an);\r
-                   }\r
+            Vector v = (Vector) accAnnotations.get("SS");\r
+\r
+            for (int i = 0; i < v.size(); i++)\r
+            {\r
+              AlignmentAnnotation an = (AlignmentAnnotation) v.elementAt(i);\r
+              seqO.addAlignmentAnnotation(an);\r
+              // annotations.add(an);\r
+            }\r
           }\r
-        \r
+\r
           Hashtable features = null;\r
           // We need to adjust the positions of all features to account for gaps\r
           try\r
@@ -442,7 +442,8 @@ public class StockholmFile extends AlignFile
               ann = new Hashtable();\r
               seqAnn.put(acc, ann);\r
             }\r
-            //TODO test structure, call parseAnnotationRow with vector from hashtable for specific sequence\r
+            // TODO test structure, call parseAnnotationRow with vector from\r
+            // hashtable for specific sequence\r
             Hashtable features;\r
             // Get an object with all the content for an annotation\r
             if (ann.containsKey("features"))\r
@@ -477,24 +478,25 @@ public class StockholmFile extends AlignFile
             }\r
             ns += seq;\r
             content.put(description, ns);\r
-
-            if(type.equals("SS")){\r
-                Hashtable strucAnn;\r
-                if (seqAnn.containsKey(acc))\r
-                {\r
-                  strucAnn = (Hashtable) seqAnn.get(acc);\r
-                }\r
-                else\r
-                {\r
-                  strucAnn = new Hashtable();\r
-                }\r
-                \r
-                Vector newStruc=new Vector();\r
-                parseAnnotationRow(newStruc, type,ns);\r
-                \r
-                strucAnn.put(type, newStruc);\r
-                seqAnn.put(acc, strucAnn);\r
-             }\r
+\r
+            if (type.equals("SS"))\r
+            {\r
+              Hashtable strucAnn;\r
+              if (seqAnn.containsKey(acc))\r
+              {\r
+                strucAnn = (Hashtable) seqAnn.get(acc);\r
+              }\r
+              else\r
+              {\r
+                strucAnn = new Hashtable();\r
+              }\r
+\r
+              Vector newStruc = new Vector();\r
+              parseAnnotationRow(newStruc, type, ns);\r
+\r
+              strucAnn.put(type, newStruc);\r
+              seqAnn.put(acc, strucAnn);\r
+            }\r
           }\r
           else\r
           {\r
@@ -521,8 +523,8 @@ public class StockholmFile extends AlignFile
     }\r
   }\r
 \r
-  private AlignmentAnnotation parseAnnotationRow(Vector annotation,\r
-          String label, String annots)\r
+  protected static AlignmentAnnotation parseAnnotationRow(\r
+          Vector annotation, String label, String annots)\r
   {\r
     String convert1, convert2 = null;\r
 \r
@@ -600,7 +602,7 @@ public class StockholmFile extends AlignFile
               annot.annotations.length);\r
       System.arraycopy(els, 0, anns, annot.annotations.length, els.length);\r
       annot.annotations = anns;\r
-      //System.out.println("else: ");\r
+      // System.out.println("else: ");\r
     }\r
     return annot;\r
   }\r
@@ -640,7 +642,7 @@ public class StockholmFile extends AlignFile
     }\r
   }\r
 \r
-  private String id2type(String id)\r
+  protected static String id2type(String id)\r
   {\r
     if (typeIds.containsKey(id))\r
     {\r