[Bioc-devel] Need for BiocGenerics?

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Mon Sep 26 16:18:56 CEST 2011


Let me restart this discussion.

There are a number of classes that could be considered core
Bioconductor classes such as phenoData.  I agree that these classes
are better handled with our current setup.  It would make little sense
to separate the IRanges class into a separate package for example.
There are possibly some exceptions, I would like the phenoData class
from Biobase to be more widely used in the sequencing packages, but
that will happen over time (and it might already have happened to some
extent).

My suggestion is really not about the classes, it is about the generics.

I believe that there are many cases where multiple (perhaps competing)
packages would like to have methods called XX.  For example, Martin
mentioned strand, which I disagree is necessarily best handled by
GenomicRanges.  I could see many usecases for a strand generic that
has nothing to do with GenomicRanges.  By gathering those into a small
package with almost no content except the generics we allow
  * more code reuse and better handling of loading several packages.
For example, I am currently developing a package where I want to have
a generic that I just found out is also defined by oligoClasses.  Now,
my package has nothing to do with oligoClasses, so I don't
particularly want to load/import this package just to get the generic.
 This has happened to me many times.
  * better handling of all the functions from "base R" that we always
end up with defining as generics in Bioconductor (for example, all the
ones from IRanges)
  * we also provide an easy way to get an overview of core
Bioconductor methods that package developers ought to consider
supporting.  For example, I think sampleNames() should be supported by
most (all?) classes dealing with data.  Having a sampleNames generic
in a basic package would make it easy for new developers to see that
this is a method they might consider supporting.

Now, Vince is raising the issue that what we have now works well.  My
opinion is that as Bioconductor grows, I see this becoming a possible
larger problem which is really just caused by how R handles generics
(not that I have any great idea on how this could be handled better).
We should of course think about how the signature of the generic is
defined.  I also think that doing this should be relatively little
work.

Kasper



More information about the Bioc-devel mailing list