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

Add a codon_prob.py #19

Closed
matsen opened this issue May 18, 2024 · 1 comment
Closed

Add a codon_prob.py #19

matsen opened this issue May 18, 2024 · 1 comment
Assignees

Comments

@matsen
Copy link
Contributor

matsen commented May 18, 2024

Free functions

  • codon_probs_of_parent_scaled_rates_and_sub_probs can be lifted from the neutral_codon notebook. We can keep this in this file for now, but eventually it may want to land in epam.molevol.

Objects

CodonProbBurrito

  • __init__ will just hand arguments off to Burrito superclass, but we'll want to do all of the trimming-to-codon-boundary stuff before doing so.
  • we will need branch length optimization functions.
    • find_optimal_branch_lengths prepares the data etc for branch length optimization
    • _find_optimal_branch_length does the per-branch work
      • note that the key for this function is to be able to define log_pcp_probability and then just hand it off to the generic optimize_branch_length routine. Just to get things going, let's have our log probability just be the probability of getting a codon mutation vs no.
      • Once we have a multihit model we will want to use the probability of getting mutations of various numbers of hits.

Eventually we'll want to have a multihit model in there, and fit it, but for now let's just do branch length optimization. As part of that next step, we'll also need to process the data into hit classes to be able to calculate loss.

CodonProbDataset

I think we'll need to have one of these, which is going to have some similarities to DNSMDataset in that it's going to have per-site SHM rates which we'll use to calculate things for our codon models. These will input into the init.

@matsen
Copy link
Contributor Author

matsen commented Sep 27, 2024

Closed by #50

@matsen matsen closed this as completed Sep 27, 2024
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

No branches or pull requests

2 participants