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.

Annotate cell types and states

Test the broad cell-type names that the PBMC analysis gives the 12 Leiden clusters against the marker statistics of every gene, and refine the names where several markers agree. The data are the 3,948 human peripheral blood mononuclear cells (PBMCs) that pass quality control in the 10x Genomics 5k PBMC dataset from a healthy donor (tenx_5K_pbmc_rnaseq). Six of seven genes that encode flow cytometry lineage markers mark the expected clusters at the RNA level, while CD4 transcripts are detected more often in monocytes than in T cells. Each cluster’s leading markers and a dot plot of T-cell and NK genes then confirm the 25 CD16 monocytes and support five finer names: naive B cells (256 cells), memory-like B cells (239), naive-like CD8 T cells (166), CD56-bright NK cells (29), and plasmacytoid dendritic cells (pDCs, 15).

Open the prepared analysis

Started: 2026-11-18T00:15:52.109499Z | Wall time: 5.031 s

A saved pipeline run keeps the cells, settings, and results of one analysis together. ds.pipeline.open(label="rna") reopens that analysis, and run["clusters"] refers to its clustering result. ds.markers.search compares each cluster with the other analyzed cells for every gene of the RNA assay, the 33,538 that run["feature_universe"] selects, and saves the statistics in the store as a marker table.

DataStore has 3948 (5025) cells with 1 assays: RNA Cell metadata: 'I', 'ids', 'names', 'RNA_G2M_score', 'RNA_S_score', 'RNA_UMAP1', 'RNA_UMAP2', 'RNA_cell_cycle_phase', 'RNA_clusters', 'RNA_doublet_score', 'RNA_leiden_cluster', 'RNA_nCounts', 'RNA_nFeatures', 'RNA_paris_cluster', 'RNA_percentMito', 'RNA_percentRibo' RNA assay has 33538 features and following metadata: 'I', 'ids', 'names', 'dropOuts', 'feature_type', 'genome', 'nCells'

Started: 2026-11-18T00:15:57.150505Z | Wall time: 23.422 s

The store holds 5,025 cells, and the run analyzed the 3,948 that passed quality control.

Read the marker evidence

ds.markers.load returns one row per gene and cluster. The columns that the next cell shows are:

ColumnMeaning
scoreSpecificity from 0 to 1: the cluster’s mean expression rank as a share of the sum over all clusters. It ranks markers within one clustering and shrinks as the number of clusters grows, so no default filter uses it.
frac_exp, frac_exp_restFraction of cells with a nonzero count, in the cluster and in the other analyzed cells.
fold_changeMean library-size normalized expression in the cluster divided by the mean in the other cells, or inf when no other cell expresses the gene. Read it with frac_exp, because a few cells can drive a large ratio.
aucArea under the ROC curve: the probability that a cell of the cluster ranks above one of the other cells. 0.5 means no separation, and values below 0.5 mean lower expression in the cluster.
neg_log10_p_valueMinus log10 of the two-sided Mann-Whitney U p-value, with cells as the units. CyteArc computes it in log space, so it stays finite where the p-value itself underflows to 0. The max_p_adj filter reads the p-values after Benjamini-Hochberg adjustment within the cluster.

The default filters, written out in the next cell, keep genes detected in at least 20% of the cluster’s cells (min_frac_exp=0.2), with an AUC of at least 0.6 (min_auc=0.6) and an adjusted p-value of at most 0.05 (max_p_adj=0.05), sorted by score. Start with cluster 2:

feature_namescorefrac_expfrac_exp_restfold_changeaucneg_log10_p_value
0S100A120.950.960.01832.510.98766.65
1VCAN0.920.980.03367.790.99748.76
2CD140.920.970.02427.900.98766.04
3CLEC4E0.890.600.00852.150.80464.56
4ALDH1A10.890.530.00659.790.76404.44
5CD1630.880.510.00442.370.76390.87
6STAB10.870.630.0195.130.81459.13
7QPCT0.870.480.00377.880.74359.74
8CYP27A10.870.470.00370.970.74356.24
9CREB50.860.530.00170.240.76394.90

Started: 2026-11-18T00:16:20.575386Z | Wall time: 0.118 s

