Skip to content

Instantly share code, notes, and snippets.

@LukeGoodsell
Created August 17, 2018 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LukeGoodsell/c26232093df7f95f045508cb49f7357e to your computer and use it in GitHub Desktop.
Save LukeGoodsell/c26232093df7f95f045508cb49f7357e to your computer and use it in GitHub Desktop.
Passing input files to output channels without storing duplicates
#!/usr/bin/env nextflow
in_ch = Channel.from(file("test.txt"))
process test {
storeDir 'out/1'
stageInMode 'rellink'
stageOutMode 'move'
input:
file x from in_ch
output:
set(file("out.txt"), val(x)) into out_ch
shell:
'''
echo "hi" > out.txt
'''
}
process test2 {
storeDir 'out/2'
stageInMode 'rellink'
stageOutMode 'move'
input:
set(file(a), file(b)) from out_ch
output:
set(val(a), val(b), file("new.txt")) into out2_ch
shell:
'''
cat !{a} !{b} > new.txt
'''
}
out2_ch.subscribe { println(it) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment