Closed jhrf closed 4 years ago
The publlishDir
should not be included within a condition statement. Use instead a conditional expression, eg.
process foo {
publishDir "${ true ? sample_id : 'baz' }", mode: "copy"
input:
file input_file
val sample_id
"""
echo "Goodbye World!"
"""
}
nextflow.log
Bug report
An if statement used to control the output directory of a process causes a process input value to be unrecognised by nextflow.
I assume what is happening is that the if statement is somehow pushing the input
val
to be moved out of scope?It should be noted that I am using DSL2
Expected behavior and actual behavior
Expected behaviour:
The if statement triggers successfully and output files are deposited to the correct directory specificed by
publishDir
Actual behaviour:
The program fails to run because the valid process input parameter cannot be found. An error is thrown.
Steps to reproduce the problem
Notice how
process bar
is successfully compiled without an if statement, but the almost identicalprocess foo
throws an error.Command line:
Program output
Environment
Additional context
None