Cluster 2 holds classical CD14 monocytes. Its three leading markers, S100A12, VCAN, and CD14, are each detected in 96% to 98% of its cells and in 1% to 3% of the other cells, with AUCs of 0.98 to 0.99. Their neg_log10_p_value of 749 to 767 reflects the hundreds of cells that the test counts as independent observations, so the AUC and the detected fractions, not the p-value, show how well a gene separates a cluster.

Check the broad names with lineage genes

Seven genes that encode the surface markers flow cytometry uses for the main lineages check the broad names on the UMAP: CD14 for classical monocytes, FCGR3A (CD16) for nonclassical monocytes and most NK cells, CD19 for B cells, CD8A and CD4 for T-cell subsets, NCAM1 (CD56) for NK cells, and IL3RA (CD123) for pDCs.

Eight UMAP panels of the 3,948 PBMCs in a four-column grid. The first, titled Leiden cluster, colors the 12 clusters and prints each cluster number on its cells; the other seven color cells by CD14, FCGR3A, CD19, CD8A, CD4, NCAM1, and IL3RA expression, from dark purple (none) to yellow (highest). CD14 is high across cluster 2 on the right but dark at its upper tip, cluster 10, where FCGR3A is brightest. FCGR3A also marks NK cluster 5 at the bottom and stays dim in the small NK cluster 9 beside it, which NCAM1 marks along with cluster 5. CD19 is high in B-cell clusters 6 and 7 at the top, CD8A in cluster 8 at the left edge and the lower part of cluster 3, and IL3RA only in the small cluster 11. CD4 is patchy over the T-cell clusters and denser in monocyte cluster 2.

Started: 2026-11-18T00:16:20.696512Z | Wall time: 3.207 s

CD14 marks cluster 2 on the right but not its upper tip, cluster 10, where FCGR3A is brightest. FCGR3A also marks NK cluster 5 at the bottom, and NCAM1 marks clusters 5 and 9 there. CD19 marks clusters 6 and 7 at the top, CD8A cluster 8 at the left edge of the T-cell island and the lower part of cluster 3, and IL3RA only the small cluster 11. CD4 is patchy across the T-cell island and denser in the monocytes.

The default filters hide weak and negative evidence. Load every row of the marker table once with the filters turned off, and find the cluster where each panel gene scores highest:

group_idscorefrac_expfrac_exp_restauc
feature_name
CD1420.920.970.020.98
FCGR3A100.491.000.140.99
CD1960.520.610.050.78
CD8A80.460.790.080.85
CD420.330.760.270.77
NCAM190.520.660.030.81
IL3RA110.791.000.021.00

Started: 2026-11-18T00:16:23.906510Z | Wall time: 0.782 s

The table confirms the UMAP panels of CD14, FCGR3A, CD19, CD8A, NCAM1, and IL3RA, with AUCs from 0.78 (CD19) to 1.00 (IL3RA). Every cell of cluster 10 detects FCGR3A, and every cell of cluster 11 detects IL3RA, against 14% and 2% of the other cells. CD4 instead scores highest in monocyte cluster 2, where 76% of cells detect it against 27% elsewhere (AUC 0.77). Human monocytes express CD4, and no T-cell cluster detects it in even half of its cells, as the table under the dot plot below shows, so CD4 RNA alone cannot mark CD4 T cells.

Apart from CD4, these patterns agree with the broad names of the PBMC analysis, whose own panel adds the T-cell genes CD3D and IL7R that name clusters 1 and 4 and the platelet genes PPBP and PF4 that name cluster 12. Several clusters share a broad name:

broad_cell_typecells
1T cells1217
2CD14 monocytes704
3T cells528
4T cells474
5NK cells283
6B cells256
7B cells239
8T cells166
9NK cells29
10CD16 monocytes25
11pDC-like cells15
12platelets12

Started: 2026-11-18T00:16:24.694120Z | Wall time: 0.016 s

Check each name against its leading markers

A heatmap of each cluster’s three highest-scoring genes shows whether several genes support each name. Expression is standardized across clusters, and the columns follow marker similarity rather than cluster number.

Heatmap of the three highest-scoring marker genes of each of the 12 PBMC clusters, with 36 genes in rows and clusters in columns, both ordered by hierarchical clustering and colored by expression standardized across clusters from -1 (pale yellow) to 2 (black). Each cluster's own genes form a dark block, for example S100A12, VCAN, and CD14 in cluster 2, CTSL, TCF7L2, and SMIM25 in cluster 10, IGHD, FCER2, and TCL1A in cluster 6, IGHA1, TNFRSF13B, and IGHG1 in cluster 7, XCL1, KLRC1, and XCL2 in cluster 9, and SERPINF1, TPM2, and LILRA4 in cluster 11.

