I have a problem when I try to provide the --rerun-triggers flag as a bash variable.
My command is
snakemake $snakemake_extra -pr --snakefile Snakefile --configfile config.yaml -c 20 -n
and snakemake_extra is a bash variable defined as
snakemake_extra="--rerun-triggers {mtime,input,params}"
I get the following error:
snakemake: error: argument --rerun-triggers: invalid choice: '{mtime,input,params}' (choose from 'mtime', 'params', 'input', 'software-env', 'code')
The problem seems to be that snakemake(?) adds single-quotes before and after the {}.
When I insert the --rerun-triggers flag directly (without bash variable) it works fine. I need the bash variable however and can also not use a snakemake profile yaml.
Is there any possible workaround?
I am using snakemake version 7.12.1.
Thanx, Carlus
Bash expands the braces when you provide them on the command line without embedding them in a variable, but it won't otherwise (see, for example, Brace expansion from a variable in Bash). A fix is to expand your variable before using it:
snakemake_extra="--rerun-triggers mtime input params"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With