From f41007fd98f9dea8e2699394adc7cc66995276e7 Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Tue, 18 Jul 2023 15:22:34 +0100 Subject: [PATCH] Update lshmm requirement to 0.0.5 Also update changed parameter names for lshmm 0.0.5 --- .../requirements/CI-complete/requirements.txt | 4 ++-- .../CI-tests-pip/requirements.txt | 4 ++-- python/requirements/development.txt | 2 +- python/tests/test_genotype_matching_fb.py | 8 ++++---- .../tests/test_genotype_matching_viterbi.py | 6 +++--- python/tests/test_haplotype_matching.py | 20 +++++++++---------- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/python/requirements/CI-complete/requirements.txt b/python/requirements/CI-complete/requirements.txt index b64ac2f43c..fb2db98445 100644 --- a/python/requirements/CI-complete/requirements.txt +++ b/python/requirements/CI-complete/requirements.txt @@ -3,7 +3,7 @@ coverage==7.2.7 dendropy==4.6.1 h5py==3.9.0 kastore==0.3.2 -lshmm==0.0.4 +lshmm==0.0.5 msgpack==1.0.5 msprime==1.2.0 networkx==3.1 @@ -12,4 +12,4 @@ pytest==7.4.0 pytest-cov==4.1.0 pytest-xdist==3.3.1 tszip==0.2.2 -xmlunittest==0.5.0 \ No newline at end of file +xmlunittest==0.5.0 diff --git a/python/requirements/CI-tests-pip/requirements.txt b/python/requirements/CI-tests-pip/requirements.txt index 9f3b31ef3d..42063d0d58 100644 --- a/python/requirements/CI-tests-pip/requirements.txt +++ b/python/requirements/CI-tests-pip/requirements.txt @@ -1,4 +1,4 @@ -lshmm==0.0.4 +lshmm==0.0.5 numpy==1.21.6; python_version < '3.11' # Held at 1.21.6 for Python 3.7 compatibility numpy==1.24.1; python_version > '3.10' pytest==7.1.3 @@ -12,4 +12,4 @@ dendropy==4.5.2 networkx==2.6.3 # Held at 2.6.3 for Python 3.7 compatibility msgpack==1.0.4 newick==1.3.2 -tszip==0.2.2 \ No newline at end of file +tszip==0.2.2 diff --git a/python/requirements/development.txt b/python/requirements/development.txt index ba48881723..5181177b2a 100644 --- a/python/requirements/development.txt +++ b/python/requirements/development.txt @@ -10,7 +10,7 @@ h5py>=2.6.0 jsonschema>=3.0.0 jupyter-book>=0.12.1 kastore -lshmm +lshmm>=0.0.5 matplotlib meson>=0.61.0 msgpack>=1.0.0 diff --git a/python/tests/test_genotype_matching_fb.py b/python/tests/test_genotype_matching_fb.py index 761eadf403..90def524aa 100644 --- a/python/tests/test_genotype_matching_fb.py +++ b/python/tests/test_genotype_matching_fb.py @@ -953,7 +953,7 @@ def verify(self, ts): np.flip(G_check, axis=0), np.flip(s, axis=1), r_flip, - mutation_rate=np.flip(mu), + p_mutation=np.flip(mu), scale_mutation_based_on_n_alleles=False, ) @@ -978,7 +978,7 @@ def verify(self, ts): ) F, c, ll = ls.forwards( - G_check, s, r, mutation_rate=mu, scale_mutation_based_on_n_alleles=False + G_check, s, r, p_mutation=mu, scale_mutation_based_on_n_alleles=False ) cm_d = ls_forward_tree(s[0, :], ts_check, r, mu) self.assertAllClose(cm_d.decode(), F) @@ -1004,14 +1004,14 @@ def verify(self, ts): ) F, c, ll = ls.forwards( - G_check, s, r, mutation_rate=mu, scale_mutation_based_on_n_alleles=False + G_check, s, r, p_mutation=mu, scale_mutation_based_on_n_alleles=False ) B = ls.backwards( G_check, s, c, r, - mutation_rate=mu, + p_mutation=mu, scale_mutation_based_on_n_alleles=False, ) diff --git a/python/tests/test_genotype_matching_viterbi.py b/python/tests/test_genotype_matching_viterbi.py index acab5d1c28..d8e0b33294 100644 --- a/python/tests/test_genotype_matching_viterbi.py +++ b/python/tests/test_genotype_matching_viterbi.py @@ -1055,14 +1055,14 @@ def verify(self, ts): ) ts_check = ts.simplify(range(1, n + 1), filter_sites=False) phased_path, ll = ls.viterbi( - G_check, s, r, mutation_rate=mu, scale_mutation_based_on_n_alleles=False + G_check, s, r, p_mutation=mu, scale_mutation_based_on_n_alleles=False ) path_ll_matrix = ls.path_ll( G_check, s, phased_path, r, - mutation_rate=mu, + p_mutation=mu, scale_mutation_based_on_n_alleles=False, ) @@ -1077,7 +1077,7 @@ def verify(self, ts): s, np.transpose(path_tree_dict), r, - mutation_rate=mu, + p_mutation=mu, scale_mutation_based_on_n_alleles=False, ) diff --git a/python/tests/test_haplotype_matching.py b/python/tests/test_haplotype_matching.py index 725c6bf38c..15c6acf6af 100644 --- a/python/tests/test_haplotype_matching.py +++ b/python/tests/test_haplotype_matching.py @@ -928,7 +928,7 @@ def verify(self, ts): np.flip(H, axis=0), np.flip(s, axis=1), r_flip, - mutation_rate=np.flip(mu), + p_mutation=np.flip(mu), scale_mutation_based_on_n_alleles=False, ) @@ -952,7 +952,7 @@ def verify(self, ts): H, s, r, - mutation_rate=mu, + p_mutation=mu, scale_mutation_based_on_n_alleles=scale_mutation, ) # Note, need to remove the first sample from the ts, and ensure @@ -977,14 +977,14 @@ class TestForwardBackwardTree(FBAlgorithmBase): def verify(self, ts): for n, H, s, r, mu in self.example_parameters_haplotypes(ts): F, c, ll = ls.forwards( - H, s, r, mutation_rate=mu, scale_mutation_based_on_n_alleles=False + H, s, r, p_mutation=mu, scale_mutation_based_on_n_alleles=False ) B = ls.backwards( H, s, c, r, - mutation_rate=mu, + p_mutation=mu, scale_mutation_based_on_n_alleles=False, ) @@ -1017,7 +1017,7 @@ class TestTreeViterbiHap(VitAlgorithmBase): def verify(self, ts): for n, H, s, r, mu in self.example_parameters_haplotypes(ts): path, ll = ls.viterbi( - H, s, r, mutation_rate=mu, scale_mutation_based_on_n_alleles=False + H, s, r, p_mutation=mu, scale_mutation_based_on_n_alleles=False ) ts_check = ts.simplify(range(1, n + 1), filter_sites=False) cm = ls_viterbi_tree(s[0, :], ts_check, r, mu) @@ -1032,7 +1032,7 @@ def verify(self, ts): s, path_tree, r, - mutation_rate=mu, + p_mutation=mu, scale_mutation_based_on_n_alleles=False, ) self.assertAllClose(ll, ll_check) @@ -1055,7 +1055,7 @@ def check_viterbi(ts, h, recombination=None, mutation=None): G, h.reshape(1, m), recombination, - mutation_rate=mutation, + p_mutation=mutation, scale_mutation_based_on_n_alleles=False, ) assert np.isscalar(ll) @@ -1073,7 +1073,7 @@ def check_viterbi(ts, h, recombination=None, mutation=None): h.reshape(1, m), path_tree, recombination, - mutation_rate=mutation, + p_mutation=mutation, scale_mutation_based_on_n_alleles=False, ) nt.assert_allclose(ll_check, ll) @@ -1109,7 +1109,7 @@ def check_forward_matrix(ts, h, recombination=None, mutation=None): G, h.reshape(1, m), recombination, - mutation_rate=mutation, + p_mutation=mutation, scale_mutation_based_on_n_alleles=False, ) assert F.shape == (m, n) @@ -1154,7 +1154,7 @@ def check_backward_matrix(ts, h, forward_cm, recombination=None, mutation=None): h.reshape(1, m), forward_cm.normalisation_factor, recombination, - mutation_rate=mutation, + p_mutation=mutation, scale_mutation_based_on_n_alleles=False, )