Skip to content

migrate to new workflow outputs#662

Merged
suzannejin merged 43 commits intodevfrom
solve-resume
Apr 13, 2026
Merged

migrate to new workflow outputs#662
suzannejin merged 43 commits intodevfrom
solve-resume

Conversation

@suzannejin
Copy link
Copy Markdown

@suzannejin suzannejin commented Mar 11, 2026

This solves #611 (linked to parent issue #471), by 1) migrating to the new workflow output format and 2) remove paramset_names when running modules.

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!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/differentialabundance branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core lint).
  • Ensure the test suite passes (nf-test test main.nf.test -profile test,docker).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@suzannejin suzannejin changed the base branch from master to dev March 11, 2026 14:38
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 11, 2026

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

Posted for pipeline commit 350691c

+| ✅ 375 tests passed       |+
#| ❔  10 tests were ignored |#
#| ❔   1 tests had warnings |#
!| ❗  19 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 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 main.nf: Optionally add in-text citation tools to this list.
  • pipeline_todos - TODO string in main.nf: Optionally add bibliographic entries to this list.
  • pipeline_todos - TODO string in main.nf: Only uncomment below if logic in toolCitationText/toolBibliographyText has been filled!
  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • schema_lint - Parameter input is not defined in the correct subschema (input_output_options)
  • schema_description - No description provided in schema for parameter: dream_p_value
  • schema_description - No description provided in schema for parameter: dream_lfc
  • schema_description - No description provided in schema for parameter: dream_confint
  • schema_description - No description provided in schema for parameter: dream_proportion
  • schema_description - No description provided in schema for parameter: dream_stdev_coef_lim
  • schema_description - No description provided in schema for parameter: dream_trend
  • schema_description - No description provided in schema for parameter: dream_robust
  • schema_description - No description provided in schema for parameter: dream_winsor_tail_p
  • schema_description - No description provided in schema for parameter: dream_ddf
  • schema_description - No description provided in schema for parameter: dream_reml
  • schema_description - No description provided in schema for parameter: dream_apply_voom
  • schema_description - No description provided in schema for parameter: dream_adjust_method

❔ Tests ignored:

  • files_exist - File is ignored: assets/multiqc_config.yml
  • nextflow_config - Config default ignored: params.report_file
  • nextflow_config - Config default ignored: params.logo_file
  • nextflow_config - Config default ignored: params.css_file
  • nextflow_config - Config default ignored: params.citations_file
  • files_unchanged - File ignored due to lint config: .github/CONTRIBUTING.md
  • files_unchanged - File ignored due to lint config: assets/nf-core-differentialabundance_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-differentialabundance_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-differentialabundance_logo_dark.png
  • multiqc_config - multiqc_config

❔ Tests fixed:

✅ Tests passed:

Run details

  • nf-core/tools version 3.5.1
  • Run at 2026-04-11 17:52:08

@suzannejin suzannejin linked an issue Mar 17, 2026 that may be closed by this pull request
@suzannejin suzannejin self-assigned this Mar 17, 2026
@suzannejin
Copy link
Copy Markdown
Author

suzannejin commented Mar 19, 2026

Hi @pinin4fjords @grst , here you have the implementation for migrating into the new workflow output format.
This migration removes the need for having paramset_names as key when calling the modules, and removes cache issues, as discussed in #471.

Please review, and if everything looks great to you, I'll proceed to first commit the changes in nf-core subworkflow and then merge this one :)

Copy link
Copy Markdown
Member

@grst grst left a comment

Choose a reason for hiding this comment

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

I like it a lot, feels very satisfying to remove so much from the config file!

I didn't check everything in detail though.

// gsea-specific outputs
gsea_report = GSEA_GSEA.out.report_tsvs_ref.join(GSEA_GSEA.out.report_tsvs_target)
gsea_report = GSEA_GSEA.out.report_tsvs_ref.join(GSEA_GSEA.out.report_tsvs_target)
gsea_artifacts = GSEA_GSEA.out.rpt
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.

Is it necessary to be that verbose?
Does it not work to just use GSEA_GSEA.out or to iterate over the sub-channel and exclude a selected few?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

how can i do that? I thought that multichannel cannot be emitted directly.
so this will give error:

