Make plots for comparing clustering methods

cmp_make_plot(mat, clt, plot_type = c("mixed", "heatmap"), nrow = 3)

Arguments

mat

A similarity matrix.

clt

A list of clusterings from cmp_make_clusters.

plot_type

What type of plots to make. See Details.

nrow

Number of rows of the layout when plot_type is set to heatmap.

Details

If plot_type is the default value mixed, a figure with three panels generated:

  • A heatmap of the similarity matrix with different classifications as row annotations.

  • A heatmap of the pair-wise concordance of the classifications of every two clustering methods.

  • Barplots of the difference scores for each method (calculated by difference_score), the number of clusters (total clusters and the clusters with size >= 5) and the mean similarity of the terms that are in the same clusters.

If plot_type is heatmap. There are heatmaps for the similarity matrix under clusterings from different methods. The last panel is a table with the number of clusters under different clusterings.

Value

No value is returned.

Examples

# \dontrun{
mat = readRDS(system.file("extdata", "random_GO_BP_sim_mat.rds",
    package = "simplifyEnrichment"))
clt = cmp_make_clusters(mat)
#> Cluster 500 terms by 'binary_cut'...
#>  19 clusters, used 1.084646 secs.
#> Cluster 500 terms by 'kmeans'...
#>  15 clusters, used 3.048331 secs.
#> Cluster 500 terms by 'pam'...
#>  5 clusters, used 19.44946 secs.
#> Cluster 500 terms by 'dynamicTreeCut'...
#>  60 clusters, used 0.140182 secs.
#> Cluster 500 terms by 'apcluster'...
#>  41 clusters, used 0.7691259 secs.
#> Cluster 500 terms by 'hdbscan'...
#>  14 clusters, used 0.1722541 secs.
#> Cluster 500 terms by 'fast_greedy'...
#>  6 clusters, used 0.1023328 secs.
#> Cluster 500 terms by 'louvain'...
#>  6 clusters, used 0.08096695 secs.
#> Cluster 500 terms by 'walktrap'...
#>  6 clusters, used 0.2634952 secs.
#> Cluster 500 terms by 'MCL'...
#>  6 clusters, used 2.234812 secs.
cmp_make_plot(mat, clt)

cmp_make_plot(mat, clt, plot_type = "heatmap")

# }