[Bioc-devel] R6 and Bioconductor

Garth Ilsley garth.ilsley at oist.jp
Mon May 15 03:02:13 CEST 2017

Thanks for explaining the context. It helps to understand what Bioconductor developers expect.

> On 05/12/2017 07:11 AM, Martin Morgan wrote:
> > On 05/12/2017 02:05 AM, Garth Ilsley wrote:
> >> Hello,
> >>
> >> I am thinking of creating package for Bioconductor, and I am
> >> wondering about the use of R6 classes (from the R6 package). I do
> >> indeed intend to use existing Bioconductor classes such as
> >> SummarizedExperiment and interact and make use of other Bioconductor
> >> packages, such as scater and DESeq2. This appears to be in accordance
> >> with the guidelines
> >> (https://www.bioconductor.org/developers/package-guidelines/#classes)
> >> , but does the use of R6 classes disqualify the package from being in
> >> Bioconductor? Do I need to write my classes as S4 in order to qualify?
> >>
> >
> > I think there's little value in exposing R6 classes to Bioconductor
> > users, introducing yet another syntax and semantics, and would
> > strongly discourage their use outside the package name space.
> >
> > Inside the package name space the maintainer has more liberty to adopt
> > programming practices that are geared toward correct and efficient
> > implementations; if R6 fills this role (I'm not an expert, but I don't
> > think R6 enforces strong type checking and is not particularly
> > efficient) then it would be appropriate to use them.
> Maybe one additional point is that perhaps 'write my classes' implies that
> you'll be creating new classes; it might often be better to re-use existing
> classes, or worst-case write simple extensions (e.g., an additional slot to
> SummarizedExperiment) to existing classes. In this way you re-use existing
> robust software and don't further overwhelm the cognitive burden placed on
> the user struggling to navigate yet more functionality.

More information about the Bioc-devel mailing list