- 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