fix(xenium_patch): restore --min-transcripts-per-cell in stitch script#11
Merged
khersameesh24 merged 1 commit intoJun 27, 2026
Conversation
XENIUM_PATCH_STITCH failed with 'unrecognized arguments: --min-transcripts-per-cell 50'. When stitch_transcripts.py was split into xenium_patch_stitch_transcripts.py + xenium_patch_stitch_postprocess.py, the --min-transcripts-per-cell argument and its small-cell filter were dropped from the transcripts script, but conf/modules.config still injects the flag. - restore the argument + post-stitch small-cell filter (reassign transcripts of sub-threshold cells to noise, drop their polygons) - repoint tests/test_xenium_patch/test_stitch_transcripts.py from the deleted modules/.../resources/usr/bin path to bin/ (broken since the PR nf-core#154 refactor) - add TestMinTranscriptsFilter: filter behaviour, no-op control, and a subprocess CLI test reproducing the exact production invocation - remove the orphan bin/stitch_transcripts.py (superseded, unused) Validated in the module's sopa container: 15 passed.
7b02685
into
khersameesh24:update-nfcore-modules
1 check passed
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.
What & why
XENIUM_PATCH_STITCHfails with:Reproduced with
--mode coordinate --method baysor(routes throughBAYSOR_RUN_TRANSCRIPTS_PARQUET → XENIUM_PATCH_STITCH).Root cause: when
stitch_transcripts.pywas split intoxenium_patch_stitch_transcripts.py+xenium_patch_stitch_postprocess.py, the--min-transcripts-per-cellargument and its small-cell filter were dropped fromthe transcripts script — but
conf/modules.configstill injects the flag(
baysor_tiling_min_transcripts_per_cell, default 50).ext.argsis opaquestring concatenation, so the mismatch only surfaces at runtime as an argparse
error.
This is not a container issue: pipeline
bin/scripts are staged by Nextflowand run with the container's interpreter; sopa imports and runs fine in the
sopa_procps-ng_pyarrowimage. An argparse "unrecognized arguments" message canonly come from the script's own argument definitions.
Changes
--min-transcripts-per-cellargument and the post-stitchsmall-cell filter (reassign sub-threshold cells' transcripts to noise, drop
their polygons) in
bin/xenium_patch_stitch_transcripts.py. The newer_ensure_polygonrefactor in that script is preserved.tests/test_xenium_patch/test_stitch_transcripts.pyfrom the deletedmodules/.../resources/usr/bin/path tobin/— it had been broken since thePR refactor(modules): convert all 19 module-level bin scripts to Nextflow templates nf-core/spatialaxe#154 refactor (masked by the module's stub block in CI).
TestMinTranscriptsFilter: filter behaviour, a no-op control, and asubprocess CLI test that reproduces the exact failing invocation.
bin/stitch_transcripts.py(superseded, unused).Testing
Ran inside the module's own container
community.wave.seqera.io/library/sopa_procps-ng_pyarrow:c9ce8cd2ede79d72:including the CLI test invoking the script with
--min-transcripts-per-cell 50(asserts no "unrecognized arguments", exit 0).