*/
abstract class EnsemblSequenceFetcher extends DbSourceProxyImpl
{
- // TODO modify to accept other species e.g. ENSMUSTnnn
- private static final Regex ACCESSION_REGEX = new Regex("((ENSP|ENST|ENSG|CCDS)[0-9.]{3,})");
+ /*
+ * accepts ENSG/T/E/P with 11 digits
+ * or ENSMUSP or similar for other species
+ * or CCDSnnnnn.nn with at least 3 digits
+ */
+ private static final Regex ACCESSION_REGEX = new Regex(
+ "(ENS([A-Z]{3}|)[GTEP]{1}[0-9]{11}$)" + "|" + "(CCDS[0-9.]{3,}$)");
+
+ protected static final String ENSEMBL_GENOMES_REST = "http://rest.ensemblgenomes.org";
+
+ protected static final String ENSEMBL_REST = "http://rest.ensembl.org";
/*
* possible values for the 'feature' parameter of the /overlap REST service
constrained, regulatory
}
+ private String domain = ENSEMBL_REST;
+
@Override
public String getDbSource()
{
// NB ensure Uniprot xrefs are canonicalised from "Ensembl" to "ENSEMBL"
- return DBRefSource.ENSEMBL; // "ENSEMBL"
- }
-
- @Override
- public String getDbVersion()
- {
- return "0";
+ if (ENSEMBL_GENOMES_REST.equals(getDomain()))
+ {
+ return DBRefSource.ENSEMBLGENOMES;
+ }
+ return DBRefSource.ENSEMBL;
}
@Override
{
return true;
}
+
+ /**
+ * Returns the domain name to query e.g. http://rest.ensembl.org or
+ * http://rest.ensemblgenomes.org
+ *
+ * @return
+ */
+ protected String getDomain()
+ {
+ return domain;
+ }
+
+ protected void setDomain(String d)
+ {
+ domain = d;
+ }
}