-
Notifications
You must be signed in to change notification settings - Fork 73
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
More flexible interpretation of mutation rate when getting emission probability when using _tskit.lshmm
#2891
Comments
Shouldn't the probability of match and probability of mismatch sum to 1? If that is the case, then I suspect there is a bug. In this code snippet:
Probability of mismatch = Their sum is not 1 when Probability of match should be EDIT: Please disregard the above. I didn't realise it's the Rosen & Paten (2019) formulation, which rescales the mutation rate based on the number of alleles at the site. So, not a bug. |
I agree it is a weird parameterisation, and doesn't belong in the core HMM. We should make this type of rescaling optional at the Python level. |
I'm just looking at how computation of emission probability is done in
tskit/python/tests/test_haplotype_matching.py Line 382 in 2dae133
|
Maybe |
Currently, the emission probability for calculating the forward, backward, and Viterbi matrices is defined as follows:
This implies that an allele at a site mutates to another allowed allele (
num_alleles - 1
) uniformly at random at a user-specified mutation rate, mu. Changing the formula forp_e
top_e = 1 - mu
upon allele match should allow for more flexible (general?) interpretation of the mutation rate.Relevant lines are the following:
tskit/c/tskit/haplotype_matching.c
Line 1055 in 2dae133
tskit/c/tskit/haplotype_matching.c
Line 1106 in 2dae133
tskit/c/tskit/haplotype_matching.c
Line 1295 in 2dae133
The text was updated successfully, but these errors were encountered: