1 package jalview.ext.ensembl;
3 import jalview.datamodel.SequenceFeature;
4 import jalview.io.gff.SequenceOntology;
6 public class EnsemblCds extends EnsemblSeqProxy
9 * fetch cds features on genomic sequence (to identify the CDS regions)
10 * and variation features (to retain)
12 private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
13 EnsemblFeatureType.cds, EnsemblFeatureType.variation };
24 public String getDbName()
26 return "ENSEMBL (CDS)";
30 protected EnsemblSeqType getSourceEnsemblType()
32 return EnsemblSeqType.CDS;
36 protected EnsemblFeatureType[] getFeaturesToFetch()
38 return FEATURES_TO_FETCH;
42 * Answers true unless the feature type is 'CDS' (or a sub-type of CDS in the
43 * Sequence Ontology). CDS features are only retrieved in order to identify
44 * the cds sequence range, and are redundant information on the cds sequence
48 protected boolean retainFeature(SequenceFeature sf, String accessionId)
50 if (SequenceOntology.getInstance().isA(sf.getType(),
51 SequenceOntology.CDS))
55 return featureMayBelong(sf, accessionId);
59 * Answers true if the sequence feature type is 'CDS' (or a subtype of CDS in
60 * the Sequence Ontology), and the Parent of the feature is the transcript we
64 protected boolean identifiesSequence(SequenceFeature sf, String accId)
66 if (SequenceOntology.getInstance().isA(sf.getType(),
67 SequenceOntology.CDS))
69 String parentFeature = (String) sf.getValue(PARENT);
70 if (("transcript:" + accId).equals(parentFeature))