From: Jim Procter Date: Fri, 23 Feb 2018 16:01:42 +0000 (+0000) Subject: Merge branch 'features/JAL-2885UniprotHttps' into releases/Release_2_10_4_Branch X-Git-Tag: Release_2_10_4~58 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d7e95f458ebcbbdcc13f8b07357542ab2d7e4547;p=jalview.git Merge branch 'features/JAL-2885UniprotHttps' into releases/Release_2_10_4_Branch --- d7e95f458ebcbbdcc13f8b07357542ab2d7e4547 diff --cc src/jalview/ext/ensembl/EnsemblLookup.java index 92763a1,f31a3f0..0ddef2b --- a/src/jalview/ext/ensembl/EnsemblLookup.java +++ b/src/jalview/ext/ensembl/EnsemblLookup.java @@@ -41,6 -41,17 +41,19 @@@ import org.json.simple.parser.ParseExce */ 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) */ @@@ -150,7 -138,14 +163,18 @@@ 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); diff --cc src/jalview/ext/ensembl/EnsemblSequenceFetcher.java index c4abb20,eb1d399..0aaaf93 --- a/src/jalview/ext/ensembl/EnsemblSequenceFetcher.java +++ b/src/jalview/ext/ensembl/EnsemblSequenceFetcher.java @@@ -41,22 -52,10 +52,22 @@@ abstract class EnsemblSequenceFetcher e "(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