From: Jim Procter Date: Wed, 9 Aug 2017 19:00:09 +0000 (+0100) Subject: Merge commit '326d48e' into HEAD X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Ffeatures%2FJAL-2253ensemblGenomes;p=jalview.git Merge commit '326d48e' into HEAD --- b342c421914723ac1b3403280cb8bc346011326e diff --cc src/jalview/ext/ensembl/EnsemblGene.java index 37c787b,902f745..84a0824 --- a/src/jalview/ext/ensembl/EnsemblGene.java +++ b/src/jalview/ext/ensembl/EnsemblGene.java @@@ -190,35 -183,19 +183,39 @@@ public class EnsemblGene extends Ensemb geneIds.add(geneId); } } + else if (isProteinIdentifier(acc)) + { + String tscriptId = new EnsemblLookup(getDomain()).getParent(acc); + if (tscriptId != null) + { + String geneId = new EnsemblLookup(getDomain()) + .getParent(tscriptId); + + if (geneId != null && !geneIds.contains(geneId)) + { + geneIds.add(geneId); + } + } + // NOTE - acc is lost if it resembles an ENS.+ ID but isn't actually + // resolving to one... e.g. ENSMICP00000009241 + } + /* + * if given a gene or other external name, lookup and fetch + * the corresponding gene for all model organisms + */ else { + /* + * if given a gene or other external name, lookup and fetch + * the corresponding gene for all model organisms + */ List ids = new EnsemblSymbol(getDomain(), getDbSource(), - getDbVersion()).getIds(acc); - for (String geneId : ids) + getDbVersion()).getGeneIds(acc); + for (String id : ids) { - if (!geneIds.contains(geneId)) + if (!geneIds.contains(id)) { - geneIds.add(geneId); + geneIds.add(id); } } } diff --cc src/jalview/ext/ensembl/EnsemblRestClient.java index 2437588,e315dc1..4c4ba76 --- a/src/jalview/ext/ensembl/EnsemblRestClient.java +++ b/src/jalview/ext/ensembl/EnsemblRestClient.java @@@ -114,42 -102,6 +112,43 @@@ abstract class EnsemblRestClient extend setDomain(d); } ++<<<<<<< HEAD + /** + * Answers true if the query matches the regular expression pattern for an + * Ensembl transcript stable identifier + * + * @param query + * @return + */ + public boolean isTranscriptIdentifier(String query) + { + return query == null ? false : TRANSCRIPT_REGEX.search(query); + } + + /** + * Answers true if the query matches the regular expression pattern for an + * Ensembl protein stable identifier + * + * @param query + * @return + */ + public boolean isProteinIdentifier(String query) + { + return query == null ? false : PROTEIN_REGEX.search(query); + } + + /** + * Answers true if the query matches the regular expression pattern for an + * Ensembl gene stable identifier + * + * @param query + * @return + */ + public boolean isGeneIdentifier(String query) + { + return query == null ? false : GENE_REGEX.search(query); + } + @Override public boolean queryInProgress() {