Preprint
Article

This version is not peer-reviewed.

Panpath-Audit: Sequence-Level Verification of Embedded Pangenome Paths Against Source Assemblies

Submitted:

25 August 2026

Posted:

26 August 2026

You are already at the latest version

Abstract
Pangenome graphs embed assemblies as traversals through sequence-labelled segments, but internal graph validity does not establish that these traversals still reproduce the external assemblies from which a graph was constructed. We present panpath-audit, a command-line program that reconstructs GFA1 paths and coordinate-aware GFA1.1 walks and compares them symbol-for-symbol with named FASTA sources. The program performs an all-or-nothing input preflight, handles complete IUPAC reverse complements, distinguishes unembedded walk ranges from divergence, bounds tracked sequence memory, and emits deterministic human, JSON, or TSV reports. We evaluated the program using public tomato and Human Pangenome Reference Consortium graphs. In the tomato chromosome-2 graph, 23 traversals representing 1,280,460,312 source bases were recovered exactly. Prepared controls localized an altered MM#1#chr02 source at both linear and graph coordinates and identified an omitted SL5#1#ch02 source explicitly. Audits of clipped and full Minigraph–Cactus graphs at human whole-pangenome scale independently reported the same 94 substituted bases, which we trace to IUPAC ambiguity codes in GRCh38 that graph construction had replaced with N. These results support sequence auditing as a distinct complement to topological graph validation and as a practical gate for construction, conversion, distribution, and continuous-integration workflows.
Keywords: 
;  ;  ;  ;  

1. Introduction

Pangenome graphs represent the sequence diversity of a collection while retaining individual genomes or haplotypes as paths through the graph [1]. This model underlies resources such as the draft human pangenome [2] and graph-building systems including Minigraph–Cactus [3] and PGGB [4]. Graphical Fragment Assembly (GFA) files commonly encode segment sequences in S records and embedded traversals in P paths or W walks [5].
Graph topology and source preservation are related but different properties. A topology validator can establish that path steps are present and connected; for example, odgi validate checks path consistency with graph topology [6]. It cannot establish that an independently distributed FASTA collection is the collection represented by the graph, nor that a segment sequence remained unchanged during conversion or transfer. A structurally valid graph may therefore reconstruct a different nucleotide sequence while continuing to satisfy its internal constraints.
panpath-audit addresses the narrow question: did the embedded graph traversals preserve their named source sequences? It is builder-independent, operates directly on plain or gzip-compressed FASTA and GFA files, and reports both complete correspondence and sequence identity. Here we describe its audit contract and apply it to plant and human public pangenomes.

2. Implementation

2.1. Audit Contract

Source identifiers are paired case-sensitively with graph traversal names. Inputs may use exact names, arbitrary prefixes, or the PanSN convention sample#haplotype#contig [7]. Nucleotide comparison is case-insensitive but symbol-exact over the DNA IUPAC alphabet; for example, N does not match A. Reverse-oriented segments use the complete IUPAC complement mapping.
The supported graph contract comprises inline-sequence S records, blunt P paths with unspecified or 0M overlaps, and coordinate-bearing W walks. Non-overlapping walk records with the same PanSN name are combined in coordinate order. Source intervals between explicit walk ranges are classified as not embedded rather than divergent. The program does not validate links, graph topology, external segment references, or non-blunt overlap CIGARs.
Before comparison, an all-or-nothing preflight rejects invalid FASTA symbols, duplicate source names, missing segment sequences, unresolved steps, duplicate traversals, ambiguous walk ranges, and unsupported overlaps. A completed audit classifies every identifier as identical, divergent, missing path, or missing source (Figure 1). Divergence reports the first one-based source and traversal positions and, when present, the segment, orientation, traversal position, and within-segment position. Stable exit codes distinguish identity, divergence, correspondence failure, unsupported GFA, and operational failure.

2.2. Streaming and Reporting

FASTA inputs are streamed twice: once to index mapped identifiers and lengths, and once to supply source sequences to a bounded worker pool. Graph records and segment sequences are indexed in anonymous temporary files instead of retaining the complete graph in memory. A shared admission budget bounds concurrently held sequence bytes; a contig larger than the budget is admitted alone to guarantee progress. This accounting intentionally excludes allocator overhead, compression buffers, parser metadata, operating-system caches, and temporary storage.
JSON and TSV reports include SHA-256 and BLAKE3 digests of complete sources, addressed source ranges, and reconstructed traversals. Comprehensive mode adds separate source and graph base ledgers and bounded exact unit-cost Levenshtein alignment for divergent traversals. First-divergence diagnostics and digests remain available when the alignment work or memory limit is exceeded.

3. Evaluation

3.1. Datasets and Controls

