/*\r
* Jalview - A Sequence Alignment Editor and Viewer\r
- * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
*\r
* This program is free software; you can redistribute it and/or\r
* modify it under the terms of the GNU General Public License\r
super(inFile, type);\r
}\r
\r
- public void parse() throws IOException\r
+ public void parse()\r
+ throws IOException\r
{\r
- StringBuffer sequence;\r
- String line = null;\r
- ModellerDescription md;\r
+ StringBuffer sequence;\r
+ String line = null;\r
+ ModellerDescription md;\r
\r
- while ( (line = nextLine()) != null)\r
+ while ( (line = nextLine()) != null)\r
+ {\r
+ if (line.length() == 0)\r
{\r
- if (line.length() == 0)\r
- {\r
- //System.out.println("blank line");\r
- continue;\r
- }\r
- if (line.indexOf("C;") == 0 || line.indexOf("#") == 0)\r
- {\r
- continue;\r
- }\r
- Sequence newSeq = parseId(line.substring(line.indexOf(";") + 1));\r
-\r
- sequence = new StringBuffer();\r
+ //System.out.println("blank line");\r
+ continue;\r
+ }\r
+ if (line.indexOf("C;") == 0 || line.indexOf("#") == 0)\r
+ {\r
+ continue;\r
+ }\r
+ Sequence newSeq = parseId(line.substring(line.indexOf(";") + 1));\r
\r
- newSeq.setDescription(nextLine()); // this is the title line\r
+ sequence = new StringBuffer();\r
\r
- boolean starFound = false;\r
+ newSeq.setDescription(nextLine()); // this is the title line\r
\r
- while(!starFound)\r
- {\r
- line = nextLine();\r
- sequence.append(line);\r
+ boolean starFound = false;\r
\r
- if (line == null)\r
- break;\r
+ while (!starFound)\r
+ {\r
+ line = nextLine();\r
+ sequence.append(line);\r
\r
- if (line.indexOf("*") > -1)\r
- {\r
- starFound = true;\r
- }\r
+ if (line == null)\r
+ {\r
+ break;\r
}\r
\r
- if (sequence.length() > 0)\r
+ if (line.indexOf("*") > -1)\r
{\r
- sequence.setLength(sequence.length() - 1);\r
- newSeq.setSequence(sequence.toString());\r
+ starFound = true;\r
+ }\r
+ }\r
\r
- seqs.addElement(newSeq);\r
+ if (sequence.length() > 0)\r
+ {\r
+ sequence.setLength(sequence.length() - 1);\r
+ newSeq.setSequence(sequence.toString());\r
\r
- md = new ModellerDescription(newSeq.\r
- getDescription());\r
- md.updateSequenceI(newSeq);\r
- }\r
+ seqs.addElement(newSeq);\r
+\r
+ md = new ModellerDescription(newSeq.\r
+ getDescription());\r
+ md.updateSequenceI(newSeq);\r
}\r
+ }\r
}\r
\r
public String print()\r
String seq = s[i].getSequenceAsString();\r
seq = seq + "*";\r
\r
-\r
if (is_NA)\r
{\r
- // modeller doesn't really do nucleotides, so we don't do anything fancy\r
- // Official tags area as follows, for now we'll use P1 and DL\r
- // Protein (complete) P1\r
- // Protein (fragment) F1\r
- // DNA (linear) Dl\r
- // DNA (circular) DC\r
- // RNA (linear) RL\r
- // RNA (circular) RC\r
- // tRNA N3\r
- // other functional RNA N1\r
+ // modeller doesn't really do nucleotides, so we don't do anything fancy\r
+ // Official tags area as follows, for now we'll use P1 and DL\r
+ // Protein (complete) P1\r
+ // Protein (fragment) F1\r
+ // DNA (linear) Dl\r
+ // DNA (circular) DC\r
+ // RNA (linear) RL\r
+ // RNA (circular) RC\r
+ // tRNA N3\r
+ // other functional RNA N1\r
\r
out.append(">N1;" + s[i].getName() + "\n");\r
if (s[i].getDescription() == null)\r
}\r
else\r
{\r
- out.append(s[i].getDescription()+"\n");\r
+ out.append(s[i].getDescription() + "\n");\r
}\r
}\r
else\r
{\r
\r
- if(useModellerOutput)\r
- {\r
- out.append(">P1;" + s[i].getName() + "\n");\r
- md = new ModellerDescription(s[i]);\r
- out.append(md.getDescriptionLine() + "\n");\r
- }\r
- else\r
- {\r
- out.append(">P1;" + printId(s[i]) + "\n");\r
- if (s[i].getDescription() != null)\r
- out.append(s[i].getDescription() + "\n");\r
- else\r
- out.append(s[i].getName() + " "\r
- + (s[i].getEnd() - s[i].getStart() + 1)\r
- + " residues\n");\r
- }\r
+ if (useModellerOutput)\r
+ {\r
+ out.append(">P1;" + s[i].getName() + "\n");\r
+ md = new ModellerDescription(s[i]);\r
+ out.append(md.getDescriptionLine() + "\n");\r
+ }\r
+ else\r
+ {\r
+ out.append(">P1;" + printId(s[i]) + "\n");\r
+ if (s[i].getDescription() != null)\r
+ {\r
+ out.append(s[i].getDescription() + "\n");\r
+ }\r
+ else\r
+ {\r
+ out.append(s[i].getName() + " "\r
+ + (s[i].getEnd() - s[i].getStart() + 1)\r
+ + " residues\n");\r
+ }\r
+ }\r
}\r
int nochunks = (seq.length() / len) + 1;\r
\r