Repository navigation
Record the DESeq2 length model, guard --tag_seq, and document its measured effect - #43
Merged
Merged
Conversation
…ee_prime_tag) 3' Tag-Seq libraries (Lexogen QuantSeq and similar) yield reads in proportion to a transcript's abundance, not its length, so length correction is wrong for them. The new --library_protocol parameter (default full_length, so existing runs are unchanged) selects: - Salmon --noLengthCorrection, the option Salmon documents for QuantSeq; - DESeq2 on raw counts (tximport countsFromAbundance "no" into DESeqDataSetFromMatrix), with no average-transcript-length offsets; with --replicate_unit, raw counts are summed per unit; - fastp --trim_poly_x for reads that run into the poly(A) tail. The protocol and the length model used are recorded in the manifest and the DESeq2 design JSON; an unknown protocol stops the run. Verified natively on simulated QuantSeq-like reads from the full M. galloprovincialis transcriptome: both modes recover 59/60 simulated 4-fold changes, but for 40 genes whose expressed isoform switched to a ~2.7x longer one with no change in 3' reads, full_length calls 26 differentially expressed (|log2FC| up to 3.0) and three_prime_tag calls none. Rerunning an earlier full_length smoke run with this code gives byte-identical DESeq2 results. CI stub-runs the three_prime_tag DAG and rejects an unknown protocol; tests/test_rnaseq_protocols.py guards the wiring. Needed by TUCCI2025_HEAT_PRIMING (PRJNA1132140, draft PR #41). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hat it lacks main (#24) added a 3' Tag-seq path, --tag_seq, doing what this branch's --library_protocol three_prime_tag did (Salmon --noLengthCorrection, DESeq2 without length offsets, fastp poly-X trimming), plus dropping --gcBias for paired-end Tag-seq. #24's implementation is kept everywhere and --library_protocol is removed. What remains: - the DESeq2 design JSON records tag_seq and the length model actually fitted, so the manifest says whether fold changes carry length offsets; - tests/test_rnaseq_tag_seq.py guards the --tag_seq wiring (CI's Python job has no Nextflow, Salmon or R); - the README gains the measured consequence: on simulated QuantSeq-like reads, the standard path called 26 of 40 isoform-switch genes (no change in 3' reads) differentially expressed and --tag_seq none, re-measured with #24's code on 2026-10-12; - the oyster backlog's Tag-seq caveat points to --tag_seq. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 tasks done
sr320
added a commit
that referenced
this pull request
Oct 13, 2026
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
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.
Shrunk on 2026-10-12. This PR first added a 3′ Tag-seq mode as
--library_protocol three_prime_tag. Meanwhile #24 merged an equivalent switch,--tag_seq, which does the same three things: Salmon--noLengthCorrection, DESeq2 without length offsets, and fastp poly-X trimming. It also drops--gcBiasfor paired-end Tag-seq.mainwas merged in and #24's implementation kept everywhere, so--library_protocolis gone.What remains is what #24 lacks:
The length model is recorded. The DESeq2 design JSON, and so the manifest's
deseq2_design, now carriestag_seqand alength_modelstring:none: counts without length offsets (tag_seq);tximport average transcript length offsets;lengthScaledTPM counts summed per replicate unit(pseudo-bulk).It says whether a study's fold changes carry length offsets, which decides whether they can be compared with other studies'.
Guard tests.
tests/test_rnaseq_tag_seq.pychecks the--tag_seqwiring in fastp, Salmon, DESeq2 and the manifest. It reads the workflow source, because CI's Python job has no Nextflow, Salmon or R. CI's Nextflow job already stub-runs the--tag_seqDAG (from Support single-end and 3' Tag-seq RNA-seq, and designs from authors' tables #24).Evidence in the README. The README said length correction makes long genes look less expressed. The measured consequence is worse: it can create fold changes.
The oyster backlog's Tag-seq caveat for PRJNA913164 now points to
--tag_seq.The evidence
This was re-measured with #24's code. Both modes ran natively against six simulated QuantSeq-like single-end libraries (3 vs 3) and the full M. galloprovincialis RefSeq transcriptome. 60 genes were given a 4-fold change. Another 40 genes switch to an isoform about 2.7 times longer with no change in 3′ reads, so their true log2 fold change is 0.
length_modelin manifest--tag_seqnone: counts without length offsets (tag_seq)tximport average transcript length offsetsThe
--tag_seqrun passed--noLengthCorrectionto all 6 Salmon tasks and--trim_poly_xto all 6 fastp tasks. The standard run used neither.Verification
ruffis clean.For the clam study (#41)
Set
tag_seq = trueinconfig/TUCCI2025_HEAT_PRIMING.config. The study's registration still says the mode is unbuilt and needs updating.🤖 Generated with Claude Code