# 细胞聚类

细胞聚类是一种计算方法，它依据单细胞所测特征的相似性——最常见的是基因表达谱——将单个细胞归入不同的簇，从而可将各簇解读为细胞类型或细胞状态。输入通常是细胞×基因的表达矩阵，经降维得到主成分（PC）嵌入，再转化为k近邻（kNN）图；输出是每个细胞的一个整数簇标签，往往还附带一个模块度得分，随后进行基于标志物的细胞类型注释。<sup>[1](https://doi.org/10.1016/j.cell.2015.05.047)</sup><sup> • </sup><sup>[2](https://satijalab.org/seurat/reference/findclusters)</sup> 对于单细胞RNA测序（scRNA-seq）数据，最流行的无监督聚类方法是Louvain和Leiden算法，它们将细胞表示为k近邻图，其中连接密集的模块被识别为簇。<sup>[3](https://www.biorxiv.org/content/10.1101/2021.05.20.445027v1.article-info)</sup>

| 关键事实 | 详情 |
|---|---|
| 典型输入 | 计数矩阵，经标准化和对数变换；约前2,000个高变基因；PC嵌入；kNN或共享最近邻（SNN）图<sup>[4](https://satijalab.org/seurat/articles/pbmc3k_tutorial)</sup> |
| 典型输出 | 每个细胞的整数簇标签，以及在PhenoGraph等方法中附带的模块度得分\( Q \)<sup>[1](https://doi.org/10.1016/j.cell.2015.05.047)</sup><sup> • </sup><sup>[5](https://github.com/dpeerlab/phenograph)</sup> |
| 主流算法 | SNN图加模块度优化的社区发现（Louvain、Leiden、SLM）<sup>[2](https://satijalab.org/seurat/reference/findclusters)</sup> |
| 默认分辨率 | Seurat的FindClusters中为0.8；Scanpy中为1.0；对于约3,000个细胞的数据集，0.4–1.2效果良好<sup>[2](https://satijalab.org/seurat/reference/findclusters)</sup><sup> • </sup><sup>[4](https://satijalab.org/seurat/articles/pbmc3k_tutorial)</sup><sup> • </sup><sup>[6](https://www.sc-best-practices.org/cellular_structure/clustering.html)</sup> |
| 规模 | 图方法可在约100万个细胞上运行而无需子采样；SC3s在20分钟内对2,026,641个细胞进行了聚类<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC7203756/)</sup><sup> • </sup><sup>[3](https://www.biorxiv.org/content/10.1101/2021.05.20.445027v1.article-info)</sup> |
| 主要失效模式 | 稀有群体因模块度的分辨率极限而丢失，连续轨迹被强制离散化，批次效应<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC7203756/)</sup><sup> • </sup><sup>[8](https://genetics.bwh.harvard.edu/courses/Biophysics205/Papers/Primers/Kiselev_2019.pdf)</sup> |

## 工作原理

scRNA-seq测量每个细胞中数万个基因，在如此高维的空间中，细胞间距离趋于相近且不可靠，即“维数灾难”；因此在聚类之前要先进行特征选择和降维。<sup>[8](https://genetics.bwh.harvard.edu/courses/Biophysics205/Papers/Primers/Kiselev_2019.pdf)</sup> 随后聚类在图结构上进行。每个细胞与PC空间中与其最相似的\( K \)个细胞相连（\( K \)通常为5–100，视数据集大小而定），边的权重通过共享邻域的Jaccard相似度加以修正，从而生成SNN图。<sup>[6](https://www.sc-best-practices.org/cellular_structure/clustering.html)</sup><sup> • </sup><sup>[4](https://satijalab.org/seurat/articles/pbmc3k_tutorial)</sup>

模块度是优化目标：它衡量的是簇内观测到的总边权与边随机分布时预期边权之间的缩放差值；模块度越大，说明社区分得越开。<sup>[9](https://bioconductor.org/books/3.15/OSCA.advanced/clustering-redux.html)</sup> Louvain社区发现方法是一种贪心启发式算法，用于寻找模块度较高的图划分，通常只能达到局部最优而非全局最大。<sup>[1](https://doi.org/10.1016/j.cell.2015.05.047)</sup> Leiden算法由V. A. 特拉格、L. 沃尔特曼和N. J. 范·埃克在《从Louvain到Leiden：保证连通良好的社区》（《[科学报告](https://www.edgepedia.org/zh/scientific-reports)》，2019）一文中提出，它通过三个阶段加以改进：划分节点、精炼成员归属、聚合社区，从而保证簇的连通性良好，并避免Louvain可能产生的内部不连通的子社区。<sup>[10](https://doi.org/10.1038/s41598-019-41695-z)</sup><sup> • </sup><sup>[11](https://link.springer.com/article/10.1186/s13059-025-03719-y)</sup> 在已发表的scRNA-seq比较研究中，Leiden优于其他方法；而且由于louvain-igraph等广泛使用的Louvain实现已不再维护，Leiden如今更受青睐；在Scanpy中，Leiden的默认迭代次数被降至底层库的默认值2，因为迭代至收敛可能非常慢，尤其是对大型数据集。<sup>[6](https://www.sc-best-practices.org/cellular_structure/clustering.html)</sup> 分辨率参数可缩放模块度：值越高，产生的簇越多、越小。<sup>[2](https://satijalab.org/seurat/reference/findclusters)</sup>

## 操作流程

一个标准的Seurat式工作流程可以说明各个步骤。<sup>[4](https://satijalab.org/seurat/articles/pbmc3k_tutorial)</sup>

1. **质量控制**：去除低质量细胞，例如对数尺度上低于中位数超过3个中位数绝对偏差的细胞，如Duò等人的基准测试所做。<sup>[12](https://f1000research.com/articles/7-1141/v2)</sup>
2. **标准化**：LogNormalize将每个基因的表达量除以该细胞的总表达量，乘以缩放因子10,000，再进行对数变换。<sup>[4](https://satijalab.org/seurat/articles/pbmc3k_tutorial)</sup>
3. **高变基因选择**：FindVariableFeatures默认每个数据集返回2,000个基因。<sup>[4](https://satijalab.org/seurat/articles/pbmc3k_tutorial)</sup>
4. **缩放**：ScaleData将每个基因调整为均值0、方差1，以免高表达基因占据主导。<sup>[4](https://satijalab.org/seurat/articles/pbmc3k_tutorial)</sup>
5. **PCA**：方差解释的肘部图可指导选择使用多少个PC；在PBMC 3k示例中，肘部位于PC9-10附近，因此保留前10个PC。<sup>[4](https://satijalab.org/seurat/articles/pbmc3k_tutorial)</sup>
6. **图构建**：FindNeighbors默认\( k = 20 \)个邻居，Jaccard剪枝阈值为1/15，并使用annoy近似最近邻方法，取50棵树。<sup>[13](https://github.com/satijalab/seurat/blob/HEAD/R/clustering.R)</sup>
7. **聚类**：FindClusters在SNN图上以分辨率参数（默认0.8）优化模块度；算法1–3为Louvain变体和SLM，算法4为Leiden。<sup>[2](https://satijalab.org/seurat/reference/findclusters)</sup>
8. **注释与验证**：通过差异表达刻画各簇特征（SC3使用非参数Kruskal-Wallis检验，标志物选取标准为AUROC > 0.85且\( p < 0.01 \)），并用轮廓宽度（衡量每个细胞与其所属簇的契合程度）、调整兰德指数（ARI）和自助法稳定性进行评估。<sup>[14](https://bioconductor.org/packages/devel/bioc/vignettes/SC3/inst/doc/SC3.html)</sup><sup> • </sup><sup>[9](https://bioconductor.org/books/3.15/OSCA.advanced/clustering-redux.html)</sup>

## 起源

如今占主导地位的基于图的方法是由2015年的几篇论文汇集而成的。PhenoGraph由雅各布·H·莱文、艾琳·F·西蒙兹、肖恩·C·本德尔及其同事于2015年发表在《细胞》上，它接收单细胞测量矩阵，构建加权kNN图，并应用Louvain社区发现方法（Blondel等，2008），这一思路借自社会网络分析（Girvan和Newman，2002）。<sup>[1](https://doi.org/10.1016/j.cell.2015.05.047)</sup> 同年，[陈旭](https://www.edgepedia.org/zh/chen-xu)（Chen Xu）和苏正昌（Zhengchang Su）在《[生物信息学](https://www.edgepedia.org/zh/bioinformatics)》上发表了一种基于图的细胞类型识别方法，<sup>[15](https://doi.org/10.1093/bioinformatics/btv088)</sup> 索菲·范·加森、布里特·卡勒博及其同事发表了FlowSOM，一种用于流式细胞术数据的自组织映射方法，<sup>[16](https://doi.org/10.1002/cyto.a.22625)</sup> [埃文·Z·马科斯科](https://www.edgepedia.org/zh/evan-z-macosko)、阿南迪塔·巴苏、拉胡尔·萨蒂贾及其同事的Drop-seq论文将密度聚类与事后差异表达相结合，把44,808个小鼠视网膜细胞划分为39个转录上不同的簇。<sup>[17](https://doi.org/10.1016/j.cell.2015.05.002)</sup> SC3是由弗拉基米尔·Yu·基谢列夫、克里斯蒂娜·基尔施纳、迈克尔·T·肖布及其同事提出的一种共识聚类方法，于2017年发表在《自然·方法》上，<sup>[18](https://doi.org/10.1038/nmeth.4236)</sup> 而实现了大规模基于图聚类的Scanpy由F. 亚历山大·沃尔夫、菲利普·安格勒和法比安·J·泰斯于2018年发表在《基因组生物学》上。<sup>[19](https://doi.org/10.1186/s13059-017-1382-0)</sup> 此后，SNN加Louvain的组合被纳入Seurat 3和Scanpy。<sup>[8](https://genetics.bwh.harvard.edu/courses/Biophysics205/Papers/Primers/Kiselev_2019.pdf)</sup>

## 变体

**共识方法与基于模型的方法。** SC3将多次聚类结果合并为共识，并利用随机矩阵的Tracy-Widom理论估计簇数\( k \)；当细胞数超过5,000时，它对随机子集进行聚类，再训练支持向量机为其余细胞打标签。<sup>[14](https://bioconductor.org/packages/devel/bioc/vignettes/SC3/inst/doc/SC3.html)</sup> SC3s重新设计了这一流程，使运行时间和内存随细胞数线性增长，采用流式k-means和独热编码的共识步骤。<sup>[3](https://www.biorxiv.org/content/10.1101/2021.05.20.445027v1.article-info)</sup>

**密度方法与加速图方法。** X-shift专为高维流式细胞术数据而建，使用加权K近邻密度估计，并从簇数对\( K \)作图的转折点自动选择\( K \)。<sup>[20](https://europepmc.org/backend/ptpmcrender.fcgi?accid=PMC4896314&blobtype=pdf)</sup> PARC结合了HNSW加速的kNN图构建、数据驱动的两步边剪枝和Leiden社区发现。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC7203756/)</sup>

**深度学习方法。** scDeepCluster由田天（Tian Tian）及其同事提出（《自然·机器智能》，2019），通过显式建模scRNA-seq计数生成过程，同时学习特征表示和聚类。<sup>[21](https://doi.org/10.1038/s42256-019-0037-0)</sup> DESC是一种无监督深度嵌入算法，它迭代优化软分配与辅助分布之间的KL散度目标，以Louvain簇为初始化，并在聚类过程中去除批次效应。<sup>[22](https://www.nature.com/articles/s41467-020-15851-3)</sup>

## 应用

PhenoGraph被应用于急性髓系白血病骨髓样本，以适中的计算资源分辨出占比低至1/2,000的稀有亚群。<sup>[1](https://doi.org/10.1016/j.cell.2015.05.047)</sup> 对于连续分化过程，PAGA（F. 亚历山大·沃尔夫、菲奥娜·K·哈米及其同事，《基因组生物学》，2019）通过将簇关联到保拓扑的图抽象中，把聚类与轨迹推断协调起来。<sup>[23](https://doi.org/10.1186/s13059-019-1663-x)</sup>

## 局限与替代方案

**分辨率与粒度。** 对于如何正确选择簇数\( k \)，尚无共识；基于肘部点的簇质量评分偏向粗分辨率，因此需要研究者自行判断。<sup>[8](https://genetics.bwh.harvard.edu/courses/Biophysics205/Papers/Primers/Kiselev_2019.pdf)</sup> SC3内置的k估计器倾向于高估，而Seurat则将簇数交给用户设定的分辨率。<sup>[12](https://f1000research.com/articles/7-1141/v2)</sup>

**验证。** 轮廓宽度能捕捉两个方向的失败：异质（聚类不足）的组会降低簇内宽度，而过度聚类的细胞靠近相邻簇，也会降低宽度；最大化平均轮廓可给出初始的\( k \)。ARI高于0.5是判断两次聚类“良好”一致性的常用经验法则，scran则通过对通过有放回抽样得到的自助法重复样本进行再聚类来评估稳定性。<sup>[9](https://bioconductor.org/books/3.15/OSCA.advanced/clustering-redux.html)</sup>

**失效模式。** 模块度优化存在分辨率极限：未经剪枝的Leiden和PhenoGraph无法稳定分离稀有但独特的群体，且该效应随网络规模增大而加剧。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC7203756/)</sup> k-means偏向于等大小的簇，会将稀有细胞类型隐藏在较大的组中。<sup>[8](https://genetics.bwh.harvard.edu/courses/Biophysics205/Papers/Primers/Kiselev_2019.pdf)</sup> 大多数方法无论是否存在有生物学意义的群体都会对数据强行划分，因此连续分化轨迹更适合用伪时间排序而非离散簇来处理。<sup>[8](https://genetics.bwh.harvard.edu/courses/Biophysics205/Papers/Primers/Kiselev_2019.pdf)</sup> DESC的软分配是一种替代方案，可同时揭示离散结构和伪时间结构。<sup>[22](https://www.nature.com/articles/s41467-020-15851-3)</sup>

**规模与批次效应。** [层次聚类](https://www.edgepedia.org/zh/hierarchical-clustering)在时间和内存上至少呈二次方增长，对大型数据集而言代价过高。<sup>[8](https://genetics.bwh.harvard.edu/courses/Biophysics205/Papers/Primers/Kiselev_2019.pdf)</sup> 在Duò的基准测试中，SC3的运行速度比Seurat慢几个数量级，但SC3和Seurat给出了最理想的结果，也是仅有的能在液滴法数据集中正确恢复细胞类型的方法。<sup>[12](https://f1000research.com/articles/7-1141/v2)</sup> 一项2025年对28种算法的基准测试建议，兼顾时间与内存的用户选择Louvain或Leiden，并指出SC3、CIDR和Spectrum明显更慢，还提醒深度学习方法较低的峰值内存往往反映的是将数据卸载到GPU内存，而非总体需求减少。<sup>[11](https://link.springer.com/article/10.1186/s13059-025-03719-y)</sup> 批次效应可在聚类之前或聚类过程中通过典型相关分析、互最近邻、二者在Seurat 3.0中的组合、scVI的深度生成建模（罗曼·洛佩斯及其同事，《自然·方法》，2018）以及DESC来处理。<sup>[22](https://www.nature.com/articles/s41467-020-15851-3)</sup><sup> • </sup><sup>[24](https://doi.org/10.1038/s41592-018-0229-2)</sup>

## References

1. [Jacob H. Levine and colleagues (2015). Data-Driven Phenotypic Dissection of AML Reveals Progenitor-like Cells that Correlate with Prognosis. Cell.](https://doi.org/10.1016/j.cell.2015.05.047)
2. [Cluster Determination, FindClusters • Seurat](https://satijalab.org/seurat/reference/findclusters)
3. [SC3s - efficient scaling of single cell consensus clustering to millions of cells](https://www.biorxiv.org/content/10.1101/2021.05.20.445027v1.article-info)
4. [Seurat - Guided Clustering Tutorial](https://satijalab.org/seurat/articles/pbmc3k_tutorial)
5. [dpeerlab/PhenoGraph (official software repository)](https://github.com/dpeerlab/phenograph)
6. [12. Clustering, Single-cell best practices](https://www.sc-best-practices.org/cellular_structure/clustering.html)
7. [PARC: ultrafast and accurate clustering of phenotypic data of millions of single cells](https://pmc.ncbi.nlm.nih.gov/articles/PMC7203756/)
8. [Challenges in unsupervised clustering of single-cell RNA-seq data (Kiselev, Andrews, Hemberg, Nature Reviews Genetics 2019)](https://genetics.bwh.harvard.edu/courses/Biophysics205/Papers/Primers/Kiselev_2019.pdf)
9. [Chapter 5 Clustering, redux | Advanced Single-Cell Analysis with Bioconductor (OSCA)](https://bioconductor.org/books/3.15/OSCA.advanced/clustering-redux.html)
10. [V. A. Traag, L. Waltman, N. J. van Eck (2019). From Louvain to Leiden: guaranteeing well-connected communities. Scientific Reports.](https://doi.org/10.1038/s41598-019-41695-z)
11. [Comparative benchmarking of single-cell clustering algorithms for transcriptomic and proteomic data (Genome Biology, 2025)](https://link.springer.com/article/10.1186/s13059-025-03719-y)
12. [A systematic performance evaluation of clustering methods for single-cell RNA-seq data (Duò et al., F1000Research)](https://f1000research.com/articles/7-1141/v2)
13. [R/clustering.R, Seurat source code](https://github.com/satijalab/seurat/blob/HEAD/R/clustering.R)
14. [SC3 package manual (Bioconductor vignette)](https://bioconductor.org/packages/devel/bioc/vignettes/SC3/inst/doc/SC3.html)
15. [Chen Xu, Zhengchang Su (2015). Identification of cell types from single-cell transcriptomes using a novel clustering method. Bioinformatics.](https://doi.org/10.1093/bioinformatics/btv088)
16. [Sofie Van Gassen and colleagues (2015). FlowSOM: Using self‐organizing maps for visualization and interpretation of cytometry data. Cytometry Part A.](https://doi.org/10.1002/cyto.a.22625)
17. [Evan Z. Macosko and colleagues (2015). Highly Parallel Genome-wide Expression Profiling of Individual Cells Using Nanoliter Droplets. Cell.](https://doi.org/10.1016/j.cell.2015.05.002)
18. [Vladimir Yu Kiselev and colleagues (2017). SC3: consensus clustering of single-cell RNA-seq data. Nature Methods.](https://doi.org/10.1038/nmeth.4236)
19. [F. Alexander Wolf, Philipp Angerer, Fabian J. Theis (2018). SCANPY: large-scale single-cell gene expression data analysis. Genome biology.](https://doi.org/10.1186/s13059-017-1382-0)
20. [Automated Mapping of Phenotype Space with Single-Cell Data (X-shift; Samusik et al.)](https://europepmc.org/backend/ptpmcrender.fcgi?accid=PMC4896314&blobtype=pdf)
21. [Tian Tian and colleagues (2019). Clustering single-cell RNA-seq data with a model-based deep learning approach. Nature Machine Intelligence.](https://doi.org/10.1038/s42256-019-0037-0)
22. [Deep learning enables accurate clustering with batch effect removal in single-cell RNA-seq analysis (DESC)](https://www.nature.com/articles/s41467-020-15851-3)
23. [F. Alexander Wolf and colleagues (2019). PAGA: graph abstraction reconciles clustering with trajectory inference through a topology preserving map of single cells. Genome biology.](https://doi.org/10.1186/s13059-019-1663-x)
24. [Romain Lopez and colleagues (2018). Deep generative modeling for single-cell transcriptomics. Nature Methods.](https://doi.org/10.1038/s41592-018-0229-2)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 生命与健康 › 生物学基础 › 细胞生物学

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/cell-clustering

English original: https://www.edgepedia.org/cell-clustering
