add nextflow d30e48d
This commit is contained in:
46
nextflow/docs/snippets/recurse-workflow.nf
Normal file
46
nextflow/docs/snippets/recurse-workflow.nf
Normal file
@@ -0,0 +1,46 @@
|
||||
nextflow.preview.recursion = true
|
||||
|
||||
params.input = "recurse-workflow.in"
|
||||
|
||||
workflow {
|
||||
clock
|
||||
.recurse(file(params.input))
|
||||
.until { file -> file.size() > 64 }
|
||||
.view { file -> file.text }
|
||||
}
|
||||
|
||||
workflow clock {
|
||||
take:
|
||||
logfile
|
||||
|
||||
emit:
|
||||
tock(tick(logfile))
|
||||
}
|
||||
|
||||
process tick {
|
||||
input:
|
||||
path 'input.txt'
|
||||
|
||||
output:
|
||||
path 'result.txt'
|
||||
|
||||
script:
|
||||
"""
|
||||
cat input.txt > result.txt
|
||||
echo "Task ${task.index} : tick" >> result.txt
|
||||
"""
|
||||
}
|
||||
|
||||
process tock {
|
||||
input:
|
||||
path 'input.txt'
|
||||
|
||||
output:
|
||||
path 'result.txt'
|
||||
|
||||
script:
|
||||
"""
|
||||
cat input.txt > result.txt
|
||||
echo "Task ${task.index} : tock" >> result.txt
|
||||
"""
|
||||
}
|
||||
Reference in New Issue
Block a user