package jalview.ext.ensembl; import jalview.datamodel.DBRefSource; import jalview.ws.seqfetcher.DbSourceProxyImpl; import com.stevesoft.pat.Regex; /** * A base class for Ensembl sequence fetchers * * @author gmcarstairs * */ public abstract class EnsemblSequenceFetcher extends DbSourceProxyImpl { /* * possible values for the 'feature' parameter of the REST overlap endpoint * @see */ protected enum EnsemblFeatureType { gene, transcript, cds, exon, repeat, simple, misc, variation, somatic_variation, structural_variation, somatic_structural_variation, constrained, regulatory } @Override public String getDbSource() { // NB ensure Uniprot xrefs are canonicalised from "Ensembl" to "ENSEMBL" return DBRefSource.ENSEMBL; // "ENSEMBL" } @Override public String getDbVersion() { return "0"; } @Override public String getAccessionSeparator() { return " "; } @Override public Regex getAccessionValidator() { return new Regex("((ENSP|ENST|ENSG|CCDS)[0-9.]{3,})"); } @Override public boolean isValidReference(String accession) { return getAccessionValidator().search(accession); } @Override public int getTier() { return 0; } /** * Default test query is a transcript */ @Override public String getTestQuery() { // has CDS on reverse strand: return "ENST00000288602"; // ENST00000461457 // forward strand } @Override public boolean isDnaCoding() { return true; } }