Skip to content

Commit

Permalink
Improve docs for get_mismatch_prob
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Jan 14, 2024
1 parent ec9dd83 commit b4bb288
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit b4bb288

Please sign in to comment.