1 package jalview.ext.ensembl;
3 import jalview.datamodel.SequenceFeature;
4 import jalview.io.gff.SequenceOntology;
6 import com.stevesoft.pat.Regex;
8 public class EnsemblCdna extends EnsemblSeqProxy
11 * fetch exon features on genomic sequence (to identify the cdnaregions)
12 * and cds and variation features (to retain)
14 private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
15 EnsemblFeatureType.exon, EnsemblFeatureType.cds,
16 EnsemblFeatureType.variation };
24 public String getDbName()
26 return "ENSEMBL (CDNA)";
30 protected EnsemblSeqType getSourceEnsemblType()
32 return EnsemblSeqType.CDNA;
36 public Regex getAccessionValidator()
38 return new Regex("((ENST|ENSG|CCDS)[0-9.]{3,})");
42 protected EnsemblFeatureType[] getFeaturesToFetch()
44 return FEATURES_TO_FETCH;
48 * Answers true unless the feature type is 'transcript' (or a sub-type in the
52 protected boolean retainFeature(SequenceFeature sf, String accessionId)
54 if (isTranscript(sf.getType()))
58 return featureMayBelong(sf, accessionId);
62 * Answers true if the sequence feature type is 'exon' (or a subtype of exon
63 * in the Sequence Ontology), and the Parent of the feature is the transcript
67 protected boolean identifiesSequence(SequenceFeature sf, String accId)
69 if (SequenceOntology.getInstance().isA(sf.getType(),
70 SequenceOntology.EXON))
72 String parentFeature = (String) sf.getValue(PARENT);
73 if (("transcript:" + accId).equals(parentFeature))