Skip to main content

Bioconda Bioconda downloads PyPI Python License

CI Coverage Documentation

JOSS

Binette

Binette is a fast and accurate binning refinement tool designed to construct high-quality MAGs from the output of multiple binning tools.

How It Works

From the input bin sets, Binette constructs new hybrid bins. A bin is a set of contigs. When at least two bins overlap (i.e., share at least one contig), Binette applies fundamental set operations to generate new bins:

  • Intersection Bin: Contains contigs that are shared by overlapping bins.
  • Difference Bin: Includes contigs that are unique to one bin and not found in others.
  • Union Bin: Encompasses all contigs from the overlapping bins.

Binette then evaluates bin quality using CheckM2, ensuring the selection of the best possible bins.

Why Binette?

Binette is inspired by the metaWRAP bin-refinement tool but effectively addresses its limitations. Key improvements include:

  • Enhanced Speed
    Binette significantly accelerates the refinement process by running CheckM2's initial steps (e.g., Prodigal and Diamond) only once for all contigs. These intermediate results are then reused for bin quality assessment, eliminating redundant computations.

  • No Limit on Input Bin Sets
    Unlike metaWRAP, Binette supports any number of input bin sets, allowing seamless processing of multiple binning outputs.

Installation

With Bioconda

Binette can be easily installed with conda

conda create -c conda-forge -c bioconda -n binette binette
conda activate binette

Binette should be able to run :

binette -h

From a conda environment

Clone this repository:

git clone https://github.com/genotoul-bioinfo/Binette
cd Binette

Then create a Conda environment using the binette.yaml file:

conda env create -n binette -f binette.yaml
conda activate binette 

Finally install Binette with pip

pip install .

Binette should be able to run :

binette -h

Downloading the CheckM2 database

Before using Binette, it is necessary to download the CheckM2 database:

checkm2 database --download --path <checkm2/database/>

Make sure to replace <checkm2/database/> with the desired path where you want to store the CheckM2 database.

Usage

Input Formats

Binette supports two input formats for bin sets:

  1. Contig2bin Tables: You can provide bin sets using contig2bin tables, which establish the relationship between each contig and its corresponding bin. In this format, you need to specify the --contig2bin_tables argument.

For example, consider the following two contig2bin_tables:

  • bin_set1.tsv:

    contig_1   binA
    contig_8   binA
    contig_15  binB
    contig_9   binC
    
  • bin_set2.tsv:

    contig_1   bin.0
    contig_8   bin.0
    contig_15  bin.1
    contig_9   bin.2
    contig_10  bin.0
    

    The binette command to process this input would be:

    binette --contig2bin_tables bin_set1.tsv bin_set2.tsv --contigs assembly.fasta
    
  1. Bin Directories: Alternatively, you can use bin directories, where each bin is represented by a separate FASTA file. For this format, you need to provide the --bin_dirs argument. Here's an example of two bin directories:

    bin_set1/
    ├── binA.fa: contains sequences of contig_1, contig_8
    ├── binB.fa: contains sequences of contig_15
    └── binC.fa: contains sequences of contig_9
    
    bin_set2/
    ├── binA.fa: contains sequences of contig_1, contig_8, contig_10
    ├── binB.fa: contains sequences of contig_15
    └── binC.fa: contains sequences of contig_9
    

    The binette command to process this input would be:

    binette --bin_dirs bin_set1 bin_set2 --contigs assembly.fasta
    

In both formats, the --contigs argument should specify a FASTA file containing all the contigs found in the bins. Typically, this file would be the assembly FASTA file used to generate the bins. In these examples the assembly.fasta file should contain at least the five contigs mentioned in the contig2bin_tables files or in the bin fasta files: contig_1, contig_8, contig_15, contig_9, and contig_10.

Outputs

Binette results are stored in the results directory. You can specify a different directory using the --outdir option.

In this directory you will find:

  • final_bins_quality_reports.tsv: This is a TSV (tab-separated values) file containing quality information about the final selected bins.
  • final_bins/: This directory stores all the selected bins in fasta format. Can be skipped with --no-write-fasta-bins.
  • final_contig_to_bin.tsv: A headerless TSV file mapping each contig to its assigned bin. This format is much lighter than the fasta output to describe the final Binette bins.
  • input_bins_quality_reports/: A directory storing quality reports for the input bin sets, with files following the same structure as final_bins_quality_reports.tsv.
  • temporary_files/: This directory contains intermediate files (predicted proteins, DIAMOND alignments and a checkpoint.json file tracking them). They are reused to avoid recomputing time-consuming steps when Binette is run again in the same output directory (see Resuming a run).

