Skip to content

Dega 667 set collection signatures - #344

Merged
cornhundred merged 14 commits into
mainfrom
DEGA-667-SetCollection_signatures
Oct 2, 2026
Merged

cornhundred merged 14 commits into
mainfrom
DEGA-667-SetCollection_signatures

Conversation

@cornhundred

Copy link
Copy Markdown
Collaborator

No description provided.

@cornhundred

cornhundred commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

0.26.0: SetCollection signatures, compact Clustergram controls, browser-side Enrich linking

Breaking

  • Matrix no longer normalizes on construction: process() and the filter_genes / norm_col / norm_row / disable_processing arguments are removed. Call filter() / norm() explicitly.
  • Marker ranking lives only in SetCollection: Matrix.marker_ranks, Matrix.set_marker_ranks() and downsample_to(rank_genes_groups=...) are removed.
  • Matrix.cluster() returns the Matrix (for chaining) instead of a dict.
  • calc_signature(rank_genes_groups=True) no longer silently ranks adata.raw. By default, raw counts are log-normalized (log1p(normalize_total), as Scanpy recommends) before ranking; use_raw=True explicitly ranks adata.raw.
  • Clustergram ↔ Enrich linking is entirely browser-side (jslink), so live and static notebooks behave the same. Python observers removed.
  • The unimplemented SetCollection.to_nbhd() stub is removed.

Added

  • calc_signature: fraction_expressing_layer, rank_genes_groups_layer, var["{set_col}_marker"] (each gene's best-scoring cluster), expression-source reporting and raw-count warnings.
  • Matrix(..., size_by_layer=...).
  • Clustergram category-bar source dropdown (static attributes + manual category); category hover outline.
  • Docs: Atera breast cancer and Visium HD human CRC Landscape + Clustergram + Enrich tutorials; sidebar toggle icon, also on gallery pages; Web Presentations moved to the bottom of the gallery.

Changed

  • Compact Clustergram control panel: ROW/COL grid with order dropdowns and dendrogram sliders, DIM row, CROP | UNDO, PROP | UNIT. Category bars styled to match the Landscape.
  • Changing the DIM level keeps each axis's order; a column order sorted by a gene falls back to CLUST only if that gene leaves the view.
  • Logo moved into the gene search bars (Clustergram, Landscape, CellCloud, NeighborhoodCloud).
  • spatial_clustergram sizes the Clustergram panel from its canvas (min 550px).
  • Renames with deprecated aliases: cluster(view=), cut_tree(), size_matrix / set_size_matrix().
  • Tooltip and bar-hover dwell delays; the manual-category dialog closes on outside clicks; Enrich link is blue, with logo spacing.

Fixed

  • Render crash with static + manual categories; manual categories missing from the bars; new color on every keystroke.
  • calc_signature: use_raw=True with an aggregation layer raised; mask_var was lost during automatic log-normalization.
  • write_dega_files() without name=; .h5mu reload of SetCollection attributes.
  • Wheel gestures over the Clustergram canvas or any widget control panel no longer scroll the page; scrollable boxes in the panels (bar plots, slider stacks, gene info) still scroll.

Review guide

Area Start here
Matrix API cleanup src/celldega/clust/matrix.py (constructor, cluster, cut_tree, set_size_matrix)
SetCollection signatures src/celldega/set/collection.py → calc_signature (marker source / use_raw resolution, _log_normalized, {set_col}_marker)
Enrich linking src/celldega/viz/__init__.py (_link_clustergram_to_enrich); js/global_variables/selected_genes.js (enrichmentSelection)
Control panel js/ui/ui_containers.js (make_matrix_ui_container, block_page_scroll_in_panel); js/ui/text_buttons.js (make_reorder_dropdown, apply_reorder)
Category bars js/ui/matrix_cat_bars.js (get_bar_sources, compute_breakdown, render_axis_cat_bar)
Order across views js/deck-gl/matrix/rank_views.js (carry_order_across_view)
Hover / outline js/deck-gl/matrix/cat_layers.js (ini_cat_outline_layer); js/deck-gl/matrix/matrix_layers.js (layer_filter)
Manual category editor js/ui/attribute_editor.js (draft color, outside-click close)
Search + logo js/ui/logo.js (embed_logo_in_search)
Layout sizing spatial_clustergram (_clustergram_panel_width)

Skip: *.ipynb (embedded widget state), src/celldega/static/celldega.js, docs/assets/js/celldega.js (built bundle).

Testing

  • 467 Python and 289 JS tests pass. New tests cover marker defaults and use_raw / mask_var, leiden_marker, panel sizing, browser link registration, enrichment selection labels, manual-category bars (jsdom), order carry-over across views and control-panel wheel handling.
  • Docs notebooks re-executed; headless-Chrome render checks show no console errors.

🤖 Generated with Claude Code

@cornhundred
cornhundred marked this pull request as ready for review October 2, 2026 16:11

@cornhundred cornhundred left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Tested local notebooks and completed high-level review of Python API changes,

@cornhundred
cornhundred merged commit 1620eda into main Oct 2, 2026
9 checks passed
@cornhundred
cornhundred deleted the DEGA-667-SetCollection_signatures branch October 2, 2026 18:21
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.

1 participant