Only pass --expansion-distance for nuclei-based xeniumranger imports#191
Merged
heylf merged 2 commits intoJul 22, 2026
Merged
Conversation
xeniumranger import-segmentation was given --expansion-distance on every invocation, but the tool only accepts it for nuclei-based imports (it expands nuclei into cell boundaries). Transcript-assignment imports (proseg/baysor/segger) and cells-only imports fail with `ERROR: --expansion-distance requires --nuclei`. Gate the flag on the module's `nuclei` input so it is emitted only when a nuclei segmentation is being imported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
heylf
approved these changes
Jul 22, 2026
heylf
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Thank you @rnaidu-seqera for your help!
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.
Problem
xeniumranger import-segmentationfails on transcript-based segmentation methods:Reproducible with
-profile test(which enablestranscript_seg_methods = [proseg, segger, baysor]).Root cause
conf/modules.configapplied--expansion-distanceto everyXENIUMRANGER_IMPORT_SEGMENTATIONinvocation viawithName. Butxeniumrangeronly accepts--expansion-distancefor nuclei-based imports — it expands nuclei outward into cell boundaries. The import step runs in two mutually-exclusive modes (enforced by the module itself):--nuclei/--cells) — image segmentation--transcript-assignment+--viz-polygons) — proseg / baysor / seggerThe transcript-assignment methods pass
nuclei = [], so--expansion-distanceis invalid there andxeniumrangerrejects it. (The same applies to the cells-only import inxeniumranger_resegment_morphology_ome_tif.)This isn't exercised by CI because
xeniumrangeris a licensed tool that CI can't run.Fix
Gate
--expansion-distanceon the module'snucleiinput, so it is emitted only when a nuclei segmentation is being imported — matchingxeniumranger's own rule:Config-only; no change to the shared nf-core module. Preserves the flag for the genuine nuclei imports (stardist / cellpose), and removes it where the tool forbids it (transcript-assignment and cells-only imports).
Validation
ext.argsclosure can reference the module'snucleipath input, and that it resolves correctly among the module's other path inputs.nextflow.util.BlankSeparatedList, size 0) → flag omitted; staged path (nextflow.processor.TaskPath) → flag emitted.nextflow lintpasses.PR checklist
CHANGELOG.mdis updated.nf-test/ CI green (please run in nf-core CI; note this path needs the licensedxeniumrangertool to exercise end-to-end).