gff parsing when no start or end position is defined.
[jalview.git] / src / jalview / io / FeaturesFile.java
index 6b9ee67..78e796e 100755 (executable)
@@ -25,9 +25,11 @@ import jalview.datamodel.*;
 import jalview.schemes.*;\r
 \r
 /**\r
- * DOCUMENT ME!\r
- *\r
- * @author $author$\r
+ * Parse and create Jalview Features files\r
+ * Detects GFF format features files and parses.\r
+ * Does not implement standard print() - call specific printFeatures or printGFF.\r
+ * Uses AlignmentI.findSequence(String id) to find the sequence object for the features annotation - this normally works on an exact match.\r
+ * @author AMW\r
  * @version $Revision$\r
  */\r
 public class FeaturesFile\r
@@ -156,8 +158,19 @@ public class FeaturesFile
             {\r
               desc = st.nextToken();\r
               type = st.nextToken();\r
+              try {\r
               start = Integer.parseInt(st.nextToken());\r
-              end = Integer.parseInt(st.nextToken());\r
+              } catch (NumberFormatException ex)\r
+              {\r
+                start=0;\r
+              }\r
+              try {\r
+                end = Integer.parseInt(st.nextToken());\r
+              }\r
+              catch (NumberFormatException ex)\r
+              {\r
+                end=-1;\r
+              } \r
               try\r
               {\r
                 score = new Float(st.nextToken()).floatValue();\r
@@ -265,6 +278,7 @@ public class FeaturesFile
     {\r
       System.out.println(line);\r
       System.out.println("Error parsing feature file: " + ex + "\n" + line);\r
+      ex.printStackTrace(System.err);\r
       return false;\r
     }\r
 \r