Port ISOFORMSWITCHANALYZER to the nf-core module structure and update IsoformSwitchAnalyzeR to 2.12.0 - #281
Conversation
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
|
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
left a comment
There was a problem hiding this comment.
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.
|
thanks @erikrikarddaniel ! |
Closes #280.
Summary
Ports the local
ISOFORMSWITCHANALYZERmodule to the nf-core module structure, addingenvironment.yml,meta.yml, a stub and nf-test coverage, and updatesIsoformSwitchAnalyzeR2.2.0 -> 2.12.0 (R 4.3 -> 4.5).Continues the module refactoring series (#245
TXIMPORT, #251DRIMSEQ_DMFILTER, #255EDGER_EXON, #264DEXSEQ_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.testwith 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.gzand the annotation fromreference/genes_chrX.gtf. The test-datasets carry no transcript fasta, so thesetup {}block builds one fromreference/X.fa.gzwithGUNZIPandGFFREAD -w, which is what the pipeline does withrsem-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_DTUtest), the plots and the RDS by name.docs/images/nf-core-rnasplice_metro_map.mmdand the rendered.svg, replacing the hand-drawndocs/rnasplice_map.pngin the README.Changed
bin/run_isoformswitchanalyzer.Ris now a module template and writesversions.ymlitself, replacing the twoevalemits. The process interface is unchanged,workflows/rnasplice.nfis untouched.IsoformSwitchAnalyzeR2.2.0 -> 2.12.0. On the chrX test data 2.12.0 finds a real switch (RPL10) at the defaultalpha = 0.05, where 2.2.0 found nothing, so thedefaultandsalmon_resultspipeline snapshots now carry the switch plots and a real summary instead of the fallback message.tests/.nftignoregainsisoformswitchanalyzer_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
paste(pathToOutput, 'common_switch_consequences.pdf', sep = ''), i.e. toresultscommon_switch_consequences.pdfnext to theresultsdirectory. It is now written insideresults/and therefore published, anddocs/output.mdlists it.Metro map
The old map predates LeafCutter and the
--sourceoptions. The new one follows the nf-core nf-metro convention: the.mmdsource 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 withFour lines, matching the three of the original map plus one for the non-statistical outputs:
The
--sourcealternatives 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:
star_salmonroute to Salmon is drawn, not the direct--pseudo_aligner salmonroute 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.Checks
--profile docker.tests/default.nf.testandtests/salmon_results.nf.test, the two pipeline tests that run this module, pass with--profile=+docker.nextflow lintis clean,nf-core modules lint --localreports only thebiocontainers/prefix warning every local module has.PR checklist
nf-core pipelines lint).nextflow run . -profile test,docker --outdir <OUTDIR>).docs/output.mdis updated.CHANGELOG.mdis updated.README.mdis updated (including new tool citations and authors/contributors).🤖 Generated with Claude Code
https://claude.ai/code/session_012ZQZJtuunSpdHWJgAys59c