[Bioc-devel] Biobase/IRanges annotation maksing
mtmorgan at fhcrc.org
Wed Feb 18 15:54:48 CET 2009
Laurent Gatto <l.gatto at dnavision.be> writes:
> Dear Bioc developeRs,
> I noted recently that Biobase's 'annotation' and 'annotation<-' objects are
> masked by IRanges. Now calling annotation(AffyBatch), of
> annotation(ExpressionSet) throws an 'unable to find an inherited method for
> function "annotation", for signature "AffyBatch"' error.
> Some of my functions fail because they rely on functions that call
> My questions are (1) is this the expected behaviour and if yes (2) how am I
> and/or upstream maintainers supposed to elegantly deal with it?
Hi Laurent -- I just came across this issue myself -- package A failed
because it called a function in package B which had a dependency on
package C which, due to changes in package D, now attached IRanges to
the search path. Package B then found IRange::annotation on the search
path, instead of Biobase::annotation.
The solution was easy, in the end -- add
to the NAMESPACE of package B, and move Biobase from 'Depends:' to
'Imports:' in package B, which is definitely the Right Thing To Do. It
doesn't matter now that IRanges is on the user search path, package B
always gets the function it wants.
The solution is less elegant for a function that is not in a name
space, e.g., because the user is writing it in the global environment,
as in your example below. Then the solution is to use
in place of annotation(eset).
There might be additional technical solutions that Biobase / IRanges /
Biostrings package authors can explore for this particular case...
> Illustrative code and sessionInfo are given below.
> I hope that I am not missing anything obvious here.
> Thank you in advance.
> -- R code ---------------------------------------
>> update.packages(rep=biocinstallRepos(), ask=FALSE)
> Loading required package: affy
> Loading required package: Biobase
> Welcome to Bioconductor
> Vignettes contain introductory material. To view, type
> 'openVignette()'. To cite Bioconductor, see
> 'citation("Biobase")' and for packages 'citation(pkgname)'.
>  "hgu95av2"
> Attaching package: 'IRanges'
> The following object(s) are masked from package:Biobase :
> The following object(s) are masked from package:base :
> Error in function (classes, fdef, mtable) :
> unable to find an inherited method for function "annotation", for signature
>  "hgu95av2"
> R version 2.9.0 Under development (unstable) (2009-02-12 r47911)
> attached base packages:
>  stats graphics grDevices utils datasets methods base
> other attached packages:
>  IRanges_1.1.38 affydata_1.11.3 affy_1.21.7 Biobase_2.3.10
> loaded via a namespace (and not attached):
>  affyio_1.11.3 preprocessCore_1.5.3 tools_2.9.0
> Bioc-devel at stat.math.ethz.ch mailing list
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109
Location: Arnold Building M2 B169
Phone: (206) 667-2793
More information about the Bioc-devel