# 序列聚类

序列聚类是一种计算方法，它将相似的生物序列（如DNA、RNA或蛋白质序列）归入成员之间超过既定相似度阈值的簇。其典型输出是一组非冗余的代表序列，外加一个成员归属文件，列出哪条序列属于哪个簇。这些输出支撑着大型数据库的去冗余、蛋白质家族分组，以及扩增子研究中操作分类单元（OTU）的界定，并且是UniProt的聚类参考簇和PDB的序列簇等资源的基础。

| 关键事实 | 详情 |
|---|---|
| 输入与输出 | 输入为FASTA格式数据库；输出为代表（“非冗余”）序列集加一个簇成员归属文件 <sup>[1](https://bioinformatics.org/cd-hit/)</sup> |
| 核心算法 | 贪心增量聚类：序列按长度降序排列，每条序列加入其代表序列通过一致性阈值的第一个簇 <sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2828112/)</sup> |
| 一致性定义各异 | CD-HIT以相同残基数除以较短序列长度；UCLUST以全局比对中相同字母—字母列数除以较短序列长度 <sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)</sup> |
| 扩展性 | 在90%一致性下，拟合运行时间对Linclust为 \( N^{1.01} \)，UCLUST为 \( N^{1.62} \)，CD-HIT为 \( N^{2.75} \) <sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)</sup> |
| 已证实的最大规模 | Linclust在配备762 GB内存的2×14核服务器上，用10小时将16亿条宏基因组序列以≥50%一致性聚为4.24亿个簇 <sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)</sup> |
| 扩增子惯例 | 16S rRNA序列按惯例以97%相似度（3%距离）聚为OTU <sup>[4](https://www.schlosslab.org/assets/pdf/2015_westcott.pdf)</sup> |
| 近期硬件变革 | MMseqs2-GPU（2025）在单块NVIDIA L40S GPU上运行同源搜索，比128核CPU上的MMseqs2 k-mer快20倍，成本为后者的1/71 <sup>[5](https://www.biorxiv.org/content/10.1101/2024.11.13.623350v4)</sup> |

## 工作原理

每个聚类工具都需要一种相似性度量和一套成簇规则。常用的度量是一致性百分比，但其定义因工具而异。CD-HIT的文档将其默认值定义为全局序列一致性，即比对中相同氨基酸的数目除以较短序列的全长，并有一个选项（-G 0）可切换为局部一致性，即相同氨基酸的数目除以比对长度 <sup>[6](https://github.com/weizhongli/cdhit/blob/master/doc/cdhit-user-guide.wiki)</sup>；Linclust的论文则将CD-HIT的一致性描述为局部比对中的相同残基除以较短序列长度。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)</sup> UCLUST从全局比对计算一致性，即相同字母—字母列数除以较短序列长度，诸如 --id 0.97 的设置要求至少97%的一致性。<sup>[7](https://drive5.com/uclust/uclust_userguide_1_1_579.pdf)</sup> MMseqs2在比对满足最大E值、最小覆盖度和最小序列一致性时，用一条边连接两条序列；默认情况下，一致性为比对得分除以两个比对片段的最大长度。<sup>[8](https://mmseqs.com/latest/userguide.pdf)</sup><sup> • </sup><sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)</sup>

**算法策略**可分为几大类。贪心增量方法（CD-HIT与UCLUST采用）对序列排序（CD-HIT按长度，USEARCH按丰度），将最长或丰度最高的序列作为第一个代表序列，并把随后的每条序列分配到其代表序列满足阈值的第一个簇，否则新建一个簇。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2828112/)</sup><sup> • </sup><sup>[9](https://drive5.com/usearch/manual/uclust_algo.html)</sup> 短词（k-mer）过滤在一致性很可能低于阈值时避免昂贵的比对。<sup>[10](https://link.springer.com/article/10.1186/s12859-022-04643-9)</sup> 层次方法计算所有两两距离，并按单链接（只要与任一成员相似即加入）、全链接（须与所有成员相似）或平均链接合并簇，代价为 \( O(N^{2}) \)。<sup>[11](https://journals.asm.org/doi/10.1128/msystems.00003-15)</sup><sup> • </sup><sup>[10](https://link.springer.com/article/10.1186/s12859-022-04643-9)</sup> 基于图的方法（如MMseqs2）将序列视为顶点，满足相似性标准的序列之间以边相连，再从图中导出簇。<sup>[10](https://link.springer.com/article/10.1186/s12859-022-04643-9)</sup> Linclust通过要求序列在缩减为13个字母的字母表中至少共享一个相同的k-mer，并让每条序列只与一小部分“中心”序列比对，从而达到线性时间；默认 \( m = 20 \) 时比较次数少于 \( m \cdot N \)，在一致性阈值达到或超过90%时使用 \( k = 14 \)，低于90%时使用 \( k = 10 \)。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)</sup><sup> • </sup><sup>[8](https://mmseqs.com/latest/userguide.pdf)</sup>

贪心增量方法的运行时间按 \( O(N \cdot K) \) 扩展，其中 \( K \) 为最终的簇数；由于 \( K \) 的大小通常与 \( N \) 相近，这近乎二次方。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)</sup> 在90%一致性下拟合的幂律给出：UCLUST为 \( N^{1.62} \)，CD-HIT为 \( N^{2.75} \)，而Linclust为 \( N^{1.01} \)。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)</sup> 在90%一致性下，Linclust的聚类速度约为UCLUST的100倍、CD-HIT的62倍；在1.23亿条序列上以50%一致性运行时，其速度约为竞争工具的10至40倍。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)</sup>

