remove cpu restrictions (#760)

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
This commit is contained in:
Ramprasad Neethiraj 2021-09-30 10:26:52 +02:00 committed by GitHub
parent 22ec5c6007
commit 216dc8c984
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 17 deletions

View file

@ -29,7 +29,6 @@ process BOWTIE_ALIGN {
tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq
script: script:
def split_cpus = Math.floor(task.cpus/2)
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped.fastq" : '' def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped.fastq" : ''
@ -37,7 +36,7 @@ process BOWTIE_ALIGN {
""" """
INDEX=`find -L ./ -name "*.3.ebwt" | sed 's/.3.ebwt//'` INDEX=`find -L ./ -name "*.3.ebwt" | sed 's/.3.ebwt//'`
bowtie \\ bowtie \\
--threads ${split_cpus} \\ --threads $task.cpus \\
--sam \\ --sam \\
-x \$INDEX \\ -x \$INDEX \\
-q \\ -q \\
@ -45,7 +44,7 @@ process BOWTIE_ALIGN {
$options.args \\ $options.args \\
$endedness \\ $endedness \\
2> ${prefix}.out \\ 2> ${prefix}.out \\
| samtools view $options.args2 -@ ${split_cpus} -bS -o ${prefix}.bam - | samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam -
if [ -f ${prefix}.unmapped.fastq ]; then if [ -f ${prefix}.unmapped.fastq ]; then
gzip ${prefix}.unmapped.fastq gzip ${prefix}.unmapped.fastq

View file

@ -29,7 +29,6 @@ process BOWTIE2_ALIGN {
tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq tuple val(meta), path('*fastq.gz'), optional:true, emit: fastq
script: script:
def split_cpus = Math.floor(task.cpus/2)
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
if (meta.single_end) { if (meta.single_end) {
@ -39,11 +38,11 @@ process BOWTIE2_ALIGN {
bowtie2 \\ bowtie2 \\
-x \$INDEX \\ -x \$INDEX \\
-U $reads \\ -U $reads \\
--threads $split_cpus \\ --threads $task.cpus \\
$unaligned \\ $unaligned \\
$options.args \\ $options.args \\
2> ${prefix}.bowtie2.log \\ 2> ${prefix}.bowtie2.log \\
| samtools view -@ ${split_cpus} $options.args2 -bhS -o ${prefix}.bam - | samtools view -@ $task.cpus $options.args2 -bhS -o ${prefix}.bam -
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}: ${getProcessName(task.process)}:
@ -60,11 +59,11 @@ process BOWTIE2_ALIGN {
-x \$INDEX \\ -x \$INDEX \\
-1 ${reads[0]} \\ -1 ${reads[0]} \\
-2 ${reads[1]} \\ -2 ${reads[1]} \\
--threads $split_cpus \\ --threads $task.cpus \\
$unaligned \\ $unaligned \\
$options.args \\ $options.args \\
2> ${prefix}.bowtie2.log \\ 2> ${prefix}.bowtie2.log \\
| samtools view -@ ${split_cpus} $options.args2 -bhS -o ${prefix}.bam - | samtools view -@ $task.cpus $options.args2 -bhS -o ${prefix}.bam -
if [ -f ${prefix}.unmapped.fastq.1.gz ]; then if [ -f ${prefix}.unmapped.fastq.1.gz ]; then
mv ${prefix}.unmapped.fastq.1.gz ${prefix}.unmapped_1.fastq.gz mv ${prefix}.unmapped.fastq.1.gz ${prefix}.unmapped_1.fastq.gz

View file

@ -27,7 +27,6 @@ process BWA_MEM {
path "versions.yml" , emit: version path "versions.yml" , emit: version
script: script:
def split_cpus = Math.floor(task.cpus/2)
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def read_group = meta.read_group ? "-R ${meta.read_group}" : "" def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
@ -37,10 +36,10 @@ process BWA_MEM {
bwa mem \\ bwa mem \\
$options.args \\ $options.args \\
$read_group \\ $read_group \\
-t $split_cpus \\ -t $task.cpus \\
\$INDEX \\ \$INDEX \\
$reads \\ $reads \\
| samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - | samtools view $options.args2 -@ $task.cpus -bhS -o ${prefix}.bam -
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}: ${getProcessName(task.process)}:

View file

@ -27,7 +27,6 @@ process BWAMEM2_MEM {
path "versions.yml" , emit: version path "versions.yml" , emit: version
script: script:
def split_cpus = Math.floor(task.cpus/2)
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def read_group = meta.read_group ? "-R ${meta.read_group}" : "" def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
@ -38,10 +37,10 @@ process BWAMEM2_MEM {
mem \\ mem \\
$options.args \\ $options.args \\
$read_group \\ $read_group \\
-t $split_cpus \\ -t $task.cpus \\
\$INDEX \\ \$INDEX \\
$reads \\ $reads \\
| samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - | samtools view $options.args2 -@ $task.cpus -bhS -o ${prefix}.bam -
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}: ${getProcessName(task.process)}:

View file

@ -27,7 +27,6 @@ process BWAMETH_ALIGN {
path "versions.yml" , emit: version path "versions.yml" , emit: version
script: script:
def split_cpus = Math.floor(task.cpus/2)
def software = getSoftwareName(task.process) def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def read_group = meta.read_group ? "-R ${meta.read_group}" : "" def read_group = meta.read_group ? "-R ${meta.read_group}" : ""
@ -37,10 +36,10 @@ process BWAMETH_ALIGN {
bwameth.py \\ bwameth.py \\
$options.args \\ $options.args \\
$read_group \\ $read_group \\
-t ${split_cpus} \\ -t $task.cpus \\
--reference \$INDEX \\ --reference \$INDEX \\
$reads \\ $reads \\
| samtools view $options.args2 -@ ${split_cpus} -bhS -o ${prefix}.bam - | samtools view $options.args2 -@ $task.cpus -bhS -o ${prefix}.bam -
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}: ${getProcessName(task.process)}: