Color colour = ColorUtils.createColourFromName(ft);
featureColours.put(ft, new FeatureColour(colour));
}
- SequenceFeature sf = new SequenceFeature(ft, desc, "", startPos,
- endPos, featureGroup);
+ SequenceFeature sf = null;
if (gffColumns.length > 6)
{
float score = Float.NaN;
try
{
score = new Float(gffColumns[6]).floatValue();
- // update colourgradient bounds if allowed to
} catch (NumberFormatException ex)
{
- // leave as NaN
+ sf = new SequenceFeature(ft, desc, startPos, endPos, featureGroup);
}
- sf.setScore(score);
+ sf = new SequenceFeature(ft, desc, startPos, endPos, score,
+ featureGroup);
+ }
+ else
+ {
+ sf = new SequenceFeature(ft, desc, startPos, endPos, featureGroup);
}
parseDescriptionHTML(sf, removeHTML);
.toArray(new String[visible.keySet().size()]);
/*
- * sort groups alphabetically, and ensure that null group is output last
+ * sort groups alphabetically, and ensure that features with a
+ * null or empty group are output after those in named groups
*/
List<String> sortedGroups = new ArrayList<String>(visibleFeatureGroups);
sortedGroups.remove(null);
+ sortedGroups.remove("");
Collections.sort(sortedGroups);
sortedGroups.add(null);
+ sortedGroups.add("");
boolean foundSome = false;
for (String group : sortedGroups)
{
- if (group != null)
+ boolean isNamedGroup = (group != null && !"".equals(group));
+ if (isNamedGroup)
{
out.append(newline);
out.append("STARTGROUP").append(TAB);
}
}
- if (group != null)
+ if (isNamedGroup)
{
out.append("ENDGROUP").append(TAB);
out.append(group);