[Bioc-sig-seq] Add ability for `subset`ing IRanges-like objects based on their elementMetadata?

Steve Lianoglou mailinglist.honeypot at gmail.com
Sat Jun 5 06:58:46 CEST 2010


Hi,

> My question is, how does one discover that the singe-index square bracket is
> implemented like this for GRanges?   I didn't see any mention of this in
> GenomicRanges.pdf of "?GRanges" .
>
> Are there other methods that do not appear in the documentation, and how can
> I learn about the existence of undocumented method in the future?

There are several ways ... I'm not sure which one I used, but I'm
thinking that I knew it worked with IRanges objects, and GRanges is
something-of an extension to that (in my mind).

Anyway, here are some ways you might have found out:

1. I keep an svn checkout of many of the "core" (for NGS types of
analyses) bioc packages on my cpu that I (i) peruse the source of and
(ii) update often.

You'll find all sorts of interesting stuff in there ;-)

2. Bioconductor heavily uses S4 objects, so you can ask what classes
have implementations of whatever function you're looking for, eg:

R> library(GRanges)
R> showMethods("[")
... you will get mucho output here, some of which looks like:
x="GappedRanges"
x="GRanges"
x="GRangesList"
x="GroupedIRanges"
x="IRanges"

All these classes have their own (or inherited) definitions for the
method in question.

R> getMethod('[', 'GRanges')

will show you the implementation of "[" for objects of type "GRanges"

A slightly different incantation shows you all S4 methods defined on
GRanges objects:

R> showMethods(classes="GRanges")

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the Bioc-sig-sequencing mailing list