Report invalid chars
[jalview.git] / src / jalview / io / FastaFile.java
index 37c96f6..2e203af 100755 (executable)
@@ -82,6 +82,13 @@ public class FastaFile extends AlignFile
                 {\r
                     if (count != 0)\r
                     {\r
+                      if (!isValidProteinSequence(sb.toString()))\r
+                      {\r
+                        throw new IOException(AppletFormatAdapter.INVALID_CHARACTERS\r
+                                              +" : "+seq.getName()\r
+                                              +" : "+invalidCharacter);\r
+                      }\r
+\r
                        seq.setSequence(sb.toString());\r
                        seqs.addElement(seq);\r
                     }\r
@@ -100,9 +107,11 @@ public class FastaFile extends AlignFile
 \r
         if (count > 0)\r
         {\r
-            if (!isValidProteinSequence(sb.toString().toUpperCase()))\r
+            if (!isValidProteinSequence(sb.toString()))\r
             {\r
-                throw new IOException("Invalid protein sequence");\r
+                throw new IOException(AppletFormatAdapter.INVALID_CHARACTERS\r
+                                      +" : "+seq.getName()\r
+                                      +" : "+invalidCharacter);\r
             }\r
 \r
             seq.setSequence(sb.toString());\r