Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Explore a remote dataset

Plot gene expression across the 1,136,218 cells of the Tabula Sapiens atlas The Tabula Sapiens Consortium & Quake, 2024 and save your own cell selection locally, without downloading the count matrix. The atlas covers 28 human tissues from 24 donors, with counts for 60,606 genes and the authors’ labels for 180 cell types. On the authors’ UMAP, the B-cell marker MS4A1 is high in one compact region of the immune compartment and is detected in 93.2% of the 114,495 B cells, 9.0% of the plasma cells and 3.1% of the other immune cells. Saving the B cells as your own selection creates a local directory of 166 MB.

The atlas is a public CyteArc store in a Hugging Face bucket, read through its hf:// URI: each step fetches only the cell metadata and count chunks that it needs. The code needs an internet connection and CyteArc’s extra dependencies, but no credentials.

Open the atlas read-only

zarr_mode="r" opens the store without write access, which suits a shared, published dataset, and storage_options={"token": False} reads it anonymously. artifacts.find returns an ArtifactRef, a reference to a saved result, here the UMAP imported from the authors’ dataset; every plot below passes it as layout. I is the boolean column that marks the active cells, the cells that analyses use by default, and key="I" reads the published labels of those cells:

Started: 2026-11-18T00:16:06.058039Z | Wall time: 1.423 s

{'cells': 1136218, 'genes': 60606, 'donors': 24, 'tissues': 28, 'cell types': 180}

Started: 2026-11-18T00:16:07.485409Z | Wall time: 7.678 s

Plot a marker in one population

MS4A1 encodes CD20, a surface protein of B cells. facet_by="cell_type" with groups=["B cell"] draws only the cells that the authors annotated as B cells, without writing anything to the read-only store. NormalizationSpec(transform="log1p") colors each cell by log(1 + x), where x is the number of MS4A1 counts per 1,000 counts in that cell, and quantiles=(0, 0.99) caps the color scale at the 99th percentile of the drawn cells:

The authors' Tabula Sapiens UMAP showing only the 114,495 cells annotated as B cells, colored by MS4A1 as log(1 + counts per 1,000) on a white-to-dark-red scale from 0 to about 1.5, capped at the 99th percentile of these cells. Nearly all B cells form one region of two overlapping lobes at the lower left, with a smaller island at its upper left and a few cells scattered across the rest of the layout; MS4A1 is red to dark red across the main region.

Started: 2026-11-18T00:16:15.169200Z | Wall time: 12.566 s

Nearly all of the 114,495 B cells lie in one region at the lower left of the UMAP, and MS4A1 is high throughout that region.

Compare with the full atlas

Draw MS4A1 for all 1,136,218 cells beside the compartments that the authors assigned:

Two panels of the authors' UMAP of all 1,136,218 Tabula Sapiens cells. Left: MS4A1 as log(1 + counts per 1,000) on a white-to-dark-red scale from 0 to about 0.9, capped at the 99th percentile of all cells; the lower-left region is dark red, and the rest of the atlas is near white with faint scattered signal, most visible in the upper-left immune region. Right: the published compartments, with immune cells in red filling the left half of the layout, endothelial cells in blue at the top, stromal cells in pink at the right, epithelial cells in orange at the bottom right, and small germline and neural groups between them; the dark red MS4A1 region lies inside the immune compartment.

Started: 2026-11-18T00:16:27.739069Z | Wall time: 18.221 s

MS4A1 is high in one compact region of the immune compartment, the region that holds the B cells, and faint or absent elsewhere. The color scale tops out lower than in the B-cell plot because its cap is now the 99th percentile of all cells, most of which have no MS4A1 counts.

Measure where MS4A1 is detected

get_cell_vals reads one gene’s values, normalized to counts per 1,000, into a NumPy array. It reads the cells in I in the order of the cell table, so the values line up with the labels read above. Group the cells by their published labels and count how often MS4A1 is detected in each group:

CellsMS4A1 detected (%)
B cells11449593.2
Plasma cells273499.0
Other immune cells4504753.1
Other compartments5438990.8

Started: 2026-11-18T00:16:45.964671Z | Wall time: 2.916 s

MS4A1 is detected in 93.2% of the 114,495 B cells. Plasma cells derive from B cells but stop expressing CD20: only 9.0% of the 27,349 plasma cells have an MS4A1 count. Detection falls to 3.1% of the 450,475 other immune cells and 0.8% of the 543,899 cells in the other compartments; the scattered cells with a count make up the faint signal outside the B-cell region.

Save the B cells in a mount

A read-only store cannot hold your own columns or results. cytearc.mount_datastore creates a mount: a writable store at a new path that copies the source’s cell and feature metadata and records the source’s URI. Count matrices and the source’s saved results, such as the authors’ UMAP, stay in the source and are read from it when a step needs them, while every write goes to the mount. Several people can mount the same source and keep separate analyses.

By default, the first writable open of a store removes the cells with 10 or fewer detected genes from I. min_features_per_cell=-1 turns that filter off, so the mount keeps the source’s active cells as they are. The B cells go into b_cells, a second boolean column. Both are cell keys, columns that an analysis can take as its input cells. Choose a new or empty path for the mount:

{'active cells': 1136218, 'B cells selected': 114495, 'mount size (MB)': 166}

Started: 2026-11-18T00:16:48.884346Z | Wall time: 11.952 s

All 1,136,218 cells stay active, and b_cells marks the 114,495 B cells. The mount takes 166 MB on disk, all of it copied metadata and the new column, while the 1,136,218 × 60,606 count matrix stays in the bucket.

Reopen your work

Open the mount’s path with cytearc.DataStore in a later session. The mount records its source’s URI but never saves storage options or credentials, so pass storage_options again. Then reopen the source read-only and check that b_cells is in the mount and not in the source:

{'selection preserved': True, 'shared source unchanged': True}

Started: 2026-11-18T00:17:00.840916Z | Wall time: 1.487 s

Both checks are True: the mount kept b_cells, and the source has no such column. The author_umap reference found on the source also draws the mount’s own column:

The authors' UMAP of all Tabula Sapiens cells, drawn from the mount, with the 114,495 cells of the saved b_cells column in blue and all other cells in light gray. The blue cells fill the lower-left region where MS4A1 is high in the previous figures.

Started: 2026-11-18T00:17:02.330925Z | Wall time: 10.466 s

The mount draws its own b_cells column on the source’s UMAP: the B cells fill the same lower-left region as in the first figure. Keep tabula_analysis.zarr to return to the analysis, and keep the source reachable. Reopening fails if the source’s counts have changed since the mount was made, and later changes to the source’s annotations never reach the mount’s copy; what a mount preserves lists what the mount records.

Continue with your analysis

  • Analyze the B cells: reopened.pipeline.rna(cells="b_cells", label="b_cells") runs the RNA recipe on the B cells that pass its quality-control filter and saves the run in the mount. Without cells, the recipe starts from every active cell.

  • Find another dataset: CyteBase publishes public datasets as stores that open the same way, by URI; CyteBase datasets shows how to find one and build its URI.

  • Connect your own storage: Remote storage configuration covers S3 and Google Cloud Storage access, source requirements and local scratch settings.

  • Work offline: download the prepared Tabula Sapiens sample in the Quick start.

References
  1. The Tabula Sapiens Consortium, & Quake, S. R. (2024). Tabula Sapiens reveals transcription factor expression, senescence effects, and sex-specific features in cell types from 28 human organs and tissues. openRxiv. 10.1101/2024.12.03.626516