X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2Fgff%2FGffHelperBase.java;h=1d4d3acbe8c90e25f3003dae372a2452789873e2;hb=55eef00ac2435b5cc0ee64b92ad87a915375a709;hp=48c33e5deff795985bf817080dd4a06d80c30140;hpb=604cbee405a837565ba1a74aa9bddd62aed685ab;p=jalview.git
diff --git a/src/jalview/io/gff/GffHelperBase.java b/src/jalview/io/gff/GffHelperBase.java
index 48c33e5..1d4d3ac 100644
--- a/src/jalview/io/gff/GffHelperBase.java
+++ b/src/jalview/io/gff/GffHelperBase.java
@@ -150,8 +150,8 @@ public abstract class GffHelperBase implements GffHelperI
* restrict from range to make them match up
* it's kind of arbitrary which end we truncate - here it is the end
*/
- System.err.print("Truncating mapping from " + Arrays.toString(from)
- + " to ");
+ System.err.print(
+ "Truncating mapping from " + Arrays.toString(from) + " to ");
if (from[1] > from[0])
{
from[1] -= fromOverlap / toRatio;
@@ -169,8 +169,8 @@ public abstract class GffHelperBase implements GffHelperI
/*
* restrict to range to make them match up
*/
- System.err.print("Truncating mapping to " + Arrays.toString(to)
- + " to ");
+ System.err.print(
+ "Truncating mapping to " + Arrays.toString(to) + " to ");
if (to[1] > to[0])
{
to[1] -= fromOverlap / fromRatio;
@@ -261,7 +261,8 @@ public abstract class GffHelperBase implements GffHelperI
/**
* Parses the input line to a map of name / value(s) pairs. For example the
* line
- * Notes=Fe-S;Method=manual curation, prediction; source = Pfam; Notes = Metal
+ * Notes=Fe-S;Method=manual curation, prediction; source = Pfam; Notes = Metal
+ *
* if parsed with delimiter=";" and separators {' ', '='}
* would return a map with { Notes={Fe=S, Metal}, Method={manual curation,
* prediction}, source={Pfam}}
@@ -337,6 +338,19 @@ public abstract class GffHelperBase implements GffHelperI
protected SequenceFeature buildSequenceFeature(String[] gff,
Map> attributes)
{
+ return buildSequenceFeature(gff, TYPE_COL, gff[SOURCE_COL], attributes);
+ }
+
+ /**
+ * @param gff
+ * @param typeColumn
+ * @param group
+ * @param attributes
+ * @return
+ */
+ protected SequenceFeature buildSequenceFeature(String[] gff,
+ int typeColumn, String group, Map> attributes)
+ {
try
{
int start = Integer.parseInt(gff[START_COL]);
@@ -355,8 +369,8 @@ public abstract class GffHelperBase implements GffHelperI
// e.g. '.' - leave as zero
}
- SequenceFeature sf = new SequenceFeature(gff[TYPE_COL],
- gff[SOURCE_COL], start, end, score, gff[SOURCE_COL]);
+ SequenceFeature sf = new SequenceFeature(gff[typeColumn],
+ gff[SOURCE_COL], start, end, score, group);
sf.setStrand(gff[STRAND_COL]);
@@ -375,8 +389,8 @@ public abstract class GffHelperBase implements GffHelperI
*/
for (Entry> attr : attributes.entrySet())
{
- String values = StringUtils.listToDelimitedString(
- attr.getValue(), ",");
+ String values = StringUtils.listToDelimitedString(attr.getValue(),
+ ",");
sf.setValue(attr.getKey(), values);
if (NOTE.equals(attr.getKey()))
{