1 package jalview.ext.ensembl;
3 import jalview.datamodel.SequenceFeature;
4 import jalview.io.gff.SequenceOntology;
8 import com.stevesoft.pat.Regex;
10 public class EnsemblCdna extends EnsemblSeqProxy
13 * fetch exon features on genomic sequence (to identify the cdnaregions)
14 * and cds and variation features (to retain)
16 private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
17 EnsemblFeatureType.exon, EnsemblFeatureType.cds,
18 EnsemblFeatureType.variation };
26 public String getDbName()
28 return "ENSEMBL (CDNA)";
32 protected EnsemblSeqType getSourceEnsemblType()
34 return EnsemblSeqType.CDNA;
38 public Regex getAccessionValidator()
40 return new Regex("((ENST|ENSG|CCDS)[0-9.]{3,})");
44 protected EnsemblFeatureType[] getFeaturesToFetch()
46 return FEATURES_TO_FETCH;
50 * Answers true unless the feature type is 'transcript' (or a sub-type in the
54 protected boolean retainFeature(SequenceFeature sf, String accessionId)
56 if (isTranscript(sf.getType()))
60 return featureMayBelong(sf, accessionId);
64 * Answers true if the sequence feature type is 'exon' (or a subtype of exon
65 * in the Sequence Ontology), and the Parent of the feature is the transcript
69 protected boolean identifiesSequence(SequenceFeature sf, String accId)
71 if (SequenceOntology.getInstance().isA(sf.getType(),
72 SequenceOntology.EXON))
74 String parentFeature = (String) sf.getValue(PARENT);
75 if (("transcript:" + accId).equals(parentFeature))
84 protected List<String> getCrossReferenceDatabases()
86 return super.getCrossReferenceDatabases();
87 // 30/01/16 also found Vega_transcript, OTTT, ENS_LRG_transcript, UCSC,
88 // HGNC_trans_name, RefSeq_mRNA, RefSeq_mRNA_predicted