John Salamon
Aug 28, 2024
.nf
filesmain.nf
:workflow {
}
nextflow
commandnextflow run main.nf
: N E X T F L O W ~ version 24.04
Launching `main.nf` [exotic_brenner] DSL2 - revision: 11d0d8e692
.nextflow.log
was createdwork/
directory was createdmain.nf
, just not inside the workflow definition:process EXAMPLE {
"echo hello > out.txt"
}
workflow {
EXAMPLE()
}
bash
by defaultnextflow run main.nf
: N E X T F L O W ~ version 24.04.2
Launching `main.nf` [romantic_snyder] DSL2 - revision: 5ef5ed8a25
executor > local (1)
[ee/c693f3] EXAMPLE [100%] 1 of 1 ✔
work/
:work/
└── ee
└── c693f3241dcd5e3576e575b62ce5e8
└── out.txt
work/
by inspecting the
process hash (you can see those as you run the pipeline)nextflow log
to see the log of previous executions
of your script$ nextflow log romantic_snyder -f 'process,exit,hash,duration'
EXAMPLE 0 ee/c693f3 6ms
nextflow log -l
process EXAMPLE {
input:
val msg
"echo $msg > out.txt"
}
val
input type can be any type (string, integer,
etc)msg
is inserted into our script string
using the dollar sign: $msg
path
input type represents a file or directory
pathprocess EXAMPLE {
input:
val msg
output:
path "out.txt"
"echo $msg > out.txt"
}
"""
process EXAMPLE {
input:
val msg
output:
path "out.txt"
script:
"""
echo $msg > out.txt
"""
}
workflow {
EXAMPLE( "hello world" )
}
workflow {
ch_input = channel.value( "hello world" )
EXAMPLE( ch_input )
}
workflow {
ch_input = channel.of( "one", "two", "three" )
EXAMPLE(ch_input)
}
Let’s try adding in the view
operator and
println
function in different places…