Entering edit mode
Hi
i Have two granges (gr1 and gr2) and i want to extract granges from gr2 that are not overlapping with gr1. Please tell me the possible way to do it
Hi
i Have two granges (gr1 and gr2) and i want to extract granges from gr2 that are not overlapping with gr1. Please tell me the possible way to do it
> gr1 <- GRanges("chr1", IRanges(c(1,3,5), c(8,9,15)))
> gr2 <- GRanges("chr1", IRanges(c(1,3,5,17), c(8,9,17,35)))
> gr2[!gr2 %over% gr1,]
GRanges object with 1 range and 0 metadata columns:
seqnames ranges strand
<Rle> <IRanges> <Rle>
[1] chr1 [17, 35] *
-------
seqinfo: 1 sequence from an unspecified genome; no seqlengths
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Note that you already asked this 5 weeks ago here Non overlapping granges (or opposite of subsetByOverlaps) and got the same answer.
H.