1 package jalview.ext.ensembl;
3 import jalview.datamodel.DBRefSource;
4 import jalview.ws.seqfetcher.DbSourceProxyImpl;
6 import com.stevesoft.pat.Regex;
9 * A base class for Ensembl sequence fetchers
13 abstract class EnsemblSequenceFetcher extends DbSourceProxyImpl
15 // TODO modify to accept other species e.g. ENSMUSTnnn
16 private static final Regex ACCESSION_REGEX = new Regex("((ENSP|ENST|ENSG|CCDS)[0-9.]{3,})");
19 * possible values for the 'feature' parameter of the /overlap REST service
20 * @see http://rest.ensembl.org/documentation/info/overlap_id
22 protected enum EnsemblFeatureType
24 gene, transcript, cds, exon, repeat, simple, misc, variation,
25 somatic_variation, structural_variation, somatic_structural_variation,
26 constrained, regulatory
30 public String getDbSource()
32 // NB ensure Uniprot xrefs are canonicalised from "Ensembl" to "ENSEMBL"
33 return DBRefSource.ENSEMBL; // "ENSEMBL"
37 public String getDbVersion()
43 public String getAccessionSeparator()
49 * Ensembl accession are ENST + 11 digits for human transcript, ENSG for human
50 * gene. Other species insert 3 letters e.g. ENSMUST..., ENSMUSG...
52 * @see http://www.ensembl.org/Help/View?id=151
55 public Regex getAccessionValidator()
57 return ACCESSION_REGEX;
61 public boolean isValidReference(String accession)
63 return getAccessionValidator().search(accession);
73 * Default test query is a transcript
76 public String getTestQuery()
78 // has CDS on reverse strand:
79 return "ENST00000288602";
80 // ENST00000461457 // forward strand
84 public boolean isDnaCoding()