A Rust tool to convert alignments from pangenome variation graphs into coverage maps, facilitating haplotype-based genotyping analysis.
gafpack processes Graph Alignment Format (GAF) files against their corresponding Graph Fragment Assembly (GFA) graphs to generate coverage statistics. This is particularly useful for:
- Analyzing read coverage across pangenome variation graphs
- Supporting haplotype-based genotyping workflows
- Quantifying alignment distribution across graph nodes
- Rust toolchain (cargo)
- Input files:
- GFA format graph file
- GAF format alignment file
Use cargo
to build and install:
cargo install --force --path .
Basic usage requires a graph file (GFA) and alignment file (GAF):
gafpack -g graph.gfa -a alignments.gaf >coverage.tsv
-g, --graph
: Input GFA pangenome graph file (required)-a, --alignments
: Input GAF alignment file (required)-l, --len-scale
: Scale coverage values by node length-c, --coverage-column
: Output coverage vector in single column format-w, --weight-queries
: Weight coverage by query group occurrences
-
Default (tabular):
#sample node.1 node.2 node.3 ... alignments.gaf 1.5 2.0 0.5 ...
-
Column format (-c flag):
##sample: alignments.gaf #coverage 1.5 2.0 0.5 ...
Scale coverage by node length:
gafpack -g graph.gfa -a reads.gaf --len-scale >scaled_coverage.tsv
Get column format output:
gafpack -g graph.gfa -a reads.gaf --coverage-column >coverage_vector.tsv