smoothLabels | R Documentation |
k-Nearest neighbor cluster label smoothing.
smoothLabels(
se,
cluster_names = NULL,
coord_names = NULL,
k = 15L,
prop_thres = 0.5,
max_iter = 10,
verbose = TRUE
)
se |
A |
cluster_names |
A string vector of label names to smooth. If NULL, smooths labels in colData(se) matching /^clust/ |
coord_names |
A string vector specifying the names in |
k |
An integer scalar specifying number of neighbors for smooething. |
prop_thres |
A numeric scalar |
max_iter |
An integer scalar specifying the max number of smoothing iterations. Set to -1 for smoothing to convergence. |
verbose |
A logical scalar specifying verbosity. |
As described in SpiceMix (https://doi.org/10.1038/s41588-022-01256-z). Implemented for labels that can be coerced to numeric only.
A SpatialExperiment / SingleCellExperiment / SummarizedExperiment
object with smoothed cluster labels in colData(se)
suffixed with
'_smooth'.
data(rings)
spe <- computeBanksy(rings, assay_name = "counts", M = 1, k_geom = c(15, 30))
spe <- runBanksyPCA(spe, M = 1, lambda = 0.2, npcs = 20)
spe <- clusterBanksy(spe, M = 1, lambda = 0.2, resolution = 1)
spe <- smoothLabels(spe, cluster_names = "clust_M1_lam0.2_k50_res1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.