download dbSNP data of a gene using REST API

244 views
Skip to first unread message

Anubrata Das

unread,
Nov 17, 2021, 11:54:25 AM11/17/21
to genome...@soe.ucsc.edu
Dear Sir,
i have been trying to download dbSNP track data, using the code below-
response=requests.get("https://api.genome.ucsc.edu/getData/track",params={"genome":"hg38","track":"dbNSP","chrom":"chr1","start":"47000","end":"48000"})

it throws a bad request. infact when i put track as anything else other than gold, i get a bad request response
i have not been able to find the gold track, anywhere
i want to achieve output as by the data integrator but i am not being able to find anything
kind regards
Anubrata

--
Dr.Anubrata Das
Scientific Officer/F
Chemical Biology Section
Bio-Organic Division
Bhabha Atomic Research Centre
Phone-25597087

Residence-
Ranjani A3, Anushakti Nagar, Mumbai-400094
phone-9702686002 (after 7.00 pm)

Jairo Navarro Gonzalez

unread,
Nov 17, 2021, 8:17:21 PM11/17/21
to Anubrata Das, genome-mirror

Hello,

Thank you for using the UCSC Genome Browser and sending your inquiry.

The reason that the REST API is not working is that you are not using the correct track name for
the tracks you wish to query. The table names for a track may be different than what is displayed
underneath the Genome Browser image. When viewing the track description page for the track,
you can find the table name in the URL by the g=[table_name] URL parameter. For example,
the following URL for the dbSNP 151 Common track is https://genome.ucsc.edu/cgi-bin/hgTrackUi?db=hg38&c=chrX&g=snp151Common.
The table name for this track is snp151. The following YouTube video and transcript can help you
learn how to find the table names for the track you want to use:

Which tables belong to a data track: https://www.youtube.com/watch?v=RQZ4EeYS6Zk&list=UUQnUJepyNOw0p8s2otX4RYQ
Transcript of video: https://genome.ucsc.edu/training/vids/transcript06.pdf

Using the dbSNP 151 Common track, the following will work for the REST API:

response=requests.get("https://api.genome.ucsc.edu/getData/track",params={"genome":"hg38","track":"snp151Common","chrom":"chr1","start":"47000","end":"48000"})

Unfortunately, the dbSNP 153 track uses the bigDbSnp track type and is not supported by the
REST API yet and support is currently being developed.

I hope this is helpful. If you have any further questions, please reply to genome...@soe.ucsc.edu.
All messages sent to that address are archived on a publicly accessible Google Groups forum.
If your question includes sensitive data, you may send it instead to genom...@soe.ucsc.edu.

Jairo Navarro
UCSC Genome Browser

Want to share the Browser with colleagues?
Host a workshop: https://bit.ly/ucscTraining


--

---
You received this message because you are subscribed to the Google Groups "UCSC Genome Browser Mirror-Specific Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genome-mirro...@soe.ucsc.edu.
To view this discussion on the web visit https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/CAHJBGAnHSGL8AwgNh9VxDpWf5wk4C%2BWYWPR_BYiRjU1zYCWkFw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages