Compare what RNA, chromatin accessibility (ATAC), and surface protein (antibody-derived tags, ADT) each separate in 6,194 human peripheral blood mononuclear cells (PBMCs), where TEA-seq measured all three in every cell Swanson et al., 2021. Then open a saved integration of the three by weighted nearest neighbors (WNN) and measure how much each modality contributes in each cell type: WNN gives each cell one weight per modality, and the three weights sum to 1. Protein carries the most weight: 0.49 on average, against 0.31 for ATAC and 0.19 for RNA. Protein leads in all four T-cell subsets, most of all in the naive CD4 and CD8 T cells, which overlap on the RNA and ATAC maps. ATAC leads in B cells, and RNA in CD16 monocytes.
Open the prepared store¶
The prepared store holds the counts of the 7,069 cells in the GSM5123951 Seurat object: 36,601 genes, 240,122 ATAC peaks, and 46 antibodies. Of these cells, 6,194 are active, the subset that CyteArc analyzes by default: those whose barcodes match the cell-type labels of the publication’s Figure 4, so every analyzed cell has a publication cell type. ds lists the active cells first and all stored cells in parentheses.
# Import CyteArc with its selectors for cell fields and features, pandas for the tables, and Matplotlib for the figure layouts.
import matplotlib.pyplot as plt
import pandas as pd
import cytearc
from cytearc.plotting import CellField, FeatureRef
# Keep routine logs and progress bars out of the page.
cytearc.configure_output(level="WARNING", progress=False)
# Download the prepared TEA-seq store, which holds the counts and the saved analysis runs.
dataset = cytearc.datasets.connect("cytearc_docs").download_dataset(
"swanson_7K_pbmc_teaseq",
destination="cytearc_datasets",
zarr=True,
)
# Open the store with RNA as the default assay.
ds = cytearc.DataStore(f"{dataset}/data.zarr", default_assay="RNA", nthreads=4)
dsDataStore has 6194 (7069) cells with 3 assays: ADT ATAC RNA
Cell metadata:
'I', 'ids', 'names', 'ADT_UMAP1', 'ADT_UMAP2',
'ADT_leiden_cluster', 'ADT_nCounts', 'ADT_nFeatures', 'ATAC_UMAP1', 'ATAC_UMAP2',
'ATAC_leiden_cluster', 'ATAC_nCounts', 'ATAC_nFeatures', 'DoubletEnrichment', 'DoubletScore',
'RNA+ATAC+ADT_UMAP1', 'RNA+ATAC+ADT_UMAP2', 'RNA+ATAC+ADT_leiden_cluster', 'RNA+ATAC+ADT_wnn_UMAP1', 'RNA+ATAC+ADT_wnn_UMAP2',
'RNA+ATAC+ADT_wnn_leiden_cluster', 'RNA_UMAP1', 'RNA_UMAP2', 'RNA_leiden_cluster', 'RNA_nCounts',
'RNA_nFeatures', 'TSSEnrichment', 'altius_count', 'altius_frac', 'barcodes',
'batch_id', 'cell_name', 'chip_id', 'gene_bodies_count', 'gene_bodies_frac',
'nCount_ADT', 'nCount_ATAC', 'nCount_RNA', 'nFeature_ADT', 'nFeature_ATAC',
'nFeature_RNA', 'n_duplicate', 'n_fragments', 'n_mito', 'n_unique',
'orig.ident', 'original_barcodes', 'pbmc_sample_id', 'peaks_count', 'peaks_frac',
'publication_barcode', 'tea_cell_type', 'tea_cell_type_color', 'tea_predicted_cell_type', 'tea_prediction_score',
'tss_count', 'tss_frac', 'well_id'
ADT assay has 46 features and following metadata:
'I', 'ids', 'names', 'dropOuts', 'nCells'
ATAC assay has 240122 features and following metadata:
'I', 'ids', 'names', 'dropOuts', 'nCells'
RNA assay has 36601 features and following metadata:
'I', 'ids', 'names', 'dropOuts', 'nCells'Started: 2026-11-14T15:42:40.636728Z | Wall time: 26.946 s
The store holds five saved pipeline runs, each a recorded analysis with its settings and results. The rna, atac, and adt runs each analyze one modality over the 6,194 active cells: RNA with library-size normalization, a log transform, and PCA; ATAC with TF-IDF normalization and latent semantic indexing (LSI); and ADT with centered log-ratio (CLR) normalization and PCA. The wnn and snn runs integrate the three, with weighted and with shared nearest neighbors; this page reads the WNN run. ds.pipeline.open(label=...) reopens a saved run without recomputing it, and indexing the run by an output name, such as run["umap"], returns a reference to that saved result.
Compare what each modality separates¶
Each UMAP comes from its own modality’s neighbor graph, so compare which populations separate rather than where they sit:
# Open the three single-modality runs, which analyzed the same cells.
modality_runs = [ds.pipeline.open(label=label) for label in ("rna", "atac", "adt")]
# Draw the three UMAPs side by side, colored by publication cell type, with one shared legend.
figure, axes = plt.subplots(1, 3, figsize=(14, 4.4), layout="constrained")
titles = ("RNA", "Chromatin accessibility (ATAC)", "Surface protein (ADT)")
for axis, run, title in zip(axes, modality_runs, titles, strict=True):
ds.plots.embedding(
layout=run["umap"],
color_by=CellField("tea_cell_type", label="Publication cell type"),
target=axis,
show_titles=False,
show_legend=run.assay == "ADT",
show=False,
)
axis.set_title(title)
plt.show()
Started: 2026-11-14T15:43:07.594984Z | Wall time: 1.839 s
All three modalities separate monocytes, B cells, and T cells, and differ in how they arrange the T and NK cells. RNA and ATAC each lay the T cells out as one island that runs from naive T cells through CD4 memory cells to CD8 effector cells, with naive CD4 and CD8 T cells mixed at the naive end. ATAC continues that island into the NK cells, which RNA and protein place on their own. Protein splits CD4 from CD8 T cells into two islands.
Check the joint map against protein markers¶
WNN builds one neighbor graph from the three runs Hao et al., 2021. Color the joint UMAP, wnn["umap"], by publication cell type and by CD3, CD8a, CD19, CD14, and CD56 protein, which mark T cells, CD8 T cells, B cells, monocytes, and NK cells:
# Open the saved WNN run, which integrated the three single-modality runs.
wnn = ds.pipeline.open(label="wnn")
# Color the joint UMAP by publication cell type and by marker proteins of T cells, CD8 T cells, B cells, monocytes, and NK cells.
proteins = ("CD3", "CD8a", "CD19", "CD14", "CD56")
ds.plots.embedding(
layout=wnn["umap"],
color_by=[
CellField("tea_cell_type", label="Publication cell type"),
*(FeatureRef(name, assay="ADT", label=f"{name} protein") for name in proteins),
],
n_columns=3,
sort_values=True,
)
Started: 2026-11-14T15:43:09.436644Z | Wall time: 1.536 s
The joint map keeps monocytes, B cells, NK cells, and T cells in separate islands, and each marker protein is high in its own island: CD3 in the T cells, CD19 in the B cells, CD14 in the monocytes, and CD56 in the NK cells. Inside the T-cell island, the four subsets occupy separate regions, including the naive CD4 and CD8 T cells that overlap on the RNA and ATAC maps: CD8a protein marks naive CD8 cells on the left and CD8 effector cells at the top, apart from naive CD4 cells at the bottom and CD4 memory cells on the right.
Measure each modality’s weight¶
For each cell, WNN gives every modality a weight from how well that modality’s own neighbors predict the cell’s profile compared with the other modalities’ neighbors, and scales each modality’s similarities by that weight when picking the cell’s joint neighbors. The CITE-seq tutorial explains the weights with two modalities. The WNN run’s cell view, wnn.cells, holds each cell’s three weights. Pair them with the publication cell types in the store’s cell table, ds.cells, then average the weights over all cells and within each cell type, and stack each average into one bar:
# Pair each cell's WNN weights with its publication cell type; the run's I marks its cells among all stored cells.
modalities = ["RNA", "ATAC", "ADT"]
weights = wnn.cells.to_pandas_dataframe([f"weight_{name}" for name in modalities])
weights.columns = modalities
weights["population"] = ds.cells.fetch_all("tea_cell_type")[wnn.cells.fetch_all("I")]
# Average the weights within each population, and list the populations with fewer than 20 cells, too few for a stable mean.
by_population = weights.groupby("population")[modalities].mean()
by_population.insert(0, "cells", weights["population"].value_counts())
small = by_population.query("cells < 20")["cells"]
print("Fewer than 20 cells:", ", ".join(f"{name} ({count})" for name, count in small.items()))
# Put the average over all cells first, then the populations from the highest protein weight down.
overall = pd.DataFrame(
[{"cells": len(weights), **weights[modalities].mean()}], index=["All cells"]
)
table = pd.concat(
[overall, by_population.query("cells >= 20").sort_values("ADT", ascending=False)]
)
display(table.round(2))
# Stack each row's mean weights into one bar; every cell's three weights sum to 1.
rows = table.iloc[::-1]
starts = rows[modalities].cumsum(axis=1) - rows[modalities]
labels = [f"{name} ({count:,})" for name, count in rows["cells"].items()]
figure, axis = plt.subplots(figsize=(7.5, 4.8), layout="constrained")
for name, color in zip(modalities, ("#0072B2", "#E69F00", "#009E73"), strict=True):
axis.barh(
labels,
rows[name],
left=starts[name],
height=0.6,
color=color,
edgecolor="white",
linewidth=1.5,
label=name,
)
# Set the all-cells bar apart from the populations, then label the axes.
axis.axhline(len(rows) - 1.5, color="#bdbdbd", linewidth=0.8)
axis.set_xlim(0, 1)
axis.set_xlabel("Mean WNN weight")
axis.set_ylabel("Publication cell type (cells)")
axis.set_title("Each modality's share of the WNN weight")
axis.legend(title="Modality", loc="center left", bbox_to_anchor=(1.01, 0.5), frameon=False)
axis.spines[["top", "right"]].set_visible(False)
plt.show()Fewer than 20 cells: DC.Myeloid (9), Platelets (14), T.DoubleNegative (1)
| cells | RNA | ATAC | ADT | |
|---|---|---|---|---|
| All cells | 6194 | 0.19 | 0.31 | 0.49 |
| T.CD8.Naive | 372 | 0.10 | 0.20 | 0.70 |
| T.CD4.Naive | 1274 | 0.13 | 0.24 | 0.63 |
| T.CD4.Memory | 1450 | 0.14 | 0.31 | 0.55 |
| T.CD8.Effector | 709 | 0.17 | 0.37 | 0.46 |
| Mono.CD14 | 789 | 0.39 | 0.20 | 0.40 |
| NK | 351 | 0.25 | 0.37 | 0.38 |
| B.Naive | 981 | 0.20 | 0.45 | 0.36 |
| B.Activated | 205 | 0.28 | 0.48 | 0.23 |
| Mono.CD16 | 39 | 0.85 | 0.07 | 0.08 |

