Skip to content

Commit 375e202

Browse files
Adjust test data for high-precision run
1 parent ac8280e commit 375e202

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

sc2ts/inference.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -421,22 +421,22 @@ def match_samples(
421421
# rerun_batch.append(sample)
422422

423423
rerun_batch = samples
424-
precision = 12
424+
precision = 6
425425
logger.info(f"Rerunning batch of {len(rerun_batch)} at p={precision}")
426426
match_tsinfer(
427427
samples=rerun_batch,
428428
ts=base_ts,
429429
num_mismatches=num_mismatches,
430-
precision=12,
430+
precision=precision,
431431
num_threads=num_threads,
432432
show_progress=show_progress,
433433
)
434-
# for sample in samples_to_rerun:
435-
# hmm_cost = sample.get_hmm_cost(num_mismatches)
436-
# # print(f"Final HMM pass:{sample.strain} hmm_cost={hmm_cost} path={sample.path}")
437-
# logger.debug(
438-
# f"Final HMM pass:{sample.strain} hmm_cost={hmm_cost} path={sample.path}"
439-
# )
434+
for sample in rerun_batch:
435+
hmm_cost = sample.get_hmm_cost(num_mismatches)
436+
# print(f"Final HMM pass:{sample.strain} hmm_cost={hmm_cost} path={sample.path}")
437+
logger.debug(
438+
f"Final HMM pass:{sample.strain} hmm_cost={hmm_cost} path={sample.path}"
439+
)
440440

441441
# remaining_samples = samples
442442
# for cost, precision in [(0, 0), (1, 2)]: #, (2, 3)]:
@@ -463,7 +463,8 @@ def match_samples(
463463
# remaining_samples = samples_to_rerun
464464

465465
# Return in sorted order so that results are deterministic
466-
return sorted(samples, key=lambda s: s.strain)
466+
# return sorted(samples, key=lambda s: s.strain)
467+
return samples
467468

468469

469470
def check_base_ts(ts):

tests/test_inference.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -612,17 +612,17 @@ def test_node_mutation_counts(self, fx_ts_map, date):
612612
"2020-01-30": {"nodes": 22, "mutations": 19},
613613
"2020-01-31": {"nodes": 23, "mutations": 21},
614614
"2020-02-01": {"nodes": 28, "mutations": 27},
615-
"2020-02-02": {"nodes": 34, "mutations": 36},
616-
"2020-02-03": {"nodes": 37, "mutations": 42},
617-
"2020-02-04": {"nodes": 42, "mutations": 48},
618-
"2020-02-05": {"nodes": 43, "mutations": 48},
619-
"2020-02-06": {"nodes": 49, "mutations": 51},
620-
"2020-02-07": {"nodes": 51, "mutations": 57},
621-
"2020-02-08": {"nodes": 57, "mutations": 58},
622-
"2020-02-09": {"nodes": 59, "mutations": 61},
623-
"2020-02-10": {"nodes": 60, "mutations": 65},
624-
"2020-02-11": {"nodes": 62, "mutations": 66},
625-
"2020-02-13": {"nodes": 66, "mutations": 68},
615+
"2020-02-02": {"nodes": 33, "mutations": 36},
616+
"2020-02-03": {"nodes": 36, "mutations": 42},
617+
"2020-02-04": {"nodes": 41, "mutations": 48},
618+
"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},
626626
}
627627
assert ts.num_nodes == expected[date]["nodes"]
628628
assert ts.num_mutations == expected[date]["mutations"]
@@ -634,10 +634,10 @@ def test_node_mutation_counts(self, fx_ts_map, date):
634634
(7, "SRR11397729", 5),
635635
(13, "SRR11597132", 10),
636636
(16, "SRR11597177", 10),
637-
(42, "SRR11597156", 10),
638-
(57, "SRR11597216", 1),
639-
(60, "SRR11597207", 41),
640-
(62, "ERR4205570", 58),
637+
(41, "SRR11597156", 10),
638+
(56, "SRR11597216", 1),
639+
(59, "SRR11597207", 40),
640+
(61, "ERR4205570", 57),
641641
],
642642
)
643643
def test_exact_matches(self, fx_ts_map, node, strain, parent):

0 commit comments

Comments
 (0)