gnomAD: query utilitites
4
1
Entering edit mode
5.0 years ago
bsmith030465 ▴ 240

Hi,

I wanted to query the gnomAD database without having to download and configure the entire data. Is there a way gnomAD provides an API for programmatic access? For example, for a given variant id, I want to retrieve the Total 'Allele Count':

INPUT: '1-978628-C-T' (or 'rs116586548')
OUTPUT: 180

i.e. if we query the website (gnomAD

I have thousands of variants that I want to get the Total Allele Count for, but would prefer not to download the entire dataset.

thanks!

gnomAD • 4.6k views
ADD COMMENT
3
Entering edit mode
5.0 years ago

use an API like https://myvariant.info/

wget -q -O - "http://myvariant.info/v1/variant/rs116586548" H  "accept: application/json"  
(..)
    "an": {
      "an": 30864,
      "an_afr": 8690,
      "an_amr": 838,
      "an_asj": 302,
      "an_eas": 1622,
      "an_female": 13804,
      "an_fin": 3490,
      "an_male": 17060,
      "an_nfe": 14940,
      "an_oth": 982,
      "an_popmax": 8690,
      "an_raw": 30990
    },

(...)
ADD COMMENT
2
Entering edit mode
3.8 years ago
r-ninja ▴ 20

Hi everyone, after trying many of the things suggested here, I realized none of them did what I needed. So I teamed up with a web developer and we wrote a node.js tool to do the work. It's working pretty well so far!

Github repo: https://github.com/crankysparrow/computationalbio

Blogpost: https://bbitarello.github.io/post/gnomad-api-query/#a-brief-tutorial

Basically you wanna run:

node scripts/readIDs.js --input input/rsIDs_whi.txt --output input/rsIDs_whi.json

This converts a text file with one SNP ID per line into a .json file to be used as input. Then run:

node scripts/gnomad_query.js --input input/rsIDs_jhs.json  --pop 'NFE' --db 'GNOMAD'

This actually runs http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/ for you and produces an output in .json with all the queries.

ADD COMMENT
1
Entering edit mode
5.0 years ago

I don't think so, at least not officially. You might be able to find a third party web application that has gnomAD data.

Bravo is another variant database that seems to use part of the ExAC browser codebase: https://bravo.sph.umich.edu/freeze5/hg38/ and they provide an API. The data might not be as rich as gnomAD but it might be enough depending on what you need.

Varsome is a commerical variant database that might work here too: https://varsome.com/information/varsome-api-info/ which is free with some restrictions but also provides some premium models. They provide a sample client API as well: https://github.com/saphetor/varsome-api-client-python

There's some other solutions: https://bioinformatics.stackexchange.com/questions/933/is-there-public-restful-api-for-gnomad I couldn't get the tabix one to work though (the URL is different now, but still didn't work in my case.)

ADD COMMENT
1
Entering edit mode

tabix doesn't work anymore because the server for gnomad doesn't support "range-query" anymore.

ADD REPLY
0
Entering edit mode
5.0 years ago
Garan ▴ 690

The Cellbase Swagger restful API might have what you're after, although I'm not sure how many requests it will take if you're looking to bulk query.

http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/

http://bioinfo.hpc.cam.ac.uk/cellbase/webservices/rest/v4/hsapiens/feature/variation/rs116586548/info?limit=-1&skip=-1&skipCount=false&count=false&Output%20format=json

populationFrequencies   
0   
study   "GNOMAD_EXOMES"
population  "ALL"
refAllele   "C"
altAllele   "T"
refAlleleFreq   0.99945223
altAlleleFreq   0.00054777955
refHomGenotypeFreq  0.99890447
hetGenotypeFreq 0.0010955591
altHomGenotypeFreq  0
1   
study   "GNOMAD_EXOMES"
population  "OTH"
refAllele   "C"
altAllele   "T"
refAlleleFreq   0.9998051
altAlleleFreq   0.00019493178
refHomGenotypeFreq  0.9996101
hetGenotypeFreq 0.00038986356
altHomGenotypeFreq  0
ADD COMMENT

Login before adding your answer.

Traffic: 2918 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6