John Salamon
Aug 28, 2024
lib, bin, and
templates)
lib will be loaded
in your pipelinebin can be executed in
your scriptstemplates can be executed
using script: template <script>, instead of an
in-line script.key = value syntax, and can be simplified
with config scopesnextflow.config in our project
dir to set up the resources we want to allocate:executor {
name = 'local'
cpus = 2
memory = '4 GB'
}
We can also specify our conda environment, if we
wish:
conda.enabled = true
// This is actually a per-process option, as we may have many different envs
process.conda = "assets/environment.yml"
params, and set
a defaultparams.samplesheet = 'assets/samplesheet.csv'
nextflow main.nf --samplesheet 'assets/samplesheet.csv'
fromPath can create channels
from files.view lets us see the content of a channelmap to manipulate our channel with closuressplitCsv:channel.of( file('samplesheet.csv') )
| splitCsv( header: true )
input:
tuple val(id), path(reads)
output:
tuple val(id), path('*.json'), emit: json
label 'process_low'
process {
withLabel: 'process_low' {
cpus = 1
}
}
Config options can be accessed via task:
"""
# map reads
echo "mapping reads"
minimap2 -t ${task.cpus} -a -x sr ${genome} ${reads} > ${id}.sam 2> ${id}.minimap2.log
"""
publishDir:publishDir "${params.outdir}", pattern: "*.html"