Accept AGC archives as sequence input - #144
Merged
Merged
Conversation
-s/--seqs now accepts an AGC (.agc) archive in addition to FASTA/FASTQ. SeqIndex ingests every sample/contig via ragc-core into the same concatenated store and FM-index used for FASTA, so contig names round-trip (a PanSN archive reproduces sample#haplotype#contig verbatim). Ingestion of archives above 32 MB is parallelized across -t threads via disjoint writes to the memory-mapped sequence file; output is byte-identical to the serial path and to the equivalent FASTA input.
AndreaGuarracino
force-pushed
the
agc-support
branch
from
July 24, 2026 15:47
53fbf15 to
7c561a7
Compare
Ingesting tests/data/agc/small.agc (built with 'agc create' from tests/data/agc/small.fa) must yield the same names, lengths, and bases as ingesting the FASTA. Runs under cargo test (ragc-core is a normal dep).
AGC identifies a sequence by (sample, contig), seqwish by name alone. An archive built the canonical AGC way (agc create sampleA.fa sampleB.fa) repeats plain contig names across samples, which produced several sequences with the same name and made them unresolvable by name. A contig name that occurs in more than one sample is now qualified as contig@sample (AGC's query syntax, matching wfmash); already unique names, as in a PanSN archive, are unchanged. Duplicates that survive are a hard error rather than a silently broken index.
This was referenced Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds native support for
-s/--seqsreading an AGC (.agc) archive in addition to FASTA/FASTQ.SeqIndex::build_indexdetects the.agcextension and ingests every sample/contig viaragc-core(a pure-Rust AGC decompressor) into the same concatenated sequence store and FM-index used for FASTA. Each contig is stored under its name verbatim, so a PanSN archive reproducessample#haplotype#contignames 1:1.For archives above 32 MB the decompression is parallelized across
-tthreads, each writing a disjoint range of the memory-mapped sequence file; smaller inputs keep the serial writer. Output is byte-identical to the serial path and to the equivalent FASTA input.Dependency:
ragc-corefromAndreaGuarracino/ragc(a fork ofekg/ragc, currently 4 commits ahead: addslist_contigs_names_onlyfor fast metadata scans, a fix for names-only loading, and a bounded segment cacheRAGC_CACHE_SIZE). Ideally those land upstream inekg/ragcso this can point there.Verified byte-identical: the induced seqwish graph is identical whether sequences come from FASTA or AGC, on LPA and yeast8 (96 Mbp, md5-identical GFA); serial and parallel ingest produce byte-identical output. Runtime and memory are at parity with FASTA; AGC ingest is sub-second and scales with archive size.