Separating peaks of chip-seq with specific length My data contain several chip-seq results. I have the peaks called by MACS2.I wanted to only look at those peaks that their size is e.g 500bp to 1000bp. How can I separate those peaks efficiently?
I know one way is to take the peaks.xls file sort them based on the length column and take out the peaks less than 1kb. But I was looking for a more efficient way to do that. Any suggestion?
Many Thanks
You can do it by awk.
awk -v OFS=&quot;\t&quot; '{ if ( ($3-$2) &gt;= 500 &amp;&amp; ($3-$2) &lt;= 1000) { print } }' in.bed &gt; out.bed

Assuming there is no header.