Question: How do I do a bedtools like intersection in GenomicRanges?
0
15 months ago by
endrebak8530
github.com/endrebak/
endrebak8530 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

genomicranges • 255 views
modified 15 months ago by Michael Lawrence11k • written 15 months ago by endrebak8530
Answer: How do I do a bedtools like intersection in GenomicRanges?
3
15 months ago by
United States
Michael Lawrence11k wrote:

See the HelloRanges package for this.

Brilliant. Thanks!

It is just pintersect, no?

No. pintersect() after findOverlaps()