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.

Interpret cell populations with scATAC-seq

Name the cell populations in a saved scATAC-seq analysis of 8,426 human PBMCs from the 10x Genomics dataset “10k Peripheral blood mononuclear cells (PBMCs) from a healthy donor” (Single Cell ATAC v1.0). The analysis kept 25,000 of the dataset’s 89,796 peaks, the genomic intervals where the assay found open chromatin, and grouped the cells into 13 Leiden clusters. Single peaks are hard to tie to a cell type, so sum the accessibility of the peaks over each gene into a gene score and read six lineage markers cluster by cluster.

Nine clusters each carry the markers of one lineage. TREM1 marks clusters 1, 2 and 5 as myeloid cells, and MS4A1 marks cluster 7 as B cells. CD3D marks clusters 3, 4, 6, 8 and 9 as T and NK cells, among which LEF1 picks out naive T cells in clusters 3 and 4 and NKG7 cytotoxic cells in clusters 6, 8 and 9. Cluster 10 carries both T-cell and myeloid markers and the highest median peak counts per cell, 27,406, so it most likely holds doublets. Clusters 11 and 12 mix markers of two lineages, and the 36 cells of cluster 13 carry too little signal to name.

Open the saved ATAC analysis

DataStore has 8426 (8728) cells with 1 assays: ATAC Cell metadata: 'I', 'ids', 'names', 'ATAC_UMAP1', 'ATAC_UMAP2', 'ATAC_leiden_cluster', 'ATAC_nCounts', 'ATAC_nFeatures' ATAC assay has 89796 features and following metadata: 'I', 'ids', 'names', 'derivation', 'dropOuts', 'feature_type', 'genome', 'nCells'

Started: 2026-11-14T15:42:39.277864Z | Wall time: 30.173 s

The store holds 8,728 cells, of which 8,426 are active: the cells that passed the saved run’s cell filter. Its ATAC assay holds 89,796 peaks. The saved run is one recorded call of the ATAC recipe, ds.pipeline.atac, under the label atac, and it keeps the settings and results of each of its stages. Indexing the run by an output name, such as run["clusters"], returns an ArtifactRef, a handle to one saved result that analysis and plotting calls take as input. Reopen the run and print its outputs, the cells that its filter removed and the settings of its other stages:

Outputs: input_cell_selection, analysis_cell_selection, feature_universe, prevalent_peaks, normalized, lsi, ann_index, neighbors, connectivity_map, embedding_initialization, umap, cluster_selection, clusters, leiden
clusters: ArtifactRef(assay='ATAC', kind='cluster_labels', artifact_id='1458794ce8f3...')
The resolution 0.6 clustering is the run's clusters: True
filtering: gaussian, between the 1% and 99% quantiles, removed 302 of 8,728 cells
  ATAC_nCounts: kept -26,034 to 52,770, 0 cells below and 247 above
  ATAC_nFeatures: kept -2,560 to 13,456, 0 cells below and 294 above
prevalent_peaks: {'top_n': 25000}
lsi: {'dims': 50, 'skip_first': True}
neighbors: {'k': 21}
leiden: {'partitions': [0.6], 'selected': None}
Analyzed cells: 8,426 in 13 clusters

Started: 2026-11-14T15:43:09.458787Z | Wall time: 0.493 s

The run first filtered the cells on two quality measurements, each cell’s peak counts (ATAC_nCounts) and detected peaks (ATAC_nFeatures). For each measurement, the Gaussian filter centers a normal distribution on the median, with the measurement’s standard deviation, and keeps the cells between that distribution’s 1st and 99th percentiles. A long upper tail widens the standard deviation of both measurements, so both lower bounds fall below zero, and the filter removed only cells at the top: 247 cells above 52,770 peak counts and 294 above 13,456 detected peaks, 302 cells in all.

The run then kept the 25,000 most prevalent peaks, those whose TF-IDF values sum highest over the cells. TF-IDF divides each peak’s count by the cell’s total count and weights up the peaks that fewer cells have open. The run reduced the TF-IDF values of those peaks with latent semantic indexing (LSI), the ATAC counterpart of PCA, to 50 components, leaving out the first, which often tracks sequencing depth rather than cell identity. It then joined each cell to its 21 nearest neighbors and divided that neighbor graph with Leiden at resolution 0.6 into 13 clusters. The rest of the page uses two of the run’s outputs, umap and clusters.

