Calculate module eigengenes.
Calculates module eigengenes for several sets.
multiSetMEs(exprData, colors, universalColors = NULL, useSets = NULL, useGenes = NULL, impute = TRUE, nPC = 1, align = "along average", excludeGrey = FALSE, grey = if (is.null(universalColors)) { if (is.numeric(colors)) 0 else "grey" } else if (is.numeric(universalColors)) 0 else "grey", subHubs = TRUE, trapErrors = FALSE, returnValidOnly = trapErrors, softPower = 6, verbose = 1, indent = 0)
exprData |
Expression data in a multi-set format (see |
colors |
A matrix of dimensions (number of probes, number of sets) giving the module assignment of each gene in each set. The color "grey" is interpreted as unassigned. |
universalColors |
Alternative specification of module assignment. A single vector of length
(number of probes) giving the module assignment of each gene in all sets (that is the modules are common
to all sets). If given, takes precedence over |
useSets |
If calculations are requested in (a) selected set(s) only, the set(s) can be specified here. Defaults to all sets. |
useGenes |
Can be used to restrict calculation to a subset of genes (the same subset in all
sets). If given, |
impute |
Logical. If |
nPC |
Number of principal components to be calculated. If only eigengenes are needed, it is best
to set it to 1 (default). If variance explained is needed as well, use value |
align |
Controls whether eigengenes, whose orientation is undetermined, should be aligned with
average expression ( |
excludeGrey |
Should the improper module consisting of 'grey' genes be excluded from the eigengenes? |
grey |
Value of |
subHubs |
Controls whether hub genes should be substituted for missing eigengenes. If
|
trapErrors |
Controls handling of errors from that may arise when there are too many
|
returnValidOnly |
Boolean. Controls whether the returned data frames of module eigengenes
contain columns
corresponding only to modules whose eigengenes or hub genes could be calculated correctly in every
set ( |
softPower |
The power used in soft-thresholding the adjacency matrix. Only used when the hubgene approximation is necessary because the principal component calculation failed. It must be non-negative. The default value should only be changed if there is a clear indication that it leads to incorrect results. |
verbose |
Controls verbosity of printed progress messages. 0 means silent, up to (about) 5 the verbosity gradually increases. |
indent |
A single non-negative integer controlling indentation of printed messages. 0 means no indentation, each unit above that adds two spaces. |
This function calls moduleEigengenes
for each set in exprData
.
Module eigengene is defined as the first principal component of the expression matrix of the
corresponding module. The calculation may fail if the expression data has too many missing entries.
Handling of such errors is controlled by the arguments subHubs
and
trapErrors
.
If subHubs==TRUE
, errors in principal component calculation will be trapped and a substitute
calculation of hubgenes will be attempted. If this fails as well, behaviour depends on
trapErrors
: if TRUE
, the offending
module will be ignored and the return value will allow the user to remove the module from further
analysis; if FALSE
, the function will stop.
If universalColors
is given, any offending
module will be removed from all sets (see validMEs
in return value below).
From the user's point of view, setting trapErrors=FALSE
ensures that if the function returns
normally, there will be a valid eigengene (principal component or hubgene) for each of the input
colors. If the user sets trapErrors=TRUE
, all calculational (but not input) errors will be
trapped, but the user should check the output (see below) to make sure all modules have a valid
returned eigengene.
While the principal component calculation can fail even on relatively sound data
(it does not take all that many "well-placed" NA
to torpedo the
calculation),
it takes many more irregularities in the data for the hubgene calculation to
fail. In fact such a failure signals there likely is something seriously wrong with the data.
A vector of lists similar in spirit to the input exprData
. For each set there is a list with the
following components:
data |
Module eigengenes in a data frame, with each column corresponding to one eigengene.
The columns are named by the corresponding color with an |
averageExpr |
If |
varExplained |
A dataframe in which each column corresponds to a module, with the component
|
nPC |
A copy of the input |
validMEs |
A boolean vector. Each component (corresponding to the columns in |
validColors |
A copy of the input colors ( |
allOK |
Boolean flag signalling whether all eigengenes have been calculated correctly, either
as principal components or as the hubgene approximation. If |
allPC |
Boolean flag signalling whether all returned eigengenes are principal components. This flag (as well as the subsequent ones) is set independently for each set. |
isPC |
Boolean vector. Each component (corresponding to the columns in |
isHub |
Boolean vector. Each component (corresponding to the columns in |
validAEs |
Boolean vector. Each component (corresponding to the columns in |
allAEOK |
Boolean flag signalling whether all returned module average expressions contain
valid data. Note that |
Peter Langfelder, Peter.Langfelder@gmail.com
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.