Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-27 Thread Michael Lawrence
On Wed, Apr 27, 2016 at 10:52 AM, Hervé Pagès wrote: > On 04/27/2016 04:24 AM, Michael Lawrence wrote: >> >> On Tue, Apr 26, 2016 at 11:12 PM, Hervé Pagès >> wrote: >>> >>> Hi, >>> >>> I would not discard defining a SummarizedExperiment subclass so quickly. >>> SummarizedExperiment is very generi

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-27 Thread Hervé Pagès
On 04/27/2016 04:24 AM, Michael Lawrence wrote: On Tue, Apr 26, 2016 at 11:12 PM, Hervé Pagès wrote: Hi, I would not discard defining a SummarizedExperiment subclass so quickly. SummarizedExperiment is very generic and can contain any kind of data. IIUC the csaw package uses SummarizedExperime

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-27 Thread Hervé Pagès
On 04/27/2016 03:18 AM, Martin Morgan wrote: On 04/27/2016 02:12 AM, Hervé Pagès wrote: Hi, I would not discard defining a SummarizedExperiment subclass so quickly. SummarizedExperiment is very generic and can contain any kind of data. IIUC the csaw package uses SummarizedExperiment to stor

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-27 Thread Kasper Daniel Hansen
I agree with Herve that making a subclass (is that the technical term?) might be a good idea. This is what I would do. And this is what has been done historically for all the extensions of ExpressionSet and eSet from Biobase. The issue with a general class like SummarizedExperiment is that metho

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-27 Thread Michael Lawrence
On Tue, Apr 26, 2016 at 11:12 PM, Hervé Pagès wrote: > Hi, > > I would not discard defining a SummarizedExperiment subclass so quickly. > SummarizedExperiment is very generic and can contain any kind of data. > IIUC the csaw package uses SummarizedExperiment to store a particular > kind of data (C

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-27 Thread Martin Morgan
On 04/27/2016 02:12 AM, Hervé Pagès wrote: Hi, I would not discard defining a SummarizedExperiment subclass so quickly. SummarizedExperiment is very generic and can contain any kind of data. IIUC the csaw package uses SummarizedExperiment to store a particular kind of data (ChIP-seq data) and

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-27 Thread Aaron Lun
OTOH introducing a "straight" subclass only to define one specialized method on it (the "normalize" method in this case) might not be worth it since there is a cost for such class, even if that cost is minimal: a cost for the user (one new container/constructor to deal with) and a cost for the dev

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-26 Thread Hervé Pagès
Hi, I would not discard defining a SummarizedExperiment subclass so quickly. SummarizedExperiment is very generic and can contain any kind of data. IIUC the csaw package uses SummarizedExperiment to store a particular kind of data (ChIP-seq data) and I believe specialization is a legitimate situa

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-26 Thread Aaron Lun
Yes, but "monkeyBars" doesn't have quite the same pithiness for a package name. Anyway, the dual dispatch mechanism sounds most interesting. I assume that means we'd have to define some sort of base "normalizeParam" class, and then derive "csawNormParam" and "swingsNormParam" subclasses, so that s

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-26 Thread Martin Morgan
On 04/26/2016 05:28 PM, Michael Lawrence wrote: > On Tue, Apr 26, 2016 at 2:16 PM, Martin Morgan > wrote: >> > >> >On 04/26/2016 04:47 PM, Michael Lawrence wrote: >>> >> >>> >>On Tue, Apr 26, 2016 at 11:00 AM, Aaron Lun wrote: ... >>>BiocGenerics. However, if some other hypothetical packa

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-26 Thread Michael Lawrence
On Tue, Apr 26, 2016 at 2:16 PM, Martin Morgan wrote: > > > On 04/26/2016 04:47 PM, Michael Lawrence wrote: >> >> On Tue, Apr 26, 2016 at 11:00 AM, Aaron Lun wrote: >>> >>> Dear List, >>> >>> When a S4 method for the same class is defined in two separate packages >>> (i.e., under the same generic

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-26 Thread Martin Morgan
On 04/26/2016 04:47 PM, Michael Lawrence wrote: On Tue, Apr 26, 2016 at 11:00 AM, Aaron Lun wrote: Dear List, When a S4 method for the same class is defined in two separate packages (i.e., under the same generic), and both packages are loaded into a R session, it seems that the method from t

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-26 Thread Michael Lawrence
On Tue, Apr 26, 2016 at 11:00 AM, Aaron Lun wrote: > Dear List, > > When a S4 method for the same class is defined in two separate packages > (i.e., under the same generic), and both packages are loaded into a R > session, it seems that the method from the package loaded later clobbers the > metho

Re: [Bioc-devel] avoiding clashes of different S4 methods with the same generic

2016-04-26 Thread Aaron Lun
Dear List, When a S4 method for the same class is defined in two separate packages (i.e., under the same generic), and both packages are loaded into a R session, it seems that the method from the package loaded later clobbers the method from the package loaded first. Is it possible to specific