fetchWGCNAModule - Compute a network module correlated to a phenotypic feature
Description
identify correlation between the input omics data e.g. normalized gene expression data, and phenotypic data e.g. weight. The function wraps around important aspects of WGCNA including blockwiseModules, cor, corPvalueStudent, labeledHeatmap. These aspects automatically perform correlation network construction, module detection, and display module-phenotype correlations. A module or the combination of modules can be selected from the heatmap of module-phenotype correlations for including in the network output, see more details below.
Usage
fetchWGCNAModule(datNorm, datPheno, sfPower, minModuleSize, threshold, returnAs)
Arguments
datNorm | data frame containing normalized, quantified omics data e.g. expression data, metabolite intensities. Columns correspond to entities e.g. genes, metabolites, and rows to samples e.g. normals, tumors. Require 'nodetype' at the first row to indicate the type of entities in each column. |
datPheno | data frame containing phenotypic data e.g. weight, age, insulin sensitivity. Columns correspond to phenotypes and rows to samples e.g. normals, tumors. |
sfPower | numerical value of soft-thresholding power for correlation network construction. It is automatically estimated using pickSoftThreshold, or it can be defined by users. |
minModuleSize | numerical value of minimum module size for module detection. |
threshold | numerical value to define the minimum value of similarity threshold, from 0 to 1, to include edges in the output. |
returnAs | string of output type. Specify the type of the returned network. It can be one of "tab","json","cytoscape", default is "tab". "cytoscape" is the format used in Cytoscape.js |
Value
list of nodes and edges. The list is with the following componens: edges and nodes. Return empty list if found nothing
Details
The function encapsulates several methods from WGCNA so that module-phenoty correlation analysis can be fasten. These methods include:
- pickSoftThreshold estimates soft-thresholding powers from scale free topology to build the correlation network.
- blockwiseModules automatically calculates a correlation network and detects modules. Modules are the areas of the network where nodes are densely connected based on their topological overlap measure, see WGCNA for more details. Each module is labeled by color. By using the color, a module or the combination of modules can be selected ("enter color to the terminal"), for including in the network output.
- Module-phenotype correlations and significances are calculated using WGCNA functions cor and corPvalueStudent. The correlation coefficients are continuous values between -1 (negative correlation) and 1 (positive correlation), with numbers close to 1 or -1, meaning very closely correlated.
- labeledHeatmap plots a heatmap of module-phenotype correlations. A row is a module and a column is a phynotype. Each cell presents the corresponding correlation and the pvalue inside parenthesis. Each cell is colored by correlation, red means positive and blue means negative correlation.
- exportNetworkToCytoscape exports a network for using in Cytoscape (http://cytoscape.org/). The selected module is exported as the network output in which an edge will be included if it similarity threshold above the cutoff, see threshold.
Examples
# Compute a correlation of metabolite module to phenotypic data
library(grinn)
data(dummy)
data(dummyPheno)
result <- fetchWGCNAModule(datNorm=dummy, datPheno=dummyPheno, minModuleSize=5, threshold=0.2)
# enter module color(s) seperate by space:yellow brown purple
library(igraph)
plot(graph.data.frame(result$edges[,1:2], directed=FALSE))
References
Correlation-based analyses apply methods from the following publications:
- Dudoit S, et al. Statistical methods for identifying differentially expressed genes in replicated cDNA microarray experiments, STATISTICA SINICA 2002;12:111.
- Langfelder P, et al. WGCNA: an R package for weighted correlation network analysis. BMC Bioinformatics 2008;9:559.
- Langfelder P, et al. Tutorials for the WGCNA package, click here
Go to HOME | Documentation | fetchGrinnNetwork | fetchCorrGrinnNetwork | fetchDiffCorrGrinnNetwork | fetchModuGrinnNetwork | fetchGrinnCorrNetwork | input formats