Wolfgang Huber
2009-Feb-25 18:15 UTC
[Rd] Unexpected side effect of the ":::" operator on the value of isGeneric
Hi, when running the following on a fresh R, library("IRanges") annotation showMethods("annotation") Biobase:::annotation showMethods("annotation") I get (see the "^^^^^" marked output at the bottom):> library("IRanges")Carico il pacchetto richiesto: 'IRanges' The following object(s) are masked from package:base : cbind, order, pmax, pmax.int, pmin, pmin.int, rbind, rep.int, table> annotationstandardGeneric for "annotation" defined from package "IRanges" function (x, ...) standardGeneric("annotation") <environment: 0x1a302b0> Methods may be defined for arguments: x Use showMethods("annotation") for currently available ones.> showMethods("annotation")Function: annotation (package IRanges) x="AnnotatedList"> Biobase:::annotationstandardGeneric for "annotation" defined from package "Biobase" function (object) standardGeneric("annotation") <environment: 0x205cee0> Methods may be defined for arguments: object Use showMethods("annotation") for currently available ones.> showMethods("annotation")Function "annotation": <not a generic function> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It seems that the value of isGeneric("annotation"), when it is called within showMethods, is FALSE, while it is TRUE when called outside.> sessionInfo()R version 2.9.0 Under development (unstable) (2009-02-25 r48007) x86_64-unknown-linux-gnu locale: 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 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] IRanges_1.1.40 loaded via a namespace (and not attached): [1] Biobase_2.3.10 Best wishes Wolfgang ------------------------------------------------------------------ Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber
Martin Maechler
2009-Feb-28 11:34 UTC
[Rd] Unexpected side effect of the ":::" operator on the value of isGeneric
>>>>> "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