Skip to content

feat(panel): validate hashing marker ids and keep collapsed bases - #481

Merged
Aratz merged 9 commits into
pna-3624_combined_panelsfrom
cursor/02-hashing-marker-id-helpers-e226
Oct 6, 2026
Merged

Aratz merged 9 commits into
pna-3624_combined_panelsfrom
cursor/02-hashing-marker-id-helpers-e226

Conversation

@Aratz

@Aratz Aratz commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Hashing marker ids must have a numeric suffix, must not nest, and must not duplicate another marker id.
  • Sample calling keeps a collapsed hashing base in the count matrix when that base is not itself on the panel.
  • The isotype mask is taken from the panel, because that collapsed base has no control value in var.
  • First panel pull request in the stack. The panel-sources pull request is based on this branch.

Test plan

  • CI passes (ruff, ruff format, mypy, pytest)
  • Duplicate marker ids and nested hashing suffixes are rejected
  • Sample calling keeps a collapsed base that the panel does not define

Made with Cursor

cursoragent and others added 2 commits October 5, 2026 12:15
Hashing ids must end with -<digits> and must not nest. Sample calling keeps a collapsed base that the panel does not define.

Co-authored-by: Adrien Coulier <adrien.coulier@pixelgen.com>
A count-matrix column that is not on the panel has no control flag in var after the join.

Co-authored-by: Adrien Coulier <adrien.coulier@pixelgen.com>

@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.

Stale Bugbot comment from a previous run.

markers=_count_markers_after_hash_collapse(
panel, hashing_antibody_mapping.hashing_antibodies
),
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Collapsed bases break panel reload

Medium Severity

Sample calling now keeps a collapsed hashing base in var when that id is not a panel row, so control and sequences are missing. PNAAntibodyPanel.from_adata treats every var row as a panel marker, and validation then fails. Denoise reloads the panel from the pxl file and only catches KeyError, so a dehashed file with an extra collapsed base crashes that step.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e475f94. Configure here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets ignore this bugbot comment, wont apply once we merge the stack

@Aratz
Aratz requested a review from elhb October 5, 2026 14:45
@Aratz
Aratz changed the base branch from dev to pna-3624_combined_panels October 6, 2026 12:12
@Aratz
Aratz added this pull request to stack #490 October 6, 2026 12:13
Aratz added 3 commits October 6, 2026 14:59
The panel df is already validated and curated when the panel is created.
There is no need for extra checks when using the panel

@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.

There are 2 total unresolved issues (including 1 from previous review).

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 3e00755. Configure here.


total_marker_counts = node_counts_df.sum(axis=1)
isotype_markers = adata.var[adata.var["control"]].index
isotype_markers = panel.df.index[panel.df["control"]]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Off-panel markers break panel reload

Medium Severity

pna_edgelist_to_anndata can now put collapsed hashing bases that are not on the panel into var. add_panel_information left-joins those rows, so control and sequences become missing. from_adata then treats every var row as a panel row and validation fails, so from_pxl_dataset cannot reload a dehashed file that kept an off-panel base.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3e00755. Configure here.

@Aratz
Aratz merged commit 8bcf0e3 into pna-3624_combined_panels Oct 6, 2026
13 checks passed
@Aratz
Aratz deleted the cursor/02-hashing-marker-id-helpers-e226 branch October 6, 2026 13:52
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.

3 participants