Started: 2026-11-18T00:16:24.734718Z | Wall time: 2.138 s

  • Monocytes: the 25-cell cluster 10 leads with CTSL, TCF7L2, and SMIM25 rather than the classical markers of cluster 2, detects FCGR3A (CD16) in every cell, and stays dark in the CD14 panel: the profile of nonclassical CD16 monocytes, which confirms the name that the PBMC analysis gave the cluster.

  • B cells: cluster 6 leads with IGHD, FCER2 (CD23), and TCL1A, the profile of naive B cells, and cluster 7 with the class-switched immunoglobulins IGHA1 and IGHG1 and with TNFRSF13B (TACI), the profile of memory B cells.

  • NK cells: FGFBP2, ADGRG1, and AKR1C3 lead cluster 5, which FCGR3A also marks: the profile of cytotoxic CD56-dim NK cells. XCL1, KLRC1, and XCL2 lead the 29-cell cluster 9, where NCAM1 (CD56) scores highest and FCGR3A stays dim: the profile of CD56-bright NK cells.

  • T cells: GZMK, TRGC2, and CD8A lead cluster 3, and LINC02446, CD8B, and NOG lead cluster 8. Clusters 1 and 4 lead with ADTRP, ANKRD55, and TCEA3, and with TNFRSF4, NPDC1, and AQP3. The next section reads all four T-cell clusters with canonical T-cell genes.

  • pDCs: SERPINF1, TPM2, and LILRA4 lead the 15-cell cluster 11. LILRA4 and IL3RA together mark pDCs, which settles the provisional name that the PBMC analysis gave the cluster from GZMB and JCHAIN.

  • Platelets: F13A1, ACRBP, and PTGS1 lead the 12-cell cluster 12, alongside the platelet genes PPBP and PF4 that name it in the PBMC analysis.

Separate T-cell states from NK cells

The four T-cell clusters differ in CD8 and naive-state genes, and NK cells share cytotoxic genes with some T cells. A dot plot compares T-cell, CD4 and CD8, naive-like, and cytotoxic genes across all 12 clusters. Dot size is the fraction of a cluster’s cells that detect the gene, and color is the gene’s mean expression standardized across clusters:

Dot plot with the 12 PBMC clusters in rows and 11 genes in columns, bracketed as T cell (CD3D, CD3E), CD4 or CD8 (CD4, CD8A, CD8B), naive-like (CCR7, IL7R, CD27), and cytotoxic (GZMK, NKG7, GNLY). Dot size is the fraction of cells that detect the gene, and color is its mean expression standardized across clusters. T-cell clusters 1, 3, 4, and 8 have large CD3D and CD3E dots. CD8A and CD8B peak in cluster 8, which also has large CCR7, IL7R, and CD27 dots. GZMK peaks in clusters 3 and 9, and NKG7 and GNLY peak in clusters 5 and 9, whose CD3D dots are smaller than those of the T-cell clusters (35% and 0% of cells). CD27 has a large dot in B-cell cluster 7 and a small one in cluster 6, and CD4 is brightest in monocyte clusters 2 and 10.

Started: 2026-11-18T00:16:26.876519Z | Wall time: 0.753 s

CD27 marks memory B cells as well as naive T cells, and its dot is large in B-cell cluster 7 and small in cluster 6, in line with the memory and naive names from their leading markers. The table lists the fractions behind the dots for the four T-cell and two NK clusters:

feature_nameCD3DCD3ECD4CD8ACD8BCCR7IL7RCD27GZMKNKG7GNLY
group_id
10.970.980.390.010.050.840.880.810.020.060.06
30.970.980.230.450.420.130.730.520.710.850.24
40.980.980.490.020.010.450.910.710.120.120.07
80.950.980.050.790.860.890.920.910.010.120.10
50.350.430.020.110.000.020.030.010.011.001.00
90.000.410.030.140.000.170.410.240.901.001.00

