Fast per-base and per-region depth statistics from BAM. Produces coverage distributions, threshold reports, and a genome-wide summary.
Reads the BAM file and computes:
mosdepth v0.3.13 — fast BAM/CRAM depth calculation.
quay.io/biocontainers/mosdepth:0.3.13--hba6dcaf_0
export GENOME_DIR=/path/to/data
./scripts/16b-mosdepth.sh <sample_name>
| File | Description |
|---|---|
mosdepth/<sample>.mosdepth.summary.txt |
Per-chromosome mean coverage + genome total |
mosdepth/<sample>.mosdepth.global.dist.txt |
Cumulative coverage distribution (for plotting) |
mosdepth/<sample>.regions.bed.gz |
Mean depth per 500bp window |
mosdepth/<sample>.thresholds.bed.gz |
Fraction of bases at 1x/5x/10x/15x/20x/30x/50x |
chrom length bases mean min max
chr1 248956422 7394254892 29.70 0 312
chr2 242193529 7185433827 29.67 0 290
...
total 3088286401 91784821430 29.72 0 312
Shows what fraction of each region is covered at key depths:
| Dataset | Threads | Time | Memory |
|---|---|---|---|
| 30X WGS (~100 GB BAM) | 4 | ~5-10 min | < 2 GB |
| chr22 BAM | 2 | < 30 sec | < 1 GB |
mosdepth output is automatically detected by MultiQC. The mosdepth.global.dist.txt and mosdepth.summary.txt files are consumed to generate coverage distribution plots and summary statistics in the aggregated report.
--fast-mode skips per-base output (saves ~10 GB of disk for 30X WGS) while keeping all distributions and thresholdsALIGN_DIR variable to use alternative alignments: ALIGN_DIR=aligned_bwamem2 ./scripts/16b-mosdepth.sh sampleCAPTURE_BED for WES on-target coverage: CAPTURE_BED=${GENOME_DIR}/captures/my_panel.bed ./scripts/16b-mosdepth.sh sample. The BED file must be inside GENOME_DIR — the Docker container only mounts GENOME_DIR as /genome/, so paths outside it are invisible to the container--threads 4 actually uses 5 threads total