Comparing clustering results Function for calculating randindex (adapted from the function by Steve Horvath and Luohua Jiang, UCLA, 2003)

rand_index(tab, adjust = TRUE)

Arguments

tab

a table containing different clustering results in rows

adjust

a logical of whether to use the adjusted rand index

Value

a rand_index value

Author

Quan Nguyen and Michael Thompson, 2018-05-11

Examples

day5 <- day_5_cardio_cell_sample mixedpop2 <-new_summarized_scGPS_object(ExpressionMatrix = day5$dat5_counts, GeneMetadata = day5$dat5geneInfo, CellMetadata = day5$dat5_clusters) cluster_all <-clustering(object=mixedpop2)
#> Performing 1 round of filtering
#> Identifying top variable genes
#> Calculating distance matrix
#> Performing hierarchical clustering
#> Finding clustering information
#> No more outliers detected in filtering round 1
#> Identifying top variable genes
#> Calculating distance matrix
#> Performing hierarchical clustering
#> Finding clustering information
#> Done clustering, moving to stability calculation...
rand_index(table(unlist(cluster_all$list_clusters[[1]]), cluster_all$cluster_ref))
#> [1] 0.9486633