Question: How do I do a bedtools like intersection in GenomicRanges?
0
gravatar for endrebak85
8 months ago by
endrebak8530
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 • 162 views
ADD COMMENTlink modified 8 months ago by Michael Lawrence10k • written 8 months ago by endrebak8530
Answer: How do I do a bedtools like intersection in GenomicRanges?
3
gravatar for Michael Lawrence
8 months ago by
United States
Michael Lawrence10k wrote:

See the HelloRanges package for this.

ADD COMMENTlink written 8 months ago by Michael Lawrence10k

Brilliant. Thanks!

ADD REPLYlink written 8 months ago by endrebak8530

It is just pintersect, no?

ADD REPLYlink written 8 months ago by endrebak8530

No. pintersect() after findOverlaps()

ADD REPLYlink written 8 months ago by Michael Lawrence10k
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: 336 users visited in the last hour