[ensembl-dev] REST API 'or' question

Andy Yates ayates at ebi.ac.uk
Tue Nov 5 11:05:32 GMT 2013


Hi,

Firstly I got my target_taxon and target_species mixed up. taxon should just be the taxon id and species should just be a species alias (as you seem to have figured out). Sorry about that. Secondly both parameters are meant to support being used more than once. I don't know why this is not working as expected but I will investigate now and get back to you once we've figured it out.

Andy

On 5 Nov 2013, at 10:55, Matthias Ziehm <matthias.ziehm at ebi.ac.uk> wrote:

> Hi Andy,
> 
> Thanks for the quick answer. There URL you provided does only give the mouse orthologue which since target_taxon requires the taxonID not name. Using:
> http://beta.rest.ensembl.org/homology/id/ENSG00000157764.json?target_taxon=10090;target_species=cow;type=orthologues
> Gives indeed both mouse and cow orthologues, however using two target_taxon entries:
> http://beta.rest.ensembl.org/homology/id/ENSG00000157764.json?target_taxon=10090;target_taxon=9913;type=orthologues
> results in only the ortholgues of the first (in this case mouse).
> Same for two target_species entries.
> http://beta.rest.ensembl.org/homology/id/ENSG00000157764.json?target_species=mouse;target_species=cow;type=orthologues
> 
> So to me it looks like I can't add multiple entries, but exploiting two different parameters trick the system into an 'or'.
> 
> Best,
> Matthias
> 
> On 05/11/2013 10:40, Andy Yates wrote:
>> Hi Matthias,
>> 
>> I've cc'd in the ensembl dev mailing list as hopefully my answer will help others with the same question. The REST homology endpoint allows you to specify more than one target taxon to provide the kind of query you want e.g.
>> 
>> http://beta.rest.ensembl.org/homology/id/ENSG00000157764.json?target_taxon=10090;target_taxon=cow;type=orthologues
>> 
>> This will return the orthologues of human BRAF in mouse and cow in JSON. You can add as many target_taxon attributes as you need. One disadvantage of the REST API is that it is not a batch download system. Should you want all orthologues of human to mouse & cow you would be better served by BioMart.
>> 
>> Hope this helps,
>> 
>> Andy
>> 
>> ------------
>> Andrew Yates - Ensembl Core Software Project Leader
>> European Bioinformatics Institute (EMBL-EBI)
>> European Molecular Biology Laboratory
>> Wellcome Trust Genome Campus
>> Hinxton
>> Cambridge CB10 1SD
>> Tel: +44-(0)1223-492538
>> Fax: +44-(0)1223-494468
>> http://www.ensembl.org/
>> 
>> On 5 Nov 2013, at 10:32, Matthias Ziehm <matthias.ziehm at ebi.ac.uk> wrote:
>> 
>>> Dear Andy,
>>> 
>>> Thanks for the the bite-size Talk about the new REST API, like seeing this since I am using python and previously used an outdate inofficial python interface or the biomart homepage.
>>> I was looking at the homology endpoint and the target_taxon parameter, I was wondering I there a way to specify one or another, i.e something like 7227|10090? (I am interested in a set of 5 species). Of'course I can do seperate targeted queries or non-target restricted queries and filter them locally.
>>> 
>>> Thanks,
>>> Matthias
>>> 
> 
> -- 
> Matthias Ziehm
> PhD Student - Thornton Group
> EMBL - European Bioinformatics Institute (EBI)
> Wellcome Trust Genome Campus
> Hinxton, Cambridge
> CB10 1SD
> United Kingdom
> 
> Tel. +44 1223 49 2546
> http://www.ebi.ac.uk/~mziehm
> 
> The contents of this email and any attachments are intended for the confidential use of the named recipient(s) only. If you are not the intended recipient, you may only use the e-mail header to process the message. It should be noted that any use of or taking action in reliance upon the content of this e-mail or any attachments by persons or entities other than the intended recipient is prohibited.





More information about the Dev mailing list