[Bioc-sig-seq] GenomicRanges wishlist: IntervalTrees for GRanges

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Fri Oct 1 15:58:30 CEST 2010


Seems like the required changes hasn't yet been pushed from svn to the builds.

I do have one possible caveat: it is not clear to me how this would
work when the GRanges is not sorted by chromosome as I get

> gr1
GRanges with 3 ranges and 0 elementMetadata values
    seqnames    ranges strand |
       <Rle> <IRanges>  <Rle> |
[1]     chr1    [1, 3]      * |
[2]     chr2    [2, 4]      * |
[3]     chr1    [6, 8]      * |

seqlengths
 chr1 chr2
   NA   NA
> as(gr1, "RangesList")
CompressedIRangesList of length 2
$chr1
IRanges of length 2
    start end width
[1]     1   3     3
[2]     6   8     3

$chr2
IRanges of length 1
    start end width
[1]     2   4     3

When I go back to the original GRanges I will need to interweave the
results from the RangesList.

Of course, being able to do IntervalTrees directly on GRanges will
also be very convenient.

Kasper


On Fri, Oct 1, 2010 at 12:05 AM, Michael Lawrence
<lawrence.michael at gene.com> wrote:
> One easy way to get something like this:
>
> rangesList <- seqapply(as(gr, "RangesList"), IntervalTree)
>
> Then you'll have a RangesList of IntervalTree objects for range queries.
>
> Might need latest IRanges svn for this to work reliably (problem with
> subsetting IRanges with metadata).
>
> On Thu, Sep 30, 2010 at 6:48 PM, Kasper Daniel Hansen
> <kasperdanielhansen at gmail.com> wrote:
>>
>> I would like to see 'IntervalTrees for GRanges'.  Specifically, if I
>> am repeatedly doing findOverlaps lookups on a big GRanges, I want to
>> be able to store the IntervalTrees that (right now?) gets computed
>> each time.
>>
>> This may of course already exist, in which case I would be satisfied
>> with a pointer :)
>>
>> Thanks,
>> Kasper
>>
>> _______________________________________________
>> Bioc-sig-sequencing mailing list
>> Bioc-sig-sequencing at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
>
>



More information about the Bioc-sig-sequencing mailing list