How To Get Gene Id And Name Into Samr From Geoquery
2
0
Entering edit mode
12.5 years ago
Brian Repko ▴ 10

New to R/Bioconductor and all that so forgive my lack of R chops or understanding of objects like ExpressionSet. Just finished reading the manuals...

I am looking to create a function that takes a GDS id and various control GSM ids and find the most up-regulated gene and most down-regulated gene. Looking at GDS1731 with controls of GSM84549, GSM84550, GSM84551, I can setup the following:

library('GEOquery')
library('samr')
gds <- getGEO('GDS1731')
eset <- GDS2eSet(gds)
x = exprs(eset)
y = c(rep(1,3),rep(2,9))
data <- list(x = x, y = y, logged2 = FALSE)
samr.out <- samr(data = data, resp.type = "Two class unpaired", assay.type = "array")
delta.table <- samr.compute.delta.table(samr.out)
delta=.5
siggenes.table <- samr.compute.siggenes.table(samr.out, delta, data, delta.table)
up_genes <- siggenes.table$genes.up
lo_genes <- siggenes.table$genes.lo

And then take the first row of upgenes or logenes.

What I can't figure out is how to get the geneid and genenames into the mix. They look like parameters to the SAM method but not samr. Nor are they parameters to the samr.compute.siggenes.table - that I can see. Also its not clear to me how to get geneid and genenames out of the ExpressionSet - all depending on what gene identifier I want to use and what is in the GDS/GPL.

Any clues thoughts?

gene • 4.9k views
ADD COMMENT
1
Entering edit mode
12.5 years ago

To access data about genes from an ExpressionSet, use the fData() method.

gene_data_frame = fData(eset)
ADD COMMENT
0
Entering edit mode

Thanks Sean - I was able to figure out where in the ExpressionSet these were based on the great documentation for ExpressionSets. But needed to figure out how to get that into samr.

ADD REPLY
1
Entering edit mode
12.5 years ago
Brian Repko ▴ 10

Apparently the list of geneids and genenames can be added to the x (list) parameter passed into samr methods.

fd <- featureData(eset)    
data <- list(x = x, y = y, logged2 = FALSE, geneid = as.character(pData(fd)[,3], genenames = as.character(pData(fd)[,4])

And that did it (looks like they get reversed in samr code so you'll need to switch the 3 and 4 around)

One can also use the SAM method rather than samr which has explicit parameters listed in the documentation for geneids and genenames.

ADD COMMENT

Login before adding your answer.

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