next version of Jpred functionality using new client code.
[jalview.git] / src / jalview / io / JPredFile.java
index 92d9819..636a8d6 100755 (executable)
@@ -28,6 +28,9 @@ public class JPredFile
 
     super.initData();
     Scores = new Hashtable();
+    ids = null;
+    conf = null;
+    QuerySeqPosition = -1;
   }
 
   public JPredFile(String inFile, String type)
@@ -40,13 +43,13 @@ public class JPredFile
   /**
    * parse a JPred concise file into a sequence-alignment like object.
    */
-
+  int QuerySeqPosition;
   public void parse()
       throws IOException
   {
 System.out.println("all read in ");
     String line;
-
+    QuerySeqPosition = -1;
     noSeqs = 0;
     Vector seq_entries = new Vector();
     Vector ids = new Vector();
@@ -144,6 +147,7 @@ System.out.println("all read in ");
               name = id.substring(id.indexOf(";")+1)+"_"+1;
             }
             ids.addElement(name);
+
             noSeqs++;
           }
           else
@@ -187,6 +191,10 @@ System.out.println("all read in ");
                               ids.elementAt(i).toString()
                               + ") has an unexpected number of columns");
       }
+      if (newSeq.getName().startsWith("QUERY") && QuerySeqPosition==-1) {
+        QuerySeqPosition = seqs.size();
+      }
+
       seqs.addElement(newSeq);
 
     }