1samtools-coverage(1) Bioinformatics tools samtools-coverage(1)
2
3
4
6 samtools coverage - produces a histogram or table of coverage per chro‐
7 mosome
8
10 samtools coverage [options] [in1.sam|in1.bam|in1.cram
11 [in2.sam|in2.bam|in2.cram] [...]]
12
13
15 Computes the depth at each position or region and draws an ASCII-art
16 histogram or tabulated text.
17
18 The tabulated form uses the following headings.
19
20
21 rname Reference name / chromosome
22 startpos Start position
23 endpos End position (or sequence length)
24 numreads Number reads aligned to the region (after filtering)
25 covbases Number of covered bases with depth >= 1
26 coverage Percentage of covered bases [0..100]
27 meandepth Mean depth of coverage
28 meanbaseq Mean baseQ in covered region
29 meanmapq Mean mapQ of selected reads
30
31
33 Input options:
34
35
36 -b, --bam-list FILE
37 List of input BAM files, one file per line [null]
38
39 -l, --min-read-len INT
40 Ignore reads shorter than INT base pairs [0]
41
42 -q, --min-MQ INT
43 Minimum mapping quality for an alignment to be used [0]
44
45 -Q, --min-BQ INT
46 Minimum base quality for a base to be considered [0]
47
48 --rf, --incl-flags STR|INT
49 Required flags: skip reads with mask bits unset [null]
50
51 --ff, --excl-flags STR|INT
52 Filter flags: skip reads with mask bits set [UNMAP,SEC‐
53 ONDARY,QCFAIL,DUP]
54
55 -d, --depth INT
56 Maximum allowed coverage depth [1000000]. If 0, depth is set to
57 the maximum integer value effectively removing any depth limit.
58
59
60 Output options:
61
62
63 -m, --histogram
64 Show histogram instead of tabular output.
65
66 -A, --ascii
67 Show only ASCII characters in histogram using colon and full‐
68 stop for full and half height characters.
69
70 -o, --output FILE
71 Write output to FILE [stdout].
72
73 -H, --no-header
74 Don't print a header in tabular mode.
75
76 -w, --n-bins INT
77 Number of bins in histogram. [terminal width - 40]
78
79 -r, --region REG
80 Show specified region. Format: chr:start-end.
81
82 -h, --help
83 Shows command help.
84
85
87 Running coverage in tabular mode, on a specific region, with tabs shown
88 as spaces for clarity in this man page.
89
90
91 samtools coverage -r chr1:1M-12M input.bam
92
93 #rname startpos endpos numreads covbases coverage meandepth meanbaseq meanmapq
94 chr1 1000000 12000000 528695 1069995 9.72723 3.50281 34.4 55.8
95
96
97 An example of the histogram output is below, with ASCII block charac‐
98 ters replaced by "#" for rendering in this man page.
99
100
101 samtools coverage -A -w 32 -r chr1:1M-12M input.bam
102
103 chr1 (249.25Mbp)
104 > 24.19% | . | Number of reads: 528695
105 > 21.50% |:: | (132000 filtered)
106 > 18.81% |:: | Covered bases: 1.07Mbp
107 > 16.12% |:: : | Percent covered: 9.727%
108 > 13.44% |:: : . :: : :| Mean coverage: 3.5x
109 > 10.75% |:: :: : :: : : :| Mean baseQ: 34.4
110 > 8.06% |::::: : :: : : : :| Mean mapQ: 55.8
111 > 5.37% |::::: :: ::: : ::::: :|
112 > 2.69% |::::: ::: ::: ::: :::::::::| Histo bin width: 343.8Kbp
113 > 0.00% |:::::::::::. :::::::::::::::::::| Histo max bin: 26.873%
114 1.00M 4.44M 7.87M 12.00M
115
116
117
118
120 Written by Florian P Breitwieser.
121
122
124 samtools(1), samtools-depth(1),
125
126 Samtools website: <http://www.htslib.org/>
127
128
129
130samtools-1.15.1 7 April 2022 samtools-coverage(1)