This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Collapse two or thee bed files into one bed file using bedtools merge

I have a 4 bed files of peak coordinates from ChIP seq, I was wondering is there a way to collapse them into one bed file where all the peak coordinates are now in one bed file from the 4 different files using bedtools merge. And if there is a way what would the command look like. Appreciate any help.

chip-seq

1 answer

cat bed1.bed bed2.bed bedn.bed (...) | sort -k1,1 -k2,2n | bedtools merge -i - > merged.bed

Thank you so much. This is what I was looking for and appreciate your quick response. I did try looking at the documentation of the bedtools merge but was a little confused. Thanks again!

Log in to answer this question.