API query for gene annotations

You can perform all the queries available on this web site directly from your R code.

Step 1. Create a new job and obtain your Job ID

library(jsonlite)
url = "http://epimed.univ-grenoble-alpes.fr/database/query/jobid"
jobid = fromJSON(url)

Keep your Job ID (jobid variable).

Step 2. Submit a query

Possible query types:

Update a list of gene symbols

For this query your need to provide: jobid (obtained in Step1), symbols and taxid (use standard NCBI taxid). The query type is update.

library(httr)
url = "http://epimed.univ-grenoble-alpes.fr/database/query/genes/update"
body = list(jobid=jobid, symbols="ATAD2, BRDT", taxid=9606)
response = POST(url, body = body, encode = "form")

Find probesets for a list of gene symbols

For this query your need to provide: jobid (obtained in Step1), symbols, platform and taxid (use standard NCBI taxid). The query type is probeset.

library(httr)
url = "http://epimed.univ-grenoble-alpes.fr/database/query/genes/probeset"
body=list(jobid=jobid, symbols="ATAD2, BRDT", platform="GPL570", taxid=9606)
response = POST(url, body = body, encode = "form")

Find positions for a list of gene symbols

For this query your need to provide: jobid (obtained in Step1), symbols, assembly, positionType ("unique" or "all") and taxid (use standard NCBI taxid). The query type is position.

library(httr)
url = "http://epimed.univ-grenoble-alpes.fr/database/query/genes/position"
body=list(jobid=jobid, symbols="ATAD2, BRDT", assembly="GRCh38", positionType="unique", taxid=9606)
response = POST(url, body = body, encode = "form")

Step 3. Check the status of a query

If your list of symbols is long, the query may take some time. You can check the status of your query with the following command.

library(jsonlite)
url = "http://epimed.univ-grenoble-alpes.fr/database/query/jobstatus?jobid=YOUR_JOB_ID"
job = fromJSON(url)
# Job ID
job$jobid
# Job status
job$status
Status Meaning
init The job has been initialized. It is not yet terminated.
progress The job is currently in progress.
success The job is terminated with success.
error An error has occurred during job execution.

If you need to access symbols of the query, just add extended=1 to the url.

url = "http://epimed.univ-grenoble-alpes.fr/database/query/jobstatus?jobid=YOUR_JOB_ID&extended=1"
job = fromJSON(url)
# Symbols
job$symbols

Step 4. Get the result of a query

When you perform any search for gene annotations on this web site (for example, to update gene symbols or to find probsets) or via R code, you obtain a unique identification number for your request: your Job ID. The result of your request is stored in the database with your Job ID. Thus, you can load it again by using your personal Job ID.

If you submit a request via R code, your Job ID is available in jobid variable (see Step 1).

Query composition

http://epimed.univ-grenoble-alpes.fr/database/query/jobs?jobid=YOUR_JOB_ID

The query will generate a CSV file that you can download or directly import into your R code

url = "http://epimed.univ-grenoble-alpes.fr/database/query/jobs?jobid=YOUR_JOB_ID"
df = read.csv2(url, header=TRUE, sep=";")

For gene positions, it is possible to organize columns accordingly to standard BED format. Just add format=bed to your request:

url = "http://epimed.univ-grenoble-alpes.fr/database/query/jobs?jobid=YOUR_JOB_ID&format=bed"
df = read.csv2(url, header=TRUE, sep=";")