The WGCNA R software package is a comprehensive collection of R functions for performing various aspects of weighted correlation network analysis. The package includes functions for network construction, module detection, gene selection, calculations of topological properties, data simulation, visualization, and interfacing with external software. Along with the R package we also present R software tutorials. While the methods development was motivated by gene expression data, the underlying data mining approach can be applied to a variety of different settings.
Click here to access the tutorial page.
Automatic installation from CRAN
The WGCNA package is now available from the Comprehensive R Archive Network (CRAN), the standard repository for R add-on packages. Currently, one of the required packages is only available from Bioconductor and needs to be installed separately. To install the required packages and WGCNA, simply type
This will install the WGCNA package and all necessary dependencies. The catch is that this only installs the newest version of WGCNA if your R version is also the newest (minor) version. Users using older versions of R will need to follow the manual download and installation instructions below.
Note for Mac users:
CRAN occasionally fails to compile the WGCNA package for
Mac OS X. This leads to the error message "Package WGCNA is not available..." when calling
install.packages(). If this occurs,
please download the binary version from here and follow the installation
instructions (or, if you are able to compile packages locally, download the source and install that).
Note of caution: The newest versions of WGCNA is available from CRAN only for the current R version. For example, if your R version is 2.14.1 and the current R version on CRAN is 2.15.2, the automatic installation and update will not use the newest version of WGCNA. Please update your R to the newest version or use the manual download below.
Problems installing or using the package? Please see our list of frequently asked
questions. Your problem and the solution may already be posted there.
Manual download and installation
Please follow these steps only if the automatic package installation above does not work.
Prerequisites:
The current version of the WGCNA package will only work with R version 2.14.0 and higher. If you have an older version of R, please upgrade your R.
The WGCNA package requires the following packages to be installed: stats, grDevices, dynamicTreeCut (1.20 or higher), cluster, utils, flashClust, reshape, and impute (from Bioconductor). If your system does not have them installed, the easiest way to install them is to issue the following command at the R prompt:
If you plan on using annotation capabilities (such as GOenrichmentAnalysis), we also recommend
installing Bioconductor annotation packages. This can be accomplished by the following R commands:
If you run an older version of R, the above may not install the flashClust package and the
newest version of the dynamicTreeCut
package. Should you encounter this problem, please manually download and install flashClust from this web page, and dynamicTreeCut from this web page.
R package download and installation: Package WGCNA_1.27-1 (last updated 2013/03/07) is available here as source code and several pre-compiled versions for various platforms. In general it is preferable to download the source and compile the package locally; however, if this is not practical, please select an appropriate compiled version.
The package version numbers follow the format packageName_major.minor-revision. Minor versions typically add or change some functionality; revisions typically contain bugfixes or minor enhancements.
Installation instructions:
Short installation instructions, including other required and recommended packages,
are available here.
Should you discover bugs (of which there are most likely plenty), please report them to Peter Langfelder.
Problems installing or using the package
Please see our list of Frequently Asked Questions (and frequently given answers);
the solution to your problem may lie there. In particular, you can find answers about spurious Mac
errors, compatibility problems when upgrading WGCNA, and others.
If you still cannot solve the problem, email Peter
Langfelder.
Getting started with R and Weighted Gene Co-expression Network Analysis
The package described here is an add-on for the statistical language and environment R (free
software).
Our tutorial, described below, contains step by
step instructions such that even complete novice users should be able to get started in R immediately.
Lastly, readers wishing to learn about the theory and published applications of WGCNA are invited to
visit the WGCNA
main page.
WGCNA is in general described in the article
If you use any q-value (FDR) calculations, please also cite at least one of the following articles:
If you use the If you use module preservation calculations, please cite
If you use functions The package is currently maintained by Peter Langfelder.
Old versions of R package WGCNA
Older version of the packages presented on this page are available here.
Citing the WGCNA package
If you use WGCNA in published work, please cite it to properly credit people who have created it.
collapseRows function to summarize/convert probe-level data to gene-level
data, please cite
rgcolors.func, plotCor, plotMat,
stat.bwss, or stat.diag.da, please also cite the article
Acknowledgments
The core of the functions and other code was written by Peter Langfelder and Steve Horvath, partly
based on older code written by Steve Horvath and Bin Zhang. Multiple people contributed additional code,
most prominently Jeremy Miller, Chaochao (Ricky) Cai, Lin Song, Jun Dong, and Andy Yip. The package also
contains code adapted from external packages that were either orphaned (such as package sma) or
their development has made the code difficult to use in WGCNA (such as package qvalue).
A big thanks goes out to people who continue report the many bugs in the package.