Skip to content

Wrap process invocations in conditionals #141

Draft
adamjtaylor wants to merge 8 commits intodevfrom
fix-sage-specific
Draft

Wrap process invocations in conditionals #141
adamjtaylor wants to merge 8 commits intodevfrom
fix-sage-specific

Conversation

@adamjtaylor
Copy link
Contributor

@adamjtaylor adamjtaylor commented Feb 3, 2026

This pull request updates the segmentation workflow in workflows/mcmicro.nf and related configuration to improve conditional execution and input handling for segmenters, particularly on AWS Batch. The changes ensure that each segmenter is only invoked when specified, preventing input validation errors and enhancing flexibility. Key updates also include improvements to how model files are staged and arguments are passed to segmenter processes.

Workflow improvements for segmentation:

  • Added conditional invocation for each segmenter (mesmer, cellpose, mccellpose) based on params.segmentation, preventing input validation errors when segmenters are skipped. This is especially important for AWS Batch compatibility. [1] [2]
  • Refactored the cellpose segmenter logic to use explicit channels for images and models, with improved handling of the model file (checks existence and supports empty value).

Process and configuration enhancements:

  • Updated the CELLPOSE process to use the stageAs option for the model input, allowing flexible file staging.
  • Added support for passing the pixel size as an argument to the MCCELLPOSE process via ext.args in the configuration.

…atch

On AWS Batch, input validation occurs before ext.when can skip process
execution. This caused "Path value cannot be null" errors when
params.cellpose_model (default []) was passed to CELLPOSE even though
ext.when would have skipped the process.

Wrap each segmentation process (DEEPCELL_MESMER, CELLPOSE, MCCELLPOSE)
in conditionals that check params.segmentation, ensuring processes are
only invoked when actually needed.

Fixes: #140

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@adamjtaylor adamjtaylor requested review from AlexBarbera and jmuhlich and removed request for jmuhlich February 3, 2026 16:46
@nf-core-bot
Copy link
Member

Warning

Newer version of the nf-core template is available.

Your pipeline is using an old version of the nf-core template: 3.5.1.
Please update your pipeline to the latest version.

For more documentation on how to update your pipeline, please see the nf-core documentation and Synchronisation documentation.

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

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

Posted for pipeline commit 876427a

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

❗ Test warnings:

  • nextflow_config - Config manifest.version should end in dev: 2.0.0
  • readme - README contains the placeholder zenodo.XXXXXXX. This should be replaced with the zenodo doi (after the first release).
  • pipeline_todos - TODO string in README.md: Add citation for pipeline after first release. Uncomment lines below and update Zenodo doi and badge at the top of this file.
  • pipeline_todos - TODO string in awsfulltest.yml: You can customise AWS full pipeline tests as required
  • schema_lint - Parameter input not found in schema

❔ Tests ignored:

  • files_exist - File is ignored: conf/igenomes.config
  • files_exist - File is ignored: conf/igenomes_ignored.config
  • nextflow_config - Config variable ignored: params.input
  • files_unchanged - File ignored due to lint config: .gitignore or .prettierignore
  • template_strings - Ignoring Jinja template strings in file /home/runner/work/mcmicro/mcmicro/assets/mcmicro_metro.pdf

❔ Tests fixed:

✅ Tests passed:

Run details

  • nf-core/tools version 3.5.1
  • Run at 2026-02-05 15:41:58

@adamjtaylor adamjtaylor marked this pull request as draft February 3, 2026 18:36
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.

CELLPOSE process fails on AWS Batch when not selected in segmentation parameter

2 participants