# 加权相关网络分析

加权相关网络分析（WGCNA）是一种统计方法，它从变量之间的两两相关性构建加权网络（这些变量最常见的是在表达样本中测得的基因），并将网络划分为高度相关基因组成的模块。它用一个特征基因来概括每个模块，将模块与外部样本性状关联，并识别枢纽基因。<sup>[1](https://doi.org/10.2202/1544-6115.1128)</sup><sup> • </sup><sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup>

| 关键事实 | 详情 |
|---|---|
| 输出 | 模块（密集互连基因的聚类）、模块特征基因、模块—性状关联，以及按模块隶属度排序的枢纽基因<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup> |
| 邻接 | 加权：软阈值化幂次 \( \beta \geq 1 \)<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup> |
| 选择β | 使无标度拓扑拟合指数 \( R^2 \) 达到足够水平（通常高于0.80）的最低幂次<sup>[3](https://link.springer.com/article/10.1186/1471-2164-7-40)</sup><sup> • </sup><sup>[4](https://pages.stat.wisc.edu/~yandell/statgen/ucla/WGCNA/wgcna.pdf)</sup> |
| 最少数据 | 不建议少于15个样本；最好至少20个<sup>[5](https://github.com/edo98811/WGCNA_official_documentation/blob/main/faq.html)</sup> |
| 可扩展性 | 单块分析需要 \( O(n^{2}) \) 的内存和 \( O(n^{3}) \) 的计算量；块大小为 \( n_b \) 的分块分析需要 \( O(n_b^{2}) \) 的内存和 \( O(n \cdot n_b^{2}) \) 的计算量<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup> |
| 原始软件 | WGCNA R包，由Peter Langfelder和Steve Horvath（2008）描述<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup> |
| 近期实现 | Python中的PyWGCNA（2023）以及用于单细胞和空间转录组学的hdWGCNA（2023）<sup>[6](https://academic.oup.com/bioinformatics/article/39/7/btad415/7218311)</sup><sup> • </sup><sup>[7](https://doi.org/10.1016/j.crmeth.2023.100498)</sup> |

## 工作原理

WGCNA将每个变量（通常是一个基因）视为一个节点，并把表达谱之间的两两相关性转换为连接权重。它使用共表达相似性，将其取幂得到邻接：对于无符号网络，\( a_{ij} = \lvert \mathrm{cor}(x_i, x_j) \rvert^{\beta} \)；对于有符号网络，\( a_{ij} = (0.5 \cdot (1 + \mathrm{cor}(x_i, x_j)))^{\beta} \)，其中 \( \beta \geq 1 \)。<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup>

**为什么要用软阈值化。** 硬阈值会不连续地丢弃信息：如果截断值设为0.8，那么两个相关性为0.799的基因之间就完全没有连接。<sup>[8](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1000117)</sup> 软阈值化将每一对都保留为分级连接，而且加权中心性度量比硬阈值化后的度量更稳健。<sup>[9](https://gds-yazarlab.bilkent.edu.tr/wp-content/uploads/YeastTutorialHorvath.pdf)</sup>

**选择β。** 软阈值化幂次依据无标度拓扑准则来选择：生物网络大致服从无标度度分布，因此β被选为在度分布上计算出的拟合指数 \( R^2 = \mathrm{cor}(\log p(k), \log k)^2 \) 达到足够水平时的最低幂次。<sup>[3](https://link.springer.com/article/10.1186/1471-2164-7-40)</sup><sup> • </sup><sup>[4](https://pages.stat.wisc.edu/~yandell/statgen/ucla/WGCNA/wgcna.pdf)</sup> 实践者追求 \( R^2 \) 大致高于0.80，且斜率接近−1，使用pickSoftThreshold函数，该函数会报告幂次、无标度 \( R^2 \)、斜率和平均连通度。<sup>[9](https://gds-yazarlab.bilkent.edu.tr/wp-content/uploads/YeastTutorialHorvath.pdf)</sup>

模块是密集互连基因的聚类，通过对拓扑重叠度量进行层次聚类来检测，该度量反映两个节点共享多少邻居，其相异度为 \( \mathrm{dissTOM}_{ij} = 1 - \mathrm{TopOverlap}_{ij} \)。<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup><sup> • </sup><sup>[4](https://pages.stat.wisc.edu/~yandell/statgen/ucla/WGCNA/wgcna.pdf)</sup> 每个模块由其特征基因 \( E^{(q)} \) 概括，即第一主成分（对于样本为行、基因为列的表达矩阵，就是跨样本的得分向量，与标准化模块表达数据的第一左奇异向量成比例），模块隶属度则通过基因与模块特征基因之间的相关性来衡量。<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup><sup> • </sup><sup>[10](https://doi.org/10.1186/1752-0509-1-54)</sup>

## 操作步骤

典型的工作流程如下。首先，预处理表达矩阵：检查样本和基因（goodSamplesGenes），通过样本聚类剔除离群值；对于RNA-seq数据，去除低计数特征，应用方差稳定化变换（如DESeq2的varianceStabilizingTransformation或log2(x+1)），并使用ComBat去除批次效应。<sup>[5](https://github.com/edo98811/WGCNA_official_documentation/blob/main/faq.html)</sup><sup> • </sup><sup>[11](https://systemsbio.ucsd.edu/WGCNAdemo/)</sup> 基因常按方差进行预过滤，例如保留中位绝对偏差最大的5000个；不建议按差异表达进行过滤，因为这会破坏无标度拓扑假设。<sup>[5](https://github.com/edo98811/WGCNA_official_documentation/blob/main/faq.html)</sup><sup> • </sup><sup>[12](https://bioconductor.statistik.uni-dortmund.de/packages/3.5/bioc/vignettes/CVE/inst/doc/WGCNA_from_TCGA_RNAseq.html)</sup>

其次，使用pickSoftThreshold依据无标度准则选择β。第三，构建拓扑重叠矩阵及其相异度，用平均连接法聚类，并用动态树切割方法（cutreeDynamic）切割分支；最后合并特征基因相关性高于阈值（例如0.75）的模块。<sup>[4](https://pages.stat.wisc.edu/~yandell/statgen/ucla/WGCNA/wgcna.pdf)</sup><sup> • </sup><sup>[13](https://doi.org/10.1093/bioinformatics/btm563)</sup> 自动替代方案blockwiseModules使用一种k-means变体（projectiveKMeans）将基因预聚类为块，对每块运行相同的流程，并合并相近的模块（mergeCloseModules）。<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup><sup> • </sup><sup>[14](https://rdrr.io/cran/WGCNA/man/blockwiseModules.html)</sup>

第四，通过计算特征基因与样本性状的相关性来关联模块与性状，并量化枢纽地位：基因显著性为 \( GS_i = \lvert \mathrm{cor}(x_i, T) \rvert \)，模块隶属度（kME）用signedKME计算，模块内枢纽是那些在自身模块内具有高连通度和高kME的基因。<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup><sup> • </sup><sup>[4](https://pages.stat.wisc.edu/~yandell/statgen/ucla/WGCNA/wgcna.pdf)</sup>

## 起源

总体框架，包括软阈值化、邻接函数和无标度拓扑准则，由Bin Zhang和Steve Horvath在《加权基因共表达网络分析的通用框架》（《遗传学与分子生物学中的统计应用》，2005）中描述。<sup>[1](https://doi.org/10.2202/1544-6115.1128)</sup> 该方法建立在早期未加权基因共表达网络工作的基础上，其中硬阈值化的相关性产生二值网络；2005年的框架用分级连接权重取代了那个二值步骤。<sup>[1](https://doi.org/10.2202/1544-6115.1128)</sup><sup> • </sup><sup>[3](https://link.springer.com/article/10.1186/1471-2164-7-40)</sup> WGCNA R包由Peter Langfelder和Steve Horvath在《BMC生物信息学》（2008）中描述，增加了分块模块检测、pickSoftThreshold、kME计算和共识函数。<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup> 特征基因网络、共识模块和差异特征基因网络分析由Langfelder和Horvath在《BMC系统生物学》（2007）中补充，模块隶属度和特征基因框架的几何解释则由Steve Horvath和Jun Dong在《PLoS计算生物学》（2008）中给出。<sup>[10](https://doi.org/10.1186/1752-0509-1-54)</sup><sup> • </sup><sup>[8](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1000117)</sup> 用于模块检测的动态树切割算法以Dynamic Tree Cut包的形式发表，作者为Peter Langfelder、Bin Zhang和Steve Horvath，发表于《生物信息学》（2007）。<sup>[13](https://doi.org/10.1093/bioinformatics/btm563)</sup>

## 变体

若干软件包对核心方法进行了封装或扩展。CEMiTool（2018）自动化了整个流程，包括基因过滤和功能富集，并使用一种基于柯西序列的算法选择β，目标是 \( R^2 > 0.8 \)。<sup>[15](https://link.springer.com/article/10.1186/s12859-018-2053-1)</sup> km2gcn包增加了一个k-means精化步骤，按最高模块隶属度将基因重新分配到模块，在组织基准测试中减少了错位基因。<sup>[16](https://link.springer.com/article/10.1186/s12918-017-0420-6)</sup> PyWGCNA在Python中原生实现了相同的流程，并通过GSEApy增加了GO、KEGG和REACTOME富集分析。<sup>[6](https://academic.oup.com/bioinformatics/article/39/7/btad415/7218311)</sup> 对于单细胞和空间转录组学，由Samuel Morabito及其同事描述的hdWGCNA（《细胞报告方法》，2023）在Seurat对象上工作，使用元细胞来应对稀疏性。<sup>[7](https://doi.org/10.1016/j.crmeth.2023.100498)</sup><sup> • </sup><sup>[17](https://github.com/smorabit/hdwgcna)</sup> multiWGCNA（2023）将该方法扩展到多性状数据集，使用组合网络、疾病状态网络和次要性状网络，并通过因子方差分析进行检验。<sup>[18](https://pmc.ncbi.nlm.nih.gov/articles/PMC10039544/)</sup>

## 应用

到2008年，WGCNA已被应用于脑癌、酵母细胞周期、小鼠遗传学、灵长类脑组织、糖尿病、慢性疲劳患者和植物。<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup> 典型问题是哪些基因模块与临床性状相关、哪些枢纽驱动疾病相关模块，以及哪些模块在不同条件下被保留或获得。在遗传学中，模块—性状关联和枢纽地位被用于从GWAS和表达研究中优先筛选基因；在三项案例研究中，共识模块中的模块内枢纽地位产生的基因列表比荟萃分析的p值更具生物学意义，尽管标准荟萃分析在独立数据集中的验证成功率表现相当或更好。<sup>[19](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0061505)</sup>

## 局限与替代方案

WGCNA假设数据经过适当预处理和归一化，并且对技术伪影、组织污染和不良实验设计敏感；该软件包并不指示哪种模块检测方法最佳，且仅限于无向网络。<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup> 选择β很重要：在若干情况下，默认的pickSoftThreshold返回了不合适的β值1，这促使CEMiTool采用替代选择算法。<sup>[15](https://link.springer.com/article/10.1186/s12859-018-2053-1)</sup> 如果在合理幂次下无标度拟合指数未能超过0.8而平均连通度仍然很高，数据很可能包含样本异质性的强驱动因素。<sup>[5](https://github.com/edo98811/WGCNA_official_documentation/blob/main/faq.html)</sup> 枢纽的解释也需要谨慎：模块内枢纽基因具有高度相关的表达谱，因此通常会产生数十个候选基因，关键是关注模块内枢纽而非全网络枢纽。<sup>[8](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1000117)</sup><sup> • </sup><sup>[19](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0061505)</sup> 共表达边可能反映间接而非直接调控，小样本可能产生假阳性。<sup>[20](https://pmc.ncbi.nlm.nih.gov/articles/PMC9168722/)</sup>

可扩展性是一个实际限制：单块分析需要 \( O(n^{2}) \) 的内存和 \( O(n^{3}) \) 的计算量，TOM计算往往是最昂贵的步骤，4 GB的台式机不太可能处理大于8000个基因的块；分块分析以一定的全局最优性换取内存，因为块预聚类可能将离群基因分配到与全网络分析不同的模块中。<sup>[2](https://doi.org/10.1186/1471-2105-9-559)</sup><sup> • </sup><sup>[14](https://rdrr.io/cran/WGCNA/man/blockwiseModules.html)</sup><sup> • </sup><sup>[4](https://pages.stat.wisc.edu/~yandell/statgen/ucla/WGCNA/wgcna.pdf)</sup>

与替代方案相比，一项在20个数据集上对42种模块检测方法的基准测试发现，WGCNA对参数调优相对不敏感，但作为一种聚类方法，它只考察所有样本的共表达，无法检测局部（情境特异性）共表达，无法将基因分配到多个模块，也不一定将每个基因分配到一个模块；基于ICA的分解方法在不同数据集间更一致地恢复了已知模块。<sup>[21](https://www.nature.com/articles/s41467-018-03424-4)</sup> 使用硬阈值的保守网络方法从高相关性且跨数据集持续存在的边构建网络（例如某方案中|r| > 0.85且p < 0.05，仅保留在下采样子集中保守的边，因为据报道在该设置下低于该截断值的相关性会产生随机信号的网络）。<sup>[20](https://pmc.ncbi.nlm.nih.gov/articles/PMC9168722/)</sup>

## References

1. [Bin Zhang, Steve Horvath (2005). A General Framework for Weighted Gene Co-Expression Network Analysis. Statistical Applications in Genetics and Molecular Biology.](https://doi.org/10.2202/1544-6115.1128)
2. [Peter Langfelder, Steve Horvath (2008). WGCNA: an R package for weighted correlation network analysis. BMC Bioinformatics.](https://doi.org/10.1186/1471-2105-9-559)
3. [Gene connectivity, function, and sequence conservation: predictions from modular yeast co-expression networks (BMC Genomics 2006)](https://link.springer.com/article/10.1186/1471-2164-7-40)
4. [Corrected R code from chapter 12 of the Horvath/Langfelder WGCNA book](https://pages.stat.wisc.edu/~yandell/statgen/ucla/WGCNA/wgcna.pdf)
5. [WGCNA FAQ (official documentation mirror)](https://github.com/edo98811/WGCNA_official_documentation/blob/main/faq.html)
6. [PyWGCNA: a Python package for weighted gene co-expression network analysis (Bioinformatics, 2023)](https://academic.oup.com/bioinformatics/article/39/7/btad415/7218311)
7. [Samuel Morabito and colleagues (2023). hdWGCNA identifies co-expression networks in high-dimensional transcriptomics data. Cell Reports Methods.](https://doi.org/10.1016/j.crmeth.2023.100498)
8. [Geometric Interpretation of Gene Coexpression Network Analysis (PLOS Computational Biology, Horvath group)](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1000117)
9. [YEAST Gene Co-expression Network Analysis R Tutorial (Horvath lab)](https://gds-yazarlab.bilkent.edu.tr/wp-content/uploads/YeastTutorialHorvath.pdf)
10. [Peter Langfelder, Steve Horvath (2007). Eigengene networks for studying the relationships between co-expression modules. BMC Systems Biology.](https://doi.org/10.1186/1752-0509-1-54)
11. [WGCNA demo protocol (UCSD Systems Biology)](https://systemsbio.ucsd.edu/WGCNAdemo/)
12. [Weighted gene co-expression network analysis with TCGA RNAseq data (CVE tutorial)](https://bioconductor.statistik.uni-dortmund.de/packages/3.5/bioc/vignettes/CVE/inst/doc/WGCNA_from_TCGA_RNAseq.html)
13. [Peter Langfelder, Bin Zhang, Steve Horvath (2007). Defining clusters from a hierarchical cluster tree: the Dynamic Tree Cut package for R. Bioinformatics.](https://doi.org/10.1093/bioinformatics/btm563)
14. [blockwiseModules: Automatic network construction and module detection (WGCNA man page)](https://rdrr.io/cran/WGCNA/man/blockwiseModules.html)
15. [CEMiTool: a Bioconductor package for performing comprehensive modular co-expression analyses](https://link.springer.com/article/10.1186/s12859-018-2053-1)
16. [An additional k-means clustering step improves the biological features of WGCNA gene co-expression networks (BMC Systems Biology, 2017)](https://link.springer.com/article/10.1186/s12918-017-0420-6)
17. [smorabit/hdWGCNA, High dimensional weighted gene co-expression network analysis](https://github.com/smorabit/hdwgcna)
18. [multiWGCNA: an R package for deep mining gene co-expression networks in multi-trait expression data (2023)](https://pmc.ncbi.nlm.nih.gov/articles/PMC10039544/)
19. [When Is Hub Gene Selection Better than Standard Meta-Analysis? (PLOS One, Langfelder/Horvath group)](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0061505)
20. [A computational approach to generate highly conserved gene co-expression networks with RNA-seq data](https://pmc.ncbi.nlm.nih.gov/articles/PMC9168722/)
21. [A comprehensive evaluation of module detection methods for gene expression data (Nature Communications 2018)](https://www.nature.com/articles/s41467-018-03424-4)

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

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Multivariate association and dimension reduction › Titles Mo to W

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/weighted-correlation-network-analysis

English original: https://www.edgepedia.org/weighted-correlation-network-analysis
