+
+ SequenceOntologyI so = SequenceOntologyFactory.getInstance();
+ String type = sf.getType();
+ if (so.isA(type, SequenceOntologyI.SEQUENCE_VARIANT))
+ {
+ /*
+ * Ensembl returns dna variants as 'alleles'
+ */
+ desc = StringUtils.listToDelimitedString(attributes.get(ALLELES),
+ ",");
+ }
+
+ /*
+ * extract 'Name' for a transcript (to show gene name)
+ * or an exon (so 'colour by label' shows exon boundaries)
+ */
+ if (SequenceOntologyI.NMD_TRANSCRIPT_VARIANT.equals(type)
+ || so.isA(type, SequenceOntologyI.TRANSCRIPT)
+ || so.isA(type, SequenceOntologyI.EXON))
+ {
+ desc = StringUtils.listToDelimitedString(attributes.get("Name"), ",");
+ }
+
+ /*
+ * if the above fails, try ID
+ */
+ if (desc == null)
+ {
+ desc = (String) sf.getValue(ID);
+ }
+
+ /*
+ * and decode comma, equals, semi-colon as required by GFF3 spec
+ */
+ desc = StringUtils.urlDecode(desc, GFF_ENCODABLE);
+
+ return desc;