emit:
gsea = GSEA_GSEA.out


# ERROR ~ Cannot emit a multi-channel output: gsea

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

an alternative I can do though is to modify the GSEA module itself and emit the output files as a combined tuple

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.

I have no idea, I had just hoped there might be an easy solution.
I'm fine with leaving it as is if there's not.

Comment thread main.nf Outdated
Comment thread workflows/differentialabundance.nf Outdated
Copy link
Copy Markdown
Member

@pinin4fjords pinin4fjords left a comment

Choose a reason for hiding this comment

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

Also like, but we should preserve file paths, outside the explicit objectives of the PR.

I think the newly captured log files are a bug fix, but they'll be variable over time so we shouldn't snapshot them.

Comment thread tests/test_affy.nf.test.snap Outdated
Comment thread .github/workflows/nf-test.yml
Comment thread conf/modules.config
Comment thread main.nf Outdated
Comment thread workflows/differentialabundance.nf Outdated
Comment thread workflows/differentialabundance.nf Outdated
ch_plot_differential_input.samples_features_matrices
)

ch_plots_differential = PLOT_DIFFERENTIAL.out.volcanos_png
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.

Is this ever used?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

not ever used in the pipeline, but they were module outputs that were saved in dev

@suzannejin
Copy link
Copy Markdown
Author

suzannejin commented Mar 27, 2026

hi @pinin4fjords @grst, i have now updated the subworkflows from nf-core.
Unfortunately, dealing with current outputs are extremely verbose, but future migration to topics and records should help to grooup outputs better, as discussed here.

Comment thread workflows/differentialabundance.nf Outdated
ch_plot_differential_input.samples_features_matrices
)

ch_plots_differential = PLOT_DIFFERENTIAL.out.volcanos_png
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.

Not used anywhere?

…o main.nf

The inner workflow (DIFFERENTIALABUNDANCE) previously mixed all outputs
into 7 broad category channels with name-tagging (e.g. ['affy_raw_expression', meta, file]).
This re-introduced the mixed-type channel pattern that was explicitly
rejected in nf-core/modules#11024.

Now each output is emitted as its own clean channel from the inner
workflow. The name-tagging and category mixing for publishing is done
in main.nf's entry workflow, keeping publishing logic in one place and
the inner workflow reusable without baked-in publishing assumptions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove 43 intermediate variables that were only defined to be emitted.
The prepareModuleOutput() calls now live directly in the emit block,
eliminating unnecessary indirection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pinin4fjords
Copy link
Copy Markdown
Member

Hey @suzannejin, thanks for all the work on this - the migration to workflow outputs is a really important change and the core of it looks great.

One piece of feedback: in the inner workflow (workflows/differentialabundance.nf), the outputs are currently mixed into category channels with name-tags (e.g. ['affy_raw_expression', meta, file]) and then emitted as 7 broad channels. This effectively spreads the publishing logic across both the inner workflow and main.nf, which is a bit regressive - the whole point of Nextflow's output {} block was to consolidate publishing configuration in one place rather than having it scattered across modules.config, workflow files, etc.

This also re-introduces the mixed-type channel pattern we discussed in nf-core/modules#11024, where the inner workflow bundles disparate outputs into single channels.

I've opened #687 against your branch with a refactor that:

  • Emits each output as its own clean, typed channel from DIFFERENTIALABUNDANCE (~62 individual emits)
  • Moves all the name-tagging and category mixing into main.nf's entry workflow, right next to the output {} block where it belongs
  • Inlines emit-only expressions directly (no intermediate variables)

The net effect is fewer lines overall and all publishing concerns in one file. It should also port more cleanly to future Nextflow enhancements (record types, etc.).

I know the verbosity of having ~62 individual emits isn't ideal - it's the same issue that led me to park the equivalent migration in rnaseq (nf-core/rnaseq#1679). But it's not too bad here, and Nextflow should address this with record types in future, at which point it'll collapse down nicely.

Could you take a look at #687 and merge it if it looks good to you? It should be a straightforward review since the output {} block and test expectations are unchanged.

@suzannejin suzannejin merged commit 35cc0c8 into dev Apr 13, 2026
56 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.

migration to workflow outputs

4 participants