<p>Please don't send things like this to the deepTools mailing list and post them here.</p>

<p>As I mentioned on the list, what you're likely being surprised by is that computeMatrix is not summing values, but taking the average in each bin. You can change this with the <code>--averageTypeBins</code> option (the default is <code>mean</code>, you presumably want <code>sum</code>).</p>

<p><strong>Update</strong>: For those wondering the cause of the confusion was due to not using <code>--missingDataAsZero</code>. In other words, including or not including NAs will lead to different results, since different numbers of values will be included.</p>

CC BY-SA 3.0
2018-01-26T19:59:49.103Z
Hi, Ryan,
     The plot for is bin window=10bp to average in another way is attached. Please note the y-axis. The peak (>0.2) is much larger than the one (~0.05) with binsize=10bp from computeMatrix. I'm confused on this. Is the value in with binsize=10bp from computeMatrix really mean or median or some other ways?
    sorry I can not attach the figure here.
    Thanks
Xue Cheng
CC BY-SA 3.0
2018-02-06T17:56:47.557Z
The default is `mean`, so unless you change it that's what you're getting.
Devon Ryan
CC BY-SA 3.0
2018-01-26T18:42:38.913Z
2018-01-27T11:54:34.637Z
2018-01-27T11:54:34.637Z
Devon Ryan
<p>I'd like to output a figure in +/-1kb around a center using <a href="http://deeptools.readthedocs.io/en/latest/content/tools/computeMatrix.html" rel="nofollow noreferrer">computeMatrix</a> as following command:  </p>

<pre><code>computeMatrix reference-point -S data.bw -R centers.bed -a 1000 -b 1000 -bs=10 -out newdata10.gz --referencePoint center
</code></pre>

<p>The bed file is like:</p>

<pre><code>chr1 100 101
</code></pre>

<p>If I change <code>-bs=1</code>, two outputs of the same input newdata10.gz are quite different. Which's correct with my commands? Maybe I don't understand the meaning of binsize option. </p>

<deeptools>
Different outputs of computeMatrix depending on binsize
# Different outputs of computeMatrix depending on binsize

(Asked by: username_0 on 2018-01-26)

I'd like to output a figure in +/-1kb around a center using computeMatrix as following command:  
computeMatrix reference-point -S data.bw -R centers.bed -a 1000 -b 1000 -bs=10 -out newdata10.gz --referencePoint center

The bed file is like:
chr1 100 101

If I change -bs=1, two outputs of the same input newdata10.gz are quite different. Which's correct with my commands? Maybe I don't understand the meaning of binsize option.

**Tags:** deeptools

---

## 1 answers

### Answer by username_1 on 2018-01-26. Score: 1

Please don't send things like this to the deepTools mailing list and post them here.

As I mentioned on the list, what you're likely being surprised by is that computeMatrix is not summing values, but taking the average in each bin. You can change this with the `--averageTypeBins` option (the default is `mean`, you presumably want `sum`).

**Update**: For those wondering the cause of the confusion was due to not using `--missingDataAsZero`. In other words, including or not including NAs will lead to different results, since different numbers of values will be included.

> **Comments:**
> **username_0**: Hi, Ryan,      The plot for is bin window=10bp to average in another way is attached. Please note the y-axis. The peak (>0.2) is much larger than the one (~0.05) with binsize=10bp from computeMatrix. I'm confused on this. Is the value in with binsize=10bp from computeMatrix really mean or median or some other ways?     sorry I can not attach the figure here.     Thanks  
> **username_1**: The default is `mean`, so unless you change it that's what you're getting.  

---

