-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.nf
90 lines (67 loc) · 1.83 KB
/
main.nf
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env nextflow
/*
========================================================================================
Hello Nextflow Pipeline
========================================================================================
eipm/hello-nextflow
@Homepage / Documentation
https://github.com/eipm/hello-nextflow
----------------------------------------------------------------------------------------
*/
import java.nio.file.Files
import java.nio.file.Paths
def final_output_file = 'All.txt'
italian = Channel.from 'Ciao'
french = Channel.from 'Bonjour'
english = Channel.from 'Hello'
spanish = Channel.from 'Hola'
start = Channel.fromPath 'welcome.txt'
if (new File(final_output_file).exists())
new File(final_output_file).delete()
process sayHelloInItalian {
input:
val (x) from italian
path (previous_file) from start
val (output) from 'italian.txt'
output:
path('italian.txt') into italian_ch
shell:
template 'hello.sh'
}
process sayHelloInFrench {
input:
val (x) from french
path (previous_file) from italian_ch
val (output) from 'french.txt'
output:
path('french.txt') into french_ch
shell:
template 'hello.sh'
}
process sayHelloInSpanish {
input:
val (x) from spanish
path (previous_file) from french_ch
val (output) from 'spanish.txt'
output:
path('spanish.txt') into spanish_ch
shell:
template 'hello.sh'
}
process sayHelloInEnglish {
input:
val (x) from english
path (previous_file) from spanish_ch
val (output) from 'english.txt'
output:
path('english.txt') into english_ch
shell:
template 'hello.sh'
}
english_ch.subscribe { file ->
Files.copy(Paths.get(file.toString()), Paths.get(final_output_file))
}
workflow.onComplete {
log.info "EIPM says:"
log.info new File(final_output_file).text
}