#bioinformatics #demultiplexing

app sabreur

sabreur is a barcode demultiplexing tool for fasta and fastq files

10 releases

0.5.0 Sep 1, 2022
0.4.1 Sep 7, 2021
0.4.0 Jul 5, 2021
0.3.3 Jun 29, 2021
0.1.0 Apr 25, 2021

#1305 in Command line utilities

Download history 19/week @ 2023-10-29 2/week @ 2023-11-05 12/week @ 2023-11-12 2/week @ 2023-11-19 32/week @ 2023-11-26 20/week @ 2023-12-03 11/week @ 2023-12-17 20/week @ 2023-12-24 11/week @ 2024-01-07 9/week @ 2024-01-14 9/week @ 2024-01-21 20/week @ 2024-01-28 2/week @ 2024-02-04 36/week @ 2024-02-11

70 downloads per month

MIT license

1.5K SLoC


With next-generation sequencing tools capabilities, millions to billions of reads are generated. To reach such a rate in a cost-efficient manner, barcoding individual sequences for multiple lines or species is a common practice.

Sabreur is a tool that aims to demultiplex barcoded reads into separate files. It supports both fasta and fastq files. Input files can be gzip, bzip2 or xz compressed in input or output (Thanks to the awesome niffler crate). If an uncompressed file is provided the output is by default uncompressed. But this behaviour can be changed by settingn the --format option to the desired compress format. The --format option if specified while input files are compressed changes output files to the specified compress format. Sabreur in its core compares the provided barcodes with each read, then separates the read into its appropriate file. If a read does not have a recognized barcode, then it is put into an unknown file.

How to use sabreur

Paired-end mode

sabreur barcode.txt input_R1.fq.gz input_R2.fq.gz

Single-end mode

sabreur barcode.txt input.fq

Input sequences files can be fasta or fastq, compressed or not. The supported compression format are gz, bz2, xz and zst. Just give the sequences, sabreur know how to handle it!

Command-line arguments

    sabreur [options] <BARCODE> <FORWARD FILE> [<REVERSE FILE>]

    <BARCODE>    input barcode file
    <FORWARD>    input forward fastx file
    <REVERSE>    input reverse fastx file

    -m, --mismatch <INT>    maximum number of mismatches [default: 0]
    -o, --out <DIR>         ouput directory [default: sabreur_out]
    -f, --format <STR>      output files compression format
    -l, --level <INT>       compression level [default: 1]
        --force             force reuse of output directory
    -q, --quiet             decrease program verbosity
    -h, --help              Print help information
    -V, --version           Print version information


  • Rust in stable channel
  • libgz for gz file support
  • liblzma for xz file support
  • libbzip2 for bzip2 file support
  • zstd for zstd file support


From crates.io

If you already have a functional rust installation do:

cargo install sabreur

From source

git clone https://github.com/Ebedthan/sabreur.git
cd sabreur

cargo build --release
cargo test
cargo install --path .


We used hyperfine for benchmarking with this dataset.

Tool Single-end uncompressed output Single-end compressed output Paired-end uncompressed output Paired-end compressed output
idemp - 211.571 ± 3.718 - 366.247 ± 10.482
sabre 32.911 ± 2.411 - 109.470 ± 49.909 -
sabreur 10.843 ± 0.531 93.840 ± 0.446 40.878 ± 13.743 187.533 ± 0.572

Minimum Rust version policy

This crate's minimum supported rustc version is 1.56.1.


Sabreur use colored output in help, nevertheless sabreur honors NO_COLORS environment variable.

Sabreur use a special barcode tab-delimited file format in the form:

barcode1    barcode1_file1.fq   barcode1_file2.fq
barcode2    barcode2_file1.fq   barcode2_file2.fq


Contributions are welcomed under the project code of conduct.


Submit problems or requests to the Issue Tracker.

Code of conduct

Please note that the sabreur project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.


~462K SLoC