*/
public class EnsemblLookup extends EnsemblRestClient
{
+
+ private static final String OBJECT_TYPE_TRANSLATION = "Translation";
+ private static final String PARENT = "Parent";
+ private static final String OBJECT_TYPE_TRANSCRIPT = "Transcript";
+ private static final String ID = "id";
+ private static final String OBJECT_TYPE_GENE = "Gene";
+ private static final String OBJECT_TYPE = "object_type";
+
++ /**
++ * keep track of last identifier retrieved to break loops
++ */
+ private String lastId;
+
/**
* Default constructor (to use rest.ensembl.org)
*/
BufferedReader br = null;
try
{
- URL url = getUrl(identifier);
++
+ URL url = getUrl(identifier, objectType);
++
+ if (identifier.equals(lastId))
+ {
+ System.err.println("** Ensembl lookup " + url.toString()
+ + " looping on Parent!");
+ return null;
+ }
++
+ lastId = identifier;
++
if (url != null)
{
br = getHttpResponse(url, ids);
"(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 final String ensemblGenomesDomain;
- protected static final String ENSEMBL_REST = "http://rest.ensembl.org";
+ protected final String ensemblDomain;
+ protected static final String OBJECT_TYPE_TRANSLATION = "Translation";
+
+ protected static final String OBJECT_TYPE_TRANSCRIPT = "Transcript";
+
+ protected static final String OBJECT_TYPE_GENE = "Gene";
+
+ protected static final String PARENT = "Parent";
+
+ protected static final String ID = "id";
+
+ protected static final String OBJECT_TYPE = "object_type";
+
/*
* possible values for the 'feature' parameter of the /overlap REST service
* @see http://rest.ensembl.org/documentation/info/overlap_id