Calculate consensus kME (eigengene-based connectivities) across multiple data sets, typically following a consensus module analysis.
consensusKME(
multiExpr,
moduleLabels,
multiEigengenes = NULL,
consensusQuantile = 0,
signed = TRUE,
useModules = NULL,
metaAnalysisWeights = NULL,
corAndPvalueFnc = corAndPvalue, corOptions = list(), corComponent = "cor",
getQvalues = FALSE,
useRankPvalue = TRUE,
rankPvalueOptions = list(calculateQvalue = getQvalues, pValueMethod = "scale"),
setNames = NULL,
excludeGrey = TRUE,
greyLabel = if (is.numeric(moduleLabels)) 0 else "grey")
Expression (or other numeric) data in a multi-set format. A vector of lists; in each list there must be a component named `data' whose content is a matrix or dataframe or array of dimension 2.
Module labels: one label for each gene in multiExpr
.
Optional eigengenes of modules specified in moduleLabels
. If not given, will be calculated from
multiExpr
.
logical: should the network be considered signed? In signed networks (TRUE
),
negative kME values are not considered significant and the corresponding p-values will be one-sided. In
unsigned networks (FALSE
), negative kME values are considered significant and the corresponding
p-values will be two-sided.
Optional specification of module labels to which the analysis should be restricted. This could be useful
if there are many modules, most of which are not interesting. Note that the "grey" module cannot be used
with useModules
.
Quantile for the consensus calculation. Should be a number between 0 (minimum) and 1.
Optional specification of meta-analysis weights for each input set. If given, must be a numeric vector
of length equal the number of input data sets (i.e., length(multiExpr)
). These weights will be used
in addition to constant weights and weights proportional to number of samples (observations) in each set.
Function that calculates associations between expression profiles and eigengenes. See details.
List giving additional arguments to function corAndPvalueFnc
. See details.
Name of the component of output of corAndPvalueFnc
that contains the actual correlation.
logical: should q-values (estimates of FDR) be calculated?
Logical: should the rankPvalue
function be used to obtain alternative
meta-analysis statistics?
Additional options for function rankPvalue
. These include
na.last
(default "keep"
), ties.method
(default "average"
),
calculateQvalue
(default copied from input getQvalues
),
and pValueMethod
(default "scale"
).
See the help file for rankPvalue
for full details.
names for the input sets. If not given, will be taken from names(multiExpr)
. If those are
NULL
as well, the names will be "Set_1", "Set_2", ...
.
logical: should the grey module be excluded from the kME tables? Since the grey module is typically not a real module, it makes little sense to report kME values for it.
label that labels the grey module.
Data frame with the following components (for easier readability the order here is not the same as in the actual output):
Gene ID, taken from the column names of the first input data set
Consensus kME (that is, the requested quantile of the kMEs in the
individual data sets)in each module for each gene across the input data
sets. The module labels (here 1, 2, etc.) correspond to those in moduleLabels
.
Average kME in each module for each gene across the input data sets.
Weighted average kME in each module for each gene across the input data sets. The weight of each data set is proportional to the square root of the number of samples in the set.
Weighted average kME in each module for each gene across the input data sets. The weight of each data set is proportional to number of samples in the set.
(Only present if input metaAnalysisWeights
is non-NULL.)
Weighted average kME in each module for each gene across the
input data sets. The weight of each data set is given in metaAnalysisWeights
.
Meta-analysis Z statistic for kME in each module,
obtained by weighing the Z scores in each set equally. Only returned if the function corAndPvalueFnc
returns the Z statistics corresponding to the correlations.
Meta-analysis Z statistic for kME in each module,
obtained by weighing the Z scores in each set by the square root of the number of
samples. Only returned if the function corAndPvalueFnc
returns the Z statistics corresponding to the correlations.
Meta-analysis Z statistic for kME in each module,
obtained by weighing the Z scores in each set by the number of
samples. Only returned if the function corAndPvalueFnc
returns the Z statistics corresponding to the correlations.
Meta-analysis Z statistic for kME in each module,
obtained by weighing the Z scores in each set by metaAnalysisWeights
.
Only returned if metaAnalysisWeights
is non-NULL and the function corAndPvalueFnc
returns the Z statistics corresponding to the correlations.
p-values obtained from the equal-weight meta-analysis Z statistics. Only returned if the function
corAndPvalueFnc
returns the Z statistics corresponding to the correlations.
p-values obtained from the meta-analysis Z statistics with weights proportional to the square root of the
number of samples. Only returned if the function
corAndPvalueFnc
returns the Z statistics corresponding to the correlations.
p-values obtained from the degree-of-freedom weight meta-analysis Z statistics. Only returned if the function
corAndPvalueFnc
returns the Z statistics corresponding to the correlations.
p-values obtained from the user-supplied weight meta-analysis Z statistics. Only returned if
metaAnalysisWeights
is non-NULL and the function
corAndPvalueFnc
returns the Z statistics corresponding to the correlations.
q-values obtained from the equal-weight meta-analysis p-values. Only present if
getQvalues
is TRUE
and the function corAndPvalueFnc
returns the Z statistics corresponding to the kME values.
q-values obtained from the meta-analysis p-values with weights proportional to the square root of the
number of samples. Only present if
getQvalues
is TRUE
and the function corAndPvalueFnc
returns the Z statistics corresponding to the kME values.
q-values obtained from the degree-of-freedom weight meta-analysis p-values. Only present if
getQvalues
is TRUE
and the function corAndPvalueFnc
returns the Z statistics corresponding to the kME values.
q-values obtained from the user-specified weight meta-analysis p-values. Only present if
metaAnalysisWeights
is non-NULL,
getQvalues
is TRUE
and the function corAndPvalueFnc
returns the Z statistics corresponding to the kME values.
The next set of columns contain the results of function rankPvalue and are only present if input useRankPvalue is TRUE. Some columns may be missing depending on the options specified in rankPvalueOptions. We explicitly list columns that are based on weighing each set equally; names of these columns carry the suffix .equalWeights
This is the minimum between pValueLowRank and pValueHighRank, i.e. min(pValueLow, pValueHigh)
Asymptotic p-value for observing a consistently low value across the columns of datS based on the rank method.
Asymptotic p-value for observing a consistently low value across the columns of datS based on the rank method.
This is the minimum between pValueLowScale and pValueHighScale, i.e. min(pValueLow, pValueHigh)
Asymptotic p-value for observing a consistently low value across the columns of datS based on the Scale method.
Asymptotic p-value for observing a consistently low value across the columns of datS based on the Scale method.
local false discovery rate (q-value) corresponding to the p-value pValueExtremeRank
local false discovery rate (q-value) corresponding to the p-value pValueLowRank
local false discovery rate (q-value) corresponding to the p-value pValueHighRank
local false discovery rate (q-value) corresponding to the p-value pValueExtremeScale
local false discovery rate (q-value) corresponding to the p-value pValueLowScale
local false discovery rate (q-value) corresponding to the p-value pValueHighScale
Analogous columns corresponding to weighing individual sets by the square root of the number of
samples, by number of samples, and by user weights (if given). The corresponding column name suffixes are
.RootDoFWeights
, .DoFWeights
, and .userWeights
.
The following set of columns summarize kME in individual input data sets.
kME values for each gene in each module in each given data set.
p-values corresponding to kME values for each gene in each module in each given data set.
q-values corresponding to
kME values for each gene in each module in each given data set. Only returned if getQvalues
is
TRUE
.
Z statistics corresponding to
kME values for each gene in each module in each given data set. Only present if the function
corAndPvalueFnc
returns the Z statistics corresponding to the kME values.
The function corAndPvalueFnc
is currently
is expected to accept arguments x
(gene expression profiles), y
(eigengene expression
profiles), and alternative
with possibilities at least "greater", "two.sided"
.
Any additional arguments can be passed via corOptions
.
The function corAndPvalueFnc
should return a list which at the least contains (1) a matrix
of associations of genes and eigengenes (this component should have the name given by corComponent
),
and (2) a matrix of the corresponding p-values, named "p" or "p.value". Other components are optional but
for full functionality should include
(3) nObs
giving the number of observations for each association (which is the number of samples less
number of missing data - this can in principle vary from association to association), and (4) Z
giving a Z static for each observation. If these are missing, nObs
is calculated in the main
function, and calculations using the Z statistic are skipped.
Langfelder P, Horvath S., WGCNA: an R package for weighted correlation network analysis. BMC Bioinformatics. 2008 Dec 29; 9:559.
signedKME for eigengene based connectivity in a single data set. corAndPvalue, bicorAndPvalue for two alternatives for calculating correlations and the corresponding p-values and Z scores. Both can be used with this function.