[Bioc-devel] Methods to speed up R CMD Check

Murphy, Alan E @@murphy @end|ng |rom |mper|@|@@c@uk
Tue Mar 23 18:05:08 CET 2021


Hey Herv�,

I get the idea now thanks for clarifying. Where do I place the call to ExperimentHub in the package?:

eh <- ExperimentHub()  # the only call to ExperimentHub() in
                          # the entire R session

The package contains calls to the datasets in internal functions, examples, tests and the vignette so eh it would need to be available to all. Sorry I don't have much experience using experiment datasets.

Kind regards,
Alan.

________________________________
From: Herv� Pag�s <hpages.on.github using gmail.com>
Sent: 23 March 2021 16:46
To: Murphy, Alan E <a.murphy using imperial.ac.uk>; Martin Morgan <mtmorgan.bioc using gmail.com>; Kern, Lori <Lori.Shepherd using RoswellPark.org>; bioc-devel using r-project.org <bioc-devel using r-project.org>
Subject: Re: [Bioc-devel] Methods to speed up R CMD Check


*******************
This email originates from outside Imperial. Do not click on links and attachments unless you recognise the sender.
If you trust the sender, add them to your safe senders list https://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address.
*******************
On 3/23/21 4:11 AM, Murphy, Alan E wrote:
> Hi,
>
> Thank you very much Martin and Herv� for your suggestions. I have reverted my zzz.R on load function to that advised by ExperimentHub and had used the ID look up (system.time(tt_alzh <- eh[["EH5373"]])) on internal functions and unit tests. However, the check is still taking ~18 minutes so I need to do a bit more work. Even with my new on load function, calling datasets by name still takes substantially longer, see below for the example Herv� gave on my new code:
>
> a<-function(){
>    eh <- query(ExperimentHub(), "ewceData")

The above line is not needed. Creating an ExperimentHub instance can be
quite expensive and with the current approach 'R CMD check' will do it
dozens of times. My suggestion was to create an ExperimentHub instance
once for all the first time you need it, and reuse it in all your data
access functions:

   eh <- ExperimentHub()  # the only call to ExperimentHub() in
                          # the entire R session

Also there's no need to query(). Just use the EHb ID directly on the
ExperimentHub instance to load your data:

   eh[["EH5373"]]

This should reduce 'R CMD check' by a few more minutes.

H.

--
Herv� Pag�s

Bioconductor Core Team
hpages.on.github using gmail.com

	[[alternative HTML version deleted]]



More information about the Bioc-devel mailing list