[Bioc-devel] mapping between original and reduced ranges

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Wed Mar 14 21:40:52 CET 2012


We have discussed this a couple of times.  I routinely uses the reduce
followed by findOverlaps paradigm.  As Malcolm says it feels wrong,
but from a practical point of view it is pretty fast, so I stopped
worrying about it.  I only think there is a reason to do this, if it
is substantially faster.

Kasper

On Wed, Mar 14, 2012 at 3:46 PM, Cook, Malcolm <MEC at stowers.org> wrote:
> Chiming in....
>
> on a similar note....
>
> A version of `disjoin` which returns a Hits/RangesMapping additional to the GRanges result would be most useful  and probably not require much additional effort (assuming `disjoin` computes this internally)
>
> Of course, it is easy to live without since I can just perform the findOverlaps myself after the disjoin.... it just "feels wrong" (tm)
>
> Ahoy!
>
> ~Malcolm
>
>
>> -----Original Message-----
>> From: bioc-devel-bounces at r-project.org [mailto:bioc-devel-bounces at r-
>> project.org] On Behalf Of Hahne, Florian
>> Sent: Wednesday, March 14, 2012 2:22 PM
>> To: bioc-devel at r-project.org
>> Subject: [Bioc-devel] mapping between original and reduced ranges
>>
>> This bounced before, guess the mailing list does not like HTML mails. So
>> one more try:
>>
>> I had the following offline discussion with Michael about how one could
>> retain a mapping of the ranges in a GRanges object before and after
>> reduce. He suggested to take it to the list. Is that something that could
>> be added to GenomicRanges/IRanges?
>> Florian
>>
>> I have a slightly tricky application for which I need to reduce a GRanges
>> object, but I would like to be able to process some of the original
>> elementMetadata of the merged ranges later. The only way I was able to
>> figure out which of the original ranges correspond to the merged ranges
>> was to perform a findOverlaps operation, but of course that is rather
>> costly. Is there a way to get the merge information out of the original
>> reduce call?
>> Here is a brief example:
>>
>> gr <- GRanges(seqnames="chr1", ranges=IRanges(start=c(1,6,12,24,27),
>> width=5), foo=1:5, bar=letters[1:5])
>> gr2 <- reduce(gr, min.gapwidth=1)
>> ind <- queryHits(findOverlaps(gr2, gr))
>> split(values(gr), ind)
>>
>>
>> Unfortunately, this is the idiom. I could see an improvement where reduce
>> or a similarly named function would return a Hits object (in addition to
>> the actual reduce result) that would indicate the mapping between the
>> input and reduced ranges. The RangesMapping structure would be really
>> close to what we would need.
>>
>> Michael
>>
>> _______________________________________________
>> Bioc-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel



More information about the Bioc-devel mailing list