Conversation
|
Current version of PR was reviewed by /review-bugbot with additional instructions on Aug 20, 12:11 GMT+2. It flagged 2 findings. Show 2 findings1. Legacy patch bump skips uns
2. Deserialization mutates adata uns
Bugbot on commit |
…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>
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 4a630f5. Configure here.
| nodes_to_remove: pl.DataFrame, | ||
| hash_info: pl.DataFrame, | ||
| panel: PNAAntibodyPanel, | ||
| panel: PNAAntibodyPanelCombination, |
There was a problem hiding this comment.
Dehashed panel metadata stays hashed
High Severity
Sample calling builds AnnData with the full panel (including hashing) via pna_edgelist_to_anndata, which stores independent panel_df__{i} snapshots in uns, then drops hashing markers from var without updating those snapshots. Unlike the legacy path that rebuilt the panel from var, PNAAntibodyPanelCombination.from_adata now restores hashing members from uns, so dehashed .pxl files keep hashing antibodies in recovered panel metadata.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 4a630f5. 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_csv,panel_from_adata,panel_from_pxl_dataset,load_antibody_panel) return a typed panel or a combination from metadata.PNAAntibodyPanelCombination(panel)/PNAAntibodyPanelCombination([p1, p2, ...]).--panelarguments; AnnData / pxl round-trips carrymulti-panel metadata and can bump compatible patch versions.
.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 (i.e. backwards compatability for bumping patch versions of old pxl files).
sample_hashingcomparisons accept both bool columns (CSV parse) and legacyyes/nostrings viasample_hashing_mask.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.PNAAntibodyPanelCombination(...), not a raw dataframe andmetadata.
.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).
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
Medium Risk
Refactors the core panel type used across the PNA pipeline and changes AnnData write format, though legacy reads and a deprecated import path limit breakage; incorrect multi-panel or hashing handling could affect demux and sample calling.
Overview
Introduces a typed PNA panel model so one sample can use several panels (base, addon, sample-hashing) together. The monolithic
PNAAntibodyPanelis split intoPNAPanel→PartialPNAAntibodyPaneland typed subclasses (PNABasePanel,PNAAddonPanel,PNASampleHashingPanel), withPNAAntibodyPanelCombinationas the object passed through demux, collapse, graph, sample calling, and AnnData/pxl I/O. CSV metadata may setpanel_type; factories (panel_from_csv,panel_from_adata,load_antibody_panel, etc.) dispatch to the right class or build a combination.API and CLI:
load_antibody_panelalways returns aPNAAntibodyPanelCombination(even for one panel). CLI--panelis repeatable for multi-panel runs.PNAAntibodyPanelremains as a deprecated alias ofPartialPNAAntibodyPanel(DeprecationWarningon access).Persistence: New AnnData/pxl files store
num_partial_panels,panel_metadata__{i}, andpanel_df__{i}instead of legacypanel_metadata+panel_columns; readers still accept the old shape, andPNAAntibodyPanelDiff.upgrade_adatamigrates legacyunson patch bumps.Bugfix: Combining a base panel without
sample_hashingwith a hashing panel no longer drops hashing markers—sample_hashing_masknormalizes bool/string/float-upcast values afterpd.concat.Docs add an AutoAPI
class.rstoverride so inheritance Bases: links resolve on own-page class docs.Reviewed by Cursor Bugbot for commit 4a630f5. Bugbot is set up for automated code reviews on this repo. Configure here.