Salut Frédéric, I had this on my list for a long time so here it goes. Starting with BSgenome 1.36.2 (in release) and 1.37.3 (in devel), a new API is available for querying a SNPlocs object:
snpsBySeqname() snpsByOverlaps() snpsById() Note that this is the new recommended API. In particular snpsById() is what should be used instead of rsid2loc(). It has an argument (ifnotfound) that let's you control what to do if some SNP ids are not found. See ?SNPlocs for more information and some examples. These new versions of BSgenome should become available via biocLite() in 24 hours or so. Let me know if you run into problems. Cheers, H. On 06/29/2015 03:50 AM, COMMO Frederic wrote:
Hi, I'm trying to map rsi Ids provided in the Affymetrix cytoScanHD arrays, using the 'SNPlocs.Hsapiens.dbSNP142.GRCh37' package, and rsid2loc(). It turns out that some of these rsi ids are unknown, e.g. rsi7553394, and rsi2loc() fails on the entire search. It would be nice if rsi2loc() would catch the failures, then return the found and the unknown ids, separately, maybe as a list or in success/failure slots. So a multiple-Ids search would not fail. Maybe I missed something, and the function already handle errors. ## To reproduce ## "rs7553394" corresponds to probe SNP_A-1780654 in the Affy cytoScanHD, annotated in Hg19. library(SNPlocs.Hsapiens.dbSNP142.GRCh37) rsids <- c("rs10458597", "rs12565286", "rs7553394") rsid2loc(rsids, caching=TRUE) Fred Frederic Commo Bioinformatics, U981 Gustave Roussy [[alternative HTML version deleted]] _______________________________________________ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel
-- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpa...@fredhutch.org Phone: (206) 667-5791 Fax: (206) 667-1319 _______________________________________________ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel