dbSNP - getting details of Pubmed ID for a SNP
2
0
Entering edit mode
Paul Evans ▴ 180
@paul-evans-2716
Last seen 9.6 years ago
Hi, I had a set of snp ids (e.g. 'rs11805303'). Is there any package that will let me access dbSNP database and return the Pubmed IDs of articles that have cited that particular snp id. For example, for 'rs11805303', it will return Pubmed IDs: 17554300,18533027,19522770 thanks! [[alternative HTML version deleted]]
SNP SNP • 2.0k views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 3 months ago
United States
On Sat, Jan 9, 2010 at 6:30 PM, Paul Evans <p.evans48 at="" yahoo.com=""> wrote: > Hi, > > I had a set of snp ids (e.g. 'rs11805303'). Is there any package that will let me access dbSNP database and return the Pubmed IDs of articles that have cited that particular snp id. For example, for 'rs11805303', it will return Pubmed IDs: 17554300,18533027,19522770 > Hi, Paul. There may be other ways to do this, but you could use eUtils from NCBI to do this: snp2linkedPubmed <- function(id) { id = as.integer(id) if(length(id)!=1) stop("id should be an integer vector of length 1") require(XML) url = sprintf("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fc gi?dbfrom=snp&db=pubmed&linkname=snp_pubmed_cited&id=%d",id) doc = xmlTreeParse(url,useInternalNode=TRUE) return(as.integer(sapply(getNodeSet(doc,'//Link/Id'),xmlValue))) } # note that this uses the integer value of the rs > snp2linkedPubmed(11805303) [1] 19522770 18533027 17554300 As it stands, this function can take only 1 rs# at a time. If you need to do this for many rs#, DO NOT simply use this in a large loop. If that is what you want to do, then you will need to modify the function to take in a vector of values and search in blocks, and then parse the returned XML. If this is your intent, I can provide further code. Sean
ADD COMMENT
0
Entering edit mode
Thanks Sean. Yes, I'd like to do it for a large set of snp ids. thanks! ________________________________ From: Sean Davis <seandavi@gmail.com> Cc: Bioconductor@stat.math.ethz.ch Sent: Sat, January 9, 2010 8:48:05 PM Subject: Re: [BioC] dbSNP - getting details of Pubmed ID for a SNP > Hi, > > I had a set of snp ids (e.g. 'rs11805303'). Is there any package that will let me access dbSNP database and return the Pubmed IDs of articles that have cited that particular snp id. For example, for 'rs11805303', it will return Pubmed IDs: 17554300,18533027,19522770 > Hi, Paul. There may be other ways to do this, but you could use eUtils from NCBI to do this: snp2linkedPubmed <- function(id) { id = as.integer(id) if(length(id)!=1) stop("id should be an integer vector of length 1") require(XML) url = sprintf("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fc gi?dbfrom=snp&db=pubmed&linkname=snp_pubmed_cited&id=%d",id) doc = xmlTreeParse(url,useInternalNode=TRUE) return(as.integer(sapply(getNodeSet(doc,'//Link/Id'),xmlValue))) } # note that this uses the integer value of the rs > snp2linkedPubmed(11805303) [1] 19522770 18533027 17554300 As it stands, this function can take only 1 rs# at a time. If you need to do this for many rs#, DO NOT simply use this in a large loop. If that is what you want to do, then you will need to modify the function to take in a vector of values and search in blocks, and then parse the returned XML. If this is your intent, I can provide further code. Sean [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
@hsiaoyi0504-15311
Last seen 5.4 years ago

There are series of file on NCBI ftp can be used in this task, but there is no document for that, though.

ftp://ftp.ncbi.nlm.nih.gov/snp/Entrez/eLinks/

ADD COMMENT

Login before adding your answer.

Traffic: 588 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6