@@ -524,7 +524,6 @@ def process_site(
524
524
s = self .output .normalisation_factor [site .id ]
525
525
for st1 in self .T :
526
526
if st1 .tree_node != tskit .NULL :
527
-
528
527
for st2 in st1 .value_list :
529
528
st2 .value = (
530
529
((self .rho [site .id ] / self .ts .num_samples ) ** 2 )
@@ -1198,7 +1197,6 @@ def genotype_emission(self, mu, m):
1198
1197
return e
1199
1198
1200
1199
def example_genotypes (self , ts ):
1201
-
1202
1200
H = ts .genotype_matrix ()
1203
1201
s = H [:, 0 ].reshape (1 , H .shape [0 ]) + H [:, 1 ].reshape (1 , H .shape [0 ])
1204
1202
H = H [:, 2 :]
@@ -1247,9 +1245,8 @@ def example_parameters_genotypes(self, ts, seed=42):
1247
1245
rs = [np .zeros (m ) + 0.999 , np .zeros (m ) + 1e-6 , np .random .rand (m )]
1248
1246
mus = [np .zeros (m ) + 0.33 , np .zeros (m ) + 1e-6 , np .random .rand (m ) * 0.33 ]
1249
1247
1250
- e = self .genotype_emission (mu , m )
1251
-
1252
- for s , r , mu in itertools .product (genotypes , rs , mus ):
1248
+ s = genotypes [0 ]
1249
+ for r , mu in itertools .product (rs , mus ):
1253
1250
r [0 ] = 0
1254
1251
e = self .genotype_emission (mu , m )
1255
1252
yield n , m , G , s , e , r , mu
@@ -1267,36 +1264,44 @@ def test_simple_n_10_no_recombination(self):
1267
1264
assert ts .num_sites > 3
1268
1265
self .verify (ts )
1269
1266
1270
- def test_simple_n_10_no_recombination_high_mut (self ):
1271
- ts = msprime .simulate (10 , recombination_rate = 0 , mutation_rate = 3 , random_seed = 42 )
1272
- assert ts .num_sites > 3
1273
- self .verify (ts )
1274
-
1275
- def test_simple_n_10_no_recombination_higher_mut (self ):
1276
- ts = msprime .simulate (20 , recombination_rate = 0 , mutation_rate = 3 , random_seed = 42 )
1277
- assert ts .num_sites > 3
1278
- self .verify (ts )
1279
-
1280
1267
def test_simple_n_6 (self ):
1281
1268
ts = msprime .simulate (6 , recombination_rate = 2 , mutation_rate = 7 , random_seed = 42 )
1282
1269
assert ts .num_sites > 5
1283
1270
self .verify (ts )
1284
1271
1285
- def test_simple_n_8 (self ):
1286
- ts = msprime .simulate (8 , recombination_rate = 2 , mutation_rate = 5 , random_seed = 42 )
1287
- assert ts .num_sites > 5
1288
- self .verify (ts )
1289
-
1290
1272
def test_simple_n_8_high_recombination (self ):
1291
1273
ts = msprime .simulate (8 , recombination_rate = 20 , mutation_rate = 5 , random_seed = 42 )
1292
1274
assert ts .num_trees > 15
1293
1275
assert ts .num_sites > 5
1294
1276
self .verify (ts )
1295
1277
1296
- def test_simple_n_16 (self ):
1297
- ts = msprime .simulate (16 , recombination_rate = 2 , mutation_rate = 5 , random_seed = 42 )
1298
- assert ts .num_sites > 5
1299
- self .verify (ts )
1278
+ # FIXME Reducing the number of test cases here as they take a long time to run,
1279
+ # and we will want to refactor the test infrastructure when implementing these
1280
+ # diploid methods in the library.
1281
+
1282
+ # def test_simple_n_10_no_recombination_high_mut(self):
1283
+ # ts = msprime.simulate(
1284
+ # 10, recombination_rate=0, mutation_rate=3, random_seed=42)
1285
+ # assert ts.num_sites > 3
1286
+ # self.verify(ts)
1287
+
1288
+ # def test_simple_n_10_no_recombination_higher_mut(self):
1289
+ # ts = msprime.simulate(
1290
+ # 20, recombination_rate=0, mutation_rate=3, random_seed=42)
1291
+ # assert ts.num_sites > 3
1292
+ # self.verify(ts)
1293
+
1294
+ # def test_simple_n_8(self):
1295
+ # ts = msprime.simulate(
1296
+ # 8, recombination_rate=2, mutation_rate=5, random_seed=42)
1297
+ # assert ts.num_sites > 5
1298
+ # self.verify(ts)
1299
+
1300
+ # def test_simple_n_16(self):
1301
+ # ts = msprime.simulate(
1302
+ # 16, recombination_rate=2, mutation_rate=5, random_seed=42)
1303
+ # assert ts.num_sites > 5
1304
+ # self.verify(ts)
1300
1305
1301
1306
def verify (self , ts ):
1302
1307
raise NotImplementedError ()
@@ -1436,7 +1441,6 @@ class TestTreeViterbiDip(VitAlgorithmBase):
1436
1441
"""
1437
1442
1438
1443
def verify (self , ts ):
1439
-
1440
1444
for n , m , _ , s , _ , r , mu in self .example_parameters_genotypes (ts ):
1441
1445
# Note, need to remove the first sample from the ts, and ensure that
1442
1446
# invariant sites aren't removed.
@@ -1450,14 +1454,14 @@ def verify(self, ts):
1450
1454
)
1451
1455
ts_check = ts .simplify (range (1 , n + 1 ), filter_sites = False )
1452
1456
phased_path , ll = ls .viterbi (
1453
- G_check , s , r , mutation_rate = mu , scale_mutation_based_on_n_alleles = False
1457
+ G_check , s , r , p_mutation = mu , scale_mutation_based_on_n_alleles = False
1454
1458
)
1455
1459
path_ll_matrix = ls .path_ll (
1456
1460
G_check ,
1457
1461
s ,
1458
1462
phased_path ,
1459
1463
r ,
1460
- mutation_rate = mu ,
1464
+ p_mutation = mu ,
1461
1465
scale_mutation_based_on_n_alleles = False ,
1462
1466
)
1463
1467
@@ -1472,7 +1476,7 @@ def verify(self, ts):
1472
1476
s ,
1473
1477
np .transpose (path_tree_dict ),
1474
1478
r ,
1475
- mutation_rate = mu ,
1479
+ p_mutation = mu ,
1476
1480
scale_mutation_based_on_n_alleles = False ,
1477
1481
)
1478
1482
0 commit comments