## 操作流程

使用者提供一个FASTA文件，并选择工具与阈值。CD-HIT的主要参数为 -c（一致性阈值，默认0.9）、-n（词长，默认5）、-T（线程数）、-M（内存上限，单位MB，默认800），以及覆盖度控制参数 -aL/-AL/-aS/-AS。<sup>[6](https://github.com/weizhongli/cdhit/blob/master/doc/cdhit-user-guide.wiki)</sup> 词长必须与阈值匹配：蛋白质为 \( k = 2 \) 至5，DNA为 \( k = 8 \) 至12；蛋白质在阈值0.7至1.0时取 \( k = 5 \)，降至0.4至0.5时取 \( k = 2 \)；DNA在0.95至1.0时取 \( k = 10 \) 至11，降至0.75至0.8时取 \( k = 4 \)。<sup>[6](https://github.com/weizhongli/cdhit/blob/master/doc/cdhit-user-guide.wiki)</sup> CD-HIT默认的快速模式将查询序列归入第一个满足阈值的代表序列；精确模式（-g 1）则将其与所有代表序列比较，归入最相似的一个。<sup>[6](https://github.com/weizhongli/cdhit/blob/master/doc/cdhit-user-guide.wiki)</sup>

MMseqs2提供easy-cluster（级联工作流，更灵敏）和easy-linclust（线性运行时间，灵敏度略低）。<sup>[8](https://mmseqs.com/latest/userguide.pdf)</sup><sup> • </sup><sup>[12](https://github.com/soedinglab/MMseqs2/blob/519bcce9257bf779281056efd42f1f21ee84252a/README.md)</sup> 在扩增子研究中，聚类前按丰度降序排序，有助于让真实的生物学序列而非测序错误产物成为种子。<sup>[7](https://drive5.com/uclust/uclust_userguide_1_1_579.pdf)</sup>

## 起源

CD-HIT（Cluster Database at High Identity with Tolerance的缩写）由李伟忠（Weizhong Li）、Lukasz Jaroszewski和[Adam Godzik](https://www.edgepedia.org/zh/adam-godzik)于2001年报道，是一个用于聚类高度同源蛋白质序列的程序。<sup>[13](https://doi.org/10.1093/bioinformatics/17.3.282)</sup> 李伟忠与Godzik于2006年以cd-hit-2d、cd-hit-est和cd-hit-est-2d扩展了该算法，增加了两个蛋白质数据集之间的比较以及DNA和RNA序列的聚类。<sup>[14](https://doi.org/10.1093/bioinformatics/btl158)</sup> 付立民（Limin Fu）及其同事于2012年为下一代测序数据将CD-HIT并行化。<sup>[15](https://doi.org/10.1093/bioinformatics/bts565)</sup> Robert C. Edgar于2010年作为USEARCH的一部分推出UCLUST，报告其搜索与聚类比BLAST快数个数量级。<sup>[16](https://doi.org/10.1093/bioinformatics/btq461)</sup>

在OTU时代，Edgar于2013年推出UPARSE <sup>[17](https://doi.org/10.1038/nmeth.2604)</sup>，Frédéric Mahé及其同事于2014年推出Swarm <sup>[18](https://doi.org/10.7717/peerj.593)</sup>，Torbjørn Rognes及其同事于2016年推出VSEARCH，作为USEARCH的开源替代品。<sup>[19](https://doi.org/10.7717/peerj.2584)</sup> 在蛋白质方面，Maria Hauser、Christian E Mayer和[Johannes Söding](https://www.edgepedia.org/zh/johannes-soding)于2013年推出kClust <sup>[20](https://doi.org/10.1186/1471-2105-14-248)</sup>；Hauser、[Martin Steinegger](https://www.edgepedia.org/zh/martin-steinegger)和Söding于2016年推出MMseqs套件 <sup>[21](https://doi.org/10.1093/bioinformatics/btw006)</sup>；Steinegger和Söding于2017年推出MMseqs2 <sup>[22](https://doi.org/10.1038/nbt.3988)</sup>，并于2018年推出线性时间聚类算法Linclust。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)</sup> Benjamin T James、Brian B Luczak和Hani Z Girgis于2018年为DNA序列推出MeShClust。<sup>[23](https://doi.org/10.1093/nar/gky315)</sup>

## 变体

CD-HIT为蛋白质（cd-hit）、核苷酸（cd-hit-est）和双数据集比较（cd-hit-2d、cd-hit-est-2d）分别提供独立程序。<sup>[14](https://doi.org/10.1093/bioinformatics/btl158)</sup> 一套网络服务器还提供PSI-CD-HIT，它利用BLAST相似性对一致性低于40%（例如30%）的蛋白质进行聚类。<sup>[2](https://pmc.ncbi.nlm.nih.gov/articles/PMC2828112/)</sup> UCLUST的cluster_fast和cluster_smallmem命令以一条中心序列定义每个簇，要求每个成员与该中心序列的一致性超过阈值 \( T \) <sup>[9](https://drive5.com/usearch/manual/uclust_algo.html)</sup>；VSEARCH以开源方式重新实现了这一工作流。<sup>[19](https://doi.org/10.7717/peerj.2584)</sup>

**较新的工具**在算法与适用范围上有所不同。MeShClust将均值漂移算法与免比对一致性得分应用于DNA。<sup>[23](https://doi.org/10.1093/nar/gky315)</sup> ALFATClust（2022）利用免比对的Mash距离矩阵和迭代图聚类，动态调整每个簇的阈值，但不适用于阈值严格为97%的OTU聚类。<sup>[10](https://link.springer.com/article/10.1186/s12859-022-04643-9)</sup> Clusterize（2024）按相关性对序列排序，以实现线性时间聚类，其准确度可与CD-HIT、MMseqs2和UCLUST媲美。<sup>[24](https://www.nature.com/articles/s41467-024-47371-9)</sup> DIAMOND DeepClust（2026）采用级联聚类，逐级提高DIAMOND的灵敏度模式，并在比对图上使用贪心顶点覆盖。<sup>[25](https://www.nature.com/articles/s41592-026-03030-z)</sup>

## 应用

**扩增子研究**将16S rRNA读段聚为OTU，按惯例以97%相似度为阈值，该阈值被解读为大致相当于物种水平。<sup>[4](https://www.schlosslab.org/assets/pdf/2015_westcott.pdf)</sup> QIIME从1.0.0版起将UCLUST作为默认聚类方法 <sup>[11](https://journals.asm.org/doi/10.1128/msystems.00003-15)</sup>，而从头平均链接聚类比封闭参考或开放参考方法更好地反映了真实的序列距离。<sup>[4](https://www.schlosslab.org/assets/pdf/2015_westcott.pdf)</sup>

**蛋白质数据库**为去冗余和家族分组而进行聚类：UniProt和PDB都使用过CD-HIT。<sup>[14](https://doi.org/10.1093/bioinformatics/btl158)</sup> MMseqs2提供一套更新工作流，可将新序列加入已有聚类，同时保持簇标识符稳定，并被用于更新UniProtKB，将其聚类至30%相似度阈值。<sup>[8](https://mmseqs.com/latest/userguide.pdf)</sup> 为AlphaFold2的BFD数据库进行30%一致性聚类时，对228亿条序列采用了90%的单向覆盖度标准。<sup>[25](https://www.nature.com/articles/s41592-026-03030-z)</sup>

## 局限与替代方案

贪心增量方法对输入顺序和种子选择敏感，一步式贪心聚类可能将两条非常相似的序列放入不同的簇，而层次多步聚类可减轻这一问题。<sup>[6](https://github.com/weizhongli/cdhit/blob/master/doc/cdhit-user-guide.wiki)</sup> 在默认参数下，UCLUST是启发式的，不保证所有中心序列彼此之间都低于阈值 \( T \)，不过这类假阴性很少见。<sup>[9](https://drive5.com/usearch/manual/uclust_algo.html)</sup> 启发式方法会损失灵敏度：在50%一致性下，Linclust/MMseqs2、UCLUST、Linclust-m80和Linclust分别漏掉2%、10%、16%和28%的达到阈值的序列对，而Linclust的准确度受限于每条序列的k-mer数（默认20）。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)</sup><sup> • </sup><sup>[24](https://www.nature.com/articles/s41467-024-47371-9)</sup> MMseqs2将一致性转换为逐残基比对得分，这意味着被聚类的序列可能偏离用户指定的一致性百分比。<sup>[24](https://www.nature.com/articles/s41467-024-47371-9)</sup>

基于比对的相似性尽管可解释，但计算代价高昂，这促使人们采用基于k-mer的免比对度量、诸如Mash的MinHash基因组距离这类草图 <sup>[26](https://doi.org/10.1186/s13059-016-0997-x)</sup>、诸如LZW-Kernel这类基于压缩的核 <sup>[27](https://doi.org/10.1093/bioinformatics/bty349)</sup>，以及嵌入。[蛋白质语言模型](https://www.edgepedia.org/zh/protein-language-model)嵌入能捕捉序列一致性所遗漏的远缘进化关系 <sup>[28](https://lirias.kuleuven.be/retrieve/b0b507f7-d641-4ced-8277-d1878420c284)</sup>；ProteinClusterTools（2025）利用此类嵌入将层次聚类扩展到桌面计算机上约44.5万条序列，对同功能蛋白质家族产生的结果可与BLAST相比 <sup>[29](https://pubmed.ncbi.nlm.nih.gov/40465845/)</sup>，不过对于含插入和缺失的重复序列，嵌入的表现既差又不稳定。<sup>[30](https://academic.oup.com/bioinformatics/article/42/7/btag378/8707838)</sup> 自2023年起，GPU加速已经到来：MMseqs2-GPU在八块GPU上以最高100 TCUPS的速度执行无空位过滤，并进行带空位的谱比对，已集成到MMseqs2中，要发挥全速需要NVIDIA Ampere代或更新的GPU。<sup>[5](https://www.biorxiv.org/content/10.1101/2024.11.13.623350v4)</sup><sup> • </sup><sup>[31](https://doi.org/10.1038/s41592-025-02819-8)</sup><sup> • </sup><sup>[12](https://github.com/soedinglab/MMseqs2/blob/519bcce9257bf779281056efd42f1f21ee84252a/README.md)</sup>

## References

1. [CD-HIT: Cluster Database at High Identity with Tolerance (project main page)](https://bioinformatics.org/cd-hit/)
2. [CD-HIT Suite: a web server for clustering and comparing biological sequences](https://pmc.ncbi.nlm.nih.gov/articles/PMC2828112/)
3. [Clustering huge protein sequence sets in linear time (Linclust, Nature Communications 2018)](https://pmc.ncbi.nlm.nih.gov/articles/PMC6026198/)
4. [De novo clustering methods outperform reference-based methods for assigning 16S rRNA gene sequences to OTUs (PeerJ, Westcott & Schloss 2015)](https://www.schlosslab.org/assets/pdf/2015_westcott.pdf)
5. [GPU-accelerated homology search with MMseqs2 (bioRxiv preprint; published in Nature Methods 2025)](https://www.biorxiv.org/content/10.1101/2024.11.13.623350v4)
6. [CD-HIT User's Guide (official documentation, weizhongli/cdhit)](https://github.com/weizhongli/cdhit/blob/master/doc/cdhit-user-guide.wiki)
7. [UCLUST user guide v1.1.579](https://drive5.com/uclust/uclust_userguide_1_1_579.pdf)
8. [MMseqs2 User Guide](https://mmseqs.com/latest/userguide.pdf)
9. [USEARCH manual: UCLUST algorithm](https://drive5.com/usearch/manual/uclust_algo.html)
10. [Clustering biological sequences with dynamic sequence similarity threshold (ALFATClust, BMC Bioinformatics 2022)](https://link.springer.com/article/10.1186/s12859-022-04643-9)
11. [Open-Source Sequence Clustering Methods Improve the State Of the Art (mSystems)](https://journals.asm.org/doi/10.1128/msystems.00003-15)
12. [MMseqs2 README (soedinglab)](https://github.com/soedinglab/MMseqs2/blob/519bcce9257bf779281056efd42f1f21ee84252a/README.md)
13. [Weizhong Li, Lukasz Jaroszewski, Adam Godzik (2001). Clustering of highly homologous sequences to reduce the size of large protein databases. Bioinformatics.](https://doi.org/10.1093/bioinformatics/17.3.282)
14. [Weizhong Li, Adam Godzik (2006). Cd-hit: a fast program for clustering and comparing large sets of protein or nucleotide sequences. Bioinformatics.](https://doi.org/10.1093/bioinformatics/btl158)
15. [Limin Fu and colleagues (2012). CD-HIT: accelerated for clustering the next-generation sequencing data. Bioinformatics.](https://doi.org/10.1093/bioinformatics/bts565)
16. [Robert C. Edgar (2010). Search and clustering orders of magnitude faster than BLAST. Bioinformatics.](https://doi.org/10.1093/bioinformatics/btq461)
17. [Robert C Edgar (2013). UPARSE: highly accurate OTU sequences from microbial amplicon reads. Nature Methods.](https://doi.org/10.1038/nmeth.2604)
18. [Frédéric Mahé and colleagues (2014). Swarm: robust and fast clustering method for amplicon-based studies. PeerJ.](https://doi.org/10.7717/peerj.593)
19. [Torbjørn Rognes and colleagues (2016). VSEARCH: a versatile open source tool for metagenomics. PeerJ.](https://doi.org/10.7717/peerj.2584)
20. [Maria Hauser, Christian E Mayer, Johannes Söding (2013). kClust: fast and sensitive clustering of large protein sequence databases. BMC Bioinformatics.](https://doi.org/10.1186/1471-2105-14-248)
21. [Maria Hauser, Martin Steinegger, Johannes Söding (2016). MMseqs software suite for fast and deep clustering and searching of large protein sequence sets. Bioinformatics.](https://doi.org/10.1093/bioinformatics/btw006)
22. [Martin Steinegger, Johannes Söding (2017). MMseqs2 enables sensitive protein sequence searching for the analysis of massive data sets. Nature Biotechnology.](https://doi.org/10.1038/nbt.3988)
23. [Benjamin T James, Brian B Luczak, Hani Z Girgis (2018). MeShClust: an intelligent tool for clustering DNA sequences. Nucleic Acids Research.](https://doi.org/10.1093/nar/gky315)
24. [Accurately clustering biological sequences in linear time by relatedness sorting (Clusterize, Nature Communications 2024)](https://www.nature.com/articles/s41467-024-47371-9)
25. [Clustering the protein universe of life using DIAMOND DeepClust (Nature Methods, 2026)](https://www.nature.com/articles/s41592-026-03030-z)
26. [Brian D. Ondov and colleagues (2016). Mash: fast genome and metagenome distance estimation using MinHash. Genome biology.](https://doi.org/10.1186/s13059-016-0997-x)
27. [Gleb Filatov, Bruno Bauwens, Attila Kertész-Farkas (2018). LZW-Kernel: fast kernel utilizing variable length code blocks from LZW compressors for protein sequence classification. Bioinformatics.](https://doi.org/10.1093/bioinformatics/bty349)
28. [Protein language model embeddings for homology detection and clustering (review chapter)](https://lirias.kuleuven.be/retrieve/b0b507f7-d641-4ced-8277-d1878420c284)
29. [Exploring Large Protein Sequence Space through Homology- and Representation-based Hierarchical Clustering (ProteinClusterTools)](https://pubmed.ncbi.nlm.nih.gov/40465845/)
30. [GBSC: graph-based sequence clustering method for similar short tandem repeats in protein sequences (Bioinformatics, 2026)](https://academic.oup.com/bioinformatics/article/42/7/btag378/8707838)
31. [Felix Kallenborn and colleagues (2025). GPU-accelerated homology search with MMseqs2. Nature Methods.](https://doi.org/10.1038/s41592-025-02819-8)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026 · Last review: Sep 30, 2026*

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

Copyright 2026 Edgepedia

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

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

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