-
Notifications
You must be signed in to change notification settings - Fork 825
Fix bigwig strand labeling for reverse-stranded libraries #1620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
FloWuenne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not familiar with this particular setting but tests pass and LGTM 🚀
|
Warning Newer version of the nf-core template is available. Your pipeline is using an old version of the nf-core template: 3.4.1. For more documentation on how to update your pipeline, please see the nf-core documentation and Synchronisation documentation. |
|
Thanks @FloWuenne ! |
Summary
Fixes #1591 - Corrects mislabeled bigwig files for reverse-stranded (dUTP) libraries where forward and reverse strand signals were inverted in the final output files.
Background
For reverse-stranded libraries, reads align to the opposite strand of the genes they represent:
This is due to the dUTP library preparation method where the second strand synthesis incorporates dUTPs, which are later degraded, preserving only the strand opposite to the original RNA.
The Problem
The pipeline was always using:
BEDTOOLS_GENOMECOV_FWwith-strand +→ output labeled as.forward.bigWigBEDTOOLS_GENOMECOV_REVwith-strand -→ output labeled as.reverse.bigWigThis is correct for forward-stranded and unstranded libraries, but produces inverted labels for reverse-stranded libraries:
.forward.bigWigcontained coverage from reads on the+strand, which represent-strand genes ❌.reverse.bigWigcontained coverage from reads on the-strand, which represent+strand genes ❌This caused the bigwig tracks to appear inverted when visualized in IGV or other genome browsers.
The Solution
Made the
-strandparameter conditional onmeta.strandednessin the nextflow config:For reverse-stranded libraries:
BEDTOOLS_GENOMECOV_FWnow uses-strand -(captures forward genes) ✓BEDTOOLS_GENOMECOV_REVnow uses-strand +(captures reverse genes) ✓For other library types:
-strand +and-strand -respectively)This ensures:
.forward.bigWigalways contains coverage of forward (+) strand genes.reverse.bigWigalways contains coverage of reverse (-) strand genes...regardless of library preparation method.
Changes
workflows/rnaseq/nextflow.configto makeext.argsconditional for bothBEDTOOLS_GENOMECOV_FWandBEDTOOLS_GENOMECOV_REVprocessesTest Plan
🤖 Generated with Claude Code