Correct Summary population and deterministic reporting - #699
Open
SuhasSrinivasan wants to merge 3 commits into
Open
Correct Summary population and deterministic reporting#699SuhasSrinivasan wants to merge 3 commits into
SuhasSrinivasan wants to merge 3 commits into
Conversation
This was referenced Aug 11, 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.
Review status: Author-reviewed and ready for ONT review.
Summary
This PR consolidates the related Summary population and reporting corrections:
summary --cpgexcludes unmapped records, matching the documented explicit--motif CG 0behavior;0, and sampling fractions are logged in percent units.The three commits are confined to Summary input eligibility, aggregation, and report rendering. Sampling decisions and threshold calculations are unchanged.
Severity
High — scientific counts, reporting completeness, and reproducibility.
The CpG shorthand can silently include an ineligible unmapped population, while filtered-only biological states can disappear despite contributing to totals. Hash-dependent ordering also prevents byte-stable reports.
Bugs and corrected behavior
--cpg--motif CG 0and mapped-only controlImplementation
--cpgas a resolved motif restriction in the indexed-path unmapped-record guard.Testing
Tested exact revision:
413cffd1bc1451901a5d58c3b63acfafb3210b5bTree:
c40550d5f5c780fc67354b63cbe4bf02a9b78a00Platform/toolchain: macOS arm64; rustc/cargo 1.90.0;
rust-htslib0.46.0 andhts-sys2.2.0.total_reads_usedfrom 10 to 11; fixed output remainstotal_reads_used=10,count_reads_C=10, andC_total_mod_calls=77.20 reads / 186 C callsbecomes the correct10 reads / 77 C calls, equal to both explicit-motif and mapped-only controls.10%.git diff --check, changed-filerustfmt --check, clean-worktree, ancestry, patch-ID, and Cargo.lock checks passed.Bioinformatics review independently verified the reference-CpG population, category conservation, code ordering, denominator handling, and sampling invariance. No blocker remained.
Output compatibility
--cpgruns lose only invalid unmapped contributions.Reviewer guide
--cpgunmapped guard and its mapped-only/explicit-motif controls.writers.rs.cargo test -p mod_kit summary -- --test-threads=1andcargo test -p modkit --test test_summary -- --test-threads=1as focused canaries.Non-goals