-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdsl2-Join.nf
More file actions
31 lines (22 loc) · 793 Bytes
/
dsl2-Join.nf
File metadata and controls
31 lines (22 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Simple example of channel wrangling in DSL 2; join two channels.
process processB {
input: tuple val(sampleid), val(yval)
output: tuple val(sampleid), path('*.txt'), emit: txt
shell: 'echo !{yval} > !{sampleid}-!{yval}.txt'
}
process processA {
input: tuple val(sampleid), val(xval)
output: tuple val(sampleid), path('*.txt'), emit: txt
shell: 'echo !{xval} > !{sampleid}-!{xval}.txt'
}
process processAB {
publishDir 'tstAB', mode: 'copy'
input: tuple val(sampleid), path(a), path(b)
output: path('*.txt')
shell: 'cat !{a} !{b} > AB!{sampleid}.txt'
}
workflow {
processA ( Channel.of(['X', 'donkey'], ['Y', 'horse'] ))
processB ( Channel.of(['X', 'diligent'], ['Y', 'hoarse'] ))
processAB( processA.out.txt.join( processB.out.txt ).view() )
}