[BioC] Confused about IRanges::nearest, precede, follow functions/docs.
mailinglist.honeypot at gmail.com
Thu Dec 30 17:33:53 CET 2010
Thanks for the update.
On Wed, Dec 29, 2010 at 6:50 PM, Michael Lawrence
<lawrence.michael at gene.com> wrote:
> Thanks Steve. Yes, the docs had it backwards. It was already fixed in devel;
> I just pushed it back to release. Sorry that this consumed your time.
> On Tue, Dec 28, 2010 at 9:28 AM, Steve Lianoglou
> <mailinglist.honeypot at gmail.com> wrote:
>> I think the holiday-over-eating is affecting my reading comprehension
>> skills. I'm having problems groking the documentation/functionality of
>> (for instance) precede, as it seems to return an integer vector that's
>> "backwards to" the documentation.
>> For instance, for `precede(x, subject)`, the docs say:
>> precede returns an integer vector of the index of range in subject
>> that ends before and closest to the start of each range in x. Note
>> that any overlapping ranges are excluded. NA is returned when there
>> are no qualifying ranges in subject.
>> I am expecting an integer vector that is as long as x that indexes
>> *into* the subject ranges. I'm getting that, but I also expect that
>> the i'th value of the returned integer vector should be the index into
>> `subject` that is closest to and precedes the i'th range in x.
>> Using the second example from the docs, we don't get this at all ...
>> in fact we get something of the opposite:
>> query <- IRanges(c(1, 3, 9), c(3, 7, 10))
>> subject <- IRanges(c(3, 2, 10), c(3, 13, 12))
>> p <- precede(query, subject) # c(3L, 3L, NA)
>> The way I'm reading the docs, shouldn't p indicate that
>> subject[p] "ends before and [is] closest to" query? The returned
>> vector is rather telling me that query precedes subject[p].
>> So, shouldn't the docs read something more like "precede returns an
>> integer vector of the index into the range of `subject` that
>> immediately follows the corresponding range in x (the query) ...
>> overlaps ignored, etc." Or something similar, no?
>> R> sessionInfo()
>> R version 2.12.1 (2010-12-16)
>> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>>  en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>> attached base packages:
>>  stats graphics grDevices utils datasets methods base
>> other attached packages:
>>  IRanges_1.8.7
>> loaded via a namespace (and not attached):
>>  tools_2.12.1
>> 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
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> Search the archives:
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 Bioconductor