Skip to content

Expose DESeq2 interaction contrasts and separate fixed-module testing - #10

Merged
CharlotteAnne merged 7 commits into
masterfrom
feature/paired-contrasts-module-tests
Oct 2, 2026
Merged

CharlotteAnne merged 7 commits into
masterfrom
feature/paired-contrasts-module-tests

Conversation

@CharlotteAnne

@CharlotteAnne CharlotteAnne commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Paired fraction experiments need gene-level interaction contrasts and a separate competitive test of a fixed gene module. The existing Flow interface exposes only pairwise DESeq2 comparisons with additive blocking, although DESeq2 itself supports these designs.

This adds analysis_mode=design_contrasts using DESeq2, with explicit design formulas and numeric coefficient-weight tables. Optional module_test=camera launches a separate limma-voom CAMERA process with the same design and contrasts. Gene results, module results, fitted objects, normalization, filters and statistical assumptions are saved separately. Existing pairwise DESeq2 remains the default.

DESeq2 uses Wald tests and unshrunk effects with 95% intervals, disables automatic count replacement and independent filtering after the explicit CPM filter, retains Cook's-distance exclusions as NA, and applies BH per contrast across expression-eligible genes. The module background never restricts DESeq2 gene tests. Explicitly declared tximport lengthScaledTPM count estimates are rounded only for DESeq2, with a rounding audit; fractional raw counts are rejected. CAMERA retains its own voom estimates and correlation-aware module tests, explicitly labeled rather than presented as DESeq2 output.

Validation:

  • R 4.4.1 / DESeq2 1.44.0 / limma 3.60.6 / edgeR 4.2.2 synthetic suite passed locally: independent formula-based DESeq2 agreement, simulated interaction recovery, total-RNA nuisance separation, contrast reversal, sample ordering, multiplicity, invalid designs, module coverage, background independence and count conversion.
  • Full Nextflow 24.10.8 runs passed with and without CAMERA. Published gene and module results matched direct R execution exactly; DESeq2-only execution produced no CAMERA output.
  • Dedicated DESeq2 CI passed the statistical suite and both complete Nextflow workflows on Linux.
  • GSEA Docker regression passed after aligning the test with supported outputs and strengthening PDF checks.
  • Repository-wide Prettier and diff-whitespace checks passed.
  • Full Docker compatibility matrix passed on Nextflow 22.10.1 and current stable 26.04.6 using the documented legacy parser. Production container build/testing remains outstanding.

The GSEA test previously required a geneheat plot deliberately disabled in upstream commit 85940e6. This removes that obsolete expectation and the dead commented plotting block. Both enrichment-table assertions remain; supported ORA plots must now be complete PDFs containing a page. Enrichment calculations and thresholds are unchanged.

CI now uses the pinned setup-nextflow v2.1.4 action, bundled Nextflow distributions and Java 17/Temurin. It retains the old-version target and current-stable coverage, explicitly sets NXF_SYNTAX_PARSER=v1 for this repository’s existing Groovy-based DSL2/config, and disables matrix fail-fast so every compatibility job reports its result. The README documents the parser requirement; a strict-syntax migration is not claimed.

Includes both Flow schema formats, documentation, a container build recipe and automated tests. Release requires review plus a tested immutable image and registration of a new Flow version. This PR does not deploy the pipeline, import biological data or run biological validation. Control-gene matching, assay QC and biological support/refutation rules remain explicit protocol responsibilities.

@CharlotteAnne CharlotteAnne changed the title Add paired interaction contrasts and fixed-module testing Expose DESeq2 interaction contrasts and separate fixed-module testing Oct 2, 2026
@CharlotteAnne
CharlotteAnne marked this pull request as ready for review October 2, 2026 16:42
@CharlotteAnne
CharlotteAnne merged commit 01ca9ce into master Oct 2, 2026
17 checks passed
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