diff --git a/python/tests/beagle_numba.py b/python/tests/beagle_numba.py index d75a176257..f5796e4701 100644 --- a/python/tests/beagle_numba.py +++ b/python/tests/beagle_numba.py @@ -150,14 +150,16 @@ def convert_to_genetic_map_positions(pos, genetic_map=None): return est_cm -def get_mutation_rates(pos, error_rate): +def get_mismatch_probs(pos, error_rate): """ - Set mutation rates at genotyped positions. + Compute mismatch probabilities at genotyped positions. - Mutation rates should be dominated by the allele error rate. + Mutation rates should be dominated by the rate of allele error, + which should be the main source of mismatch between query and + reference haplotypes. - In BEAGLE 4.1/5.4, the default value is set to 0.0001 and capped at 0.50. - In IMPUTE5, the default value is also set to 0.0001. + In BEAGLE 4.1/5.4, the default value is set to 1e-4 and capped at 0.50. + In IMPUTE5, the default value is also set to 1e-4. When using `_tskit.LsHmm`, this is `mu`. @@ -169,8 +171,8 @@ def get_mutation_rates(pos, error_rate): MAX_ERROR_RATE = 0.5 if error_rate >= MAX_ERROR_RATE: error_rate = MAX_ERROR_RATE - mu = np.zeros(len(pos), dtype=np.float64) + error_rate - return mu + mismatch_probs = np.zeros(len(pos), dtype=np.float64) + error_rate + return mismatch_probs def get_recombination_rates(cm, h, ne): @@ -472,7 +474,7 @@ def run_interpolation_beagle( # Get rates at genotyped markers. h = ref_h.shape[1] rho = get_recombination_rates(typed_cm, h=h, ne=ne) - mu = get_mutation_rates(typed_pos, error_rate=error_rate) + mu = get_mismatch_probs(typed_pos, error_rate=error_rate) # Compute matrices at genotyped markers. fm = compute_forward_matrix(ref_h_typed, query_h_typed, rho, mu) bm = compute_backward_matrix(ref_h_typed, query_h_typed, rho, mu)