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