Skip to content

Support single-end and 3' Tag-seq RNA-seq, and designs from authors' tables - #24

Merged
sr320 merged 2 commits into
mainfrom
workflow/tagseq-single-end
Oct 12, 2026
Merged

sr320 merged 2 commits into
mainfrom
workflow/tagseq-single-end

Conversation

@sr320

@sr320 sr320 commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Adds what PRJNA913164 (George et al. 2023, 72 single-end QuantSeq 3′ libraries) needs, as a separate code PR per docs/parallel_study_runs.md.

RNA-seq workflow

  • --single_end: one FASTQ per sample (fromFilePairs(size: 1)). fastp, Salmon (-r) and the optional viral QC switch to their single-end forms.

  • --tag_seq: for 3′ tag libraries, which give about one read per transcript. It changes three steps:

    Step Standard RNA-seq With --tag_seq
    fastp adapter trimming also --trim_poly_x
    Salmon --gcBias --noLengthCorrection, no --gcBias
    DESeq2 from tximport, with length offsets DESeqDataSetFromMatrix on counts, no length offset; pseudo-bulk sums raw counts
  • Both flags are recorded in the workflow manifest's parameters. CI also runs the raw DAG single-end with --tag_seq under -stub-run.

aree fetch-samplesheet

  • --design-table / --design-join / --design-source: for deposits whose BioSamples carry no design, only an isolate code. The study commits the authors' table and it is joined on a shared attribute. Every sample must match exactly one row and every row a sample. The table's sha256 and source are written to ena_provenance.json.

Testing

  • pytest: 273 passed (3 new design-table tests); ruff: clean.
  • Local stub runs pass for both raw DAGs: paired-end with viral QC and an exclusion, and single-end with --tag_seq.
  • Real data: used for the full-depth run of all 72 libraries on sr320/AREE#18, with 222/222 tasks plus 3 cached reruns. The run checks out three ways:
    • the manifest records single_end: true, tag_seq: true;
    • Salmon ran -r … --noLengthCorrection, and DESeq2 logged that it used counts without length offsets;
    • fold-change direction agrees with the authors' published DEG lists for 88–97% of their genes, and for 99.3–99.8% of genes significant in both analyses.

Notes for the reviewer

  • Footgun, not fixed here: if a study config sets params.rnaseq.comparison_id, it silently beats --comparison_id on the command line. The workflow resolves params.rnaseq?.comparison_id ?: params.comparison_id, so every override run gets filed under the config's id. This bit [study] GEORGE2023_HEATWAVE_PLOIDY (PRJNA913164) #18's first attempt; the manifest's recorded arms caught it. Study configs that run several comparisons should leave rnaseq.comparison_id null. A guard probably belongs in its own PR.
  • Possible conflict: this touches modules/rnaseq/emit_manifest.nf (two new parameters keys), as does the in-progress manifest software-versions fix.

Waiting study branch to rebase after merge: study/PRJNA913164/GEORGE2023_HEATWAVE_PLOIDY (sr320/AREE#18).

🤖 Generated with Claude Code

…tables

rnaseq workflow:
- --single_end: one FASTQ per sample (fromFilePairs size 1); fastp, Salmon
  (-r) and viral QC use their single-end forms.
- --tag_seq: for QuantSeq-style 3' tag libraries, which give ~one read per
  transcript. fastp adds --trim_poly_x; Salmon uses --noLengthCorrection and
  drops --gcBias; DESeq2 builds from counts with no tximport length offset
  (pseudo-bulk sums raw counts instead of length-scaled ones).
- Both flags are recorded in the workflow manifest's parameters, and CI runs
  the raw DAG single-end with --tag_seq under -stub-run.

aree fetch-samplesheet:
- --design-table / --design-join / --design-source: for deposits whose
  BioSamples carry no design (only an isolate code), join a committed table
  (e.g. the authors' submission sheet) on a shared attribute. Every sample
  must match exactly one row and every row a sample; the table's sha256 and
  source are recorded in ena_provenance.json.

Needed by study/PRJNA913164/GEORGE2023_HEATWAVE_PLOIDY (72 single-end
QuantSeq libraries; treatment and ploidy only in the authors' NCBI sheet).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main gained its own single-end support (#25, with --se_adapter) and DESeq2
--covariates (#27) while this branch was open. Conflicts resolved by taking
main's implementation of both and re-applying only what this branch adds:

- --tag_seq: fastp --trim_poly_x; Salmon --noLengthCorrection and no
  --gcBias; DESeq2 from counts without tximport length offsets (pseudo-bulk
  sums raw counts); recorded in the manifest's parameters.
- fetch-samplesheet --design-table / --design-join / --design-source
  (merged cleanly).
- CI: a single-end --tag_seq stub step on main's single-end fixtures.
- README: a Tag-seq section, including a poly-A check for telling QuantSeq
  from full-length libraries.

This branch's own single_end implementation is dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sr320
sr320 merged commit fc9eee4 into main Oct 12, 2026
6 checks passed
@sr320
sr320 deleted the workflow/tagseq-single-end branch October 12, 2026 23:44
sr320 added a commit that referenced this pull request Oct 12, 2026
… and --design-table

main (#24) added --design-table/--design-join/--design-source to fetch-samplesheet in the same places this branch added --library-strategy. The two are independent and both are kept. The strategy filter runs before the design-table join, so a table needs rows only for the runs kept; a new test pins that order. README documents both options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sr320 added a commit that referenced this pull request Oct 13, 2026
…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>
sr320 added a commit that referenced this pull request Oct 13, 2026
…eq (#24)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sr320 added a commit that referenced this pull request Oct 13, 2026
The libraries are QuantSeq 3' Tag-Seq. main now has the workflow's Tag-seq path (#24): fastp poly-X trimming, Salmon --noLengthCorrection, DESeq2 without length offsets. The config sets tag_seq = true, the registration no longer calls the study unrunnable, limitation (1) says what the manifest's length_model must read and never to run without tag_seq, and a curation test pins the setting. Tank membership (limitation 2) is still unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant