This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Need help with getting chromosomal positions of SNPs

Hi,

I have a list of 100,000 SNPs with rsIDs in a .txt file and I am trying to get the chromosomal positions of these SNPs. So far I have tried a mysql command -

mysql --user=genome --host=genome-mysql.soe.ucsc.edu -A -P 3306 -D hg38 -e 'select chrom,chromStart+1,chromEnd,name,alleles from snp150 where name in ("rs3748597", "rs2465136", "rs2710872", "rs13129")'

This gives me the desired results, but I am not sure how to extract the positions of all 100,000 SNPs.

Any help or advice anyone has on how I could go about doing this would be greatly appreciated!

Kanika

snp

1 answer

This gives me the desired results, but I am not sure how to extract the positions of all 100,000 SNPs.

use join and the mysql dump of the ucsc:

 join -t $'\t' -1 4 -2 1 \
     <(wget -q  -O - "http://hgdownload.cse.ucsc.edu/goldenPath/hg38/database/snp150.txt.gz" | gunzip -c  |  cut -f 2-5 | LC_ALL=C sort -t $'\t' -k4,4 ) \
    <(cat your_list_of_rs|  LC_ALL=C sort | uniq )

Log in to answer this question.