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 exon and variation features (to retain for display)
12 private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
13 EnsemblFeatureType.cds, EnsemblFeatureType.exon,
14 EnsemblFeatureType.variation };
25 public String getDbName()
27 return "ENSEMBL (CDS)";
31 protected EnsemblSeqType getSourceEnsemblType()
33 return EnsemblSeqType.CDS;
37 protected EnsemblFeatureType[] getFeaturesToFetch()
39 return FEATURES_TO_FETCH;
43 * Answers true unless the feature type is 'CDS' (or a sub-type of CDS in the
44 * Sequence Ontology). CDS features are only retrieved in order to identify
45 * the cds sequence range, and are redundant information on the cds sequence
49 protected boolean retainFeature(SequenceFeature sf, String accessionId)
51 if (SequenceOntology.getInstance().isA(sf.getType(),
52 SequenceOntology.CDS))
56 return featureMayBelong(sf, accessionId);
60 * Answers true if the sequence feature type is 'CDS' (or a subtype of CDS in
61 * the Sequence Ontology), and the Parent of the feature is the transcript we
65 protected boolean identifiesSequence(SequenceFeature sf, String accId)
67 if (SequenceOntology.getInstance().isA(sf.getType(),
68 SequenceOntology.CDS))
70 String parentFeature = (String) sf.getValue(PARENT);
71 if (("transcript:" + accId).equals(parentFeature))