blc file reader modified
authoramwaterhouse <Andrew Waterhouse>
Mon, 21 Mar 2005 18:48:39 +0000 (18:48 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 21 Mar 2005 18:48:39 +0000 (18:48 +0000)
src/jalview/io/BLCFile.java

index 5f45aec..8db0a9a 100755 (executable)
@@ -65,31 +65,23 @@ public class BLCFile extends AlignFile {
         break;\r
       }\r
 \r
-      if (line.indexOf(">") > -1)\r
+      int abracket = line.indexOf(">");\r
+\r
+      if (abracket > -1)\r
       {\r
 \r
-        if(line.indexOf(" ")>-1 )\r
+        if(line.indexOf(" ")>-1)\r
         {\r
-          //>54402046         0             1   137   137: immunog\r
-          ids.addElement(line.substring(1, line.indexOf(" ")));\r
-\r
-          // remove p Value\r
-          line = line.substring(line.indexOf(" ") + 1);\r
-          line = line.trim();\r
-\r
-          line = line.substring(line.indexOf(" ") + 1);\r
-          line = line.trim();\r
-          starts.addElement(line.substring(0, line.indexOf(" ")));\r
-          line = line.substring(line.indexOf(" ") + 1);\r
-          line = line.trim();\r
-          ends.addElement(line.substring(0, line.indexOf(" ")));\r
+          ids.addElement(line.substring(abracket+1, line.indexOf(" ", abracket+1)));\r
+          starts.addElement("0");\r
+          ends.addElement("0");\r
         }\r
         else\r
         {\r
-          ids.addElement( line.substring(line.indexOf(">") + 1, line.indexOf("/")));\r
+          ids.addElement( line.substring(abracket + 1, line.indexOf("/")));\r
           line = line.substring(line.indexOf("/") + 1);\r
           starts.addElement(line.substring(0, line.indexOf("-")));\r
-          ends.addElement(line.substring(line.indexOf("-")+1));\r
+          ends.addElement(line.substring(line.indexOf("-") + 1));\r
         }\r
       }\r
     }while(!idsFound);\r
@@ -105,7 +97,10 @@ public class BLCFile extends AlignFile {
     while ((line = nextLine()).indexOf("*")==-1)\r
     {\r
       for(int i=0; i<ids.size(); i++)\r
-        seqstrings[i].append( line.charAt(i+starCol) );\r
+      {\r
+        if(line.length()>i+starCol)\r
+          seqstrings[i].append(line.charAt(i + starCol));\r
+      }\r
     }\r
 \r
     for(int i=0; i<ids.size(); i++)\r