Perform k=means clustering on both genes and single cells
DoKMeans(object, genes.use = NULL, k.genes = NULL, k.cells = 0,
k.seed = 1, do.plot = FALSE, data.cut = 2.5, k.cols = pyCols,
set.ident = TRUE, do.constrained = FALSE, assay.type = "RNA", ...)
Seurat object
Genes to use for clustering
K value to use for clustering genes
K value to use for clustering cells (default is NULL, cells are not clustered)
Random seed
Draw heatmap of clustered genes/cells (default is FALSE).
Clip all z-scores to have an absolute value below this. Reduces the effect of huge outliers in the data.
Color palette for heatmap
If clustering cells (so k.cells>0), set the cell identity class to its K-means cluster (default is TRUE)
FALSE by default. If TRUE, use the constrained K-means function implemented in the tclust package.
Type of data to normalize for (default is RNA), but can be changed for multimodal analyses.
Additional parameters passed to kmeans (or tkmeans)
Seurat object where the k-means results for genes is stored in
object@kmeans.obj[[1]], and the k-means results for cells is stored in object@kmeans.col[[1]]. The cluster for each cell is stored in object@meta.data[,"kmeans.ident"] and also object@ident (if set.ident=TRUE)
K-means and heatmap are calculated on object@scale.data