You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had the hypothesis that nextflow.config is file always meant to be used to specify the parameters declaratively, rather than a sophisticated programming logic in there.
To test this, modified the script a little bit and added the evaluation part to the main.nf as well, as shown below.
params {
nested.foo =true
nested.bar = nested.foo ?"nested foo is true":"nested foo is false"
}
The results for the command invocation were
(base) bash-5.0$ nextflow run main.nf --nested.foo false --foo false
N E X T F L O W ~ version 21.04.2
Launching `main.nf` [ecstatic_fourier] - revision: 1edf06339b
nested.foo: false - nested.bar: nested foo is true
nested.foo: false - derived_nested_bar: nested.foo is false // <-- As expected
I imagine that the reason this happens is because, the nextflow.config file goes through a parsing process to convert it into Groovy classes (Nextflow is a Groovy DSL) and the config file parser does not cater to sophisticated logic within that file.
That logic works perfectly fine once it is expressed into a xyz.nf` i.e. nextflow file which takes care of those derivations.
Oddly, the return value is as expected if line order is switched in config file:
To me, the aforementioned observation is troubling and unexpected 😶
Bug report
Expected behavior and actual behavior
Evaluating a nested parameter in
nextflow.config
does not return the user-specified value.Steps to reproduce the problem
nextflow.config:
main.nf:
Program output
nextflow run main.nf --nested.foo false --foo false
Oddly, the return value is as expected if line order is switched in config file:
nextflow.config:
Environment
The text was updated successfully, but these errors were encountered: