You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Overall: The parallel-section approach is right. Proteins are a separate modality
that still maps onto the same cell-coloring mechanism, so a sibling section next to the
gene section is the natural model. The code mirrors the gene path (meta_gene / selected_genes / bar callbacks) closely, which makes it easy to follow. The cleanest
part is generalizing update_cell_exp_array to take a feature_store + { dataType }
and switch the cbg/cbp directory — that's the correct shared abstraction. Issues to
address before this is the final shape:
1. No backend/data support exists yet
run_pre_processing.py and dega.pre only produce cbg/ and meta_gene.parquet.
Nothing generates cbp/ or meta_protein.parquet. This branch is frontend-only against
files that don't exist yet — need to decide whether the data-prep side lands first/together.
2. The protein section always renders, even with no protein data
There's no is_protein flag analogous to the existing is_nbhd pattern. set_meta_protein
swallows its error and sets empty arrays, and ui_containers.js unconditionally appends protein_container. Net effect: every existing dataset now fires a meta_protein.parquet
request that 404s and renders an empty "PRT" section. Most important fix — gate the whole
section on a viz_state.proteins.is_protein flag set from a landscape parameter, mirroring is_nbhd.
3. Mutual exclusion via scattered manual resets is fragile
"Selecting a protein clears the gene/cat selection" is implemented by sprinkling update_selected_proteins(viz_state.proteins, [], obs_store) into ~12 call sites (every
gene/cat/nbhd/dendro/search/cgm callback). This was already a smell with genes↔cats; a third
modality makes it combinatorial and easy to miss a site. Consider a single clear_feature_selections(viz_state, { except }) helper or a single "active feature" concept.
Guards like if (viz_state.proteins && ...), top_protein_counts || [], and if (!viz_state.proteins.svg_bar_protein) suggest uncertainty about init. It is always
initialized (both landscape_ist and landscape_sst). Guarantee init once and drop the
defensive noise — it hides ordering bugs rather than preventing them. The if (viz_state.obs_store.selected_proteins) guards are also dead since create_obs_store
always creates those observables now.
5. landscape_sst gets the state object but no section
landscape_sst.js initializes viz_state.proteins = {...} but never calls set_meta_protein
and never builds a protein bar. Dead state in the SST path — either wire it up or don't
initialize it there.
6. Smaller things
Inconsistent UI construction: the PRT label is a hand-styled inline div, while
cell/TRX/NBHD use make_button(...). Reuse make_button; also its blue collides with
the TRX button's blue.
No visual gene/protein distinction:get_cell_color returns red [255,0,0] for any
expression, so protein-colored cells look identical to gene-colored ones. color_dict_protein
is loaded but only used for bar colors, not cell coloring — decide whether that's intended.
max_exp ... ?? 1 fallback in update_cell_exp_array silently changes the gene path:
a missing meta_gene[gene].max previously threw, now it normalizes to 1.
No model sync:selected_genes.js has sync_selected_genes (pushes to the Python widget
model); there's no sync_selected_proteins. Fine if not needed yet, just flagging the asymmetry.
No protein search box to parallel the gene search — bars only.
Bottom line
Keep the parallel-section direction and the feature_store/dataType generalization. Before
merge: (a) an is_protein gate so non-protein datasets are untouched, (b) a centralized
selection-reset rather than scattered manual clears, and (c) a decision on whether the data-prep
side ships alongside. Items 4–6 are cleanup.
cornhundred
changed the title
Add protein expression column to landscape view
codex/add-column-for-cell-by-protein-visualization
Jun 28, 2026
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
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
Testing
https://chatgpt.com/codex/tasks/task_b_68fa1ede6bec8331a305d7785df2f839