Skip to content

fix: wire NanoPlot pre/post stats into MultiQC - #181

Open
ljwharbers wants to merge 2 commits into
devfrom
fix_nanoplot_multiqc
Open

fix: wire NanoPlot pre/post stats into MultiQC#181
ljwharbers wants to merge 2 commits into
devfrom
fix_nanoplot_multiqc

Conversation

@ljwharbers

@ljwharbers ljwharbers commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Closes #180.

Description of changes

ch_nanoplot_pre_txt (workflows/lrsomatic.nf:249) and ch_nanoplot_post_txt (:831) 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. Confirmed by the previously committed snapshots — no nanostat* entry appeared in any of them.

  • workflows/lrsomatic.nf — assign both channels inside the existing if (!params.skip_nanoplot) blocks, matching the idiom already used for the samtools / mosdepth / whatshap QC channels. Also corrected two comments that claimed label: process_medium (the module is process_low).
  • conf/modules.config — added the replicate to NANOPLOT_PRE's ext.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. Its publishDir already separated replicates; only the filename did not. NANOPLOT_POST is deliberately unchanged — it runs after replicate merging, where meta.replicate no longer exists.
  • tests/default.nf.test.snap — five new MultiQC entries (multiqc_nanostat.txt, nanostat_fasta_stats_table.txt and its pdf/png/svg exports) and 35 nanoplot_ubam_rep1 filenames picking up the replicate. stable_path is unchanged; tests/.nftignore already 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 and multiqc_data entries.

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.txt files produced by this pipeline's own cramino --arrow → NanoPlot path, for both the unaligned and aligned variants:

$ cut -f1 multiqc_data/multiqc_nanostat.txt
Sample
sample1_tumor_aln
sample1_tumor_rep1_ubam
sample1_tumor_rep2_ubam

The nanostat module parses these files and the two replicates survive as distinct samples. CI then confirmed it end-to-end: the run at 1bc9048 completed the pipeline successfully and failed only the snapshot assertion, with multiqc/multiqc_data/multiqc_nanostat.txt present in the produced output. nextflow lint reports no errors and pre-commit passes.

I also checked whether extra_fn_clean_exts: ["_NanoStats"] was needed in assets/multiqc_config.yml for readable sample names — it is not. _NanoStats is already in MultiQC's built-in fn_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 the nanoplot_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

  • This comment contains a description of changes (with reason).
  • Make sure your code lints (nextflow lint, pre-commit).
  • Ensure the test suite passes (tests/default.nf.test, the small tag CI runs on PRs).
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • Citations updated (NanoPlot added to CITATIONS.md).

🤖 Generated with Claude Code

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>
Copilot AI lite review requested due to automatic review settings August 13, 2026 10:00
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

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

Posted for pipeline commit f23b9b5

+| ✅ 202 tests passed       |+
#| ❔  22 tests were ignored |#
!| ❗  38 tests had warnings |!
Details

❗ Test warnings:

  • nextflow_config - Config manifest.version should end in dev: 1.1.0
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in README.md: Include a figure that guides the user through the major workflow steps. Many nf-core
  • pipeline_todos - TODO string in nextflow.config: Specify your pipeline's command line flags
  • pipeline_todos - TODO string in nextflow.config: Update the field with the details of the contributors to your pipeline. New with Nextflow version 24.10.0
  • pipeline_todos - TODO string in meta.yml: #Add a description of the module and list keywords
  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here
  • 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 CONTRIBUTING.md: Add any pipeline specific contribution guidelines here, such as coding styles, procedures, checklists etc.
  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • pipeline_todos - TODO string in base.config: Customise requirements for specific processes.
  • schema_description - Ungrouped param in schema: skip_modkit
  • schema_description - No description provided in schema for parameter: generate_gvcf
  • schema_description - No description provided in schema for parameter: autocorrelation
  • schema_description - No description provided in schema for parameter: vep_custom
  • schema_description - No description provided in schema for parameter: vep_custom_tbi
  • schema_description - No description provided in schema for parameter: severus_minsupport
  • schema_description - No description provided in schema for parameter: wakhan_chroms
  • local_component_structure - phasing_haplotyping.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - small_variant_consensus.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - prepare_reference_files.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - prepare_annotation.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - deepsomatic.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure

❔ Tests ignored:

  • files_exist - File is ignored: CODE_OF_CONDUCT.md
  • files_exist - File is ignored: assets/nf-core-lrsomatic_logo_light.png
  • files_exist - File is ignored: docs/images/nf-core-lrsomatic_logo_light.png
  • files_exist - File is ignored: docs/images/nf-core-lrsomatic_logo_dark.png
  • files_exist - File is ignored: .github/ISSUE_TEMPLATE/config.yml
  • files_exist - File is ignored: .github/workflows/awstest.yml
  • files_exist - File is ignored: .github/workflows/awsfulltest.yml
  • files_exist - File is ignored: .github/CONTRIBUTING.md
  • nextflow_config - Config variable ignored: manifest.name
  • nextflow_config - Config variable ignored: manifest.homePage
  • files_unchanged - File ignored due to lint config: CODE_OF_CONDUCT.md
  • files_unchanged - File ignored due to lint config: .github/ISSUE_TEMPLATE/bug_report.yml
  • 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_comment.yml
  • files_unchanged - File ignored due to lint config: .github/workflows/linting.yml
  • files_unchanged - File ignored due to lint config: assets/email_template.txt
  • files_unchanged - File ignored due to lint config: assets/nf-core-lrsomatic_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-lrsomatic_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-lrsomatic_logo_dark.png
  • files_unchanged - File ignored due to lint config: docs/README.md
  • actions_awstest - 'awstest.yml' workflow not found: /home/runner/work/lrsomatic/lrsomatic/.github/workflows/awstest.yml

✅ Tests passed:

Run details

  • nf-core/tools version 4.0.2
  • Run at 2026-08-13 11:17:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.txt and NANOPLOT_POST.out.txt into ch_nanoplot_pre_txt / ch_nanoplot_post_txt so they reach ch_multiqc_files.
  • Include meta.replicate in NANOPLOT_PRE’s ext.prefix to prevent MultiQC sample collapsing when multiple replicates exist.
  • Update output docs + changelog + citations to reflect the new filenames and new MultiQC multiqc_data entries.

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>
Copilot AI review requested due to automatic review settings August 13, 2026 11:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@ljwharbers
ljwharbers marked this pull request as ready for review August 13, 2026 12:29
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