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

Likelihood Calculation Felsenstein #41

Merged

Conversation

Billyzhang1229
Copy link
Contributor

@Billyzhang1229 Billyzhang1229 commented Apr 22, 2024

Likelihood Calculation

This PR introduces a set of functions for computing the likelihood of phylogenetic trees.

Checklist

  • Implement the basic version of Felsenstein's likelihood calculation.
  • Implement _get_genotype_index to find genotype indices in a mapping array.
  • Implement _transition_probability for calculating mutation transition probabilities.
  • Implement _calculate_likelihood to compute likelihoods using the transition probabilities.
  • Create likelihood_felsenstein as the high-level function orchestrating the likelihood computation.
  • Implement a variant vectorised version of likelihood calculation function.
  • Implement unit tests for all new functions.
  • Add documentation and examples for new functions.

Notes

  • The implementation uses Numba parallel=True option in _likelihood_felsenstein.

@Billyzhang1229 Billyzhang1229 changed the title Feature/maximum likelihood Likelihood Calculation Felsenstein Apr 22, 2024
@coveralls
Copy link

coveralls commented Apr 22, 2024

Pull Request Test Coverage Report for Build 9000585702

Details

  • 113 of 113 (100.0%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.4%) to 91.202%

Totals Coverage Status
Change from base Build 8880499253: 1.4%
Covered Lines: 622
Relevant Lines: 682

💛 - Coveralls

@Billyzhang1229 Billyzhang1229 force-pushed the feature/maximum_likelihood branch 7 times, most recently from 63cad00 to 0638ffd Compare April 25, 2024 13:23
@Billyzhang1229 Billyzhang1229 force-pushed the feature/maximum_likelihood branch from 0638ffd to a019308 Compare April 29, 2024 14:43
@Billyzhang1229 Billyzhang1229 force-pushed the feature/maximum_likelihood branch 3 times, most recently from 46e7756 to 99739dc Compare May 7, 2024 16:51
Copy link
Owner

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

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

LGTM, a few minor comments and good to merge.

phylokit/maximum_likelihood/felsenstein.py Show resolved Hide resolved
phylokit/maximum_likelihood/felsenstein.py Outdated Show resolved Hide resolved
phylokit/maximum_likelihood/felsenstein.py Outdated Show resolved Hide resolved
@Billyzhang1229 Billyzhang1229 force-pushed the feature/maximum_likelihood branch 3 times, most recently from e413ab6 to df068d7 Compare May 8, 2024 10:15
@Billyzhang1229
Copy link
Contributor Author

I'm adding one more test to cover all the cases

@jeromekelleher
Copy link
Owner

OK, ping me when ready for final review

@Billyzhang1229 Billyzhang1229 force-pushed the feature/maximum_likelihood branch from df068d7 to 2021533 Compare May 8, 2024 10:45
@Billyzhang1229 Billyzhang1229 force-pushed the feature/maximum_likelihood branch from 2021533 to 4896bec Compare May 8, 2024 10:52
@jeromekelleher jeromekelleher merged commit 080d0f3 into jeromekelleher:main May 10, 2024
8 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.

3 participants