I have snakemake command line with configuration options like this:
snakemake --config \
f1=$PWD/file1.txt \
f2=$PWD/file2.txt \
f3=/path/to/file3.txt \
...more key-value pairs \
--directory /path/to/output/dir
file1.txt
and file2.txt
are expected to be in the same directory as the snakefile, file3.txt
is somewhere else. I need the paths to files to be absolute, hence the $PWD
variable, so Snakemake can find the files after moving to /path/to/output/dir
.
Because I start having several configuration options, I would like to move all the --config
items to a separate yaml configuration file. The problem is: How do I transfer the variable $PWD
to a configuration file?
I could have a dummy string in the yaml file indicating that that string is to be replaced by the directory where the Snakefile is (e.g. f1: <replace me>/file1.txt
) but I feel it's awkward. Any better ideas? It may be that I should rethink how the files fileX.txt
are passed to snakemake...