-
Notifications
You must be signed in to change notification settings - Fork 776
Description
New feature
I'm not sure whether to classify this as a feature request or bug.
The issue is that params configuration from custom configs (-c) appears to be read in after nextflow.config.
The docs describe that params provided in a custom config have a higher priority than those in the nextflow.config. This is true at the time of running the workflow, but not when parsing and evaluating the conditions in the Nextflow config.
For example:
main.nf:
#! /usr/bin/env nextflow
nextflow.enable.dsl = 2
workflow {
FOO()
}
process FOO {
output:
path 'myfile.txt'
script:
"""
touch myfile.txt
"""
}nextflow.config:
params.outdir = 'results'
process {
withName: 'FOO' {
publishDir = "$params.outdir/foo"
}
}If one runs:
$ nextflow run main.nf --outdir '/my/new/path'or
$ cat params.yml
outdir : '/my/new/path'
$ nextflow run main.nf -params-file params.ymlThen the publishDir is correctly set.
However, if one uses
$ cat custom.config
params.outdir = '/my/new/path'
$ nextflow run main.nf -c custom.configThen the publishDir is not correct, instead using the default value.
Usage scenario
Lot's of Nextflow users currently provide custom params via the -c option, not realizing it is not applying to configuration in the nextflow.config.
Suggest implementation
Perhaps read in any custom configs in the order described by the docs before and implement the configuration evaluation in such a way that if the keys are already present, don't override them.