Fraction of bases covered by each element in bed
1
0
Entering edit mode
10.3 years ago
avinash.sahu ▴ 10

I am stuck in finding special kind of intersect of 2 bed files. I want to find for each entry of a.bed fraction (or number) of base-pairs overlapping at least one element of b.bed ( ignoring strand). b.bed itself can have overlapping entries. E.g.

a.bed

chr1    1       21      A
chr1    13      24      B

b.bed

chr1    4       11      +    1
chr1    6       12     -    2
chr1    7       15     -    3

output should be

chr1    1       20      A     11 (7+1+3)
chr1    13      24      B     2

Even if I can get unique overlap A those intersect one entry of B I can collapse them. However, bedtools-intersect reports non-unique overlap if b.bed entries are overlapping. Any solution?

R ChIP-Seq • 2.4k views
ADD COMMENT
2
Entering edit mode
10.3 years ago
avinash.sahu ▴ 10

CoverageBed of bedtools perform exactly that I was referring to. Sorry for the trivial question.

ADD COMMENT

Login before adding your answer.

Traffic: 2560 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6