CoverM

Introduction

CoverM aims to be a configurable, easy to use and fast DNA read coverage and relative abundance calculator focused on metagenomics applications (Aroney et al. 2025).

CoverM calculates coverage of genomes/MAGs via coverm genome (help) or individual contigs via coverm contig (help). Calculating coverage by read mapping, its input can either be BAM files sorted by reference, or raw reads and reference genomes in various formats.

Installation

Installed on Crunchomics: Yes,

  • CoverM v0.7.0 is installed as part of the bioinformatics share. If you have access to Crunchomics and have not yet access to the bioinformatics share, then you can send an email with your Uva netID to Nina Dombrowski, n.dombrowski@uva.nl.
  • Afterwards, you can add the bioinformatics share as follows (if you have already done this in the past, you don’t need to run this command):
conda config --add envs_dirs /zfs/omics/projects/bioinformatics/software/miniconda3/envs/

If you want to install it yourself, you can run:

mamba create --name coverm_0.7.0 -c bioconda coverm=0.7.0

Usage

conda activate coverm_0.7.0

mkdir results/coverm/

#  Calculate read coverage per-genome
coverm genome \
  --interleaved data/sample1.fastq.gz data/sample2.fastq.gz data/sample3.fastq.gz \
  --genome-fasta-directory genome_folder \
  --genome-fasta-extension fasta \
  -t 8 \
  -m mean relative_abundance covered_fraction \
  -o results/coverm/output_coverm.tsv

conda deactivate

Useful settings:

  • -1 PATH ..: Forward FASTA/Q file(s) for mapping. These may be gzipped or not.
  • -2 PATH ..: Reverse FASTA/Q file(s) for mapping. These may be gzipped or not.
  • -c, --coupled PATH ..: One or more pairs of forward and reverse possibly gzipped FASTA/Q files for mapping in order <sample1_R1.fq.gz> <sample1_R2.fq.gz> <sample2_R1.fq.gz> <sample2_R2.fq.gz> ..
  • --interleaved PATH ..: Interleaved FASTA/Q files(s) for mapping. These may be gzipped or not.
  • --single PATH ..: Unpaired FASTA/Q files(s) for mapping. These may be gzipped or not.
  • -f, --genome-fasta-files PATH ..: Path(s) to FASTA files of each genome e.g. pathA/genome1.fna pathB/genome2.fa.
  • -d, --genome-fasta-directory PATH: Directory containing FASTA files of each genome.
  • -x, --genome-fasta-extension EXT: File extension of genomes in the directory specified with -d/–genome-fasta-directory. [default: fna]
  • --genome-fasta-list PATH: File containing FASTA file paths, one per line.
  • -p, --mapper NAME: Underlying mapping software used [default: minimap2-sr]. minimap2-sr, bwa-mem, bwa-mem2, minimap2-ont, minimap2-pb, minimap2-hifi, minimap2-no-preset
  • -m, --methods METHOD: Method(s) for calculating coverage [default: relative_abundance]. A more thorough description of the different methods is available at here.

For a full set of options visit the coverm genome manual.

If you want to run CoverM on contigs, visit the coverm contig manual.

Trouble shooting

CoverM is quite memory intensive and might not run efficiently on many samples. For such cases, it might be preferable to run CoverM on a single sample at a time and optimize the run by using bash arrays or tools like GNU parallel.

References

Aroney, Samuel T N, Rhys J P Newell, Jakob N Nissen, Antonio Pedro Camargo, Gene W Tyson, and Ben J Woodcroft. 2025. “CoverM: Read Alignment Statistics for Metagenomics.” Edited by Can Alkan. Bioinformatics 41 (4). https://doi.org/10.1093/bioinformatics/btaf147.