sfs = sequence.getFeatures()
+ .getFeaturesByOntology(term);
+ for (SequenceFeature sf : sfs)
+ {
+ String parent = (String) sf.getValue(PARENT);
+ if (parent != null && parent.equalsIgnoreCase(parentId))
+ {
+ result.add(sf);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Answers true if the feature type is either 'NMD_transcript_variant' or
+ * 'transcript' (or one of its sub-types in the Sequence Ontology). This is
+ * because NMD_transcript_variant behaves like 'transcript' in Ensembl
+ * although strictly speaking it is not (it is a sub-type of
+ * sequence_variant).
+ *
+ * (This test was needed when fetching transcript features as GFF. As we are
+ * now fetching as JSON, all features have type 'transcript' so the check for
+ * NMD_transcript_variant is redundant. Left in for any future case arising.)
+ *
+ * @param featureType
+ * @return
+ */
+ public static boolean isTranscript(String featureType)
{
- return 0;
+ return SequenceOntologyI.NMD_TRANSCRIPT_VARIANT.equals(featureType)
+ || SequenceOntologyFactory.getInstance().isA(featureType,
+ SequenceOntologyI.TRANSCRIPT);
}
}