Skip to content

v0.0.11: stats and compare subcommands - #10

Merged
alejandrogzi merged 1 commit into
masterfrom
v0.0.11
Aug 9, 2026
Merged

alejandrogzi merged 1 commit into
masterfrom
v0.0.11

Conversation

@alejandrogzi

@alejandrogzi alejandrogzi commented Aug 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds two new subcommands.

chaintools stats

Single streaming pass summarizing alignment amount, within-chain gaps, query strands, and chain fragmentation:

  • GENERAL / ALIGNMENT / CONTINUITY / GAPS / STRAND / SCORE sections, TSV output
  • chain aligned-bp N50/L50 (aligned bp, not header span), median chain aligned bp, median blocks/chain
  • per-target top-1/top-3 chain concentration, chains→50/90/95%, per-target N50; global median/max fragmentation
  • --by-sequence adds per-target tables and top scored chains (--top N, default 3)
  • reads standard input when --chain is omitted; full chain validation with byte-offset errors

chaintools compare

Compares two chain files by the exact base-pair relations they encode, not by chain identity:

  • canonical (target, query, strand, diagonal) mapping segments — invariant to chain IDs, order, and harmless splitting; overlapping/adjacent intervals merged, duplicates removed
  • MAPPING AGREEMENT (unique/shared/A-only/B-only pair bp, retained-by, Dice, Jaccard), COVERAGE/AMBIGUITY (unique + multi-mapped bp per side), CONTINUITY, GAPS (A/B + deltas), INTERPRETATION — no synthetic quality score
  • --by-sequence adds per-target agreement (A-only/B-only/shared bp, Dice) and top chains
  • sequence names interned; fixed 8 GiB memory budget checked before canonicalization — clean failure instead of OOM (external per-key sort is the documented upgrade path)
  • conflicting sequence sizes between files are fatal; sequences in one file only are not

Tests / validation

  • 216 unit + 38 lib + integration tests pass (cargo test --all-features), clippy -D warnings and fmt --check clean
  • defining fixture: one 24-bp chain vs two 12-bp chains → 100% Dice/Jaccard and worse continuity, reported side by side
  • minus-strand canonicalization verified against the official UCSC chain spec (reverse-strand query coords, qStart < qEnd)

Docs

  • assets/tools/stats.md, assets/tools/compare.md with real captured output
  • README "Statistics and comparison" section, changelog [Unreleased] entries
  • version bumped to 0.0.11

- stats: single streaming pass summarizing alignment amount, within-chain
  gaps, query strands, and chain fragmentation (aligned-bp N50/L50,
  per-target top-1/top-3 concentration, chains-to-50/90/95%, median/max
  fragmentation). --by-sequence adds per-target tables and top scored
  chains; reads stdin when --chain is omitted.
- compare: canonical base-pair mapping agreement invariant to chain IDs,
  order, and harmless splitting, reported separately from unique coverage,
  multi-mapped bp, continuity, and gaps. Name interning plus a fixed 8 GiB
  memory budget checked before canonicalization; --by-sequence adds
  per-target agreement and top chains.
- Bump to 0.0.11, add tool docs (assets/tools/stats.md, compare.md),
  README statistics section, and changelog entries.
@alejandrogzi
alejandrogzi merged commit 60ce99d into master Aug 9, 2026
2 checks passed
@alejandrogzi
alejandrogzi deleted the v0.0.11 branch August 9, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant