diff --git a/tests/lsbase.py b/tests/lsbase.py index f4194cb..5a7d11b 100644 --- a/tests/lsbase.py +++ b/tests/lsbase.py @@ -160,8 +160,6 @@ def get_examples_parameters_diploid(self, ts, seed=42): rs = [np.zeros(m) + 0.999, np.zeros(m) + 1e-6, np.random.rand(m)] mus = [np.zeros(m) + 0.33, np.zeros(m) + 1e-6, np.random.rand(m) * 0.33] - e = self.get_emission_prob_matrix_diploid(mu, m) - for s, r, mu in itertools.product(genotypes, rs, mus): r[0] = 0 e = self.get_emission_prob_matrix_diploid(mu, m) diff --git a/tests/test_API.py b/tests/test_API.py index 1854e43..f71f7df 100644 --- a/tests/test_API.py +++ b/tests/test_API.py @@ -1,14 +1,5 @@ -import itertools -import pytest - -import numpy as np - -import msprime -import tskit - from . import lsbase import lshmm as ls -import lshmm.core as core import lshmm.fb_diploid as fbd import lshmm.fb_haploid as fbh import lshmm.vit_diploid as vd @@ -16,8 +7,6 @@ class TestMethodsHaploid(lsbase.FBAlgorithmBase): - """Test that the computed likelihood is the same across all implementations.""" - def test_simple_n_10_no_recombination(self): ts = self.get_simple_n_10_no_recombination() self.verify(ts) diff --git a/tests/test_API_multiallelic.py b/tests/test_API_multiallelic.py index b034d18..e638f68 100644 --- a/tests/test_API_multiallelic.py +++ b/tests/test_API_multiallelic.py @@ -7,6 +7,22 @@ class TestMethodsHaploid(lsbase.FBAlgorithmBase): + def test_multiallelic_n_10_no_recombination(self): + ts = self.get_multiallelic_n_10_no_recombination() + return ts + + def test_multiallelic_n_6(self): + ts = self.get_multiallelic_n_6() + return ts + + def test_multiallelic_n_8(self): + ts = self.get_multiallelic_n_8() + return ts + + def test_multiallelic_n_16(self): + ts = self.get_multiallelic_n_16() + return ts + def verify(self, ts): for n, m, H_vs, s, e_vs, r, mu in self.get_examples_parameters_haploid(ts): F_vs, c_vs, ll_vs = fbh.forwards_ls_hap(n, m, H_vs, s, e_vs, r) @@ -34,6 +50,22 @@ def verify(self, ts): class TestViterbiHaploid(lsbase.ViterbiAlgorithmBase): + def test_multiallelic_n_10_no_recombination(self): + ts = self.get_multiallelic_n_10_no_recombination() + return ts + + def test_multiallelic_n_6(self): + ts = self.get_multiallelic_n_6() + return ts + + def test_multiallelic_n_8(self): + ts = self.get_multiallelic_n_8() + return ts + + def test_multiallelic_n_16(self): + ts = self.get_multiallelic_n_16() + return ts + def verify(self, ts): for n, m, H_vs, s, e_vs, r, mu in self.get_examples_parameters_haploid(ts): V_vs, P_vs, ll_vs = vh.forwards_viterbi_hap_lower_mem_rescaling(