From 4b207bff708a002968f6c59958125b5f84be5f6a Mon Sep 17 00:00:00 2001 From: Kim Andrews <17375001+kimandrews@users.noreply.github.com> Date: Thu, 11 Jan 2024 16:04:17 -0800 Subject: [PATCH] Use a config file to define hardcoded parameters --- Snakefile | 18 ++++++++++-------- config/config.yaml | 11 +++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 config/config.yaml diff --git a/Snakefile b/Snakefile index 92432a1..27ae188 100644 --- a/Snakefile +++ b/Snakefile @@ -1,3 +1,5 @@ +configfile: "config/config.yaml" + rule all: input: auspice_json = "auspice/measles.json", @@ -55,10 +57,10 @@ rule filter: output: sequences = "results/filtered.fasta" params: - group_by = "country year month", - sequences_per_group = 20, - min_date = 1950, - min_length = 5000 + 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"] shell: """ augur filter \ @@ -121,9 +123,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"] shell: """ augur refine \ @@ -147,7 +149,7 @@ rule ancestral: output: node_data = "results/nt_muts.json" params: - inference = "joint" + inference = config["ancestral"]["inference"] shell: """ augur ancestral \ diff --git a/config/config.yaml b/config/config.yaml new file mode 100644 index 0000000..18a2a05 --- /dev/null +++ b/config/config.yaml @@ -0,0 +1,11 @@ +filter: + group_by: "country year month" + sequences_per_group: 20 + min_date: 1950 + min_length: 5000 +refine: + coalescent: "opt" + date_inference: "marginal" + clock_filter_iqd: 4 +ancestral: + inference: "joint" \ No newline at end of file