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]]

