-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.nf
48 lines (34 loc) · 767 Bytes
/
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
include { newInstance as Madrid } from './source/Madrid.groovy'
madrid = Madrid()
process emitStation{
maxForks 10
input:
val item
output:
path 'estacion.txt'
script:
"echo '${madrid.transformItem(item)}' > estacion.txt"
}
process echoStation{
maxForks 10
input:
file estacion
output:
stdout
script:
"echo '${madrid.estacionToString(estacion)}'"
}
params.max = -1
workflow {
ch = Channel.fromList( madrid.downloadXml() )
ch.subscribe( onNext:{ item->
madrid.measureItem(item)
item
}, onComplete:{
println "The mean of intensidadSat is $madrid.mean"
})
ch.take(params.max) \
| filter{ it.descripcion } \
| emitStation \
| echoStation
}