Get the snp id (rs) from the name of genes
2
I have a list of genes and I want to see all available SNP related to those genes. so I need to get the SNP ID (rs) from the gene name by using python or R.
snp
rs
gene
• 1.4k views
using mysql/ucsc
$ mysql -h genome-mysql.cse.ucsc.edu -A -u genome -D hg19 -e 'select distinct G.chrom,N.value,S.name,S.chromStart,S.chromEnd from ensemblToGeneName as N,ensGene as G,snp151 as S where G.name= N.name and N.value="SCN5A" and S.chrom=G.chrom and NOT(S.chromEnd <= G.txStart OR S.chromStart>=G.txEnd) limit 10'
+-------+-------+--------------+------------+----------+
| chrom | value | name | chromStart | chromEnd |
+-------+-------+--------------+------------+----------+
| chr3 | SCN5A | rs1048869186 | 38589554 | 38589555 |
| chr3 | SCN5A | rs1364237131 | 38589555 | 38589556 |
| chr3 | SCN5A | rs34095914 | 38589561 | 38589561 |
| chr3 | SCN5A | rs756210830 | 38589562 | 38589563 |
| chr3 | SCN5A | rs1318679164 | 38589570 | 38589571 |
| chr3 | SCN5A | rs887720794 | 38589571 | 38589572 |
| chr3 | SCN5A | rs41258455 | 38589581 | 38589582 |
| chr3 | SCN5A | rs1383871535 | 38589584 | 38589585 |
| chr3 | SCN5A | rs1399904090 | 38589588 | 38589589 |
| chr3 | SCN5A | rs913120201 | 38589591 | 38589592 |
+-------+-------+--------------+------------+----------+
Using EntrezDirect :
$ esearch -db snp -query "SCN5A [GENE] AND human [orgn]" | esummary | xtract -pattern DocumentSummary -element CHR,NAME,SNP_ID,CHRPOS
3 SCN5A 2089406557 3:38641066
3 SCN5A 2077235231 3:38610317
3 SCN5A 2074172389 3:38618406
3 SCN5A 2065689680 3:38581366
3 SCN5A 2062935810 3:38651659
Login before adding your answer.
Traffic: 1546 users visited in the last hour
Thanks , is there any python or R package does this?
any mysql driver for python or R...