Question: How do I do a bedtools like intersection in GenomicRanges?

0

endrebak85 •

**30**wrote:GenomicRanges intersect is more like what I would call set intersect - first the sets of A and B are computed, then intersection is done.

Bedtools intersect finds the intersect of each interval in A with each interval in B which means that in the worst case, the number of output regions is the size of the cartesian product of A B as in the example below:

$ cat A.bed chr1 10 32 chr1 30 40 $ cat B.bed chr1 15 35 $ bedtools intersect -a A.bed -b B.bed chr1 15 32 chr1 30 35

Is this type of intersect possible in genomicranges? Thanks.

Edit: fixed example

ADD COMMENT
• link
•
modified 15 months ago
by
Michael Lawrence ♦

**11k**• written 15 months ago by endrebak85 •**30**