Skip to content

Commit

Permalink
Minor variable renamining
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Jan 21, 2024
1 parent 3fda98d commit 8755d22
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,23 +338,23 @@ def interpolate_allele_prob(sm, ref_h, typed_pos, untyped_pos, typed_cm, untyped
return probs_rescaled


def get_map_alleles(allele_prob):
def get_map_alleles(allele_probs):
"""
Compute the maximum a posteriori alleles at ungenotyped markers of a query haplotype,
based on posterior marginal allele probabilities.
The imputed alleles is an array of size x.
WARN: If the allele probabilities are equal, then allele 0 is arbitrarily chosen.
TODO: Analyse how often this happens and the effect of this arbitrary choice.
TODO: Investigate how often this happens and the effect of this arbitrary choice.
:param numpy.ndarray allele_prob: Interpolated allele probabilities.
:param numpy.ndarray allele_probs: Interpolated allele probabilities.
:return: Imputed alleles and their associated probabilities.
:rtype: tuple(numpy.ndarray, numpy.ndarray)
"""
imputed_alleles = np.argmax(allele_prob, axis=1)
max_allele_prob = np.max(allele_prob, axis=1)
return (imputed_alleles, max_allele_prob)
imputed_alleles = np.argmax(allele_probs, axis=1)
max_allele_probs = np.max(allele_probs, axis=1)
return (imputed_alleles, max_allele_probs)


def run_interpolation_beagle(
Expand Down

0 comments on commit 8755d22

Please sign in to comment.