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.

Quick start

Plot a saved RNA analysis of 100,000 human cells sampled across the tissues of the Tabula Sapiens atlas The Tabula Sapiens Consortium & Quake, 2024, then run the same RNA recipe on your own counts. The cells come from 24 donors, and the authors annotated them with 172 cell types. The analysis grouped the cells into 52 clusters without using those labels. In eight of the ten largest clusters, one published cell type makes up most of the cells, from 56% endothelial cells in cluster 7 to 96% neutrophils in cluster 5; each of the other two holds several related types, such as monocytes and classical monocytes.

Install CyteArc with its extra dependencies first.

Download and plot the saved analysis

The code below downloads a CyteArc store, a Zarr directory that holds the 100,000 cells with their counts for 60,606 genes, the authors’ annotations and the saved analysis. The cells were sampled in proportion to the atlas’s cells from each donor in each tissue. The download is about 1.5 GB, and running the cell again reuses the downloaded store, with anything saved in it. For a smaller download, start with the PBMC analysis, and to explore every cell of the atlas without downloading it, open the full atlas remotely.

Started: 2026-11-14T15:42:40.911794Z | Wall time: 25.932 s

Open the store with cytearc.DataStore and its saved analysis, labeled rna, with ds.pipeline.open(label="rna"). The result is a pipeline run, the record of one call to the RNA recipe ds.pipeline.rna: the settings of that call and the results it saved, from normalized counts to clusters and marker genes. ds.pipeline.open only reads these results, while ds.pipeline.rna computes a new run. Passing run=run to ds.plots.embedding draws the run’s UMAP. Each CellField names a column to color by and the title of its panel, here the clusters that the run saved and the cell types that the authors published:

Two UMAP panels of the same 100,000 cells, side by side, with each cell at the same position in both. Left, titled Saved Leiden clusters: cells colored by the run's 52 clusters, the ten largest numbered on the data. Right, titled Published cell types: cells colored by the authors' 172 cell types, many in similar colors, the ten most common named on the data. The large central island holds clusters 4, 2 and 1 from top to bottom, under the CD8-positive alpha-beta T cell, CD4-positive alpha-beta T cell and B cell labels; clusters 5, 6, 7, 3 and 10 lie under the neutrophil, macrophage, endothelial cell, fibroblast and stromal cell of ovary labels. No label falls on cluster 8, on the left, or cluster 9, at the top, and the bladder urothelial cell label sits to the right of the B cell label, with the basal cell label below it.

Started: 2026-11-14T15:43:06.847849Z | Wall time: 6.368 s

Both panels place each cell at the same position, and eight of the ten numbered clusters lie under one of the ten named types. The central island holds cluster 4 under the CD8-positive T-cell label, cluster 2 under the CD4-positive label and cluster 1 under B cell. Clusters 3, 5, 6, 7 and 10 lie under fibroblast, neutrophil, macrophage, endothelial cell and stromal cell of ovary. No label falls on clusters 8 and 9. Many of the 172 cell types share similar colors on the right, so read that panel by its labels.

Inspect the store and its run

ds lists what the store holds:

DataStore has 100000 (100000) cells with 1 assays: RNA Cell metadata: 'I', 'ids', 'names', '10X_run', 'RNA_nCounts', 'RNA_nFeatures', 'RNA_percentMito', 'RNA_percentRibo', '_scvi_batch', '_scvi_labels', 'ambient_removal', 'anatomical_position', 'assay', 'assay_ontology_term_id', 'broad_cell_class', 'cdna_plate', 'cdna_well', 'cell_type', 'cell_type_ontology_term_id', 'compartment', 'development_stage', 'development_stage_ontology_term_id', 'disease', 'disease_ontology_term_id', 'donor_assay', 'donor_id', 'donor_method', 'donor_tissue', 'donor_tissue_assay', 'ethnicity_original', 'free_annotation', 'is_primary_data', 'library_plate', 'manually_annotated', 'method', 'n_genes_by_counts', 'notes', 'observation_joinid', 'pct_counts_ercc', 'pct_counts_mt', 'published_2022', 'replicate', 'sample_id', 'sample_number', 'scvi_leiden_donorassay_full', 'self_reported_ethnicity', 'self_reported_ethnicity_ontology_term_id', 'sex', 'sex_ontology_term_id', 'suspension_type', 'tissue', 'tissue_in_publication', 'tissue_ontology_term_id', 'tissue_type', 'total_counts', 'total_counts_ercc', 'total_counts_mt' RNA assay has 60606 features and following metadata: 'I', 'ids', 'names', '_index', 'dropOuts', 'ercc', 'feature_biotype', 'feature_length', 'feature_reference', 'feature_type', 'genome', 'mean', 'mean_counts', 'mt', 'nCells', 'n_cells_by_counts', 'pct_dropout_by_counts', 'std', 'total_counts'