Plot the accessibility clusters

Draw the run’s 13 clusters on its UMAP:

UMAP of the 8,426 PBMCs that the saved ATAC run analyzed, colored by its 13 Leiden clusters at resolution 0.6, with each cluster's number printed on its cells. Clusters 3, 4, 6, 8 and 9 form a large group at the top and clusters 1, 2 and 5 a large group at the bottom; cluster 7 sits apart on the right, and the small clusters 10 to 13 lie between and beside these groups.

Started: 2026-11-14T15:43:09.954908Z | Wall time: 0.579 s

The clusters are numbered by size, from cluster 1, the largest, to cluster 13. Clusters 3, 4, 6, 8 and 9 form one large group at the top and clusters 1, 2 and 5 another at the bottom, and cluster 7 sits apart on the right. The four smallest clusters lie between and beside these groups: clusters 10 and 12 share an island between the two large groups, the few cells of cluster 13 form a speck above that island, and cluster 11 forms a short strip that rises from the top of the bottom group.

Score genes from the peaks that overlap them

A gene score sums, in each cell, the TF-IDF values of the peaks that overlap a gene. add_melded_assay reads the gene intervals from a BED file, a table of genomic intervals and their names, and writes the scores as a new assay, GeneScores, beside the peaks. The intervals here are GENCODE v38 gene bodies on GRCh37, and they must use the genome of the peaks, which the next cell checks.

renormalization=False keeps the sums instead of rescaling each cell’s scores to a common total. assay_type="RNA" stores them as an RNA assay; because they are already TF-IDF values, RNA steps such as the plots below use them as they are instead of dividing them by each cell’s total again.

Genome of the peaks: hg19
WARNING: Chromosome chrM not in the input peak coordinates
WARNING: 33935/62446 features did not overlap with any peak

Started: 2026-11-14T15:43:10.539267Z | Wall time: 36.246 s

The peaks are on hg19, the UCSC name for GRCh37, so the gene intervals match them. Both warnings are expected: the peak set has no mitochondrial (chrM) peaks, and 33,935 of the 62,446 genes overlap no peak, so their scores are zero in every cell. Gene bodies also leave out regulatory elements outside the gene, so a gene driven by distant enhancers can score low in the cells that express it.

Name the clusters from marker genes

Six markers cover the main blood lineages: CD3D for T cells, LEF1 for naive T cells, NKG7 for NK and cytotoxic T cells, MS4A1 for B cells, and TREM1 and LYZ for myeloid cells. Draw their scores on the UMAP:

Six UMAP panels of the same cells colored by gene scores, CD3D, LEF1 and NKG7 in the top row and MS4A1, TREM1 and LYZ in the bottom row, each on a purple-to-yellow scale that stops at the gene's 99th percentile. CD3D, LEF1 and NKG7 are bright across the top group, LEF1 most on its right side over clusters 3 and 4 and NKG7 on its left side over clusters 6, 8 and 9. MS4A1 is bright in cluster 7 on the right, and TREM1 and LYZ in the bottom group of clusters 1, 2 and 5. The island of cluster 10 shows mid-range CD3D and NKG7 with weaker TREM1, LYZ and LEF1, and the strip of cluster 12 at its lower edge is brightest for LEF1, with some cells at the top of the CD3D, NKG7 and TREM1 scales.

Started: 2026-11-14T15:43:46.789317Z | Wall time: 2.395 s

CD3D, LEF1 and NKG7 color the top group, MS4A1 cluster 7, and TREM1 and LYZ the bottom group. Within the top group, LEF1 is brightest on the right over clusters 3 and 4 and NKG7 on the left over clusters 6, 8 and 9. Cluster 10, on the island between the groups, carries T-cell and myeloid markers at once. Each panel draws the highest-scoring cells on top, so a marker detected in a minority of a group’s cells can still color the whole group; the dot plot below measures that share.

A gene counts as detected in a cell when any peak over the gene has a count in that cell. To read the markers cluster by cluster, a dot plot shows the share of each cluster’s cells in which a gene is detected as dot size, and the cluster’s mean score, standardized across clusters, as color. The table below it gives the same shares in percent and adds each cluster’s cell count and median peak counts per cell, which roughly double in doublets, droplets that captured two nuclei:

