1 package jalview.io.gff;
3 import jalview.datamodel.AlignmentI;
4 import jalview.datamodel.SequenceFeature;
5 import jalview.datamodel.SequenceI;
7 import java.io.IOException;
11 public class Gff2Helper extends GffHelperBase
14 * GFF2 uses space character to delimit name/value pairs on column 9
19 public static Map<String, List<String>> parseNameValuePairs(String text)
21 // TODO: can a value include a comma? if so it will be broken by this
22 return parseNameValuePairs(text, ";", ' ', ",");
26 * Return ' ' as the name-value separator used in column 9 attributes.
29 protected char getNameValueSeparator()
35 * Default processing if not overridden is just to construct a sequence
39 public SequenceFeature processGff(SequenceI seq, String[] gff,
40 AlignmentI align, List<SequenceI> newseqs,
41 boolean relaxedIdMatching) throws IOException
43 Map<String, List<String>> attributes = null;
44 if (gff.length > ATTRIBUTES_COL)
46 attributes = parseNameValuePairs(gff[ATTRIBUTES_COL]);
48 return buildSequenceFeature(gff, attributes);