[Bioc-devel] eSet extension

Martin Morgan mtmorgan at fhcrc.org
Tue Jul 19 00:55:43 CEST 2011


On 07/18/2011 03:31 PM, Kasper Daniel Hansen wrote:
> On Mon, Jul 18, 2011 at 6:03 PM, Martin Morgan<mtmorgan at fhcrc.org>  wrote:
>> ExpressionSet has some unusual wrinkles. Also, it might make sense to extend
>> NChannelSet instead of eSet.
>
> Thanks a lot, this was super helpful.  Much cleaner than my massive
> code duplication.  You may be rusty on ExpressionSet, but clearly not
> as rusty as I seem to be.
>
> Q: I was under the impression that ExpressionSet is essentially a eSet
> with a forced "exprs".  Why is it unusual (backwards-compabilit) and
> does this mean that I should not look at this class for inspiration
> (and rather looks at eg. NChannelSet).

Yes it's unusual for backward compatibility reasons, and for the special 
way it uses environments to reduce copying. And actually you've hit on a 
key challenge in the original design -- a good S4 class needs to be able 
to be created with new("Foo"), and the original eSet / ExpressionSet had 
signatures that didn't satisfy this. Two things that complicate matters 
are that the benefits of the use of constructors ExpressionSet() weren't 
fully appreciated (so everyone goes around calling new("ExpressionSet", 
...), implying that the initialize method has to do all the work of of 
mapping between interface and implementation). There are also 
significant costs to changing eSet and its interface, in terms of 
serialized (saved to disk) instances of our own and our users, and the 
large amount of code that now uses the current interface.

NChannelSet extends eSet, so you kind of get all the warts anyway; some 
of these are smoothed over so in general it is a better role model.

If you were looking for inspiration on S4, maybe the general design of 
GenomicRanges::SummarizedExperiment as a kind of container class with 
basic accessors, subsetting, etc. For actually clever things, IRanges is 
the place to look.

Martin

>
> I'll look into extending NChannelSet instead of eSet.
>
> Thanks again,
> Kasper


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



More information about the Bioc-devel mailing list