Started: 2026-11-14T15:43:13.219235Z | Wall time: 0.080 s

The first line counts the active cells, which analyses use by default, and in parentheses every cell of the store: all 100,000 are active. The store has one RNA assay with 60,606 genes. Its cell table, ds.cells, holds the authors’ metadata, such as cell_type, tissue and donor_id. The run saved copies of the cell columns passed to ds.pipeline.rna as snapshot_columns, cell_type and donor_id among them, so its plots and tables keep the labels it ran with even if ds.cells changes later. run.cells reads these copies beside the run’s results, and run.report() returns the settings that the run recorded. Count the donors, cell types and clusters, and read the main settings:

{'analyzed cells': 100000, 'donors': 24, 'published cell types': 172, 'variable genes': 2000, 'principal components': 30, 'neighbors per cell': 21, 'Leiden resolution': 1.0, 'saved clusters': 52}

Started: 2026-11-14T15:43:13.302423Z | Wall time: 0.113 s

The run analyzed all 100,000 cells with 2,000 variable genes, 30 principal components and 21 neighbors per cell, and saved the Leiden clustering at resolution 1.0, which has 52 clusters. These are the run’s own settings; the example in the last section runs the recipe with its defaults, which differ from them.

Compare the clusters with the published cell types

For each of the ten largest clusters, the table gives its most common published cell type and that type’s share of the cluster’s cells, and the lines below it break down the two clusters where that share is lowest:

cellsmost common cell typeshare of cluster
clusters
19463B cell0.80
28561CD4-positive, alpha-beta T cell0.61
37914fibroblast0.66
45098CD8-positive, alpha-beta T cell0.65
55024neutrophil0.96
64448macrophage0.74
74438endothelial cell0.56
83726monocyte0.42
93565smooth muscle cell0.42
103391stromal cell of ovary0.89

Started: 2026-11-14T15:43:13.417441Z | Wall time: 0.055 s

Cluster 8: 42% monocyte, 37% classical monocyte, 9% macrophage
Cluster 9: 42% smooth muscle cell, 20% pericyte, 13% blood vessel smooth muscle cell

Started: 2026-11-14T15:43:13.475060Z | Wall time: 0.011 s

Cluster 5 is 96% neutrophils, cluster 10 is 89% ovarian stromal cells and cluster 1 is 80% B cells. Cluster 2 is 61% CD4-positive and cluster 4 is 65% CD8-positive alpha-beta T cells, so the two clusters follow the CD4 and CD8 split of the annotation. Clusters 8 and 9 have no majority type because the annotation splits their cells among related labels: cluster 8 is 42% monocytes and 37% classical monocytes, and cluster 9 is 42% smooth muscle cells, 20% pericytes and 13% blood vessel smooth muscle cells.

Analyze your own RNA-seq data

To analyze a filtered Cell Ranger HDF5 file, convert it to a CyteArc store, open the store and run the RNA recipe:

import cytearc

# Convert the filtered Cell Ranger counts into a new store.
reader = cytearc.CrH5Reader("filtered_feature_bc_matrix.h5")
cytearc.CrToZarr(reader, zarr_loc="analysis.zarr").dump()

# Run the RNA recipe with its default settings and plot the clusters it saves.
ds = cytearc.DataStore("analysis.zarr")
run = ds.pipeline.rna(label="baseline")
ds.plots.embedding(run=run, color_by="clusters")

CrToZarr raises FileExistsError if analysis.zarr already holds data. Pass overwrite=True to replace a conversion that no DataStore has opened yet; once a store has been opened, convert into a new path or delete the old store yourself.

With its default settings, the recipe filters cells on their quality-control metrics, scores the cell cycle, selects highly variable genes, normalizes their counts by library size and log-transforms them, reduces the normalized values with PCA, builds a neighbor graph, embeds it with UMAP, clusters it with Leiden at several resolutions and saves the resolution with the best silhouette score, scores doublets and ranks the marker genes of each cluster. Pass a stage’s settings as a keyword to change them, such as hvg={"top_n": 2000}, pca={"dims": 30} and neighbors={"k": 21}, the values that the saved Tabula Sapiens run used. run.report() returns the settings with each stage’s summary and warnings, such as the cells that filtering removed. Before you interpret a new dataset, check that filter with the quality-control tutorial.

Keep run to plot and read marker tables without recomputing them. A label names one completed run in a store: calling the recipe again with label="baseline" raises a ValueError, so reopen that run with ds.pipeline.open(label="baseline") or give a new run a new label.

Continue with the page that fits your next step:

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