package jalview.ext.ensembl;
-import jalview.ext.ensembl.SeqFetcher.EnsemblSeqType;
+import jalview.datamodel.SequenceFeature;
+import jalview.io.gff.SequenceOntology;
import com.stevesoft.pat.Regex;
public class EnsemblCdna extends EnsemblSeqProxy
{
+ /*
+ * fetch exon features on genomic sequence (to identify the cdnaregions)
+ * and cds and variation features (to retain)
+ */
+ private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
+ EnsemblFeatureType.exon, EnsemblFeatureType.cds,
+ EnsemblFeatureType.variation };
public EnsemblCdna()
{
}
@Override
- public String getTestQuery()
+ protected EnsemblFeatureType[] getFeaturesToFetch()
{
- return "ENST00000288602";
+ return FEATURES_TO_FETCH;
+ }
+
+ /**
+ * Answers true unless the feature type is 'exon' (or a sub-type of exon in
+ * the Sequence Ontology). Exon features are only retrieved in order to
+ * identify the exon sequence range, and are redundant information on the exon
+ * sequence itself.
+ */
+ @Override
+ protected boolean retainFeature(String type)
+ {
+ return !SequenceOntology.getInstance().isA(type, SequenceOntology.EXON);
+ }
+
+ /**
+ * Answers true if the sequence feature type is 'exon' (or a subtype of exon
+ * in the Sequence Ontology), and the Parent of the feature is the transcript
+ * we are retrieving
+ */
+ @Override
+ protected boolean identifiesSequence(SequenceFeature sf, String accId)
+ {
+ if (SequenceOntology.getInstance().isA(sf.getType(),
+ SequenceOntology.EXON))
+ {
+ String parentFeature = (String) sf.getValue("Parent");
+ if (("transcript:" + accId).equals(parentFeature))
+ {
+ return true;
+ }
+ }
+ return false;
}
}