This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Ensembl REST API Optional Parameters

Hello,

Can anyone please share an example of how one can specify optional parameters when using VEP through Ensembl REST API? I am following the examples on this page and would like to limit the results to those from canonical transcripts, and only return the maximum allele frequency in any population.

Best, Noushin

P.S. Tagging Emily_Ensembl

ensembl vep

Are you putting this in a script (if so what language), just plugging a URL into a browser or using a REST client? Are you using POST or GET endpoints?

Thank you! I am using this in an R script and using POST endpoint.

1 answer

We have Jupyter notebooks that take you through a training course on using the REST API in different coding languages. This page covers how to use POST endpoints in R, and includes how to add optional parameters. Simply, you add them to the endpoint URL after a /. There's even a VEP example in there, although it is a different parameter.

Thanks, Emily_Ensembl ! The tutorials were great.

For future reference of myself and others, here is an example of how one would add protein domain annotation and uniprot protein ids to vep results for an input specified in genomic coordinates:

server <- "http://grch37.rest.ensembl.org"
ext <- "/vep/homo_sapiens/region/?domains=1&uniprot=1"
query <- "17 7578407 - G A"

body <- sprintf('{ "variants" : ["%s"] }', query)
r <- httr::POST(paste(server, ext, sep = ""), httr::content_type("application/json"),
                        httr::accept("application/json"), body = body)
annot <- jsonlite::fromJSON(jsonlite::toJSON(httr::content(r)))

Your links are dead (misleading) here, it would be helpful if you could restore them to a more useful state!

Log in to answer this question.