Title: | Basic Module Functions |
---|---|
Description: | Methods for color labeling, calculation of eigengenes, merging of closely related modules. |
Authors: | Peter Langfelder <[email protected]> and Steve Horvath <[email protected]> |
Maintainer: | Peter Langfelder <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.8-4 |
Built: | 2024-11-24 02:53:06 UTC |
Source: | https://github.com/cran/moduleColor |
Methods for color labeling, calculation of eigengenes, merging of closely related modules.
Package: | moduleColor |
Version: | 1.08-3 |
Date: | 2014-11-25 |
Depends: | R, stats, impute, grDevices, dynamicTreeCut |
ZipData: | no |
License: | GPL version 2 or newer |
URL: | http://www.genetics.ucla.edu/labs/horvath/CoexpressionNetwork/BranchCutting/ |
Index:
checkSets Retrieve basic sizes of a group of datasets. collectGarbage Iterative garbage collection. consensusMEDissimilarity Consensus dissimilarity of module eigengenes. consensusOrderMEs Put close eigenvectors next to each other in several sets. fixDataStructure Put single-set data into a form useful for multiset calculations. labels2colors Convert numerical labels to colors. mergeCloseModules Merge close modules of gene expression data. moduleColor-package Basic module functions. moduleColor.getMEprefix Get the prefix used to label module eigengenes. moduleColor.version Returns the version number of the package. moduleColor.revisionDate Returns the revision date of the package. moduleEigengenes Calculate module eigengenes. moduleNumber Fixed-height cut of a dendrogram. multiSetMEs Calculate module eigengenes. normalizeLabels Transform numerical labels into normal order. orderMEs Put close eigenvectors next to each other plotHclustColors Plot color bars corresponding to modules removeGreyME Remove the grey module eigengene from given eigengenes. standardColors Colors this library uses for labeling modules.
Peter Langfelder <[email protected]> and Steve Horvath <[email protected]>
Maintainer: Peter Langfelder <[email protected]>
Checks whether given sets have the correct format and retrieves dimensions.
checkSets(data, checkStructure = FALSE, useSets = NULL)
checkSets(data, checkStructure = FALSE, useSets = NULL)
data |
A vector of lists; in each list there must be a component named |
checkStructure |
If |
useSets |
Optional specification of entries of the vector |
For multiset calculations, many quantities (such as expression data, traits, module eigengenes etc) are
presented by a common structure, a vector of lists (one list for each set) where each list has a
component data
that contains the actual (expression, trait, eigengene) data for the corresponding
set in the form of a dataframe. This funtion checks whether data
conforms to this convention and
retrieves some basic dimension information (see output).
A list with components
nSets |
Number of sets (length of the vector |
nGenes |
Number of columns in the |
nSamples |
A vector of length |
structureOK |
Only set if the argument |
Peter Langfelder, [email protected]
Performs garbage collection until free memory idicators show no change.
collectGarbage()
collectGarbage()
None.
Steve Horvath
Calculates consensus dissimilarity (1-cor)
of given module eigengenes relaized in several sets.
consensusMEDissimilarity(MEs, useAbs = FALSE, useSets = NULL, method = "consensus")
consensusMEDissimilarity(MEs, useAbs = FALSE, useSets = NULL, method = "consensus")
MEs |
Module eigengenes of the same modules in several sets. |
useAbs |
Controls whether absolute value of correlation should be used instead of correlation in the calculation of dissimilarity. |
useSets |
If the consensus is to include only a selection of the given sets, this vector (or
scalar in the case of a single set) can be used to specify the selection. If |
method |
A character string giving the method to use. Allowed values are (abbreviations of)
|
This function calculates the
individual set dissimilarities of the given eigengenes in each set, then takes the (parallel) maximum or
average over all sets. For details on the structure of imput data, see checkSets
.
A dataframe containing the matrix of dissimilarities, with names
and rownames
set
appropriately.
Peter Langfelder, [email protected]
Reorder given (eigen-)vectors such that similar ones (as measured by correlation) are next to each
other. This is a multi-set version of orderMEs
; the dissimilarity used can be of consensus
type (for each pair of eigenvectors the consensus dissimilarity is the maximum of individual set
dissimilarities over all sets) or of majority type (for each pair of eigenvectors the consensus
dissimilarity is the average of individual set dissimilarities over all sets).
consensusOrderMEs(MEs, useAbs = FALSE, useSets = NULL, greyLast = TRUE, greyName = paste(moduleColor.getMEprefix(), "grey", sep=""), method = "consensus")
consensusOrderMEs(MEs, useAbs = FALSE, useSets = NULL, greyLast = TRUE, greyName = paste(moduleColor.getMEprefix(), "grey", sep=""), method = "consensus")
MEs |
Module eigengenes of several sets in a multi-set format (see |
useAbs |
Controls whether vector similarity should be given by absolute value of correlation or plain correlation. |
useSets |
Allows the user to specify for which sets the eigengene ordering is to be performed. |
greyLast |
Normally the color grey is reserved for unassigned genes; hence the grey module is not
a proper module and it is conventional to put it last. If this is not desired, set the parameter to
|
greyName |
Name of the grey module eigengene. |
method |
A character string giving the method to be used calculating the consensus
dissimilarity. Allowed values are (abbreviations of)
|
Ordering module eigengenes is useful for plotting purposes. This function calculates the consensus
or majority
dissimilarity of given eigengenes over the sets specified by useSets
(defaults to all sets).
A hierarchical dendrogram is calculated using the dissimilarity and the order given by the dendrogram is
used for the eigengenes in all other sets.
A vector of lists of the same type as MEs
containing the re-ordered eigengenes.
Peter Langfelder, [email protected]
moduleEigengenes
, multiSetMEs
, orderMEs
Encapsulates single-set data in a wrapper that makes the data suitable for functions working on multiset data collections.
fixDataStructure(data, verbose = 0, indent = 0)
fixDataStructure(data, verbose = 0, indent = 0)
data |
A dataframe, matrix or array with two dimensions to be encapsulated. |
verbose |
Controls verbosity. 0 is silent. |
indent |
Controls indentation of printed progress messages. 0 means no indentation, every unit adds two spaces. |
For multiset calculations, many quantities (such as expression data, traits, module eigengenes etc) are
presented by a common structure, a vector of lists (one list for each set) where each list has a
component data
that contains the actual (expression, trait, eigengene) data for the corresponding
set in the form of a dataframe. This funtion creates a vector of lists of length 1 and fills the
component data
with the content of parameter data
.
As described above, input data in a format suitable for functions operating on multiset data collections.
Peter Langfelder, [email protected]
singleSetData = matrix(rnorm(100), 10,10); encapsData = fixDataStructure(singleSetData); length(encapsData) names(encapsData[[1]]) dim(encapsData[[1]]$data) all.equal(encapsData[[1]]$data, singleSetData);
singleSetData = matrix(rnorm(100), 10,10); encapsData = fixDataStructure(singleSetData); length(encapsData) names(encapsData[[1]]) dim(encapsData[[1]]$data) all.equal(encapsData[[1]]$data, singleSetData);
Converts a vector or array of numerical labels into a corresponding vector or array of colors corresponding to the labels.
labels2colors(labels, zeroIsGrey = TRUE, colorSeq = NULL)
labels2colors(labels, zeroIsGrey = TRUE, colorSeq = NULL)
labels |
Vector of non-negative integer labels. |
zeroIsGrey |
If TRUE, labels 0 will be assigned color grey. Otherwise, labels below 1 will trigger an error. |
colorSeq |
Color sequence corresponding to labels. If not given, a standard sequence will be used. |
The standard sequence start with well-distinguishable colors, and after about 40 turns into a quasi-random sampling of all colors available in R with the exception of all shades of grey (and gray).
If the input labels
have a dimension attribute, it is copied into the output, meaning the
dimensions of the returned value are the same as those of the input labels
.
A vector or array of character strings of the same length or dimensions as labels
.
Peter Langfelder, [email protected]
labels = c(0:20); labels2colors(labels);
labels = c(0:20); labels2colors(labels);
Merges modules in gene expression networks that are too close as measured by the correlation of their eigengenes.
mergeCloseModules(exprData, colors, cutHeight = 0.2, MEs = NULL, impute = TRUE, useAbs = FALSE, iterate = TRUE, relabel = FALSE, colorSeq = NULL, getNewMEs = TRUE, getNewUnassdME = TRUE, useSets = NULL, checkDataFormat = TRUE, unassdColor = ifelse(is.numeric(colors), 0, "grey"), trapErrors = FALSE, verbose = 1, indent = 0)
mergeCloseModules(exprData, colors, cutHeight = 0.2, MEs = NULL, impute = TRUE, useAbs = FALSE, iterate = TRUE, relabel = FALSE, colorSeq = NULL, getNewMEs = TRUE, getNewUnassdME = TRUE, useSets = NULL, checkDataFormat = TRUE, unassdColor = ifelse(is.numeric(colors), 0, "grey"), trapErrors = FALSE, verbose = 1, indent = 0)
exprData |
Expression data, either a single data frame with rows corresponding to samples and
columns to genes, or in a multi-set format (see |
colors |
A vector (numeric, character or a factor) giving module colors for genes. The method only makes sense when genes have the same color label in all sets, hence a single vector. |
cutHeight |
Maximum dissimilarity (i.e., 1-correlation) that qualifies modules for merging. |
MEs |
If module eigengenes have been calculated before, the user can save some computational time
by inputting them. |
impute |
Should missing values be imputed in eigengene calculation? If imputation is disabled, the
presence of |
useAbs |
Specifies whether absolute value of correlation or plain correlation (of module eigengenes) should be used in calculating module dissimilarity. |
iterate |
Controls whether the merging procedure should be repeated until there is no change. If FALSE, only one iteration will be executed. |
relabel |
Controls whether, after merging, color labels should be ordered by module size. |
colorSeq |
Color labels to be used for relabeling. Defaults to the standard color order used
in this package if |
getNewMEs |
Controls whether module eigengenes of merged modules should be calculated and returned. |
getNewUnassdME |
When doing module eigengene manipulations, the function does not normally
calculate the eigengene of the 'module' of unassigned ('grey') genes. Setting this option to
|
useSets |
A vector of scalar allowing the user to specify which sets will be used to calculate the consensus dissimilarity of module eigengenes. Defaults to all given sets. |
checkDataFormat |
If TRUE, the function will check |
unassdColor |
Specifies the string that labels unassigned genes. Module of this color will not enter the module eigengene clustering and will not be merged with other modules. |
trapErrors |
Controls whether computational errors in calculating module eigengenes, their
dissimilarity, and merging trees should be trapped. If |
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 returns the color labels for modules that are obtained from the input modules by merging
ones that are closely related. The relationships are quantified by correlations of module eigengenes; a
“consensus” measure is defined as the minimum over the corresponding relationship in each set. Once the
(dis-)similarity is calculated, average linkage hierarchical clustering of the module eigengenes is
performed, the dendrogram is cut at the height cutHeight
and modules on each branch are merged.
The process is (optionally) repeated until no more modules are merged.
If, for a particular module, the module eigengene calculation fails, a hubgene approximation will be used.
The user should be aware that if a computational error occurs and trapErrors==TRUE
,
the returned list (see below) will not contain all of the components returned upon normal execution.
If no errors occurred, a list with components
colors |
Color labels for the genes corresponding to merged modules. The function attempts to
mimic the mode of the input |
dendro |
Hierarchical clustering dendrogram (average linkage) of the eigengenes of the most
recently computed tree. If |
oldDendro |
Hierarchical clustering dendrogram (average linkage) of the eigengenes of the original modules. |
cutHeight |
The input cutHeight. |
oldMEs |
Module eigengenes of the original modules in the sets given by |
newMEs |
Module eigengenes of the merged modules in the sets given by |
allOK |
A boolean set to |
If an error occurred and trapErrors==TRUE
, the list only contains these components:
colors |
A copy of the input colors. |
allOK |
a boolean set to |
Peter Langfelder, [email protected]
Returns the currently used prefix used to label module eigengenes. When returning module eigengenes in a dataframe, names of the corresponding columns will start with the given prefix.
moduleColor.getMEprefix()
moduleColor.getMEprefix()
Returns the prefix used to label module eigengenes. When returning module eigengenes in a dataframe, names of the corresponding columns will consist of the corresponfing color label preceded by the given prefix. For example, if the prefix is "PC" and the module is turquoise, the corresponding module eigengene will be labeled "PCturquoise". Most of old code assumes "PC", but "ME" is more instructive and used in some newer analyses.
A character string.
Peter Langfelder, [email protected]
moduleColor.setMEprefix
, moduleEigengenes
Returns the last revision date of the package.
moduleColor.revisionDate()
moduleColor.revisionDate()
A character string.
Peter Langfelder, [email protected]
Sets the prefix used to label module eigengenes. When returning module eigengenes in a dataframe, names of the corresponding columns will start with the given prefix.
moduleColor.setMEprefix(prefix)
moduleColor.setMEprefix(prefix)
prefix |
A character string of length 2. Recommended values are "PC" (the default start-up value) and "ME". |
Sets the prefix used to label module eigengenes. When returning module eigengenes in a dataframe, names of the corresponding columns will consist of the corresponfing color label preceded by the given prefix. For example, if the prefix is "PC" and the module is turquoise, the corresponding module eigengene will be labeled "PCturquoise". Most of old code assumes "PC", but "ME" is more instructive and used in some newer analyses.
None.
Peter Langfelder, [email protected]
moduleColor.getMEprefix
, moduleEigengenes
Returns the version number of the package.
moduleColor.version()
moduleColor.version()
A character string.
Peter Langfelder, [email protected]
Calculates module eigengenes (1st principal component) of modules in a given single dataset.
moduleEigengenes(expr, colors, impute = TRUE, nPC = 1, align = "along average", excludeGrey = FALSE, grey = ifelse(is.numeric(colors), 0, "grey"), subHubs = TRUE, trapErrors = FALSE, returnValidOnly = trapErrors, softPower = 6, verbose = 0, indent = 0)
moduleEigengenes(expr, colors, impute = TRUE, nPC = 1, align = "along average", excludeGrey = FALSE, grey = ifelse(is.numeric(colors), 0, "grey"), subHubs = TRUE, trapErrors = FALSE, returnValidOnly = trapErrors, softPower = 6, verbose = 0, indent = 0)
expr |
Expression data for a single set in the form of a data frame where rows are samples and columns are genes (probes). |
colors |
A vector of the same length as the number of probes in |
impute |
If |
nPC |
Number of principal components and variance explained entries to be calculated. Note
that only the first principal component is returned; the rest are used only for the calculation of
proportion of variance explained. The number of returned variance explained entries is
currently |
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 frame of module eigengenes
contains columns
corresponding only to modules whose eigengenes or hub genes could be calculated correctly
( |
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. |
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.
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 list with the following components:
eigengenes |
Module eigengenes in a dataframe, 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 with entries corresponding to invalid modules set to
|
allOK |
Boolean flag signalling whether all eigengenes have been calculated correctly, either as principal components or as the hubgene average approximation. |
allPC |
Boolean flag signalling whether all returned eigengenes are principal components. |
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 |
Steve Horvath [email protected], Peter Langfelder [email protected]
Zhang, B. and Horvath, S. (2005), "A General Framework for Weighted Gene Co-Expression Network Analysis", Statistical Applications in Genetics and Molecular Biology: Vol. 4: No. 1, Article 17
Detects branches of on the input dendrogram by performing a fixed-height cut.
moduleNumber(dendro, cutHeight = 0.9, minSize = 50)
moduleNumber(dendro, cutHeight = 0.9, minSize = 50)
dendro |
a hierarchical clustering dendorgram such as one returned by |
cutHeight |
Maximum joining heights that will be considered. |
minSize |
Minimum cluster size. |
All contiguous branches below the height cutHeight
that contain at least minSize
objects
are assigned unique positive numerical labels; all unassigned objects are assigned label 0.
A vector of numerical labels giving the assigment of each object.
The numerical labels may not be sequential. See normalizeLabels
for a way to put the
labels into a standard order.
Peter Langfelder, [email protected]
hclust
, cutree
, normalizeLabels
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 = ifelse(is.null(universalColors), ifelse(is.numeric(colors), 0, "grey"), ifelse(is.numeric(universalColors), 0, "grey")), subHubs = TRUE, trapErrors = FALSE, returnValidOnly = trapErrors, softPower = 6, verbose = 1, indent = 0)
multiSetMEs(exprData, colors, universalColors = NULL, useSets = NULL, useGenes = NULL, impute = TRUE, nPC = 1, align = "along average", excludeGrey = FALSE, grey = ifelse(is.null(universalColors), ifelse(is.numeric(colors), 0, "grey"), ifelse(is.numeric(universalColors), 0, "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, [email protected]
Transforms numerical labels into normal order, that is the largest group will be labeled 1, next largest 2 etc. Label 0 is optionally preserved.
normalizeLabels(labels, keepZero = TRUE)
normalizeLabels(labels, keepZero = TRUE)
labels |
Numerical labels. |
keepZero |
If |
A vector of the same length as input, containing the normalized labels.
Peter Langfelder, [email protected]
Reorder given (eigen-)vectors such that similar ones (as measured by correlation) are next to each other.
orderMEs(MEs, greyLast = TRUE, greyName = paste(moduleColor.getMEprefix(), "grey", sep=""), orderBy = 1, order = NULL, useSets = NULL, verbose = 0, indent = 0)
orderMEs(MEs, greyLast = TRUE, greyName = paste(moduleColor.getMEprefix(), "grey", sep=""), orderBy = 1, order = NULL, useSets = NULL, verbose = 0, indent = 0)
MEs |
Module eigengenes in a multi-set format (see |
greyLast |
Normally the color grey is reserved for unassigned genes; hence the grey module is not
a proper module and it is conventional to put it last. If this is not desired, set the parameter to
|
greyName |
Name of the grey module eigengene. |
orderBy |
Specifies the set by which the eigengenes are to be ordered (in all other sets as well).
Defaults to the first set in |
order |
Allows the user to specify a custom ordering. |
useSets |
Allows the user to specify for which sets the eigengene ordering is to be performed. |
verbose |
Controls verbostity of printed progress messages. 0 means silent, nonzero verbose. |
indent |
A single non-negative integer controling indentation of printed messages. 0 means no indentation, each unit above zero adds two spaces. |
Ordering module eigengenes is useful for plotting purposes. For this function the order can be specified explicitly, or a set can be given in which the correlations of the eigengenes will determine the order. For the latter, a hierarchical dendrogram is calculated and the order given by the dendrogram is used for the eigengenes in all other sets.
A vector of lists of the same type as MEs
containing the re-ordered eigengenes.
Peter Langfelder, [email protected]
moduleEigengenes
, multiSetMEs
, consensusOrderMEs
Plot color bars corresponding to modules, usually beneath a dendrogram.
plotHclustColors(dendro, colors, rowLabels = NULL, cex.rowLabels = 0.9, ...)
plotHclustColors(dendro, colors, rowLabels = NULL, cex.rowLabels = 0.9, ...)
dendro |
A dendrogram such as returned by |
colors |
Coloring of objects on the dendrogram. Either a vector (one color per object) or a matrix (can also be an array or a data frame) with each column giving one color per object. Each column will be plotted as a horizontal row of colors under the dendrogram. |
rowLabels |
Labels for the colorings given in |
cex.rowLabels |
Font size scale factor for the row labels. See |
... |
Other parameters to be passed on to the plotting method (such as |
It is often useful to plot module assignment (by color) that was obtained by cutting a hierarchical
dendrogram, to visually check whether the obtained modules are meaningful, or which one of several
possible module assignments looks best. One way to do it to section the screen into two parts, plot the
dendrogram (via plot(hclust)
) in the upper section and use this function to plot colors in the
order corresponding to the dendrogram in the lower section.
None.
Steve Horvath [email protected] and Peter Langfelder [email protected]
cutreeDynamic
for module detection in a dendrogram.
Given module eigengenes either in a single data frame or in a multi-set format, removes the grey eigengenes from each set. If the grey eigengenes are not found, a warning is issued.
removeGreyME(MEs, greyMEName = paste(moduleColor.getMEprefix(), "grey", sep=""))
removeGreyME(MEs, greyMEName = paste(moduleColor.getMEprefix(), "grey", sep=""))
MEs |
Module eigengenes, either in a single data frame (typicaly for a single set), or in a
multi-set format. See |
greyMEName |
Name of the module eigengene (in each corresponding data frame) that corresponds to the grey color. This will typically be "PCgrey" or "MEgrey". If the module eigengenes were calculated using standard functions in this library, the default should work. |
Module eigengenes in the same format as input (either a single data frame or a vector of lists) with the grey eigengene removed.
Peter Langfelder, [email protected]
Returns the vector of color names in the order they are assigned by other functions in this library.
standardColors(n = NULL)
standardColors(n = NULL)
n |
Number of colors requested. If |
A vector of character color names of the requested length.
Peter Langfelder, [email protected]
standardColors(10);
standardColors(10);