SynGraph builds a colored de Bruijn graph over gene tokens to detect conserved synteny blocks across multiple genomes.
syn/
├── crates/
│ ├── syn-core/ # Core library (data structures, algorithms)
│ │ ├── token.rs # Gene token types
│ │ ├── genome.rs # Genome/chromosome representation
│ │ ├── bed.rs # TOGA2 BED12 parser
│ │ ├── kmer.rs # Gene k-mer construction
│ │ ├── graph.rs # Colored de Bruijn graph
│ │ ├── compaction.rs # Unitig compaction
│ │ └── synteny.rs # Synteny block detection
│ ├── syn-cli/ # Command-line interface
│ └── syn-web/ # WASM + Web UI
├── data/ # Input/output data
└── Makefile # Build commands
Parse TOGA2 output files containing gene annotations with embedded orthology information.
BED12 with name field: transcript#ortholog_gene#scores$fragment
Construct a colored de Bruijn graph over gene tokens.
For each genome, extract k-mers of consecutive genes. Add each k-mer as an edge, colored by the genome ID.
./target/release/syn build-toga \ --bed data/genome1.bed \ --bed data/genome2.bed \ --k 3 \ --output data/graph.bin
Collapse non-branching paths into unitigs (synteny blocks).
Find maximal paths where all edges have the same color set. These become unitigs.
./target/release/syn compact \ --graph data/graph.bin \ --output data/compacted.bin
Classify blocks and detect conserved synteny regions.
Interactive web browser for exploring synteny.
make build-wasm make deploy
Detect inversions, translocations, and other rearrangements.
# Build everything make build # Run full pipeline on TOGA2 BED files ./target/release/syn build-toga \ --bed data/HLlarFus1.sorted.bed \ --bed data/HLtaeGutt6.sorted.bed \ --k 3 \ --output data/graph.bin ./target/release/syn compact \ --graph data/graph.bin \ --output data/compacted.bin # Serve web interface ./target/release/syn serve --graph data/compacted.bin --port 8080
TOGA2 BED files Gene Graph Compacted Graph Web Browser
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ genome1.bed │────────▶│ │ │ Unitigs │ │ Tracks │
│ genome2.bed │ │ Colored │────────▶│ + colors │────────▶│ + ribbons │
│ genome3.bed │────────▶│ de Bruijn │ │ + coords │ │ + popups │
│ ... │ │ Graph │ │ + adj. │ │ + search │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
│ │
▼ ▼
graph.bin compacted.bin