[BioC] dynamic mget with affy annotation
Robert Gentleman
rgentlem at fhcrc.org
Thu Jun 9 16:09:12 CEST 2005
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 at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
>
More information about the Bioconductor
mailing list