Skip to content

Zero-pad proximity score violin plots - #105

Open
maxkarlsson wants to merge 3 commits into
mainfrom
cursor/zero-pad-proximity-scores-4e02
Open

Zero-pad proximity score violin plots#105
maxkarlsson wants to merge 3 commits into
mainfrom
cursor/zero-pad-proximity-scores-4e02

Conversation

@maxkarlsson

@maxkarlsson maxkarlsson commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Description

The per-marker proximity violin plots dropped any cell whose proximity score for that marker was removed by the isotype-background filtering, so each marker's violin was drawn from a different subset of cells. The violins now show every cell for every marker that is plotted, with the filtered-out scores set to 0.

The padding happens in the visualization only. es_data$proximity is unchanged, so no colocalization pairs are added globally.

  • complete_proximity_scores() collects the components before the only_self filter, so a cell is represented even when all of its self-proximity scores were filtered out, and it fills join_count_z as well as log2_ratio.
  • component_proximity_per_marker() uses that completion in place of filtering to self-comparisons.

An earlier commit on this branch completed the proximity table globally during ingestion; that commit is reverted here.

The comparison below uses the package test data, where 22 of 48 cells have a surviving CD18 score:

CD18 proximity violins before and after zero-padding

Type of change

  • Bug fix
  • New feature
  • Breaking change

How Has This Been Tested?

Ran the full testthat suite locally (R 4.6.1, pixelatorR 0.21.0) — no failures. Added an exact-structure test for complete_proximity_scores() covering self-pair and all-pair completion, and regenerated the expected plot data for component_proximity_per_marker(). lintr::lint_package() reports no lints.

PR checklist:

  • I have run R CMD check on the package and it passes.
  • I have made changes to the documentation.
  • I have added tests.
  • I have documented any significant changes in CHANGELOG.md

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Complete the extracted proximity table so every component has a value
for every presented marker pair, filling missing log2_ratio and
join_count_z scores with 0.

Co-authored-by: max.karlsson <max.karlsson@pixelgen.com>
@maxkarlsson
maxkarlsson marked this pull request as ready for review September 4, 2026 15:38

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4733ed4. Configure here.

Comment thread R/processing.R Outdated
cursoragent and others added 2 commits September 4, 2026 16:06
Show every component in the per-marker proximity violin plots, filling
scores that were removed by proximity filtering with 0 instead of
dropping the component from the marker's violin.

Co-authored-by: max.karlsson <max.karlsson@pixelgen.com>
@cursor cursor Bot changed the title Zero-pad missing proximity scores Zero-pad proximity score violin plots Sep 4, 2026
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.

2 participants