Ecosystem Survey — AI-assisted Rust rewrites of bioinformatics tools¶
Author / Maintainer: Palak Sheth palakpsheth@gmail.com
Repository: https://github.com/palakpsheth/VarDictRust
Governing Manifesto: rewrites.bio
Point-in-time snapshot: 2026-08-24. Compiled from web/GitHub sweeps (sources listed at the end; claims reflect pages as fetched that day). This document is provenance for decisions consolidated into project specifications and external validation reports in
docs/validation/omnibus-empirical-validation.md. Weaknesses are given equal standing to strengths — see §5.
1. The wave¶
AI coding assistants crossed a threshold where a domain expert can reimplement a mature tool in days. rewrites.bio (Seqera, Apr 2026) is the movement's anchor manifesto. Its principles:
- Credit the original authors — README, papers, downstream reports; citations flow to the original.
- Emulate exactly — byte-for-byte for deterministic tools; scientist-defined float tolerance otherwise; "everything counts": headers, column order, file naming.
- Be transparent about AI — which tools, what role, how correctness was verified, where validation is thin.
- Think big / work small — rethink architecture (fold pipeline steps, kill intermediate I/O), but implement in tight loops with output comparison at every step ("AI agents are unreliable for correctness — validate every step").
- Test and benchmark with real data, documented hardware/datasets/commands.
- Build only what you need — unsupported features must fail loudly pointing at the original; never silently ignore flags.
- Pin versions and document — equivalence claims are about an exact version; document commands, data, dates, upstream-update policy.
- Stewardship — maintain what you ship; preserve hot-swappable compatibility; open source; contribute upstream responsibly (verify manually; never AI-generated bug-report evidence).
Origin story: RustQC began as dupRadar rewrite over lunch, became a 15-tool QC suite at >60× speedup; weeks of parity iteration followed the weekend beta ("Stringency in validation will be key to community adoption and trust").
2. Exemplar rewrites and their evidence models¶
| Project | Replaces | Evidence model |
|---|---|---|
| bwa-mem4 | bwa-mem2 2.3 | Byte-identity acceptance gate from first commit; whole-genome GIAB HG002 byte-identical SAM (353M SE + 707M PE records); 2000-job property test on SW kernel; release binaries must rebuild committed fixtures byte-identically per platform |
| Bismark Rust suite | Perl Bismark (12 tools) | Byte-identical contract v0.25.1; worker-invariant --multicore; deliberate documented divergences; opt-in non-identical modes concordance-gated |
| rammap | minimap2 | Identical output; found 2 long-standing minimap2 bugs → fixed upstream v2.31 |
| rustar-aligner | STAR | Public compatibility scoreboard; 99.88% mate faithfulness labeled "tie-adjusted"; 396 tests |
| tama-rs | TAMA (Python 2) | Byte-identical goldens; dict-iteration-order exceptions compared as sets and documented |
| RustQC | 15 RNA-seq QC tools | nf-test snapshot harness as agent feedback loop; public AI & Provenance page incl. known gaps |
| fastqc-compliant-rs | Java FastQC | Golden char-for-char files; published parity matrix; refuses replacement claims until matrix green |
| FastQC-Rust | Java FastQC | UPSTREAM.toml version pin; nightly CI bot files issues on upstream releases; equivalence report CI |
| fgumi | fgbio (Scala) | 25× speedup, 100% output-reproduction claim |
| fastars | fastp | 100% identical sequences verified byte-for-byte; honest "limited samples" warning |
Also notable: sshash-rs/piscem (Patro, C++→Rust in <4 days, 100% concordance); henriksson-lab's port program (minimap2, BLAST, HMMER, MUSCLE, DIAMOND, Kraken2…); umi-collapse-rs, dist2mst-rs (~900×), EVidenceModeler_rust, bowtie2-rs ("parity gates before core aligner work").
3. Community feedback¶
Pro (Heng Li, "The AI Rewrite Dilemma"): order-of-magnitude speedups for Python/R tools; static Rust binaries end dependency hell; welcomes rewrites of his own tools. Reversibility makes adoption risk-free — swap in, confirm on one run, roll back if needed.
Con/skepticism (Kai Blin thread): "Who will maintain vibe-rewritten tools? Original maintainers won't." Unmergeable AI PRs burden maintainers; fragmentation risk — subtle rounding/multimap differences poison cross-study comparability.
Deeper critique (Clay McLeod): emulation preserves historical constraints without separating durable science from accidents; rewrites are seductively easy AI projects; noodles (spec-first foundation) may compound more than any single rewrite; "a tool author can delegate implementation, but cannot delegate understanding"; wants provenance-as-runtime-artifact.
Counter-example teardown (polars-bio on RastQC): claimed FastQC-compatible with wrong core outputs, non-thread-invariant sampling, "speedup" that was parallelism-not-port (slower than the JVM single-threaded, silently gated above 50 MB). Thesis: a rewrite is a validation contract; cheap generation needs disciplined validation — spec-driven + test-driven development, golden assertions not header greps, partition-invariance checks, like-for-like benchmarks.
Trust levers that convinced skeptics: byte-diff against a pinned oracle on real data > any claim; published parity matrices; thread/partition-invariance proofs; manually-verified upstream bug reports; gating artifacts (not just source) before release.
4. Scientific Variant Caller Ecosystem Comparison¶
| Dimension | VarDictRust (v1.x) | VarDictJava v1.8.3 | GATK Mutect2 (v4.5+) | Illumina Strelka2 (v2.9+) | Octopus (v0.7+) |
|---|---|---|---|---|---|
| Language / Runtime | Single static Rust binary (musl/glibc) |
Java 8 + R 3.x + Perl 5 pipeline | Java JVM (GATK framework) | C++11 + Python wrapper | C++14 native |
| Memory Footprint | Bounded (\(O(1)\) halo tiling, 1.39 GiB on 249 Mbp chr1) |
Unbounded (\(O(N)\) depth, OOM prone) | High (JVM heap 8–16 GB) | Moderate (4–8 GB) | High (Haplotype graph 8–16 GB) |
| Execution Model | Rayon work-stealing, thread-deterministic | Multi-process pipe, non-deterministic | Multi-threaded JVM | Multi-threaded task graphs | Multi-threaded DAG |
| Calling Modalities | Germline, Somatic, Amplicon, Splicing/SV | Germline, Somatic, Amplicon, Splicing/SV | Somatic, Mitochondrial | Germline, Somatic | Germline, Somatic, De Novo |
| Complex Realignment | In-engine Smith-Waterman + soft-clip assembly | In-engine Smith-Waterman + soft-clip assembly | Local Haplotype assembly | Prefix tree / HMM alignment | Haplotype-based HMM |
| Low-AF Sensitivity | Ultra-high (\(AF \ge 0.1\%\), down to 2 reads) | Ultra-high (\(AF \ge 0.1\%\), down to 2 reads) | Moderate (\(AF \ge 1\%\)) | Moderate (\(AF \ge 1\%\)) | High (\(AF \ge 0.5\%\)) |
| Targeted Amplicon | Primer trimming (-a), amplicon bias filter |
Primer trimming (-a), amplicon bias filter |
Requires external trimming | External trimming | External trimming |
| Upstream Parity | Byte-for-byte by default (--compat=vardictjava, rewrites.bio); opt-in --compat=off fixes |
Baseline reference | N/A | N/A | N/A |
How VarDictRust Meets rewrites.bio Principles¶
| Field Practice | VarDictRust Implementation |
|---|---|
| Emulate exactly, bugs included | AGENTS.md §5 Bug-Replication Policy and DIVERGENCES.md ledger. Upstream bugs replicated by default (--compat=vardictjava), with bonafide correctness fixes gated behind opt-in --compat=off (CompatProfile) in v1.1.0+ per ROADMAP.md. |
| Pinned oracle + differential testing | VarDictJava v1.8.3 @0886261 conda environment; 92-case corpus; live-oracle VCF sweeps. |
| Work small, per-function evidence | AGENTS.md §7 Port Loop with exact Java source code citations. |
| Fail loudly on unsupported features | AGENTS.md §12 Unsupported Error Policy implemented in cli.rs via UNSUPPORTED_FLAGS. |
| Real-data, like-for-like benchmarks | Documented in benchmarks/README.md; strictly avoided parallelism-only speedup claims. |
| Thread & partition invariance | Formally verified in engine_behavior.rs. |
| Upstream bugs, manually verified | Documented in docs/upstream-bugs.md (UB-1 through UB-7). |
| Credit & AI transparency | Comprehensive attribution and disclosures in README.md and benchmarks/evidence/. |
5. Architectural Hardening & Verification Matrix¶
| Area | Historical Gap | Engine Hardening Measure | Verification Evidence |
|---|---|---|---|
| Hostile CIGAR Fuzzing | Crash risks in CIGAR modifier | Bounds-checked CIGAR manipulation in crates/vardictrust-core/src/cigar/ |
crates/vardictrust/tests/robustness.rs covering PR #402 corrupt topology |
| CLI Flag Parity | Incomplete CLI flag documentation | Explicit 95-flag Diátaxis reference categorized into 7 functional groups (including 18/18 var2vcf_*.pl flags via --vcf-all-alleles, --orientation-bias[=MAX_AF:MIN_SOB:MAX_OBP\|annotate], --noise-model[=MAX_ERRP\|annotate\|off], --methylation, --amplicon-single-primer / -sp, --compat=vardictjava\|off, and --preset wgs\|wes\|amplicon\|ctdna\|hifi\|ont; plus docs/migration.md) |
Section 4 in README.md |
| Release Artifact Packaging | Ungated release binaries | PIE static binary validation gate comparing musl to glibc outputs | harness/bin_equiv.sh, musl-ci.json |
| Biological Truth Concordance | Lack of physical truth-set evaluation | Full multi-cohort RTG vcfeval truth concordance suite |
5 cohorts in docs/validation/omnibus-empirical-validation.md |
| Upstream Drift Defense | Unpinned upstream dependency risk | Pinned reference oracle to VarDictJava v1.8.3 (commit 0886261) |
Sealed environment specification in harness/setup_oracle.sh |
| Bioconda Packaging | No automated Conda distribution | Canonical in-tree Bioconda recipe under packaging/bioconda/recipes/vardictrust/ |
harness/tests/test_bioconda_recipe.py |
6. Sources (as fetched 2026-08-24)¶
- https://rewrites.bio · https://github.com/seqeralabs/rewrites.bio · https://seqera.io/blog/rewrites-bio/ · https://seqera.io/blog/rustqc/
- https://seqeralabs.github.io/RustQC/about/ai-statement/
- https://lh3.github.io/2026/04/17/the-ai-rewrite-dilemma · https://lh3.github.io/2026/07/04/minibwa-is-the-new-bwa
- https://claymcleod.dev/blog/2026-07-13-beyond-bioinformatics-rewrites
- https://biodatageeks.org/polars-bio/blog/2026/07/04/cheap-to-rewrite-expensive-to-get-right-the-fastqc-compatible-trap/
- https://scverse.org/rustar-aligner/ · https://github.com/IPNP-BIPN/bwa-mem4/releases/tag/v4.0.0
- https://felixkrueger.github.io/Bismark/rust/overview/ · https://github.com/henriksson-lab/fastqc-compliant-rs
- https://github.com/ewels/FastQC-Rust · https://github.com/sguizard/tama-rs · https://github.com/necoli1822/fastars · https://github.com/jwanglab/rammap
- Phil Ewels, Nextflow Summit 2026 talk + launch threads (Kai Blin rebuttals on Bluesky/mu.social)
7. Addendum 2026-10-11: vardictcpp third arm (this section only is newer than the snapshot)¶
Every Java-vs-Rust comparison in this repo now runs beside vardictcpp 3
hc52dbad_0 bioconda (same vardict-oracle conda env as the VarDictJava
oracle; upstream MHH-Bioinformatics-Hematology/vardictcpp v4 ce0beb86ce / bioconda/bioconda-recipes#71981 / MHH-Bioinformatics-Hematology/galaxytools#12 / Wolff, GigaByte 2026 adds --vcfall and raw -f filter strings while retaining CPP-1..CPP-12, and bioconda::vardict-java moved to joachimwolff/VarDictJava v1.8.4 in bioconda/bioconda-recipes#67584 while vardict-oracle keeps vardict-java=1.8.3 pinned) as an advisory third arm: CPP: MATCH/MISMATCH/SKIP lines and
compare_cpp.txt artifacts, evidence extra keys (cpp_version, cpp_head,
cpp_wall_s, cpp_maxrss_kb, cpp_f1, cpp_skip_reason), CPP_SKIP=1
escape. The release gate stays java==rust; cpp divergences are normalized in
docs/upstream-bugs.md,
not silently dropped. Broader VarDict rewrites and clinical forks audited against VarDictRust include Crispy13/VarDictRust2 (which surfaced the CigarParser.java:1916 -UN unpaired-read IllegalStateException crash, fixed safely in VarDictRust), LeiHaoa/RabbitVar (C++11/OpenMP VarDict port paired with DeepFilter), roysomak4/VarDict-Go (Go teststrandbias port), clinical UMI/amplicon/CVE forks (fengqing-dong/VarDictJava F1R2/F2R1 + duplex UMI, Schaudge/VarDictJava --hotspot ctDNA, crutching/VarDictJava -sp single-primer AMP, Kennedy-Lab-UW/VarDictJava outer-H indel clipping, hedera-dx/VarDictJava AstraZeneca-NGS/VarDictJava#402, invitae/VarDictJava, Belay-Diagnostics/VarDictJava), and clinical pipeline wrappers (bcbio-nextgen, Karolinska BALSAMIC, MSK-ACCESS, SomaticSeq, PCGR, and clintval/vartovcf). Galaxy wrapper distribution of VarDictRust itself stays a
follow-up (see CHANGELOG.md).
8. Addendum 2026-11-08: Clinical, Scientific & Engineering Critical Review (v1.0.7)¶
This section synthesizes a 5-domain critical engineering and clinical oncology survey across:
1. Fulcrum Genomics & rewrites.bio Rust Rewrites (fgumi, perbase, ferro-hgvs, riker, bwa-mem4, Bismark, FastQC-Rust, RustQC, vardictcpp)
2. PacBio Native Rust Suite & Greenfield Rust Callers (sawfish, trgt, HiPhase, paraphase, pb-CpG-tools, aardvark, fibertools-rs, varlociraptor, kanpig, modkit, oarfish, piscem)
3. Peer-Reviewed Clinical Oncology & Variant Calling Literature (2016–2026)
4. Community Discourse Across LinkedIn, Reddit (r/bioinformatics, r/rust), Biostars, and GitHub Issues/PRs
5. Internal Line-by-Line Codebase & Performance Audit of VarDictRust v1.0.7
8.1 SWOT Analysis (VarDictRust v1.0.7)¶
| Quadrant | Core Findings |
|---|---|
| Strengths | • 100% Oracle Parity: Bitwise/float (\(\varepsilon=10^{-6}\)) equivalence to VarDictJava v1.8.3 across 92 Tier-1 fixtures, 92/92 full-chromosome validation runs (70 Tier-2 full-VCF comparisons + 22 Tier-3 count/PASS-site/vcfeval checks; chr-parity-v107.md), 17 modalities, 18 multi-platform slices, and 5 NIST GIAB / FDA SEQC2 truth sets.• Bounded \(O(1)\) Memory via Halo Tiling: Flat 1.11× RSS scaling on chr1 (1.15 GiB at 10 Mbp \(\to\) 1.27 GiB at 249 Mbp vs Java OOM and vardictcpp 24.34 GiB unchunked RSS); only VarDict engine completing 364× HG008 paired WGS (329 GB BAM) in 1h45m (4.99–12.43 GiB RSS).• Memory-Safe Core & HTSlib-Free I/O Stack: #![forbid(unsafe_code)] in vardictrust-core + HTSlib-free noodles 0.118 I/O with native noodles-bgzf 0.52 (libdeflate C backend + zlib-rs), eliminating all modifyCigar index crashes and hts-sys bindgen breakage.• Single-Binary Consolidation & Supply Chain: Fuses Java -> R -> Perl into one static binary (cargo-dist SLSA L3, Crates.io, Bioconda, Seqera Wave, nf-core/modules #13343).• Clinical Niche: Best-in-class sensitivity for complex/composite indels and MNVs (BRCA1/2, EGFR Ex19del/Ex20ins, FLT3-ITD), native 8-column BED amplicon primer/overlap bias ( -a / AMPBIAS), and unified Somatic + Germline + LOH classification. |
| Weaknesses | • Resolved v1.0.7 Hotspots (palakpsheth/VarDictRust#98–palakpsheth/VarDictRust#107 & v1.1.0): Multi-tile scan_multi_tile_max_read_lengths pre-scans are now parallelized across rayon; modify_cigar now fast-paths single-M and pure S/M reads in-place without String/regex round-trips; Reference::get_base inlines primary-region lookup; BGZF_BLOCK_CACHE expanded from 8 to 32 shards; FisherExact eliminated support: Vec<i32> and sum_elements heap allocations; cleanroom stats/hypergeom.rs (Catherine Loader 2000 saddlepoint binomial deviance & Stirling error) restored pure MIT workspace licensing (palakpsheth/VarDictRust#92, synced across Cargo.toml, cli.rs --version, Bioconda, nf-core, and deny.toml); and native --output .vcf.gz + --tbi/--csi (clintval/vartovcf#161 spanning-SV LinearIndex loffset fix) + all 18/18 var2vcf_*.pl flags (including --vcf-all-alleles / --all-alleles) + --amplicon-single-primer (-sp) + --compat=vardictjava\|off (32 shipped CompatProfile switches in v1.1.0+, spanning Waves 1–5) + --completions/--manpage landed.• Remaining Engine & Scaling Gaps: DEFAULT_UNTILED_SPAN_MAX = 1_000_000 still leaves 100 kbp–1 Mbp BED intervals untiled by default; BamFeed materializes BamRecord before coordinate/flag pre-filtering; default --compat=vardictjava retains eager mate-window partial_pipeline in sv.rs find_inv_sub_paths for strict parity (--compat=off enables sv_lazy_mate_pileup).• Inherited v1.8.3 UX & Clinical Quirks: Default 13-column UCSC refGene settings (-c 3 -S 7 -E 8 -s 10 -e 11 -g 13, with 4-column standard BED and 8-column amplicon BED auto-detected) require explicit -c 1 -S 2 -E 3 -z on 3-, 5-, and 6-column UCSC BEDs (now emitting an actionable VardictError::Parse hint); legacy -A flag collision (sv_min_af vs var2vcf_valid.pl -A all-alleles UB-7, resolved via --vcf-all-alleles / --all-alleles); VD > DP and RD + VD > DP (AstraZeneca-NGS/VarDictJava#92, AstraZeneca-NGS/VarDict#168, reconciled under opt-in --compat=off via reconcile_vd_dp + reconcile_rd_vd_dp); elevated raw low-VAF FDR without UMI/duplex or F1R2/F2R1 orientation bias filtering. |
| Opportunities | • Surpass vardictcpp on All Germline Workloads (v1.0.x Tier 1): Output-neutral v1.0.8 fast-paths landed (modify_cigar single-M fast-path preserving endpoint mismatch clipping, parallel max_read_length scan, cached &LoadedRegion, 32-shard BGZF cache), cutting germline wall times while leaving 100 kbp untiled-span threshold tuning open.• Pure MIT License Restored (v1.1.0): Cleanroom stats/hypergeom.rs (Catherine Loader 2000 saddlepoint binomial deviance & Stirling error + f80_sum accumulation) replaced legacy R hypergeometric files with 0 flips across r_fisher_oracle.tsv, restoring pure MIT workspace licensing.• Fulcrum & PacBio Engineering Convergence: Native --output out.vcf.gz + .tbi/.csi via noodles::bgzf::io::MultithreadedWriter (aardvark pattern) and --stats-json telemetry (sawfish / fgumi pattern) landed in v1.0.8, with undecoded noodles::bam::Record pre-filtering (fgumi-raw-bam / oarfish pattern) slated for v2.0.• Opt-In --compat=off & --preset Evolution (v1.1+ / v2.0): Ship bwa-mem3-style --compat=vardictjava\|off (CompatProfile, eliminating --fix flag sprawl; 32 shipped CompatProfile switches in v1.1.0 across Waves 1–5, closing palakpsheth/VarDictRust#95 and palakpsheth/VarDictRust#158), --amplicon-single-primer / -sp (AstraZeneca-NGS/VarDictJava#303), --vcf-all-alleles / --all-alleles (18/18 var2vcf_*.pl parity), plus streaming UMI/duplex consensus (--umi-tag RX --duplex), F1R2/F2R1 FFPE filter, and SA:Z / HP:i / MM:Z / --noise-model support for HiFi/ONT long reads (delegating full-read gap-affine mapping and VNTR motif genotyping to minimap2/pbmm2 and TRGT/LongTR/sawfish via Switch 49). |
| Threats | • Skepticism of AI Rewrites: Community warnings (Nils Homer, Clay McLeod, Kai Blin, polars-bio) against "convincingly correct" ports make strict differential CI gating non-negotiable.• Deep-Learning & Haplotype Callers: DeepSomatic (Nat. Biotechnol. 2025), ClairS/ClairS-TO (Nat. Commun. 2025), Octopus, varlociraptor, and sawfish raise precision expectations in homopolymers and FFPE.• Upstream VarDictJava EOL (0886261): With VarDictJava officially archived (#396), VarDictRust must steward post-1.0 specifications transparently via ROADMAP.md. |
8.2 Comparative Architecture: Fulcrum Genomics, PacBio & Greenfield Rust Callers¶
| Engineering Dimension | Fulcrum Genomics (fgumi v0.9, perbase v1.4, ferro-hgvs v1.0) |
PacBio & Greenfield Rust Suite (sawfish v2.3, trgt v5.1, HiPhase v1.7, aardvark v1.1, varlociraptor v8.12, kanpig v2.0, modkit v0.6, oarfish v0.11) |
VarDictRust (v1.0.7) Status & Gap Analysis |
|---|---|---|---|
| HTS I/O & Record Representation | fgumi uses noodles 0.115 + fgumi-raw-bam (RawRecord zero-copy byte slices) + noodles-bgzf (libdeflate) + flate2 (zlib-rs); perbase uses rust-htslib with thread_local! IndexedReader and LruCache reference contigs. |
aardvark, oarfish, and piscem use HTSlib-free noodles (oarfish inspects raw packed 4-byte CIGAR words on undecoded noodles::bam::Record buffers). fibertools-rs had to emergency-pin hts-sys = "=2.2.0" due to bindgen ABI breakage in bam1_core_t. |
Strong Foundation (main / v1.0.8): HTSlib-free noodles 0.118 I/O + native noodles-bgzf 0.52 (libdeflate C backend + zlib-rs) avoids hts-sys bindgen bugs, with 32-shard BGZF_BLOCK_CACHE, LUT sequence decoding, and zero-copy read slices (PR #98, PR #104). Remaining Gap: Raw-record pre-filtering before BamRecord materialization (v2.0). |
| Sequence & Alignment Kernels | fgumi-dna packs 4 bases/byte (2-bit DNA, 32 bases/u64) for XOR + popcnt Hamming distance; fgumi-simd-fastq uses runtime-dispatched AVX2 / NEON. |
sawfish, trgt, HiPhase, and aardvark use 2-piece affine Wavefront Alignment (WFA2 / DWFALite) + POA (spoa_rs). Crucially, sawfish caps WFA at CONSENSUS_SCORE_MAX_WFA_STEPS = 60 (falling back to ~30 µs DP) with a 6 GB global alignment semaphore (CONTIG_ALIGNMENT_MEMORY_BUDGET_BYTES). varlociraptor uses Myers bit-parallel edit distance to shrink PairHMM to an 8 bp band (EDIT_BAND = 4). |
Partial: find_35_match uses 64-bit SWAR fast-reject and realign.rs reuses scratch buffers with zero-intermediate flanking builders (PR #98–#107), while 2-bit DNA XOR+popcnt and Myers band-shrinking remain slated for v2.0 (keeping full-read gap-affine WFA2 alignment and VNTR motif decomposition delegated to minimap2/pbmm2 and TRGT/LongTR/sawfish via Switch 49). |
| Concurrency, Backpressure & Disk Prefetching | fgumi-pipeline-core uses a 7-stage priority work-stealing scheduler with sysinfo cgroup memory limits (--max-memory auto) and a 10s deadlock watchdog; perbase overlaps superchunk compute and bounded crossbeam channel draining via rayon::join. |
sawfish splits threads \(\lceil 0.3 N \rceil\) I/O scan vs \(0.7 N\) speculative breakpoint assembly, and issues libc::posix_fadvise(POSIX_FADV_WILLNEED) on merged BGZF chunks 8 * threads ahead of lowest_unfinished. modkit uses a return_mem channel so worker threads absorb drop() deallocation latency. |
Strong (main / v1.0.8): runner.rs bounds in-flight tasks (4 * threads + Condvar), SpillableVcfAccumulator spills above 8 MiB, and scan_multi_tile_max_read_lengths now runs in parallel across rayon (PR #102); DEFAULT_UNTILED_SPAN_MAX = 1_000_000 still leaves 100 kbp–1 Mbp intervals untiled by default. |
| VCF Output, Indexing & File Safety | fgumi-bam-io performs checked close(2) syscalls (preventing File::drop from swallowing NFS/Lustre writeback errors); perbase handles ErrorKind::BrokenPipe cleanly on stdout. |
aardvark writes .vcf.gz via noodles::bgzf::io::MultithreadedWriter (threads.clamp(1, 4)) and generates .tbi purely in Rust (noodles::vcf::fs::index + noodles::tabix::fs::write). trgt reuses a single cleared VCF record buffer across loci. |
Complete (main / v1.0.8): Handles BrokenPipe cleanly on both stdout and stderr, writes multithreaded BGZF .vcf.gz via --output + pure-Rust --tbi / --csi indexes, and stages regular files via StagedFileTarget with File::sync_all + input-collision guards (PR #100–#105). |
| Testing, Telemetry & Parity Governance | fgumi uses proptest (with committed regression seeds), rstest, cargo nextest, miri, and built-in --pipeline-stats. Bismark v3.1 freezes default v1.0 byte parity while gating v2+ features behind never-silent opt-in flags + concordance gates. |
sawfish (run.stats.json) and HiPhase (--summary-file) emit structured JSON telemetry and high-depth excluded BEDs (max.sv.depth.bed); paraphase codifies legacy Python parity and intentional low-depth divergences in unit tests. |
Strong Parity & Telemetry (v1.0.10 / v1.1.0+): 8-gate differential harness + UPSTREAM.toml (VarDictJava, VarDict, and advisory vardictcpp 3) + --stats-json telemetry + --parity / --compat=vardictjava\|off (32 CompatProfile switches) + --vcf-all-alleles (palakpsheth/VarDictRust#100–palakpsheth/VarDictRust#158); proptest interval-conservation suites remain a candidate expansion. |
8.3 Clinical Oncology Literature & Community Pain-Point Synthesis¶
- Where VarDict Wins Clinically (Lai et al., NAR 2016; SEQC2, Nat. Biotechnol. 2021; Guille et al., Brief. Bioinform. 2025):
- Complex Indels & MNVs in Actionable Cancer Genes: Rescues soft-clipped reads (
CigarModifier+VariationRealigner+StructuralVariantsProcessor) to call composite indels and 20–250 bp frameshifts in BRCA1/2, EGFR (exon 19 deletions / exon 20 insertions in AURA/FLAURA/ADAURA ctDNA trials, J. Thorac. Oncol. 2024), TP53, and FLT3-ITD that haplotype/column callers split or miss. - Ultra-Deep Low-VAF Sensitivity Without Downsampling: Evaluates every read at \(1,000\times\text{–}50,000\times\) depth down to \(0.1\%\) VAF (Sandmann et al., Sci. Rep. 2017).
- Native 8-Column BED Amplicon Calling (
-a): Masks primer binding sites and flags single-amplicon PCR artifacts (AMPBIAS) without external trimming tools. - Simultaneous Somatic, Germline & Candidate LOH Classification: Heuristic
STATUSclassification inpostprocess/somatic.rs(StrongSomatic,LikelySomatic,Germline,StrongLOH,LikelyLOH,Deletion), paired with Fisher exact strand-bias and somatic p-value annotations (SBF,ODDRATIO,SSF), identifies somatic variants alongside germline and candidate LOH events in a single pass. - Documented Scientific & Community Pain Points (Bian et al., 2018; Chen et al., 2020; Zhang et al., DeepFilter 2023; GitHub / Biostars / Reddit):
- Low-VAF Precision / FDR Without Post-Filtering: Raw calling at
-f 0.01yields elevated false positives in homopolymers (MSI >= 5) and repeats (on 30× germline WGSHG002, raw \(F_1 = 0.6622\) improves to \(F_1 = 0.9699\) atQUAL >= 128; low-VAF somatic and ctDNA panels require separate depth- and VAF-aware calibration). - Missing
F1R2/F2R1Orientation Bias & UMI Consensus: Lacks native FFPE deamination (C>T/G>A) / 8-oxoG (C>A/G>T) read-pair orientation modeling (vs. Mutect2LearnReadOrientationModelor PiscesVQR) and native duplex UMI collapsing (vs.fgumi). - Upstream Output Quirks Replicated by Default (
--compat=vardictjava):VD > DPandAF > 1(VarDictJava#92,#242,#316,#323,#386,#400) when soft-clip realignment adds supporting reads (VD) without incrementing locusDP(reconciled under opt-in--compat=offviareconcile_vd_dp).- Single-winner multi-allelic collapsing (
UB-7,VarDict#35,VarDictJava#65) compounded by the-Aflag collision (sv_min_afinVarDictJavavs$opt_Aall-alleles invar2vcf_valid.pl; opt-in--vcf-all-alleles/--all-allelesemits all qualifying alleles). - Missing automatic 3/5/6-column BED detection: default 13-column UCSC
refGenesettings (-c 3 -S 7 -E 8 -s 10 -e 11 -g 13, with 4-column standard BED and 8-column amplicon BED auto-detected) fail withVardictError::Parseon 3-, 5-, and 6-column UCSC BED files (regions.rs:641-652) when-c 1 -S 2 -E 3 -zis omitted (VarDictJava#49,#54). - NovaSeq 2-color dark-cycle poly-G mate-pileup stalls (
VarDictJava#370; resolved under opt-in--compat=offviasv_lazy_mate_pileup).
8.4 Prioritized Future Work Matrix (Tier 1 \(\to\) Tier 2 \(\to\) Tier 3) & Tracked GitHub Epics (#90–#96)¶
To eliminate end-user --fix flag sprawl while permanently preserving VarDictJava v1.8.3 reproducibility, post-1.0 evolution uses a bwa-mem3-Style --compat=<vardictjava|off> SemVer Model (#94):
- v1.0.x (Parity Baseline): Parity-only execution; all invocations are 100% VarDictJava v1.8.3 byte-identical, with explicit --parity / --compat vardictjava-1.8.3 introduced in v1.0.8 (PR #102).
- v1.1.x–v1.2.x (v1.1.0+): Default CLI invocations remain 100% VarDictJava v1.8.3 byte-identical (--compat=vardictjava, aliases vardictjava-1.8.3 / 1.8.3, plus --parity). Introduces opt-in --compat=off (COMPAT_OFF, stamping ##VarDictRustCompat=off in VCF headers and activating 49 CompatProfile clinical/spec/RNA-Seq/consensus-BAM/SV-interop fixes palakpsheth/VarDictRust#95, palakpsheth/VarDictRust#96, palakpsheth/VarDictRust#160 without per-bug --fix CLI flags) alongside --vcf-all-alleles (--all-alleles, completing 18/18 var2vcf_*.pl flag parity), --orientation-bias, --noise-model, --methylation, --amplicon-single-primer (-sp), and --preset wgs|wes|amplicon|ctdna|hifi|ont (completing the 95-flag CLI surface).
- v2.0.0+: Evaluates promoting --compat=off to default out-of-the-box behavior, while --compat=vardictjava (--parity) reproduces the rigorously tested VarDictJava v1.8.3 byte-for-byte oracle permanently with a single flag.
| Tier & Target Release | Priority Item & Tracked Epic | Subsystem / Location | Summary of Change & Verification Gate |
|---|---|---|---|
Tier 1 (v1.0.x)Zero-Output-Diff Engine, Perf & UX |
1.1 fastpath-modify-cigar (#90 — landed on main ahead of v1.0.8, PR #98, PR #102, PR #104 & PR #105) |
cigar/modify.rs:408-806 |
On single-Match (150M, >85% of WGS reads) and pure S/M reads, apply endpoint mismatch/clipping checks directly in-place on record.cigar with zero-copy seq/qual slices and modify_cigar_preserving_buffers scratch reuse, bypassing the inner 25-regex indel/clip cascade and ASCII string round-trip when unclipped (~11.5% CPU savings). Gate: endpoint-mismatch parity fixtures + pr_check.sh 0 diffs. |
Tier 1 (v1.0.x) |
1.2 parallel-max-rl-scan & tile-span-100k (#90 — parallel pre-scan landed on main ahead of v1.0.8, PR #102) |
lib.rs:69, 412-893, 1677, 2368 |
Parallelize per-tile max_read_length pre-scan across rayon workers with prefix-max fold (re-running only tiles impacted by an upstream max_read_length step increase; DEFAULT_UNTILED_SPAN_MAX = 1_000_000 retained until tile-span-100k parity tuning). |
Tier 1 (v1.0.x) |
1.3 direct-loaded-region & zero-alloc-realign (#90 — landed on main ahead of v1.0.8, PR #98–#107) |
reference.rs, cigar/parse.rs, realign.rs, sv.rs, variations/mod.rs |
Share Arc<[u8]> Reference spans (RegionSpanSlot), inline Reference::get_base primary-region lookup, and pack [u64; 3] SeedKey tables; inline single-allele VariationEntries + JavaHashMap new-key delta log, Somatic RefSiteMode/CompactRefSite elision, O(W_mate log W_mate) SV partial_pipeline delta log, join_ref_for_5_lgins / join_ref_for_3_lgins zero-intermediate builders, i32::MAX overflow saturation, and FxHashMap non-iterated lookup maps. |
Tier 1 (v1.0.x) |
1.4 bgzf-cache-scale & tuple-dedup-key (#90 — landed on main ahead of v1.0.8, PR #98, PR #104, PR #105 & PR #107) |
bam.rs |
Expand BGZF_BLOCK_CACHE (\(8 \to 32\) shards / pooled buffers) to eliminate 32-thread fetch_block Arc eviction churn; add LUT/vectorized BAM sequence decode + zero-copy seq/qual read slices + checked CIGAR span overflow guards; replace -t HashSet<String> with FxHashSet<DupKey>; construct pub(crate) build_noodles_region directly. |
Tier 1 (v1.0.x) |
1.5 audit-fisher-stream & audit-somatic-dedup (#90, #91 — landed on main ahead of v1.0.8, PR #98–#107) |
stats/fisher.rs, stats/f80.rs, output/vcf.rs, lib.rs |
Eliminate redundant support: Vec<i32> and heap Vec<f64> allocations in FisherExact via algebraic support_len(), 4,096-entry LRU cache, f80_sum_iter, build_single_vcf_event --pass-only Fisher/uniroot short-circuit in output/vcf.rs, and StackBuf / write_perl_num_str formatting (#90); apply SplitVarDeduper (200 kbp cross-tile .var ownership window, PR #99), single-buffer SingleVcfRecord / PairedVcfRecord consolidation, SpillableVcfAccumulator::insert IndexMap::get_mut(chr) fast-path, deterministic -i splice sorting, and streaming per-tile BamFeed pileup (#91). |
Tier 1 (v1.0.x–v1.2.0) |
1.6 CLI & File-Safety Hardening (palakpsheth/VarDictRust#93 — landed in v1.0.8–v1.2.0) |
cli.rs, main.rs, regions.rs, runner.rs, Cargo.toml |
Sync cli.rs pure MIT license string and MSRV 1.91.0 + crates.io metadata; warn on 5/6-column BEDs lacking cols 7/8; apply StagedFileTarget atomic staging + File::sync_all + input-collision guards across --output/--tbi/--csi/--stats-json; support -T/--trim, -n, -VS SILENT\|LENIENT, clustered -pz/-uk/-ua, RAYON_NUM_THREADS, GRCh38 HLA-* colon-contig -R/BED parsing (regions::parse_region_flag), and all 18/18 consolidated var2vcf_*.pl CLI flags including --vcf-all-alleles / --all-alleles plus --orientation-bias, --noise-model, --methylation, --amplicon-single-primer / -sp, hidden vardictcpp aliases (--vcfall, --noend, --vcfpass, --vcf), --compat=vardictjava\|off, --preset wgs\|wes\|amplicon\|ctdna\|hifi\|ont, --completions, and --manpage (95 CLI flags across 7 functional groups; see docs/migration.md); auto-set 64 MiB worker stack on .cram inputs; add UPSTREAM.toml. |
Tier 2 (v1.1.0)Cleanroom MIT, --compat=vardictjava\|off & UX |
2.1 Cleanroom stats/hypergeom.rs \(\to\) Pure MIT (palakpsheth/VarDictRust#92 — landed in v1.1.0) |
stats/hypergeom.rs, stats/fisher.rs, Cargo.toml:9, deny.toml |
Replaced legacy R hypergeometric files with a cleanroom Catherine Loader (2000) saddlepoint binomial-deviance and Stirling-error implementation in stats/hypergeom.rs (f80_sum extended-precision accumulation), matching 259/259 testdata/fisher/r_fisher_oracle.tsv tables (0 flips) and all certified cohorts within \(\varepsilon \le 10^{-6}\), restoring pure MIT licensing across Cargo, Bioconda, nf-core, and deny.toml. |
Tier 2 (v1.0.8–v1.1.0) |
2.2 Native --output out.vcf.gz + .tbi/.csi, 18/18 var2vcf_*.pl Flags & --stats-json (palakpsheth/VarDictRust#93 — landed in v1.0.8–v1.1.0) |
crates/vardictrust/src/cli.rs, main.rs |
Direct multithreaded BGZF .vcf.gz output + pure-Rust .tbi (--tbi / --index, with actionable --csi hint above 512 Mbp) and .csi (--csi) index generation (END=-aware for structural variants) via noodles::bgzf::io::MultithreadedWriter + noodles::tabix / noodles::csi (aardvark pattern), all 18/18 consolidated var2vcf_*.pl CLI flags (--no-end, --pass-only, --paired-strict, --vcf-all-alleles / --all-alleles, --vcf-pval, --min-splitreads, --no-pstd-filter, --vcf-af, --vcf-min-depth, --vcf-min-vd, --vcf-qmean, --vcf-mapq, --vcf-pmean, --vcf-sn, --vcf-max-nm, --vcf-gt-freq, --vcf-msi, --vcf-cluster-dist), -y / --verbose progress, and --stats-json run telemetry (sawfish/fgumi pattern). |
Tier 2 (v1.1.0–v1.2.0) |
2.3 --compat=vardictjava\|off Profile & Clinical Fixes (palakpsheth/VarDictRust#94, palakpsheth/VarDictRust#95, palakpsheth/VarDictRust#96, palakpsheth/VarDictRust#158, palakpsheth/VarDictRust#160 — Waves 1–5 landed in v1.1.0, Waves 6–8 & Switches 42 & 49 landed) |
ROADMAP.md |
Ships bwa-mem3-style --compat=vardictjava\|off (CompatProfile, stamping ##VarDictRustCompat=off in VCF headers) with 49 COMPAT_OFF switches (sanitize_sample_info, standard_dup_symbolic_alt, shift3_3prime_alleles, strict_region_bounds, UB-1/UB-2 suppress_pileup_sentinels, live_duprate, preserve_mixed_sex_contigs, AstraZeneca-NGS/VarDictJava#402 cigar_homopolymer_merge, eqx_cigar_read_length, UB-5 preserve_discordant_svs, UB-6 mark_dup_sv_inclusive_end, sv_lazy_mate_pileup, exact_binary_half_even, AstraZeneca-NGS/VarDictJava#92 reconcile_vd_dp, UB-3/AstraZeneca-NGS/VarDictJava#282 coordinate_sorted_vars, exact_35_overlap, exact_cigar_dlen_match, joachimwolff/VarDictJava#4 somatic_continue_after_bad_var, AstraZeneca-NGS/VarDictJava#240 adaptor_all_consensus_dirs, AstraZeneca-NGS/VarDictJava#398 canonical_sv_vcf_anchoring, AstraZeneca-NGS/VarDictJava#378 paired_somatic_amplicon, AstraZeneca-NGS/VarDictJava#341 cigar_strip_outer_hard_clips, bcbio/bcbio-nextgen#1704 nonnegative_subtracted_means, AstraZeneca-NGS/VarDictJava#316 reconcile_strand_and_hq_sums, AstraZeneca-NGS/VarDict#168 reconcile_rd_vd_dp, AstraZeneca-NGS/VarDictJava#267 sanitize_iupac_alt_alleles, AstraZeneca-NGS/VarDictJava#328 sv_respect_min_len, AstraZeneca-NGS/VarDictJava#330 pileup_preserve_shifted_ref, clintval/vartovcf#109 recompute_vartype_after_adj_complex, clintval/vartovcf#101 strict_vcf_ad_number_r, clintval/vartovcf#105 omit_nonsv_vcf_end, clintval/vartovcf#99 canonical_vcf_gt, VariationUtils.java:90 sclip_majority_count_first, Clinical-Genomics/BALSAMIC#1396 mate_overlap_both_strands, AstraZeneca-NGS/VarDictJava#264 canonical_vcf_complex_left_align, clintval/vartovcf#191 somatic_reconcile_split_alleles, clintval/vartovcf#181 adj_snv_full_sclip_match, AstraZeneca-NGS/VarDictJava#263 indel_only_shift3, SomaticPostProcessModule.java:221,238 somatic_loh_homozygous_alt, clintval/vartovcf#160 mnp_exact_right_fold, AstraZeneca-NGS/VarDictJava#363 strict_unspanned_lgins_stitch, palakpsheth/VarDictRust#96 consensus_bam_compat, insertion_hicov_and_local_amp_dp, mnp_cis_haplotype_phasing, complex_indel_and_lgins_concordance, spliced_overhang_and_homopolymer_filter, somatic_multiallelic_loh_rescue, continuous_pstd_qstd, and sv_downstream_vcf_interop) plus --orientation-bias, --noise-model, --methylation, --amplicon-single-primer / -sp (AstraZeneca-NGS/VarDictJava#303), and --vcf-all-alleles / --all-alleles (UB-7). |
Tier 2 (v1.1.0–v1.2.0+) |
2.4 Clinical & Long-Read Presets (--preset) (palakpsheth/VarDictRust#94, palakpsheth/VarDictRust#96 — landed in v1.1.0–v1.2.x) |
crates/vardictrust-core/src/{config,sv,methylation,noise}.rs, crates/vardictrust/src/cli.rs |
Shipped --preset wgs\|wes\|amplicon\|ctdna\|hifi\|ont (WorkflowPreset, Config::from_preset, ##VarDictRustPreset=<PRESET>) bundling --compat=off, 0-based BED coordinates (preserving 1-based -R, BED4 3'_UTR, and UCSC BED8 SimpleMode), 25 kbp long-read tile halos + 2,048 bp soft-clip/indel bounds, SA:Z intra-chromosomal <DEL>/<DUP>/<INV>/<INS> chaining with foldback-hairpin rejection & normal veto, HP:i/PS:i phasing (HapBias), MM:Z/ML:B:C cis-CpG --methylation, and calibrated Beta-Binomial --noise-model (PolymerNoise), while keeping full-read gap-affine alignment, VNTR motif genotyping, raw UMI collapsing, and inter-chromosomal BND/fusion calling delegated to upstream aligners (minimap2/pbmm2), specialized tandem-repeat callers (TRGT/LongTR/sawfish), fgumi/fgbio (Switch 42), and SV/BND callers interoperating cleanly via Switch 49 (sv_downstream_vcf_interop). |
Tier 3 (v2.0)Next-Gen Clinical & Rust-Native |
3.1 Streaming In-Caller UMI & Learned Orientation Priors (#96) |
bam.rs, cigar/parse.rs, postprocess/ |
Evaluate promoting --compat=off to default (--compat=vardictjava / --parity preserves v1.8.3 forever); external fgumi/fgbio consensus-BAM interop (consensus_bam_compat) and --orientation-bias landed in v1.2.0, while native tile-local UMI collapsing and learned Beta-Binomial orientation priors target v2.0. |
Tier 3 (v2.0) |
3.2 2-Bit DNA & Undecoded BAM Record Pre-Filtering (#96) |
bam.rs, realign.rs, cigar/parse.rs |
2-bit DNA XOR+popcnt matching (fgumi-dna), Myers band-shrinking (varlociraptor), undecoded noodles::bam::Record coordinate/flag pre-filtering (oarfish pattern), and rolling ring-buffer pileup ([PosSlot; 16384]), keeping full-read gap-affine alignment and VNTR motif decomposition delegated to minimap2/pbmm2 and TRGT/LongTR/sawfish via Switch 49 VCFv4.2/v4.3 interop. |