# bamCoverage¶

This tool takes an alignment of reads or fragments as input (BAM file) and generates a coverage track (bigWig or bedGraph) as output. The coverage is calculated as the number of reads per bin, where bins are short consecutive counting windows of a defined size. It is possible to extended the length of the reads to better reflect the actual fragment length. bamCoverage offers normalization by scaling factor, Reads Per Kilobase per Million mapped reads (RPKM), and 1x depth (reads per genome coverage, RPGC).

usage: An example usage is: bamCoverage -b signal.bam -o signal.bw

Required arguments
 --bam, -b BAM file to process
Output
 --outFileName, -o Output file name. --outFileFormat=bigwig, -of=bigwig Output file type. Either “bigwig” or “bedgraph”. Possible choices: bigwig, bedgraph
Optional arguments
 --scaleFactor=1.0 Indicate a number that you would like to use. When used in combination with –normalizeTo1x or –normalizeUsingRPKM, the computed scaling factor will be multiplied by the given scale factor. --MNase=False Determine nucleosome positions from MNase-seq data. Only 3 nucleotides at the center of each fragment are counted. The fragment ends are defined by the two mate reads. Only fragment lengthsbetween 130 - 200 bp are considered to avoid dinucleosomes or other artifacts.*NOTE*: Requires paired-end data. A bin size of 1 is recommended. --version show program’s version number and exit --binSize=50, -bs=50 Size of the bins, in bases, for the output of the bigwig/bedgraph file. --region, -r Region of the genome to limit the operation to - this is useful when testing parameters to reduce the computing time. The format is chr:start:end, for example –region chr10 or –region chr10:456700:891000. --numberOfProcessors=max/2, -p=max/2 Number of processors to use. Type “max/2” to use half the maximum number of processors or “max” to use all available processors. --verbose=False, -v=False Set to see processing messages.

## Usage hints¶

• A smaller bin size value will result in a higher resolution of the coverage track but also in a larger file size.
• The 1x normalization (RPGC) requires the input of a value for the effective genome size, which is the mappable part of the reference genome. Of course, this value is species-specific. The command line help of this tool offers suggestions for a number of model species.
• It might be useful for some studies to exclude certain chromosomes in order to avoid biases, e.g. chromosome X, as male mice contain a pair of each autosome, but usually only a single X chromosome.
• By default, the read length is NOT extended! This is the preferred setting for spliced-read data like RNA-seq, where one usually wants to rely on the detected read locations only. A read extension would neglect potential splice sites in the unmapped part of the fragment. Other data, e.g. Chip-seq, where fragments are known to map contiguously, should be processed with read extension (--extendReads [INT]).
• For paired-end data, the fragment length is generally defined by the two read mates. The user provided fragment length is only used as a fallback for singletons or mate reads that map too far apart (with a distance greater than four times the fragment length or are located on different chromosomes).

Warning

If you already normalized for GC bias using correctGCbias, you should absolutely NOT set the parameter --ignoreDuplicates!

## Usage example¶

This is an example using additional options (smaller bin size for higher resolution, normalizing coverage to 1x mouse genome size, excluding chromosome X during the normalization step, and extending reads):

\$ bamCoverage --bam reads.bam -o coverage.SeqDepthNorm.bw
--binSize 10
--normalizeTo1x 2150570000
--ignoreForNormalization chrX