+ /**\r
+ * DOCUMENT ME!\r
+ */\r
+ public void parse() throws IOException\r
+ {\r
+ int i = 0;\r
+ boolean seqFlag = false;\r
+ String key = new String();\r
+ Vector headers = new Vector();\r
+ Hashtable seqhash = new Hashtable();\r
+ String line;\r
+\r
+ try\r
+ {\r
+ while ((line = nextLine()) != null)\r
+ {\r
+ StringTokenizer str = new StringTokenizer(line);\r
+\r
+ while (str.hasMoreTokens())\r
+ {\r
+ String inStr = str.nextToken();\r
+\r
+ //If line has header information add to the headers vector\r
+ if (inStr.indexOf("Name:") != -1)\r
+ {\r
+ key = str.nextToken();\r
+ headers.addElement(key);\r
+ }\r
+\r
+ //if line has // set SeqFlag to 1 so we know sequences are coming\r
+ if (inStr.indexOf("//") != -1)\r
+ {\r
+ seqFlag = true;\r
+ }\r
+\r
+ //Process lines as sequence lines if seqFlag is set\r
+ if ((inStr.indexOf("//") == -1) && (seqFlag == true))\r
+ {\r
+ //seqeunce id is the first field\r
+ key = inStr;\r
+\r
+ StringBuffer tempseq;\r
+\r
+ //Get sequence from hash if it exists\r
+ if (seqhash.containsKey(key))\r
+ {\r
+ tempseq = (StringBuffer) seqhash.get(key);\r
+ }\r
+ else\r
+ {\r
+ tempseq = new StringBuffer();\r
+ seqhash.put(key, tempseq);\r
+ }\r
+\r
+ //loop through the rest of the words\r
+ while (str.hasMoreTokens())\r
+ {\r
+ //append the word to the sequence\r
+ tempseq.append(str.nextToken());\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ catch (IOException e)\r
+ {\r
+ System.err.println("Exception parsing MSFFile " + e);\r
+ e.printStackTrace();\r
+ }\r