Any character non aa or nucleotide is a space
[jalview.git] / src / jalview / io / FastaFile.java
index d5a6a66..684f867 100755 (executable)
@@ -33,6 +33,13 @@ import java.util.*;
  */\r
 public class FastaFile extends AlignFile\r
 {\r
+  /**\r
+   * Length of a sequence line\r
+   */\r
+  int len = 72;\r
+\r
+  StringBuffer out;\r
+\r
     /**\r
      * Creates a new FastaFile object.\r
      */\r
@@ -93,20 +100,12 @@ public class FastaFile extends AlignFile
 \r
                       annotations.addElement(aa);\r
                     }\r
-                    annotation = true;\r
                   }\r
                   else\r
                     annotation = false;\r
 \r
                     if (!firstLine)\r
                     {\r
-                      if (!annotation && !isValidProteinSequence(sb.toString().toCharArray()))\r
-                      {\r
-                        throw new IOException(AppletFormatAdapter.INVALID_CHARACTERS\r
-                                              +" : "+seq.getName()\r
-                                              +" : "+invalidCharacter);\r
-                      }\r
-\r
                        seq.setSequence(sb.toString());\r
 \r
                        if (!annotation)\r
@@ -117,6 +116,9 @@ public class FastaFile extends AlignFile
                     firstLine = false;\r
 \r
                     sb = new StringBuffer();\r
+\r
+                    if (line.startsWith(">#_"))\r
+                      annotation = true;\r
                 }\r
                 else\r
                 {\r
@@ -144,20 +146,11 @@ public class FastaFile extends AlignFile
 \r
         else if (!firstLine)\r
         {\r
-\r
-            if (!isValidProteinSequence(sb.toString().toCharArray()))\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
     }\r
 \r
-\r
     /**\r
      * DOCUMENT ME!\r
      *\r
@@ -170,8 +163,7 @@ public class FastaFile extends AlignFile
      */\r
     public String print(SequenceI[] s)\r
     {\r
-        int len = 72;\r
-        StringBuffer out = new StringBuffer();\r
+        out = new StringBuffer();\r
         int i = 0;\r
 \r
         while ((i < s.length) && (s[i] != null))\r