Hello,
I'm trying to merge peak files in a way that I can't find so far.
I have 16 peak files concatenated in my_peaks.bed
I've tried to use bedtools merge following this example:
$ cat my_peaks.bed
chr1 100 300
chr1 200 500
chr1 0 700
$ bedtools merge -i my_peaks.bed -c 1 -o count
chr1 0 700 3
But actually the kind of output that I want would be the following:
$ bedtools merge -i my_peaks.bed -c 1 -o count
chr1 0 100 1
chr1 100 200 2
chr1 200 300 3
chr1 300 500 2
chr1 500 700 1
I've looked into bedops option --partition which would give :
$ bedops --partition my_peaks.bed
chr1 0 100
chr1 100 200
chr1 200 300
chr1 300 500
chr1 500 700
But then I don't know how to keep the peak count.
Thanks for help
bedtools
bedops
chip-seq