fix: wire NanoPlot pre/post stats into MultiQC - #181
Open
ljwharbers wants to merge 2 commits into
Open
Conversation
ch_nanoplot_pre_txt and ch_nanoplot_post_txt were declared as empty channels and mixed into ch_multiqc_files, but never assigned from NANOPLOT_PRE.out.txt / NANOPLOT_POST.out.txt. The .ifEmpty([]) on the mix swallowed the empty channels, so the pipeline succeeded while the NanoStat section was silently absent from every MultiQC report. Assign both channels inside the existing `if (!params.skip_nanoplot)` blocks, matching the idiom already used for the samtools, mosdepth and whatshap QC channels. Also add the replicate to NANOPLOT_PRE's output prefix. NANOPLOT_PRE runs once per replicate, so without it every replicate of a sample produced an identically named NanoStats.txt and MultiQC kept only one of them -- its publishDir already separated replicates, only the filename did not. Verified against MultiQC 1.34 with real NanoStats.txt files from both the cramino --arrow ubam and aligned paths: the nanostat module parses them and reports sample1_tumor_aln, sample1_tumor_rep1_ubam and sample1_tumor_rep2_ubam as three distinct samples. Fixes #180 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a workflow wiring issue where NanoPlot pre- and post-alignment *.txt outputs were never fed into the MultiQC input channel, causing the NanoStat section to be silently absent from MultiQC reports. It also updates NanoPlot PRE filename prefixes to avoid replicate collisions and refreshes documentation/changelog/citations accordingly.
Changes:
- Wire
NANOPLOT_PRE.out.txtandNANOPLOT_POST.out.txtintoch_nanoplot_pre_txt/ch_nanoplot_post_txtso they reachch_multiqc_files. - Include
meta.replicateinNANOPLOT_PRE’sext.prefixto prevent MultiQC sample collapsing when multiple replicates exist. - Update output docs + changelog + citations to reflect the new filenames and new MultiQC
multiqc_dataentries.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
workflows/lrsomatic.nf |
Assign NanoPlot PRE/POST out.txt channels so NanoStats files are included in MultiQC inputs; fix module label comments. |
conf/modules.config |
Add replicate to NanoPlot PRE output prefix to avoid per-replicate filename collisions in MultiQC. |
docs/output.md |
Update documented NanoPlot PRE filenames and document new MultiQC nanostat-related outputs. |
CITATIONS.md |
Add missing NanoPlot/NanoPack2 citation entry. |
CHANGELOG.md |
Document the MultiQC NanoPlot stats wiring fix and replicate-safe NanoPlot PRE naming. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Regenerated from the CI run on PR #181, which completed the pipeline successfully and failed only the snapshot assertion (1 of 3). stable_name gains five MultiQC entries now that NanoStats reaches MultiQC -- multiqc_nanostat.txt, nanostat_fasta_stats_table.txt and its pdf/png/svg exports -- and 35 nanoplot_ubam_rep1 filenames pick up the replicate from the new NANOPLOT_PRE prefix. stable_path is unchanged; tests/.nftignore already excludes the nanoplot and multiqc_data text files from content hashing. The four extended-tagged snapshots (clair_only, consensus, deep_only, union) drift the same way but are not run on pull requests, so they still need regenerating before the next release. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ljwharbers
marked this pull request as ready for review
August 13, 2026 12:29
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.
Closes #180.
Description of changes
ch_nanoplot_pre_txt(workflows/lrsomatic.nf:249) andch_nanoplot_post_txt(:831) were declared as empty channels and mixed intoch_multiqc_files, but never assigned fromNANOPLOT_PRE.out.txt/NANOPLOT_POST.out.txt. The.ifEmpty([])on the mix swallowed the empty channels, so the pipeline succeeded while the NanoStat section was silently absent from every MultiQC report. Confirmed by the previously committed snapshots — nonanostat*entry appeared in any of them.workflows/lrsomatic.nf— assign both channels inside the existingif (!params.skip_nanoplot)blocks, matching the idiom already used for the samtools / mosdepth / whatshap QC channels. Also corrected two comments that claimedlabel: process_medium(the module isprocess_low).conf/modules.config— added the replicate toNANOPLOT_PRE'sext.prefix.NANOPLOT_PREruns once per replicate, so without it every replicate of a sample produced an identically namedNanoStats.txtand MultiQC kept only one. ItspublishDiralready separated replicates; only the filename did not.NANOPLOT_POSTis deliberately unchanged — it runs after replicate merging, wheremeta.replicateno longer exists.tests/default.nf.test.snap— five new MultiQC entries (multiqc_nanostat.txt,nanostat_fasta_stats_table.txtand its pdf/png/svg exports) and 35nanoplot_ubam_rep1filenames picking up the replicate.stable_pathis unchanged;tests/.nftignorealready excludes these files from content hashing.CITATIONS.md— NanoPlot was missing entirely; added the NanoPack2 reference.docs/output.md,CHANGELOG.md— updated for the new filenames andmultiqc_dataentries.Verification
Because the bug's symptom was silence, a green test alone would not prove the fix, so I also ran the pinned MultiQC 1.34 directly against real
NanoStats.txtfiles produced by this pipeline's owncramino --arrow→ NanoPlot path, for both the unaligned and aligned variants:The
nanostatmodule parses these files and the two replicates survive as distinct samples. CI then confirmed it end-to-end: the run at1bc9048completed the pipeline successfully and failed only the snapshot assertion, withmultiqc/multiqc_data/multiqc_nanostat.txtpresent in the produced output.nextflow lintreports no errors andpre-commitpasses.I also checked whether
extra_fn_clean_exts: ["_NanoStats"]was needed inassets/multiqc_config.ymlfor readable sample names — it is not._NanoStatsis already in MultiQC's built-infn_clean_exts, so no config change is included.Follow-up needed before the next release
The four
extended-tagged snapshots (clair_only,consensus,deep_only,union) drift in exactly the same way — five MultiQC additions plus thenanoplot_ubam_rep*renames. They are not run on pull requests, so they do not show up here, but they need regenerating before the next release.PR checklist
nextflow lint,pre-commit).tests/default.nf.test, thesmalltag CI runs on PRs).docs/output.mdis updated.CHANGELOG.mdis updated.CITATIONS.md).🤖 Generated with Claude Code