- 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
+ if (abracket > -1)\r
+ {\r
+ if (line.indexOf(" ") > -1) //\r
+ {\r
+ ///Colur it be this format?\r
+ //>54402046 0 1 137 137:\r
+ // or this??\r
+ // 1 >L1H14 30539 343\r
+ try\r
+ {\r
+ ids.addElement(line.substring(abracket + 1,\r
+ line.indexOf(" ", abracket + 1)));\r
+\r
+ // remove p Value\r
+ line = line.substring(abracket + 1);\r
+ line = line.substring(line.indexOf(" ") + 1);\r
+ line = line.trim();\r
+ line = line.substring(line.indexOf(" ") + 1);\r
+ line = line.trim();\r
+\r
+ int value = Integer.parseInt(line.substring(0,\r
+ line.indexOf(" ")));\r
+ starts.addElement(value + "");\r
+ line = line.substring(line.indexOf(" ") + 1);\r
+ line = line.trim();\r
+ value = Integer.parseInt(line.substring(0,\r
+ line.indexOf(" ")));\r
+ ends.addElement(value + "");\r
+ }\r
+ catch (Exception ex)\r
+ {\r
+ System.err.println("Error during blockfile read.");\r
+ ex.printStackTrace();\r
+ starts.addElement("1");\r
+ ends.addElement("-1");\r
+ }\r
+ }\r
+ else\r
+ {\r
+ if (line.indexOf("/") > -1)\r
+ {\r
+ ids.addElement(line.substring(abracket + 1,\r
+ line.indexOf("/")));\r
+ line = line.substring(line.indexOf("/") + 1);\r
+ starts.addElement(line.substring(0,\r
+ line.indexOf("-")));\r
+ ends.addElement(line.substring(line.indexOf("-") +\r
+ 1));\r
+ }\r
+ else\r
+ {\r
+ ids.addElement(line.substring(abracket + 1));\r
+ starts.addElement("1");\r
+ ends.addElement("-1");\r
+ }\r
+ }\r
+ }\r
+ }\r
+ while (!idsFound);\r
+\r
+ int starCol = line.indexOf("*");\r
+ seqstrings = new StringBuffer[ids.size()];\r
+\r
+ for (int i = 0; i < ids.size(); i++)\r
+ {\r
+ if (seqstrings[i] == null)\r
+ {\r
+ seqstrings[i] = new StringBuffer();\r
+ }\r
+ }\r
+\r
+ while ((line = nextLine()).indexOf("*") == -1)\r
+ {\r
+ for (int i = 0; i < ids.size(); i++)\r
+ {\r
+ if (line.length() > (i + starCol))\r
+ {\r
+ seqstrings[i].append(line.charAt(i + starCol));\r
+ }\r
+ }\r
+ }\r
+\r
+ for (int i = 0; i < ids.size(); i++)\r
+ {\r
+ Sequence newSeq = new Sequence(ids.elementAt(i).toString(),\r
+ seqstrings[i].toString(),\r
+ Integer.parseInt(starts.elementAt(i).toString()),\r
+ Integer.parseInt(ends.elementAt(i).toString()));\r
+ seqs.addElement(newSeq);\r
+ }\r