Ulrich Bodenhofer
2014-Mar-26 11:26 UTC
[Rd] Conflicting definitions for function redefined as S4 generics
[cross-posted to R-devel and bioc-devel] Hi, I am trying to implement a 'sort' method in one of the CRAN packages I am maintaining ('apcluster'). I started with using setMethod("sort", ...) in my package, which worked fine. Since many users of my package are from the bioinformatics field, I want to ensure that my package works smoothly with Bioconductor. The problem is that the BiocGenerics package also redefines 'sort' as an S4 generic. If I load BiocGenerics before my package, everything is fine. If I load BiocGeneric after I have loaded my package, my setMethod("sort", ...) is overridden by BiocGenerics and does not work anymore. A simple solution would be to import BiocGenerics in my package, but I do not want this, since many of this package's users are outside the bioinformatics domain. Moreover, I am reluctant to include a dependency to a Bioconductor package in a CRAN package. I thought that maybe I could protect my setMethod("sort", ...) from being overridden by BiocGeneric by sealed=TRUE, but that did not work either. Any ideas are gratefully appreciated! Thanks a lot, Ulrich ------------------------------------------------------------------------ *Dr. Ulrich Bodenhofer* Associate Professor Institute of Bioinformatics *Johannes Kepler University* Altenberger Str. 69 4040 Linz, Austria Tel. +43 732 2468 4526 Fax +43 732 2468 4539 bodenhofer at bioinf.jku.at <mailto:bodenhofer at bioinf.jku.at> http://www.bioinf.jku.at/ <http://www.bioinf.jku.at>
Michael Lawrence
2014-Mar-26 11:38 UTC
[Rd] Conflicting definitions for function redefined as S4 generics
The BiocGenerics package was designed to solve this issue within Bioconductor. It wouldn't be the worst thing in the world to depend on the simple BiocGenerics package for now, but ideally the base generics would be defined higher up, perhaps in the methods package itself. Maybe someone else has a more creative solution, but any sort of conditional/dynamic approach would probably be too problematic in comparison. Michael On Wed, Mar 26, 2014 at 4:26 AM, Ulrich Bodenhofer <bodenhofer@bioinf.jku.at> wrote:> [cross-posted to R-devel and bioc-devel] > > Hi, > > I am trying to implement a 'sort' method in one of the CRAN packages I am > maintaining ('apcluster'). I started with using setMethod("sort", ...) in > my package, which worked fine. Since many users of my package are from the > bioinformatics field, I want to ensure that my package works smoothly with > Bioconductor. The problem is that the BiocGenerics package also redefines > 'sort' as an S4 generic. If I load BiocGenerics before my package, > everything is fine. If I load BiocGeneric after I have loaded my package, > my setMethod("sort", ...) is overridden by BiocGenerics and does not work > anymore. A simple solution would be to import BiocGenerics in my package, > but I do not want this, since many of this package's users are outside the > bioinformatics domain. Moreover, I am reluctant to include a dependency to > a Bioconductor package in a CRAN package. I thought that maybe I could > protect my setMethod("sort", ...) from being overridden by BiocGeneric by > sealed=TRUE, but that did not work either. Any ideas are gratefully > appreciated! > > Thanks a lot, > Ulrich > > > ------------------------------------------------------------------------ > *Dr. Ulrich Bodenhofer* > Associate Professor > Institute of Bioinformatics > > *Johannes Kepler University* > Altenberger Str. 69 > 4040 Linz, Austria > > Tel. +43 732 2468 4526 > Fax +43 732 2468 4539 > bodenhofer@bioinf.jku.at <mailto:bodenhofer@bioinf.jku.at> > http://www.bioinf.jku.at/ <http://www.bioinf.jku.at> > > ______________________________________________ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >[[alternative HTML version deleted]]
Possibly Parallel Threads
- Conflicting definitions for function redefined as S4 generics
- [Bioc-devel] Conflicting definitions for function redefined as S4 generics
- Conflicting definitions for function redefined as S4 generics
- Strange, most probably unjustified, codoc mismatch for S4 method with one argument plus '...' (re-try)
- How to address the following: CRAN packages not using Suggests conditionally