+ * @param parentId
+ * @return
+ */
+ protected List<SequenceFeature> findFeatures(SequenceI sequence,
+ String type, String parentId)
+ {
+ List<SequenceFeature> result = new ArrayList<SequenceFeature>();
+
+ SequenceFeature[] sfs = sequence.getSequenceFeatures();
+ if (sfs != null) {
+ SequenceOntologyI so = SequenceOntologyFactory.getInstance();
+ for (SequenceFeature sf :sfs) {
+ if (so.isA(sf.getType(), type))
+ {
+ String parent = (String) sf.getValue(PARENT);
+ if (parent.equals(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
+ * needed because NMD_transcript_variant behaves like 'transcript' in Ensembl
+ * although strictly speaking it is not (it is a sub-type of
+ * sequence_variant).
+ *
+ * @param featureType