Skip to content

Commit

Permalink
Move hardcoded parameters to the config file
Browse files Browse the repository at this point in the history
  • Loading branch information
j23414 committed Mar 6, 2024
1 parent a91e575 commit f2c287a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
20 changes: 19 additions & 1 deletion phylogenetic/defaults/config_zika.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
strain_id_field: "accession"
display_strain_field: "strain"
display_strain_field: "strain"

filter:
group_by: "country year month"
sequences_per_group: 40
min_date: 2012
min_length: 5385

refine:
coalescent: "opt"
date_inference: "marginal"
clock_filter_iqd: 4

ancestral:
inference: "joint"

traits:
columns: "region country"
sampling_bias_correction: 3
6 changes: 3 additions & 3 deletions phylogenetic/rules/annotate_phylogeny.smk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ rule ancestral:
output:
node_data = "results/nt_muts.json"
params:
inference = "joint"
inference = config["ancestral"]["inference"]
shell:
"""
augur ancestral \
Expand Down Expand Up @@ -77,8 +77,8 @@ rule traits:
output:
node_data = "results/traits.json",
params:
columns = "region country",
sampling_bias_correction = 3,
columns = config["traits"]["columns"],
sampling_bias_correction = config["traits"]["sampling_bias_correction"],
strain_id = config.get("strain_id_field", "strain"),
shell:
"""
Expand Down
6 changes: 3 additions & 3 deletions phylogenetic/rules/construct_phylogeny.smk
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ rule refine:
tree = "results/tree.nwk",
node_data = "results/branch_lengths.json"
params:
coalescent = "opt",
date_inference = "marginal",
clock_filter_iqd = 4,
coalescent = config["refine"]["coalescent"],
date_inference = config["refine"]["date_inference"],
clock_filter_iqd = config["refine"]["clock_filter_iqd"],
strain_id = config.get("strain_id_field", "strain"),
shell:
"""
Expand Down
8 changes: 4 additions & 4 deletions phylogenetic/rules/prepare_sequences.smk
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ rule filter:
output:
sequences = "results/filtered.fasta"
params:
group_by = "country year month",
sequences_per_group = 40,
min_date = 2012,
min_length = 5385,
group_by = config["filter"]["group_by"],
sequences_per_group = config["filter"]["sequences_per_group"],
min_date = config["filter"]["min_date"],
min_length = config["filter"]["min_length"],
strain_id = config.get("strain_id_field", "strain"),
shell:
"""
Expand Down

0 comments on commit f2c287a

Please sign in to comment.