Skip to content

Commit

Permalink
phylo: Make auspice_name config optional
Browse files Browse the repository at this point in the history
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
  • Loading branch information
joverlee521 committed Feb 14, 2024
1 parent a32ce2a commit bc1c957
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions phylogenetic/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bc1c957

Please sign in to comment.