Started: 2026-11-14T15:43:10.975476Z | Wall time: 0.485 s
Protein leads in all four T-cell subsets, and its weight is highest in the naive ones: 0.70 in naive CD8 and 0.63 in naive CD4 T cells, the cells that overlap on the RNA and ATAC maps. CD8 effector cells, which RNA and ATAC already place at the far end of the T-cell island, lean less on protein, 0.46, and more on ATAC, 0.37. T cells make up most of the cells and so pull the all-cells average toward protein.
Outside the T cells, ATAC leads in naive and activated B cells, at 0.45 and 0.48, and RNA carries 0.85 of the weight in the 39 CD16 monocytes. No modality dominates in CD14 monocytes, which split their weight between RNA and protein, 0.39 and 0.40, or in NK cells, which split it between ATAC and protein, 0.37 and 0.38. The table leaves out the 9 myeloid dendritic cells, 14 platelets, and 1 double-negative T cell, too few for a stable mean.
Count the cells that put nearly all their weight on one modality, then map each cell’s weights on the joint UMAP to see how the weights vary inside the populations:
# Count the cells that put more than 0.9 of their weight on a single modality.
dominated = weights[modalities].max(axis=1) > 0.9
print(f"One weight above 0.9: {dominated.sum():,} of {len(weights):,} cells ({dominated.mean():.0%})")
# Map each modality's weight, which the WNN graph stores, over the joint UMAP.
ds.plots.modality_weights(graph=wnn["integrated_graph"], layout=wnn["umap"])One weight above 0.9: 2,612 of 6,194 cells (42%)

