jnet file is 1 to 1 mapping
[jalview.git] / src / jalview / io / BLCFile.java
index a7cc1ea..ceeac64 100755 (executable)
@@ -1,6 +1,6 @@
 /*\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
@@ -42,15 +42,6 @@ public class BLCFile extends AlignFile
     {\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
@@ -77,7 +68,7 @@ public class BLCFile extends AlignFile
     /**\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
@@ -87,8 +78,6 @@ public class BLCFile extends AlignFile
 \r
         String line = null;\r
 \r
-        try\r
-        {\r
             do\r
             {\r
                 line = nextLine();\r
@@ -146,17 +135,23 @@ public class BLCFile extends AlignFile
 \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