feat: simple test workflow
This commit is contained in:
52
test/main.nf
Normal file
52
test/main.nf
Normal file
@@ -0,0 +1,52 @@
|
||||
params.str = "Hello, world!"
|
||||
|
||||
process split {
|
||||
publishDir "results/lower"
|
||||
|
||||
input:
|
||||
val x
|
||||
|
||||
output:
|
||||
path 'chunk_*'
|
||||
|
||||
script:
|
||||
"""
|
||||
printf '${x}' | split -b 6 - chunk_
|
||||
"""
|
||||
}
|
||||
|
||||
process to_upper {
|
||||
tag "$y"
|
||||
|
||||
input:
|
||||
path y
|
||||
|
||||
output:
|
||||
path 'upper_*'
|
||||
|
||||
script:
|
||||
"""
|
||||
cat $y | tr '[a-z]' '[A-Z]' > upper_${y}
|
||||
"""
|
||||
}
|
||||
|
||||
workflow {
|
||||
main:
|
||||
ch_str = channel.of(params.str)
|
||||
ch_chunks = split(ch_str)
|
||||
ch_upper = to_upper(ch_chunks.flatten())
|
||||
|
||||
publish:
|
||||
lower = ch_chunks.flatten()
|
||||
upper = ch_upper
|
||||
}
|
||||
|
||||
output {
|
||||
lower {
|
||||
path 'lower'
|
||||
}
|
||||
|
||||
upper {
|
||||
path 'upper'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user