Skip to content

Commit

Permalink
Add parameter for min root mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromekelleher committed Sep 25, 2024
1 parent aecd697 commit 93067cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions sc2ts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -369,6 +376,7 @@ def extend(
num_mismatches,
hmm_cost_threshold,
min_group_size,
min_root_mutations,
retrospective_window,
max_daily_samples,
num_threads,
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion sc2ts/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 93067cf

Please sign in to comment.