Skip to content

Commit

Permalink
Pre-release checks
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Jun 18, 2024
1 parent d328110 commit 2fc8476
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lshmm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def check_inputs(
reference_panel,
query,
prob_recombination,
prob_mutation=None,
scale_mutation_rate=None,
prob_mutation,
scale_mutation_rate,
):
"""
Check that the input data and parameters are valid, and return basic info
Expand All @@ -50,8 +50,8 @@ def check_inputs(
:param numpy.ndarray reference_panel: An array of size (m, n) or (m, n, n).
:param numpy.ndarray query: An array of size (k, m).
:param numpy.ndarray prob_recombination: Recombination probability.
:param numpy.ndarray prob_mutation: Mutation probability. If None (default), set as per Li & Stephens (2003).
:param bool scale_mutation_rate: Scale mutation rate if True (default).
:param numpy.ndarray prob_mutation: Mutation probability.
:param bool scale_mutation_rate: Scale mutation rate.
:return: Number of reference haplotypes, number of sites, ploidy
:rtype: tuple
"""
Expand All @@ -60,7 +60,7 @@ def check_inputs(

# Check the reference panel.
if not len(reference_panel.shape) in (2, 3):
err_msg = "Reference panel array must have 2 or 3 dimensions."
err_msg = "Reference panel array has incorrect dimensions."
raise ValueError(err_msg)

if len(reference_panel.shape) == 2:
Expand Down Expand Up @@ -129,7 +129,7 @@ def set_emission_probabilities(
scale_mutation_rate,
):
if isinstance(prob_mutation, float):
prob_mutation = prob_mutation * np.ones(num_sites)
prob_mutation = np.zeros(num_sites) + prob_mutation

if ploidy == 1:
emission_probs = core.get_emission_matrix_haploid(
Expand Down Expand Up @@ -159,7 +159,7 @@ def forwards(
scale_mutation_rate=None,
normalise=None,
):
"""Run the forwards algorithm on haplotype or unphased genotype data."""
"""Run the forwards algorithm on haploid or diploid genotype data."""
if scale_mutation_rate is None:
scale_mutation_rate = True

Expand Down Expand Up @@ -217,7 +217,7 @@ def backwards(
prob_mutation=None,
scale_mutation_rate=None,
):
"""Run the backwards algorithm on haplotype or unphased genotype data."""
"""Run the backwards algorithm on haploid or diploid genotype data."""
if scale_mutation_rate is None:
scale_mutation_rate = True

Expand Down Expand Up @@ -267,7 +267,7 @@ def viterbi(
prob_mutation=None,
scale_mutation_rate=None,
):
"""Run the Viterbi algorithm on haplotype or unphased genotype data."""
"""Run the Viterbi algorithm on haploid or diploid genotype data."""
if scale_mutation_rate is None:
scale_mutation_rate = True

Expand Down

0 comments on commit 2fc8476

Please sign in to comment.