Search
Question: convert Gene collection to gene list for camera function
0
9 months ago by
Seymoo0
Oslo
Seymoo0 wrote:

I want to use camera function in limma. I downloaded xml file from MSigDB and loaded it but I am wondering how can I make it to a compatible list for camera function as it has been mentioned in here that GEneCollection need to be converted to a list.

what I have done is

gsc <- getBroadSets("P:/repos/R/msigdb_v6.1.xml")

camera(eset, design = design, index = gsc[grepl("REACTOME", names(gsc))])

Error in Stat[iset] : invalid subscript type 'S4'

This code works when I load the file from http://bioinf.wehi.edu.au

download.file("http://bioinf.wehi.edu.au/software/MSigDB/human_c2_v5p2.rdata",
"human_c2_v5p2.rdata", mode = "wb")

camera(eset, design = design, index = Hs.c2[grepl("REACTOME", names(Hs.c2))])

modified 9 months ago by James W. MacDonald48k • written 9 months ago by Seymoo0
2
9 months ago by
United States
James W. MacDonald48k wrote:

Using GSEABase seems overkill. Just download the gmt you need from the Broad and parse it yourself. As an example, I downloaded the c2.cp.reactome.v1.1.entrez.gmt file, which is all the Reactome gene sets.

> z <- strsplit(readLines("c2.cp.reactome.v6.1.entrez.gmt"), "\t")
> zz <- lapply(z, function(x) x[3:length(x)])
> names(zz) <- sapply(z, "[", 1)

Then you should be able to feed that as your 'index' argument to camera. Although I don't think there is any profit in doing so, as what I get is identical to what you already have from WEHI:

> table(mapply(function(x,y) all(x %in% y), zz, Hs.c2[names(zz)]))

TRUE
674

That's right, the Reactome Pathways are the same in MSigDb v6 as they were in v5.