dynamic mget with affy annotation
1
0
Entering edit mode
@jacob-michaelson-1079
Last seen 10.2 years ago
Hi all, I'm trying to set up some code that will automatically check the "annotation" component of an exprSet and then properly choose the symbol in an mget statement which will then properly label a heatmap (gene symbols instead of probe ids). Here's what I've got: R>library(annotation(exprset), character.only=T) ##load the proper annotation library This is what I want to accomplish (this is how it works without the "dynamic" mget call): R>heatmap(exprs(exprset[as.numeric(rownames(topTable (fit2,coef=2,n=50)))]), labRow=mget((topTable(fit2,coef=1,n=50))$ID, env = hgu95av2SYMBOL), col = cm.colors(256)) I've tried things like "paste" and "cat" to concatenate "<annotation name="">" and "SYMBOL" for the env = argument of mget, but nothing seems to achieve the same affect as typing it in. I've tried everything I can think of, like sticking as.name, as. environment (it complains if it's not an environment) out front. I know these are just shots in the dark, but I'm not sure what else to try. Any experienced R users have any ideas? Thanks in advance, Jake
probe probe • 1.1k views
ADD COMMENT
0
Entering edit mode
rgentleman ★ 5.5k
@rgentleman-7725
Last seen 9.6 years ago
United States
You were close it seems - mget("1001_at", get(paste("hgu95av2", "SYMBOL", sep=""))) you need to "get" the environment - so you have the object, not the name of the object (and you need to make sure you use sep="" in your call to paste). Of course there are many other ways to do this (do.call is an easy one). Jacob Michaelson wrote: > Hi all, > > I'm trying to set up some code that will automatically check the > "annotation" component of an exprSet and then properly choose the > symbol in an mget statement which will then properly label a heatmap > (gene symbols instead of probe ids). Here's what I've got: > > R>library(annotation(exprset), character.only=T) ##load the proper > annotation library > > This is what I want to accomplish (this is how it works without the > "dynamic" mget call): > > R>heatmap(exprs(exprset[as.numeric(rownames(topTable > (fit2,coef=2,n=50)))]), labRow=mget((topTable(fit2,coef=1,n=50))$ID, > env = hgu95av2SYMBOL), col = cm.colors(256)) > > I've tried things like "paste" and "cat" to concatenate "<annotation> name>" and "SYMBOL" for the env = argument of mget, but nothing seems > to achieve the same affect as typing it in. I've tried everything I > can think of, like sticking as.name, as. environment (it complains if > it's not an environment) out front. I know these are just shots in the > dark, but I'm not sure what else to try. > > Any experienced R users have any ideas? > > Thanks in advance, > > Jake > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor >
ADD COMMENT

Login before adding your answer.

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