Demonstration only. Corollary is a non-commercial research demo — no warranty, no support, not for commercial use or clinical decisions. Read the disclaimer

All tools and pipelines

nf-core pipeline · annotation, assembly, binning

nf-core/mag

A bioinformatics pipeline for quality control, assembly, binning, and annotation of metagenomic sequencing data.

What nf-core/mag is

nf-core/mag is a bioinformatics analysis pipeline for the de novo assembly, binning, and functional and taxonomic annotation of metagenomic datasets. Developed by Hadrien Gourle9, Daniel Straub, Sabrina Krakau, James A. Fellows Yates, Maxime Borry, and contributors across the scientific community, it standardises the processing of mixed microbial sequencing data into reconstructed genomes.

Metagenomic sequencing captures genetic material directly from environmental, host-associated, or ancient samples without prior culturing. Isolating individual microbial genomes from these composite samples requires a complex chain of quality trimming, contig assembly, binning into discrete genomes, taxonomic assignment, and completeness checking. nf-core/mag addresses this by coordinating established computational tools into a reproducible workflow.

The pipeline supports both short and long reads, handles single-sample or group-wise co-assembly, and incorporates specialised steps for ancient DNA damage assessment and contig consensus sequence repair.

What the pipeline does

Sequencing reads undergo adapter and quality trimming using fastp, AdapterRemoval, or Trimmomatic for short reads, and Porechop for long reads, alongside quality assessment with FastQC. De novo assembly is carried out using MEGAHIT or SPAdes, with quality evaluation via QUAST and ALE (for short reads). Long-read assemblies can be polished with short reads using pypolca, while ancient DNA assemblies can undergo damage validation using PyDamage and consensus sequence recalling using Freebayes and BCFtools.

Following assembly, protein-coding genes are predicted with Prodigal, Prokka, and optionally MetaEuk. Contigs are clustered into metagenome-assembled genomes (MAGs) using MetaBAT2, MaxBin2, CONCOCT, COMEBin, MetaBinner, or SemiBin2, with optional bin refinement using DAS Tool. Genome bins are evaluated for completeness and contamination using BUSCO, CheckM, or CheckM2, and optionally GUNC. Bins receive taxonomic classifications via GTDB-Tk and CAT, while geNomad and Tiara optionally identify viral and eukaryotic sequences. Overall metrics are collated into a MultiQC report.

Key facts

Input formats
FastQ (short and long reads), samplesheet CSV
Assembly software
MEGAHIT, SPAdes
Binning tools
MetaBAT2, MaxBin2, CONCOCT, COMEBin, MetaBinner, SemiBin2
Bin refinement
DAS Tool
Bin quality evaluation
CheckM, CheckM2, BUSCO, GUNC
Taxonomic profiling
GTDB-Tk, CAT
Gene prediction
Prodigal, Prokka, MetaEuk
Latest release
5.5.0 (2026-08-01)

What you can use it for

Metagenome-assembled genome recovery
Assemble short or long metagenomic reads, bin contigs into individual microbial genomes, refine them with DAS Tool, and determine their completeness and contamination.
Ancient DNA metagenomic analysis
Validate ancient metagenomic contigs and repair sequence damage using PyDamage, Freebayes, and BCFtools.
Viral and eukaryotic sequence detection
Identify non-bacterial elements within metagenomic contigs and bins using geNomad for viruses and Tiara for eukaryotes.
Co-assembly and differential coverage binning
Combine read sets by sample group for MEGAHIT or SPAdes co-assembly and compute group-wise co-abundances with MetaBAT2 to improve bin resolution.

Run it here

The research agent runs nf-core/mag with Nextflow on its own machine — up to 32 cores, 256 GiB of memory and 24 hours per run, which covers the test profile and real single-sample runs. It builds the samplesheet, checks it against the pipeline's schema and reads the results back. When a run is too big for one machine, it gives you the exact command for your own cluster instead.

Strengths and limits

Good at

  • Processes both short-read and long-read sequencing technologies, including long-read assembly polishing using pypolca.
  • Integrates multiple binning algorithms and supports ensemble refinement with DAS Tool.
  • Provides built-in damage validation and consensus repair specifically tailored for ancient DNA metagenomes.
  • Calculates multi-sample co-abundances to support differential coverage binning.

Watch out for

  • Group-wise co-assembly with metaSPAdes requires pooling read files because the underlying assembler cannot accept multiple distinct libraries directly.
  • Assembly quality assessment via ALE is only available for short-read sequencing data.
  • Group-wise co-assembly is disabled by default and must be explicitly configured.

Questions

Can I run nf-core/mag without my own cluster?

The research agent runs nf-core/mag with Nextflow on its own machine — up to 32 cores, 256 GiB of memory and 24 hours per run, which covers the test profile and real single-sample runs. It builds the samplesheet, checks it against the pipeline's schema and reads the results back. When a run is too big for one machine, it gives you the exact command for your own cluster instead.

What licence is nf-core/mag under?

MIT, like every nf-core pipeline.

Can the pipeline process Oxford Nanopore reads alongside Illumina data?

Yes. The pipeline supports short and long reads, includes Porechop for trimming long-read adapters, and can polish long-read assemblies with short reads using pypolca.

How are genome bins evaluated for quality and contamination?

Bins are evaluated using CheckM, CheckM2, or BUSCO for lineage completeness and contamination, with additional chimerism detection available through GUNC.

How does group-wise co-assembly differ between MEGAHIT and SPAdes?

When group-wise co-assembly is enabled, MEGAHIT processes individual read file lists per group, whereas SPAdes runs on pooled read files because metaSPAdes does not accept separate sample inputs.

What tools are used to assign taxonomy to assembled bins?

Taxonomic classifications are assigned using GTDB-Tk, CAT, or both.

How to cite it

Sabrina Krakau, Daniel Straub, Hadrien Gourle9, Gisela Gabernet, Sven Nahnsen. nf-core/mag: a best-practice pipeline for metagenome hybrid assembly and binning. NAR Genom Bioinform. 2022 Feb 2;4(1):lqac007. doi: 10.1093/nargab/lqac007.

Written from nf-core/mag's own README. Statements citing a figure that does not appear there are removed before publication. Licence and running details come from our registry.