Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Normalized enrichments scores and repo improvements #20

Merged
merged 4 commits into from
Jan 11, 2024
Merged

Conversation

iblacksand
Copy link
Collaborator

This release fixes a bug for cases where the GSEA enrichment score for a gene set did not share a sign with any of the random permutations.

Previous behavior

Example case: the enrichment score for set $S$ is a negative value. The 1000 permutations had all positive enrichment scores. To calculate the normalized enrichment score (NES), you divide the real score by the average of the random scores that are of the same sign (in this example the average of the negative scores). Since there are no negative random scores, the average would be 0.

To avoid dividing by 0, old WebGestaltR would add 0.000001 to every average. In this example, this would result in multiply the enrichment score by $10^{-5}$.

The old R package would set the NES to 0 if this happened, but this step was missed in the rust implementation, resulting in a high NES.

New behavior

To avoid this abnormally high normalized score, if there are no permutations with a matched sign, the normalized score is set to 0. This is the same behavior as the original R package.

@iblacksand iblacksand added bug Something isn't working library Deals with the library portion of the project labels Jan 11, 2024
@iblacksand iblacksand self-assigned this Jan 11, 2024
@iblacksand iblacksand merged commit b7be835 into master Jan 11, 2024
2 checks passed
@iblacksand iblacksand deleted the dev branch January 11, 2024 22:32
iblacksand added a commit that referenced this pull request Apr 25, 2024
Fix Normalized enrichments scores and repo improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working library Deals with the library portion of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant