[BioC] specifying metadata packages on the fly

Seth Falcon sfalcon at fhcrc.org
Thu Jun 14 06:07:33 CEST 2007

"James W. MacDonald" <jmacdon at med.umich.edu> writes:

> Hi Tae-Hoon,
> Tae-Hoon Chung wrote:
>> Hi, All;
>> I have some probe ids say in HG-U133 Plus2 chips and I want to  
>> retrieve the gene names attached to them. This can be done like get 
>> ('239651_at', hgu133plus2SYMBOL). But when I tried get('239651_at',  
>> paste('hgu133plus2', 'SYMBOL', sep='')), this one failed. Is there  
>> any way I can make the latter approach work? The thing is I know the  
>> package is 'hgu133plus2' but, depending on the situation, I want to  
>> use different suffixes such as 'SYMBOL', 'ACCNUM', 'ENTREZID'  
>> interchangeably. Thanks in advance!
> You are missing a get() statement. Note the following:
>  > library(hgu133plus2)
>  > paste("hgu133plus2", "SYMBOL", sep="")
> [1] "hgu133plus2SYMBOL"
>  > get(paste("hgu133plus2", "SYMBOL", sep=""))
> <environment: 0x0178922c>
>  > get("1007_s_at", get(paste("hgu133plus2", "SYMBOL", sep="")))
> [1] "DDR1"

In the latest release of the annotate package there is a function
called getAnnMap.  With it, you can do:

> getAnnMap("SYMBOL", "hgu95av2")
<environment: 0x39c56b4>

and so on.  This function is recommended especially for scripts and
package code because it provides an interface between what the objects
are actually called and how you ask for them...

+ seth

Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center

More information about the Bioconductor mailing list