[Bioc-devel] recalling methods
stvjc at channing.harvard.edu
Thu Dec 4 19:49:58 CET 2014
fwiw sos::findFn("narrow") produces quite a few hits, including
it may be more effective to parse doc than to hope that the formal metadata
will yield the desired fruit?
On Thu, Dec 4, 2014 at 1:26 PM, Martin Morgan <mtmorgan at fredhutch.org>
> On 12/04/2014 09:56 AM, Michael Love wrote:
>> I was thinking about a request from someone at Bioc2014 (I can't
>> remember at the moment)
>> As an end-user, if I have an object x, how can I *quickly* recall the
>> main methods for that? As in, without breaking my flow and going to
>> ?myClass or help("myClass-class"). Suppose x is a GRanges, how can I
>> remember that there is a method called narrow() which works on x?
>> showMethods(classes=class(x)) will print out a huge list for many
>> complex Bioc classes. And printTo=FALSE turns this huge list into an
>> unhelpful character vector, e.g.:
>>  "" "Function \".asSpace\":"
>>  " <not an S4 generic function>" ""
>>  "Function \".linkToCachedObject<-\":" " <not an S4 generic
>>  "" "Function \".replaceSEW\":"
>> any ideas?
> showMethods(classes="GRanges", where=search())
> But this doesn't get 'narrow()' out of the box because it is inheritted
> (from GenomicRanges) and has not yet been invoked (so you'd be able to
> discover it if you'd used it...)
> cl = c("GRanges", names(getClass("GRanges")@contains))
> showMethods(classes=cl, where=search())
> Yep, that's convenient.
>> Bioc-devel at r-project.org mailing list
> Computational Biology / Fred Hutchinson Cancer Research Center
> 1100 Fairview Ave. N.
> PO Box 19024 Seattle, WA 98109
> Location: Arnold Building M1 B861
> Phone: (206) 667-2793
> Bioc-devel at r-project.org mailing list
[[alternative HTML version deleted]]
More information about the Bioc-devel