Started: 2026-11-18T00:16:27.632610Z | Wall time: 0.063 s

  • Cluster 8 holds naive-like CD8 T cells. CD8B and CD8A are detected in 86% and 79% of its cells, and the naive and central-memory genes CCR7, IL7R, and CD27 in 89% to 92%, against 1% for GZMK.

  • Cluster 3 keeps the broad T-cell name. CD3D is detected in 97% of its cells and the cytotoxic genes GZMK and NKG7 in 71% and 85%, but CD8A and CD8B in fewer than half (45% and 42%, against 79% and 86% in cluster 8), so the cluster mixes CD8 T cells with CD8-negative cytotoxic T cells.

  • Cluster 9 holds CD56-bright NK cells, and cluster 5 keeps the broad NK name. Both detect NKG7 and GNLY in nearly every cell (1.00 in the table) and CD8B, which T cells pair with CD8A, in fewer than 1%. Cluster 9 also detects GZMK in 90% of its cells, as CD56-bright NK cells do, and CD3D in none, although CD3E reaches 41%. Cluster 5 detects CD3D in 35% of its cells, against 95% to 98% in each T-cell cluster, so it may also hold some T cells.

  • Clusters 1 and 4 keep the broad T-cell name. CD3D and IL7R are detected in 88% to 98% of their cells and CD8A and CD8B in at most 5%, the pattern of CD4 T cells, and cluster 1 detects CCR7 more often than cluster 4 (84% against 45%), as naive cells do. CD4 itself is detected in only 39% and 49% of their cells, so a CD4 name would rest mainly on the missing CD8 transcripts; the CD4 surface protein that the CITE-seq tutorial measures settles such calls.

Save and compare the reviewed names

Refine the five clusters whose markers agree, and keep the broad names of the other seven:

broadreviewed
6B cellsnaive B cells
7B cellsmemory-like B cells
8T cellsnaive-like CD8 T cells
9NK cellsCD56-bright NK cells
11pDC-like cellspDCs

Started: 2026-11-18T00:16:27.698763Z | Wall time: 0.010 s

Map each analyzed cell’s cluster to its name, mark the cells outside the run Not analyzed, and write both name columns to the cell table. overwrite=True replaces the columns on a rerun and leaves the run’s clusters unchanged.

T cells 2219 CD14 monocytes 704 NK cells 283 naive B cells 256 memory-like B cells 239 naive-like CD8 T cells 166 CD56-bright NK cells 29 CD16 monocytes 25 pDCs 15 platelets 12 Name: cells, dtype: int64

Started: 2026-11-18T00:16:27.711889Z | Wall time: 0.075 s

Two UMAP panels of the 3,948 PBMCs colored by the broad (left) and reviewed (right) cell types, with one color per name in both panels and a legend for each. Names that the review keeps are muted in both: T cells gray, NK cells light green, CD14 monocytes light orange, CD16 monocytes brown at the tip of the monocyte island, and platelets pale pink. On the left, the B-cell island at the top is light cyan and the pDC-like cells are pale purple. On the right, the refined populations take strong colors: naive B cells (blue) and memory-like B cells (vermillion) split the B-cell island, naive-like CD8 T cells (orange) sit at the left edge of the gray T-cell island, CD56-bright NK cells (dark green) form a small group beside the light green NK cells, and pDCs (reddish purple) form a small group above the monocytes.

Started: 2026-11-18T00:16:27.789875Z | Wall time: 0.576 s

The B-cell island at the top splits into 256 naive and 239 memory-like B cells, and the 166 naive-like CD8 T cells separate at the left edge of the T-cell island, which keeps 2,219 cells under the broad name. The 29 CD56-bright NK cells sit beside the other NK cells at the bottom, and the 15 pDCs form a small group above the monocyte island. Both name columns stay in ds.cells beside the run’s clusters, so later plots and comparisons can group cells by either one.

Test the names further

The clustering tutorial compares partitions and measures each cell’s cluster membership strength, which shows whether neighboring T-cell clusters such as 1 and 4 are distinct types or one gradient of states. A cluster with markers of two lineages, such as NK cluster 5 with CD3D in 35% of its cells, may hold a second cell type, doublets, or ambient RNA; the quality control and ambient RNA removal tutorials check the last two. The reference mapping and label transfer tutorial transfers labels from an annotated reference instead of naming clusters by hand. Marker statistics treat cells as the units, so differences between conditions need a comparison across donors, as in the donor-level comparisons tutorial.

Find marker references for your tissue

These resources list published markers to compare with the measured ones: