Add threads to BWA/Samtools commands
The nextflow config increases the number of CPU with each task
prod.config
withLabel: samtools {
module = ['bioinfo/samtools-1.14']
cpus = { 6 * task.attempt }
memory = { 8.GB * task.attempt }
time = { 3.h * task.attempt }
}
withName: BWA_ALIGNMENT {
cpus = { 6 * task.attempt }
memory = { 8.GB * task.attempt }
time = { 3.d * task.attempt }
}
But the commands do no include a thread number, so only one CPU is used.
bwa mem ${reference} ${reads} 1> ${sample}_${referenceName}.sam 2> ${sample}_${referenceName}.log
samtools view -bS ${sam} > ${sample}.bam
For bwa mem it's the -t
argument, and for samtools sort it's -@
. Not sure it's possible for the other samtools tools, so no need to increase threads in the nextflow config to avoid waiting in pending for nothing.
Edited by Eden Darnige