This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how i get get same length of peaks by macs2

Hi, I find after i run macs2, i will get different zise of each peak. if i want to get peaks' length is 200, what kind of command I can use? Thanks

chip-seq macs2

1 answer

I hope you understand that peak calling is a data-driven kind of analysis. You cannot dictate the length of peaks you get. Still a technical solution would be to merge all peaks, take the center position of each and extend it by 100bp in each direction:

cat *.narrowPeak | sort -k1,1 -k2,2n | bedtools merge -i - | bedtools slop -r -0.5 -l -0.5 -pct -g genomesizes.txt -i - | bedtools slop -i - -r 100 -l 100 -g genomesizes.txt > peaks_extendedFromSummit200bp.bed

Log in to answer this question.