The tomato dataset followed the 23-assembly preparation used to evaluate PGGB [4], originally derived from the tomato graph pangenome resource of Zhou et al. [8]. Chromosome 2 sequences were renamed with PanSN identifiers and audited against the cleaned PGGB GFA containing 23 P paths. Two prepared FASTA controls retained the same graph: one substituted a single base at the midpoint of the 55,739,602 bp MM chromosome, and one omitted the SL5 source entirely.
For the human evaluation, 94 phased Year-1 HPRC assemblies with existing PanSN headers were combined with CHM13 using a PanSN mapping, then audited against the public GRCh38-based Minigraph–Cactus v1.0 clipped and v1.1 full graphs [2,3]. The two graphs name their GRCh38 traversals differently: the clipped graph embeds GRCh38 as P paths named GRCh38.chr1, whereas the full graph embeds it as PanSN walks named GRCh38#0#chr1. GRCh38 was therefore mapped by graph path prefix for the clipped graph and by PanSN sample and haplotype for the full graph. Applying one convention to both graphs reclassifies every GRCh38 contig as missing instead of comparing it, which is itself an instance of the correspondence failure the audit is designed to expose. The clipped graph uses explicit walk ranges and can omit source intervals; the full graph preserves untrimmed walks. Publisher-provided assembly checksums were verified before analysis.

3.2. Execution and Results

Version 0.1.2 of panpath-audit [9] was compiled in release mode with Rust 1.98.0 and run with 24 worker threads, a 6144-MiB tracked-memory limit, and comprehensive statistics. Experiments ran on Linux with 24 logical processors and 61.7 GiB host memory; inputs were read from btrfs storage and scratch files were written to btrfs storage. Wall-clock time and maximum resident set size in Table 1 are therefore descriptive telemetry, not a cross-system performance benchmark. The complete evaluation was subsequently rerun on unrelated hardware with a different processor count, operating system, kernel, filesystem, and Rust minor version against byte-identical inputs: every outcome classification, base ledger, and digest was unchanged, and only the timing and memory telemetry differed.
All 23 tomato paths were identical across 1,280,460,312 reconstructed bases. Against the altered source, panpath-audit classified MM#1#chr02 as divergent and the remaining 22 as identical, localizing the substituted base to source position 27,869,801, path position 27,869,801, and offset 69 within segment 1120821. Recovering one altered base from the interior of a 55,739,602 bp chromosome exercises the linear and graph coordinate reports together, including the position within the segment rather than only the segment itself. Against the source set lacking SL5, it reported SL5#1#ch02 as missing source rather than treating the remaining 22 identities as complete correspondence.
In the HPRC clipped graph, 22,923 traversals were identical. The source base ledger partitions 289,594,475,134 bases into 87.99% matched against an embedded traversal, 7.98% belonging to the 17,991 contigs the graph does not embed at all, and 4.03% (11,671,173,035 bases) falling outside the explicit walk ranges of contigs that are embedded. The missing paths are short assembly contigs that Minigraph–Cactus does not place; they are reported as absent correspondence rather than as sequence loss. The full graph embedded 19,798 traversals identically, reported 0 not-embedded bases as expected for untrimmed walks, and left 8.93% of source bases in unplaced contigs. Missing sources numbered 42 and 43 for the clipped and full graphs.
Both audits reported the same 14 divergent traversals, the GRCh38 chromosomes, each carrying 94 substituted bases in total and the same first-divergence source coordinates, even though the two graphs were constructed separately and encode GRCh38 as P paths and W walks respectively.

4. Discussion

These experiments distinguish three properties that are easily conflated: internal graph consistency, complete source–traversal correspondence, and exact sequence recovery. The tomato controls show why reporting only successfully matched paths is insufficient: one changed source or one omitted source must make the complete audit fail. The HPRC analysis additionally shows why coordinate-aware gaps should not be labelled as sequence substitutions.
The 14 divergent GRCh38 chromosomes have a single benign explanation. GRCh38 carries 94 IUPAC ambiguity codes outside the ACGTN alphabet, distributed across exactly those 14 chromosomes and no others, and graph construction replaced each of them with N. Per-chromosome ambiguity-code and substituted-base counts agree exactly in every case, the graph symbol is N at every reported position, and in 13 of the 14 chromosomes the replacement occupies a dedicated single-base segment. Because the comparison is symbol-exact, N does not match R, Y, or M, so the substitution is reported instead of silently absorbed. Recovering the same 94 positions from two independently constructed graphs, through both P paths and W walks, indicates a property of the construction pipeline rather than of one distributed file. Reporting it is the intended behaviour: the audit states what changed and leaves the significance to the reader, which is the distinction a topology validator cannot draw.
The tool is deliberately narrower than a general GFA validator. Its guarantee applies only after the documented input contract has passed, and it does not infer biological homology, validate topology, or support sequence-less segments and non-blunt path overlaps. Exact IUPAC equality is appropriate for artifact integrity but should not be interpreted as variant calling or assembly-quality assessment. Memory telemetry is a tracked admission bound rather than total process memory. These limitations are exposed in reports to prevent an identity result from being interpreted more broadly than warranted.
The resulting binary outcome, structured diagnostics, and stable exit codes make the audit suitable after graph construction or conversion, before data release, and as a continuous-integration gate. Topology validation remains a complementary step.

