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

gamma b21 QC #1669

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

clararehmann
Copy link
Contributor

@clararehmann clararehmann commented Jan 23, 2025

Addresses #1649

I've replicated the Gamma DFE from Booker et al. (2021), using the shape and mean parameters from Table S2 and basing the neutral:negative proportion off of the transition:transversion ratio in Table S1.

The authors use PolyDFE to estimate the scaled selection coefficient:

Using polyDFE, the DFE is estimated in terms of the scaled selection coefficient for deleterious mutations, 2Nesd, where sd is the reduction in fitness experienced by an individual homozygous for the mutation (which is assumed to be semi-dominant).

I divided the scaled mean of the gamma distribution by the effective population size quoted in the paper (420,000) to obtain 2sd, then divided by two to get the s coefficient used for homozygotes in SLiM.

@clararehmann
Copy link
Contributor Author

It seems like the tests are failing bc I included more sig figs - is there a standard for how many to use? I just copy and pasted values from the provided supplementary tables

@clararehmann clararehmann marked this pull request as ready for review January 23, 2025 01:49
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.42%. Comparing base (5e63e81) to head (49fee96).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1669      +/-   ##
==========================================
- Coverage   99.84%   99.42%   -0.43%     
==========================================
  Files         136      136              
  Lines        4656     4684      +28     
  Branches      470      470              
==========================================
+ Hits         4649     4657       +8     
- Misses          3       18      +15     
- Partials        4        9       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@petrelharp
Copy link
Contributor

Ah, I see: the second one is yours.

FAILED tests/test_dfes.py::TestMusMusGamma_B21::test_mutation_types_match - AssertionError: assert False
 +  where False = <function allclose at 0x7fc47dd367b0>([-0.0596, 0.186], [-0.05957688452380952, 0.18617976])

We don't have a standard. In general I'd think "as many digits as they report"? But, the third digit or so here is not going to make a difference, so what they had isn't wrong. I'd say change the main implementation to agree with yours, after checking they agree up to rounding? The other consideration is if the catalog looks ugly - but I think the values printed there are rounded? If not, maybe we shoudl round?

@petrelharp
Copy link
Contributor

That's not the isuse now:

=========================== short test summary info ============================
FAILED tests/test_dfes.py::TestMusMusGamma_B21::test_proporitions_match - assert False
 +  where False = <function allclose at 0x104c3b1b0>([0.334, 0.666], [np.float64(0.772), np.float64(0.228)])
 +    where <function allclose at 0x104c3b1b0> = np.allclose
===== 1 failed, 2601 passed, 53 skipped, 20 warnings in 278.46s (0:04:38) ======

@petrelharp
Copy link
Contributor

If you look at your parameters again and still don't agree with what the original implementer put in, then ping them here (and maybe elsewhere too) to consult?

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.

2 participants