Started: 2026-11-14T15:43:11.464321Z | Wall time: 0.795 s
Individual cells often put nearly all their weight on one modality: one weight exceeds 0.9 in 2,612 of the 6,194 cells (42%), and neighboring cells can sit at opposite ends of the color scale. Read the weights as population averages, as in the table, rather than cell by cell. Protein weight is high across most of the T-cell island and ATAC weight in the B-cell island, matching the table.
Build the runs for your own data¶
In your own open datastore, ds, these calls build runs like the prepared ones. Each modality after RNA analyzes the RNA run’s cells, cells=rna, because WNN integrates runs of the same cells:
# Filter cells and analyze RNA: cell-cycle scores, variable genes, PCA, graph, UMAP, clusters, doublet scores, and markers.
rna = ds.pipeline.rna(
label="rna", hvg={"min_cells": 20, "top_n": 2000}, pca={"dims": 30}
)
# Analyze accessibility over the RNA run's cells with TF-IDF and LSI.
atac = ds.pipeline.atac(
label="atac",
cells=rna,
prevalent_peaks={"top_n": 25000},
lsi={"dims": 30, "skip_first": True},
)
# Analyze the antibody panel over the same cells, leaving out its control antibodies.
adt = ds.pipeline.adt(
label="adt", cells=rna, panel={"exclude": "(?i)control"}, pca={"dims": 15}
)
# Integrate the three runs with WNN, then embed and cluster the joint graph.
wnn = ds.pipeline.multimodal([rna, atac, adt], label="wnn")Each saved run records its settings, and run.report() returns them. Tabulate the settings in which the prepared runs differ from these calls:
# Read the settings in which each prepared run differs from the calls above.
recorded = {}
for label in ("rna", "atac", "adt", "wnn", "snn"):
run = ds.pipeline.open(label=label)
stages = run.report()["run"]["config"]["stages"]
umap = stages["umap"]
recorded[label] = {
"recipe": run.recipe,
"QC filtering": stages.get("filtering", {}).get("enabled"),
"cell-cycle scoring": stages.get("cell_cycle"),
"neighbors": stages.get("neighbors", {}).get("k"),
"UMAP initialization centroids": stages["embedding_initialization"]["n_centroids"],
"UMAP epochs": umap["n_epochs"],
"UMAP spread": umap["spread"],
"UMAP min_dist": umap["min_dist"],
"Leiden resolutions": stages["leiden"]["partitions"],
"doublet scoring": stages.get("doublets"),
"marker ranking": stages["markers"],
}
# Show one setting per row and one run per column.
pd.DataFrame(recorded)| rna | atac | adt | wnn | snn | |
|---|---|---|---|---|---|
| recipe | rna | atac | adt | multimodal | multimodal |
| QC filtering | False | False | False | None | None |
| cell-cycle scoring | False | None | None | None | None |
| neighbors | 20 | 20 | 20 | None | None |
| UMAP initialization centroids | 100 | 100 | 100 | 100 | 100 |
| UMAP epochs | 250 | 250 | 250 | 250 | 250 |
| UMAP spread | 1 | 1 | 1 | 1 | 1 |
| UMAP min_dist | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 |
| Leiden resolutions | [1.0] | [1.0] | [1.0] | [1.0] | [1.0] |
| doublet scoring | False | None | None | None | None |
| marker ranking | False | False | False | False | False |
Started: 2026-11-14T15:43:12.263652Z | Wall time: 0.221 s
The RNA run skipped QC filtering, because the store’s active cells were already the publication-matched cells, and skipped cell-cycle and doublet scoring; the ATAC and ADT runs took the RNA run’s cells. None marks a stage that the run did not record: a stage that its recipe does not have, or, for doublet scoring in the ATAC run, a stage that the ATAC recipe gained, off by default, after this run was saved. All five runs started UMAP from 100 k-means centroids, ran it for 250 epochs with spread 1 and min_dist 0.1, clustered with Leiden at resolution 1.0, and ranked no markers. The three modality runs used 20 neighbors. To match them, pass filtering=False, cell_cycle=False, and doublets=False to the RNA call, neighbors={"k": 20} and leiden={"partitions": [1.0]} to the three modality calls, and embedding_initialization={"n_centroids": 100}, umap={"n_epochs": 250, "spread": 1, "min_dist": 0.1}, and markers=False to all four calls. The multimodal recipe clusters at resolution 1.0 by default. Adding method="snn" to the multimodal call builds the SNN run from the same three runs.
Continue to Compare multimodal integration methods to compare WNN with SNN integration and with each modality’s own clusters, on a CITE-seq store.
- Swanson, E., Lord, C., Reading, J., Heubeck, A. T., Genge, P. C., Thomson, Z., Weiss, M. D., Li, X., Savage, A. K., Green, R. R., Torgerson, T. R., Bumol, T. F., Graybuck, L. T., & Skene, P. J. (2021). Simultaneous trimodal single-cell measurement of transcripts, epitopes, and chromatin accessibility using TEA-seq. eLife, 10. 10.7554/elife.63632
- Hao, Y., Hao, S., Andersen-Nissen, E., Mauck, W. M., Zheng, S., Butler, A., Lee, M. J., Wilk, A. J., Darby, C., Zager, M., Hoffman, P., Stoeckius, M., Papalexi, E., Mimitou, E. P., Jain, J., Srivastava, A., Stuart, T., Fleming, L. M., Yeung, B., … Satija, R. (2021). Integrated analysis of multimodal single-cell data. Cell, 184(13), 3573-3587.e29. 10.1016/j.cell.2021.04.048