← All tools
TagGen logo

TagGen

High-performance barcode generator and demultiplexer

Overview

Generates diverse, error-tolerant DNA and RNA barcodes for multiplexed sequencing and assigns reads back to their source barcode with an integrated anchor-free demultiplexer. It is built for long-read platforms, where error rates of 5 to 15 percent dominated by insertions and deletions demand longer and more robust barcodes than short-read tools can produce.

Quick start

Linux

curl -fsSL https://github.com/Arnaroo/taggen/releases/download/v1.2.5/taggen-linux-x86_64 \
  -o /usr/local/bin/taggen && chmod +x /usr/local/bin/taggen
taggen --cli -n 96 -l 14 -d 4 -o my_barcodes

Barcodes for nanopore (Levenshtein)

taggen --cli -n 96 -l 20 -d 8 --metric levenshtein \
  --minGc 40 --maxGc 60 -o ont_tags -v

Demultiplex reads

taggen --demux --tags my_barcodes.fasta --reads reads.fastq \
  --mode end --trim-mode ends --outdir demux_results/

The problem it solves

Barcodes of 8 to 12 bp with a minimum Hamming distance of 3 or 4 give adequate error tolerance on short-read platforms. Nanopore sequencing does not behave that way: error rates of 5 to 15 percent, dominated by insertions and deletions, demand longer barcodes with greater inter-sequence distances. Existing generators enumerate every possible sequence exhaustively, which is O(4^n) and becomes computationally infeasible above 12 bp.

TagGen replaces exhaustive enumeration with Monte Carlo candidate sampling followed by greedy diversity selection. That is O(k) in the number of candidates sampled, typically 10,000 to 100,000, so barcode sets of 14 to 30 bp are produced in milliseconds rather than never.

Anchor-free demultiplexing

The bundled demultiplexer assigns FASTQ reads to their source barcode without needing to know the flanking adapter sequence. It locates the barcode at any position in the read using k-mer voting followed by banded edit-distance alignment. That matters for direct RNA sequencing, spatial transcriptomics capture plates, and custom library protocols, where the barcode is not framed by a consistent adapter and primer-anchored tools such as minibar or Dorado have nothing to anchor to.

  • Two search modes: end mode for standard dual-ended libraries, full mode for mid-read barcodes.
  • Position masks restrict the search to a region given in absolute bp, end-relative offsets or read-length fractions, which cuts false positives.
  • Ambiguity detection rejects a read when the margin between the best and second-best match is less than 2.
  • POD5 co-demultiplexing partitions the raw signal files alongside the FASTQ, one per sample.
  • Unassigned reads are collected separately and annotated with the reason they were rejected.

Measured performance

Benchmarks from the repository README, all for 96 target barcodes under Hamming distance with GC held between 25 and 75 percent, wall-clock averaged over 3 replicates on a 12-core AMD machine. At 12 bp and d>=4 TagGen takes 34 ms against 463 s for DNABarcodes, a factor of 13,600. At 14 bp and above DNABarcodes exhausts memory and returns nothing, while TagGen stays at roughly 35 ms out to 30 bp.

Barcode resolution was validated against a realistic nanopore error model (50 percent deletions, 25 percent insertions, 25 percent substitutions) over 154 parameter combinations. At 20 bp with d>=6, 96.4 percent of reads are still assigned to the correct barcode at a 25 percent error rate; at 30 bp with d>=8 that rises to 99.6 percent.

Interfaces

TagGen ships a GTK3 graphical interface with a three-tab layout (Generate, Demultiplex, About), real-time parameter validation, an interactive pairwise-distance heatmap, and post-demultiplexing statistics charts covering match positions, edit-distance distributions and Q-score profiles. The same functionality is available through a full command-line interface for scripted pipelines and HPC batch use, and parameter sets can be saved to and shared as JSON configuration files.

Full documentation, source and issue tracker on GitHub.