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

See the HelloRanges package for this.

ADD COMMENTlink written 11 months ago by Michael Lawrence11k

Brilliant. Thanks!

ADD REPLYlink written 11 months ago by endrebak8530

It is just pintersect, no?

ADD REPLYlink written 11 months ago by endrebak8530

No. pintersect() after findOverlaps()

ADD REPLYlink written 11 months ago by Michael Lawrence11k
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: 272 users visited in the last hour