Skip to content
Prev 1819 / 21312 Next

[Bioc-devel] Biobase/IRanges annotation maksing

Wolfgang Huber <huber at ebi.ac.uk> writes:
Hi Wolfgang --

Not exactly sure what you're getting at here (which doesn't bode well
for common sense on my part, I guess); I read this as saying these
functions might be 'regular', and not generic at all. But as you know

* Methods are not restricted to definition in the package of the
generic. So there are two methods on Biobase::annotation after
library(GSEABase), three after library(affyPLM), etc.

* Generics provide type checking that is useful even when there is a
single method (e.g., Biobase::annotation does not operate on, say, a
data.frame).

* Generics help to define an API (e.g., Biobase::annotation's single
method operates on 4 different classes defined in Biobase). The API
can be discovered programmatically, modulo the quirks of showMethod
(the 'where' argument can be useful under the current regime).

* Two identically named regular functions would conflict in the same
way, except perhaps without notifying the user.

Also worth reiterating that the example I mentioned pointed to a bug
(relying on user search path for function discovery) that has been
resolved through use of a name space and 'imports'. 

End users still have to contend with the competing functions (using
Biobase::annotation to disambiguate). This is unfortunate and perhaps
amenable to common sense, but independent of S4 / generics.

Martin