Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests when prob_mutation is not specified #106

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/lsbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def get_examples_diploid(self, ts, include_ancestors):
query_miss_most[:, 1:] = core.MISSING
queries = [query_1, query_2, query_miss_last, query_miss_mid, query_miss_most]
# Exclude the arbitrarily chosen queries from the reference panel.
ref_panel = ref_panel[:, 4:]
# ref_panel = ref_panel[:, 4:]
return ref_panel, queries

def get_examples_pars(
Expand Down Expand Up @@ -148,6 +148,7 @@ def get_examples_pars(
np.zeros(m) + 0.01, # Equal recombination and mutation
np.random.rand(m) * 0.2, # Random
1e-5 * (np.random.rand(m) + 0.5) / 2,
None,
]

if include_extreme_rates:
Expand All @@ -162,17 +163,20 @@ def get_examples_pars(
# result in the number of alleles being higher
# than the number of alleles in the reference panel.
num_alleles = core.get_num_alleles(H, query)
prob_mutation = mu
if prob_mutation is None:
prob_mutation = np.zeros(m) + core.estimate_mutation_probability(n)
if ploidy == 1:
e = core.get_emission_matrix_haploid(
mu=mu,
mu=prob_mutation,
num_sites=m,
num_alleles=num_alleles,
scale_mutation_rate=scale_mutation_rate,
)
yield n, m, H, query, e, r, mu
else:
e = core.get_emission_matrix_diploid(
mu=mu,
mu=prob_mutation,
num_sites=m,
num_alleles=num_alleles,
scale_mutation_rate=scale_mutation_rate,
Expand Down
Loading