Question: Non overlapping granges (or opposite of subsetByOverlaps)
0
gravatar for vinod.acear
4.1 years ago by
vinod.acear40
India
vinod.acear40 wrote:

I have two granges (gr1 and gr2)  in which all ranges of gr2 overlaps with ranges of gr1. How can i find granges of gr1 that are not overlaping with gr2?  i.e.  black color output given on the link http://bedops.readthedocs.org/en/latest/_images/reference_setops_bedops_difference_ab@2x.png

ADD COMMENTlink modified 10 months ago by doublehelix310 • written 4.1 years ago by vinod.acear40
Answer: Non overlapping granges (or opposite of subsetByOverlaps)
2
gravatar for Steve Lianoglou
4.1 years ago by
Denali
Steve Lianoglou12k wrote:

 

I believe "setdiff" should do what you want. Browse through this intro vignette for more info: http://www.bioconductor.org/packages/release/bioc/vignettes/GenomicRanges/inst/doc/GenomicRangesIntroduction.pdf

 

ADD COMMENTlink written 4.1 years ago by Steve Lianoglou12k

Thanks Steve ,  it worked

ADD REPLYlink written 4.1 years ago by vinod.acear40

Thanks Steve ,  it worked

ADD REPLYlink written 4.1 years ago by vinod.acear40

Thanks Steve ,  it worked

ADD REPLYlink written 4.1 years ago by vinod.acear40

Thanks Steve ,  it worked

ADD REPLYlink written 4.1 years ago by vinod.acear40
Answer: Non overlapping granges (or opposite of subsetByOverlaps)
1
gravatar for Hervé Pagès
4.1 years ago by
Hervé Pagès ♦♦ 14k
United States
Hervé Pagès ♦♦ 14k wrote:

Hi,

FWIW subsetByOverlaps(gr1, gr2) is equivalent to gr1[gr1 %over% gr2] so you would get the opposite with gr1[!(gr1 %over% gr2)]. This is not what you seem to want though: you seem to want setdiff() (thanks Steve). Just wanted to clarify the difference.

H.

ADD COMMENTlink written 4.1 years ago by Hervé Pagès ♦♦ 14k
Answer: Non overlapping granges (or opposite of subsetByOverlaps)
0
gravatar for doublehelix31
10 months ago by
Germany, Freiburg, University of Freiburg
doublehelix310 wrote:

    subsetByOverlaps(gr1, gr2, invert = TRUE)

does it.

ADD COMMENTlink modified 10 months ago • written 10 months ago by doublehelix310
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 437 users visited in the last hour