| Crates.io | seqwish |
| lib.rs | seqwish |
| version | 0.1.3 |
| created_at | 2025-11-05 15:44:10.237736+00 |
| updated_at | 2025-11-07 21:11:25.945165+00 |
| description | A variation graph inducer - build pangenome graphs from pairwise alignments |
| homepage | |
| repository | https://github.com/pangenome/seqwish |
| max_upload_size | |
| id | 1918180 |
| size | 641,454 |
A variation graph inducer - Build pangenome graphs from pairwise sequence alignments.
Seqwish implements a lossless conversion from pairwise alignments between sequences to a variation graph encoding the sequences and their alignments. As input we typically take all-versus-all alignments, but the exact structure of the alignment set may be defined in an application specific way.
# From source (recommended)
git clone https://github.com/pangenome/seqwish
cd seqwish
cargo build --release
# Binary will be in target/release/seqwish
# Future: cargo install seqwish (once published to crates.io)
# Basic usage
seqwish -s sequences.fa -p alignments.paf -g output.gfa
# With options for large datasets
seqwish \
-s sequences.fa \ # Input sequences (FASTA/FASTQ)
-p alignments.paf \ # Pairwise alignments (PAF format)
-g output.gfa \ # Output variation graph (GFA format)
-t 16 \ # Use 16 threads
-k 19 \ # Filter matches < 19bp
-P # Show progress
-s, --seqs <FILE> Input sequences (FASTA/FASTQ, optionally gzipped)
-p, --paf-alns <FILE> Input alignments (PAF format, optionally gzipped)
-g, --gfa <FILE> Output graph (GFA v1.0 format)
-t, --threads <N> Number of threads [default: 1]
-k, --min-match-len <N> Minimum match length [default: 0]
-r, --repeat-max <N> Maximum repeat copies in transitive closure [default: 0]
-l, --min-repeat-distance <N> Minimum distance for repeat handling [default: 0]
-B, --transclose-batch <N> Transitive closure batch size [default: 1000000]
-b, --temp-dir <PATH> Temporary file directory
-T, --keep-temp Keep temporary files
-P, --show-progress Show progress messages
The algorithm proceeds in stages:
# 1. Generate all-to-all alignments
minimap2 -cx asm20 -X sequences.fa sequences.fa > alignments.paf
# 2. Build the variation graph
seqwish -s sequences.fa -p alignments.paf -g graph.gfa -t 16 -P
# 3. Visualize (requires vg and graphviz)
vg view -dp graph.gfa | dot -Tpng > graph.png
If you use seqwish, please cite:
Garrison E, Guarracino A. (2023)
Unbiased pangenome graphs
Bioinformatics, Volume 39, Issue 1, btac743
https://doi.org/10.1093/bioinformatics/btac743
This is a complete Rust reimplementation of seqwish using the "Ship of Theseus" pattern - incrementally replacing components while maintaining correctness. The Rust version:
The original C++ implementation is preserved in cpp/ for reference. See README_CPP.md for C++ documentation.
Contributions welcome! See CONTRIBUTING.md for guidelines.
MIT - see LICENSE file
Made with 🦀 Rust