Skip to contents

Apply various clustering methods

Usage

cmp_make_clusters(
  mat,
  method = setdiff(all_clustering_methods(), "mclust"),
  verbose = TRUE
)

Arguments

mat

The similarity matrix.

method

Which methods to compare. All available methods are in all_clustering_methods. A value of all takes all available methods. By default mclust is excluded because its long runtime.

verbose

Whether to print messages.

Ddetails The function compares following default clustering methods by default:

-kmeans see cluster_by_kmeans. -pam see cluster_by_pam. -dynamicTreeCut see cluster_by_dynamicTreeCut. -mclust see cluster_by_mclust. By default it is not included. -apcluster see cluster_by_apcluster. -hdbscan see cluster_by_hdbscan. -fast_greedy see cluster_by_fast_greedy. -louvain see cluster_by_louvain. -walktrap see cluster_by_walktrap. -MCL see cluster_by_MCL. -binary_cut see binary_cut.

Also the user-defined methods in all_clustering_methods are also compared.

Value

A list of cluster label vectors for different clustering methods.

Examples

# \donttest{
mat = readRDS(system.file("extdata", "random_GO_BP_sim_mat.rds",
    package = "simplifyEnrichment"))
clt = cmp_make_clusters(mat)
#> Cluster 500 terms by 'kmeans'...
#>  16 clusters, used 4.146869 secs.
#> Cluster 500 terms by 'pam'...
#>  5 clusters, used 20.6156 secs.
#> Cluster 500 terms by 'dynamicTreeCut'...
#>  60 clusters, used 0.143589 secs.
#> Cluster 500 terms by 'apcluster'...
#>  41 clusters, used 1.058974 secs.
#> Cluster 500 terms by 'hdbscan'...
#>  14 clusters, used 0.173619 secs.
#> Cluster 500 terms by 'fast_greedy'...
#>  6 clusters, used 0.073627 secs.
#> Cluster 500 terms by 'louvain'...
#>  6 clusters, used 0.0734272 secs.
#> Cluster 500 terms by 'walktrap'...
#>  6 clusters, used 0.7433069 secs.
#> Cluster 500 terms by 'MCL'...
#>  6 clusters, used 1.747188 secs.
#> Cluster 500 terms by 'binary_cut'...
#>  19 clusters, used 4.274761 secs.
# }