A Rust tool for visualizing variation graphs from GFA files.
This is a reimplementation of odgi viz that works directly with GFA files, avoiding the need to convert to ODGI format first.
Based on the viz command from ODGI:
Guarracino A, Heumos S, Naber F, Panber P, Kelleher J, Garrison E. ODGI: understanding pangenome graphs. Bioinformatics. 2022;38(13):3319-3326. https://doi.org/10.1093/bioinformatics/btac308
- Direct GFA file input (no conversion required)
- PNG and SVG output formats
- Memory-efficient processing
- SHA256-based path coloring (matching odgi)
- Binned mode visualization with multiple coloring modes
- Path clustering by similarity with dendrogram visualization
- Path annotations with legend (e.g., population labels)
- Edge visualization
- X-axis coordinate display
cargo build --releasegfalook -i input.gfa -o output.png [OPTIONS]All examples use the chr6.C4.gfa test graph.
gfalook -i graph.gfa -o basic.png -x 1000 -y 500Color by coverage depth using Spectral palette:
gfalook -i graph.gfa -o depth.png -x 1000 -y 500 -mgfalook -i graph.gfa -o depth_rdbu.png -x 1000 -y 500 -m -B RdBu:11Show forward (blue) and reverse (red) strand orientation:
gfalook -i graph.gfa -o strand.png -x 1000 -y 500 -SColor darkness varies by position within each path:
gfalook -i graph.gfa -o darkness.png -x 1000 -y 500 -d -lgfalook -i graph.gfa -o white_black.png -x 1000 -y 500 -d -uDraw connector lines between discontinuous path segments:
gfalook -i graph.gfa -o links.png -x 1000 -y 500 -L 0.3Single row showing mean coverage across all paths:
gfalook -i graph.gfa -o compressed.png -x 1000 -y 100 -OAutomatically cluster and reorder paths by similarity. Colored bars on the left indicate cluster membership. Combined with -m for better visibility:
gfalook -i graph.gfa -o clustered.png -x 1000 -y 500 -k -mShow only cluster representatives (medoids) with -K. Each path label shows the cluster size:
gfalook -i graph.gfa -o clustered_representatives.png -x 1000 -y 500 -k -K -mShow hierarchical clustering tree alongside paths with depth coloring:
gfalook -i graph.gfa -o dendrogram.png -x 1000 -y 500 -k -D -mCombine dendrogram, depth coloring, and absolute X-axis coordinates:
gfalook -i graph.gfa -o dendrogram_xaxis.png -x 1000 -y 500 \
-k -D -m --x-axis "chm13#chr6:31825251-31908851" --x-axis-absoluteUse pure UPGMA hierarchical clustering instead of DBSCAN. This creates clusters by cutting the tree at a height threshold:
gfalook -i graph.gfa -o upgma.png -x 1000 -y 500 -k --use-upgma -D -mControl cluster granularity with --upgma-threshold (0.0-1.0, lower = more clusters):
gfalook -i graph.gfa -o upgma_fine.png -x 1000 -y 500 -k --use-upgma --upgma-threshold 0.3 -D -mDisplay coordinates based on node order in the graph:
gfalook -i graph.gfa -o xaxis_pangenomic.png -x 1000 -y 500 --x-axis pangenomic --x-ticks 5Display coordinates based on a reference path (e.g., chm13):
gfalook -i graph.gfa -o xaxis_chm13.png -x 1000 -y 500 \
--x-axis "chm13#chr6:31825251-31908851" --x-ticks 5Show absolute chromosome coordinates instead of relative positions:
gfalook -i graph.gfa -o xaxis_chm13_abs.png -x 1000 -y 500 \
--x-axis "chm13#chr6:31825251-31908851" --x-ticks 5 --x-axis-absoluteLabel paths by category (e.g., population, sample type) using an annotation file. The annotation file is a CSV or TSV with two columns: prefix and annotation. Each prefix is matched against path names (longest match wins), and categories are displayed as a centered legend at the top with colored indicators next to each path.
gfalook -i graph.gfa -o annotation.png -x 1000 -y 500 \
-E test/hprc_year1_samples.csvExample annotation file (test/hprc_year1_samples.csv) - includes all 234 HPRC Year 1 samples with their population codes:
prefix,annotation
HG00438,CHS
HG00621,CHS
HG01891,ACB
...
CHM13,REF
GRCh38,REF
HG002,NA
HG005,NA
Combine path annotations with clustering, dendrogram, depth coloring, and x-axis coordinates:
gfalook -i graph.gfa -o annotation_clustered.png -x 1000 -y 500 \
-E test/hprc_year1_samples.csv -k -D -m \
--x-axis "chm13#chr6:31825251-31908851" --x-axis-absoluteThis example shows all visualization features combined: legend at top, dendrogram on left, cluster bar, annotation bar (with a gap between them), path names, depth coloring, and x-axis with absolute coordinates at the bottom.
MIT License - see LICENSE for details.


















