Skip to content

Commit 64aedbf

Browse files
Update lshmm requirement to 0.0.5
Also update changed parameter names for lshmm 0.0.5
1 parent c9f26c8 commit 64aedbf

File tree

7 files changed

+25
-22
lines changed

7 files changed

+25
-22
lines changed

c/tskit/haplotype_matching.c

+2
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,8 @@ tsk_ls_hmm_process_site_backward(tsk_ls_hmm_t *self, const tsk_site_t *site,
11261126
* immediately before calling store_site in order to filter out -1 nodes,
11271127
* and also (crucially) to ensure that the value transitions are listed
11281128
* in preorder, which we rely on later for decoding.
1129+
*
1130+
* https://github.com/tskit-dev/tskit/issues/2803
11291131
*/
11301132
ret = tsk_ls_hmm_compress(self);
11311133
if (ret != 0) {

python/requirements/CI-complete/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ coverage==7.2.7
33
dendropy==4.6.1
44
h5py==3.9.0
55
kastore==0.3.2
6-
lshmm==0.0.4
6+
lshmm==0.0.5
77
msgpack==1.0.5
88
msprime==1.2.0
99
networkx==3.1
@@ -12,4 +12,4 @@ pytest==7.4.0
1212
pytest-cov==4.1.0
1313
pytest-xdist==3.3.1
1414
tszip==0.2.2
15-
xmlunittest==0.5.0
15+
xmlunittest==0.5.0

python/requirements/CI-tests-pip/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
lshmm==0.0.4
1+
lshmm==0.0.5
22
numpy==1.21.6; python_version < '3.11' # Held at 1.21.6 for Python 3.7 compatibility
33
numpy==1.24.1; python_version > '3.10'
44
pytest==7.1.3
@@ -12,4 +12,4 @@ dendropy==4.5.2
1212
networkx==2.6.3 # Held at 2.6.3 for Python 3.7 compatibility
1313
msgpack==1.0.4
1414
newick==1.3.2
15-
tszip==0.2.2
15+
tszip==0.2.2

python/requirements/development.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ h5py>=2.6.0
1010
jsonschema>=3.0.0
1111
jupyter-book>=0.12.1
1212
kastore
13-
lshmm
13+
lshmm>=0.0.5
1414
matplotlib
1515
meson>=0.61.0
1616
msgpack>=1.0.0

python/tests/test_genotype_matching_fb.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ def verify(self, ts):
953953
np.flip(G_check, axis=0),
954954
np.flip(s, axis=1),
955955
r_flip,
956-
mutation_rate=np.flip(mu),
956+
p_mutation=np.flip(mu),
957957
scale_mutation_based_on_n_alleles=False,
958958
)
959959

@@ -978,7 +978,7 @@ def verify(self, ts):
978978
)
979979

980980
F, c, ll = ls.forwards(
981-
G_check, s, r, mutation_rate=mu, scale_mutation_based_on_n_alleles=False
981+
G_check, s, r, p_mutation=mu, scale_mutation_based_on_n_alleles=False
982982
)
983983
cm_d = ls_forward_tree(s[0, :], ts_check, r, mu)
984984
self.assertAllClose(cm_d.decode(), F)
@@ -1004,14 +1004,14 @@ def verify(self, ts):
10041004
)
10051005

10061006
F, c, ll = ls.forwards(
1007-
G_check, s, r, mutation_rate=mu, scale_mutation_based_on_n_alleles=False
1007+
G_check, s, r, p_mutation=mu, scale_mutation_based_on_n_alleles=False
10081008
)
10091009
B = ls.backwards(
10101010
G_check,
10111011
s,
10121012
c,
10131013
r,
1014-
mutation_rate=mu,
1014+
p_mutation=mu,
10151015
scale_mutation_based_on_n_alleles=False,
10161016
)
10171017

python/tests/test_genotype_matching_viterbi.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1055,14 +1055,14 @@ def verify(self, ts):
10551055
)
10561056
ts_check = ts.simplify(range(1, n + 1), filter_sites=False)
10571057
phased_path, ll = ls.viterbi(
1058-
G_check, s, r, mutation_rate=mu, scale_mutation_based_on_n_alleles=False
1058+
G_check, s, r, p_mutation=mu, scale_mutation_based_on_n_alleles=False
10591059
)
10601060
path_ll_matrix = ls.path_ll(
10611061
G_check,
10621062
s,
10631063
phased_path,
10641064
r,
1065-
mutation_rate=mu,
1065+
p_mutation=mu,
10661066
scale_mutation_based_on_n_alleles=False,
10671067
)
10681068

