public class FeaturesFile extends AlignFile\r
{\r
/**\r
+ * work around for GFF interpretation bug where source string becomes description rather than a group\r
+ */\r
+ private boolean doGffSource = true;\r
+\r
+ /**\r
* Creates a new FeaturesFile object.\r
*/\r
public FeaturesFile()\r
if (seq != null)\r
{\r
desc = st.nextToken();\r
+ String group=null;\r
+ if (doGffSource && desc.indexOf(' ')==-1) {\r
+ // could also be a source term rather than description line\r
+ group = new String(desc);\r
+ }\r
type = st.nextToken();\r
try\r
{\r
- start = Integer.parseInt(st.nextToken());\r
+ String stt = st.nextToken();\r
+ if (stt.length()==0 || stt.equals("-"))\r
+ {\r
+ start = 0;\r
+ } else {\r
+ start = Integer.parseInt(stt);\r
+ }\r
} catch (NumberFormatException ex)\r
{\r
start = 0;\r
}\r
try\r
{\r
- end = Integer.parseInt(st.nextToken());\r
+ String stt = st.nextToken();\r
+ if (stt.length()==0 || stt.equals("-"))\r
+ {\r
+ end = -1;\r
+ } else {\r
+ end = Integer.parseInt(stt);\r
+ }\r
} catch (NumberFormatException ex)\r
{\r
end = -1;\r
score = 0;\r
}\r
\r
- sf = new SequenceFeature(type, desc, start, end, score, null);\r
+ sf = new SequenceFeature(type, desc, start, end, score, group);\r
\r
try\r
{\r