From b4bb288ee08136127305912a61d3d14e51fa174a Mon Sep 17 00:00:00 2001 From: Shing Zhan Date: Sun, 14 Jan 2024 14:01:46 +0000 Subject: [PATCH] Improve docs for get_mismatch_prob --- python/tests/beagle_numba.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/python/tests/beagle_numba.py b/python/tests/beagle_numba.py index e72706de4e..1f4c0b84be 100644 --- a/python/tests/beagle_numba.py +++ b/python/tests/beagle_numba.py @@ -122,21 +122,23 @@ def get_weights(genotyped_pos, ungenotyped_pos, genotyped_cm, ungenotyped_cm): return (weights, marker_interval_start) -def get_mismatch_prob(pos, miscall_rate): +def get_mismatch_prob(pos, error_rate): """ - Set mismatch probabilities at genotyped markers. + Set mismatch probabilities at genotyped positions. - In BEAGLE, the mismatch probability is dominated by the allelic miscall rate. - By default, it is set to 0.0001 and capped at 0.50. + Mutation rates (per meiosis) should be dominated by the genotyping error rate. + Note that in BEAGLE 4.1, the default value is set to 0.0001 and capped at 0.50. - :param numpy.ndarray pos: Physical positions. + In terms of using `_tskit.LsHmm`, this mismatch probability is `mu`. + + :param numpy.ndarray pos: Physical positions (bp). :param float miscall_rate: Allelic miscall rate. :return: Mismatch probabilities. :rtype: numpy.ndarray """ - if miscall_rate >= 0.5: - miscall_rate = 0.5 - mu = np.zeros(len(pos), dtype=np.float32) + miscall_rate + if error_rate >= 0.5: + error_rate = 0.5 + mu = np.zeros(len(pos), dtype=np.float32) + error_rate return mu