@@ -571,20 +571,12 @@ def test_2020_02_02(self, tmp_path, fx_ts_map, fx_alignment_store, fx_metadata_d
571
571
)
572
572
assert ts .num_samples == 26
573
573
assert np .sum (ts .nodes_time [ts .samples ()] == 0 ) == 4
574
- samples = {}
575
- for u in ts .samples ()[- 4 :]:
576
- node = ts .node (u )
577
- samples [node .metadata ["strain" ]] = node
578
- smd = node .metadata ["sc2ts" ]
579
- md = node .metadata
580
- print (md ["date" ], md ["strain" ], len (smd ["mutations" ]))
581
574
# print(samples)
582
575
# print(fx_ts_map["2020-02-01"])
583
576
# print(ts)
584
577
# print(fx_ts_map["2020-02-02"])
585
578
ts .tables .assert_equals (fx_ts_map ["2020-02-02" ].tables , ignore_provenance = True )
586
579
587
-
588
580
@pytest .mark .parametrize ("date" , dates )
589
581
def test_date_metadata (self , fx_ts_map , date ):
590
582
ts = fx_ts_map [date ]
@@ -601,7 +593,11 @@ def test_date_validate(self, fx_ts_map, fx_alignment_store, date):
601
593
602
594
@pytest .mark .parametrize ("date" , dates [1 :])
603
595
def test_node_mutation_counts (self , fx_ts_map , date ):
604
- # Basic check to make sure our fixtures are what we expect
596
+ # Basic check to make sure our fixtures are what we expect.
597
+ # NOTE: this is somewhat fragile as the numbers of nodes does change
598
+ # a little depending on the exact solution that the HMM choses, for
599
+ # example when there are multiple single-mutation matches at different
600
+ # sites.
605
601
ts = fx_ts_map [date ]
606
602
expected = {
607
603
"2020-01-19" : {"nodes" : 3 , "mutations" : 3 },
@@ -616,13 +612,13 @@ def test_node_mutation_counts(self, fx_ts_map, date):
616
612
"2020-02-03" : {"nodes" : 36 , "mutations" : 42 },
617
613
"2020-02-04" : {"nodes" : 41 , "mutations" : 48 },
618
614
"2020-02-05" : {"nodes" : 42 , "mutations" : 48 },
619
- "2020-02-06" : {"nodes" : 48 , "mutations" : 51 },
620
- "2020-02-07" : {"nodes" : 50 , "mutations" : 57 },
621
- "2020-02-08" : {"nodes" : 56 , "mutations" : 58 },
622
- "2020-02-09" : {"nodes" : 58 , "mutations" : 61 },
623
- "2020-02-10" : {"nodes" : 59 , "mutations" : 65 },
624
- "2020-02-11" : {"nodes" : 61 , "mutations" : 66 },
625
- "2020-02-13" : {"nodes" : 65 , "mutations" : 68 },
615
+ "2020-02-06" : {"nodes" : 49 , "mutations" : 51 },
616
+ "2020-02-07" : {"nodes" : 51 , "mutations" : 57 },
617
+ "2020-02-08" : {"nodes" : 57 , "mutations" : 58 },
618
+ "2020-02-09" : {"nodes" : 59 , "mutations" : 61 },
619
+ "2020-02-10" : {"nodes" : 60 , "mutations" : 65 },
620
+ "2020-02-11" : {"nodes" : 62 , "mutations" : 66 },
621
+ "2020-02-13" : {"nodes" : 66 , "mutations" : 68 },
626
622
}
627
623
assert ts .num_nodes == expected [date ]["nodes" ]
628
624
assert ts .num_mutations == expected [date ]["mutations" ]
@@ -635,9 +631,9 @@ def test_node_mutation_counts(self, fx_ts_map, date):
635
631
(13 , "SRR11597132" , 10 ),
636
632
(16 , "SRR11597177" , 10 ),
637
633
(41 , "SRR11597156" , 10 ),
638
- (56 , "SRR11597216" , 1 ),
639
- (59 , "SRR11597207" , 40 ),
640
- (61 , "ERR4205570" , 57 ),
634
+ (57 , "SRR11597216" , 1 ),
635
+ (60 , "SRR11597207" , 40 ),
636
+ (62 , "ERR4205570" , 58 ),
641
637
],
642
638
)
643
639
def test_exact_matches (self , fx_ts_map , node , strain , parent ):
@@ -697,7 +693,7 @@ class TestMatchingDetails:
697
693
# assert s.path[0].parent == 37
698
694
699
695
@pytest .mark .parametrize (
700
- ("strain" , "parent" ), [("SRR11597207" , 41 ), ("ERR4205570" , 58 )]
696
+ ("strain" , "parent" ), [("SRR11597207" , 40 ), ("ERR4205570" , 58 )]
701
697
)
702
698
@pytest .mark .parametrize ("num_mismatches" , [2 , 3 , 4 ])
703
699
@pytest .mark .parametrize ("precision" , [0 , 1 , 2 , 12 ])
0 commit comments