merge: within-tile 1:1 matching, low-score seed filtering, persist aligned SBS - #232
Merged
Conversation
…igned SBS - match_cells(): mutual nearest-neighbor 1:1 matching, shared by merge_sbs_phenotype and plot_merge_example (no within-tile double matches); cleaner 3-panel preview - filter_low_score_seeds(): drop low-score outlier initial sites relative to the cohort (median/MAD), always keeping >= 5; wired into fast_alignment.py - align_sbs output no longer temp() so the stitch merge can read aligned SBS tiles Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
akcd1
pushed a commit
that referenced
this pull request
Aug 6, 2026
Bring main (5 commits, #227/#231/#232/#234/#240) into the branch ahead of #171. Merged rather than rebased: a rebase replays 45 commits and re-hits the same aggregate collisions repeatedly, while the merge conflicts in one file, and main only accepts squash merges so the linear history would be flattened on landing anyway. Both conflicts are in generate_feature_table.py and are complementary: - #234 added a warning when perturbation_id_col is unset; the branch added the control_name_col fallback (#222). Independent, both kept. - Column ordering for the construct table: the branch dedupes via dict.fromkeys over [pert_id_col, pert_col, control_name_col, ...], main dedupes only the id/name pair. Kept the branch version -- main's drops control_name_col, which the control filter downstream indexes on, so main's form would KeyError under a construct-level config. ruff check and ruff format clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Summary
Three merge/stitch improvements. Backward compatible — no config changes required. Gated by the full
small_test_analysispipeline (2173/2173 steps, exit 0).Within-tile 1:1 matching (mutual nearest-neighbor)
merge_sbs_phenotypeand theplot_merge_examplepreview now share amatch_cells()helper that enforces mutual nearest-neighbor matching, so no cell within a tile is matched more than once. Cross-tile duplicates remain resolved downstream by deduplication. The preview figure is also redesigned: a common-frame overlay (no cross-coordinate fan-lines), per-cell labels removed, and a stats header (matched / % phenotype / median residual / doubles).Low-score seed filtering
filter_low_score_seeds()drops initial-site seeds whose alignment score is a low outlier relative to the cohort (median/MAD, k=3), always keeping >= 5. Wired intofast_alignment.pyafter the best-per-site collapse. Uses a relative cut rather than a fixed floor because the score's absolute scale is screen-dependent.Persist aligned SBS (stitch fix)
align_sbsoutput is no longer wrapped intemp(), so the stitch merge can read the aligned SBS tiles (previously deleted after use). This matches the phenotype side, which already persisted its aligned/segmented images.🤖 Generated with Claude Code