This workflow turns metagenomic assemblies into metagenomic bins with five binners (CONCOCT, MaxBin2, MetaBAT2, SemiBin and COMEBin), using cross-sample read coverage, and refines the bins with DAS Tool and/or Binette.
It performs cross-sample coverage estimation, binning and bin refinement for the MAGs generation workflow. A dedicated learning pathway provides detailed guidance on MAG generation in Galaxy, including the binning tools used here.
In single-sample binning, each assembly is binned with the coverage of its own reads. In multi-sample binning, the reads of every sample are mapped against the assembly of every sample, so each contig gets one coverage profile per sample. Binners can then separate organisms that have similar composition but different abundance patterns across samples.
Two details are worth knowing before starting:
- Each sample's reads are mapped against each sample's assembly, and every assembly is binned on its own. The workflow does not concatenate all assemblies into one co-assembly and split the resulting bins afterwards.
- The mapping workload grows as N² for N samples: N read sets × N assemblies. Storage grows quickly too, even though the workflow reuses the original FASTQ datasets instead of writing intermediate read files.
Note on sample count: Multi-sample binning is most effective with up to ~20 samples. Performance usually peaks around 20 samples (Mineeva et al., Nat. Commun. 2025). Using more than 20 samples can lead to extensive resource usage (N² mappings and substantial storage requirements). For many samples or samples from unrelated environments where cross-sample coverage adds little, single-sample binning is often the cheaper choice.
- Assemblies: a
listcollection of assemblies from any assembler (e.g. MEGAHIT or metaSPAdes).- Every sample's reads are mapped against every assembly, so the element identifiers of the reads and assemblies do not need to match.
- The number of assemblies does not need to equal the number of read samples: a single co-assembly binned with the coverage of all samples is a valid input.
- Paired-end reads: a
list:pairedcollection with one element per sample.- Reads should be quality-trimmed and host-removed, e.g. with the IWC short-read quality control and host contamination removal workflows.
- The sample names become the coverage columns of the binners.
- Use with caution for large datasets: multi-sample binning is most effective with up to ~20 samples. Performance usually peaks around 20 samples (Mineeva et al., Nat. Commun. 2025). Using more than 20 samples can lead to extensive resource usage, as the mapping workload grows as N² (N read sets × N assemblies) and storage requirements increase substantially. For many samples or unrelated environments, single-sample binning is often the cheaper choice.
- Run COMEBin?, Run SemiBin?, Run CONCOCT?, Run MetaBAT2? and Run MaxBin2? (default:
Yes): enable or skip each binner independently.- Keep at least one binner enabled.
- COMEBin is the most time- and resource-consuming binner.
- Bin refinement tool (default:
Binette):Binette,DAS ToolorBoth. - CheckM2 Database: the CheckM2 reference database Binette uses to assess bin quality.
- Minimum MAG completeness percentage (default: 40): the minimum bin completeness used by Binette. It does not filter DAS Tool output.
- Contamination weight (Binette) (default: 2): the contamination penalty used in Binette's scoring.
This step produces the coverage information every binner needs.
- The read pairs of all samples are flattened into one flat list of files, and the assemblies are used as they are.
- A nested cross product pairs each assembly with every flattened read file.
- Apply Rules rebuilds, for each assembly, the paired reads of each sample and the matching assembly reference. These are collection operations on the original datasets: no interlaced or de-interlaced FASTQ file is written.
- Bowtie2 maps every sample against every assembly.
- Contig depths are summarised per assembly with
jgi_summarize_bam_contig_depths, which yields one coverage matrix per assembly with the coverage and variance of every sample. - CONCOCT additionally needs the coverage of its contig fragments, which is computed separately, and the mean read length, which is estimated from both mates of every sample with SeqKit statistics. The estimate is the read-count-weighted mean (total bases divided by total reads), not an average of the per-sample means. No manual read length is required.
- For MaxBin2, the depth table is converted into one abundance file per read sample, containing the contig name and that sample's depth, without the header line or the variance columns. MaxBin2 reads the first number after the contig name as its abundance, so the full table would make it use the contig length instead, and MaxBin2 only uses cross-sample coverage when it gets one abundance file per sample.
The depth table produced by jgi_summarize_bam_contig_depths starts with contigName (contig identifier), contigLen (contig length) and totalAvgDepth (average depth across the input BAM files). Each read sample then contributes a depth column and a variance column. This gives each assembly's contigs a coverage profile across all read samples; “JGI depth table” refers to this format, not to an additional input database.
Each assembly is binned separately by every enabled binner.
| Binner | Inputs used |
|---|---|
| SemiBin | Contig composition and cross-sample coverage, in co-binning mode |
| CONCOCT | Contig fragments, their coverage table and the estimated read length; fragment clusters are merged back to contigs |
| MetaBAT2 | Contig composition and cross-sample coverage |
| MaxBin2 | Contig composition, cross-sample coverage and marker genes |
| COMEBin | Deep-learning binning from contig sequence and coverage; optional |
A binner set to No is skipped, and its candidate results are replaced by empty collections so that the refinement steps keep their structure. Raw binner outputs are only available for binners that ran.
The candidate bins are refined with one or both refinement tools:
- DAS Tool scores the contig-to-bin assignments of all enabled binners and selects a non-redundant set of bins.
- Binette evaluates the candidate FASTA bins with CheckM2 and refines them with the selected completeness and contamination settings.
Selecting Both runs DAS Tool and Binette independently on the candidate bins, allowing you to benefit from their different refinement approaches. The two output sets must then be combined and dereplicated downstream; this workflow does not perform dereplication. Dereplication reduces redundant genomes but does not enforce unique contig membership, so contigs can still end up in multiple retained bins. If exclusive contig assignments are required, inspect and resolve overlaps explicitly.
- Coverage depth matrices: one depth table per assembly, with the coverage of all original samples.
- MaxBin2 abundance files: one abundance file per assembly and read sample, as passed to MaxBin2 (contig name, that sample's mean depth, sample tag; no header).
- CONCOCT bins, MaxBin2 bins, MetaBAT2 bins, SemiBin bins and COMEBin bins (when COMEBin ran): one list of bins per assembly.
- DAS Tool bins, DAS Tool summary and DAS Tool contigs2bin report (when DAS Tool ran): the refined bins, a per-bin summary of completeness and redundancy based on single-copy genes, and the contig-to-bin assignments.
- Binette bins, Binette input bin quality reports and Binette final bin quality report (when Binette ran): the refined bins, the CheckM2 quality of the bins from each binner, and the CheckM2 quality of the final bins.
Binning is a separate workflow here, so it can be reused by larger analysis pipelines without copying or rewiring it.
- It keeps the binning parameters and outputs visible and controllable.
- It can be combined with different upstream and downstream workflows, e.g. taxonomic classification, genome annotation, functional analysis or benchmarking.
- It avoids duplicating binning logic inside every pipeline that needs it.
The IWC MAGs generation workflow is the comprehensive alternative: it assembles reads, bins with multiple tools, dereplicates the MAGs and reports their quality and abundance in one workflow. Use it when you want MAGs and their evaluation without a specialised downstream workflow, and use this binning workflow when binning is one component of a larger analysis.
Through the workflow editor, an upstream or downstream workflow can also restrict this one, for example to a single refinement tool.
This workflow was developed as part of the FAIRyMAGs project, funded as a commissioned service of the Biodiversity, Food Security and Pathogens (BFSP) ELIXIR Scientific Programme 2024–2028.
The project was also supported by the European Galaxy Server, funded by the German Federal Ministry of Education and Research (BMBF; 031 A538A de.NBI-RBC) and the Ministry of Science, Research and the Arts Baden-Württemberg (MWK) within the framework of LIBIS/de.NBI Freiburg.