We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1679b1a commit 200b6abCopy full SHA for 200b6ab
python/tests/test_imputation.py
@@ -6,6 +6,7 @@
6
import numpy as np
7
import pandas as pd
8
9
+import _tskit
10
import tskit
11
12
@@ -259,3 +260,13 @@ def get_beagle_data(matrix_text, data_type):
259
260
return df.sumSite.to_numpy().reshape((4, 4))[:, 0]
261
else:
262
raise ValueError(f"Unknown data type: {data_type}")
263
+
264
265
+def get_tskit_forward_backward_matrices(ts, h):
266
+ m = ts.num_sites
267
+ fm = _tskit.CompressedMatrix(ts)
268
+ bm = _tskit.CompressedMatrix(ts)
269
+ ls_hmm = _tskit.LsHmm(ts, np.zeros(m) + 0.1, np.zeros(m) + 0.1)
270
+ ls_hmm.forward_matrix(h, fm)
271
+ ls_hmm.backward_matrix(h, fm.normalisation_factor, bm)
272
+ return [fm, bm]
0 commit comments