The code that's there now is already unit tested and should be merged. The test I mentioned was a small check that the following works (this is what started this thread):
> m <- matrix(1, 5, 3, dimnames=list(NULL, NULL)) > gr <- GRanges("chr1", IRanges(1:5, 10)) > colData <- DataFrame(x=letters[1:3]) > > sexp <- SummarizedExperiment(assays=SimpleList(m=m), + rowData=gr, + colData=colData) > sexp2 <- SummarizedExperiment(assays=SimpleList(m=m), + rowData=GIntervalTree(gr), + colData=colData) > > olaps1 <- findOverlaps(gr, sexp) > olaps2 <- findOverlaps(gr, sexp2) > identical(olaps1, olaps2) [1] TRUE > > sexp <- sexp[1:2,] > sexp2 <- sexp2[1:2,] > > olaps1 <- findOverlaps(gr, sexp) > olaps2 <- findOverlaps(gr, sexp2) > identical(olaps1,olaps2) [1] TRUE On Fri, Aug 2, 2013 at 1:36 PM, Michael Lawrence <lawrence.mich...@gene.com>wrote: > If you don't mind, I think I'll wait till after you're finished testing > before merging. > > Please keep me up to date, > Michael > > > On Fri, Aug 2, 2013 at 7:43 AM, Hector Corrada Bravo > <hcorr...@gmail.com>wrote: > >> Thanks again Kasper, >> All of these are now fixed: >> * empty subject seqlevel, >> * out-of-order seqinfo's, >> * show,GIntervalTree-method >> >> Michael, please merge from >> https://github.com/hcorrada/IRanges [version 1.19.20] >> https://github.com/hcorrada/GenomicRanges [version 1.13.36] >> >> I'll test the SummarizedExperiment stuff later today. >> >> Cheers, >> Hector >> >> >> >> On Thu, Aug 1, 2013 at 5:21 PM, Kasper Daniel Hansen < >> kasperdanielhan...@gmail.com> wrote: >> >>> If you're fixing tonight here is a possible related. I get an error >>> when I do the findOverlaps and I have two GRanges with the same seqlevels >>> but in different order (so, I guess, technically not the same seqlevels). >>> If this is not supported, I suggest an upfront check. >>> >>> gr1 = GRanges(seqnames = c("chr1", "chr2"), ranges = IRanges(1:2, width >>> = 1)) >>> gr2 = gr1 >>> seqlevels(gr2, force = TRUE) = c("chr2", "chr1") >>> findOverlaps(GIntervalTree(gr1), GIntervalTree(gr2)) >>> >>> I also got a seqfault on a similar example (but with real data). I am >>> trying to see if I can make a small reproducible example (which is how I >>> got here), hypothesizing that it has something to do with the seqinfo slot >>> in the two GRanges. >>> >>> Kasper >>> >>> >>> >>> >>> >>> >>> On Thu, Aug 1, 2013 at 4:48 PM, Hector Corrada Bravo <hcorr...@gmail.com >>> > wrote: >>> >>>> Thanks. I'll fix tonight. >>>> >>>> >>>> On Thu, Aug 1, 2013 at 4:28 PM, Kasper Daniel Hansen < >>>> kasperdanielhan...@gmail.com> wrote: >>>> >>>>> Bug: >>>>> >>>>> > library(GenomicRanges) ## 1.13.35 >>>>> >>>>> > gr = GRanges(seqnames = c("chr1", "chr2"), ranges = IRanges(1:2, >>>>> width = 1)) >>>>> >>>>> > gr.tree <- GIntervalTree(gr) >>>>> >>>>> >>>>> > findOverlaps(gr.tree, gr.tree) >>>>> >>>>> >>>>> Hits of length 2 >>>>> >>>>> >>>>> queryLength: 2 >>>>> >>>>> >>>>> subjectLength: 2 >>>>> >>>>> >>>>> queryHits subjectHits >>>>> >>>>> >>>>> <integer> <integer> >>>>> >>>>> >>>>> 1 1 1 >>>>> >>>>> >>>>> 2 2 2 >>>>> >>>>> >>>>> !> findOverlaps(gr.tree, gr.tree[1]) >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> *** caught segfault *** >>>>> >>>>> >>>>> address (nil), cause 'memory not mapped' >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Traceback: >>>>> >>>>> >>>>> 1: .Call(.NAME, ..., PACKAGE = PACKAGE) >>>>> >>>>> >>>>> 2: .Call2(fun, object@ptr, ..., PACKAGE = "IRanges") >>>>> >>>>> >>>>> 3: .IntervalForestCall(subject, fun, query, partitionIndices, >>>>> elementLengths(partitioning), query_ord) >>>>> >>>>> 4: .local(query, subject, maxgap, minoverlap, type, select, ...) >>>>> >>>>> >>>>> 5: findOverlaps(qlist, subject@ranges, maxgap = maxgap, minoverlap >>>>> = minoverlap, type = type, select = "all") >>>>> >>>>> 6: findOverlaps(qlist, subject@ranges, maxgap = maxgap, minoverlap >>>>> = minoverlap, type = type, select = "all") >>>>> >>>>> 7: .local(query, subject, maxgap, minoverlap, type, select, ...) >>>>> >>>>> >>>>> 8: findOverlaps(gr.tree, gr.tree[1]) >>>>> >>>>> >>>>> 9: findOverlaps(gr.tree, gr.tree[1]) >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Possible actions: >>>>> >>>>> >>>>> 1: abort (with core dump, if enabled) >>>>> >>>>> >>>>> 2: normal R exit >>>>> >>>>> >>>>> 3: exit R without saving workspace >>>>> >>>>> >>>>> 4: exit R saving workspace >>>>> >>>>> >>>>> Selection: >>>>> >>>>> >>>>> On Thu, Aug 1, 2013 at 3:45 PM, Kasper Daniel Hansen < >>>>> kasperdanielhan...@gmail.com> wrote: >>>>> >>>>>> Ah! Super-nice! I'll test as well, when I have time. >>>>>> >>>>>> Kasper >>>>>> >>>>>> >>>>>> On Thu, Aug 1, 2013 at 3:34 PM, Hector Corrada Bravo < >>>>>> hcorr...@gmail.com> wrote: >>>>>> >>>>>>> This is not tested, but... >>>>>>> >>>>>>> GIntervalTree extends GenomicRanges so, in principle, can be used >>>>>>> in the rowData slot of SummarizedExperiment. I tried to make >>>>>>> GIntervalTree >>>>>>> support as much of the GenomicRanges interface as I could so this may >>>>>>> work >>>>>>> already for overlap queries where the SummarizedExperiment object is the >>>>>>> subject. I'll test this soon and let you know. >>>>>>> >>>>>>> >>>>>>> On Thu, Aug 1, 2013 at 3:12 PM, Kasper Daniel Hansen < >>>>>>> kasperdanielhan...@gmail.com> wrote: >>>>>>> >>>>>>>> Now that we have GIntervalTree, I am really interested in a >>>>>>>> SummarizedExperiment that stores its index in a slot, so it can be >>>>>>>> indexed >>>>>>>> once. I am sure other people are greedily eyeing this as well. >>>>>>>> Either >>>>>>>> changing the class or extending it. >>>>>>>> >>>>>>>> Unfortunately, I will not have time to work on this for some weeks, >>>>>>>> but I >>>>>>>> wanted to put the idea out there. >>>>>>>> >>>>>>>> Best, >>>>>>>> Kasper >>>>>>>> >>>>>>>> [[alternative HTML version deleted]] >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Bioc-devel@r-project.org mailing list >>>>>>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > [[alternative HTML version deleted]] _______________________________________________ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel