gr1 <- GRanges(Rle(c("chr1", "chr2", "chr1")), IRanges (c(1,3,5), width =5)) gr2 <- GRanges(Rle(c("chr2", "chr1", "chr2")), IRanges(c(2,3,4), width=4)) intersect(gr1,gr2)
I wish to find the overlapping regions. Below are the results
GRanges object with 2 ranges and 0 metadata columns: seqnames ranges strand <rle> <iranges> <rle> [1] chr1 3-6 * [2] chr2 3-7 *
seqinfo: 2 sequences from an unspecified genome; no seqlengths
Why the overlapping region in chr1 is 3-6 rather than 3-7 ?
Thanks Michael. Now I understand the rules. Appreciated so much.