Dot plot with the 13 ATAC clusters in rows and CD3D, LEF1, NKG7, MS4A1, TREM1 and LYZ in columns. Dot size is the share of a cluster's cells with a nonzero score for the gene, from 0% to 82%, and color is the cluster's mean gene score, standardized across clusters. TREM1 has large dots in myeloid clusters 1, 2 and 5 and in clusters 10 and 11. CD3D has large dots in clusters 3, 4, 6, 8 and 10, LEF1 its largest and brightest dot in cluster 3, and NKG7 large dots in clusters 6, 8 and 9, brightest in cluster 9. MS4A1 has a large, bright dot only in cluster 7, and cluster 13 has small dots for every gene.
cellsmedian peak countsCD3DLEF1NKG7MS4A1TREM1LYZ
cluster
115531132103307515
215101064513306713
310671490244823050
490818262465716150
57371211613307915
661622599622654350
74761023631203771
844316931401447240
938612790272749140
103822740643543065212
11158135603166116113
12154108611437163212
13365890060033

Started: 2026-11-14T15:43:49.188056Z | Wall time: 0.966 s

TREM1 is detected in 67% to 79% of the cells of clusters 1, 2 and 5 and LYZ in 13% to 15%, against at most 7% and 1% in the T, NK and B-cell clusters, so clusters 1, 2 and 5 hold the myeloid cells. CD3D is detected in 27% to 62% of the cells of clusters 3, 4, 6, 8 and 9 and in at most 3% of the myeloid and B-cell clusters, so these five hold the T and NK cells. Among them, LEF1 is detected in 82% of cluster 3 and 57% of cluster 4, the naive T cells, and NKG7 in 47% to 54% of clusters 6, 8 and 9, the cytotoxic cells. Cluster 9 pairs the highest mean NKG7 score with the lowest CD3D detection of the five, 27%, which points to NK cells. MS4A1 is detected in 37% of cluster 7, the B cells, and in at most 11% of any other cluster.

Cluster 10 carries markers of two lineages: CD3D is detected in 43% of its cells and TREM1 in 52%. Its cells hold a median of 27,406 peak counts, the most of any cluster and about the sum of the medians of T-cell cluster 3 (14,902) and myeloid cluster 1 (11,321). Its 382 cells are most likely doublets of a T cell and a myeloid cell. Their median is about half the filter’s upper bound of 52,770 peak counts, so the filter kept them; leave cluster 10 out of comparisons between cell types. The 36 cells of cluster 13 hold the fewest counts, a median of 5,890, and no marker is detected in more than 6% of them, too little signal to name. The filter’s lower bounds, both below zero, could not remove them. Clusters 11 and 12 have typical counts but mix lineages. In cluster 11, TREM1 is detected in 61% of the cells and MS4A1 in 11%; in cluster 12, LEF1 is detected in 37% and TREM1 in 21%. Naming these two clusters takes more markers than these six; the cell type annotation tutorial tests cluster names against the marker statistics of every gene.

Start from your own peak counts

Convert your peak counts into a store as Import and export does for this dataset’s Cell Ranger HDF5 file, where CrH5Reader names the assay ATAC from the feature types that the file records. Review each cell’s peak counts and detected peaks as Quality control and doublet detection does for RNA. The ATAC recipe, ds.pipeline.atac, then runs every stage of the saved analysis, from filtering to clustering, in one recorded run. This call made the prepared store’s run:

# Open your own ATAC count store.
own_ds = cytearc.DataStore("my_atac.zarr", default_assay="ATAC")

# Repeat the saved analysis on your own peaks.
run = own_ds.pipeline.atac(
    label="atac",
    filtering={"method": "gaussian"},
    prevalent_peaks={"top_n": 25000},
    lsi={"dims": 50, "skip_first": True},
    neighbors={"k": 21},
    umap={"n_epochs": 500, "min_dist": 0.1, "spread": 1, "parallel": True},
    leiden={"partitions": [0.6]},
    markers=False,
)

# Color the ATAC embedding by its saved clusters.
own_ds.plots.embedding(run=run, color_by="clusters")

filtering={"method": "gaussian"} selects the Gaussian filter, which removed 302 cells from this dataset. Without that keyword, the recipe keeps the cells within three median absolute deviations (MADs) of the median of each measurement, on a log scale. Leave out any other keyword to use its stage’s default; markers=False skips ranking peaks for each cluster, which this page does not use. To choose the LSI dimensions, the number of neighbors and the Leiden resolution, follow the RNA comparisons in the dimensionality reduction, neighbor graph and clustering tutorials.