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 ofall
takes all available methods. By defaultmclust
is excluded because its long runtime.- verbose
Whether to print messages.
Ddetails The function compares following default clustering methods by default:
-
kmeans
seecluster_by_kmeans
. -pam
seecluster_by_pam
. -dynamicTreeCut
seecluster_by_dynamicTreeCut
. -mclust
seecluster_by_mclust
. By default it is not included. -apcluster
seecluster_by_apcluster
. -hdbscan
seecluster_by_hdbscan
. -fast_greedy
seecluster_by_fast_greedy
. -louvain
seecluster_by_louvain
. -walktrap
seecluster_by_walktrap
. -MCL
seecluster_by_MCL
. -binary_cut
seebinary_cut
.Also the user-defined methods in
all_clustering_methods
are also compared.
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.
# }