– Henri E. Bal , Jennifer G. Steiner , Andrew S. Tanenbaum. Programming languages for distributed computing systems (1989) “Dataflow variables are spectacularly expressive in concurrent programming when compared to explicit synchronisation”
CONTROL STATEMENTS for(
int
i=0,n=10;
i
..
}
! list
=
[1,2,3]
for(
x
:
list
)
{
print
x
}
! list.each
{
print
it
}
! map.each
{
k,
v
-‐>
println
"$k
contains
$v"
}
HOW READ IT process
sayHello
{
!
input:
val
str
!
output:
stdout
into
result
!
"""
echo
$str
world!
"""
}
! str
=
Channel.from('hello',
'hola',
'bonjour',
'ciao') result.subscribe
{
print
it
}
PROCESS INPUTS input:
val
x
from
ch_1
file
y
from
ch_2
file
'data.fa'
from
ch_3
stdin
from
from
ch_4
set
(x,
'file.txt')
from
ch_5 process
procName
{
! ! ! ! ! ! ! ! !
"""
PIPELINES PARAMETERS params.p1
=
'alpha'
params.p2
=
'beta'
: Simply declares some variables prefixed by params When launching your script you can override
the default values $
nextflow
-‐-‐p1
'delta'
-‐-‐p2
'gamma'
COLLECT FILE The operator collectFile allows to gather
items produced by upstream processes my_items.collectFile(storeDir:'path/name')
{
!
def
key
=
getKeyByItem(it)
def
content
=
getContentByItem(it)
[
key,
content
]
! } Collect the items and group them into files
USING THE CLUSTER //
default
properties
for
any
process
process.executor
=
'sge'
process.queue
=
'short'
process.clusterOptions
=
'-‐pe
smp
2'
process.scratch
=
true
! //
specific
process
settings
process.$procName.queue
=
'long'
process.$procName.clusterOptions
=
'-‐l
h_rt=12:00:0'
! //
set
the
max
number
SGE
jobs
executor.$sge.queueSize
=
100 Simply define the SGE executor in nextflow.config