From bc1c957346f36729327007107e6e44a178dd0bf6 Mon Sep 17 00:00:00 2001 From: Jover Lee Date: Tue, 13 Feb 2024 16:23:38 -0800 Subject: [PATCH] phylo: Make `auspice_name` config optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If `auspice_name` param is not provided, then the workflow will use the required `build_name` as the default Auspice filename. Ensures that we are following the Nextstrain Snakemake style guide for configs¹ by not accessing configs with `config.get(key)`. ¹ https://docs.nextstrain.org/en/latest/reference/snakemake-style-guide.html#access-config-values-appropriately --- phylogenetic/Snakefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/phylogenetic/Snakefile b/phylogenetic/Snakefile index d5c3e2d..19cce10 100644 --- a/phylogenetic/Snakefile +++ b/phylogenetic/Snakefile @@ -16,14 +16,12 @@ if not config: build_dir = "results" - - auspice_dir = "auspice" prefix = config.get("auspice_prefix", None) AUSPICE_PREFIX = ("trial_" + prefix + "_") if prefix is not None else "" -AUSPICE_FILENAME = AUSPICE_PREFIX + config.get("auspice_name") - +# Defaults to the `build_name` if no `auspice_name` is provided in the config +AUSPICE_FILENAME = AUSPICE_PREFIX + config.get("auspice_name", config["build_name"]) rule all: input: