[Bioc-devel] NAMESPACE question
mtmorgan at fhcrc.org
Mon Oct 6 19:24:23 CEST 2014
On 10/05/2014 01:39 PM, Robert Castelo wrote:
> i have the following warning message when installing the devel version
> (0.99.5) of my package 'qpgraph':
> ** testing if installed package can be loaded
> Warning: replacing previous import by 'IRanges::as.vector' when loading
> * DONE (qpgraph)
> after investigating the issue i think it has to do with the fact that in
> the NAMESPACE of 'qpgraph' i'm importing the whole Matrix package and
> later the 'as.vector()' method defined in IRanges. The NAMESPACE file
> looks like this:
> ... (few lines later) ...
> ... (rest of the file) ...
> from what i have learned while reading documentation and googling about
> this issue, it seems that the solution would be to import every
> function/method i use from Matrix before i do the import from IRanges,
> but i use the dspMatrix-class all over the package and i don't know how
> would i find out what set of functions/methods i have to explicitly
> import. i can import a few of the methods from Matrix i know from the
> top of my head that the package is using but i'm afraid i'll be missing
> other methods that will break the package when using it in situations
> outside current examples and unit tests.
> i'd appreciate if you have a suggestion about what to do in this situation.
There are two 'as.vector' generics, one defined in Matrix and one in
BiocGenerics (and made available via IRanges). These generics have different methods
Function: as.vector (package base)
Function: as.vector (package BiocGenerics)
so it's important that your code clearly distinguish between generics. One
possibility is to remove importMethodsFrom(IRanges, as.vector) from the
NAMESPACE, and explicitly use IRanges::as.vector(...) in your code.
codetoolsBioC::writeNamespaceImports("qpgraph") might provide you with some
guidance (it's not 100% reliable; available via svn at
what functionality is being imported.
> [[alternative HTML version deleted]]
> Bioc-devel at r-project.org mailing list
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109
Location: Arnold Building M1 B861
Phone: (206) 667-2793
More information about the Bioc-devel