#barcode #sequencing #bioinformatics

bin+lib barkit

BarKit — a cross-platform and ultrafast toolkit for barcodes manipulation in FASTQ files

8 releases

1.0.0-rc.6 Aug 30, 2024
1.0.0-rc.4 Aug 29, 2024
0.1.1 Sep 2, 2024
0.1.0 Aug 26, 2024

#75 in Biology

Download history 416/week @ 2024-08-26 170/week @ 2024-09-02

586 downloads per month

GPL-3.0 license

70KB
1K SLoC

BarKit

BarKit (Barcodes ToolKit) is a toolkit designed for manipulating FASTQ barcodes.

Installation

From crates.io

Barkit can be installed from crates.io using cargo. This can be done with the following command:

cargo install barkit

Build from source

  1. Clone the repository:
git clone https://github.com/nsyzrantsev/barkit
cd barkit/
  1. Build:
cargo build --release && sudo mv target/release/barkit /usr/local/bin/

Extract subcommand

The extract subcommand is designed to parse barcode sequences from FASTQ reads using approximate regex matching based on a provided pattern.

All parsed barcode sequences are moved to the read header with base quality, separated by colons:

@SEQ_ID UMI:ATGC:???? CB:ATGC:???? SB:ATGC:????
  • UMI: Unique Molecular Identifier (Molecular Barcode)
  • CB: Cell Barcode
  • SB: Sample Barcode

Examples

Parse the first twelve nucleotides as a UMI from each forward read:

barkit extract -1 <IN_FASTQ1> -2 <IN_FASTQ2> -p "^(?P<UMI>[ATGCN]{12})" -o <OUT_FASTQ1> -O <OUT_FASTQ2>

Parse the first sixteen nucleotides as a cell barcode from each reverse read before the atgccat adapter sequence:

barkit extract -1 <IN_FASTQ1> -2 <IN_FASTQ2> -P "^(?P<CB>[ATGCN]{16})atgccat" -o <OUT_FASTQ1> -O <OUT_FASTQ2>

[!NOTE] Use lowercase letters for fuzzy match patterns.

Dependencies

~11–20MB
~237K SLoC