sabreur

July 29, 2025 ยท View on GitHub

CI Coverage Rust version License

sabreur logo

๐Ÿ”Ž About

sabreur is a command-line tool designed to demultiplex barcoded sequencing reads into separate files. It supports:

  • FASTA and FASTQ formats
  • Compressed inputs and outputs: gzip, bzip2, xz, and zstd
  • Paired-end and Single-end reads

It uses a barcode file to match reads and dispatches each to the corresponding output. Reads with unknown barcodes go into a separate file.

Powered by niffler for seamless compression support.

๐Ÿš€ Usage

โ–ถ๏ธ Paired-end mode

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

โ–ถ๏ธ Single-end mode

sabreur barcode.txt input.fq

sabreur automatically detects the format and compression. Just provide the inputs!

โš™๏ธ Command-Line Options

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

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

OPTIONS:
    -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

๐Ÿ“ฆ Installation

Requirements

  • 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 Source (via Cargo)

git clone https://github.com/Ebedthan/sabreur.git
cd sabreur
cargo install --path . --root ~/.cargo
sabreur --help

๐Ÿ“ Prebuilt Binaries

Download binaries for your platform from the releases page:

Benchmark

Benchmarked with hyperfine dataset.

ToolSingle-end uncompressed outputSingle-end compressed outputPaired-end uncompressed outputPaired-end compressed output
idemp-211.571 ยฑ 3.718-366.247 ยฑ 10.482
sabre32.911 ยฑ 2.411-109.470 ยฑ 49.909-
sabreur10.843 ยฑ 0.53193.840 ยฑ 0.44640.878 ยฑ 13.743187.533 ยฑ 0.572

๐Ÿ—œ๏ธ Compression format performance

A simple benchmark of the different compression format (sabreur tests/bc_pe_fq.txt tests/input_R1.fastq.gz tests/input_R2.fastq.gz), zst being the fastest.

CommandMean [s]Min [s]Max [s]Relative
--format zst43.096 ยฑ 1.54741.17946.8781.00
--format bz294.049 ยฑ 4.76287.984101.1402.18 ยฑ 0.14
--format gz123.107 ยฑ 1.748120.529125.1662.86 ยฑ 0.11
--format xz285.692 ยฑ 18.625264.960325.7506.63 ยฑ 0.49

๐Ÿ“„ Barcode File Format

The barcode file must be tab-delimited in the format:

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

Output filenames must be unique. You can use .fq, .fastq, .fa, or .fasta as extensions.

Minimum supported Rust version

sabreur minimum Rust version is 1.78.0.

๐Ÿค Contributing

๐Ÿ› Bugs & Support

Found a bug or have a feature request? โ†’ Open an issue.

๐Ÿ“œ License

This project is licensed under the MIT License.