Gene-snp matching
2
0
Entering edit mode
@mohamed-lajnef-3515
Last seen 10.2 years ago
Hi All, I have a list of genes and I want the snps matching of these genes (the other way too e.g: Snps ----> genes) Is there any R package to do this ? Regards M -- Mohamed Lajnef INSERM Unit? 955. 40 rue de Mesly. 94000 Cr?teil. Courriel : Mohamed.lajnef at inserm.fr tel. : 01 49 81 31 31 (poste 18470) Sec : 01 49 81 32 90 fax : 01 49 81 30 99
• 1.5k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 2 days ago
United States
Hi Mohamed, First, you don't need to ask the same question twice with different subject lines; the list traffic is typically low over the weekend, so you could have waited until today for a response. In addition, you will either get a response or not - asking again probably reduces your chances of getting an answer. Mohamed Lajnef wrote: > Hi All, > > I have a list of genes and I want the snps matching of these genes (the > other way too e.g: Snps ----> genes) > > Is there any R package to do this ? Several. You can do this with either an org.Xx.eg.db package in concert with a SNPloc package, using biomaRt, or RMySQL with a direct query of the UCSC genome browser public MySQL server. 1.) library(org.Hs.eg.db) library("SNPlocs.Hsapiens.dbSNP.20080617") gns <- c("VEGFA","TP53", "BRCA1") egs <- unlist(mget(gns, org.Hs.egALIAS2EG)) beg <- mget(egs, org.Hs.egCHRLOC) finish <- mget(egs, org.Hs.egCHRLOCEND) chr6 <- getSNPlocs("chr6") chr6[chr6$loc > beg[[1]] & chr6$loc < finish[[1]],] RefSNP_id alleles_as_ambig loc 215667 2010963 S 43846328 215668 6928818 R 43846352 215669 25648 Y 43846955 215670 58159269 Y 43847424 215671 61085192 R 43847452 <snip> 2.) mart <- useMart("snp","hsapiens_snp") embl <- unlist(mget(egs, org.Hs.egENSEMBL)) snps <- getBM(c("ensembl_gene_stable_id", "refsnp_id"),"ensembl_gene", embl , mart) head(snps) ensembl_gene_stable_id refsnp_id 1 ENSG00000012048 rs2355954 2 ENSG00000012048 rs35578914 3 ENSG00000012048 rs3074670 4 ENSG00000012048 rs34130132 5 ENSG00000012048 rs762533 6 ENSG00000012048 rs762532 <snip> 3.) library(RMySQL) con <- dbConnect("MySQL", user = "genome", host = "genome-mysql.cse.ucsc.edu", dbname = "hg18") sql <- paste("select name from snp128 where chrom='chr6' and chromStart between", beg[[1]], "and", finish[[1]], ";") dbGetQuery(con, sql) dbGetQuery(con, sql) name 1 rs2010963 2 rs6928818 3 rs25648 4 rs35440538 5 rs833067 6 rs1885657 7 rs943070 8 rs1413711 <snip> I leave it as an exercise to figure out how to go the other direction. Best, Jim > > Regards > M > -- James W. MacDonald, M.S. Biostatistician Douglas Lab University of Michigan Department of Human Genetics 5912 Buhl 1241 E. Catherine St. Ann Arbor MI 48109-5618 734-615-7826
ADD COMMENT
0
Entering edit mode
Dear James & Bucher Thank you very much for your help Mohamed James W. MacDonald a ?crit : > Hi Mohamed, > > First, you don't need to ask the same question twice with different > subject lines; the list traffic is typically low over the weekend, so > you could have waited until today for a response. In addition, you > will either get a response or not - asking again probably reduces your > chances of getting an answer. > > Mohamed Lajnef wrote: >> Hi All, >> >> I have a list of genes and I want the snps matching of these genes >> (the other way too e.g: Snps ----> genes) >> >> Is there any R package to do this ? > > Several. You can do this with either an org.Xx.eg.db package in > concert with a SNPloc package, using biomaRt, or RMySQL with a direct > query of the UCSC genome browser public MySQL server. > > 1.) > > library(org.Hs.eg.db) > library("SNPlocs.Hsapiens.dbSNP.20080617") > gns <- c("VEGFA","TP53", "BRCA1") > egs <- unlist(mget(gns, org.Hs.egALIAS2EG)) > beg <- mget(egs, org.Hs.egCHRLOC) > finish <- mget(egs, org.Hs.egCHRLOCEND) > chr6 <- getSNPlocs("chr6") > chr6[chr6$loc > beg[[1]] & chr6$loc < finish[[1]],] > > RefSNP_id alleles_as_ambig loc > 215667 2010963 S 43846328 > 215668 6928818 R 43846352 > 215669 25648 Y 43846955 > 215670 58159269 Y 43847424 > 215671 61085192 R 43847452 > <snip> > > 2.) > > mart <- useMart("snp","hsapiens_snp") > embl <- unlist(mget(egs, org.Hs.egENSEMBL)) > snps <- getBM(c("ensembl_gene_stable_id", "refsnp_id"),"ensembl_gene", > embl , mart) > head(snps) > ensembl_gene_stable_id refsnp_id > 1 ENSG00000012048 rs2355954 > 2 ENSG00000012048 rs35578914 > 3 ENSG00000012048 rs3074670 > 4 ENSG00000012048 rs34130132 > 5 ENSG00000012048 rs762533 > 6 ENSG00000012048 rs762532 > <snip> > > 3.) > > library(RMySQL) > con <- dbConnect("MySQL", user = "genome", host = > "genome-mysql.cse.ucsc.edu", dbname = "hg18") > sql <- paste("select name from snp128 where chrom='chr6' and > chromStart between", beg[[1]], "and", finish[[1]], ";") > dbGetQuery(con, sql) > dbGetQuery(con, sql) > name > 1 rs2010963 > 2 rs6928818 > 3 rs25648 > 4 rs35440538 > 5 rs833067 > 6 rs1885657 > 7 rs943070 > 8 rs1413711 > <snip> > > I leave it as an exercise to figure out how to go the other direction. > > Best, > > Jim > > > > >> >> Regards >> M >> > -- Mohamed Lajnef INSERM Unit? 955. 40 rue de Mesly. 94000 Cr?teil. Courriel : Mohamed.lajnef at inserm.fr tel. : 01 49 81 31 31 (poste 18470) Sec : 01 49 81 32 90 fax : 01 49 81 30 99
ADD REPLY
0
Entering edit mode
Bucher Elmar ▴ 80
@bucher-elmar-3683
Last seen 10.2 years ago
Hi Mohamed, I never had to link snips to genes. But I checked the documentation of the biomaRt bioconductor package. http://www.bioconductor.org/packages/release/bioc/html/biomaRt.html This package enables you to use ensembl mart in R. http://www.ensembl.org/index.html http://www.ensembl.org/biomart/martview/ I checked there the attributes and filters for the Homo Sapiens. Several snp related attributes and filters are to find. So I think this package will be able to solve your problem. If you work at Homo Sapiens the package SNPlocs.Hsapiens.dbSNP.20090506, which I found in addition on the bioconductor homepage, might as well be useful. http://www.bioconductor.org/packages/release/data/annotation/html/SNPl oc s.Hsapiens.dbSNP.20090506.html But if the biomaRt packge works, then myself would prefer the biomaRt... but that's just a matter of taste and you maybe better listen to a person who works a lot whit snp data, if one of those gives you answer. Anyhow, hope this help get you at least started. So long, Elmar -----Original Message----- From: bioconductor-bounces@stat.math.ethz.ch [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of bioconductor-request at stat.math.ethz.ch Sent: 14 September 2009 13:00 To: bioconductor at stat.math.ethz.ch Subject: Bioconductor Digest, Vol 79, Issue 14 - Message: 2 Date: Mon, 14 Sep 2009 11:32:38 +0200 From: Mohamed Lajnef <mohamed.lajnef@inserm.fr> Subject: [BioC] Gene-snp matching To: bioconductor at stat.math.ethz.ch, Sean Davis <seandavi at="" gmail.com=""> Message-ID: <4AAE0DB6.9070606 at inserm.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi All, I have a list of genes and I want the snps matching of these genes (the other way too e.g: Snps ----> genes) Is there any R package to do this ? Regards M -- Mohamed Lajnef INSERM Unit? 955. 40 rue de Mesly. 94000 Cr?teil. Courriel : Mohamed.lajnef at inserm.fr tel. : 01 49 81 31 31 (poste 18470) Sec : 01 49 81 32 90 fax : 01 49 81 30 99
ADD COMMENT

Login before adding your answer.

Traffic: 839 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