[Bioc-devel] Listing package-specific methods

Michael Lawrence lawrence.michael at gene.com
Mon Jun 27 20:08:04 CEST 2016

There are two relevant queries:

1) What are the methods where at least one signature component is (or
extends) this class?
2) What are the methods for this class that are defined in a specific package?

#1 is along the lines of what Vince said. I prefer that definition,
because I often want to see the methods that are specific to the
semantics of the subclass. It does not matter which package implements
the methods. I think it could be supported via
methods(class="DESeqDataSet", inherit=FALSE). But we might want a more
convenient interface. Optionally displaying the signatures would also
be good.

One of the problems is that methods are not easily accessible objects
in the search path like ordinary functions. There is no equivalent of
ls(2), and it's tougher to retrieve the definition. Maybe the IDE
could help out? For example, when typing the name of a generic, in
addition to the prompt with argument names, it could list the methods.
Type-ahead could be smart enough to handle method selection. Or, one
could enter a symbol like `findOverlaps,Ranges,Ranges` but the search
would need to be dynamic to handle method selection.

Maybe the generic function could be modeled as a container of its
methods? Like findOverlaps$IRanges (second argument wildcard) or
findOverlaps$"IRanges,IRanges" to further restrict.  Doing the same
from the class perspective semantically clashes with S4. I just don't
like the IRanges$findOverlaps syntax. It also would require formal
treatment of constructors.

On Mon, Jun 27, 2016 at 9:39 AM, Michael Love
<michaelisaiahlove at gmail.com> wrote:
> hi,
> Following on a conversation from Bioc2016, I think it would be good to have
> a function available to Bioconductor users that helps in the following
> situation:
> I'm a user, trying out a new package 'foo', which defines the FooData
> class, that builds on top of SummarizedExperiment. The package author has
> defined a set of methods for the FooData class in the 'foo' package. From
> the R console, I want to see a list of these methods, but I don't want to
> look through the entire list of methods defined for SummarizedExperiment,
> Vector, and Annotated.
> I think such a function should live somewhere easily accessible for
> Bioconductor users. I worked out two implementations of this function which
> you can see here:
> http://rpubs.com/mikelove/pkgmethods
>         [[alternative HTML version deleted]]
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel

More information about the Bioc-devel mailing list