consensusProjectiveKMeans(
multiExpr,
preferredSize = 5000,
nCenters = NULL,
sizePenaltyPower = 4,
networkType = "unsigned",
randomSeed = 54321,
checkData = TRUE,
useMean = (length(multiExpr) > 3),
maxIterations = 1000,
verbose = 0, indent = 0)
checkSets
). A vector of
lists, one per set. Each set must contain a component data
that contains the expression data, with
rows corresponding to sas.integer(min(nGenes/20, preferredSize^2/nGenes))
and is an attempt to arrive at a reasonable number given the resoupreferredSize
."unsigned"
,
"signed"
, "signed hybrid"
. See adjacency
.NA
.data
that
contains a matrix whose columns are the cluster centers in the corresponding set.data
that contains a matrix whose columns are the cluster centers before merging in the
corresponding set.This function implements a variant of K-means clustering that is suitable for co-expression analysis.
Cluster centers are defined by the first principal component, and distances by correlation. Consensus
distance across several sets is defined as the maximum of the corresponding distances in individual
sets; however, if useMean
is set, the mean distance will be used instead of the maximum.
The distance between a gene and a center of a cluster is multiplied by a factor of
$max(clusterSize/preferredSize, 1)^{sizePenaltyPower}$, thus penalizing clusters whose size exceeds
preferredSize
. The function starts with randomly generated cluster assignment (hence the need to
set the random seed for repeatability) and executes interations of calculating new centers and
reassigning genes to nearest (in the consensus sense) center until the clustering becomes stable.
Before returning, nearby
clusters are iteratively combined if their combined size is below preferredSize
.
Consensus distance defined as maximum of distances in all sets is consistent with the approach taken in
blockwiseConsensusModules
, but the procedure may not converge. Hence it is advisable to use
the mean as consensus in cases where there are multiple data sets (4 or more, say) and/or if the input
data sets are very different.
The standard principal component calculation via the function svd
fails from time to time
(likely a convergence problem of the underlying lapack functions). Such errors are trapped and the
principal component is approximated by a weighted average of expression profiles in the cluster. If
verbose
is set above 2, an informational message is printed whenever this approximation is used.
projectiveKMeans