1 package jalview.ext.ensembl;
3 import jalview.datamodel.SequenceFeature;
4 import jalview.io.gff.SequenceOntologyFactory;
5 import jalview.io.gff.SequenceOntologyI;
9 import com.stevesoft.pat.Regex;
11 public class EnsemblCdna extends EnsemblSeqProxy
14 * fetch exon features on genomic sequence (to identify the cdnaregions)
15 * and cds and variation features (to retain)
17 private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
18 EnsemblFeatureType.exon, EnsemblFeatureType.cds,
19 EnsemblFeatureType.variation };
27 public String getDbName()
29 return "ENSEMBL (CDNA)";
33 protected EnsemblSeqType getSourceEnsemblType()
35 return EnsemblSeqType.CDNA;
39 public Regex getAccessionValidator()
41 return new Regex("((ENST|ENSG|CCDS)[0-9.]{3,})");
45 protected EnsemblFeatureType[] getFeaturesToFetch()
47 return FEATURES_TO_FETCH;
51 * Answers true unless the feature type is 'transcript' (or a sub-type in the
55 protected boolean retainFeature(SequenceFeature sf, String accessionId)
57 if (isTranscript(sf.getType()))
61 return featureMayBelong(sf, accessionId);
65 * Answers true if the sequence feature type is 'exon' (or a subtype of exon
66 * in the Sequence Ontology), and the Parent of the feature is the transcript
70 protected boolean identifiesSequence(SequenceFeature sf, String accId)
72 if (SequenceOntologyFactory.getInstance().isA(sf.getType(),
73 SequenceOntologyI.EXON))
75 String parentFeature = (String) sf.getValue(PARENT);
76 if (("transcript:" + accId).equals(parentFeature))
85 protected List<String> getCrossReferenceDatabases()
87 return super.getCrossReferenceDatabases();
88 // 30/01/16 also found Vega_transcript, OTTT, ENS_LRG_transcript, UCSC,
89 // HGNC_trans_name, RefSeq_mRNA, RefSeq_mRNA_predicted