Entering edit mode
Hello,
I think I've found another bug. If you use subsetByOverlaps with a
GRangesList as query, the full object is returned, instead of the
subset
that overlaps:
library(GenomicRanges)
gr1 <- GRanges(seqnames=c("a","b"),ranges=IRanges(c(1,11), c(5,15)))
gr2 <- GRanges(seqnames=c("a","b"),ranges=IRanges(c(1,11), c(5,15)))
gr3 <- GRanges(seqnames=c("a"),ranges=IRanges(1,5))
grl <- GRangesList(gr1,gr2)
identical(grl,subsetByOverlaps(grl, gr3))
[1] TRUE
To get the behavior that I was expecting, you can do:
endoapply(grl, subsetByOverlaps, gr3)
Cheers,
Cei
> sessionInfo()
R version 2.11.0 (2010-04-22)
i386-apple-darwin9.8.0
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices datasets utils methods base
other attached packages:
[1] GenomicRanges_1.0.6 IRanges_1.6.8 Biobase_2.8.0
loaded via a namespace (and not attached):
[1] tools_2.11.0