Skip to content

Accurate resolution of ties at level borders through hashing#178

Merged
assaron merged 10 commits intomasterfrom
hash-greater
Nov 10, 2025
Merged

Accurate resolution of ties at level borders through hashing#178
assaron merged 10 commits intomasterfrom
hash-greater

Conversation

@assaron
Copy link
Contributor

@assaron assaron commented Nov 10, 2025

Authored by Nikita Golikov @golikov-nik

The root of the problem was that different gene sets could have exactly the same ES value. Because of that, in the multilevel procedure, when we sample gene sets uniformly from conditional distribution P(.| ES >= x) for the current level x, there could be a situation when all of the generated gene sets have the same score of x. This is a problem, because we want to select a new score y > x for the next level, such that P(ES >= y | ES >= x) is approximately 1/2, and we can't do it in this case.

The main change that we implemented is to make a compound score: for a set s, the score is a pair (ES(s), hash(s)). We compare the scores lexicographically: first by ES, and if they are equal — by hash. Thus there are no more identical scores, and we can always select a new level, except for the very end, when only a single gene set is left at all. However, another problem appears, that now we need to be able to tell if two scores are exactly the same or not, which is hard to do within floating point arithmetic, so we switched to integer gene weights internally.

@assaron assaron merged commit 9a06694 into master Nov 10, 2025
4 of 5 checks passed
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.

fgsea hangs forever for highly enriched pathways in the presence of repeated high scored genes

1 participant