-
Notifications
You must be signed in to change notification settings - Fork 813
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
Open
pinin4fjords
wants to merge
3
commits into
dev
Choose a base branch
from
fix-bigwig-reverse-strand-labeling
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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