This function merges clusters by correlation of the first principal components such that the resulting merged clusters do not exceed a given maximum size.
sizeRestrictedClusterMerge(
datExpr,
clusters,
clusterSizes = NULL,
centers = NULL,
maxSize,
networkType = "unsigned",
verbose = 0,
indent = 0)
A list with two components
A numeric vector with one component per input gene, giving the cluster number in which the gene is assigned.
Cluster centers, that is their first principal components/singular vectors.
Data on which the clustering is based (e.g., expression data). Variables are in columns and observations (samples) in rows.
A vector with element per variable (column) in datExpr
giving the cluster label for the corresponding variable.
Optional pre-calculated cluster sizes. If not given, will be determined from given clusters
.
Optional pre-calculaed cluster centers (first principal components/singular vectors). If not given, will be calculated from given data and cluster assignments.
Maximum allowed size of merged clusters. If any of the given clusters
are larger than maxSize
, they will not
be changed.
One of "unsigned"
and "signed"
. Determines whether clusters with negatively correlated representatives will
be considered similar ("unsigned"
) or dis-similar ("signed"
).
integer level of verbosity. Zero means silent, higher values make the output progressively more and more verbose.
indentation for diagnostic messages. Zero means no indentation, each unit adds two spaces.
Peter Langfelder
The function iteratively merges two closest clusters subject to the constraint that the merged cluster size cannot exceed maxSize. Merging stops when no two clusters can be merged without exceeding the maximum size.
The last step in projectiveKMeans
uses this function.