The final_bins_quality_reports.tsv file contains the following columns:

Column Name Description
name The unique name of the bin.
origin Indicates the source of the bin: either an original bin set (e.g., B) or binette for intermediate bins.
is_original Boolean flag indicating if the bin is an original bin (True) or an intermediate bin (False).
original_name The name of the original bin from which this bin was derived.
completeness The completeness of the bin, determined by CheckM2.
contamination The contamination of the bin, determined by CheckM2.
checkm2_model The CheckM2 model used for quality prediction: Gradient Boost (General Model) or Neural Network (Specific Model).
score Computed score: completeness - contamination * weight. The contamination weight can be customized using the --contamination_weight option.
size Total size of the bin in nucleotides.
N50 The N50 of the bin, representing the length for which 50% of the total nucleotides are in contigs of that length or longer.
coding_density The percentage of the bin that codes for proteins (genes length / total bin length × 100). Only computed when genes are freshly identified. Empty when using the --proteins option.
contig_count Number of contigs contained within the bin.

Resuming a run and reusing an output directory

Binette keeps track of its intermediate results in temporary_files/. When it is run again with the same output directory, it automatically reuses whatever was already computed. Resuming is on by default, so the same command can be resubmitted after a failed or interrupted job (e.g. a SLURM job that ran out of time or memory) without any change:

  • Predicted proteins and DIAMOND alignments are reused only when they were computed from the same inputs (contig sequences, input bin sets, --proteins file and CheckM2 database) and their files are complete and unmodified. Otherwise they are recomputed, and Binette logs why.
  • If a previous run already completed with the same inputs and parameters, Binette reports that there is nothing to do and exits successfully.
  • Changing only parameters that affect bin selection (e.g. --min_completeness, --contamination_weight, --prefix) reuses the proteins and DIAMOND alignments and overwrites the final results.
  • --no-write-fasta-bins does not change the results: rerunning a completed run with or without it does not recompute anything. If bin FASTA files are missing or modified, they are written again from final_contig_to_bin.tsv.
  • Use --no-resume to recompute everything.

To prevent accidentally mixing results from different analyses, Binette stops with an error if the output directory contains results computed from different inputs, or results from an older Binette version that cannot be verified. Use a different --outdir, or add --force to discard the previous intermediate files and overwrite the results.

Help, feature requests and bug reporting

To report bugs, request new features, or seek help and support, please open an issue.

Licence

This tool is released as open source software under the terms of the GNU General Public Licence.

Citation

Binette is a scientific software tool with a published paper in the Journal of Open Source Software. If you use Binette in academic research, please cite:

Binette: a fast and accurate bin refinement tool to construct high-quality Metagenome Assembled Genomes.
Mainguy et al., (2024).
Journal of Open Source Software, 9(102), 6782.
doi: 10.21105/joss.06782

Binette extensively uses CheckM2. If your work relies on Binette, consider citing:

CheckM2: a rapid, scalable, and accurate tool for assessing microbial genome quality using machine learning.
Chklovski, Alex, et al. (2023).
Nature Methods, 20(8), 1203-1212.
doi: 10.1038/s41592-023-01940-w

Metadata

Release files for Binette 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Binette 1.4.0
File Size Uploaded Provenance Actions
binette-1.4.0.tar.gz 60.0 kB With provenance Details for binette-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Binette 1.4.0
File Interpreter ABI Platform Actions
binette-1.4.0-py3-none-any.whl Python 3 none any Details for binette-1.4.0-py3-none-any.whl

Total release size: 119.1 kB

Release files / binette-1.4.0.tar.gz

Download URL binette-1.4.0.tar.gz
Size 60.0 kB
Tags Source
SHA-256 checksum
How to use checksums
03f49b6def39cfcbf666bbf4860a401a671711a1e316f850b1b7cf5dd28fcfe7
BLAKE2b-256 checksum
How to use checksums
4ca753ad1e5f0c83bdbff34feeed2e5efd5e4c96834104dd89ffafa4c6363b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / binette-1.4.0-py3-none-any.whl

Download URL binette-1.4.0-py3-none-any.whl
Size 59.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3ebe70132381db1fbec5c6235208325a5ea592f9b25fff4a787319f383c288a
BLAKE2b-256 checksum
How to use checksums
6b4cd6ff9253f8107c3130b79c774ce64f2038d90c109f4dc7f0b428266ac085
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for Binette 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for binette-1.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page