From f111755d128ee4c8d77fba5044553fb10eaf165b Mon Sep 17 00:00:00 2001 From: Neil Horner Date: Thu, 18 Jan 2024 19:40:14 +0000 Subject: [PATCH] Resolve CW-3327 "Mapping 1 thread" --- CHANGELOG.md | 4 ++++ subworkflows/reference_assembly.nf | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb760b9..bc987a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Fixed +- Mapping stage using a single thread only. + ## [v1.0.0] ### Added - Published minimap2 and pychopper results to output directory. diff --git a/subworkflows/reference_assembly.nf b/subworkflows/reference_assembly.nf index f0bd299..7ab994a 100644 --- a/subworkflows/reference_assembly.nf +++ b/subworkflows/reference_assembly.nf @@ -22,7 +22,7 @@ process map_reads{ RightShift: ${params.poly_context}, RegexEnd: "[Aa]{${params.max_poly_run},}", Stranded: True,Invert: True, Tsv: "internal_priming_fail.tsv"} """ - def mm2_threads = Math.min(task.cpus - 3, 1) + def mm2_threads = Math.max(task.cpus - 3, 1) """ minimap2 -t ${mm2_threads} -ax splice ${params.minimap2_opts} ${index} ${fastq_reads}\ | samtools view -q ${params.minimum_mapping_quality} -F 2304 -Sb -\