nf-core mag

Metagenome assembly, binning and bin annotation: a native port of nf-core/mag 5.5.0.

by Temple Compute

Run nf-core mag on Horus

W-56 · nf-core/mag (native port)

Metagenome assembly, binning and bin annotation: a native port of nf-core/mag 5.5.0.

Domain: nf-core ports

Overview

Runs the route nextflow run nf-core/mag -r 5.5.0 -profile test,docker takes, as Horus tasks with the same containers, rendered command lines and per-process cpus/memory: FastQC, fastp and Bowtie2 PhiX removal per run, run merging, MEGAHIT and metaSPAdes per sample, QUAST and Prodigal per assembly, Bowtie2 mapping for binning, MetaBAT2, MaxBin2 and SemiBin2, then BUSCO, QUAST, CAT, GTDB-Tk and Prokka on the bins, bin depths, the bin summary and MultiQC. Per-run, per-sample, per-assembly and per-bin steps are horus_map stages. The pipeline's channel logic after binning runs as decision tasks (scripts/decide.py): bin size filter, unbinned contig splits, the post-binning bin sets and the BUSCO filter in front of GTDB-Tk, so other samplesheets give the sets nf-core would. The workflow has 46 tasks (31 maps).

Route left out (not run by the test profile): long reads (Nanopore/PacBio preprocessing, Flye, metaMDBG, hybrid SPAdes, PyPolCA), host removal, adapterremoval/Trimmomatic, BBNorm, group co-assembly, Kraken2/Centrifuge read taxonomy, ALE, CONCOCT, COMEBin, MetaBinner, DAS Tool refinement, Tiara domain classification, CheckM/CheckM2/GUNC, geNomad, MetaEuk, ancient DNA validation and given assemblies (--assembly_input).

Variants

Pipeline

stage_samples / fetch_databases   samplesheet ──► work/reads/, run, sample, assembly and mapping lists; database archives
BUSCO_UNTAR, CATPACK_DB_UNTAR, GTDBTK_DB_PREPARATION
fastqc_raw, fastp, phix_align, fastqc_trimmed   per run ──► results/QC_shortreads/
cat_fastq                         samples with several runs ──► <id>_[12].merged.fastq.gz
megahit, spades                   per sample ──► results/Assembly/
gunzip, quast, prodigal, bt2_build    per assembly
bt2_align                         each assembly x every sample of its group
depths, convert_depths, metabat2, maxbin2, semibin    per assembly ──► results/GenomeBinning/
binsets ─► seqkit, split_fasta ─► postbinning         bin sets, unbinned sets, one folder per bin
busco, quast_bins ─► concat_busco, concat_quast
gtdb_filter ─► gtdbtk ─► gtdbtk_summary
mag_depths ─► mag_depths_summary
catpack_bins ─► addnames ─► summarise; concat_unbins ─► catpack_unbins ─► addnames ─► summarise
prokka                            per bin ──► results/Annotation/Prokka/
bin_summary, multiqc              ──► results/GenomeBinning/summary/bin_summary.tsv, results/multiqc/

Inputs / Outputs

Assemblies, bins, depth tables, every summary table and the MultiQC tables match the Nextflow run (scripts/bench/nfcore/mag/compare.py in tc-os). The MultiQC report has no software versions, workflow summary or methods sections, which nf-core builds from Nextflow run metadata. Where Nextflow orders inputs by task finish time, the port uses a fixed order: runs of a sample are merged in samplesheet order, an assembly's BAMs go to jgi_summarize_bam_contig_depths and SemiBin2 in reverse name order (the finish order of the test run), and CONCAT_BUSCO_TSV concatenates in BUSCO slot order. bat_summary.tsv (CAT per bin) has the same rows in another fixed order: Nextflow's collectFile(sort: 'deep') orders the files by a hash of their content, the port by their content; the port writes it to results/GenomeBinning/summary/, Nextflow to Taxonomy/CAT/. SemiBin2 and the depth column order depend on the BAM order, so another dataset can bin differently from a Nextflow run that happened to finish in another order. MaxBin2 assemblies it cannot bin (exit 1 or 255) are dropped, as the pipeline's errorStrategy ignores them.

Parameters

| id | Default | Meaning | |---|---|---| | samplesheet | examples/samplesheet.csv | Samples, runs and reads (--input) | | busco_db_url, busco_db_lineage | test bacteria_odb10 archive | BUSCO lineage (--busco_db, --busco_db_lineage) | | cat_db_url | minigut_cat.tar.gz | CAT database (--cat_db) | | gtdb_db_url | gtdbtk_mockup_r232_20260507.tar.gz | GTDB-Tk database (--gtdb_db) | | input_mirror | empty | Folder searched by file name before downloading | | min_length_unbinned_contigs, max_unbinned_contigs | 1, 2 | Unbinned contigs kept as single-contig bins (test profile values) | | bin_min_size, bin_max_size | 0, 0 (none) | Bin size filter in bp | | gtdbtk_min_completeness, gtdbtk_max_contamination | 0.01, 10 | BUSCO thresholds for GTDB-Tk (test profile, default) |

References