Correct pileup record state and count accounting - #656
Open
SuhasSrinivasan wants to merge 8 commits into
Open
Conversation
SuhasSrinivasan
marked this pull request as ready for review
August 6, 2026 06:59
This was referenced Aug 6, 2026
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 two related pileup correctness patches that both affect per-record state and bedMethyl count accounting:
--modified-basesselections.The resulting history retains the seven focused count-accounting commits followed by one focused generic-state commit.
Severity
High — scientific correctness
Affected commands can exit successfully while reporting incorrect modified/canonical counts, duplicated output rows, omitted combined-C modifications, or incorrectly anchored reverse-strand status counts.
Reproduced behavior and expected results
Root causes
update_mods_iter2left four cached fields unchanged when its iterator returnedNone.Implementation
mod_pos,canonical_base,pos_base_mod_call, andmod_strandon iterator exhaustion.(canonical base, modification code).Preserved behavior and non-goals
Testing
Exact final revision:
18b3ff23a3ecb146611df2679a59682ce09d5430Base:
5cecc3fb3a9336068d9e3c68d5c08d678153dd2cPlatform: macOS on Apple silicon
Dependency resolution: ignored
Cargo.lockSHA-25678876ab4a98da30caad167744d1c8a0875c27edad7b0b3ad5f8a1891f78604ea;hts-sys 2.2.0cargo test --offline --locked -p mod_kit generic_pileup_clears_mod_state_between_records --lib -- --test-threads=1cargo test --offline --locked -p mod_kit pileup::pileup_processor::tests --lib -- --test-threads=1cargo test --offline --locked -p modkit --test test_pileup -- --test-threads=1cargo test --offline --locked --workspace --all-targets --no-fail-fast -- --test-threads=1rustfmt --checkon all three changed files;git diff --check upstream/master...HEADcargo clippy -D warningsis not currently a usable repository-wide gate because the unchanged baseline first fails insafe-recordand contains hundreds of existing warnings. No new production-line Clippy diagnostic was identified in this diff.Scientific validation
Reviewer guide
update_mods_iter2exhausted-iterator branch.pileup_processor.rs.test_pileupcommands above.Author checklist