Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Feb 26, 2024
1 parent 5b63b7e commit 5105bbf
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,12 @@ def get_alleles_at_site(self, i):
return a1, ap1, a2, ap2


""" Helper functions. """


def remap_alleles(a):
"""
Helper function to map an allele encoded as a character to an integer.
Map an allele encoded as a character to an integer.
TODO: Move elsewhere.
Expand Down Expand Up @@ -213,6 +216,9 @@ def convert_to_genetic_map_positions(pos, genetic_map=None):
return est_cm


""" Li & Stephens HMM. """


def get_mismatch_probs(pos, error_rate):
"""
Compute mismatch probabilities at genotyped positions.
Expand Down Expand Up @@ -363,6 +369,9 @@ def compute_state_prob_matrix(fm, bm):
return sm


""" Genotype imputation. """


@njit
def get_weights(typed_pos, untyped_pos, typed_cm, untyped_cm):
"""
Expand Down Expand Up @@ -640,6 +649,9 @@ def run_tsimpute(
return (imputed_alleles, max_allele_probs)


""" Evaluation metrics and printing of results. """


# Individual-level data.
def compute_individual_scores(alleles_1, allele_probs_1, alleles_2, allele_probs_2):
"""
Expand Down

0 comments on commit 5105bbf

Please sign in to comment.