Help with GSEAlm
1
0
Entering edit mode
@b1gorsuchcomcastnet-5382
Last seen 10.3 years ago
Dear Sir/Madam, I am using R 2.15.0 and following a tutoiral by Daniel Gusenleitner (5/23/2011) for GSEAlm. I am using Agilent probes. I am getting : " Error in binaryGeneSet[probesOfGeneSet] <- 1 : object 'binaryGeneSet' not found " 1. "We start by loading the fi le into R, and splitting each line at the tabs" >setwd("C:/Documents and Settings/wg025/Desktop") > c5.bp.v3.0.symbols` <- read.delim("C:/Documents and Settings/wg025/Desktop/c5.bp.v3.0.symbols.gmt", header=F) + > > c5.bp.v3.0.symbols <- read.delim("C:/Documents and Settings/wg025/Desktop/c5.bp.v3.0.symbols.gmt", header=F) > View(`c5.bp.v3.0.symbols`) > names(c5.bp.v3.0.symbols) <- sapply(c5.bp.v3.0.symbols, function(x) x[1]) > c5.bp.v3.0.symbols <- sapply(c5.bp.v3.0.symbols, function(x) x[3:length(x)]) > allGenes <- unique(unlist(c5.bp.v3.0.symbols)) 2. The next step is to use the 1st elements of each line as identi ers and afterwards dropping the rst two elements so that each gene set only contains the actual genes: >names(c5.bp.v3.0.symbols) <- sapply(c5.bp.v3.0.symbols, function(x) x[1]) > c5.bp.v3.0.symbols <- sapply(c5.bp.v3.0.symbols, function(x) x[3:length(x)]) 3. We can use the Bioconductor package biomaRt to map the genes. > allGenes <- unique(unlist(c5.bp.v3.0.symbols)) >library("biomaRt") > c5.bp.v3.0.symbols <- t(c5.bp.v3.0.symbols) save(c5.bp.v3.0.symbols, file = "c5.bp.v3.0.symbols.RData") > load("c5.bp.v3.0.symbols.RData") > pVals = gsealmPerm(breastCancer, disease_type, c5.bp.v3.0.symbols, nperm = 1000) Error: could not find function "gsealmPerm" > ensembl = useMart("ensembl", dataset = "mmusculus_gene_ensembl") > geneMaps <- getBM(attributes = c("ensembl_gene_id", "mgi_symbol"), filters="mgi_symbol", values =allGenes, mart=ensembl) > head(geneMaps) ensembl_gene_id mgi_symbol 1 ENSMUSG00000022534 Mefv 2 ENSMUSG00000049871 Nlrc3 3 ENSMUSG00000022521 Crebbp 4 ENSMUSG00000005718 Tfap4 5 ENSMUSG00000014303 Glis2 6 ENSMUSG00000078135 Eid1 > geneMaps <- geneMaps[!geneMaps[, 2] == "", ] 4. "Biobase" [1] "Biobase" >mapGeneSet <- function(geneSet, geneMap, binaryGeneSet) { + probesOfGeneSet <- geneMap[geneMap[, 1] %in% geneSet, 2] + binaryGeneSet[probesOfGeneSet] <- 1 + return(binaryGeneSet) + } > c5.bp.v3.0.symbols <- sapply(c5.bp.v3.0.symbols, mapGeneSet, geneMaps, binaryGeneSet) Error in binaryGeneSet[probesOfGeneSet] <- 1 : object 'binaryGeneSet' not found Thank you very much for any help. Brian [[alternative HTML version deleted]]
biomaRt GSEAlm biomaRt GSEAlm • 1.1k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 3 days ago
United States
Hi Brian, What you have posted here is quite a mess. First of all, what tutorial by Daniel Gusenleitner? From where? And what you have posted below is really not helpful. We are not mind readers, so in the future try to put yourself in our shoes and try to give as much information as possible, without adding in a bunch of extraneous information. I am feeling extra helpful today, and I was able to find the tutorial you are following, with just a bit of googling: http://rcourse.wordpress.com/about/cccb-introduction-to-r-and- bioconductor-may-2011/ In particular, the first tutorial on day 2. Apparently the breastCancer.RData file was at one time in a public dropbox folder, which no longer exists. There was also an R script you could have followed, which would have been more helpful than the tutorial, which leaves out important steps. So at this point you won't be able to run the code unless you can get Daniel Gusenleitner to send you the data (and the R script). Best, Jim On 7/5/2012 1:42 PM, b1gorsuch at comcast.net wrote: > Dear Sir/Madam, > I am using R 2.15.0 and following a tutoiral by Daniel Gusenleitner (5/23/2011) for GSEAlm. I am using Agilent probes. > I am getting : " Error in binaryGeneSet[probesOfGeneSet]<- 1 : object 'binaryGeneSet' not found " > > > 1. "We start by loading the fi le into R, and splitting each line at the tabs" > >> setwd("C:/Documents and Settings/wg025/Desktop") >> c5.bp.v3.0.symbols`<- read.delim("C:/Documents and Settings/wg025/Desktop/c5.bp.v3.0.symbols.gmt", header=F) > +> >> c5.bp.v3.0.symbols<- read.delim("C:/Documents and Settings/wg025/Desktop/c5.bp.v3.0.symbols.gmt", header=F) >> View(`c5.bp.v3.0.symbols`) >> names(c5.bp.v3.0.symbols)<- sapply(c5.bp.v3.0.symbols, function(x) x[1]) >> c5.bp.v3.0.symbols<- sapply(c5.bp.v3.0.symbols, function(x) x[3:length(x)]) >> allGenes<- unique(unlist(c5.bp.v3.0.symbols)) > 2. The next step is to use the 1st elements of each line as identi ers and > afterwards dropping the rst two elements so that each gene set only contains > the actual genes: > >> names(c5.bp.v3.0.symbols)<- sapply(c5.bp.v3.0.symbols, function(x) x[1]) >> c5.bp.v3.0.symbols<- sapply(c5.bp.v3.0.symbols, function(x) x[3:length(x)]) > 3. We can use the Bioconductor package biomaRt to map the genes. > >> allGenes<- unique(unlist(c5.bp.v3.0.symbols)) >> library("biomaRt") >> c5.bp.v3.0.symbols<- t(c5.bp.v3.0.symbols) > save(c5.bp.v3.0.symbols, file = "c5.bp.v3.0.symbols.RData") >> load("c5.bp.v3.0.symbols.RData") >> pVals = gsealmPerm(breastCancer, disease_type, c5.bp.v3.0.symbols, nperm = 1000) > Error: could not find function "gsealmPerm" >> ensembl = useMart("ensembl", dataset = "mmusculus_gene_ensembl") >> geneMaps<- getBM(attributes = c("ensembl_gene_id", "mgi_symbol"), filters="mgi_symbol", values =allGenes, mart=ensembl) >> head(geneMaps) > ensembl_gene_id mgi_symbol > 1 ENSMUSG00000022534 Mefv > 2 ENSMUSG00000049871 Nlrc3 > 3 ENSMUSG00000022521 Crebbp > 4 ENSMUSG00000005718 Tfap4 > 5 ENSMUSG00000014303 Glis2 > 6 ENSMUSG00000078135 Eid1 >> geneMaps<- geneMaps[!geneMaps[, 2] == "", ] > 4. "Biobase" > [1] "Biobase" > >> mapGeneSet<- function(geneSet, geneMap, binaryGeneSet) { > + probesOfGeneSet<- geneMap[geneMap[, 1] %in% geneSet, 2] > + binaryGeneSet[probesOfGeneSet]<- 1 > + return(binaryGeneSet) > + } >> c5.bp.v3.0.symbols<- sapply(c5.bp.v3.0.symbols, mapGeneSet, geneMaps, binaryGeneSet) > Error in binaryGeneSet[probesOfGeneSet]<- 1 : > object 'binaryGeneSet' not found > > Thank you very much for any help. > Brian > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician University of Washington Environmental and Occupational Health Sciences 4225 Roosevelt Way NE, # 100 Seattle WA 98105-6099
ADD COMMENT

Login before adding your answer.

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