Data Availability Statement

Source code, documentation, tests, and installation instructions are available at https://github.com/gkanogiannis/panpath-audit; release 0.1.2 is also available from crates.io under the Apache-2.0 license. The repository documents the exact public HPRC and tomato acquisition and preparation procedures. Large third-party FASTA/GFA inputs are not redistributed. Manuscript scripts, input manifests, checksums, raw JSON reports, and generated summaries accompany the paper package.

Author Contributions

Anestis Gkanogiannis: conceptualization, methodology, software, validation, formal analysis, investigation, data curation, visualization, writing—original draft, and writing—review and editing.

Funding

This research received no specific grant from any funding agency in the public, commercial, or not-for-profit sectors.

Conflicts of Interest

The author provides freelance bioinformatics consulting services. No client funded, commissioned, or influenced this work.

Acknowledgments

The author thanks the Human Pangenome Reference Consortium, the PGGB developers, and the original assembly producers for making the evaluated resources publicly available.

References

  1. Eizenga, J.M.; Novak, A.M.; Sibbesen, J.A.; Heumos, S.; Ghaffaari, A.; Hickey, G.; Chang, X.; Seaman, J.D.; Rounthwaite, R.; Ebler, J.; et al. Pangenome graphs. Annu. Rev. Genom. Hum. Genet. 2020, 21, 139–162. [Google Scholar] [CrossRef] [PubMed]
  2. Liao, W.W.; Asri, M.; Ebler, J.; et al. A draft human pangenome reference. Nature 2023, 617, 312–324. [Google Scholar] [CrossRef] [PubMed]
  3. Hickey, G.; Monlong, J.; Ebler, J.; et al. Pangenome graph construction from genome alignments with Minigraph-Cactus. Nat. Biotechnol. 2024, 42, 663–673. [Google Scholar] [CrossRef] [PubMed]
  4. Garrison, E.; Guarracino, A.; Heumos, S.; et al. Building pangenome graphs. Nat. Methods 2024, 21, 1512–1519. [Google Scholar] [CrossRef] [PubMed]
  5. GFA Format Specification Working Group. Graphical Fragment Assembly Format Specification. 2022. [Google Scholar] [PubMed]
  6. Guarracino, A.; Heumos, S.; Nahnsen, S.; Prins, P.; Garrison, E. ODGI: understanding pangenome graphs. Bioinformatics 2022, 38, 3319–3326. [Google Scholar] [CrossRef] [PubMed]
  7. Community, Pangenome. PanSN-spec: a naming convention for pangenome sequences. 2023. [Google Scholar]
  8. Zhou, Y.; Zhang, Z.; Bao, Z.; et al. Graph pangenome captures missing heritability and empowers tomato breeding. Nature 2022, 606, 527–534. [Google Scholar] [CrossRef] [PubMed]
  9. Gkanogiannis, A. panpath-audit: audit GFA paths against source FASTA sequences. 2026. [Google Scholar] [CrossRef]
Figure 1. Audit workflow. FASTA identifiers are mapped to embedded GFA traversals by PanSN or prefix convention, inputs are preflighted, and oriented segment sequences are streamed and compared. Every identifier resolves to exactly one of four outcomes; coordinate gaps in GFA walks are tallied separately, within the identical and divergent ledgers, rather than as a fifth outcome.
Figure 1. Audit workflow. FASTA identifiers are mapped to embedded GFA traversals by PanSN or prefix convention, inputs are preflighted, and oriented segment sequences are streamed and compared. Every identifier resolves to exactly one of four outcomes; coordinate gaps in GFA walks are tallied separately, within the identical and divergent ledgers, rather than as a fifth outcome.
Preprints 230006 g001
Table 1. Sequence audits on the two public pangenome datasets and prepared tomato controls. Runtime and resident memory describe this single Linux environment and are not comparative benchmarks.
Table 1. Sequence audits on the two public pangenome datasets and prepared tomato controls. Runtime and resident memory describe this single Linux environment and are not comparative benchmarks.
Case Graph GFA Sources Traversals Outcome Time RSS
Tomato baseline PGGB chr. 2 P 23 23 23 identical 0.4 min 1766 MiB
Tomato altered MM PGGB chr. 2 P 23 23 22 identical; 1 divergent 0.4 min 1762 MiB
Tomato omitted SL5 PGGB chr. 2 P 22 23 22 identical; 1 missing source 0.4 min 1759 MiB
HPRC clipped Minigraph–Cactus v1.0 P+W 40,928 22,979 22,923 identical; 14 divergent; 17,991 missing path; 42 missing source 0.62 h 5021 MiB
HPRC full Minigraph–Cactus v1.1 W 40,928 19,855 19,798 identical; 14 divergent; 21,116 missing path; 43 missing source 0.63 h 5517 MiB
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.