[Bioc-devel] BiocGenerics attach when GenomicFeatures imported

Hervé Pagès hpages at fredhutch.org
Mon Oct 19 23:56:46 CEST 2015


Hi Marcin,

On 10/19/2015 05:11 AM, Marcin Cieślik wrote:
> Dear Bioc Developers,
>
> I am developing a package that depends on GenomicFeatures which I am adding
> to my package using Imports: and import(GenomicFeatures). However, when I
> use the "genes" function the "BiocGenerics" package gets attached (I am not
> adding BiocGenerics to my Depends:).

Not sure exactly what you mean by "use the genes() function". Do you
mean when you add an internal call to genes() in one of the functions
of your package? Are you saying that before you add that call, when you
install and load your package BiocGenerics doesn't get attached (only
loaded via a namespace), but after you add the call to genes() and
re-install and re-load your package, BiocGenerics now gets attached?
I would be surprised if that was the case.

However, if by "use the genes() function" you mean use the genes()
function in an example or in the vignette then running the example or
the code in the vignette will necessarily attach GenomicFeatures and
consequently BiocGenerics (which GenomicFeatures depends on via the
Depends field).

Please clarify in which context you "use the genes() function". Also
please show your DESCRIPTION file.

>
> Am I missing something? Why would a package be non-explicitly attached?

There could be several reasons for that:

- your package could depend (via the Depends field) on a package that
   depends itself (via the Depends field again) directly or indirectly
   on BiocGenerics

- one of the functions in your package could use an explicit call
   to library() or require() to attach a package that depends directly
   or indirectly (via the Depends field) on BiocGenerics

- not sure what happens exactly if your package contains a dataset
   that is a serialized instance of a class defined in a package
   that depends directly or indirectly (via the Depends field) on
   BiocGenerics, but that could be another reason or at least something
   to investigate

Hard to know exactly what's going on in your case without more
information.

Thanks,
H.

>
> Yours,
> Marcin
>
> A tiny hopefully reproducible example:
>
> download package:
> https://drive.google.com/open?id=0B_OomVx_ca5wcEVmR3JVMWp5YTA
> R CMD INSTALL /mctp/users/mcieslik/attch_0.0.0.9000.tar.gz
> from R:
> library(attch)
> att()
> Attaching package: ‘BiocGenerics’
>
> The following objects are masked from ‘package:parallel’:
> ....
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioc-devel mailing list