I am trying to pass in a parameter to Nextflow that I can use to turn a process on or off, to no avail.
Moreover, when I print the parameter in the log file the case always changes, which seems odd to me (i.e., TRUE turns to true). I have tried setting the conditional statement to match "TRUE" or "true", given this behavior, but neither seems to work.
Here is some code to illustrate the issue.
params.force = "FALSE"
params.in = 1
log.info """\
Force: $params.force
"""
.stripIndent()
process tester {
input:
val x from params.in
output:
stdout testerOut
when:
params.force == "TRUE"
script:
"""
echo "foo"
"""
}
testerOut.view()
If this file is saved as testnf and is run via "nextflow run testnf --force "TRUE" " the process will not run. The output is:
N E X T F L O W ~ version 21.10.0
Launching testnf [soggy_lorenz] - revision: a7399aad3c
Force: true
[- ] process > tester -
The goal is for users to pass in parameters that turn off or on certain processes. This seems like a common use case, but I am stuck. Cheers for any help!