diff --git a/CHANGELOG.md b/CHANGELOG.md index d5c45983f..f84594c35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Special thanks to the following for their contributions to the release: - [PR #1608](https://github.com/nf-core/rnaseq/pull/1608) - Bump version after release 3.21.0 - [PR #1617](https://github.com/nf-core/rnaseq/pull/1617) - Update bbmap/bbsplit module +- [PR #1621](https://github.com/nf-core/rnaseq/pull/1621) - Optimize qualimap performance with multi-threaded name sorting ## [[3.21.0](https://github.com/nf-core/rnaseq/releases/tag/3.21.0)] - 2025-09-18 diff --git a/modules/nf-core/qualimap/rnaseq/nextflow.config b/modules/nf-core/qualimap/rnaseq/nextflow.config index 2d3756d58..5c1b59423 100644 --- a/modules/nf-core/qualimap/rnaseq/nextflow.config +++ b/modules/nf-core/qualimap/rnaseq/nextflow.config @@ -1,7 +1,16 @@ if (!params.skip_qc) { if (!params.skip_qualimap) { process { + withName: 'SAMTOOLS_SORT_QUALIMAP' { + ext.args = '-n' + ext.prefix = { "${meta.id}.namesorted" } + publishDir = [ + enabled: false + ] + } + withName: 'QUALIMAP_RNASEQ' { + ext.args = '--sorted' publishDir = [ path: { "${params.outdir}/${params.aligner}/qualimap" }, mode: params.publish_dir_mode, diff --git a/tests/bam_input.nf.test.snap b/tests/bam_input.nf.test.snap index 17dfec744..388233d7d 100644 --- a/tests/bam_input.nf.test.snap +++ b/tests/bam_input.nf.test.snap @@ -1,7 +1,7 @@ { "BAM input for Salmon": { "content": [ - 139, + 144, { "BBMAP_BBSPLIT": { "bbmap": 39.18 @@ -79,6 +79,9 @@ "SAMTOOLS_INDEX": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, @@ -958,7 +961,7 @@ }, "BAM input for RSEM": { "content": [ - 138, + 143, { "BBMAP_BBSPLIT": { "bbmap": 39.18 @@ -1041,6 +1044,9 @@ "SAMTOOLS_INDEX": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, diff --git a/tests/default.nf.test.snap b/tests/default.nf.test.snap index 8571c3100..0798e8ef4 100644 --- a/tests/default.nf.test.snap +++ b/tests/default.nf.test.snap @@ -102,7 +102,7 @@ }, "Params: default": { "content": [ - 209, + 214, { "BBMAP_BBSPLIT": { "bbmap": 39.18 @@ -199,6 +199,9 @@ "SAMTOOLS_SORT": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, diff --git a/tests/featurecounts_group_type.nf.test.snap b/tests/featurecounts_group_type.nf.test.snap index 4b07d4b71..5f34e3174 100644 --- a/tests/featurecounts_group_type.nf.test.snap +++ b/tests/featurecounts_group_type.nf.test.snap @@ -102,7 +102,7 @@ }, "Params: --featurecounts_group_type false": { "content": [ - 199, + 204, { "BBMAP_BBSPLIT": { "bbmap": 39.18 @@ -196,6 +196,9 @@ "SAMTOOLS_SORT": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, diff --git a/tests/hisat2.nf.test.snap b/tests/hisat2.nf.test.snap index cf66b6527..032160724 100644 --- a/tests/hisat2.nf.test.snap +++ b/tests/hisat2.nf.test.snap @@ -103,7 +103,7 @@ }, "Params: --aligner hisat2": { "content": [ - 200, + 205, { "BBMAP_BBSPLIT": { "bbmap": 39.18 @@ -203,6 +203,9 @@ "SAMTOOLS_SORT": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, diff --git a/tests/min_mapped_reads.nf.test.snap b/tests/min_mapped_reads.nf.test.snap index 72ced7061..014c2f424 100644 --- a/tests/min_mapped_reads.nf.test.snap +++ b/tests/min_mapped_reads.nf.test.snap @@ -1,7 +1,7 @@ { "Params: --min_mapped_reads 90": { "content": [ - 163, + 166, { "BBMAP_BBSPLIT": { "bbmap": 39.18 @@ -98,6 +98,9 @@ "SAMTOOLS_SORT": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, diff --git a/tests/remove_ribo_rna.nf.test.snap b/tests/remove_ribo_rna.nf.test.snap index e2789c952..f6de3f886 100644 --- a/tests/remove_ribo_rna.nf.test.snap +++ b/tests/remove_ribo_rna.nf.test.snap @@ -1,7 +1,7 @@ { "Params: --remove_ribo_rna": { "content": [ - 220, + 225, { "BBMAP_BBSPLIT": { "bbmap": 39.18 @@ -98,6 +98,9 @@ "SAMTOOLS_SORT": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, diff --git a/tests/sentieon_default.nf.test.snap b/tests/sentieon_default.nf.test.snap index 6c9d283f5..69e433e8a 100644 --- a/tests/sentieon_default.nf.test.snap +++ b/tests/sentieon_default.nf.test.snap @@ -102,7 +102,7 @@ }, "Params: default --use_sentieon_star": { "content": [ - 209, + 214, { "BBMAP_BBSPLIT": { "bbmap": 39.18 @@ -199,6 +199,9 @@ "SAMTOOLS_SORT": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, diff --git a/tests/skip_trimming.nf.test.snap b/tests/skip_trimming.nf.test.snap index a95a80efe..e4e43d55b 100644 --- a/tests/skip_trimming.nf.test.snap +++ b/tests/skip_trimming.nf.test.snap @@ -1,7 +1,7 @@ { "Params: --skip_trimming": { "content": [ - 199, + 204, { "BBMAP_BBSPLIT": { "bbmap": 39.18 @@ -98,6 +98,9 @@ "SAMTOOLS_SORT": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, diff --git a/tests/star_rsem.nf.test.snap b/tests/star_rsem.nf.test.snap index f0f78f74f..68292fc9e 100644 --- a/tests/star_rsem.nf.test.snap +++ b/tests/star_rsem.nf.test.snap @@ -1,7 +1,7 @@ { "Params: --aligner star_rsem": { "content": [ - 207, + 212, { "BBMAP_BBSPLIT": { "bbmap": 39.18 @@ -109,6 +109,9 @@ "SAMTOOLS_SORT": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, diff --git a/tests/umi.nf.test.snap b/tests/umi.nf.test.snap index fc7524acf..8ddd1d27c 100644 --- a/tests/umi.nf.test.snap +++ b/tests/umi.nf.test.snap @@ -1,7 +1,7 @@ { "--umi_dedup_tool 'umitools'": { "content": [ - 261, + 266, { "BEDTOOLS_GENOMECOV_FW": { "bedtools": "2.31.1" @@ -92,6 +92,9 @@ "SAMTOOLS_SORT": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, @@ -1507,7 +1510,7 @@ }, "Params: --aligner hisat2 --umi_dedup_tool 'umicollapse'": { "content": [ - 194, + 199, { "BEDTOOLS_GENOMECOV_FW": { "bedtools": "2.31.1" @@ -1601,6 +1604,9 @@ "SAMTOOLS_SORT": { "samtools": 1.21 }, + "SAMTOOLS_SORT_QUALIMAP": { + "samtools": 1.21 + }, "SAMTOOLS_STATS": { "samtools": 1.21 }, diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index d3a3ded0c..4d0046e2e 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -47,6 +47,7 @@ include { MULTIQC } from '../../modules/nf-core/multiqc' include { BEDTOOLS_GENOMECOV as BEDTOOLS_GENOMECOV_FW } from '../../modules/nf-core/bedtools/genomecov' include { BEDTOOLS_GENOMECOV as BEDTOOLS_GENOMECOV_REV } from '../../modules/nf-core/bedtools/genomecov' include { SAMTOOLS_INDEX } from '../../modules/nf-core/samtools/index' +include { SAMTOOLS_SORT as SAMTOOLS_SORT_QUALIMAP } from '../../modules/nf-core/samtools/sort' // // SUBWORKFLOW: Consisting entirely of nf-core/modules @@ -539,8 +540,15 @@ workflow RNASEQ { // if (!params.skip_qc) { if (!params.skip_qualimap) { - QUALIMAP_RNASEQ ( + // Sort BAM by name for qualimap (performance optimization) + SAMTOOLS_SORT_QUALIMAP ( ch_genome_bam, + ch_fasta.map { [ [:], it ] } + ) + ch_versions = ch_versions.mix(SAMTOOLS_SORT_QUALIMAP.out.versions.first()) + + QUALIMAP_RNASEQ ( + SAMTOOLS_SORT_QUALIMAP.out.bam, ch_gtf.map { [ [:], it ] } ) ch_multiqc_files = ch_multiqc_files.mix(QUALIMAP_RNASEQ.out.results.collect{it[1]})