Skip to content

Where should these generics live? #2

@PeteHaitch

Description

@PeteHaitch

matrixStats 'owns' much of the API we (DelayedMatrixStats, matter, etc.) are trying to follow/mimic. The remainder is defined in base (e.g, colSums()); there may be other generics we wish to add (e.g., prcomp()). However, for performance reasons matrixStats uses ordinary functions rather than S4 (or S3). We want generic versions of these functions so that we can write methods that operate on matrix-like data structure; within Bioconductor, this generally means S4 generics but it may be worth also supporting S3 generics.

Based on the discussion in https://stat.ethz.ch/pipermail/bioc-devel/2017-November/012273.html, I think our options are:

  1. Putting the generics in a Bioconductor package:
    a. A stand-alone MatrixGenerics package
    b. Sticking them in BiocGenerics
  2. Putting the generics in a CRAN package:
    a. A stand-alone MatrixGenerics package
    c. Sticking them in the matrixStats package
  3. Putting the generics in a required/recommended package:
    a. Sticking them in the Matrix package
    b. Sticking them in the stats4 package
    c. Sticking them in the the methods package
  • 1a, 1b, and 2a are lightweight since they contain no methods and have minimal dependencies. This also gives us (Bioconductor) the most explicit control.
  • 1a and 2a are similar, but 2a arguably makes it easier for non-BioC packages to incorporate. These require developers to know about yet another package.
  • 2b and 3a introduce dependencies (with compiled code), although Matrix "is 'Recommended' and comes with every R installation". Again, it's worth noting that matrixStats 'owns' much of the API but won't make use of the generics; right now, Matrix will use even less of the API (but of course it could add methods to support Matrix (sub)classes).
  • 3a-c are dependencies included in all R installations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions