Landscape–Clustergram–Enrich
Link a Landscape, Clustergram, and Enrich to move between where cells are, which genes distinguish them, and what those genes mean. The Landscape shows the cells, in tissue or in a UMAP; the Clustergram organizes expression across genes and cell groups; and Enrich interprets a selected group of genes through gene-set enrichment.
How the views connect
| In the Clustergram | Landscape | Enrich |
|---|---|---|
| Click a gene label | Colors cells by that gene; click again to return to clusters | — |
| Click a column label | Shows that group's cells | Receives the group's top marker genes |
| Click a row dendrogram branch | Colors cells by the genes' combined expression | Receives the branch's genes |
| Click a mark | Colors cells by that gene within that group | — |
| In Enrich | Clustergram | Landscape |
|---|---|---|
| Click a term | Its genes' labels turn blue | — |
| Click a gene | Zooms to the gene | Colors cells by the gene |
Selections made in the Landscape do not change the other views. The links run in the browser, so they keep working in a published notebook report.
Spatial data
For spatial data, the Landscape shows the tissue from DegaFiles, with your clusters from an AnnData.
Xenium pancreas: clicking INS colors the islets in the tissue; clicking the islet cluster (9) shows its cells and sends its markers to Enrich; clicking the INS–GCG–SCGN branch sends those genes to Enrich and colors cells by their combined expression; and clicking a term turns its genes blue in the Clustergram.
import scanpy as sc
import celldega as dega
sc.tl.rank_genes_groups(adata, groupby="leiden")
markers = dega.clust.Matrix(adata, groupby="leiden")
markers.filter_by_size(0.05)
markers.norm("row", by="zscore")
markers.cluster(view="rank_genes_groups", levels=[1, 3, 5, 10])
landscape = dega.viz.Landscape(
base_url="https://your-data-host/DegaFiles",
adata=adata,
cluster_attr="leiden",
)
cgm = dega.viz.Clustergram(matrix=markers, rank_dim=3)
dega.viz.spatial_clustergram(landscape, cgm, enrich=True)
The AnnData's obs_names must match the DegaFiles' cell IDs, and the Matrix's
groupby must be the Landscape's cluster_attr. Color is each group's mean
expression, z-scored across groups; dot size is the fraction of the group's
cells that express the gene. Visualize Your Own Data
walks through this example from the instrument output.
Single-cell data
For single-cell data, the Landscape shows the UMAP from an AnnData Zarr store, read directly in the browser, with no DegaFiles. The linked Clustergram adds a higher-dimensional view: which genes distinguish the clusters you see in the UMAP.
Tabula Sapiens, 1.1 million cells and 180 cell types:
- Zooming toward the spermatids updates the CELL and gene bars to the cells in view, and PRM1 colors the spermatid swirl; zoomed out, PRM1 stays confined to it.
- Dragging the column dendrogram slider previews the cell-type tree and its cut, then selecting column dendrogram branches highlights meta-clusters of cell types in the UMAP.
- Double-clicking the spermatid column ranks the genes by spermatid expression, selects the spermatids, and sends their top markers to Enrich, which ranks Germ Cell Testis first. Zooming into the top rows and clicking PRM1 colors its cells.
- Clicking the plasma cell column selects plasma cells across tissues, and Enrich ranks plasma cell gene sets first.
Follow along in the Tabula Sapiens tutorial, or explore the atlas in the Gallery.
adata.layers["counts_csc"] = adata.layers["counts"].tocsc()
adata.write_zarr("cells.zarr")
landscape = dega.viz.Landscape(
zarr_url="cells.zarr", zarr_layer="counts_csc", cluster_attr="leiden"
)
cgm = dega.viz.Clustergram(matrix=markers, rank_dim=3) # markers as above
dega.viz.spatial_clustergram(landscape, cgm, enrich=True)
A Clustergram can also show individual cells instead of cluster summaries, for example a single-cell Clustergram of a selected population; the Chromium PBMC tutorial links both kinds to UMAP Landscapes.
Try the linked selections
- Click a gene in the Clustergram. The Landscape colors cells by that gene's expression, in tissue or the UMAP.
- Select a cell group in the Clustergram. The Landscape shows those cells, and Enrich receives the group's top marker genes.
- Select a gene group with the row dendrogram. Enrich looks up the genes in the selected library.
- Select an enriched term. Its genes are highlighted in the Clustergram.
- Click a gene in Enrich. The Clustergram zooms to that gene and the Landscape colors cells by its expression.
A focused gene and the enrichment gene set are kept separate: inspecting one gene does not replace the multi-gene enrichment query.
Examples and reference
- Visium HD tutorial: a complete spatial Landscape–Clustergram–Enrich workflow.
- Narrated walkthrough: watch the linked spatial workflow.
- Chromium PBMC tutorial and Tabula Sapiens tutorial: single-cell UMAP Landscapes linked to Clustergrams and Enrich.
- Python linking API: layout and enrichment options.
- CellCloud–Clustergram: the same linking for cells in 3D.
Source: linking helpers.
Screenshot sources
The animations show the Xenium pancreas DegaFiles with the
hosted Scanpy AnnData,
and the Tabula Sapiens tutorial
(Tabula Sapiens Consortium, via CZ CELLxGENE Discover, CC BY 4.0),
captured with Celldega 0.28.0 using
scripts/docs_screenshots/capture.py.

