cukelarter
10/23/2026, 3:50 PMcukelarter
10/23/2026, 3:51 PMdef shouldWeRunThisProcess(config, process) {[true|false]}
workflow {
...
if shouldWeRunThisProcess(run_channel.config,"unzip_input") {
next_step_ch=UNZIP_INPUT(run_channel)
} else {
next_step_ch=run_channel
}
}Niklas Schandry
10/23/2026, 4:06 PMNiklas Schandry
10/23/2026, 4:07 PMparams
if params.someparam { SOMEPROCESS(channel) }
Which controls at the pipelinelevelNiklas Schandry
10/23/2026, 4:11 PMinput:
tuple meta, file
output: meta, "${meta.id}.fa"
...
def cmd = file.endsWith(".gz") ? "gunzip $file > ${meta.id}.fa" : "mv $file ${meta.id}.fa"
script:
"""
$cmd
"""Niklas Schandry
10/23/2026, 4:15 PMinputs = run_channel.branch{it ->
unzip: it[fileidx].endsWith('gz')
nozip: true }
UNZIP(inputs.unzip)
prepared_inputs = inputs.nozip.mix(UNZIP.out) // depends if those are compatible or need some transformationMaxime Garcia
10/23/2026, 4:19 PMNiklas Schandry
10/23/2026, 4:20 PMcukelarter
10/23/2026, 4:31 PM