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.

benchmark.clustering(
  object,
  assay,
  clustering,
  reduction,
  n.dims = 2,
  dist.method = "euclidean",
  ground.truth.column = NULL,
  verbose = FALSE,
  seed = 1234
)

Arguments

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.column

Character. If available, supply the column in the object metadata that contains ground truth labels, i.e. true cell type labels. If this is not supplied, only unsupervised methods will be supplied. Default = NULL

verbose

Logical. Should system information be printed. Default = FALSE

seed

Numeric. What should the seed be set as. Default = 1234

Value

Benchmarking scores for the supplied cluster assignments

Examples


# 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)
#> Error in is(object = object, class2 = "IBRAP"): object 'object' not found

# 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)
#> Error in is(object = object, class2 = "IBRAP"): object 'object' not found