How to find overlapping regions in a single bed file
1
0
Entering edit mode
2.2 years ago
AA • 0

I have a .bed file from a ChIP-seq experiment that has some overlapping regions (peaks) across the genome.

How can I:

  • Find out how many regions overlap with at least one other region?
  • Determine how much overlap there is between each overlapping region?
ChIP-seq bed • 2.0k views
ADD COMMENT
0
Entering edit mode
ADD REPLY
1
Entering edit mode
2.2 years ago

BEDOPS bedmap has --count and --bases operations for investigating self-overlaps or overlaps between BED file(s), e.g.,:

sort-bed peaks.bed | bedmap --echo --count --bases - > answer.bed

Ref. https://github.com/bedops/bedops

ADD COMMENT
0
Entering edit mode

This appears to work, but is there a way to make the results output as new columns rather than output in a new row for each individual region.

This is what the output looks like:

chr1    4399801 4400245 peak_12659  719 .   32.37675    -1  1.92924 222
|1|444                                  
chr1    2495548 2495992 peak_11970  542 .   36.95443    -1  2.58372 222
|1|444                                  
chr1    3572002 3572264 peak_901    1000    .   148.62292   -1  3.94096 145
|1|262  

It makes sorting more cumbersome.

ADD REPLY
1
Entering edit mode

Add --delim '\t' if you want results in separate columns

ADD REPLY
0
Entering edit mode

I tried that and the output is in new columns, but still outputs in new rows:

chr1    4399801 4400245 peak_12659  719 .   32.37675    -1  1.92924 222
    1   444                         
chr1    2495548 2495992 peak_11970  542 .   36.95443    -1  2.58372 222
    1   444                         
chr1    3572002 3572264 peak_901    1000    .   148.62292   -1  3.94096 145
    1   262             

How can I have the output appear as columns in the same row as each peak?

ADD REPLY

Login before adding your answer.

Traffic: 1664 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