Description Usage Arguments Value Examples
View source: R/benchmark.clustering.R
Supervised (ARI and NMI) and unsupervised (ASW, Dunn Index, and Connectivity) benchmarking metrics are calculated for cluster assignments. assays, clustering and reduction for distance calculations are iterated through.
1 2 3 4 5 6 7 8 9 | benchmark.clustering(
object,
assay,
clustering,
reduction,
n.dims = 2,
dist.method = "euclidean",
ground.truth = NULL
)
|
object |
IBRAP S4 class object |
assay |
Character. String containing indicating which assay to use |
clustering |
Character. The names of the cluster assignment dataframes to use |
reduction |
Character. Which reduction(s) within the assay should be supplied for distance calcultions |
n.dims |
Numerical. How many dimensions of the reduction should be supplied. Default = 1:3 |
dist.method |
Character. Which distance method should be used, options: 'euclidean', 'maximum', 'manhattan', 'canberra', 'binary', 'minkowski'. Default = 'euclidean' |
ground.truth |
Vector. If available, supply the vector in the same order as colnames of the ground truth, i.e. true cell type labels. If this is not supplied, only unsupervised methods will be supplied. Default = NULL |
Benchmarking scores for the supplied cluster assignments
1 2 3 4 5 6 7 8 9 10 11 12 13 | # without ground truth labels
object <- benchmark.clustering(object = object, assay = c('SCT', 'SCRAN', 'SCANPY'),
clustering = c("pca_harmony_nn:louvain"),
reduction = c('pca_harmony_umap'),
n.dims = 1:2)
# With ground truth labels
object <- benchmark.clustering(object = object, assay = c('SCT', 'SCRAN', 'SCANPY'),
clustering = c("pca_harmony_nn.v1:louvain"),
reduction = c('pca_harmony_umap'),
n.dims = 1:2, ground.truth = metadata$celltypes)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.