Skip to content

[Bioc-devel] The ShortRead::chromosome function

2 messages · Steve Lianoglou, Martin Morgan

#
Howdy,

I'm developing a package that defines a `chromosome` function. Since
the `setGeneric("chromosome")` is already defined in ShortRead, my
package lists ShortRead in the Imports of the DESCRIPTION, and also
has an importFrom(ShortRead, chromosome) in my NAMESPACE.

I also have an exportMethods(..., chromosome, ...) in my NAMESPACE so
that people can use this function when loading my library, but this
function isn't actually being exported into "the works."

I looked back at the ShortRead package, and realize that the
`chromosome` function is not listed in the `exportMethods` clause of
its NAMESPACE. Is this why that's happening? Shouldn't `chromosome` be
listed in the ShortRead NAMESPACE file, anyway?

Thanks,

-steve
#
On 12/10/2010 11:25 AM, Steve Lianoglou wrote:
Hi Steve --

I think what is going on is that exportMethod adds your method to the
'chromosome' generic. While the 'chromosome' generic is visible inside
your package, it is not, unfortunately, available to the user. E.g., if
the user were to then library(ShortRead), my guess is they'd see your
chromosome method.

You'll want  to either re-export the generic export(chromosome) or make
the chromosome generic visible to the user by having your package
Depend: on ShortRead.

A consequence of exporting the chromosome generic is that R CMD check
will warn that you need to document it; it's not really clear what your
documentation would be -- see ShortRead::chromosome ?

Martin