[BioC] Annotation.db: how automatically call a mapping?

Marc Carlson mcarlson at fhcrc.org
Mon Jun 29 22:29:46 CEST 2009


Hi Guido,

The trouble you were having here was because gh[33] is a character
vector.  You can check this by calling class(gh[33]).  My bet is that R
will say:  [1] "character" when you do this which will indicate that
gh[33] is a "character" and not an "AnnDbBimap".  To make this work you
have to get the appropriate object that was created when you loaded the
moe430a.db package, and that object must be an "AnnDbBimap".

The get() function will do that for you and return the appropriate
"AnnDbBimap" object which is why this works.  You may have already
figured all of that out, but I am adding these comments here so that
others who stumble onto this thread later can learn.

  Marc




Hooiveld, Guido wrote:
> Thanks. This indeed does work!
>
> G
>
>  
>
>   
>> -----Original Message-----
>> From: bioconductor-bounces at stat.math.ethz.ch 
>> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of 
>> John Zhang
>> Sent: 29 June 2009 21:51
>> To: bioconductor at stat.math.ethz.ch; Hooiveld, Guido
>> Subject: Re: [BioC] Annotation.db: how automatically call a mapping?
>>
>>
>>     
>>>> symbols <- mget(probeids, gh[33])
>>>>         
>>> Error in mget(probeids, gh[33]) : second argument must be an 
>>> environment
>>>       
>> Have you tried 
>>
>> symbols <- mget(probeids, get(gh[33]))
>>
>>
>>     
>>> This also doesn't work:
>>>       
>>>> symbols <- mget(probeids, envir=gh[33])
>>>>         
>>> Error in mget(probeids, envir = gh[33]) : 
>>>  second argument must be an environment
>>>
>>> My approach thus is the wrong approach to automatically extract 
>>> mappings from a annotation.db.
>>> Since i don't know about any other possibility, i would 
>>>       
>> appreciate if 
>>     
>>> someone could point me to a working solution.
>>>
>>> Thanks,
>>> Guido
>>>
>>>
>>> ------------------------------------------------ 
>>> Guido Hooiveld, PhD 
>>> Nutrition, Metabolism & Genomics Group 
>>> Division of Human Nutrition 
>>> Wageningen University 
>>> Biotechnion, Bomenweg 2 
>>> NL-6703 HD Wageningen 
>>> the Netherlands 
>>> tel: (+)31 317 485788 
>>> fax: (+)31 317 483342 
>>> internet:   http://nutrigene.4t.com <http://nutrigene.4t.com/>  
>>> email:      guido.hooiveld at wur.nl 
>>>
>>>
>>>
>>> 	[[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> Bioconductor mailing list
>>> Bioconductor at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>> Search the archives: 
>>>       
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>> Jianhua Zhang
>> Department of Medical Oncology
>> Dana-Farber Cancer Institute
>> 44 Binney Street
>> Boston, MA 02115-6084
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives: 
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>>
>>     
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>
>



More information about the Bioconductor mailing list