# UniFrac

UniFrac是[微生物组](https://www.edgepedia.org/zh/microbiome)研究中的一种β多样性距离度量，它通过测量一个群落或另一个群落独有的系统发育树枝长所占比例，量化两个微生物群落之间的差异程度。由于它基于系统发育树工作，而不是仅基于分类单元计数表，因此能够记录每个样本中存在的生物之间的演化距离，并已成为微生物组研究中的标准距离度量之一。

| 关键事实 | 详情 |
|---|---|
| 它度量什么 | 系统发育树中，通向仅来自一个样本或另一个样本、而非同时来自两者的后代的枝长所占比例 <sup>[1](https://doi.org/10.1128/aem.71.12.8228-8235.2005)</sup> |
| 提出 | 凯瑟琳·洛祖蓬（Catherine Lozupone）和罗布·奈特（Rob Knight），《应用与环境微生物学》（Applied and Environmental Microbiology），2005年 <sup>[1](https://doi.org/10.1128/aem.71.12.8228-8235.2005)</sup> |
| 取值范围 | 相同群落为0；对于没有共享谱系的群落，归一化加权UniFrac达到1 <sup>[2](https://doi.org/10.1128/aem.01996-06)</sup> |
| 主要变体 | 非加权、加权（原始和归一化）、广义、方差校正、信息和比值UniFrac <sup>[3](https://doi.org/10.1093/bioinformatics/bts342)</sup><sup> • </sup><sup>[4](https://doi.org/10.1371/journal.pone.0161196)</sup> |
| 输入 | 一棵包含至少两个样本序列的单一有根系统发育树，以及一个将每条序列映射到其样本的文件 <sup>[5](https://doi.org/10.1186/1471-2105-7-371)</sup> |
| 显著性检验 | 在固定树上对样本标签进行蒙特卡洛置换；后来的工作流在距离矩阵上使用PCoA和层次聚类等排序方法 <sup>[1](https://doi.org/10.1128/aem.71.12.8228-8235.2005)</sup><sup> • </sup><sup>[6](https://doi.org/10.1038/ismej.2009.97)</sup> |

## 工作原理

UniFrac将一棵有根系统发育树视为所观察生物之间演化关系的图谱。对于每个分支，它考察该分支的后代出现在群落A、群落B、两者皆有，还是两者皆无。非加权距离是通向仅存在于两个群落之一的后代的总枝长，除以通向任一群落后代的总枝长。形式化地，设共有 \( N \) 个节点，节点 \( i \) 与其父节点之间的枝长为 \( l_{i} \)，并用指示变量 \( A_{i} \), \( B_{i} \in \{0,1\} \) 表示后代是否存在：

\[ u = \frac{\sum_{i=1}^{N} l_{i} \lvert A_{i} - B_{i} \rvert}{\sum_{i=1}^{N} l_{i} \max(A_{i}, B_{i})} \]

<sup>[7](https://mothur.org/wiki/unweighted_unifrac_algorithm/)</sup> 当两个群落共享所有谱系时，结果为0；随着谱系分化，结果趋近于1。由于该度量非负、对称，并且在通常的树和枝长假设下满足三角不等式，完整的成对距离矩阵可用于UPGMA聚类和主坐标分析，从而一次比较许多样本。<sup>[1](https://doi.org/10.1128/aem.71.12.8228-8235.2005)</sup>

系统发育信息正是该方法的要点。更早的检验，如P检验和 \( F_{\mathrm{ST}} \)，只能比较群落对，且不使用枝长信息。<sup>[1](https://doi.org/10.1128/aem.71.12.8228-8235.2005)</sup> 非加权UniFrac是[杰卡德指数](https://www.edgepedia.org/zh/jaccard-index)在系统发育上的扩展，基于谱系的有无<sup>[7](https://mothur.org/wiki/unweighted_unifrac_algorithm/)</sup>；而加权UniFrac是坎托罗维奇–鲁宾斯坦（推土机）距离的一种实现，埃文斯（Evans）和马岑（Matsen）证明它是树上的一阶瓦瑟斯坦距离。<sup>[4](https://doi.org/10.1371/journal.pone.0161196)</sup><sup> • </sup><sup>[8](https://psb.stanford.edu/psb-online/proceedings/psb12/fukuyama.pdf)</sup>

## 计算流程

分析需要两个输入：一棵包含至少两个样本序列的单一有根系统发育树，以及一个将每条序列映射到其样本的文件。<sup>[5](https://doi.org/10.1186/1471-2105-7-371)</sup> 在现代实践中，树和特征表（按样本列出的OTU或ASV）来自标准的扩增子或鸟枪法流程，树通常以中点生根。<sup>[4](https://doi.org/10.1371/journal.pone.0161196)</sup>

计算对每一对样本遍历一次树，按所选变体的公式对枝长加权并累加。对于加权UniFrac，每条枝长 \( l_{i} \) 乘以该分支以下比例丰度的绝对差 \( \lvert a_{i}/A_{T} - b_{i}/B_{T} \rvert \)，其中 \( a_{i} \) 和 \( b_{i} \) 是分支 \( i \) 以下群落A和B的丰度，\( A_{T} \) 是群落A的总丰度。<sup>[8](https://psb.stanford.edu/psb-online/proceedings/psb12/fukuyama.pdf)</sup>

成对差异的显著性通过[蒙特卡洛](https://www.edgepedia.org/zh/monte-carlo)随机化检验：在树保持不变的条件下置换样本标签，P值为随机标签分配中，所选UniFrac变体的检验统计量至少与观测值一样大的比例。<sup>[1](https://doi.org/10.1128/aem.71.12.8228-8235.2005)</sup><sup> • </sup><sup>[7](https://mothur.org/wiki/unweighted_unifrac_algorithm/)</sup> 当样本很多时，该网络工具在成对比较之间应用[邦费罗尼校正](https://www.edgepedia.org/zh/bonferroni-correction)。<sup>[5](https://doi.org/10.1186/1471-2105-7-371)</sup> 随着测序深度增加，Fast UniFrac作者建议将重点从成对检验转向能同时关联所有样本的多变量方法，如PCoA和层次聚类。<sup>[6](https://doi.org/10.1038/ismej.2009.97)</sup>

原始实现是在Macintosh G4上运行的Python代码。<sup>[1](https://doi.org/10.1128/aem.71.12.8228-8235.2005)</sup> Fast UniFrac用基于数组的numpy操作取代树遍历，运行速度快10到100倍。<sup>[6](https://doi.org/10.1038/ismej.2009.97)</sup> Striped UniFrac将单线程性能提高30倍以上，并具有接近线性的并行扩展性，在笔记本电脑上不到24小时处理了27,751个样本的地球微生物组计划（Earth Microbiome Project）数据集，结果与其他算法相同。<sup>[9](https://doi.org/10.1038/s41592-018-0187-8)</sup> 后来的OpenACC GPU实现实现了超过1,000倍的加速。<sup>[10](https://journals.asm.org/doi/10.1128/msystems.00028-22)</sup>

## 起源

洛祖蓬和奈特于2005年在《应用与环境微生物学》上提出UniFrac。<sup>[1](https://doi.org/10.1128/aem.71.12.8228-8235.2005)</sup> 2005年的论文已经从原理上描述了一种丰度加权变体。<sup>[1](https://doi.org/10.1128/aem.71.12.8228-8235.2005)</sup> 洛祖蓬、哈马迪（Hamady）和奈特于2006年在《BMC生物信息学》（BMC Bioinformatics）上描述了一个网络应用。<sup>[5](https://doi.org/10.1186/1471-2105-7-371)</sup> 洛祖蓬、哈马迪、凯利（Kelley）和奈特于2007年发表了加权UniFrac的归一化和非归一化形式。<sup>[2](https://doi.org/10.1128/aem.01996-06)</sup> 哈马迪、洛祖蓬和奈特于2009年在《ISME杂志》（The ISME Journal）上报告了Fast UniFrac。<sup>[6](https://doi.org/10.1038/ismej.2009.97)</sup> 张（Chang）、栾（Luan）和孙（Sun）于2011年在《BMC生物信息学》上提出方差校正加权UniFrac<sup>[11](https://doi.org/10.1186/1471-2105-12-118)</sup>；陈（Chen）及其同事于2012年在《[生物信息学](https://www.edgepedia.org/zh/bioinformatics)》（Bioinformatics）上提出广义UniFrac<sup>[3](https://doi.org/10.1093/bioinformatics/bts342)</sup>；黄（Wong）、吴（Wu）和格卢尔（Gloor）于2016年在《PLoS ONE》上引入信息UniFrac和比值UniFrac。<sup>[4](https://doi.org/10.1371/journal.pone.0161196)</sup> 布赖恩特（Bryant）及其同事于2008年在PNAS上提出PhyloSor，即索伦森（Sørensen）相异度的系统发育类似物。<sup>[12](https://doi.org/10.1073/pnas.0801920105)</sup> 麦克唐纳（McDonald）及其同事于2018年在《[自然·方法](https://www.edgepedia.org/zh/nature-methods)》（Nature Methods）上发表了Striped UniFrac。<sup>[9](https://doi.org/10.1038/s41592-018-0187-8)</sup>

## 变体

**非加权与加权。** 非加权UniFrac忽略丰度，在检测稀有谱系的变化时最为高效；加权UniFrac使用绝对丰度差异，对高丰度谱系的变化最为敏感。当重要变化发生在中等丰度谱系中时，两者都可能降低检验效能。<sup>[3](https://doi.org/10.1093/bioinformatics/bts342)</sup> 非加权UniFrac比DPCoA或加权UniFrac都更重视较浅的分支。<sup>[8](https://psb.stanford.edu/psb-online/proceedings/psb12/fukuyama.pdf)</sup>

**归一化与非归一化加权UniFrac。** 加权UniFrac的归一化将原始加权值 \( u_{w} \) 除以缩放因子 \( D \)，即每条序列到根的平均距离，使相同群落取值为0，不重叠群落取值为1。<sup>[2](https://doi.org/10.1128/aem.01996-06)</sup>

**广义UniFrac。** 陈及其同事用一个调节参数 \( \alpha \in [0,1] \) 将该家族统一起来，该参数作为 \( (A_{i}/A_{T} + B_{i}/B_{T}) \) 上的指数，控制高丰度分支的贡献；作者建议 \( \alpha = 0.5 \)。<sup>[3](https://doi.org/10.1093/bioinformatics/bts342)</sup>

**其他加权方式。** 方差校正加权UniFrac用随机抽样下的方差来调节分支比例差异。<sup>[11](https://doi.org/10.1186/1471-2105-12-118)</sup><sup> • </sup><sup>[13](https://search.r-project.org/CRAN/refmans/abdiv/html/unifrac.html)</sup> 加权UniFrac把一个分类单元从5/1000升至10/1000与从95/1000升至100/1000同等对待，尽管前者翻了一倍；信息UniFrac和比值UniFrac的加权方式解决了这一点，并且对抽平较不敏感，不过比值UniFrac违反三角不等式，是一种相异度而非距离。<sup>[4](https://doi.org/10.1371/journal.pone.0161196)</sup>

## 应用

2005年的论文将UniFrac应用于已发表的来自海洋沉积物、水和冰的16S rRNA文库，发现地理位置与北极和南极冰及沉积物中的细菌群落差异没有强相关性。<sup>[1](https://doi.org/10.1128/aem.71.12.8228-8235.2005)</sup> 在温泉研究中，加权UniFrac按泉水化学特征对样本聚类，而非加权UniFrac的第一因子与温度相关，表明定性和定量度量可以在同一数据上支持不同结论。<sup>[2](https://doi.org/10.1128/aem.01996-06)</sup> 在调查尺度上，它支撑了地球微生物组计划的分析。<sup>[9](https://doi.org/10.1038/s41592-018-0187-8)</sup>

## 局限与替代方法

由于非加权UniFrac是一种二值的有无检验，它对测序深度敏感，并假定已归一化到共同深度；因此抽平成为QIIME和mothur中的标准工作流步骤。<sup>[4](https://doi.org/10.1371/journal.pone.0161196)</sup> 在没有组结构的均匀数据集中，非加权UniFrac可能因抽平实例和深度不同而产生截然不同的结果，制造虚假分组；作者将这一效应归因于成分数据的子成分效应。<sup>[4](https://doi.org/10.1371/journal.pone.0161196)</sup> 无论加权还是非加权UniFrac，对构建底层系统发育的方法都不敏感；这一点在七棵树中得到检验，其中10%到75%的支系为某一棵树所独有。<sup>[2](https://doi.org/10.1128/aem.01996-06)</sup>

主要替代方法在系统发育与丰度信息之间取舍。传统UniFrac使用相对丰度，忽略微生物载量的变化，这限制了对具有生态意义的变化的检测；Bray–Curtis可以捕捉载量，但忽略系统发育<sup>[14](https://doi.org/10.1101/2025.07.18.665540)</sup>；而非加权UniFrac尽管采用有无设计，在某些分析中可能表现得比杰卡德指数更像基于丰度的Bray–Curtis。<sup>[15](https://link.springer.com/article/10.1186/s13059-019-1735-y)</sup> 在没有组差异或组差异很小的数据集中，加权UniFrac、信息UniFrac、比值UniFrac和Bray–Curtis比非加权UniFrac更可靠；作者建议使用多种度量，因为每种度量在不同情况下检测离群值。<sup>[4](https://doi.org/10.1371/journal.pone.0161196)</sup> 近期工作扩展了这一家族，而非取代它。彭德尔顿（Pendleton）和施密特（Schmidt）在2025年的一项工作中引入了绝对UniFrac（Absolute UniFrac，UA），该工作后来以同行评议形式发表（PubMed Central PMC12900076；PubMed PMID 41696024）；它是加权UniFrac的一种变体，纳入绝对丰度（微生物载量），并有一个广义扩展（GUA），其参数 \( \alpha \) 调节稀有谱系与高丰度谱系的贡献；在 \( \alpha \) 较高时，GUA仅与总细胞丰度的差异就呈强相关，这可能掩盖对成分组成的解释。<sup>[14](https://doi.org/10.1101/2025.07.18.665540)</sup> coreUniFrac由贝威克（Bewick）和坎珀（Camper）于2026年在《微生物组》（Microbiome）上报告，它使用基于末端或基于分支的核心群落系统发育，计算两个栖息地核心微生物组之间的UniFrac距离。<sup>[16](https://doi.org/10.1186/s40168-026-02520-8)</sup>

## References

1. [Catherine Lozupone, Rob Knight (2005). UniFrac: a New Phylogenetic Method for Comparing Microbial Communities. Applied and Environmental Microbiology.](https://doi.org/10.1128/aem.71.12.8228-8235.2005)
2. [Catherine A. Lozupone and colleagues (2007). Quantitative and Qualitative β Diversity Measures Lead to Different Insights into Factors That Structure Microbial Communities. Applied and Environmental Microbiology.](https://doi.org/10.1128/aem.01996-06)
3. [Jun Chen and colleagues (2012). Associating microbiome composition with environmental covariates using generalized UniFrac distances. Bioinformatics.](https://doi.org/10.1093/bioinformatics/bts342)
4. [Ruth G. Wong, Jia R. Wu, Gregory B. Gloor (2016). Expanding the UniFrac Toolbox. PLoS ONE.](https://doi.org/10.1371/journal.pone.0161196)
5. [Catherine Lozupone, Micah Hamady, Rob Knight (2006). UniFrac – An online tool for comparing microbial community diversity in a phylogenetic context. BMC Bioinformatics.](https://doi.org/10.1186/1471-2105-7-371)
6. [Micah Hamady, Catherine Lozupone, Rob Knight (2009). Fast UniFrac: facilitating high-throughput phylogenetic analyses of microbial communities including analysis of pyrosequencing and PhyloChip data. The ISME Journal.](https://doi.org/10.1038/ismej.2009.97)
7. [Unweighted UniFrac algorithm (mothur documentation)](https://mothur.org/wiki/unweighted_unifrac_algorithm/)
8. [Comparisons of nonparametric analyses of microbiome data (Fukuyama et al., PSB 2012)](https://psb.stanford.edu/psb-online/proceedings/psb12/fukuyama.pdf)
9. [Daniel McDonald and colleagues (2018). Striped UniFrac: enabling microbiome analysis at unprecedented scale. Nature Methods.](https://doi.org/10.1038/s41592-018-0187-8)
10. [Optimizing UniFrac with OpenACC Yields Greater Than One Thousand Times Speed Increase (mSystems 2022)](https://journals.asm.org/doi/10.1128/msystems.00028-22)
11. [Qin Chang, Yihui Luan, Fengzhu Sun (2011). Variance adjusted weighted UniFrac: a powerful beta diversity measure for comparing communities based on phylogeny. BMC Bioinformatics.](https://doi.org/10.1186/1471-2105-12-118)
12. [Jessica A. Bryant and colleagues (2008). Microbes on mountainsides: Contrasting elevational patterns of bacterial and plant diversity. Proceedings of the National Academy of Sciences.](https://doi.org/10.1073/pnas.0801920105)
13. [R: UniFrac distance (abdiv package documentation)](https://search.r-project.org/CRAN/refmans/abdiv/html/unifrac.html)
14. [Augustus Pendleton, Marian L. Schmidt (2025). Interpreting UniFrac with Absolute Abundance: A Conceptual and Practical Guide. bioRxiv (Cold Spring Harbor Laboratory).](https://doi.org/10.1101/2025.07.18.665540)
15. [Emphasis on the deep or shallow parts of the tree provides a new characterization of phylogenetic distances (Genome Biology, 2019)](https://link.springer.com/article/10.1186/s13059-019-1735-y)
16. [Sharon Anne Bewick, Benjamin Thomas Camper (2026). Phylogenetic measures of the core microbiome. Microbiome.](https://doi.org/10.1186/s40168-026-02520-8)

---
*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/unifrac

English original: https://www.edgepedia.org/unifrac
