<p>You can use <a href="https://bedtools.readthedocs.io/en/latest/content/tools/window.html" rel="nofollow noreferrer">windowBed</a> from bedtools with <code>-c</code> if you just want counts. Or use <code>-wa</code> <code>-wb</code> and then use <a href="https://bedtools.readthedocs.io/en/latest/content/tools/groupby.html" rel="nofollow noreferrer">groupBy</a> for any other operations.</p>

CC BY-SA 4.0
2020-07-21T14:02:58.110Z
2020-07-21T14:02:58.110Z
geek_y
<p>I have 3 histone marks,I have used Macs2 for peak calling and diffBind to analyze the peaks. I was wondering if you know any way to calculate the peak numbers of one specific histone mark that occur for example within 2kb of peaks belong to another histone mark.<br />
Much appreciated</p>

<sequence-analysis><chip-seq><bedtools><peak-calling><deeptools>
How to calculate the number of peaks that are upstream/downstream of some other peaks
# How to calculate the number of peaks that are upstream/downstream of some other peaks

(Asked by: username_0 on 2020-07-20)

I have 3 histone marks,I have used Macs2 for peak calling and diffBind to analyze the peaks. I was wondering if you know any way to calculate the peak numbers of one specific histone mark that occur for example within 2kb of peaks belong to another histone mark.  
Much appreciated

**Tags:** sequence-analysis, chip-seq, bedtools, peak-calling, deeptools

---

## 1 answers

### Answer by username_1 on 2020-07-21. Score: 1 | Accepted answer

You can use [windowBed](https://bedtools.readthedocs.io/en/latest/content/tools/window.html) from bedtools with `-c` if you just want counts. Or use `-wa` `-wb` and then use [groupBy](https://bedtools.readthedocs.io/en/latest/content/tools/groupby.html) for any other operations.


---

