I am using a workflow profile saved in profiles/default/config.yaml
to define default values for my snakemake command line arguments. I use conda to manage my environments, and so my snakemake calls usually include
snakemake --use-conda --conda-prefix='path.to.conda.envs'
In my config.yaml
I can define the --conda-prefix
parameter, but the --use-conda
parameter is just a flag with no value. How does one define that in the YAML? The YAML takes key:value
inputs and translates those into --key=value
. I have not been able to find a way to input key
and have it return just --key
. For example, in my config.yaml
:
# `--conda-prefix` works, since this is a traditional key:value pair
conda-prefix: 'path.to.conda.envs'
# None of these variations work to define `--use-conda`
use-conda: TRUE ##Does not work because `--use-conda=TRUE` is not valid
use-conda: ~ ##This does not produce an error, but it does not pass `--use-conda` correctly and conda is not used
use-conda ##Is not valid YAML syntax
Is there a way to do this, or do I just have to always specify --use-conda
in the command line?
You want:
use-conda: true
It has to be lower case. You might think it would be use-conda: True
because we have to use True
and False
in Python code, but in YAML it's all lowercase. Any other variant like TRUE
is treated as a string.