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

Multiple merger polyploid scaling #2309

Closed
wants to merge 0 commits into from

Conversation

JereKoskela
Copy link
Member

Ping @jeromekelleher. Adding tests for polyploid scaling for multiple merger coalescents turned out to be easy, but also sent me down a bit of a rabbit hole. Summary of changes:

  • The extra spaces on various lines in msprime.c which are unrelated to anything I've done (1396, 1899...) were put in by clang. Let me know if you want me to do something about them.
  • For the Dirac coalescent, population growth at rate g should yield a coalescent growth rate of 2g,essentially because the coalescence probability in the Moran model is 1/N^2 rather than 1/N. We had overlooked that, but it is now fixed.
  • Ploidy wasn't being handled quite right in the Dirac coalescent either, but is now fixed. In the process, I got rid of some if (ploidy == 1) {...} else {...} statements which became redundant.
  • For both the Dirac and Beta coalescents, I moved the allocation of the ancestor buckets Q later into the rejection sampler. It is now only done once a multiple merger event is definitely taking place.
  • The Dirac coalescent test in test_ancestry.py started failing after the ploidy fix because the rate of multiple mergers wasn't high enough to guarantee one anymore. I increased it.
  • I also noticed we were disallowing psi = 1 in the Dirac coalescent for no reason. The documented (and sensible) range is 0 < psi <= 1. I tweaked the boundary values and associated tests to make the code consistent with the documentation.

Copy link

codecov bot commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 85.45455% with 8 lines in your changes missing coverage. Please review.

Project coverage is 90.98%. Comparing base (7492287) to head (42ec186).

Files Patch % Lines
lib/msprime.c 84.90% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2309      +/-   ##
==========================================
- Coverage   90.99%   90.98%   -0.02%     
==========================================
  Files          20       20              
  Lines       12035    12021      -14     
  Branches     2441     2437       -4     
==========================================
- Hits        10951    10937      -14     
  Misses        599      599              
  Partials      485      485              
Flag Coverage Δ
C 90.98% <85.45%> (-0.02%) ⬇️
python 98.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@jeromekelleher
Copy link
Member

Sorry, making a mess of git stuff here, I'll fix it up

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