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 * accepts ENST or ENSTG with 11 digits
15 * or ENSMUST or similar for other species
16 * or CCDSnnnnn.nn with at least 3 digits
18 private static final Regex ACCESSION_REGEX = new Regex(
19 "(ENS([A-Z]{3}|)[TG][0-9]{11}$)" + "|" + "(CCDS[0-9.]{3,}$)");
22 * fetch exon features on genomic sequence (to identify the cdna regions)
23 * and cds and variation features (to retain)
25 private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
26 EnsemblFeatureType.exon, EnsemblFeatureType.cds,
27 EnsemblFeatureType.variation };
35 public String getDbName()
37 return "ENSEMBL (CDNA)";
41 protected EnsemblSeqType getSourceEnsemblType()
43 return EnsemblSeqType.CDNA;
47 public Regex getAccessionValidator()
49 return ACCESSION_REGEX;
53 protected EnsemblFeatureType[] getFeaturesToFetch()
55 return FEATURES_TO_FETCH;
59 * Answers true unless the feature type is 'transcript' (or a sub-type in the
63 protected boolean retainFeature(SequenceFeature sf, String accessionId)
65 if (isTranscript(sf.getType()))
69 return featureMayBelong(sf, accessionId);
73 * Answers true if the sequence feature type is 'exon' (or a subtype of exon
74 * in the Sequence Ontology), and the Parent of the feature is the transcript
78 protected boolean identifiesSequence(SequenceFeature sf, String accId)
80 if (SequenceOntologyFactory.getInstance().isA(sf.getType(),
81 SequenceOntologyI.EXON))
83 String parentFeature = (String) sf.getValue(PARENT);
84 if (("transcript:" + accId).equals(parentFeature))
93 protected List<String> getCrossReferenceDatabases()
95 return super.getCrossReferenceDatabases();
96 // 30/01/16 also found Vega_transcript, OTTT, ENS_LRG_transcript, UCSC,
97 // HGNC_trans_name, RefSeq_mRNA, RefSeq_mRNA_predicted