Conversation
…n sync with df Co-authored-by: Cursor <cursoragent@cursor.com>
Split config/panel.py over multiple files
pd.concat upcast bool flags to float (True → 1.0), and sample_hashing_mask did not treat "1.0" as hashing, so sample calling saw an empty hashing set. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…iptions. Co-authored-by: Cursor <cursoragent@cursor.com>
…type. Co-authored-by: Cursor <cursoragent@cursor.com>
Multi-panel names are stored as "base + hash", so splitting on "+" without stripping left padded fragments that load_antibody_panel could not resolve. Co-authored-by: Cursor <cursoragent@cursor.com>
Sample calling now records uns["sample_calling"]["collapsed"] and keeps the original panels in uns, so a later patch bump no longer fails when hashing clones are absent from var. Co-authored-by: Cursor <cursoragent@cursor.com>
Edgelist, proximity, and layout reads now share the AnnData helper rename so stored marker ids follow the upgraded var names. Co-authored-by: Cursor <cursoragent@cursor.com>
…s after sample calling.
…can key by product alone.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1eb146b. Configure here.
| # update the anndata var table | ||
| org_var_shape = adata.var.shape | ||
| org_index = adata.var.index.name | ||
| collapsed = sample_calling_hashing_collapsed(adata) |
There was a problem hiding this comment.
Collapsed inference uses upgraded snapshots
Medium Severity
upgrade_adata rewrites panel_metadata__* / panel_df__* to the new panel before calling sample_calling_hashing_collapsed. When the collapsed flag is absent, that helper rebuilds the combination from uns and treats hashing clones as collapsed if those ids are missing from var. After a hashing marker_id rename, var still holds the old names, so an uncollapsed file is inferred as collapsed for the rest of the upgrade (missing-clone skips and collapsed index remaps).
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1eb146b. Configure here.


Description
Add typed panel combination system for PNA.
Adds distinct panel kinds (base / addon / sample-hashing) driven by metadata
panel_type, plusPNAAntibodyPanelCombinationfor samples that use severalpanels together. Shared marker helpers live on
PNAPanel.PNAAntibodyPaneltype with the hierarchy above.PNAAntibodyPanelremains a deprecated alias ofPartialPNAAntibodyPanel(
DeprecationWarningon access; removed in a future release).pixelator.pna.configincludePNAPanel,PartialPNAAntibodyPanel, typed subclasses,PanelType,PNAAntibodyPanelCombination, andpanel_from_*/load_antibody_panel.panel_from_csvreturns a typedPartialPNAAntibodyPanelfrom metadatapanel_type.panel_from_adata/panel_from_pxl_datasetreturn that typeor a combination when several partial panels are stored.
load_antibody_panelalways returns aPNAAntibodyPanelCombination.PNAAntibodyPanelCombination(panel)/PNAAntibodyPanelCombination([p1, p2, ...]). Members must not share thesame
product(including more than one member withproductunset).marker_idvalues must end with-<digits>(e.g.B2M-1) and mustnot collapse to another hashing id (
B2M-1-1next toB2M-1).--panelmay be repeated on demux / collapse / graph..pxlfiles store panels undernum_partial_panels+panel_metadata__{i}/panel_df__{i}(even for a single panel). Legacypanel_metadata+panel_columnsfiles remain readable. Patch bumps viaPNAAntibodyPanelDiff.upgrade_adatamigrate legacyunsto the multi-panellayout (backwards compatibility for bumping patch versions of old pxl files).
are absent from
var. The upgrade recordsuns["sample_calling"]["collapsed"](legacy files are inferred), remapsedgelist / proximity / layout marker columns, and denoise rebuilds AnnData
from the current markers so hashing antibodies are not added back.
rendering.
Fixes: PNA-2699
THIS PR DOES NOT CHANGE ANY PANELS (panel CSVs are unchanged; typed
panel_typeonly applies when metadata sets it).Type of change
API impact vs
dev:PartialPNAAntibodyPanel(or a typed subclass) /PNAAntibodyPanelCombination/PNAPanelinstead ofPNAAntibodyPanel.Existing
PNAAntibodyPanelimports still work but warn.load_antibody_panelreturnsPNAAntibodyPanelCombination.panel_from_csvstill returns a single typed panel, not a combination.PNAAntibodyPanelCombination(...), not a raw dataframe andmetadata. Combination members must have unique
product..pxlfiles store panels undernum_partial_panels+panel_metadata__{i}/panel_df__{i}(even for a single panel). Legacypanel_metadata+panel_columnsfiles are still readable, but are nolonger written (patch bumps migrate them to the new layout).
marker_idvalues must use a-<digits>suffix and must not nest(
B2M-1-1next toB2M-1).How Has This Been Tested?
task testupgrade_adatamigration to multi-panelunsnf-test test tests/proxiome_v2.nf.test --profile=+docker --verboseran on the container built in this PR finished sucesfully.PR checklist:
pyproject.tomland cited it properlyNote
High Risk
Breaking panel API and AnnData write format, with patch-upgrade and marker-remap logic on core PNA pipeline paths (demux through pixel I/O) including post–sample-calling edge cases.
Overview
Introduces a typed PNA panel model and first-class support for multiple panels per sample. The monolithic
PNAAntibodyPanelis split intoPartialPNAAntibodyPanelwithPNABasePanel,PNAAddonPanel, andPNASampleHashingPanel(driven by CSV metadatapanel_type), combined viaPNAAntibodyPanelCombination.load_antibody_panelalways returns a combination;--panelmay be repeated on demux, collapse, and graph.PNAAntibodyPanelremains as a deprecated alias.AnnData /
.pxlpanel storage for new files usesnum_partial_panelsand indexedpanel_metadata__{i}/panel_df__{i}(legacy single-key layout is still read).add_panel_informationand patch bumps viaPNAAntibodyPanelDiff.upgrade_adatafollow that layout. Hashingmarker_idvalues must end with-<digits>and cannot nest (e.g.B2M-1-1besideB2M-1).Sample-called files are handled when panel patch versions differ: upgrades tolerate missing hashing clones in
varusinguns["sample_calling"]["collapsed"](with legacy inference), remap edgelist / proximity / layout marker columns on read, and denoise rebuilds counts from currentvarwhile preserving sample-calling metadata. Sphinx AutoAPI gets a customclass.rstso inheritance links resolve on class pages.Reviewed by Cursor Bugbot for commit 1eb146b. Bugbot is set up for automated code reviews on this repo. Configure here.