0
$\begingroup$

So I have the following e-utils api-link:

https://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=gene&db=snp&id=5726&retmode=json

it returns all the SNP-ids for the gene with the id 5726 as an example. Additionally to the SNP-ids I also need the SNP position and the genomic distance. Also I would need the chromosome but I could query that from the gene as well rather than for each SNP. Do you know how I can add all these informations to the resulting json/xml?

The first one in the resulting list is the SNP with the id 1490381980. Further information about it can be found on dbSNP: https://www.ncbi.nlm.nih.gov/snp/?term=1490381980%5BUID%5D

I really want to avoid creating a request for each single SNP and would prefer to query everything at once. Due to the unavoidable performance-issues. The Tas2R38 doesn't have that many SNPs but there are other genes with way more.

$\endgroup$
2
  • $\begingroup$ Hi @cowboy_patrick could you plase state/clarify what you mean by "to query everything at once. Due to unavoidable performance issues.". $\endgroup$
    – M__
    Jul 3 '20 at 17:41
  • $\begingroup$ It would be great if I could get all the SNPs and their positions with a single api-call for a specified gene. Instead of creating a call for each SNP on the variation services or something similar $\endgroup$ Jul 4 '20 at 3:35
2
$\begingroup$

If your dataset is limited to human SNPs, and you know the list of SNPs, I would advise taking a look at the dedicated NCBI Variation Services. This would be one request for each SNP, but if you fire off 1-2 per second, I think you'll be ok.

For example, for rs1490381980, you could try something like:

curl -X GET 'https://api.ncbi.nlm.nih.gov/variation/v0/refsnp/1490381980' \
   | jq '.primary_snapshot_data.placements_with_allele[] | "\(.seq_id) \(.alleles[0].allele.spdi.position)"'

It would be better to query for the SNP and parse the JSON in python, but jq helps provide an idea of what is possible.

Alternatively, you could download the JSON or VCF data from the NCBI dbSNP FTP site, and process out the information you need.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.