Re: [Rd] Unexpected side effect of the ":::" operator on the value of isGeneric

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Sat, 28 Feb 2009 12:34:39 +0100

>>>>> "Wolfi" == Wolfgang Huber <huber_at_ebi.ac.uk> >>>>> on Wed, 25 Feb 2009 18:15:03 +0000 writes:

    Wolfi> Hi,
    Wolfi> when running the following on a fresh R,

    Wolfi> library("IRanges")
    Wolfi> annotation
    Wolfi> showMethods("annotation")
    Wolfi> Biobase:::annotation
    Wolfi> showMethods("annotation")


    Wolfi> I get (see the "^^^^^" marked output at the bottom):


>> library("IRanges")

    Wolfi> Carico il pacchetto richiesto: 'IRanges'

    Wolfi> The following object(s) are masked from package:base :

    Wolfi> cbind,
    Wolfi> order,
    Wolfi> pmax,
    Wolfi> pmax.int,
    Wolfi> pmin,
    Wolfi> pmin.int,
    Wolfi> rbind,
    Wolfi> rep.int,
    Wolfi> table

>> annotation

    Wolfi> standardGeneric for "annotation" defined from package "IRanges"

    Wolfi> function (x, ...)
    Wolfi> standardGeneric("annotation")
    Wolfi> <environment: 0x1a302b0>
    Wolfi> Methods may be defined for arguments: x
    Wolfi> Use  showMethods("annotation")  for currently available ones.

>> showMethods("annotation")

    Wolfi> Function: annotation (package IRanges)     Wolfi> x="AnnotatedList"

>> Biobase:::annotation

    Wolfi> standardGeneric for "annotation" defined from package "Biobase"

    Wolfi> function (object)
    Wolfi> standardGeneric("annotation")
    Wolfi> <environment: 0x205cee0>
    Wolfi> Methods may be defined for arguments: object
    Wolfi> Use  showMethods("annotation")  for currently available ones.

>> showMethods("annotation")

    Wolfi> Function "annotation":
    Wolfi> <not a generic function>
    Wolfi> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


    Wolfi> It seems that the value of isGeneric("annotation"), when it is called     Wolfi> within showMethods, is FALSE, while it is TRUE when called outside.

Hi Wolfgang,

I have looked at the NAMESPACE files of the two packages Biobase and IRanges, (the Bioconductor development version in SVN), and I think the problem might result from the fact that IRanges does export the annotation generic, does not exportMethods( ... annotation ...).

OTOH, Biobase exportMethods( annotation ) only [but not the generic]. and then both packages do not at all mention each other, neither in DESCRIPTION nor NAMESPACE.

Either you are talking about conceptually the same generic annotation(); in that case one package needs to import*() it from the other,
or then you have two completely different animals, but then (masking) problems are unavoidable
-- in spite of the fact that I vaguely remember that some

   Bioconductor developers repeatedly emphasize that these    problems are not problems for them  

Martin

>> sessionInfo()

    Wolfi> R version 2.9.0 Under development (unstable) (2009-02-25 r48007)     Wolfi> x86_64-unknown-linux-gnu

    Wolfi> locale:
    Wolfi> LC_CTYPE=it_IT.UTF-8;LC_NUMERIC=C;LC_TIME=it_IT.UTF-8;LC_COLLATE=it_IT.UTF-8;LC_MONETARY=C;LC_MESSAGES=it_IT.UTF-8;LC_PAPER=it_IT.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=it_IT.UTF-8;LC_IDENTIFICATION=C

    Wolfi> attached base packages:
    Wolfi> [1] stats graphics grDevices utils datasets methods base

    Wolfi> other attached packages:
    Wolfi> [1] IRanges_1.1.40

    Wolfi> loaded via a namespace (and not attached):     Wolfi> [1] Biobase_2.3.10

    Wolfi> Best wishes
    Wolfi> Wolfgang

    Wolfi> ------------------------------------------------------------------
    Wolfi> Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber
    Wolfi> ______________________________________________
    Wolfi> R-devel_at_r-project.org mailing list     Wolfi> https://stat.ethz.ch/mailman/listinfo/r-devel

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 28 Feb 2009 - 10:37:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 28 Feb 2009 - 22:30:46 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive