if (space > -1)
{
seq = new Sequence(id.substring(0, space), "");
- seq.setDescription(id.substring(space + 1));
+ String desc = id.substring(space + 1);
+ seq.setDescription(desc);
+
+ if (desc.startsWith("chromosome"))
+ {
+ /*
+ * parse Ensembl style gene description e.g.
+ * chromosome:GRCh38:7:140696688:140721955:1
+ */
+ String[] tokens = desc.split(":");
+ if (tokens.length > 3)
+ {
+ try
+ {
+ seq.setStart(Integer.parseInt(tokens[3]));
+ } catch (NumberFormatException e)
+ {
+ // ignore
+ }
+ }
+ }
}
else
{