nf-core pipeline · epidemiology, fastq, ngs
nf-core/viralmetagenome
Reconstructs viral consensus genomes and detects intra-host single-nucleotide variants from metagenomic sequencing data.
What nf-core/viralmetagenome is
nf-core/viralmetagenome is a bioinformatics pipeline designed for untargeted whole-genome reconstruction and intra-host single-nucleotide variant (iSNV) identification. It processes metagenomic sequencing data as well as enrichment-based approaches such as hybrid capture. The pipeline was originally written by Joon Klaps, Philippe Lemey, and Liana Kafetzopoulou.
Viral metagenomics often presents low viral titres, complex background host or microbial sequences, and quasispecies variation within a single host. To address this, the pipeline combines metagenomic classification, de novo assembly, contig clustering, scaffolding, and iterative refinement to assemble viral consensus sequences and identify low-frequency mutations without requiring targeted primer schemes.
Researchers can apply the workflow to virome characterisation, viral genomic epidemiology, and outbreak surveillance where the pathogen sequence may be uncharacterised or divergent from reference genomes.
What the pipeline does
The pipeline starts with quality assessment using FastQC, followed by optional read pre-processing that can perform adapter trimming with fastp or Trimmomatic, unique molecular identifier (UMI) deduplication via HUMID, low-complexity and quality filtering using bbduk or prinseq++, and host-read removal via Kraken2. It then performs metagenomic diversity profiling using Kraken2, Bracken, or Kaiju. De novo assembly is carried out using SPAdes, TRINITY, or megahit, with optional contig extension using sspace_basic and filtering via prinseq++. Reads can optionally be mapped to contigs with Bowtie2 or BWA-MEM2 to evaluate coverage depth.
Contigs can be identified against references via blastn (using up to the top five hits for scaffolding) and optionally preclustered by taxonomic bins using Kraken2 or Kaiju before sequence clustering with tools such as CD-HIT-EST, vsearch, mmseqs-linclust, mmseqs-cluster, vRhyme, or Mash with Clusty. Contigs are scaffolded against a centroid using Minimap2 and iVar-consensus, or guided by reference constraints screened using Mash. Filtered reads are mapped back to supercontigs with Bowtie2 or BWA-MEM2, optionally deduplicated with Picard or UMI-tools, and assessed with mosdepth and samtools. Variant calling and consensus generation are executed using BCFtools or iVar and iteratively refined. Downstream contigs and consensus sequences can be annotated and evaluated using SnpEff, SnpSift, QUAST, CheckV, Prokka, blastn, mmseqs-search, and MAFFT, with final summaries aggregated into a MultiQC report.
Key facts
- Pipeline framework
- Nextflow (nf-core)
- Latest release
- 1.1.3 (2026-07-02)
- Supported inputs
- Single-end and paired-end sequencing reads in FASTQ format
- Primary outputs
- De novo contigs, scaffolded supercontigs, consensus genomes, variant calls (iSNVs), and MultiQC summary reports
- De novo assemblers
- SPAdes, TRINITY, megahit
- Taxonomic profilers
- Kraken2, Bracken, Kaiju
- Read aligners
- Bowtie2, BWA-MEM2, Minimap2
- Variant and consensus tools
- BCFtools, iVar
What you can use it for
- Untargeted viral genome reconstruction
- Assemble complete or partial viral consensus genomes directly from metagenomic sequencing libraries without prior target-specific amplification.
- Intra-host variant detection
- Identify low-frequency intra-host single-nucleotide variants (iSNVs) across viral genomes using read mapping and variant calling with iVar or BCFtools.
- Hybrid capture data analysis
- Process enrichment-based sequence datasets, such as hybrid capture libraries, with support for UMI deduplication via HUMID or UMI-tools.
- Metagenomic diversity profiling
- Screen environmental or clinical samples to profile taxonomic composition and viral content using Kraken2, Bracken, or Kaiju prior to targeted assembly.
Run it here
The research agent runs nf-core/viralmetagenome 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
- Supports multiple assembly tools including SPAdes, TRINITY, and megahit, allowing flexible contig generation depending on sample type.
- Performs iterative refinement cycles mapping reads back to scaffolded supercontigs to polish the consensus sequence.
- Handles unique molecular identifiers (UMIs) at both the read trimming and post-alignment stages using HUMID and UMI-tools.
- Integrates quality checks and downstream viral genome evaluations, including completeness checking via CheckV and genome assessment via QUAST.
Watch out for
- Requires high enough sequencing depth over contigs, as low-coverage clusters may need to be filtered out.
- Relies on external reference databases for taxonomic profiling, host depletion, and blastn-based contig identification.
Questions
Can I run nf-core/viralmetagenome without my own cluster?
The research agent runs nf-core/viralmetagenome 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/viralmetagenome under?
MIT, like every nf-core pipeline.
What input formats does the pipeline accept?
It accepts single-end and paired-end raw sequencing data provided in FASTQ format (.fastq or .fastq.gz) defined via a CSV samplesheet.
Can the pipeline remove host contamination from the reads?
Yes, host reads can optionally be removed during pre-processing using Kraken2.
How are contigs scaffolded into supercontigs?
Contigs are scaffolded to a cluster centroid using Minimap2 and iVar-consensus, optionally informed by the top five blastn reference matches or Mash screening.
How does the pipeline handle duplicate reads in UMI-tagged libraries?
It provides UMI deduplication options at the read level using HUMID and after alignment using UMI-tools.
How to cite it
Joon Klaps, Philippe Lemey, Magda Bletsa, nf-core community, Liana Eleni Kafetzopoulou, nf-core/viralmetagenome: A novel pipeline for untargeted viral genome reconstruction, Bioinformatics, Volume 42, Issue 5, May 2026, btag187, https://doi.org/10.1093/bioinformatics/btag187
Written from nf-core/viralmetagenome's own README. Statements citing a figure that does not appear there are removed before publication. Licence and running details come from our registry.