[Bioc-devel] get rid of require/depends warning

Paolo Sonego paolo.sonego at gmail.com
Sat Dec 12 14:57:28 CET 2009


Dear Seth,

Thanks so much! You identifiedmy intention correctly and your suggestion 
solved my problem!

Regards,
Paolo

On 12/12/09 12:00 PM, bioc-devel-request at stat.math.ethz.ch wrote:
> Send Bioc-devel mailing list submissions to
> 	bioc-devel at stat.math.ethz.ch
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://stat.ethz.ch/mailman/listinfo/bioc-devel
> or, via email, send a message with subject or body 'help' to
> 	bioc-devel-request at stat.math.ethz.ch
>
> You can reach the person managing the list at
> 	bioc-devel-owner at stat.math.ethz.ch
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Bioc-devel digest..."
>
>
> Today's Topics:
>
>     1. Re: get rid of require/depends warning (Paolo Sonego)
>     2. Re: get rid of require/depends warning (Seth Falcon)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 11 Dec 2009 15:03:46 +0100
> From: Paolo Sonego<paolo.sonego at gmail.com>
> Subject: Re: [Bioc-devel] get rid of require/depends warning
> To: bioc-devel at stat.math.ethz.ch
> Cc: sfalcon at fhcrc.org
> Message-ID:<4B225142.5060400 at gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Dear Seth,
> Thanks for the useful suggestions. I'm digging the source code of the
> annotate package, it seems really interesting...
> Below a chunk of my code that use require:
>
> imp.data<- function(...){
>       # importing raw.data
>       ...
>       ...
>       ## load the proper annotation package regardless the technology
>       if( !grepl("\\.db", raw.data at annotation) ) {
>           raw.data at annotation<- paste(raw.data at annotation, ".db", sep="")
>       }
>       require( raw.data at annotation, character.only=T )
>
>       return(raw.data)
> }
>
> raw.data is an object of class 'ExpressionSet'.
>
> Thanks again for the help!
>
> Regards,
> Paolo
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 11 Dec 2009 14:04:56 -0800
> From: Seth Falcon<sfalcon at fhcrc.org>
> Subject: Re: [Bioc-devel] get rid of require/depends warning
> To: bioc-devel at stat.math.ethz.ch
> Message-ID:<4B22C208.30507 at fhcrc.org>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> On 12/11/09 6:03 AM, Paolo Sonego wrote:
>    
>> Dear Seth,
>> Thanks for the useful suggestions. I'm digging the source code of the
>> annotate package, it seems really interesting...
>> Below a chunk of my code that use require:
>>
>> imp.data<- function(...){
>> # importing raw.data
>> ...
>> ...
>> ## load the proper annotation package regardless the technology
>> if( !grepl("\\.db", raw.data at annotation) ) {
>> raw.data at annotation<- paste(raw.data at annotation, ".db", sep="")
>> }
>> require( raw.data at annotation, character.only=T )
>>
>> return(raw.data)
>> }
>>      
> You can avoid the warning by specifying character.only=TRUE.  The check
> actually examines the source code for TRUE so T will not work to avoid
> the warning message.
>
> That said, based on your example, it looks like your actual goal is to
> dynamically load annotation packages.  If that is the case, I would
> recommend using the code that already does this for you in the annotate
> package, and in particular the getAnnMap function might be of use.
>
> One advantage of using the annotate functions is that you should not
> have to worry about the ".db" extension, those functions should figure
> out the right thing.
>
> Best,
>
> + seth
>
>



More information about the Bioc-devel mailing list