Skip to content

Port ISOFORMSWITCHANALYZER to the nf-core module structure and update IsoformSwitchAnalyzeR to 2.12.0 - #281

Merged
piplus2 merged 4 commits into
nf-core:devfrom
piplus2:isoformswitchanalyzer-nfcore
Sep 14, 2026
Merged

piplus2 merged 4 commits into
nf-core:devfrom
piplus2:isoformswitchanalyzer-nfcore

Conversation

@piplus2

@piplus2 piplus2 commented Sep 14, 2026 •

Copy link
Copy Markdown

Closes #280.

Summary

Ports the local ISOFORMSWITCHANALYZER module to the nf-core module structure, adding environment.yml, meta.yml, a stub and nf-test coverage, and updates IsoformSwitchAnalyzeR 2.2.0 -> 2.12.0 (R 4.3 -> 4.5).

Continues the module refactoring series (#245 TXIMPORT, #251 DRIMSEQ_DMFILTER, #255 EDGER_EXON, #264 DEXSEQ_DTU).

Also redraws the pipeline metro map with nf-metro, see below.

No new test-datasets files were needed.

Added

  • modules/local/isoformswitchanalyzer/tests/main.nf.test with three cases: a real run, a run with a dIF cutoff no isoform reaches (covering the fallback path the pipeline relies on, where the summary holds the error message and the features table is empty) and a stub run.

    The Salmon quant directories come from testdata/salmon_quant/salmon_quant.tar.gz and the annotation from reference/genes_chrX.gtf. The test-datasets carry no transcript fasta, so the setup {} block builds one from reference/X.fa.gz with GUNZIP and GFFREAD -w, which is what the pipeline does with rsem-prepare-reference.

    The summary is snapshotted by content, the features table by header and row count (its DEXSeq statistics are not reproducible across machines, same policy as the DEXSEQ_DTU test), the plots and the RDS by name.

  • docs/images/nf-core-rnasplice_metro_map.mmd and the rendered .svg, replacing the hand-drawn docs/rnasplice_map.png in the README.

Changed

  • bin/run_isoformswitchanalyzer.R is now a module template and writes versions.yml itself, replacing the two eval emits. The process interface is unchanged, workflows/rnasplice.nf is untouched.
  • IsoformSwitchAnalyzeR 2.2.0 -> 2.12.0. On the chrX test data 2.12.0 finds a real switch (RPL10) at the default alpha = 0.05, where 2.2.0 found nothing, so the default and salmon_results pipeline snapshots now carry the switch plots and a real summary instead of the fallback message.
  • tests/.nftignore gains isoformswitchanalyzer_isoformfeatures.csv. Now that the table is populated, its content depends on Salmon's non-reproducible quantification and on DEXSeq, so it is only checked by path at the pipeline level.

Fixed

  • The overall consequences plot was written with paste(pathToOutput, 'common_switch_consequences.pdf', sep = ''), i.e. to resultscommon_switch_consequences.pdf next to the results directory. It is now written inside results/ and therefore published, and docs/output.md lists it.

Metro map

nf-core/rnasplice metro map

The old map predates LeafCutter and the --source options. The new one follows the nf-core nf-metro convention: the .mmd source is committed next to the rendered SVG (with the Inter font embedded, and both light and dark palettes so GitHub shows the one matching the viewer's theme), and is re-rendered with

nf-metro render docs/images/nf-core-rnasplice_metro_map.mmd -o docs/images/nf-core-rnasplice_metro_map.svg --embed-font

Four lines, matching the three of the original map plus one for the non-statistical outputs:

Line Route
DEU STAR -> SAMtools -> HTSeq -> DEXSeq / featureCounts -> edgeR
DTU STAR -> Salmon -> tximport -> DRIMSeq -> DEXSeq -> stageR, and Salmon -> IsoformSwitchAnalyzeR
Event-based SAMtools -> rMATS, SAMtools -> regtools -> LeafCutter, tximport -> SUPPA events -> PSI -> diffSplice -> cluster
QC & visualisation SAMtools -> BEDTools -> bedGraphToBigWig, MISO sashimi, MultiQC

The --source alternatives are drawn as off-track file icons dropping into the station they replace: genome BAM -> SAMtools, transcriptome BAM -> Salmon, Salmon quant directories -> tximport.

Two deliberate simplifications:

  • Only the star_salmon route to Salmon is drawn, not the direct --pseudo_aligner salmon route from the trimmed reads. Both are on by default, but every layout carrying both edges either crashed nf-metro's router or tangled the alignment section.
  • The DTU line dips under SAMtools in the alignment section. That is the engine's bypass idiom, DTU leaves STAR without going through the sort and index step, and it is accurate, so it stays rather than faking a SAMtools -> Salmon edge.

Checks

  • Module tests pass with --profile docker.
  • tests/default.nf.test and tests/salmon_results.nf.test, the two pipeline tests that run this module, pass with --profile=+docker.
  • nextflow lint is clean, nf-core modules lint --local reports only the biocontainers/ prefix warning every local module has.

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

🤖 Generated with Claude Code

https://claude.ai/code/session_012ZQZJtuunSpdHWJgAys59c

Add environment.yml, meta.yml, a stub and nf-tests for the local
ISOFORMSWITCHANALYZER module, and update IsoformSwitchAnalyzeR 2.2.0 -> 2.12.0
(R 4.3 -> 4.5). bin/run_isoformswitchanalyzer.R becomes a module template
and writes versions.yml itself, replacing the two eval emits.

The tests take the four Salmon quant directories from
testdata/salmon_quant/salmon_quant.tar.gz and reference/genes_chrX.gtf. The
test-datasets carry no transcript fasta, so the setup block extracts one from
reference/X.fa.gz with GUNZIP and GFFREAD -w, as the pipeline does with
rsem-prepare-reference. Three cases: a real run, a run with a dIF cutoff no
isoform reaches, which covers the fallback path the pipeline relies on, and a
stub run. The summary is snapshotted by content, the features table by
header and row count as its DEXSeq statistics are not reproducible across
machines, the plots and the RDS by name.

Also:

- Fix the common switch consequences plot, which was written to
  resultscommon_switch_consequences.pdf next to the results directory
  instead of inside it, so it was never published.
- With 2.12.0 the chrX test data yields a real switch (RPL10) at the default
  alpha, where 2.2.0 found nothing, so the default and salmon_results
  pipeline snapshots now carry the switch plots and a real summary. The
  features table is added to tests/.nftignore: it depends on Salmon's
  non-reproducible quantification and on DEXSeq.

Closes nf-core#280

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ZQZJtuunSpdHWJgAys59c
@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 9678c74

+| ✅ 311 tests passed       |+
#| ❔   5 tests were ignored |#
#| ❔   1 tests had warnings |#
!| ❗  12 tests had warnings |!
Details

❗ Test warnings:

  • readme - README contains the placeholder zenodo.XXXXXXX. This should be replaced with the zenodo doi (after the first release).
  • pipeline_todos - TODO string in CHANGELOG.md: ## v1.1.0dev - [unreleased replace with date on release ]
  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here
  • pipeline_todos - TODO string in CONTRIBUTING.md: Add any pipeline specific contribution guidelines here, such as coding styles, procedures, checklists etc.
  • pipeline_todos - TODO string in main.nf.test: define inputs of the process here. Example:
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline
  • pipeline_todos - TODO string in awsfulltest.yml: You can customise AWS full pipeline tests as required
  • schema_params - Schema param fasta not found from nextflow config
  • schema_params - Schema param gtf not found from nextflow config
  • schema_params - Schema param gff not found from nextflow config
  • schema_params - Schema param star_index not found from nextflow config
  • schema_params - Schema param salmon_index not found from nextflow config

❔ Tests ignored:

  • files_unchanged - File ignored due to lint config: .github/PULL_REQUEST_TEMPLATE.md
  • files_unchanged - File ignored due to lint config: .github/workflows/branch.yml
  • files_unchanged - File ignored due to lint config: .github/workflows/linting.yml
  • files_unchanged - File ignored due to lint config: assets/nf-core-rnasplice_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-rnasplice_logo_dark.png

❔ Tests fixed:

✅ Tests passed:

Run details

  • nf-core/tools version 4.1.0
  • Run at 2026-09-14 08:08:05

piplus2 and others added 3 commits September 14, 2026 09:47
Replace the hand-drawn docs/rnasplice_map.png with an nf-metro map whose
.mmd source is committed next to the rendered SVG in docs/images/. The map
now covers LeafCutter, the --source inputs (genome BAM, transcriptome BAM,
Salmon quant directories) as off-track file icons dropping into the station
they replace, and the bigWig coverage tracks. Four lines: DEU, DTU,
event-based splicing, and QC & visualisation.

Only the star_salmon route to Salmon is drawn, not the direct pseudo-aligner
one from the trimmed reads: every layout carrying both edges either crashed
the router or tangled the alignment section.

Re-render with:

    nf-metro render docs/images/nf-core-rnasplice_metro_map.mmd \
        -o docs/images/nf-core-rnasplice_metro_map.svg --embed-font

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ZQZJtuunSpdHWJgAys59c

@erikrikarddaniel erikrikarddaniel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed with some help from Claude Code.

Nice work overall, especially the R→Nextflow-template conversion — checked every $-accessor in the ~375-line script for missing escaping (an easy class of bug to introduce there) and found none; the common_switch_consequences.pdf path fix is a real, correctly-diagnosed bug (the old paste(..., sep='') produced resultscommon_switch_consequences.pdf with no separator, now fixed); and the fallback-path test case checks out against the actual tryCatch/error= handler in the script — the blank isoformswitchanalyzer_isoformfeatures.csv it snapshots by full content really is deterministic on that path, unlike the real-run case.

One non-blocking question inline — not a demonstrated defect, worth a reply before merge.

Comment thread .github/workflows/nf-test.yml
@piplus2

piplus2 commented Sep 14, 2026

Copy link
Copy Markdown
Author

thanks @erikrikarddaniel !

@piplus2
piplus2 merged commit c51eba1 into nf-core:dev Sep 14, 2026
24 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.

2 participants