From 7dd436ca470dd232bb527e41f96373cf13994d98 Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Fri, 14 Nov 2025 10:49:57 +0000 Subject: [PATCH 1/3] Fix bigwig strand labeling for reverse-stranded libraries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes mislabeled bigwig files for reverse-stranded (dUTP) libraries where forward and reverse strand signals were inverted in the final output files. For reverse-stranded libraries, reads align to the opposite strand of the genes they represent: - Forward (+) genes have reads on the reverse (-) strand - Reverse (-) genes have reads on the forward (+) strand The pipeline was always using `-strand +` for BEDTOOLS_GENOMECOV_FW and `-strand -` for BEDTOOLS_GENOMECOV_REV, regardless of library strandedness. This is correct for forward-stranded and unstranded libraries, but produces inverted labels for reverse-stranded libraries. This fix makes the `-strand` parameter conditional on meta.strandedness: - For reverse-stranded libraries: swaps the strand parameters so that BEDTOOLS_GENOMECOV_FW uses `-strand -` and BEDTOOLS_GENOMECOV_REV uses `-strand +` - For other library types: uses the original parameters This ensures .forward.bigWig always contains coverage of forward (+) strand genes and .reverse.bigWig always contains coverage of reverse (-) strand genes, regardless of library preparation method. Fixes #1591 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- workflows/rnaseq/nextflow.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflows/rnaseq/nextflow.config b/workflows/rnaseq/nextflow.config index 7bd96fc31..84c945cd9 100644 --- a/workflows/rnaseq/nextflow.config +++ b/workflows/rnaseq/nextflow.config @@ -335,7 +335,7 @@ if (!params.skip_bigwig) { process { withName: 'BEDTOOLS_GENOMECOV_FW' { ext.prefix = { meta.strandedness == 'reverse' ? meta.id + '.reverse' : meta.id + '.forward' } - ext.args = '-split -du -strand + -bg' + ext.args = { meta.strandedness == 'reverse' ? '-split -du -strand - -bg' : '-split -du -strand + -bg' } publishDir = [ enabled: false ] @@ -343,7 +343,7 @@ if (!params.skip_bigwig) { withName: 'BEDTOOLS_GENOMECOV_REV' { ext.prefix = { meta.strandedness == 'reverse' ? meta.id + '.forward' : meta.id + '.reverse' } - ext.args = '-split -du -strand - -bg' + ext.args = { meta.strandedness == 'reverse' ? '-split -du -strand + -bg' : '-split -du -strand - -bg' } publishDir = [ enabled: false ] From 8267cc89296a18d46875347fa4ae4ea8c1e0a26e Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Fri, 14 Nov 2025 10:52:43 +0000 Subject: [PATCH 2/3] Update CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5c45983f..c3ec4abac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Special thanks to the following for their contributions to the release: - [Elad Herzog](https://github.com/EladH1) +- [Emily Miyoshi](https://github.com/emilymiyoshi) ### Enhancements and fixes - [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 #1620](https://github.com/nf-core/rnaseq/pull/1620) - Fix bigwig strand labeling for reverse-stranded libraries ([#1591](https://github.com/nf-core/rnaseq/issues/1591)) ## [[3.21.0](https://github.com/nf-core/rnaseq/releases/tag/3.21.0)] - 2025-09-18 From fbf71f8d5bc7069c2528cacfbc09aa950cc3de3d Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Fri, 14 Nov 2025 11:01:18 +0000 Subject: [PATCH 3/3] Add comment about conditional strand parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- workflows/rnaseq/main.nf | 1 + 1 file changed, 1 insertion(+) diff --git a/workflows/rnaseq/main.nf b/workflows/rnaseq/main.nf index d3a3ded0c..90bf218c3 100755 --- a/workflows/rnaseq/main.nf +++ b/workflows/rnaseq/main.nf @@ -499,6 +499,7 @@ workflow RNASEQ { // // MODULE: Genome-wide coverage with BEDTools + // Note: Strand parameters are conditional on library strandedness (see nextflow.config) // if (!params.skip_bigwig) {