fix: prevent markers.csv duplication in multi-sample runs (#165) - #166
Draft
adamjtaylor wants to merge 2 commits into
Draft
fix: prevent markers.csv duplication in multi-sample runs (#165)#166adamjtaylor wants to merge 2 commits into
adamjtaylor wants to merge 2 commits into
Conversation
… runs (nf-core#165) Multi-sample runs failed in MCQUANT with "number of channels in markers.csv doesn't match the image" whenever samples differed in a per-sample field. Two independent causes, both fixed here: - The shared markersheet was deduplicated with `.unique()` on the whole marker map, which includes per-sample fields (exposure_time/_unit). Any difference left duplicate rows, inflating markers.csv beyond the image channel count. Now rows are grouped by (cycle_number, channel_number) and collapsed to one shared row per channel; samples may differ in exposure (validated separately for backsub), but must agree on the marker definition. - The per-cycle channel offset uniqued (cycle_number, channel_count) pairs, so samples disagreeing on a cycle's channel count silently produced duplicate offsets and duplicated markers. This is now a clear, actionable error. Adds a defense-in-depth assertion that the final markers.csv has exactly one contiguously numbered row (1..N) per image channel. Also removes the previous inter-sample/backsub checks, which operated on the whole list rather than individual rows and never fired. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ore#165) Two nf-test cases exercising the multi-sample paths that previously produced a malformed markers.csv: - samples differing in exposure time must collapse to one row per image channel (regression against the 44 -> 64 row duplication) - samples disagreeing on a cycle's channel count must fail with a clear error Both feed small committed OME-XML fixtures straight to the xml input so they run OMEVALIDATION natively without a container. The existing single-sample snapshot is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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. For more documentation on how to update your pipeline, please see the Synchronisation documentation. |
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.
Fixes #165.
markers.csvwith duplicate rows (44 → 64 in the reported case), causing MCQUANT to abort with "number of channels doesn't match".UPDATE_FROM_OMEnow groups markers by(cycle_number, channel_number)and collapses to one row per image channel, instead of.unique()over whole maps that still carried per-sampleexposure_time.1..N, and removed the previous list-level guards that never fired.🤖 Generated with Claude Code