[Bioc-devel] Problem with generic methods name conflicts

Vincent Carey stvjc at channing.harvard.edu
Thu Oct 13 17:55:12 CEST 2011


On Thu, Oct 13, 2011 at 11:36 AM, Simon Anders <anders at embl.de> wrote:
> Dear Kaspar and Herb
>
> On 2011-10-13 17:14, Kasper Daniel Hansen wrote:
>>
>> Second I will note (like you have already noticed) that this is a
>> recent addition to Biobase, seemingly coming from the DEseq crowd and
>> that this particular generic is not used at all in Biobase, it just
>> contains the generic.
>>
>> The best solution to this is of course to agree with the other
>> package(s) about the signature of the generic.  You are using
>>   object, ...
>> which to me seems very nice. Biobase is using
>>   cds, normalized=TRUE
>> To me it seems that "object" works better as the function argument of
>> a generic, and that you are right in adding the ....  Also,
>> "normalized=TRUE" seems (to me) to be something that really belongs in
>> the individual method (is this really relevant for all signatures?),
>> so my suggestion would be to adapt your generic into Biobase.  It
>
> I fully agree. Please change the definition in Biobase to
> "counts( object, ...)" and I'll change DESeq/DEXSeq accordingly. That the
> specialized argument 'normalized' turned up in Biobase was an oversight.
>
> To get back to the general discussion: It is an unfortunate property of CLOS
> and S4 that a generic function needs to be defined before one can define
> methods; other language demonstrate that this requirement is not needed.
> (Compare with overloading in C++; the reason we have it in CLOS/S4 is, as
> far as I understand it, solely that the construction allowed to add methods
> without modifying the core language.)
>
> Hence, it seems reasonable to consider the definition of a generic as a mere
> formality without semantic context. This is especially true if multiple
> dispatch is not needed, because then, the standard signature "object, ..."

"object" is here just a parameter name, not a signature.  i believe
this issue is independent of the
concept of multiple dispatch.

> will always to the job. Hence, we could make it a policy that whenever two
> packages both wish to define methods for a generic f, we simply define one
> in Biobase (or maybe, in BiocGenerics) with always the same standard
> signature "object, ...".
>
>  Simon
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>



More information about the Bioc-devel mailing list