-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscatter-gather-dsl2.nf
More file actions
45 lines (33 loc) · 994 Bytes
/
Copy pathscatter-gather-dsl2.nf
File metadata and controls
45 lines (33 loc) · 994 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env nextflow
nextflow.preview.dsl=2
dict_file = file("${params.dict}")
process test {
input:
tuple val(group_name), val(groupdetail), val(sampleId)
output:
tuple val(sampleId), path("${sampleId}_${group_name}.file.txt")
script:
groupdetail_trimmed = groupdetail.trim().split().join(" -L ")
"""
echo "${groupdetail_trimmed}" > "${sampleId}_${group_name}.file.txt"
"""
}
process collectFilesBySample {
echo "true"
input:
tuple val(sampleId), path(myfiles)
output:
path("${sampleId}_final_report.txt")
script:
files_to_print = myfiles.join("\n")
"""
echo "${files_to_print}" > "${sampleId}_final_report.txt"
"""
}
workflow {
mydata = channel.fromPath(dict_file).splitText().map{ line ->[ line.tokenize(':')[0], line ] }
//mydata.combine(channel.from("A","B","C")).view()
test(mydata.combine(channel.from("A","B","C")))
collectFilesBySample(test.out.groupTuple())
//test.out.groupTuple().view()
}