/*\r
* Jalview - A Sequence Alignment Editor and Viewer\r
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+* Copyright (C) 2006 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
{\r
}\r
\r
- /**\r
- * Creates a new BLCFile object.\r
- *\r
- * @param inStr DOCUMENT ME!\r
- */\r
- public BLCFile(String inStr)\r
- {\r
- super(inStr);\r
- }\r
\r
/**\r
* Creates a new BLCFile object.\r
/**\r
* DOCUMENT ME!\r
*/\r
- public void parse()\r
+ public void parse() throws IOException\r
{\r
boolean idsFound = false;\r
Vector ids = new Vector();\r
\r
String line = null;\r
\r
- try\r
- {\r
do\r
{\r
line = nextLine();\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
+ Sequence newSeq = new Sequence(ids.elementAt(i).toString(),\r
+ seqstrings[i].toString(),\r
+ Integer.parseInt(starts.elementAt(i).\r
+ toString()),\r
+ Integer.parseInt(ends.elementAt(i).toString()));\r
+\r
+ if (!isValidProteinSequence(newSeq.getSequence()))\r
+ {\r
+ throw new IOException(AppletFormatAdapter.INVALID_CHARACTERS\r
+ +" : "+ newSeq.getName()\r
+ +" : "+invalidCharacter);\r
+\r
+ }\r
+\r
seqs.addElement(newSeq);\r
}\r
- }\r
- catch (Exception ex)\r
- {\r
- ex.printStackTrace();\r
- }\r
+\r
}\r
\r
/**\r
{\r
out.append(">" + printId(s[i]) +"\n");\r
\r
- if (s[i].getSequence().length() > max)\r
+ if (s[i].getSequence().length > max)\r
{\r
- max = s[i].getSequence().length();\r
+ max = s[i].getSequence().length;\r
}\r
\r
i++;\r
\r
while ((i < s.length) && (s[i] != null))\r
{\r
- if (s[i].getSequence().length() > j)\r
+ if (s[i].getSequence().length > j)\r
{\r
- out.append(s[i].getSequence().substring(j, j + 1));\r
+ out.append(s[i].getSequenceAsString(j, j + 1));\r
}\r
else\r
{\r