<p>Using deepTools to get a bin size of 10 and 20 threads:</p>

<pre><code>bamCoverage -of bedgraph -bs 10 -b input.bam -p 20
</code></pre>

<p>You'll probably prefer the default bigWig format if you need random access or to use something like IGV.</p>

<p>Regarding the options to igvtools, <code>-w</code> is equivalent to <code>-bs</code>/<code>--binSize</code> in deepTools and denotes the resolution of the output data. <code>-e</code> (it's the same option in bamCoverage) denotes whether and how much to extend a read in its 3' direction. This done such that the output represents the sequences fragments. <code>-z</code> is specific to things like bigWig files (and apparently tdf files), where there are precomputed values that IGV will load as you zoom out (the various resolutions are "zoom levels", which is parlance taken from the bigWig format).</p>

CC BY-SA 4.0
2019-04-03T22:06:46.640Z
2019-04-03T22:06:46.640Z
Devon Ryan
<p>Is there a out of the box to convert a .bam file to a .wig file at specific resolution/bin size?</p>

<p>I was thinking to use igvtools, but I am not sure how it works:</p>

<p><code>igvtools count -z 5 -w 25 -e 250 alignments.bam  alignments.cov.tdf  hg19</code></p>

<p>What is the diffrence between <code>-w,-z,-e</code>?</p>

<pre><code>-z num  Specifies the maximum zoom level to precompute. The default
               value is 7 and is sufficient for most files. To reduce file
               size at the expense of IGV performance this value can be
               reduced.

 -e, --extFactor num

The read or feature is extended by the specified distance in bp prior to counting. This option is useful for chip-seq and rna-seq applications. The value is generally set to the average fragment length of the library minus the average read length.

-w, --windowSize num

The window size over which coverage is averaged. Defaults to 25 bp.

</code></pre>

<chip-seq>
How to convert ChiP-seq track in .bam file format into an array at fixed bin resolution?
# How to convert ChiP-seq track in .bam file format into an array at fixed bin resolution?

(Asked by: username_0 on 2019-04-03)

Is there a out of the box to convert a .bam file to a .wig file at specific resolution/bin size?
I was thinking to use igvtools, but I am not sure how it works:
igvtools count -z 5 -w 25 -e 250 alignments.bam  alignments.cov.tdf  hg19
What is the diffrence between -w,-z,-e?
-z num  Specifies the maximum zoom level to precompute. The default
               value is 7 and is sufficient for most files. To reduce file
               size at the expense of IGV performance this value can be
               reduced.

 -e, --extFactor num

The read or feature is extended by the specified distance in bp prior to counting. This option is useful for chip-seq and rna-seq applications. The value is generally set to the average fragment length of the library minus the average read length.

-w, --windowSize num

The window size over which coverage is averaged. Defaults to 25 bp.

**Tags:** chip-seq

---

## 1 answers

### Answer by username_1 on 2019-04-03. Score: 1 | Accepted answer

Using deepTools to get a bin size of 10 and 20 threads:
bamCoverage -of bedgraph -bs 10 -b input.bam -p 20

You'll probably prefer the default bigWig format if you need random access or to use something like IGV.
Regarding the options to igvtools, -w is equivalent to -bs/--binSize in deepTools and denotes the resolution of the output data. -e (it's the same option in bamCoverage) denotes whether and how much to extend a read in its 3' direction. This done such that the output represents the sequences fragments. -z is specific to things like bigWig files (and apparently tdf files), where there are precomputed values that IGV will load as you zoom out (the various resolutions are "zoom levels", which is parlance taken from the bigWig format).


---

