Mwu biasz int64 - #2598
Merged
Merged
Mwu biasz int64#2598
Conversation
calc_mwu_biasZ() summed the tie adjustment (p*p-1)*p, the pair counts and the group sizes in `int`. The tie term is cubic in the number of reads sharing one quality or position bin and exceeds INT_MAX once a bin holds 1291 reads. That happens at a single deep site (-d raised for amplicon, mitochondrial or viral data) and, under the default -d 250, across the samples of a multi-sample call: the histograms are pooled over all samples, so ~45 samples at 30x with MAPQ 60 are enough. The wrapped tie term inflated the variance and shrank INFO/MQBZ, BQBZ, RPBZ, SCBZ, MQSBZ and NMBZ towards zero (for example MQBZ -7.9 where the tie-corrected Z is -36.6 for 1300 MAPQ-60 reference reads and 40 MAPQ-30 alternate reads). Accumulate in int64_t. Adds a regression test with 1340 20-bp reads where the MAPQ-60 bin holds 1300 reads, and a NEWS entry. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Cindy Krafft <cynthiacondra@gmail.com>
The previous commit avoids overflow by switching to 64-bit, but it moves overflow from ~2^10 to ~2^21. While high (approx 2 million depth) this commit refactors it to remove the cube entirely. Also shrunk the test data a little by using a higher compression level. Assisted-by: Claude:claude-opus-5-5 high Signed-off-by: James Bonfield <jkb@sanger.ac.uk>
Member
|
Thank you |
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.
A replacement for #2595. Fixes #2594
This has the same commit as 2595 but with an additional refactoring. The two commits are left in place to reflect the same authorship (although by author we mostly mean Claude!), but also because the earlier commit is perhaps easier to understand as an interim solution top the original problem.