@@ -1077,7 +1077,7 @@ def verify(self, ts):
10771077
s,
10781078
np.transpose(path_tree_dict),
10791079
r,
1080-
mutation_rate=mu,
1080+
p_mutation=mu,
10811081
scale_mutation_based_on_n_alleles=False,
10821082
)
10831083

python/tests/test_haplotype_matching.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ def compute_next_probability(self, site_id, p_next, is_match, node):
455455
def process_site(self, site, haplotype_state, s):
456456
# FIXME see nodes in the C code for why we have two calls to
457457
# compress
458+
# https://github.com/tskit-dev/tskit/issues/2803
458459
self.compress()
459460
self.output.store_site(
460461
site.id,
@@ -928,7 +929,7 @@ def verify(self, ts):
928929
np.flip(H, axis=0),
929930
np.flip(s, axis=1),
930931
r_flip,
931-
mutation_rate=np.flip(mu),
932+
p_mutation=np.flip(mu),
932933
scale_mutation_based_on_n_alleles=False,
933934
)
934935

@@ -952,7 +953,7 @@ def verify(self, ts):
952953
H,
953954
s,
954955
r,
955-
mutation_rate=mu,
956+
p_mutation=mu,
956957
scale_mutation_based_on_n_alleles=scale_mutation,
957958
)
958959
# Note, need to remove the first sample from the ts, and ensure
@@ -977,14 +978,14 @@ class TestForwardBackwardTree(FBAlgorithmBase):
977978
def verify(self, ts):
978979
for n, H, s, r, mu in self.example_parameters_haplotypes(ts):
979980
F, c, ll = ls.forwards(
980-
H, s, r, mutation_rate=mu, scale_mutation_based_on_n_alleles=False
981+
H, s, r, p_mutation=mu, scale_mutation_based_on_n_alleles=False
981982
)
982983
B = ls.backwards(
983984
H,
984985
s,
985986
c,
986987
r,
987-
mutation_rate=mu,
988+
p_mutation=mu,
988989
scale_mutation_based_on_n_alleles=False,
989990
)
990991

@@ -1017,7 +1018,7 @@ class TestTreeViterbiHap(VitAlgorithmBase):
10171018
def verify(self, ts):
10181019
for n, H, s, r, mu in self.example_parameters_haplotypes(ts):
10191020
path, ll = ls.viterbi(
1020-
H, s, r, mutation_rate=mu, scale_mutation_based_on_n_alleles=False
1021+
H, s, r, p_mutation=mu, scale_mutation_based_on_n_alleles=False
10211022
)
10221023
ts_check = ts.simplify(range(1, n + 1), filter_sites=False)
10231024
cm = ls_viterbi_tree(s[0, :], ts_check, r, mu)
@@ -1032,7 +1033,7 @@ def verify(self, ts):
10321033
s,
10331034
path_tree,
10341035
r,
1035-
mutation_rate=mu,
1036+
p_mutation=mu,
10361037
scale_mutation_based_on_n_alleles=False,
10371038
)
10381039
self.assertAllClose(ll, ll_check)
@@ -1055,7 +1056,7 @@ def check_viterbi(ts, h, recombination=None, mutation=None):
10551056
G,
10561057
h.reshape(1, m),
10571058
recombination,
1058-
mutation_rate=mutation,
1059+
p_mutation=mutation,
10591060
scale_mutation_based_on_n_alleles=False,
10601061
)
10611062
assert np.isscalar(ll)
@@ -1073,7 +1074,7 @@ def check_viterbi(ts, h, recombination=None, mutation=None):
10731074
h.reshape(1, m),
10741075
path_tree,
10751076
recombination,
1076-
mutation_rate=mutation,
1077+
p_mutation=mutation,
10771078
scale_mutation_based_on_n_alleles=False,
10781079
)
10791080
nt.assert_allclose(ll_check, ll)
@@ -1109,7 +1110,7 @@ def check_forward_matrix(ts, h, recombination=None, mutation=None):
11091110
G,
11101111
h.reshape(1, m),
11111112
recombination,
1112-
mutation_rate=mutation,
1113+
p_mutation=mutation,
11131114
scale_mutation_based_on_n_alleles=False,
11141115
)
11151116
assert F.shape == (m, n)
@@ -1154,7 +1155,7 @@ def check_backward_matrix(ts, h, forward_cm, recombination=None, mutation=None):
11541155
h.reshape(1, m),
11551156
forward_cm.normalisation_factor,
11561157
recombination,
1157-
mutation_rate=mutation,
1158+
p_mutation=mutation,
11581159
scale_mutation_based_on_n_alleles=False,
11591160
)
11601161

0 commit comments

Comments
 (0)