Closed mahesh-panchal closed 3 months ago
What would be a good example of setting params in a config file?
nextflow.config
:
params.outdir = 'results'
params.publish_mode = 'copy'
process.publishDir = [ path: params.outdir, mode: params.publish_mode ]
Now I want to override the params.publish_mode
, so I do -c custom.config
with:
custom.config
:
params.publish_mode = 'symlink'
However, my publishDir
still receives params.publish_mode = 'copy'
because the values are resolved immediately.
To make it work I should update the parameters instead using a -params-file params.yml
.
params.yml
:
publish_mode: 'symlink'
This now works because of how configuration priority is evaluated.
When configuring workflows, need to explain that workflow parameters should be overriden in a file params.yml and passed to
-params-file
, instead of using-c
with a custom config. There is an important distinction here since params are evaluated immediately as they are read in.