I have a list of a few hundred SNPs given by rs number. I want to get the chromosome and position for each SNP. For example:
input: rs4477212 output: chr1:82154
I have a list of a few hundred SNPs given by rs number. I want to get the chromosome and position for each SNP. For example:
input: rs4477212 output: chr1:82154
you can download this information from NCBS dbSNP site. On the other hand, you can also use the SNP-nexus site. Very useful.
Thanks I got it! http://www.ncbi.nlm.nih.gov/projects/SNP/dbSNP.cgi?list=rslist
Use the variation dataset, short variation and indels. Then filter by rsID and choose the position as an attribute.
This is my solution: I download the "gwas_catalog_v1.0.2-associations_e110_r2023-10-29.tsv" from https://www.ebi.ac.uk/gwas/download.
awk '{ for(i=1; i<=NF; i++) { if($i ~ /^rs/) print $i } }' gwas_catalog_v1.0.2-associations_e110_r2023-10-29.tsv |grep -v "-" |sed 's/)//g' |sed 's/;//g'|sed 's/,//g' |sort |uniq >gwas.catalog.20231109.rs.del.unique.txt
274432 gwas.catalog.20231109.rs.del.unique.txt
then download "humandb" database from annovar, and get the "hg38_gwasCatalog.txt" file.
less -NS /path/annovar/humandb_hg38/hg38_gwasCatalog.txt |awk '{print $2,$3,$4,$5}' >humandb.hg38.gwascatalog.txt
344020 humandb.hg38.gwascatalog.txt
for i in `cat gwas.catalog.20231109.rs.del.unique.txt`;do grep "${i}$" humandb.hg38.gwascatalog.txt;done |sort |uniq >gwas.catalog.20231113.filter.unique.txt
194186 gwas.catalog.20231113.filter.unique.txt (get the chr:pos position from rs number)
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
duplicate of: How to get the chromosome physical position from rs numbers? , Get SNP position from a python interface.
I created an iOS app for this exact purpose, I welcome any feedback.
http://chromioapp.com