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

Resolve z-score discrepancy due to beads samples ordering #189

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

ksung25
Copy link
Collaborator

@ksung25 ksung25 commented Nov 5, 2024

Use math.fsum to minimize rounding errors when summing CPMs over beads samples to determine peptide binning before computing Z-scores. Rounding errors can cause binning differences depending on the input order of beads samples, leading to different Z-score results.

I've made an example that demonstrates discrepant Z-scores if ran without the patch in this PR:
/fh/fast/matsen_e/ksung2/phippery_test_data/zscore_test.py
This is tested with V1.13 VS57_Vir3_Jan2023_Z7 virscan.phip file.

@ksung25 ksung25 linked an issue Nov 5, 2024 that may be closed by this pull request
@ksung25 ksung25 requested a review from jgallowa07 November 5, 2024 20:14
Copy link
Member

@jgallowa07 jgallowa07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@jgallowa07
Copy link
Member

Thanks a ton, @ksung25! I'm going to rebase this with some other changes that were just made, bump the versions for a new release, then I'll merge.

@jgallowa07 jgallowa07 force-pushed the 187-z-score-counts-discrepancy branch from d3cd4c0 to 85863e9 Compare November 6, 2024 00:53
@jgallowa07 jgallowa07 mentioned this pull request Nov 6, 2024
@jgallowa07 jgallowa07 force-pushed the 187-z-score-counts-discrepancy branch from 85863e9 to bd75e60 Compare November 6, 2024 02:20
@jgallowa07 jgallowa07 merged commit 9e9626e into main Nov 6, 2024
4 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.

z-score counts discrepancy
2 participants