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