Description Usage Arguments Value
View source: R/cluster_functions.R
Clusters spatial omics data with spatial regularization
1 2 3 4 5 6 7 8 | k.means.spatial(
X,
cell.dists,
nclust = 3,
lambda = 0.1,
metric = matrixStats::colMins,
max.iter = 100
)
|
X |
An n x p matrix with n cells and p features |
cell.dists |
An n x n matrix with pairwise distances between all cells |
nclust |
A scalar indicating the number of clusters |
lambda |
The weight that spatial penalty takes |
metric |
A column-wise quantile function to determine distance to cluster (eg. colMins, colMedians, colMaxs from matrixStats) |
max.iter |
Maximum number of iterations before stopping clustering |
a list containing mus (the centroid of each cluster), est (cluster membership for each cell), num_it (number of iterations taken to converge)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.