Repository navigation
Conversation
getTwoTailedPValue kept a table only if its probability was <= the observed table's. With equal-size groups the mirror table has exactly the same probability, but the two log-factorial sums can differ in the last bits, so the result changed when the groups were swapped (for example 1 vs 0.624 for 299/1 vs 298/2). Compare with a relative tolerance of 1e-7, as R's fisher.test does, and cap the sum at 1. This matches the backend fix proposed in cBioPortal/cbioportal#12502 for cBioPortal/cbioportal#12501.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
arieleven
marked this pull request as ready for review
November 21, 2026 15:06
Author
|
Marking this ready for review. The failing CircleCI jobs here ( |
This branch was successfully deployed
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.
Fix cBioPortal/cbioportal#12501 (frontend part)
Describe changes proposed in this pull request:
getTwoTailedPValueinsrc/shared/lib/calculation/FisherExactTestCalculator.tskept a table only if its probability was<=the observed table's. With equal-size groups the mirror table has exactly the same probability, but the two log-factorial sums can differ in the last bits, so it could be dropped and the p-value changed when the groups were swapped. For example,getTwoTailedPValue(298, 2, 299, 1)returns 1 butgetTwoTailedPValue(299, 1, 298, 2)returns 0.624.fisher.test, and caps the sum at 1 (it could come out as 1.0000000000006).Checks
FisherExactTestCalculator.spec.ts(swapped groups give the same p-value and match R'sfisher.test; the p-value is never above 1). Both fail on master and pass with the change; the existing cases still pass unchanged. I ran the spec file with a small standalone runner because I didn't do a fullpnpm installhere, so CI's Jest run is the real check.Label: could a maintainer add
fix? I can't set labels from a fork.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.