how to extract Granges not overlapping with other ganges?
1
1
Entering edit mode
vinod.acear ▴ 50
@vinodacear-8884
Last seen 4.3 years ago
India

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

Granges findoverlaps • 4.8k views
ADD COMMENT
1
Entering edit mode

Note that you already asked this 5 weeks ago here Non overlapping granges (or opposite of subsetByOverlaps) and got the same answer.

H.

ADD REPLY
5
Entering edit mode
@james-w-macdonald-5106
Last seen just now
United States
> 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
ADD COMMENT
1
Entering edit mode

Also can use %outside% here instead of negating %over%.

ADD REPLY

Login before adding your answer.

Traffic: 994 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6