diff --git a/sc2ts/cli.py b/sc2ts/cli.py index 2e65d40..950c8a0 100644 --- a/sc2ts/cli.py +++ b/sc2ts/cli.py @@ -320,6 +320,13 @@ def summarise_base(ts, date, progress): type=int, help="Minimum size of groups of reconsidered samples for inclusion", ) +@click.option( + "--min-root-mutations", + default=2, + show_default=True, + type=int, + help="Minimum number of shared mutations for reconsidered sample groups" +) @click.option( "--retrospective-window", default=30, @@ -369,6 +376,7 @@ def extend( num_mismatches, hmm_cost_threshold, min_group_size, + min_root_mutations, retrospective_window, max_daily_samples, num_threads, @@ -409,6 +417,7 @@ def extend( num_mismatches=num_mismatches, hmm_cost_threshold=hmm_cost_threshold, min_group_size=min_group_size, + min_root_mutations=min_root_mutations, retrospective_window=retrospective_window, max_daily_samples=max_daily_samples, random_seed=random_seed, diff --git a/sc2ts/inference.py b/sc2ts/inference.py index 63c75cb..4c058b4 100644 --- a/sc2ts/inference.py +++ b/sc2ts/inference.py @@ -519,6 +519,7 @@ def extend( num_mismatches=None, hmm_cost_threshold=None, min_group_size=None, + min_root_mutations=None, max_daily_samples=None, show_progress=False, retrospective_window=None, @@ -531,6 +532,8 @@ def extend( hmm_cost_threshold = 5 if min_group_size is None: min_group_size = 10 + if min_root_mutations is None: + min_root_mutations = 2 if retrospective_window is None: retrospective_window = 30 @@ -617,7 +620,7 @@ def extend( min_group_size=min_group_size, min_different_dates=3, # TODO parametrise additional_group_metadata_keys=["Country"], # TODO parametrise - min_root_mutations=3, # TODO parametrise + min_root_mutations=min_root_mutations, additional_node_flags=core.NODE_IN_RETROSPECTIVE_SAMPLE_GROUP, show_progress=show_progress, phase="retro",