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

Poisson context likelihood and better cli flexibility #126

Merged
merged 8 commits into from
Apr 8, 2024

Conversation

willdumm
Copy link
Contributor

@willdumm willdumm commented Apr 5, 2024

This PR optionally (and by default) replaces "mutability parsimony" with a poisson S5F context-based likelihood, described in https://github.com/matsengrp/poisson-subs-models/blob/main/main.tex
This likelihood assumes MLE branch lengths, and doesn't require any parameter fitting on the parsimony forest.

The PR also adds two new command line arguments to gctree infer:

  • --use_old_mut_parsimony allows the user to use the old version of mutability parsimony, instead of the new context-based likelihood.
  • --branching_process_ranking_coeff allows the user to specify the ranking coefficient for branching process likelihood, in particular allowing branching process likelihood to be ignored altogether. The default value remains -1 as before, but if the provided value is zero, branching process parameter fitting is skipped entirely

The CollapsedForest.filter_trees method was largely rewritten. It should be somewhat faster and provides much better log messages (if verbose flag is set) indicating how tree ranking is performed, which is reassuring when you want to be sure that the ranking coefficients line up with the proper weights. It also warns the user if the sign of a ranking coefficient doesn't match the appropriate optimization function for that weight (e.g. coefficients for likelihoods should be negative, since higher likelihoods are better)

More test cases are now included in tests/smalltest.sh, testing more of the possible cli parameter combinations. There is also a new test in tests/test_likelihoods.py comparing the new context-based likelihood to a couple of hand-computed simple cases.

@willdumm willdumm requested a review from wsdewitt April 5, 2024 22:38
Copy link
Collaborator

@wsdewitt wsdewitt left a comment

Choose a reason for hiding this comment

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

:shipit:

@willdumm willdumm merged commit e2910b7 into main Apr 8, 2024
9 checks passed
@willdumm willdumm deleted the wd-poisson-context-likelihood branch April 8, 2024 18:54
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