cola Report for GDS1627

Date: 2019-12-25 20:17:11 CET, cola version: 1.3.2

Document is loading...


Summary

All available functions which can be applied to this res_list object:

res_list
#> A 'ConsensusPartitionList' object with 24 methods.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows are extracted by 'SD, CV, MAD, ATC' methods.
#>   Subgroups are detected by 'hclust, kmeans, skmeans, pam, mclust, NMF' method.
#>   Number of partitions are tried for k = 2, 3, 4, 5, 6.
#>   Performed in total 30000 partitions by row resampling.
#> 
#> Following methods can be applied to this 'ConsensusPartitionList' object:
#>  [1] "cola_report"           "collect_classes"       "collect_plots"         "collect_stats"        
#>  [5] "colnames"              "functional_enrichment" "get_anno_col"          "get_anno"             
#>  [9] "get_classes"           "get_matrix"            "get_membership"        "get_stats"            
#> [13] "is_best_k"             "is_stable_k"           "ncol"                  "nrow"                 
#> [17] "rownames"              "show"                  "suggest_best_k"        "test_to_known_factors"
#> [21] "top_rows_heatmap"      "top_rows_overlap"     
#> 
#> You can get result for a single method by, e.g. object["SD", "hclust"] or object["SD:hclust"]
#> or a subset of methods by object[c("SD", "CV")], c("hclust", "kmeans")]

The call of run_all_consensus_partition_methods() was:

#> run_all_consensus_partition_methods(data = mat, mc.cores = 4, anno = anno)

Dimension of the input matrix:

mat = get_matrix(res_list)
dim(mat)
#> [1] 14502    83

Density distribution

The density distribution for each sample is visualized as in one column in the following heatmap. The clustering is based on the distance which is the Kolmogorov-Smirnov statistic between two distributions.

library(ComplexHeatmap)
densityHeatmap(mat, top_annotation = HeatmapAnnotation(df = get_anno(res_list), 
    col = get_anno_col(res_list)), ylab = "value", cluster_columns = TRUE, show_column_names = FALSE,
    mc.cores = 4)

plot of chunk density-heatmap

Suggest the best k

Folowing table shows the best k (number of partitions) for each combination of top-value methods and partition methods. Clicking on the method name in the table goes to the section for a single combination of methods.

The cola vignette explains the definition of the metrics used for determining the best number of partitions.

suggest_best_k(res_list)
The best k 1-PAC Mean silhouette Concordance
SD:pam 2 1.000 0.989 0.995 **
MAD:pam 2 1.000 0.920 0.950 **
ATC:kmeans 2 1.000 0.966 0.987 **
ATC:pam 2 0.949 0.935 0.974 *
ATC:skmeans 2 0.878 0.899 0.959
CV:kmeans 2 0.745 0.882 0.935
CV:skmeans 2 0.741 0.853 0.942
ATC:NMF 2 0.684 0.856 0.935
MAD:NMF 2 0.633 0.800 0.917
SD:NMF 5 0.633 0.613 0.799
CV:pam 5 0.615 0.657 0.803
SD:skmeans 2 0.613 0.814 0.927
CV:mclust 4 0.595 0.720 0.844
MAD:skmeans 2 0.586 0.781 0.914
SD:kmeans 2 0.565 0.787 0.903
MAD:kmeans 2 0.546 0.589 0.829
CV:NMF 2 0.510 0.825 0.902
ATC:mclust 4 0.505 0.760 0.820
SD:mclust 5 0.504 0.519 0.729
ATC:hclust 2 0.461 0.788 0.896
CV:hclust 3 0.396 0.686 0.820
MAD:mclust 3 0.379 0.715 0.770
SD:hclust 2 0.276 0.735 0.852
MAD:hclust 2 0.250 0.768 0.854

**: 1-PAC > 0.95, *: 1-PAC > 0.9

CDF of consensus matrices

Cumulative distribution function curves of consensus matrix for all methods.

collect_plots(res_list, fun = plot_ecdf)

plot of chunk collect-plots

Consensus heatmap

Consensus heatmaps for all methods. (What is a consensus heatmap?)

collect_plots(res_list, k = 2, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-1

collect_plots(res_list, k = 3, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-2

collect_plots(res_list, k = 4, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-3

collect_plots(res_list, k = 5, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-4

collect_plots(res_list, k = 6, fun = consensus_heatmap, mc.cores = 4)

plot of chunk tab-collect-consensus-heatmap-5

Membership heatmap

Membership heatmaps for all methods. (What is a membership heatmap?)

collect_plots(res_list, k = 2, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-1

collect_plots(res_list, k = 3, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-2

collect_plots(res_list, k = 4, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-3

collect_plots(res_list, k = 5, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-4

collect_plots(res_list, k = 6, fun = membership_heatmap, mc.cores = 4)

plot of chunk tab-collect-membership-heatmap-5

Signature heatmap

Signature heatmaps for all methods. (What is a signature heatmap?)

Note in following heatmaps, rows are scaled.

collect_plots(res_list, k = 2, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-1

collect_plots(res_list, k = 3, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-2

collect_plots(res_list, k = 4, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-3

collect_plots(res_list, k = 5, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-4

collect_plots(res_list, k = 6, fun = get_signatures, mc.cores = 4)

plot of chunk tab-collect-get-signatures-5

Statistics table

The statistics used for measuring the stability of consensus partitioning. (How are they defined?)

get_stats(res_list, k = 2)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      2 0.657           0.826       0.927          0.409 0.574   0.574
#> CV:NMF      2 0.510           0.825       0.902          0.467 0.533   0.533
#> MAD:NMF     2 0.633           0.800       0.917          0.455 0.540   0.540
#> ATC:NMF     2 0.684           0.856       0.935          0.492 0.500   0.500
#> SD:skmeans  2 0.613           0.814       0.927          0.498 0.496   0.496
#> CV:skmeans  2 0.741           0.853       0.942          0.501 0.500   0.500
#> MAD:skmeans 2 0.586           0.781       0.914          0.504 0.494   0.494
#> ATC:skmeans 2 0.878           0.899       0.959          0.499 0.500   0.500
#> SD:mclust   2 0.300           0.529       0.795          0.413 0.520   0.520
#> CV:mclust   2 0.372           0.833       0.895          0.351 0.685   0.685
#> MAD:mclust  2 0.449           0.831       0.898          0.369 0.700   0.700
#> ATC:mclust  2 0.225           0.469       0.781          0.311 0.750   0.750
#> SD:kmeans   2 0.565           0.787       0.903          0.452 0.533   0.533
#> CV:kmeans   2 0.745           0.882       0.935          0.469 0.533   0.533
#> MAD:kmeans  2 0.546           0.589       0.829          0.473 0.617   0.617
#> ATC:kmeans  2 1.000           0.966       0.987          0.455 0.540   0.540
#> SD:pam      2 1.000           0.989       0.995          0.240 0.767   0.767
#> CV:pam      2 0.438           0.784       0.878          0.345 0.670   0.670
#> MAD:pam     2 1.000           0.920       0.950          0.313 0.700   0.700
#> ATC:pam     2 0.949           0.935       0.974          0.405 0.606   0.606
#> SD:hclust   2 0.276           0.735       0.852          0.387 0.630   0.630
#> CV:hclust   2 0.472           0.793       0.907          0.301 0.785   0.785
#> MAD:hclust  2 0.250           0.768       0.854          0.423 0.584   0.584
#> ATC:hclust  2 0.461           0.788       0.896          0.414 0.584   0.584
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.319           0.450       0.715          0.500 0.654   0.460
#> CV:NMF      3 0.486           0.656       0.814          0.371 0.745   0.557
#> MAD:NMF     3 0.435           0.718       0.808          0.425 0.677   0.461
#> ATC:NMF     3 0.612           0.782       0.889          0.352 0.694   0.462
#> SD:skmeans  3 0.603           0.795       0.863          0.334 0.702   0.476
#> CV:skmeans  3 0.562           0.779       0.853          0.330 0.719   0.492
#> MAD:skmeans 3 0.499           0.539       0.781          0.326 0.772   0.569
#> ATC:skmeans 3 0.695           0.785       0.890          0.294 0.778   0.591
#> SD:mclust   3 0.356           0.401       0.699          0.556 0.686   0.470
#> CV:mclust   3 0.223           0.659       0.730          0.598 0.727   0.614
#> MAD:mclust  3 0.379           0.715       0.770          0.664 0.431   0.300
#> ATC:mclust  3 0.177           0.444       0.675          0.660 0.494   0.369
#> SD:kmeans   3 0.438           0.773       0.842          0.343 0.703   0.512
#> CV:kmeans   3 0.367           0.449       0.659          0.314 0.808   0.661
#> MAD:kmeans  3 0.311           0.527       0.693          0.336 0.673   0.498
#> ATC:kmeans  3 0.487           0.542       0.717          0.390 0.724   0.520
#> SD:pam      3 0.496           0.744       0.865          0.891 0.802   0.745
#> CV:pam      3 0.246           0.470       0.747          0.689 0.718   0.591
#> MAD:pam     3 0.241           0.429       0.727          0.732 0.761   0.670
#> ATC:pam     3 0.598           0.727       0.851          0.477 0.797   0.670
#> SD:hclust   3 0.281           0.585       0.740          0.309 0.950   0.921
#> CV:hclust   3 0.396           0.686       0.820          0.537 0.815   0.764
#> MAD:hclust  3 0.260           0.684       0.771          0.236 0.960   0.932
#> ATC:hclust  3 0.321           0.417       0.718          0.396 0.918   0.865
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.451           0.603       0.760         0.1602 0.653   0.297
#> CV:NMF      4 0.459           0.648       0.779         0.1609 0.771   0.457
#> MAD:NMF     4 0.500           0.642       0.809         0.1282 0.797   0.486
#> ATC:NMF     4 0.720           0.747       0.872         0.1275 0.797   0.481
#> SD:skmeans  4 0.577           0.459       0.709         0.1164 0.760   0.435
#> CV:skmeans  4 0.609           0.706       0.833         0.1243 0.893   0.688
#> MAD:skmeans 4 0.594           0.727       0.813         0.1258 0.849   0.589
#> ATC:skmeans 4 0.864           0.839       0.930         0.1386 0.828   0.570
#> SD:mclust   4 0.482           0.536       0.724         0.0594 0.804   0.554
#> CV:mclust   4 0.595           0.720       0.844         0.2947 0.758   0.493
#> MAD:mclust  4 0.451           0.638       0.771         0.1391 0.892   0.707
#> ATC:mclust  4 0.505           0.760       0.820         0.3174 0.753   0.427
#> SD:kmeans   4 0.561           0.744       0.805         0.1396 0.914   0.787
#> CV:kmeans   4 0.439           0.575       0.724         0.1594 0.777   0.496
#> MAD:kmeans  4 0.420           0.453       0.664         0.1386 0.852   0.626
#> ATC:kmeans  4 0.692           0.777       0.871         0.1676 0.756   0.418
#> SD:pam      4 0.502           0.715       0.826         0.3205 0.862   0.767
#> CV:pam      4 0.374           0.567       0.731         0.1690 0.804   0.591
#> MAD:pam     4 0.546           0.526       0.739         0.2161 0.828   0.678
#> ATC:pam     4 0.893           0.884       0.931         0.1685 0.784   0.538
#> SD:hclust   4 0.325           0.637       0.789         0.2168 0.749   0.594
#> CV:hclust   4 0.279           0.594       0.752         0.2230 0.931   0.884
#> MAD:hclust  4 0.299           0.648       0.730         0.2353 0.781   0.616
#> ATC:hclust  4 0.493           0.573       0.720         0.2350 0.619   0.362
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.633           0.613       0.799         0.0700 0.854   0.550
#> CV:NMF      5 0.636           0.675       0.793         0.0693 0.885   0.597
#> MAD:NMF     5 0.629           0.629       0.825         0.0665 0.827   0.453
#> ATC:NMF     5 0.584           0.587       0.756         0.0560 0.896   0.633
#> SD:skmeans  5 0.641           0.585       0.750         0.0715 0.896   0.639
#> CV:skmeans  5 0.655           0.647       0.773         0.0671 0.927   0.730
#> MAD:skmeans 5 0.646           0.547       0.694         0.0615 0.892   0.609
#> ATC:skmeans 5 0.778           0.683       0.853         0.0721 0.908   0.679
#> SD:mclust   5 0.504           0.519       0.729         0.0694 0.890   0.696
#> CV:mclust   5 0.618           0.674       0.798         0.0695 0.862   0.541
#> MAD:mclust  5 0.501           0.578       0.742         0.0832 0.874   0.595
#> ATC:mclust  5 0.561           0.691       0.798         0.0944 0.860   0.540
#> SD:kmeans   5 0.570           0.561       0.736         0.0828 0.940   0.826
#> CV:kmeans   5 0.551           0.524       0.685         0.0774 0.946   0.797
#> MAD:kmeans  5 0.509           0.459       0.616         0.0732 0.833   0.487
#> ATC:kmeans  5 0.677           0.643       0.795         0.0730 0.859   0.528
#> SD:pam      5 0.559           0.761       0.836         0.0908 0.935   0.860
#> CV:pam      5 0.615           0.657       0.803         0.1206 0.791   0.458
#> MAD:pam     5 0.594           0.352       0.660         0.1251 0.793   0.517
#> ATC:pam     5 0.823           0.834       0.904         0.1234 0.904   0.679
#> SD:hclust   5 0.461           0.611       0.762         0.1112 0.941   0.855
#> CV:hclust   5 0.324           0.435       0.675         0.1851 0.748   0.564
#> MAD:hclust  5 0.449           0.615       0.734         0.0833 0.957   0.888
#> ATC:hclust  5 0.635           0.592       0.754         0.0848 0.944   0.800
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.578           0.486       0.688         0.0543 0.894   0.611
#> CV:NMF      6 0.602           0.478       0.700         0.0386 0.974   0.878
#> MAD:NMF     6 0.576           0.474       0.690         0.0514 0.916   0.635
#> ATC:NMF     6 0.612           0.495       0.697         0.0391 0.931   0.707
#> SD:skmeans  6 0.704           0.705       0.803         0.0441 0.924   0.661
#> CV:skmeans  6 0.667           0.535       0.741         0.0403 0.931   0.708
#> MAD:skmeans 6 0.705           0.639       0.794         0.0423 0.902   0.578
#> ATC:skmeans 6 0.773           0.629       0.816         0.0429 0.938   0.729
#> SD:mclust   6 0.486           0.331       0.637         0.0651 0.922   0.742
#> CV:mclust   6 0.676           0.616       0.752         0.0499 0.951   0.774
#> MAD:mclust  6 0.585           0.659       0.772         0.0469 0.957   0.814
#> ATC:mclust  6 0.781           0.786       0.861         0.1094 0.890   0.541
#> SD:kmeans   6 0.619           0.458       0.688         0.0534 0.963   0.878
#> CV:kmeans   6 0.577           0.611       0.720         0.0484 0.904   0.630
#> MAD:kmeans  6 0.631           0.576       0.695         0.0509 0.894   0.564
#> ATC:kmeans  6 0.722           0.673       0.783         0.0406 0.945   0.742
#> SD:pam      6 0.601           0.659       0.816         0.1046 0.847   0.634
#> CV:pam      6 0.672           0.564       0.773         0.0593 0.864   0.503
#> MAD:pam     6 0.702           0.529       0.791         0.0962 0.755   0.282
#> ATC:pam     6 0.766           0.736       0.850         0.0339 0.964   0.831
#> SD:hclust   6 0.575           0.598       0.783         0.0468 0.953   0.871
#> CV:hclust   6 0.411           0.429       0.703         0.0982 0.863   0.649
#> MAD:hclust  6 0.614           0.598       0.737         0.1061 0.855   0.593
#> ATC:hclust  6 0.669           0.640       0.740         0.0461 0.875   0.525

Following heatmap plots the partition for each combination of methods and the lightness correspond to the silhouette scores for samples in each method. On top the consensus subgroup is inferred from all methods by taking the mean silhouette scores as weight.

collect_stats(res_list, k = 2)

plot of chunk tab-collect-stats-from-consensus-partition-list-1

collect_stats(res_list, k = 3)

plot of chunk tab-collect-stats-from-consensus-partition-list-2

collect_stats(res_list, k = 4)

plot of chunk tab-collect-stats-from-consensus-partition-list-3

collect_stats(res_list, k = 5)

plot of chunk tab-collect-stats-from-consensus-partition-list-4

collect_stats(res_list, k = 6)

plot of chunk tab-collect-stats-from-consensus-partition-list-5

Partition from all methods

Collect partitions from all methods:

collect_classes(res_list, k = 2)

plot of chunk tab-collect-classes-from-consensus-partition-list-1

collect_classes(res_list, k = 3)

plot of chunk tab-collect-classes-from-consensus-partition-list-2

collect_classes(res_list, k = 4)

plot of chunk tab-collect-classes-from-consensus-partition-list-3

collect_classes(res_list, k = 5)

plot of chunk tab-collect-classes-from-consensus-partition-list-4

collect_classes(res_list, k = 6)

plot of chunk tab-collect-classes-from-consensus-partition-list-5

Top rows overlap

Overlap of top rows from different top-row methods:

top_rows_overlap(res_list, top_n = 1000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-1

top_rows_overlap(res_list, top_n = 2000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-2

top_rows_overlap(res_list, top_n = 3000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-3

top_rows_overlap(res_list, top_n = 4000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-4

top_rows_overlap(res_list, top_n = 5000, method = "euler")

plot of chunk tab-top-rows-overlap-by-euler-5

Also visualize the correspondance of rankings between different top-row methods:

top_rows_overlap(res_list, top_n = 1000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-1

top_rows_overlap(res_list, top_n = 2000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-2

top_rows_overlap(res_list, top_n = 3000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-3

top_rows_overlap(res_list, top_n = 4000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-4

top_rows_overlap(res_list, top_n = 5000, method = "correspondance")

plot of chunk tab-top-rows-overlap-by-correspondance-5

Heatmaps of the top rows:

top_rows_heatmap(res_list, top_n = 1000)

plot of chunk tab-top-rows-heatmap-1

top_rows_heatmap(res_list, top_n = 2000)

plot of chunk tab-top-rows-heatmap-2

top_rows_heatmap(res_list, top_n = 3000)

plot of chunk tab-top-rows-heatmap-3

top_rows_heatmap(res_list, top_n = 4000)

plot of chunk tab-top-rows-heatmap-4

top_rows_heatmap(res_list, top_n = 5000)

plot of chunk tab-top-rows-heatmap-5

Test to known annotations

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res_list, k = 2)
#>              n cell.line(p) agent(p)  time(p) k
#> SD:NMF      75     1.43e-07   0.5848 2.94e-01 2
#> CV:NMF      79     5.42e-07   0.4410 4.91e-03 2
#> MAD:NMF     75     8.35e-07   0.5693 2.12e-01 2
#> ATC:NMF     78     5.09e-02   0.0193 1.01e-03 2
#> SD:skmeans  73     9.95e-05   0.9519 2.16e-01 2
#> CV:skmeans  76     1.87e-08   0.1268 2.28e-02 2
#> MAD:skmeans 73     3.58e-07   0.7595 2.14e-01 2
#> ATC:skmeans 79     8.50e-01   0.0961 6.51e-06 2
#> SD:mclust   68     1.22e-03   0.7435 3.61e-03 2
#> CV:mclust   79     2.38e-02   0.5530 1.23e-04 2
#> MAD:mclust  80     1.96e-02   0.6273 1.32e-01 2
#> ATC:mclust  59     3.57e-03   0.4602 2.17e-03 2
#> SD:kmeans   75     9.77e-06   0.8819 6.70e-01 2
#> CV:kmeans   79     3.23e-09   0.3117 2.67e-02 2
#> MAD:kmeans  62     1.62e-04   0.7144 1.35e-01 2
#> ATC:kmeans  81     2.30e-01   0.1749 1.71e-05 2
#> SD:pam      83     4.87e-05   0.1842 6.54e-02 2
#> CV:pam      78     5.04e-03   0.0732 3.28e-04 2
#> MAD:pam     81     5.50e-06   0.2261 3.71e-01 2
#> ATC:pam     81     8.09e-02   0.3273 9.83e-05 2
#> SD:hclust   74     1.78e-04   0.8439 6.00e-01 2
#> CV:hclust   73     3.52e-02   0.3951 4.87e-05 2
#> MAD:hclust  78     3.29e-03   0.5201 4.81e-01 2
#> ATC:hclust  75     4.01e-01   0.1773 1.28e-04 2
test_to_known_factors(res_list, k = 3)
#>              n cell.line(p) agent(p)  time(p) k
#> SD:NMF      42     2.18e-03   0.3622 5.47e-05 3
#> CV:NMF      74     1.38e-06   0.0537 1.40e-03 3
#> MAD:NMF     74     1.64e-06   0.5705 7.03e-05 3
#> ATC:NMF     78     1.54e-05   0.3815 6.81e-05 3
#> SD:skmeans  80     8.71e-09   0.6281 7.02e-03 3
#> CV:skmeans  79     1.02e-12   0.7205 1.48e-05 3
#> MAD:skmeans 59     5.49e-12   0.1047 8.30e-01 3
#> ATC:skmeans 76     8.39e-12   0.4412 1.72e-02 3
#> SD:mclust   30     1.76e-02   0.5699 4.54e-05 3
#> CV:mclust   77     1.17e-10   0.7113 3.66e-04 3
#> MAD:mclust  77     1.10e-12   0.2077 1.57e-01 3
#> ATC:mclust  44     1.62e-01   0.7149 1.81e-03 3
#> SD:kmeans   77     1.61e-06   0.8077 3.80e-05 3
#> CV:kmeans   47     4.94e-09   0.3493 2.44e-01 3
#> MAD:kmeans  49     1.34e-07   0.0836 1.40e-01 3
#> ATC:kmeans  62     1.60e-02   0.4697 6.34e-04 3
#> SD:pam      78     6.32e-06   0.2401 3.26e-03 3
#> CV:pam      52     6.93e-06   0.2531 9.80e-04 3
#> MAD:pam     39     2.04e-01   0.6123 5.89e-01 3
#> ATC:pam     77     4.48e-08   0.4366 1.55e-03 3
#> SD:hclust   66     3.35e-04   0.6164 6.12e-04 3
#> CV:hclust   69     1.34e-06   0.1669 6.89e-06 3
#> MAD:hclust  76     2.14e-03   0.4906 1.14e-03 3
#> ATC:hclust  45     2.35e-03   0.4795 1.18e-03 3
test_to_known_factors(res_list, k = 4)
#>              n cell.line(p) agent(p)  time(p) k
#> SD:NMF      65     2.45e-06   0.1399 8.40e-05 4
#> CV:NMF      72     1.02e-11   0.6430 2.74e-06 4
#> MAD:NMF     69     6.52e-06   0.1498 3.06e-06 4
#> ATC:NMF     73     3.72e-08   0.0777 6.42e-07 4
#> SD:skmeans  40     4.26e-04   0.8155 3.19e-01 4
#> CV:skmeans  72     2.95e-12   0.7097 1.46e-07 4
#> MAD:skmeans 75     1.19e-16   0.8352 1.88e-01 4
#> ATC:skmeans 77     6.75e-10   0.3696 2.35e-04 4
#> SD:mclust   55     1.08e-05   0.5444 5.51e-04 4
#> CV:mclust   74     2.95e-13   0.7887 1.34e-05 4
#> MAD:mclust  72     5.63e-14   0.3209 2.90e-02 4
#> ATC:mclust  77     1.70e-09   0.7146 6.18e-05 4
#> SD:kmeans   78     1.87e-06   0.6641 9.13e-08 4
#> CV:kmeans   59     6.11e-10   0.5325 4.36e-06 4
#> MAD:kmeans  38     2.73e-02   0.5487 2.47e-02 4
#> ATC:kmeans  72     3.53e-09   0.6980 6.52e-04 4
#> SD:pam      77     3.58e-07   0.8269 1.05e-04 4
#> CV:pam      60     2.52e-09   0.4305 6.67e-06 4
#> MAD:pam     60     7.67e-07   0.8202 9.33e-04 4
#> ATC:pam     80     7.79e-10   0.3672 6.09e-02 4
#> SD:hclust   70     1.43e-03   0.2751 2.41e-07 4
#> CV:hclust   62     7.35e-06   0.0080 4.30e-05 4
#> MAD:hclust  69     7.35e-03   0.5993 3.88e-07 4
#> ATC:hclust  55     1.29e-08   0.4662 7.79e-05 4
test_to_known_factors(res_list, k = 5)
#>              n cell.line(p) agent(p)  time(p) k
#> SD:NMF      63     2.27e-08   0.1533 3.50e-06 5
#> CV:NMF      72     1.83e-11   0.1116 5.84e-07 5
#> MAD:NMF     66     4.65e-10   0.1580 3.40e-05 5
#> ATC:NMF     60     1.07e-05   0.1530 5.19e-08 5
#> SD:skmeans  56     4.61e-09   0.9215 1.29e-07 5
#> CV:skmeans  70     1.28e-14   0.5543 1.48e-09 5
#> MAD:skmeans 63     1.02e-12   0.8570 1.93e-05 5
#> ATC:skmeans 65     3.59e-09   0.3210 8.99e-06 5
#> SD:mclust   49     2.00e-06   0.6435 2.25e-04 5
#> CV:mclust   71     5.36e-11   0.2944 2.43e-04 5
#> MAD:mclust  60     4.77e-15   0.8322 1.10e-03 5
#> ATC:mclust  75     1.63e-08   0.4024 1.62e-07 5
#> SD:kmeans   59     4.35e-05   0.7279 9.71e-09 5
#> CV:kmeans   53     4.44e-08   0.5910 5.09e-06 5
#> MAD:kmeans  44     6.49e-07   0.4453 6.49e-04 5
#> ATC:kmeans  60     1.60e-08   0.9426 8.77e-03 5
#> SD:pam      79     3.86e-10   0.8739 8.06e-06 5
#> CV:pam      66     4.32e-12   0.1193 1.99e-06 5
#> MAD:pam     31     9.20e-03   0.4070 1.69e-02 5
#> ATC:pam     77     2.10e-11   0.1625 2.79e-02 5
#> SD:hclust   69     1.44e-03   0.2792 8.69e-09 5
#> CV:hclust   41     1.38e-04   0.0464 1.75e-06 5
#> MAD:hclust  64     1.98e-03   0.4807 9.91e-08 5
#> ATC:hclust  62     2.67e-09   0.4267 2.42e-04 5
test_to_known_factors(res_list, k = 6)
#>              n cell.line(p) agent(p)  time(p) k
#> SD:NMF      50     8.95e-07   0.0685 2.04e-05 6
#> CV:NMF      52     1.16e-10   0.3268 2.60e-05 6
#> MAD:NMF     45     1.64e-09   0.2767 9.10e-06 6
#> ATC:NMF     44     5.60e-05   0.2050 9.87e-09 6
#> SD:skmeans  75     2.98e-13   0.8558 1.32e-09 6
#> CV:skmeans  53     1.11e-11   0.0832 1.28e-06 6
#> MAD:skmeans 65     4.81e-12   0.7387 1.77e-08 6
#> ATC:skmeans 61     3.14e-07   0.2247 7.28e-05 6
#> SD:mclust   20     5.42e-02   0.2536 1.92e-02 6
#> CV:mclust   66     2.25e-13   0.5032 8.69e-06 6
#> MAD:mclust  70     2.00e-14   0.4624 6.12e-04 6
#> ATC:mclust  77     2.09e-09   0.7413 2.89e-04 6
#> SD:kmeans   41     3.19e-04   0.1910 3.53e-05 6
#> CV:kmeans   59     2.09e-12   0.3761 7.81e-06 6
#> MAD:kmeans  57     7.45e-09   0.9585 5.64e-08 6
#> ATC:kmeans  72     5.17e-10   0.7534 1.44e-03 6
#> SD:pam      68     3.60e-09   0.2001 1.73e-04 6
#> CV:pam      59     4.65e-15   0.2316 1.66e-05 6
#> MAD:pam     54     7.45e-16   0.7127 1.62e-03 6
#> ATC:pam     72     8.26e-10   0.1396 1.99e-02 6
#> SD:hclust   60     2.53e-02   0.2963 1.56e-09 6
#> CV:hclust   36     2.37e-05   0.3045 6.63e-06 6
#> MAD:hclust  62     1.18e-03   0.2215 1.73e-06 6
#> ATC:hclust  70     6.65e-10   0.8467 2.51e-03 6

Results for each method


SD:hclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "hclust"]
# you can also extract it by
# res = res_list["SD:hclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-hclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-hclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.276           0.735       0.852         0.3869 0.630   0.630
#> 3 3 0.281           0.585       0.740         0.3088 0.950   0.921
#> 4 4 0.325           0.637       0.789         0.2168 0.749   0.594
#> 5 5 0.461           0.611       0.762         0.1112 0.941   0.855
#> 6 6 0.575           0.598       0.783         0.0468 0.953   0.871

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     2  0.4161    0.81196 0.084 0.916
#> GSM11735     2  0.4161    0.81196 0.084 0.916
#> GSM11733     2  0.9686    0.55809 0.396 0.604
#> GSM11863     2  0.9686    0.55809 0.396 0.604
#> GSM11710     2  0.4431    0.81823 0.092 0.908
#> GSM11712     1  0.2423    0.83174 0.960 0.040
#> GSM11732     1  0.9286    0.31312 0.656 0.344
#> GSM11844     1  0.9286    0.31312 0.656 0.344
#> GSM11842     1  0.9000    0.44588 0.684 0.316
#> GSM11860     1  0.9000    0.44588 0.684 0.316
#> GSM11686     2  0.6531    0.83504 0.168 0.832
#> GSM11688     2  0.6048    0.83392 0.148 0.852
#> GSM11846     1  0.9044    0.45223 0.680 0.320
#> GSM11680     1  0.5059    0.79956 0.888 0.112
#> GSM11698     1  0.5178    0.79683 0.884 0.116
#> GSM11840     2  0.9686    0.55809 0.396 0.604
#> GSM11847     2  0.9686    0.55809 0.396 0.604
#> GSM11685     2  0.6048    0.83392 0.148 0.852
#> GSM11699     1  0.5178    0.79683 0.884 0.116
#> GSM27950     2  0.9358    0.63226 0.352 0.648
#> GSM27946     1  0.4815    0.80445 0.896 0.104
#> GSM11709     1  0.6438    0.74291 0.836 0.164
#> GSM11720     1  0.0376    0.83411 0.996 0.004
#> GSM11726     1  0.4161    0.81433 0.916 0.084
#> GSM11837     1  0.4161    0.81433 0.916 0.084
#> GSM11725     1  0.3879    0.81877 0.924 0.076
#> GSM11864     1  0.3879    0.81877 0.924 0.076
#> GSM11687     1  0.0672    0.83486 0.992 0.008
#> GSM11693     1  0.0672    0.83486 0.992 0.008
#> GSM11727     1  0.4161    0.81433 0.916 0.084
#> GSM11838     1  0.4161    0.81433 0.916 0.084
#> GSM11681     2  0.6531    0.83504 0.168 0.832
#> GSM11689     1  0.0672    0.83486 0.992 0.008
#> GSM11704     1  0.0672    0.83486 0.992 0.008
#> GSM11703     1  0.3879    0.81796 0.924 0.076
#> GSM11705     1  0.7602    0.64766 0.780 0.220
#> GSM11722     1  0.4690    0.81157 0.900 0.100
#> GSM11730     1  0.4161    0.81433 0.916 0.084
#> GSM11713     2  0.7299    0.81341 0.204 0.796
#> GSM11728     2  0.7745    0.79239 0.228 0.772
#> GSM27947     1  0.4815    0.80445 0.896 0.104
#> GSM27951     1  0.9909    0.00942 0.556 0.444
#> GSM11707     2  0.4431    0.81823 0.092 0.908
#> GSM11716     1  0.4298    0.81977 0.912 0.088
#> GSM11850     1  0.4431    0.82109 0.908 0.092
#> GSM11851     1  0.4431    0.82109 0.908 0.092
#> GSM11721     1  0.2603    0.82942 0.956 0.044
#> GSM11852     1  0.2603    0.82942 0.956 0.044
#> GSM11694     1  0.4815    0.80445 0.896 0.104
#> GSM11695     1  0.4815    0.80445 0.896 0.104
#> GSM11734     1  0.4161    0.81433 0.916 0.084
#> GSM11861     1  0.2423    0.82946 0.960 0.040
#> GSM11843     1  0.4022    0.82058 0.920 0.080
#> GSM11862     1  0.2423    0.82946 0.960 0.040
#> GSM11697     1  0.5178    0.79683 0.884 0.116
#> GSM11714     2  0.4431    0.81823 0.092 0.908
#> GSM11723     1  0.4298    0.81977 0.912 0.088
#> GSM11845     1  0.4298    0.81977 0.912 0.088
#> GSM11683     2  1.0000    0.24699 0.500 0.500
#> GSM11691     1  0.9427    0.30693 0.640 0.360
#> GSM27949     1  0.9993   -0.22521 0.516 0.484
#> GSM27945     1  0.4815    0.80445 0.896 0.104
#> GSM11706     2  0.4939    0.82440 0.108 0.892
#> GSM11853     1  0.5178    0.79683 0.884 0.116
#> GSM11729     1  0.4161    0.81433 0.916 0.084
#> GSM11746     1  0.4161    0.81433 0.916 0.084
#> GSM11711     1  0.5519    0.78099 0.872 0.128
#> GSM11854     1  0.5178    0.79683 0.884 0.116
#> GSM11731     1  0.4161    0.81433 0.916 0.084
#> GSM11839     1  0.4161    0.81433 0.916 0.084
#> GSM11836     1  0.6438    0.80754 0.836 0.164
#> GSM11849     1  0.6148    0.76328 0.848 0.152
#> GSM11682     2  0.6531    0.83504 0.168 0.832
#> GSM11690     1  0.6048    0.76726 0.852 0.148
#> GSM11692     1  0.2423    0.83174 0.960 0.040
#> GSM11841     1  0.2423    0.83174 0.960 0.040
#> GSM11901     1  0.2423    0.83174 0.960 0.040
#> GSM11715     1  0.6801    0.76493 0.820 0.180
#> GSM11724     1  0.6801    0.76493 0.820 0.180
#> GSM11684     1  0.6048    0.76726 0.852 0.148
#> GSM11696     1  0.6048    0.76726 0.852 0.148
#> GSM27952     2  0.6531    0.83504 0.168 0.832
#> GSM27948     1  0.6048    0.76726 0.852 0.148

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     2  0.6763     0.4334 0.012 0.552 0.436
#> GSM11735     2  0.6763     0.4334 0.012 0.552 0.436
#> GSM11733     2  0.9773     0.5614 0.340 0.420 0.240
#> GSM11863     2  0.9773     0.5614 0.340 0.420 0.240
#> GSM11710     3  0.5696     0.5031 0.064 0.136 0.800
#> GSM11712     1  0.2443     0.7655 0.940 0.032 0.028
#> GSM11732     1  0.8350     0.1203 0.600 0.280 0.120
#> GSM11844     1  0.8408     0.1178 0.596 0.280 0.124
#> GSM11842     1  0.7772     0.4243 0.676 0.152 0.172
#> GSM11860     1  0.7772     0.4243 0.676 0.152 0.172
#> GSM11686     3  0.2165     0.6512 0.064 0.000 0.936
#> GSM11688     3  0.3045     0.6415 0.064 0.020 0.916
#> GSM11846     1  0.6647     0.3216 0.592 0.012 0.396
#> GSM11680     1  0.3998     0.7319 0.884 0.056 0.060
#> GSM11698     1  0.4095     0.7295 0.880 0.056 0.064
#> GSM11840     2  0.9773     0.5614 0.340 0.420 0.240
#> GSM11847     2  0.9773     0.5614 0.340 0.420 0.240
#> GSM11685     3  0.3045     0.6415 0.064 0.020 0.916
#> GSM11699     1  0.3998     0.7312 0.884 0.056 0.060
#> GSM27950     3  0.9633    -0.3374 0.236 0.300 0.464
#> GSM27946     1  0.3583     0.7378 0.900 0.056 0.044
#> GSM11709     1  0.4808     0.6753 0.804 0.008 0.188
#> GSM11720     1  0.0747     0.7660 0.984 0.016 0.000
#> GSM11726     1  0.5785     0.6247 0.668 0.332 0.000
#> GSM11837     1  0.5785     0.6247 0.668 0.332 0.000
#> GSM11725     1  0.3267     0.7480 0.884 0.116 0.000
#> GSM11864     1  0.3267     0.7480 0.884 0.116 0.000
#> GSM11687     1  0.0848     0.7662 0.984 0.008 0.008
#> GSM11693     1  0.0848     0.7662 0.984 0.008 0.008
#> GSM11727     1  0.5785     0.6247 0.668 0.332 0.000
#> GSM11838     1  0.5785     0.6247 0.668 0.332 0.000
#> GSM11681     3  0.2165     0.6512 0.064 0.000 0.936
#> GSM11689     1  0.0848     0.7662 0.984 0.008 0.008
#> GSM11704     1  0.0848     0.7662 0.984 0.008 0.008
#> GSM11703     1  0.3134     0.7512 0.916 0.052 0.032
#> GSM11705     1  0.7222     0.5389 0.684 0.072 0.244
#> GSM11722     1  0.6264     0.6797 0.724 0.244 0.032
#> GSM11730     1  0.5785     0.6247 0.668 0.332 0.000
#> GSM11713     3  0.5764     0.5902 0.076 0.124 0.800
#> GSM11728     3  0.6176     0.5822 0.100 0.120 0.780
#> GSM27947     1  0.3583     0.7378 0.900 0.056 0.044
#> GSM27951     3  0.7491     0.0581 0.472 0.036 0.492
#> GSM11707     2  0.6819     0.3961 0.012 0.512 0.476
#> GSM11716     1  0.2959     0.7508 0.900 0.100 0.000
#> GSM11850     1  0.2711     0.7518 0.912 0.088 0.000
#> GSM11851     1  0.2711     0.7518 0.912 0.088 0.000
#> GSM11721     1  0.1585     0.7617 0.964 0.008 0.028
#> GSM11852     1  0.1585     0.7617 0.964 0.008 0.028
#> GSM11694     1  0.3583     0.7378 0.900 0.056 0.044
#> GSM11695     1  0.3583     0.7378 0.900 0.056 0.044
#> GSM11734     1  0.5216     0.6724 0.740 0.260 0.000
#> GSM11861     1  0.1411     0.7602 0.964 0.000 0.036
#> GSM11843     1  0.5024     0.6974 0.776 0.220 0.004
#> GSM11862     1  0.1411     0.7602 0.964 0.000 0.036
#> GSM11697     1  0.3797     0.7335 0.892 0.056 0.052
#> GSM11714     2  0.6822     0.3897 0.012 0.508 0.480
#> GSM11723     1  0.2959     0.7508 0.900 0.100 0.000
#> GSM11845     1  0.2959     0.7508 0.900 0.100 0.000
#> GSM11683     3  0.7715     0.1115 0.428 0.048 0.524
#> GSM11691     1  0.7334     0.3743 0.624 0.048 0.328
#> GSM27949     1  0.9776    -0.3411 0.440 0.276 0.284
#> GSM27945     1  0.3583     0.7378 0.900 0.056 0.044
#> GSM11706     3  0.7293    -0.4499 0.028 0.476 0.496
#> GSM11853     1  0.3998     0.7312 0.884 0.056 0.060
#> GSM11729     1  0.5397     0.6603 0.720 0.280 0.000
#> GSM11746     1  0.5397     0.6603 0.720 0.280 0.000
#> GSM11711     1  0.4768     0.7189 0.848 0.052 0.100
#> GSM11854     1  0.3998     0.7312 0.884 0.056 0.060
#> GSM11731     1  0.5216     0.6724 0.740 0.260 0.000
#> GSM11839     1  0.5216     0.6724 0.740 0.260 0.000
#> GSM11836     1  0.7680     0.6685 0.680 0.188 0.132
#> GSM11849     1  0.7651     0.5692 0.680 0.124 0.196
#> GSM11682     3  0.2165     0.6512 0.064 0.000 0.936
#> GSM11690     1  0.7124     0.5872 0.708 0.088 0.204
#> GSM11692     1  0.2443     0.7655 0.940 0.032 0.028
#> GSM11841     1  0.2443     0.7655 0.940 0.032 0.028
#> GSM11901     1  0.2443     0.7655 0.940 0.032 0.028
#> GSM11715     1  0.9131     0.4558 0.520 0.312 0.168
#> GSM11724     1  0.9131     0.4558 0.520 0.312 0.168
#> GSM11684     1  0.7124     0.5872 0.708 0.088 0.204
#> GSM11696     1  0.7124     0.5872 0.708 0.088 0.204
#> GSM27952     3  0.2165     0.6512 0.064 0.000 0.936
#> GSM27948     1  0.7124     0.5872 0.708 0.088 0.204

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     4  0.0000     0.5667 0.000 0.000 0.000 1.000
#> GSM11735     4  0.0000     0.5667 0.000 0.000 0.000 1.000
#> GSM11733     4  0.4855     0.5747 0.004 0.000 0.352 0.644
#> GSM11863     4  0.4855     0.5747 0.004 0.000 0.352 0.644
#> GSM11710     1  0.6292     0.6620 0.592 0.000 0.076 0.332
#> GSM11712     3  0.2216     0.7145 0.000 0.092 0.908 0.000
#> GSM11732     3  0.4978     0.1982 0.004 0.000 0.612 0.384
#> GSM11844     3  0.5112     0.1991 0.008 0.000 0.608 0.384
#> GSM11842     3  0.4584     0.4412 0.000 0.004 0.696 0.300
#> GSM11860     3  0.4584     0.4412 0.000 0.004 0.696 0.300
#> GSM11686     1  0.4740     0.9113 0.788 0.000 0.080 0.132
#> GSM11688     1  0.5077     0.8997 0.760 0.000 0.080 0.160
#> GSM11846     3  0.6315     0.4506 0.300 0.004 0.620 0.076
#> GSM11680     3  0.2521     0.7558 0.024 0.000 0.912 0.064
#> GSM11698     3  0.2623     0.7543 0.028 0.000 0.908 0.064
#> GSM11840     4  0.4855     0.5747 0.004 0.000 0.352 0.644
#> GSM11847     4  0.4855     0.5747 0.004 0.000 0.352 0.644
#> GSM11685     1  0.5077     0.8997 0.760 0.000 0.080 0.160
#> GSM11699     3  0.2521     0.7554 0.024 0.000 0.912 0.064
#> GSM27950     4  0.7700     0.2810 0.304 0.000 0.248 0.448
#> GSM27946     3  0.2234     0.7587 0.008 0.004 0.924 0.064
#> GSM11709     3  0.4188     0.6937 0.144 0.008 0.820 0.028
#> GSM11720     3  0.1488     0.7469 0.012 0.032 0.956 0.000
#> GSM11726     2  0.2589     0.7484 0.000 0.884 0.116 0.000
#> GSM11837     2  0.2589     0.7484 0.000 0.884 0.116 0.000
#> GSM11725     3  0.5035     0.5667 0.052 0.204 0.744 0.000
#> GSM11864     3  0.5035     0.5667 0.052 0.204 0.744 0.000
#> GSM11687     3  0.1520     0.7500 0.020 0.024 0.956 0.000
#> GSM11693     3  0.1520     0.7500 0.020 0.024 0.956 0.000
#> GSM11727     2  0.2589     0.7484 0.000 0.884 0.116 0.000
#> GSM11838     2  0.2589     0.7484 0.000 0.884 0.116 0.000
#> GSM11681     1  0.4740     0.9113 0.788 0.000 0.080 0.132
#> GSM11689     3  0.1520     0.7500 0.020 0.024 0.956 0.000
#> GSM11704     3  0.1520     0.7500 0.020 0.024 0.956 0.000
#> GSM11703     3  0.3001     0.7566 0.024 0.024 0.904 0.048
#> GSM11705     3  0.6337     0.5844 0.240 0.028 0.672 0.060
#> GSM11722     2  0.5517     0.7152 0.036 0.648 0.316 0.000
#> GSM11730     2  0.2589     0.7484 0.000 0.884 0.116 0.000
#> GSM11713     1  0.2266     0.8198 0.912 0.004 0.084 0.000
#> GSM11728     1  0.2654     0.8028 0.888 0.004 0.108 0.000
#> GSM27947     3  0.2234     0.7587 0.008 0.004 0.924 0.064
#> GSM27951     3  0.5938     0.0258 0.476 0.000 0.488 0.036
#> GSM11707     4  0.1637     0.5460 0.060 0.000 0.000 0.940
#> GSM11716     3  0.5096     0.6171 0.084 0.156 0.760 0.000
#> GSM11850     3  0.4955     0.6242 0.084 0.144 0.772 0.000
#> GSM11851     3  0.4955     0.6242 0.084 0.144 0.772 0.000
#> GSM11721     3  0.0376     0.7548 0.004 0.004 0.992 0.000
#> GSM11852     3  0.0376     0.7548 0.004 0.004 0.992 0.000
#> GSM11694     3  0.2048     0.7577 0.008 0.000 0.928 0.064
#> GSM11695     3  0.2048     0.7577 0.008 0.000 0.928 0.064
#> GSM11734     2  0.5694     0.6367 0.080 0.696 0.224 0.000
#> GSM11861     3  0.0336     0.7558 0.008 0.000 0.992 0.000
#> GSM11843     2  0.6206     0.4232 0.056 0.540 0.404 0.000
#> GSM11862     3  0.0336     0.7558 0.008 0.000 0.992 0.000
#> GSM11697     3  0.2300     0.7560 0.016 0.000 0.920 0.064
#> GSM11714     4  0.1716     0.5424 0.064 0.000 0.000 0.936
#> GSM11723     3  0.5141     0.6139 0.084 0.160 0.756 0.000
#> GSM11845     3  0.5096     0.6171 0.084 0.156 0.760 0.000
#> GSM11683     3  0.7115    -0.0733 0.420 0.000 0.452 0.128
#> GSM11691     3  0.6327     0.4661 0.228 0.000 0.648 0.124
#> GSM27949     3  0.7243    -0.1718 0.144 0.000 0.452 0.404
#> GSM27945     3  0.2048     0.7577 0.008 0.000 0.928 0.064
#> GSM11706     4  0.3144     0.5311 0.072 0.000 0.044 0.884
#> GSM11853     3  0.2521     0.7551 0.024 0.000 0.912 0.064
#> GSM11729     2  0.4103     0.7743 0.000 0.744 0.256 0.000
#> GSM11746     2  0.4103     0.7743 0.000 0.744 0.256 0.000
#> GSM11711     3  0.4401     0.7372 0.080 0.024 0.836 0.060
#> GSM11854     3  0.2521     0.7551 0.024 0.000 0.912 0.064
#> GSM11731     2  0.4123     0.7526 0.008 0.772 0.220 0.000
#> GSM11839     2  0.4123     0.7526 0.008 0.772 0.220 0.000
#> GSM11836     2  0.7119     0.3258 0.128 0.444 0.428 0.000
#> GSM11849     3  0.6465     0.4189 0.228 0.136 0.636 0.000
#> GSM11682     1  0.4740     0.9113 0.788 0.000 0.080 0.132
#> GSM11690     3  0.5041     0.5756 0.232 0.040 0.728 0.000
#> GSM11692     3  0.2216     0.7145 0.000 0.092 0.908 0.000
#> GSM11841     3  0.2216     0.7145 0.000 0.092 0.908 0.000
#> GSM11901     3  0.2216     0.7145 0.000 0.092 0.908 0.000
#> GSM11715     2  0.7220     0.6294 0.212 0.548 0.240 0.000
#> GSM11724     2  0.7220     0.6294 0.212 0.548 0.240 0.000
#> GSM11684     3  0.5041     0.5756 0.232 0.040 0.728 0.000
#> GSM11696     3  0.5041     0.5756 0.232 0.040 0.728 0.000
#> GSM27952     1  0.4740     0.9113 0.788 0.000 0.080 0.132
#> GSM27948     3  0.5041     0.5756 0.232 0.040 0.728 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     3  0.0000      0.875 0.000 0.000 1.000 0.000 0.000
#> GSM11735     3  0.0000      0.875 0.000 0.000 1.000 0.000 0.000
#> GSM11733     5  0.6963      0.835 0.044 0.000 0.404 0.120 0.432
#> GSM11863     5  0.6963      0.835 0.044 0.000 0.404 0.120 0.432
#> GSM11710     1  0.3957      0.410 0.712 0.000 0.280 0.008 0.000
#> GSM11712     4  0.2130      0.736 0.000 0.080 0.000 0.908 0.012
#> GSM11732     4  0.6972     -0.449 0.012 0.000 0.224 0.404 0.360
#> GSM11844     4  0.7046     -0.438 0.016 0.000 0.224 0.412 0.348
#> GSM11842     4  0.6055      0.389 0.040 0.000 0.204 0.648 0.108
#> GSM11860     4  0.6055      0.389 0.040 0.000 0.204 0.648 0.108
#> GSM11686     1  0.2069      0.670 0.912 0.000 0.076 0.012 0.000
#> GSM11688     1  0.2470      0.655 0.884 0.000 0.104 0.012 0.000
#> GSM11846     4  0.5034      0.398 0.348 0.000 0.020 0.616 0.016
#> GSM11680     4  0.3046      0.741 0.028 0.000 0.020 0.876 0.076
#> GSM11698     4  0.3129      0.739 0.032 0.000 0.020 0.872 0.076
#> GSM11840     5  0.6963      0.835 0.044 0.000 0.404 0.120 0.432
#> GSM11847     5  0.6963      0.835 0.044 0.000 0.404 0.120 0.432
#> GSM11685     1  0.2470      0.655 0.884 0.000 0.104 0.012 0.000
#> GSM11699     4  0.3046      0.740 0.028 0.000 0.020 0.876 0.076
#> GSM27950     1  0.7851     -0.445 0.348 0.000 0.252 0.068 0.332
#> GSM27946     4  0.2700      0.745 0.012 0.004 0.020 0.896 0.068
#> GSM11709     4  0.3544      0.685 0.164 0.000 0.008 0.812 0.016
#> GSM11720     4  0.1399      0.755 0.000 0.028 0.000 0.952 0.020
#> GSM11726     2  0.0404      0.710 0.000 0.988 0.000 0.012 0.000
#> GSM11837     2  0.0404      0.710 0.000 0.988 0.000 0.012 0.000
#> GSM11725     4  0.4818      0.594 0.000 0.180 0.000 0.720 0.100
#> GSM11864     4  0.4818      0.594 0.000 0.180 0.000 0.720 0.100
#> GSM11687     4  0.1503      0.756 0.008 0.020 0.000 0.952 0.020
#> GSM11693     4  0.1503      0.756 0.008 0.020 0.000 0.952 0.020
#> GSM11727     2  0.0404      0.710 0.000 0.988 0.000 0.012 0.000
#> GSM11838     2  0.0404      0.710 0.000 0.988 0.000 0.012 0.000
#> GSM11681     1  0.2069      0.670 0.912 0.000 0.076 0.012 0.000
#> GSM11689     4  0.1503      0.756 0.008 0.020 0.000 0.952 0.020
#> GSM11704     4  0.1503      0.756 0.008 0.020 0.000 0.952 0.020
#> GSM11703     4  0.3291      0.748 0.024 0.020 0.012 0.872 0.072
#> GSM11705     4  0.6144      0.574 0.200 0.020 0.012 0.648 0.120
#> GSM11722     2  0.4438      0.697 0.012 0.748 0.000 0.204 0.036
#> GSM11730     2  0.0404      0.710 0.000 0.988 0.000 0.012 0.000
#> GSM11713     1  0.2971      0.540 0.836 0.008 0.000 0.000 0.156
#> GSM11728     1  0.3606      0.533 0.816 0.008 0.000 0.024 0.152
#> GSM27947     4  0.2700      0.745 0.012 0.004 0.020 0.896 0.068
#> GSM27951     1  0.4450     -0.116 0.508 0.000 0.000 0.488 0.004
#> GSM11707     3  0.1544      0.897 0.068 0.000 0.932 0.000 0.000
#> GSM11716     4  0.4101      0.528 0.000 0.004 0.000 0.664 0.332
#> GSM11850     4  0.4047      0.535 0.000 0.004 0.000 0.676 0.320
#> GSM11851     4  0.4047      0.535 0.000 0.004 0.000 0.676 0.320
#> GSM11721     4  0.0451      0.755 0.000 0.004 0.000 0.988 0.008
#> GSM11852     4  0.0451      0.755 0.000 0.004 0.000 0.988 0.008
#> GSM11694     4  0.2666      0.743 0.012 0.000 0.020 0.892 0.076
#> GSM11695     4  0.2666      0.743 0.012 0.000 0.020 0.892 0.076
#> GSM11734     2  0.6117      0.554 0.000 0.540 0.000 0.156 0.304
#> GSM11861     4  0.1168      0.756 0.008 0.000 0.000 0.960 0.032
#> GSM11843     2  0.6439      0.375 0.000 0.448 0.000 0.372 0.180
#> GSM11862     4  0.0451      0.756 0.008 0.000 0.000 0.988 0.004
#> GSM11697     4  0.2866      0.742 0.020 0.000 0.020 0.884 0.076
#> GSM11714     3  0.1544      0.896 0.068 0.000 0.932 0.000 0.000
#> GSM11723     4  0.4218      0.524 0.000 0.008 0.000 0.660 0.332
#> GSM11845     4  0.4101      0.528 0.000 0.004 0.000 0.664 0.332
#> GSM11683     1  0.6615      0.095 0.476 0.000 0.060 0.400 0.064
#> GSM11691     4  0.6328      0.369 0.280 0.000 0.060 0.592 0.068
#> GSM27949     5  0.8433      0.470 0.176 0.000 0.220 0.264 0.340
#> GSM27945     4  0.2666      0.743 0.012 0.000 0.020 0.892 0.076
#> GSM11706     3  0.3003      0.816 0.092 0.000 0.864 0.044 0.000
#> GSM11853     4  0.3046      0.740 0.028 0.000 0.020 0.876 0.076
#> GSM11729     2  0.4410      0.729 0.000 0.764 0.000 0.124 0.112
#> GSM11746     2  0.4410      0.729 0.000 0.764 0.000 0.124 0.112
#> GSM11711     4  0.4447      0.719 0.092 0.020 0.012 0.804 0.072
#> GSM11854     4  0.3046      0.740 0.028 0.000 0.020 0.876 0.076
#> GSM11731     2  0.4807      0.705 0.000 0.728 0.000 0.140 0.132
#> GSM11839     2  0.4807      0.705 0.000 0.728 0.000 0.140 0.132
#> GSM11836     2  0.7204      0.304 0.068 0.452 0.000 0.364 0.116
#> GSM11849     4  0.6447      0.432 0.072 0.072 0.000 0.596 0.260
#> GSM11682     1  0.2069      0.670 0.912 0.000 0.076 0.012 0.000
#> GSM11690     4  0.5274      0.614 0.080 0.036 0.000 0.724 0.160
#> GSM11692     4  0.2130      0.736 0.000 0.080 0.000 0.908 0.012
#> GSM11841     4  0.2130      0.736 0.000 0.080 0.000 0.908 0.012
#> GSM11901     4  0.2130      0.736 0.000 0.080 0.000 0.908 0.012
#> GSM11715     2  0.6725      0.601 0.060 0.572 0.000 0.112 0.256
#> GSM11724     2  0.6725      0.601 0.060 0.572 0.000 0.112 0.256
#> GSM11684     4  0.5274      0.614 0.080 0.036 0.000 0.724 0.160
#> GSM11696     4  0.5274      0.614 0.080 0.036 0.000 0.724 0.160
#> GSM27952     1  0.2069      0.670 0.912 0.000 0.076 0.012 0.000
#> GSM27948     4  0.5274      0.614 0.080 0.036 0.000 0.724 0.160

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6   0.127     0.9107 0.000 0.000 0.000 0.000 0.060 0.940
#> GSM11735     6   0.127     0.9107 0.000 0.000 0.000 0.000 0.060 0.940
#> GSM11733     5   0.101     0.6256 0.000 0.000 0.004 0.000 0.960 0.036
#> GSM11863     5   0.101     0.6256 0.000 0.000 0.004 0.000 0.960 0.036
#> GSM11710     1   0.387     0.4653 0.704 0.000 0.008 0.000 0.012 0.276
#> GSM11712     3   0.171     0.7193 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM11732     5   0.446     0.4186 0.000 0.000 0.352 0.016 0.616 0.016
#> GSM11844     5   0.426     0.4151 0.004 0.000 0.364 0.004 0.616 0.012
#> GSM11842     3   0.485     0.2798 0.000 0.012 0.548 0.000 0.404 0.036
#> GSM11860     3   0.485     0.2798 0.000 0.012 0.548 0.000 0.404 0.036
#> GSM11686     1   0.216     0.7073 0.904 0.000 0.012 0.000 0.012 0.072
#> GSM11688     1   0.252     0.6950 0.876 0.000 0.012 0.000 0.012 0.100
#> GSM11846     3   0.497     0.4051 0.332 0.028 0.604 0.000 0.036 0.000
#> GSM11680     3   0.263     0.7462 0.020 0.004 0.864 0.000 0.112 0.000
#> GSM11698     3   0.272     0.7443 0.024 0.004 0.860 0.000 0.112 0.000
#> GSM11840     5   0.101     0.6256 0.000 0.000 0.004 0.000 0.960 0.036
#> GSM11847     5   0.101     0.6256 0.000 0.000 0.004 0.000 0.960 0.036
#> GSM11685     1   0.252     0.6950 0.876 0.000 0.012 0.000 0.012 0.100
#> GSM11699     3   0.254     0.7484 0.020 0.004 0.872 0.000 0.104 0.000
#> GSM27950     5   0.511     0.3510 0.336 0.000 0.040 0.000 0.592 0.032
#> GSM27946     3   0.216     0.7520 0.008 0.000 0.892 0.004 0.096 0.000
#> GSM11709     3   0.368     0.6855 0.156 0.028 0.796 0.000 0.016 0.004
#> GSM11720     3   0.172     0.7455 0.000 0.036 0.932 0.028 0.004 0.000
#> GSM11726     2   0.462     0.6436 0.000 0.644 0.000 0.304 0.012 0.040
#> GSM11837     2   0.462     0.6436 0.000 0.644 0.000 0.304 0.012 0.040
#> GSM11725     3   0.467     0.5189 0.000 0.088 0.692 0.212 0.008 0.000
#> GSM11864     3   0.467     0.5189 0.000 0.088 0.692 0.212 0.008 0.000
#> GSM11687     3   0.174     0.7487 0.008 0.032 0.936 0.020 0.004 0.000
#> GSM11693     3   0.174     0.7487 0.008 0.032 0.936 0.020 0.004 0.000
#> GSM11727     2   0.462     0.6436 0.000 0.644 0.000 0.304 0.012 0.040
#> GSM11838     2   0.462     0.6436 0.000 0.644 0.000 0.304 0.012 0.040
#> GSM11681     1   0.216     0.7073 0.904 0.000 0.012 0.000 0.012 0.072
#> GSM11689     3   0.174     0.7487 0.008 0.032 0.936 0.020 0.004 0.000
#> GSM11704     3   0.174     0.7487 0.008 0.032 0.936 0.020 0.004 0.000
#> GSM11703     3   0.298     0.7517 0.020 0.028 0.864 0.004 0.084 0.000
#> GSM11705     3   0.581     0.5971 0.172 0.100 0.644 0.004 0.080 0.000
#> GSM11722     2   0.555     0.3190 0.004 0.588 0.160 0.244 0.004 0.000
#> GSM11730     2   0.462     0.6436 0.000 0.644 0.000 0.304 0.012 0.040
#> GSM11713     1   0.301     0.5352 0.800 0.192 0.000 0.004 0.004 0.000
#> GSM11728     1   0.358     0.5257 0.780 0.188 0.024 0.004 0.004 0.000
#> GSM27947     3   0.216     0.7520 0.008 0.000 0.892 0.004 0.096 0.000
#> GSM27951     1   0.400    -0.1192 0.508 0.000 0.488 0.004 0.000 0.000
#> GSM11707     6   0.153     0.9218 0.068 0.000 0.000 0.000 0.004 0.928
#> GSM11716     3   0.518     0.3968 0.000 0.004 0.608 0.312 0.056 0.020
#> GSM11850     3   0.513     0.4102 0.000 0.004 0.620 0.300 0.056 0.020
#> GSM11851     3   0.513     0.4102 0.000 0.004 0.620 0.300 0.056 0.020
#> GSM11721     3   0.052     0.7508 0.000 0.008 0.984 0.008 0.000 0.000
#> GSM11852     3   0.052     0.7508 0.000 0.008 0.984 0.008 0.000 0.000
#> GSM11694     3   0.231     0.7490 0.008 0.004 0.880 0.000 0.108 0.000
#> GSM11695     3   0.231     0.7490 0.008 0.004 0.880 0.000 0.108 0.000
#> GSM11734     4   0.191     0.5443 0.000 0.004 0.096 0.900 0.000 0.000
#> GSM11861     3   0.180     0.7515 0.008 0.000 0.936 0.016 0.020 0.020
#> GSM11843     4   0.470     0.4140 0.000 0.044 0.368 0.584 0.004 0.000
#> GSM11862     3   0.052     0.7517 0.008 0.000 0.984 0.008 0.000 0.000
#> GSM11697     3   0.241     0.7495 0.016 0.004 0.880 0.000 0.100 0.000
#> GSM11714     6   0.139     0.9207 0.068 0.000 0.000 0.000 0.000 0.932
#> GSM11723     3   0.507     0.3903 0.000 0.004 0.608 0.320 0.052 0.016
#> GSM11845     3   0.518     0.3968 0.000 0.004 0.608 0.312 0.056 0.020
#> GSM11683     1   0.604     0.1141 0.464 0.000 0.400 0.000 0.088 0.048
#> GSM11691     3   0.593     0.3786 0.268 0.000 0.588 0.008 0.088 0.048
#> GSM27949     5   0.534     0.5034 0.164 0.004 0.224 0.000 0.608 0.000
#> GSM27945     3   0.231     0.7490 0.008 0.004 0.880 0.000 0.108 0.000
#> GSM11706     6   0.284     0.8613 0.092 0.000 0.044 0.000 0.004 0.860
#> GSM11853     3   0.257     0.7477 0.024 0.004 0.872 0.000 0.100 0.000
#> GSM11729     2   0.417     0.5687 0.000 0.708 0.056 0.236 0.000 0.000
#> GSM11746     2   0.417     0.5687 0.000 0.708 0.056 0.236 0.000 0.000
#> GSM11711     3   0.410     0.7244 0.088 0.028 0.792 0.004 0.088 0.000
#> GSM11854     3   0.257     0.7477 0.024 0.004 0.872 0.000 0.100 0.000
#> GSM11731     4   0.462     0.4961 0.000 0.236 0.092 0.672 0.000 0.000
#> GSM11839     4   0.462     0.4961 0.000 0.236 0.092 0.672 0.000 0.000
#> GSM11836     2   0.652    -0.0163 0.048 0.464 0.316 0.172 0.000 0.000
#> GSM11849     3   0.460     0.3558 0.032 0.408 0.556 0.004 0.000 0.000
#> GSM11682     1   0.216     0.7073 0.904 0.000 0.012 0.000 0.012 0.072
#> GSM11690     3   0.451     0.5627 0.036 0.236 0.704 0.020 0.004 0.000
#> GSM11692     3   0.171     0.7193 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM11841     3   0.171     0.7193 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM11901     3   0.171     0.7193 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM11715     2   0.181     0.4725 0.020 0.920 0.060 0.000 0.000 0.000
#> GSM11724     2   0.181     0.4725 0.020 0.920 0.060 0.000 0.000 0.000
#> GSM11684     3   0.451     0.5627 0.036 0.236 0.704 0.020 0.004 0.000
#> GSM11696     3   0.451     0.5627 0.036 0.236 0.704 0.020 0.004 0.000
#> GSM27952     1   0.216     0.7073 0.904 0.000 0.012 0.000 0.012 0.072
#> GSM27948     3   0.451     0.5627 0.036 0.236 0.704 0.020 0.004 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-hclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-hclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-hclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-hclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-hclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-hclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-hclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>            n cell.line(p) agent(p)  time(p) k
#> SD:hclust 74     0.000178    0.844 6.00e-01 2
#> SD:hclust 66     0.000335    0.616 6.12e-04 3
#> SD:hclust 70     0.001431    0.275 2.41e-07 4
#> SD:hclust 69     0.001444    0.279 8.69e-09 5
#> SD:hclust 60     0.025299    0.296 1.56e-09 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


SD:kmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "kmeans"]
# you can also extract it by
# res = res_list["SD:kmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-kmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.565           0.787       0.903         0.4518 0.533   0.533
#> 3 3 0.438           0.773       0.842         0.3430 0.703   0.512
#> 4 4 0.561           0.744       0.805         0.1396 0.914   0.787
#> 5 5 0.570           0.561       0.736         0.0828 0.940   0.826
#> 6 6 0.619           0.458       0.688         0.0534 0.963   0.878

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     2   0.000    0.87155 0.000 1.000
#> GSM11735     2   0.000    0.87155 0.000 1.000
#> GSM11733     2   0.000    0.87155 0.000 1.000
#> GSM11863     2   0.204    0.85876 0.032 0.968
#> GSM11710     2   0.000    0.87155 0.000 1.000
#> GSM11712     1   0.141    0.89848 0.980 0.020
#> GSM11732     1   1.000    0.00580 0.500 0.500
#> GSM11844     2   1.000   -0.02038 0.492 0.508
#> GSM11842     2   0.204    0.85876 0.032 0.968
#> GSM11860     2   0.204    0.85876 0.032 0.968
#> GSM11686     2   0.494    0.80262 0.108 0.892
#> GSM11688     2   0.000    0.87155 0.000 1.000
#> GSM11846     2   0.000    0.87155 0.000 1.000
#> GSM11680     1   0.995    0.17519 0.540 0.460
#> GSM11698     2   1.000   -0.00372 0.488 0.512
#> GSM11840     2   0.000    0.87155 0.000 1.000
#> GSM11847     2   0.000    0.87155 0.000 1.000
#> GSM11685     2   0.000    0.87155 0.000 1.000
#> GSM11699     1   0.634    0.80032 0.840 0.160
#> GSM27950     2   0.000    0.87155 0.000 1.000
#> GSM27946     1   0.615    0.80752 0.848 0.152
#> GSM11709     2   0.958    0.40451 0.380 0.620
#> GSM11720     1   0.141    0.89848 0.980 0.020
#> GSM11726     1   0.000    0.89521 1.000 0.000
#> GSM11837     1   0.000    0.89521 1.000 0.000
#> GSM11725     1   0.000    0.89521 1.000 0.000
#> GSM11864     1   0.141    0.89848 0.980 0.020
#> GSM11687     1   0.141    0.89848 0.980 0.020
#> GSM11693     1   0.141    0.89848 0.980 0.020
#> GSM11727     1   0.000    0.89521 1.000 0.000
#> GSM11838     1   0.000    0.89521 1.000 0.000
#> GSM11681     2   0.000    0.87155 0.000 1.000
#> GSM11689     1   0.141    0.89848 0.980 0.020
#> GSM11704     1   0.141    0.89848 0.980 0.020
#> GSM11703     1   0.141    0.89848 0.980 0.020
#> GSM11705     2   0.969    0.36314 0.396 0.604
#> GSM11722     1   0.000    0.89521 1.000 0.000
#> GSM11730     1   0.000    0.89521 1.000 0.000
#> GSM11713     2   0.373    0.83427 0.072 0.928
#> GSM11728     2   0.932    0.47772 0.348 0.652
#> GSM27947     1   0.141    0.89848 0.980 0.020
#> GSM27951     2   0.966    0.37391 0.392 0.608
#> GSM11707     2   0.000    0.87155 0.000 1.000
#> GSM11716     1   0.141    0.89848 0.980 0.020
#> GSM11850     1   0.861    0.64387 0.716 0.284
#> GSM11851     1   0.881    0.61626 0.700 0.300
#> GSM11721     1   0.118    0.89799 0.984 0.016
#> GSM11852     1   0.866    0.63648 0.712 0.288
#> GSM11694     1   0.855    0.65033 0.720 0.280
#> GSM11695     1   0.876    0.62398 0.704 0.296
#> GSM11734     1   0.000    0.89521 1.000 0.000
#> GSM11861     1   0.634    0.79984 0.840 0.160
#> GSM11843     1   0.141    0.89848 0.980 0.020
#> GSM11862     1   0.615    0.80752 0.848 0.152
#> GSM11697     1   0.855    0.65033 0.720 0.280
#> GSM11714     2   0.000    0.87155 0.000 1.000
#> GSM11723     1   0.000    0.89521 1.000 0.000
#> GSM11845     1   0.141    0.89848 0.980 0.020
#> GSM11683     2   0.000    0.87155 0.000 1.000
#> GSM11691     1   0.615    0.80752 0.848 0.152
#> GSM27949     2   0.706    0.71877 0.192 0.808
#> GSM27945     1   0.615    0.80752 0.848 0.152
#> GSM11706     2   0.000    0.87155 0.000 1.000
#> GSM11853     1   0.861    0.64323 0.716 0.284
#> GSM11729     1   0.000    0.89521 1.000 0.000
#> GSM11746     1   0.000    0.89521 1.000 0.000
#> GSM11711     2   0.706    0.71891 0.192 0.808
#> GSM11854     1   0.871    0.62995 0.708 0.292
#> GSM11731     1   0.000    0.89521 1.000 0.000
#> GSM11839     1   0.000    0.89521 1.000 0.000
#> GSM11836     1   0.204    0.87591 0.968 0.032
#> GSM11849     1   0.000    0.89521 1.000 0.000
#> GSM11682     2   0.000    0.87155 0.000 1.000
#> GSM11690     1   0.141    0.89848 0.980 0.020
#> GSM11692     1   0.141    0.89848 0.980 0.020
#> GSM11841     1   0.141    0.89848 0.980 0.020
#> GSM11901     1   0.141    0.89848 0.980 0.020
#> GSM11715     1   0.000    0.89521 1.000 0.000
#> GSM11724     1   0.000    0.89521 1.000 0.000
#> GSM11684     1   0.000    0.89521 1.000 0.000
#> GSM11696     1   0.000    0.89521 1.000 0.000
#> GSM27952     2   0.000    0.87155 0.000 1.000
#> GSM27948     1   0.141    0.89848 0.980 0.020

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3   0.348      0.815 0.000 0.128 0.872
#> GSM11735     3   0.397      0.813 0.008 0.132 0.860
#> GSM11733     3   0.514      0.810 0.044 0.132 0.824
#> GSM11863     3   0.666      0.778 0.116 0.132 0.752
#> GSM11710     3   0.140      0.851 0.028 0.004 0.968
#> GSM11712     1   0.334      0.800 0.880 0.120 0.000
#> GSM11732     1   0.399      0.783 0.864 0.012 0.124
#> GSM11844     1   0.350      0.784 0.880 0.004 0.116
#> GSM11842     3   0.666      0.778 0.116 0.132 0.752
#> GSM11860     3   0.673      0.776 0.120 0.132 0.748
#> GSM11686     3   0.460      0.732 0.204 0.000 0.796
#> GSM11688     3   0.196      0.851 0.056 0.000 0.944
#> GSM11846     3   0.388      0.811 0.152 0.000 0.848
#> GSM11680     1   0.319      0.794 0.896 0.004 0.100
#> GSM11698     1   0.392      0.763 0.856 0.004 0.140
#> GSM11840     3   0.514      0.810 0.044 0.132 0.824
#> GSM11847     3   0.514      0.810 0.044 0.132 0.824
#> GSM11685     3   0.207      0.850 0.060 0.000 0.940
#> GSM11699     1   0.134      0.832 0.972 0.016 0.012
#> GSM27950     3   0.186      0.851 0.052 0.000 0.948
#> GSM27946     1   0.148      0.833 0.968 0.020 0.012
#> GSM11709     1   0.765      0.526 0.644 0.080 0.276
#> GSM11720     1   0.455      0.754 0.800 0.200 0.000
#> GSM11726     2   0.412      0.918 0.168 0.832 0.000
#> GSM11837     2   0.406      0.920 0.164 0.836 0.000
#> GSM11725     1   0.573      0.546 0.676 0.324 0.000
#> GSM11864     1   0.475      0.736 0.784 0.216 0.000
#> GSM11687     1   0.355      0.797 0.868 0.132 0.000
#> GSM11693     1   0.412      0.778 0.832 0.168 0.000
#> GSM11727     2   0.375      0.920 0.144 0.856 0.000
#> GSM11838     2   0.369      0.921 0.140 0.860 0.000
#> GSM11681     3   0.254      0.845 0.080 0.000 0.920
#> GSM11689     1   0.418      0.775 0.828 0.172 0.000
#> GSM11704     1   0.418      0.775 0.828 0.172 0.000
#> GSM11703     1   0.400      0.785 0.840 0.160 0.000
#> GSM11705     1   0.774      0.486 0.632 0.080 0.288
#> GSM11722     2   0.394      0.922 0.156 0.844 0.000
#> GSM11730     2   0.369      0.920 0.140 0.860 0.000
#> GSM11713     3   0.849      0.321 0.096 0.384 0.520
#> GSM11728     3   0.967      0.133 0.216 0.360 0.424
#> GSM27947     1   0.228      0.829 0.940 0.052 0.008
#> GSM27951     1   0.802      0.448 0.604 0.088 0.308
#> GSM11707     3   0.127      0.851 0.024 0.004 0.972
#> GSM11716     1   0.295      0.820 0.908 0.088 0.004
#> GSM11850     1   0.203      0.829 0.952 0.016 0.032
#> GSM11851     1   0.176      0.826 0.956 0.004 0.040
#> GSM11721     1   0.319      0.813 0.896 0.100 0.004
#> GSM11852     1   0.164      0.831 0.964 0.016 0.020
#> GSM11694     1   0.200      0.828 0.952 0.012 0.036
#> GSM11695     1   0.200      0.828 0.952 0.012 0.036
#> GSM11734     2   0.588      0.673 0.348 0.652 0.000
#> GSM11861     1   0.148      0.831 0.968 0.020 0.012
#> GSM11843     1   0.394      0.776 0.844 0.156 0.000
#> GSM11862     1   0.127      0.831 0.972 0.024 0.004
#> GSM11697     1   0.175      0.830 0.960 0.012 0.028
#> GSM11714     3   0.127      0.851 0.024 0.004 0.972
#> GSM11723     1   0.445      0.727 0.808 0.192 0.000
#> GSM11845     1   0.341      0.798 0.876 0.124 0.000
#> GSM11683     3   0.424      0.770 0.176 0.000 0.824
#> GSM11691     1   0.134      0.832 0.972 0.012 0.016
#> GSM27949     1   0.575      0.556 0.700 0.004 0.296
#> GSM27945     1   0.148      0.831 0.968 0.012 0.020
#> GSM11706     3   0.127      0.851 0.024 0.004 0.972
#> GSM11853     1   0.127      0.831 0.972 0.004 0.024
#> GSM11729     2   0.424      0.921 0.176 0.824 0.000
#> GSM11746     2   0.424      0.921 0.176 0.824 0.000
#> GSM11711     1   0.595      0.428 0.640 0.000 0.360
#> GSM11854     1   0.127      0.830 0.972 0.004 0.024
#> GSM11731     2   0.450      0.908 0.196 0.804 0.000
#> GSM11839     2   0.450      0.906 0.196 0.804 0.000
#> GSM11836     2   0.506      0.889 0.148 0.820 0.032
#> GSM11849     2   0.557      0.861 0.184 0.784 0.032
#> GSM11682     3   0.277      0.843 0.080 0.004 0.916
#> GSM11690     1   0.400      0.804 0.868 0.116 0.016
#> GSM11692     1   0.341      0.803 0.876 0.124 0.000
#> GSM11841     1   0.355      0.798 0.868 0.132 0.000
#> GSM11901     1   0.355      0.798 0.868 0.132 0.000
#> GSM11715     2   0.388      0.921 0.152 0.848 0.000
#> GSM11724     2   0.388      0.921 0.152 0.848 0.000
#> GSM11684     2   0.678      0.547 0.396 0.588 0.016
#> GSM11696     1   0.631     -0.224 0.512 0.488 0.000
#> GSM27952     3   0.207      0.850 0.060 0.000 0.940
#> GSM27948     1   0.304      0.809 0.896 0.104 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     4  0.2546     0.8167 0.092 0.008 0.000 0.900
#> GSM11735     4  0.1970     0.8618 0.060 0.008 0.000 0.932
#> GSM11733     4  0.1004     0.9274 0.004 0.000 0.024 0.972
#> GSM11863     4  0.1661     0.9114 0.000 0.004 0.052 0.944
#> GSM11710     1  0.5592     0.7470 0.608 0.008 0.016 0.368
#> GSM11712     3  0.4521     0.7931 0.056 0.092 0.828 0.024
#> GSM11732     3  0.3658     0.8078 0.068 0.004 0.864 0.064
#> GSM11844     3  0.2739     0.8171 0.036 0.000 0.904 0.060
#> GSM11842     4  0.1847     0.9079 0.004 0.004 0.052 0.940
#> GSM11860     4  0.2164     0.8875 0.004 0.004 0.068 0.924
#> GSM11686     1  0.6188     0.7609 0.636 0.004 0.072 0.288
#> GSM11688     1  0.5717     0.7637 0.608 0.004 0.028 0.360
#> GSM11846     1  0.6733     0.6858 0.564 0.000 0.112 0.324
#> GSM11680     3  0.2924     0.8186 0.036 0.004 0.900 0.060
#> GSM11698     3  0.3016     0.8174 0.040 0.004 0.896 0.060
#> GSM11840     4  0.1004     0.9274 0.004 0.000 0.024 0.972
#> GSM11847     4  0.1004     0.9274 0.004 0.000 0.024 0.972
#> GSM11685     1  0.5717     0.7637 0.608 0.004 0.028 0.360
#> GSM11699     3  0.1509     0.8245 0.012 0.008 0.960 0.020
#> GSM27950     1  0.5717     0.7637 0.608 0.004 0.028 0.360
#> GSM27946     3  0.1745     0.8253 0.020 0.008 0.952 0.020
#> GSM11709     3  0.6902     0.0337 0.428 0.048 0.496 0.028
#> GSM11720     3  0.4957     0.7482 0.060 0.164 0.772 0.004
#> GSM11726     2  0.3928     0.7918 0.088 0.848 0.060 0.004
#> GSM11837     2  0.3077     0.8031 0.068 0.892 0.036 0.004
#> GSM11725     3  0.6329     0.4912 0.064 0.344 0.588 0.004
#> GSM11864     3  0.5467     0.7148 0.056 0.224 0.716 0.004
#> GSM11687     3  0.4296     0.7735 0.060 0.112 0.824 0.004
#> GSM11693     3  0.4371     0.7741 0.064 0.112 0.820 0.004
#> GSM11727     2  0.3625     0.8037 0.120 0.852 0.024 0.004
#> GSM11838     2  0.3264     0.8069 0.096 0.876 0.024 0.004
#> GSM11681     1  0.5873     0.7607 0.660 0.004 0.056 0.280
#> GSM11689     3  0.4651     0.7713 0.080 0.112 0.804 0.004
#> GSM11704     3  0.4707     0.7703 0.080 0.116 0.800 0.004
#> GSM11703     3  0.3862     0.7904 0.060 0.084 0.852 0.004
#> GSM11705     1  0.6167     0.3373 0.568 0.016 0.388 0.028
#> GSM11722     2  0.4452     0.8147 0.156 0.796 0.048 0.000
#> GSM11730     2  0.4186     0.7992 0.164 0.808 0.024 0.004
#> GSM11713     1  0.5292     0.5337 0.776 0.140 0.028 0.056
#> GSM11728     1  0.5579     0.5373 0.768 0.100 0.100 0.032
#> GSM27947     3  0.1631     0.8277 0.020 0.016 0.956 0.008
#> GSM27951     1  0.5527     0.5045 0.700 0.020 0.256 0.024
#> GSM11707     1  0.5592     0.7470 0.608 0.008 0.016 0.368
#> GSM11716     3  0.5357     0.7813 0.108 0.068 0.784 0.040
#> GSM11850     3  0.4260     0.7939 0.116 0.008 0.828 0.048
#> GSM11851     3  0.4277     0.7957 0.116 0.004 0.824 0.056
#> GSM11721     3  0.4890     0.7822 0.084 0.084 0.808 0.024
#> GSM11852     3  0.2484     0.8219 0.040 0.012 0.924 0.024
#> GSM11694     3  0.2500     0.8192 0.044 0.000 0.916 0.040
#> GSM11695     3  0.2500     0.8192 0.044 0.000 0.916 0.040
#> GSM11734     2  0.6558     0.5907 0.132 0.664 0.192 0.012
#> GSM11861     3  0.4213     0.8030 0.136 0.012 0.824 0.028
#> GSM11843     3  0.5858     0.7385 0.088 0.180 0.720 0.012
#> GSM11862     3  0.3657     0.8133 0.096 0.016 0.864 0.024
#> GSM11697     3  0.2500     0.8192 0.044 0.000 0.916 0.040
#> GSM11714     1  0.5592     0.7470 0.608 0.008 0.016 0.368
#> GSM11723     3  0.6997     0.6518 0.156 0.200 0.628 0.016
#> GSM11845     3  0.6269     0.7430 0.156 0.112 0.708 0.024
#> GSM11683     1  0.6644     0.7230 0.624 0.004 0.124 0.248
#> GSM11691     3  0.0895     0.8284 0.020 0.004 0.976 0.000
#> GSM27949     3  0.4867     0.7313 0.144 0.004 0.784 0.068
#> GSM27945     3  0.2089     0.8234 0.048 0.000 0.932 0.020
#> GSM11706     1  0.5592     0.7470 0.608 0.008 0.016 0.368
#> GSM11853     3  0.1174     0.8255 0.020 0.000 0.968 0.012
#> GSM11729     2  0.1953     0.8145 0.012 0.940 0.044 0.004
#> GSM11746     2  0.1953     0.8145 0.012 0.940 0.044 0.004
#> GSM11711     3  0.6233     0.0980 0.388 0.000 0.552 0.060
#> GSM11854     3  0.1745     0.8249 0.020 0.008 0.952 0.020
#> GSM11731     2  0.2996     0.7988 0.064 0.892 0.044 0.000
#> GSM11839     2  0.3876     0.7890 0.068 0.856 0.068 0.008
#> GSM11836     2  0.5449     0.7803 0.132 0.768 0.076 0.024
#> GSM11849     2  0.6132     0.7436 0.168 0.712 0.100 0.020
#> GSM11682     1  0.5751     0.7579 0.664 0.004 0.048 0.284
#> GSM11690     3  0.6552     0.6565 0.164 0.120 0.688 0.028
#> GSM11692     3  0.4939     0.7740 0.060 0.108 0.804 0.028
#> GSM11841     3  0.4996     0.7734 0.060 0.112 0.800 0.028
#> GSM11901     3  0.4996     0.7734 0.060 0.112 0.800 0.028
#> GSM11715     2  0.3491     0.8136 0.104 0.864 0.028 0.004
#> GSM11724     2  0.3491     0.8136 0.104 0.864 0.028 0.004
#> GSM11684     2  0.7952     0.5018 0.192 0.496 0.292 0.020
#> GSM11696     2  0.8076     0.2426 0.180 0.412 0.388 0.020
#> GSM27952     1  0.5701     0.7646 0.612 0.004 0.028 0.356
#> GSM27948     3  0.5541     0.7450 0.108 0.096 0.768 0.028

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     5  0.4886     0.7001 0.032 0.000 0.000 0.372 0.596
#> GSM11735     5  0.4723     0.8337 0.032 0.000 0.008 0.272 0.688
#> GSM11733     5  0.4096     0.9156 0.000 0.000 0.040 0.200 0.760
#> GSM11863     5  0.4453     0.9076 0.008 0.000 0.064 0.164 0.764
#> GSM11710     4  0.1444     0.8069 0.040 0.000 0.000 0.948 0.012
#> GSM11712     3  0.5152     0.4594 0.272 0.016 0.672 0.004 0.036
#> GSM11732     3  0.3481     0.6231 0.100 0.000 0.840 0.004 0.056
#> GSM11844     3  0.2747     0.6484 0.060 0.000 0.888 0.004 0.048
#> GSM11842     5  0.4453     0.9076 0.008 0.000 0.064 0.164 0.764
#> GSM11860     5  0.4436     0.8997 0.008 0.000 0.068 0.156 0.768
#> GSM11686     4  0.2395     0.8070 0.036 0.000 0.040 0.912 0.012
#> GSM11688     4  0.0000     0.8204 0.000 0.000 0.000 1.000 0.000
#> GSM11846     4  0.3599     0.6743 0.016 0.000 0.140 0.824 0.020
#> GSM11680     3  0.2278     0.6537 0.032 0.000 0.916 0.008 0.044
#> GSM11698     3  0.2515     0.6523 0.044 0.000 0.904 0.008 0.044
#> GSM11840     5  0.4096     0.9180 0.000 0.000 0.040 0.200 0.760
#> GSM11847     5  0.4096     0.9180 0.000 0.000 0.040 0.200 0.760
#> GSM11685     4  0.0000     0.8204 0.000 0.000 0.000 1.000 0.000
#> GSM11699     3  0.2756     0.6405 0.092 0.000 0.880 0.004 0.024
#> GSM27950     4  0.0981     0.8170 0.012 0.000 0.008 0.972 0.008
#> GSM27946     3  0.2784     0.6341 0.108 0.000 0.872 0.004 0.016
#> GSM11709     3  0.7817     0.3289 0.092 0.068 0.544 0.224 0.072
#> GSM11720     3  0.6019     0.5344 0.116 0.112 0.684 0.000 0.088
#> GSM11726     2  0.1278     0.6910 0.020 0.960 0.016 0.000 0.004
#> GSM11837     2  0.0566     0.7045 0.012 0.984 0.004 0.000 0.000
#> GSM11725     3  0.7698     0.0937 0.208 0.276 0.440 0.000 0.076
#> GSM11864     3  0.6914     0.4015 0.188 0.160 0.580 0.000 0.072
#> GSM11687     3  0.5681     0.5518 0.112 0.088 0.724 0.008 0.068
#> GSM11693     3  0.5816     0.5511 0.124 0.088 0.712 0.008 0.068
#> GSM11727     2  0.0771     0.7048 0.020 0.976 0.000 0.000 0.004
#> GSM11838     2  0.0162     0.7086 0.004 0.996 0.000 0.000 0.000
#> GSM11681     4  0.2930     0.7992 0.032 0.000 0.032 0.888 0.048
#> GSM11689     3  0.5982     0.5390 0.140 0.088 0.696 0.008 0.068
#> GSM11704     3  0.5982     0.5390 0.140 0.088 0.696 0.008 0.068
#> GSM11703     3  0.5449     0.5689 0.116 0.068 0.740 0.008 0.068
#> GSM11705     3  0.8150     0.1832 0.136 0.048 0.468 0.280 0.068
#> GSM11722     2  0.5386     0.5683 0.256 0.668 0.036 0.000 0.040
#> GSM11730     2  0.2873     0.6442 0.120 0.860 0.000 0.000 0.020
#> GSM11713     4  0.6847     0.5525 0.220 0.136 0.004 0.584 0.056
#> GSM11728     4  0.7688     0.5074 0.228 0.108 0.056 0.548 0.060
#> GSM27947     3  0.2589     0.6435 0.076 0.004 0.896 0.004 0.020
#> GSM27951     4  0.7312     0.4985 0.148 0.020 0.168 0.584 0.080
#> GSM11707     4  0.1522     0.8069 0.044 0.000 0.000 0.944 0.012
#> GSM11716     3  0.5038     0.5154 0.220 0.008 0.700 0.000 0.072
#> GSM11850     3  0.4742     0.5282 0.220 0.000 0.716 0.004 0.060
#> GSM11851     3  0.4679     0.5378 0.220 0.000 0.720 0.004 0.056
#> GSM11721     3  0.5582     0.3313 0.356 0.004 0.576 0.004 0.060
#> GSM11852     3  0.4070     0.5956 0.164 0.000 0.784 0.004 0.048
#> GSM11694     3  0.2609     0.6485 0.048 0.000 0.896 0.004 0.052
#> GSM11695     3  0.2609     0.6485 0.048 0.000 0.896 0.004 0.052
#> GSM11734     1  0.6350    -0.1557 0.536 0.352 0.044 0.000 0.068
#> GSM11861     3  0.5376     0.4425 0.356 0.000 0.584 0.004 0.056
#> GSM11843     3  0.6806     0.3337 0.296 0.084 0.544 0.000 0.076
#> GSM11862     3  0.4842     0.5200 0.264 0.000 0.684 0.004 0.048
#> GSM11697     3  0.2390     0.6510 0.044 0.000 0.908 0.004 0.044
#> GSM11714     4  0.1626     0.8076 0.044 0.000 0.000 0.940 0.016
#> GSM11723     1  0.7179    -0.1873 0.416 0.104 0.408 0.000 0.072
#> GSM11845     3  0.6016     0.3237 0.392 0.020 0.520 0.000 0.068
#> GSM11683     4  0.2407     0.7806 0.004 0.000 0.088 0.896 0.012
#> GSM11691     3  0.2227     0.6607 0.048 0.000 0.916 0.004 0.032
#> GSM27949     3  0.3683     0.6305 0.048 0.000 0.848 0.056 0.048
#> GSM27945     3  0.2378     0.6505 0.048 0.000 0.904 0.000 0.048
#> GSM11706     4  0.1522     0.8069 0.044 0.000 0.000 0.944 0.012
#> GSM11853     3  0.1996     0.6549 0.036 0.000 0.928 0.004 0.032
#> GSM11729     2  0.4151     0.6861 0.156 0.788 0.012 0.000 0.044
#> GSM11746     2  0.4151     0.6861 0.156 0.788 0.012 0.000 0.044
#> GSM11711     3  0.4809     0.4995 0.024 0.000 0.724 0.216 0.036
#> GSM11854     3  0.2569     0.6457 0.068 0.000 0.896 0.004 0.032
#> GSM11731     2  0.5629     0.4061 0.388 0.544 0.008 0.000 0.060
#> GSM11839     2  0.5921     0.3044 0.420 0.504 0.024 0.000 0.052
#> GSM11836     1  0.6080    -0.3192 0.476 0.440 0.032 0.000 0.052
#> GSM11849     1  0.7205    -0.2751 0.432 0.420 0.052 0.024 0.072
#> GSM11682     4  0.2095     0.8061 0.060 0.000 0.008 0.920 0.012
#> GSM11690     1  0.6401     0.2619 0.532 0.020 0.372 0.040 0.036
#> GSM11692     3  0.5261     0.4002 0.308 0.016 0.640 0.004 0.032
#> GSM11841     3  0.5485     0.3658 0.320 0.024 0.620 0.004 0.032
#> GSM11901     3  0.5485     0.3658 0.320 0.024 0.620 0.004 0.032
#> GSM11715     2  0.5481     0.5580 0.324 0.608 0.012 0.000 0.056
#> GSM11724     2  0.5481     0.5580 0.324 0.608 0.012 0.000 0.056
#> GSM11684     1  0.7093     0.4454 0.568 0.076 0.268 0.032 0.056
#> GSM11696     1  0.6881     0.4433 0.560 0.068 0.296 0.020 0.056
#> GSM27952     4  0.0162     0.8201 0.004 0.000 0.000 0.996 0.000
#> GSM27948     3  0.5798     0.0264 0.436 0.012 0.504 0.012 0.036

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     5  0.6208    0.50732 0.160 0.000 0.000 0.052 0.556 0.232
#> GSM11735     5  0.4844    0.74215 0.156 0.000 0.000 0.048 0.720 0.076
#> GSM11733     5  0.1398    0.90182 0.000 0.000 0.008 0.000 0.940 0.052
#> GSM11863     5  0.1511    0.89913 0.004 0.000 0.012 0.000 0.940 0.044
#> GSM11710     6  0.4393    0.69254 0.164 0.000 0.000 0.052 0.036 0.748
#> GSM11712     3  0.6341    0.26892 0.128 0.016 0.512 0.316 0.028 0.000
#> GSM11732     3  0.2904    0.43979 0.108 0.004 0.860 0.004 0.012 0.012
#> GSM11844     3  0.2178    0.49742 0.056 0.000 0.912 0.008 0.012 0.012
#> GSM11842     5  0.1624    0.89875 0.008 0.000 0.012 0.000 0.936 0.044
#> GSM11860     5  0.1624    0.89875 0.008 0.000 0.012 0.000 0.936 0.044
#> GSM11686     6  0.1483    0.77994 0.008 0.000 0.012 0.036 0.000 0.944
#> GSM11688     6  0.0508    0.78111 0.000 0.000 0.004 0.000 0.012 0.984
#> GSM11846     6  0.4202    0.62655 0.040 0.000 0.160 0.008 0.024 0.768
#> GSM11680     3  0.2127    0.52062 0.032 0.000 0.920 0.016 0.008 0.024
#> GSM11698     3  0.2618    0.51212 0.036 0.000 0.896 0.036 0.012 0.020
#> GSM11840     5  0.1398    0.90182 0.000 0.000 0.008 0.000 0.940 0.052
#> GSM11847     5  0.1398    0.90182 0.000 0.000 0.008 0.000 0.940 0.052
#> GSM11685     6  0.0508    0.78111 0.000 0.000 0.004 0.000 0.012 0.984
#> GSM11699     3  0.3551    0.52877 0.024 0.000 0.808 0.148 0.012 0.008
#> GSM27950     6  0.1109    0.77770 0.004 0.000 0.004 0.012 0.016 0.964
#> GSM27946     3  0.3875    0.52864 0.052 0.000 0.796 0.132 0.012 0.008
#> GSM11709     3  0.7132    0.34678 0.236 0.076 0.528 0.080 0.000 0.080
#> GSM11720     3  0.6194    0.40433 0.264 0.100 0.564 0.068 0.000 0.004
#> GSM11726     2  0.1363    0.64042 0.028 0.952 0.012 0.004 0.004 0.000
#> GSM11837     2  0.0405    0.64929 0.008 0.988 0.004 0.000 0.000 0.000
#> GSM11725     3  0.7191    0.05679 0.316 0.224 0.388 0.060 0.012 0.000
#> GSM11864     3  0.6905    0.25223 0.308 0.148 0.460 0.076 0.008 0.000
#> GSM11687     3  0.6055    0.43866 0.232 0.076 0.596 0.092 0.000 0.004
#> GSM11693     3  0.6260    0.43146 0.240 0.080 0.572 0.104 0.000 0.004
#> GSM11727     2  0.1693    0.64105 0.020 0.932 0.000 0.044 0.004 0.000
#> GSM11838     2  0.0937    0.64736 0.000 0.960 0.000 0.040 0.000 0.000
#> GSM11681     6  0.1832    0.77483 0.032 0.000 0.008 0.032 0.000 0.928
#> GSM11689     3  0.6334    0.42783 0.240 0.080 0.564 0.112 0.000 0.004
#> GSM11704     3  0.6353    0.42485 0.244 0.080 0.560 0.112 0.000 0.004
#> GSM11703     3  0.6167    0.44070 0.232 0.072 0.584 0.108 0.000 0.004
#> GSM11705     3  0.7797    0.26737 0.220 0.044 0.456 0.144 0.004 0.132
#> GSM11722     2  0.6271    0.28799 0.132 0.488 0.020 0.348 0.008 0.004
#> GSM11730     2  0.3485    0.50475 0.020 0.772 0.000 0.204 0.004 0.000
#> GSM11713     6  0.6257    0.30118 0.064 0.068 0.000 0.400 0.008 0.460
#> GSM11728     6  0.6787    0.23189 0.064 0.068 0.024 0.412 0.008 0.424
#> GSM27947     3  0.3697    0.53387 0.068 0.004 0.812 0.104 0.012 0.000
#> GSM27951     6  0.6569    0.45193 0.180 0.008 0.064 0.180 0.004 0.564
#> GSM11707     6  0.4518    0.68758 0.172 0.000 0.000 0.056 0.036 0.736
#> GSM11716     3  0.4696   -0.03163 0.332 0.024 0.620 0.000 0.024 0.000
#> GSM11850     3  0.4682    0.04083 0.312 0.004 0.644 0.012 0.020 0.008
#> GSM11851     3  0.4698    0.03515 0.316 0.004 0.640 0.012 0.020 0.008
#> GSM11721     3  0.6868    0.11661 0.156 0.004 0.432 0.356 0.032 0.020
#> GSM11852     3  0.5294    0.43768 0.072 0.000 0.676 0.208 0.024 0.020
#> GSM11694     3  0.1820    0.49760 0.056 0.000 0.924 0.000 0.012 0.008
#> GSM11695     3  0.1820    0.49760 0.056 0.000 0.924 0.000 0.012 0.008
#> GSM11734     1  0.6745   -0.00969 0.480 0.268 0.024 0.204 0.024 0.000
#> GSM11861     3  0.6699   -0.20829 0.376 0.000 0.420 0.156 0.028 0.020
#> GSM11843     3  0.7536   -0.05267 0.280 0.080 0.416 0.192 0.032 0.000
#> GSM11862     3  0.6316    0.28352 0.160 0.000 0.564 0.228 0.028 0.020
#> GSM11697     3  0.1555    0.51007 0.040 0.000 0.940 0.000 0.012 0.008
#> GSM11714     6  0.4481    0.68836 0.176 0.000 0.000 0.056 0.032 0.736
#> GSM11723     1  0.6692    0.55295 0.464 0.068 0.360 0.088 0.020 0.000
#> GSM11845     1  0.6411    0.44748 0.436 0.052 0.416 0.080 0.016 0.000
#> GSM11683     6  0.1514    0.77495 0.012 0.000 0.036 0.004 0.004 0.944
#> GSM11691     3  0.1672    0.52391 0.028 0.000 0.940 0.016 0.004 0.012
#> GSM27949     3  0.2635    0.48589 0.048 0.000 0.888 0.004 0.012 0.048
#> GSM27945     3  0.1787    0.50665 0.068 0.000 0.920 0.000 0.008 0.004
#> GSM11706     6  0.4518    0.68758 0.172 0.000 0.000 0.056 0.036 0.736
#> GSM11853     3  0.3508    0.53704 0.048 0.000 0.832 0.096 0.016 0.008
#> GSM11729     2  0.4520    0.57348 0.132 0.728 0.004 0.132 0.004 0.000
#> GSM11746     2  0.4520    0.57348 0.132 0.728 0.004 0.132 0.004 0.000
#> GSM11711     3  0.4439    0.48868 0.052 0.000 0.776 0.040 0.016 0.116
#> GSM11854     3  0.3682    0.53267 0.044 0.000 0.820 0.108 0.016 0.012
#> GSM11731     2  0.6721    0.24525 0.200 0.440 0.020 0.320 0.020 0.000
#> GSM11839     2  0.6897    0.09145 0.200 0.376 0.028 0.376 0.020 0.000
#> GSM11836     4  0.5105    0.27048 0.080 0.224 0.004 0.672 0.016 0.004
#> GSM11849     4  0.5266    0.33199 0.052 0.212 0.024 0.684 0.004 0.024
#> GSM11682     6  0.1615    0.77338 0.004 0.000 0.004 0.064 0.000 0.928
#> GSM11690     4  0.4814    0.44139 0.032 0.000 0.164 0.732 0.016 0.056
#> GSM11692     3  0.6126    0.22438 0.112 0.012 0.476 0.380 0.020 0.000
#> GSM11841     3  0.6292    0.20427 0.124 0.016 0.464 0.376 0.020 0.000
#> GSM11901     3  0.6292    0.20427 0.124 0.016 0.464 0.376 0.020 0.000
#> GSM11715     4  0.5261   -0.19266 0.096 0.444 0.000 0.460 0.000 0.000
#> GSM11724     4  0.5261   -0.19266 0.096 0.444 0.000 0.460 0.000 0.000
#> GSM11684     4  0.3656    0.52927 0.004 0.024 0.112 0.824 0.008 0.028
#> GSM11696     4  0.3696    0.52732 0.008 0.024 0.120 0.820 0.008 0.020
#> GSM27952     6  0.0653    0.78232 0.000 0.000 0.004 0.012 0.004 0.980
#> GSM27948     4  0.5614    0.08413 0.056 0.004 0.344 0.564 0.016 0.016

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-kmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-kmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-kmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-kmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-kmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-kmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-kmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>            n cell.line(p) agent(p)  time(p) k
#> SD:kmeans 75     9.77e-06    0.882 6.70e-01 2
#> SD:kmeans 77     1.61e-06    0.808 3.80e-05 3
#> SD:kmeans 78     1.87e-06    0.664 9.13e-08 4
#> SD:kmeans 59     4.35e-05    0.728 9.71e-09 5
#> SD:kmeans 41     3.19e-04    0.191 3.53e-05 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


SD:skmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "skmeans"]
# you can also extract it by
# res = res_list["SD:skmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-skmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-skmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.613           0.814       0.927         0.4980 0.496   0.496
#> 3 3 0.603           0.795       0.863         0.3342 0.702   0.476
#> 4 4 0.577           0.459       0.709         0.1164 0.760   0.435
#> 5 5 0.641           0.585       0.750         0.0715 0.896   0.639
#> 6 6 0.704           0.705       0.803         0.0441 0.924   0.661

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1  0.0000      0.884 1.000 0.000
#> GSM11735     1  0.0000      0.884 1.000 0.000
#> GSM11733     1  0.0000      0.884 1.000 0.000
#> GSM11863     1  0.0000      0.884 1.000 0.000
#> GSM11710     1  0.0000      0.884 1.000 0.000
#> GSM11712     2  0.0000      0.939 0.000 1.000
#> GSM11732     1  0.0376      0.882 0.996 0.004
#> GSM11844     1  0.0000      0.884 1.000 0.000
#> GSM11842     1  0.0000      0.884 1.000 0.000
#> GSM11860     1  0.0000      0.884 1.000 0.000
#> GSM11686     1  0.0000      0.884 1.000 0.000
#> GSM11688     1  0.0000      0.884 1.000 0.000
#> GSM11846     1  0.0000      0.884 1.000 0.000
#> GSM11680     1  0.7883      0.658 0.764 0.236
#> GSM11698     1  0.0000      0.884 1.000 0.000
#> GSM11840     1  0.0000      0.884 1.000 0.000
#> GSM11847     1  0.0000      0.884 1.000 0.000
#> GSM11685     1  0.0000      0.884 1.000 0.000
#> GSM11699     2  0.7528      0.695 0.216 0.784
#> GSM27950     1  0.0000      0.884 1.000 0.000
#> GSM27946     2  0.4939      0.839 0.108 0.892
#> GSM11709     1  0.4939      0.808 0.892 0.108
#> GSM11720     2  0.0000      0.939 0.000 1.000
#> GSM11726     2  0.0000      0.939 0.000 1.000
#> GSM11837     2  0.0000      0.939 0.000 1.000
#> GSM11725     2  0.0000      0.939 0.000 1.000
#> GSM11864     2  0.0000      0.939 0.000 1.000
#> GSM11687     2  0.0000      0.939 0.000 1.000
#> GSM11693     2  0.0000      0.939 0.000 1.000
#> GSM11727     2  0.0000      0.939 0.000 1.000
#> GSM11838     2  0.0000      0.939 0.000 1.000
#> GSM11681     1  0.0000      0.884 1.000 0.000
#> GSM11689     2  0.0000      0.939 0.000 1.000
#> GSM11704     2  0.0000      0.939 0.000 1.000
#> GSM11703     2  0.0000      0.939 0.000 1.000
#> GSM11705     1  0.4939      0.808 0.892 0.108
#> GSM11722     2  0.0000      0.939 0.000 1.000
#> GSM11730     2  0.0000      0.939 0.000 1.000
#> GSM11713     1  0.4939      0.808 0.892 0.108
#> GSM11728     1  0.4939      0.808 0.892 0.108
#> GSM27947     2  0.0000      0.939 0.000 1.000
#> GSM27951     1  0.4939      0.808 0.892 0.108
#> GSM11707     1  0.0000      0.884 1.000 0.000
#> GSM11716     2  0.0000      0.939 0.000 1.000
#> GSM11850     1  0.9850      0.314 0.572 0.428
#> GSM11851     1  0.9850      0.314 0.572 0.428
#> GSM11721     2  0.0000      0.939 0.000 1.000
#> GSM11852     1  0.9866      0.304 0.568 0.432
#> GSM11694     1  0.9983      0.167 0.524 0.476
#> GSM11695     1  0.9850      0.314 0.572 0.428
#> GSM11734     2  0.0000      0.939 0.000 1.000
#> GSM11861     2  0.7299      0.716 0.204 0.796
#> GSM11843     2  0.0000      0.939 0.000 1.000
#> GSM11862     2  0.5059      0.835 0.112 0.888
#> GSM11697     2  1.0000     -0.107 0.496 0.504
#> GSM11714     1  0.0000      0.884 1.000 0.000
#> GSM11723     2  0.0000      0.939 0.000 1.000
#> GSM11845     2  0.0000      0.939 0.000 1.000
#> GSM11683     1  0.0000      0.884 1.000 0.000
#> GSM11691     2  0.5178      0.831 0.116 0.884
#> GSM27949     1  0.0000      0.884 1.000 0.000
#> GSM27945     2  0.5059      0.835 0.112 0.888
#> GSM11706     1  0.0000      0.884 1.000 0.000
#> GSM11853     1  0.9866      0.304 0.568 0.432
#> GSM11729     2  0.0000      0.939 0.000 1.000
#> GSM11746     2  0.0000      0.939 0.000 1.000
#> GSM11711     1  0.0000      0.884 1.000 0.000
#> GSM11854     1  0.9850      0.314 0.572 0.428
#> GSM11731     2  0.0000      0.939 0.000 1.000
#> GSM11839     2  0.0000      0.939 0.000 1.000
#> GSM11836     2  0.9850      0.184 0.428 0.572
#> GSM11849     2  0.9850      0.184 0.428 0.572
#> GSM11682     1  0.0000      0.884 1.000 0.000
#> GSM11690     2  0.0000      0.939 0.000 1.000
#> GSM11692     2  0.0000      0.939 0.000 1.000
#> GSM11841     2  0.0000      0.939 0.000 1.000
#> GSM11901     2  0.0000      0.939 0.000 1.000
#> GSM11715     2  0.0000      0.939 0.000 1.000
#> GSM11724     2  0.0000      0.939 0.000 1.000
#> GSM11684     2  0.0000      0.939 0.000 1.000
#> GSM11696     2  0.0000      0.939 0.000 1.000
#> GSM27952     1  0.0000      0.884 1.000 0.000
#> GSM27948     2  0.0000      0.939 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.0000      0.944 0.000 0.000 1.000
#> GSM11735     3  0.0237      0.944 0.004 0.000 0.996
#> GSM11733     3  0.0237      0.944 0.004 0.000 0.996
#> GSM11863     3  0.0237      0.944 0.004 0.000 0.996
#> GSM11710     3  0.0592      0.942 0.012 0.000 0.988
#> GSM11712     1  0.3879      0.750 0.848 0.152 0.000
#> GSM11732     3  0.3340      0.845 0.120 0.000 0.880
#> GSM11844     3  0.2066      0.907 0.060 0.000 0.940
#> GSM11842     3  0.0424      0.943 0.008 0.000 0.992
#> GSM11860     3  0.0237      0.944 0.004 0.000 0.996
#> GSM11686     3  0.0747      0.940 0.016 0.000 0.984
#> GSM11688     3  0.0747      0.940 0.016 0.000 0.984
#> GSM11846     3  0.0237      0.944 0.004 0.000 0.996
#> GSM11680     1  0.6079      0.451 0.612 0.000 0.388
#> GSM11698     3  0.2261      0.901 0.068 0.000 0.932
#> GSM11840     3  0.0237      0.944 0.004 0.000 0.996
#> GSM11847     3  0.0237      0.944 0.004 0.000 0.996
#> GSM11685     3  0.0747      0.940 0.016 0.000 0.984
#> GSM11699     1  0.2599      0.779 0.932 0.052 0.016
#> GSM27950     3  0.0000      0.944 0.000 0.000 1.000
#> GSM27946     1  0.1031      0.784 0.976 0.024 0.000
#> GSM11709     3  0.8343      0.472 0.132 0.256 0.612
#> GSM11720     1  0.5621      0.655 0.692 0.308 0.000
#> GSM11726     2  0.1860      0.841 0.052 0.948 0.000
#> GSM11837     2  0.1289      0.857 0.032 0.968 0.000
#> GSM11725     1  0.5859      0.621 0.656 0.344 0.000
#> GSM11864     1  0.5216      0.701 0.740 0.260 0.000
#> GSM11687     1  0.5815      0.655 0.692 0.304 0.004
#> GSM11693     1  0.5621      0.655 0.692 0.308 0.000
#> GSM11727     2  0.0892      0.864 0.020 0.980 0.000
#> GSM11838     2  0.0892      0.864 0.020 0.980 0.000
#> GSM11681     3  0.1491      0.931 0.016 0.016 0.968
#> GSM11689     1  0.5621      0.655 0.692 0.308 0.000
#> GSM11704     1  0.5621      0.655 0.692 0.308 0.000
#> GSM11703     1  0.5621      0.655 0.692 0.308 0.000
#> GSM11705     3  0.7053      0.596 0.064 0.244 0.692
#> GSM11722     2  0.0892      0.864 0.020 0.980 0.000
#> GSM11730     2  0.0892      0.864 0.020 0.980 0.000
#> GSM11713     2  0.5643      0.653 0.020 0.760 0.220
#> GSM11728     2  0.5680      0.666 0.024 0.764 0.212
#> GSM27947     1  0.2448      0.784 0.924 0.076 0.000
#> GSM27951     3  0.6927      0.610 0.060 0.240 0.700
#> GSM11707     3  0.0000      0.944 0.000 0.000 1.000
#> GSM11716     1  0.3112      0.778 0.900 0.096 0.004
#> GSM11850     1  0.3412      0.769 0.876 0.000 0.124
#> GSM11851     1  0.3752      0.760 0.856 0.000 0.144
#> GSM11721     1  0.5988      0.411 0.632 0.368 0.000
#> GSM11852     1  0.3502      0.772 0.896 0.020 0.084
#> GSM11694     1  0.3482      0.767 0.872 0.000 0.128
#> GSM11695     1  0.3551      0.765 0.868 0.000 0.132
#> GSM11734     1  0.5785      0.538 0.668 0.332 0.000
#> GSM11861     1  0.2096      0.779 0.944 0.052 0.004
#> GSM11843     1  0.2711      0.779 0.912 0.088 0.000
#> GSM11862     1  0.2261      0.775 0.932 0.068 0.000
#> GSM11697     1  0.3482      0.767 0.872 0.000 0.128
#> GSM11714     3  0.0000      0.944 0.000 0.000 1.000
#> GSM11723     1  0.3482      0.764 0.872 0.128 0.000
#> GSM11845     1  0.2066      0.785 0.940 0.060 0.000
#> GSM11683     3  0.0747      0.940 0.016 0.000 0.984
#> GSM11691     1  0.0848      0.789 0.984 0.008 0.008
#> GSM27949     3  0.1643      0.920 0.044 0.000 0.956
#> GSM27945     1  0.2774      0.784 0.920 0.008 0.072
#> GSM11706     3  0.0000      0.944 0.000 0.000 1.000
#> GSM11853     1  0.3349      0.775 0.888 0.004 0.108
#> GSM11729     2  0.1753      0.864 0.048 0.952 0.000
#> GSM11746     2  0.1643      0.863 0.044 0.956 0.000
#> GSM11711     3  0.0000      0.944 0.000 0.000 1.000
#> GSM11854     1  0.4047      0.754 0.848 0.004 0.148
#> GSM11731     2  0.4654      0.728 0.208 0.792 0.000
#> GSM11839     2  0.4842      0.711 0.224 0.776 0.000
#> GSM11836     2  0.3375      0.848 0.100 0.892 0.008
#> GSM11849     2  0.2625      0.858 0.084 0.916 0.000
#> GSM11682     3  0.1620      0.927 0.024 0.012 0.964
#> GSM11690     2  0.5327      0.655 0.272 0.728 0.000
#> GSM11692     1  0.5254      0.638 0.736 0.264 0.000
#> GSM11841     1  0.5291      0.638 0.732 0.268 0.000
#> GSM11901     1  0.5254      0.638 0.736 0.264 0.000
#> GSM11715     2  0.1964      0.863 0.056 0.944 0.000
#> GSM11724     2  0.1964      0.863 0.056 0.944 0.000
#> GSM11684     2  0.3340      0.841 0.120 0.880 0.000
#> GSM11696     2  0.3412      0.838 0.124 0.876 0.000
#> GSM27952     3  0.0747      0.940 0.016 0.000 0.984
#> GSM27948     1  0.5560      0.561 0.700 0.300 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     1  0.4621    0.69440 0.708 0.000 0.008 0.284
#> GSM11735     1  0.6295    0.64701 0.616 0.000 0.088 0.296
#> GSM11733     1  0.6336    0.64297 0.608 0.000 0.088 0.304
#> GSM11863     1  0.6336    0.64297 0.608 0.000 0.088 0.304
#> GSM11710     1  0.0469    0.78711 0.988 0.000 0.000 0.012
#> GSM11712     4  0.5414    0.55318 0.000 0.020 0.376 0.604
#> GSM11732     3  0.7189    0.34381 0.084 0.036 0.592 0.288
#> GSM11844     3  0.7933    0.25631 0.184 0.036 0.548 0.232
#> GSM11842     1  0.6336    0.64297 0.608 0.000 0.088 0.304
#> GSM11860     1  0.6336    0.64297 0.608 0.000 0.088 0.304
#> GSM11686     1  0.1716    0.77413 0.936 0.000 0.000 0.064
#> GSM11688     1  0.0921    0.78439 0.972 0.000 0.000 0.028
#> GSM11846     1  0.0817    0.78810 0.976 0.000 0.000 0.024
#> GSM11680     3  0.2722    0.60670 0.064 0.000 0.904 0.032
#> GSM11698     3  0.6759    0.17810 0.344 0.000 0.548 0.108
#> GSM11840     1  0.6336    0.64297 0.608 0.000 0.088 0.304
#> GSM11847     1  0.6336    0.64297 0.608 0.000 0.088 0.304
#> GSM11685     1  0.1022    0.78367 0.968 0.000 0.000 0.032
#> GSM11699     3  0.4477    0.35745 0.000 0.000 0.688 0.312
#> GSM27950     1  0.0336    0.78648 0.992 0.000 0.008 0.000
#> GSM27946     3  0.4522    0.34787 0.000 0.000 0.680 0.320
#> GSM11709     1  0.7112    0.28132 0.504 0.408 0.044 0.044
#> GSM11720     2  0.6482    0.23368 0.000 0.504 0.424 0.072
#> GSM11726     2  0.0188    0.49006 0.000 0.996 0.004 0.000
#> GSM11837     2  0.1635    0.49762 0.000 0.948 0.008 0.044
#> GSM11725     2  0.6265    0.32162 0.000 0.588 0.340 0.072
#> GSM11864     2  0.6642    0.22002 0.000 0.492 0.424 0.084
#> GSM11687     2  0.6919    0.24396 0.012 0.508 0.404 0.076
#> GSM11693     2  0.6514    0.25053 0.000 0.516 0.408 0.076
#> GSM11727     2  0.1118    0.49774 0.000 0.964 0.000 0.036
#> GSM11838     2  0.1302    0.49714 0.000 0.956 0.000 0.044
#> GSM11681     1  0.1985    0.77739 0.940 0.016 0.004 0.040
#> GSM11689     2  0.6514    0.25053 0.000 0.516 0.408 0.076
#> GSM11704     2  0.6514    0.25053 0.000 0.516 0.408 0.076
#> GSM11703     2  0.6514    0.25053 0.000 0.516 0.408 0.076
#> GSM11705     1  0.6475    0.38286 0.572 0.368 0.028 0.032
#> GSM11722     2  0.1118    0.49774 0.000 0.964 0.000 0.036
#> GSM11730     2  0.1716    0.49022 0.000 0.936 0.000 0.064
#> GSM11713     1  0.6165    0.53586 0.652 0.264 0.004 0.080
#> GSM11728     1  0.6111    0.55095 0.660 0.256 0.004 0.080
#> GSM27947     3  0.5998    0.38728 0.000 0.116 0.684 0.200
#> GSM27951     1  0.7036    0.39994 0.564 0.332 0.020 0.084
#> GSM11707     1  0.1211    0.78488 0.960 0.000 0.000 0.040
#> GSM11716     3  0.0672    0.62745 0.000 0.008 0.984 0.008
#> GSM11850     3  0.1821    0.62013 0.012 0.032 0.948 0.008
#> GSM11851     3  0.1059    0.63115 0.012 0.000 0.972 0.016
#> GSM11721     4  0.6703    0.60434 0.000 0.156 0.232 0.612
#> GSM11852     3  0.5400   -0.04610 0.008 0.004 0.560 0.428
#> GSM11694     3  0.0657    0.63187 0.012 0.000 0.984 0.004
#> GSM11695     3  0.0657    0.63187 0.012 0.000 0.984 0.004
#> GSM11734     2  0.7541   -0.15786 0.000 0.424 0.188 0.388
#> GSM11861     3  0.4761    0.14936 0.000 0.000 0.628 0.372
#> GSM11843     3  0.7421   -0.26784 0.000 0.176 0.468 0.356
#> GSM11862     4  0.5000    0.20956 0.000 0.000 0.500 0.500
#> GSM11697     3  0.0469    0.63144 0.012 0.000 0.988 0.000
#> GSM11714     1  0.0000    0.78658 1.000 0.000 0.000 0.000
#> GSM11723     3  0.6548    0.24370 0.000 0.188 0.636 0.176
#> GSM11845     3  0.5332    0.39046 0.000 0.080 0.736 0.184
#> GSM11683     1  0.1118    0.78333 0.964 0.000 0.000 0.036
#> GSM11691     3  0.2675    0.58821 0.000 0.008 0.892 0.100
#> GSM27949     3  0.4989   -0.00235 0.472 0.000 0.528 0.000
#> GSM27945     3  0.0336    0.62938 0.000 0.000 0.992 0.008
#> GSM11706     1  0.1118    0.78535 0.964 0.000 0.000 0.036
#> GSM11853     3  0.4492    0.53409 0.016 0.016 0.792 0.176
#> GSM11729     2  0.3529    0.44138 0.000 0.836 0.012 0.152
#> GSM11746     2  0.3324    0.45343 0.000 0.852 0.012 0.136
#> GSM11711     1  0.1209    0.78616 0.964 0.004 0.000 0.032
#> GSM11854     3  0.5166    0.48777 0.044 0.004 0.736 0.216
#> GSM11731     2  0.4898    0.10836 0.000 0.584 0.000 0.416
#> GSM11839     2  0.5147   -0.01200 0.000 0.536 0.004 0.460
#> GSM11836     2  0.4985    0.00786 0.000 0.532 0.000 0.468
#> GSM11849     2  0.5503    0.01364 0.016 0.516 0.000 0.468
#> GSM11682     1  0.1867    0.77080 0.928 0.000 0.000 0.072
#> GSM11690     4  0.5360    0.32469 0.016 0.316 0.008 0.660
#> GSM11692     4  0.5558    0.57736 0.000 0.028 0.364 0.608
#> GSM11841     4  0.5558    0.57736 0.000 0.028 0.364 0.608
#> GSM11901     4  0.5630    0.58151 0.000 0.032 0.360 0.608
#> GSM11715     2  0.4713    0.22651 0.000 0.640 0.000 0.360
#> GSM11724     2  0.4730    0.21980 0.000 0.636 0.000 0.364
#> GSM11684     4  0.4978    0.22757 0.000 0.384 0.004 0.612
#> GSM11696     4  0.5237    0.29908 0.000 0.356 0.016 0.628
#> GSM27952     1  0.1118    0.78281 0.964 0.000 0.000 0.036
#> GSM27948     4  0.5970    0.62062 0.000 0.088 0.244 0.668

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     5  0.4291      0.504 0.464 0.000 0.000 0.000 0.536
#> GSM11735     5  0.3519      0.938 0.216 0.000 0.008 0.000 0.776
#> GSM11733     5  0.3421      0.949 0.204 0.000 0.008 0.000 0.788
#> GSM11863     5  0.3421      0.949 0.204 0.000 0.008 0.000 0.788
#> GSM11710     1  0.0609      0.845 0.980 0.000 0.000 0.000 0.020
#> GSM11712     4  0.2692      0.733 0.000 0.016 0.092 0.884 0.008
#> GSM11732     3  0.4774      0.499 0.012 0.028 0.684 0.000 0.276
#> GSM11844     3  0.5971      0.453 0.064 0.028 0.628 0.008 0.272
#> GSM11842     5  0.3421      0.949 0.204 0.000 0.008 0.000 0.788
#> GSM11860     5  0.3421      0.949 0.204 0.000 0.008 0.000 0.788
#> GSM11686     1  0.0324      0.850 0.992 0.000 0.000 0.004 0.004
#> GSM11688     1  0.0162      0.851 0.996 0.000 0.000 0.000 0.004
#> GSM11846     1  0.3039      0.619 0.808 0.000 0.000 0.000 0.192
#> GSM11680     3  0.5785      0.497 0.080 0.000 0.660 0.224 0.036
#> GSM11698     3  0.6642      0.429 0.292 0.000 0.560 0.080 0.068
#> GSM11840     5  0.3421      0.949 0.204 0.000 0.008 0.000 0.788
#> GSM11847     5  0.3421      0.949 0.204 0.000 0.008 0.000 0.788
#> GSM11685     1  0.0162      0.851 0.996 0.000 0.000 0.000 0.004
#> GSM11699     4  0.3819      0.617 0.016 0.000 0.228 0.756 0.000
#> GSM27950     1  0.0693      0.849 0.980 0.000 0.012 0.000 0.008
#> GSM27946     4  0.3586      0.610 0.000 0.000 0.264 0.736 0.000
#> GSM11709     1  0.7564      0.414 0.520 0.196 0.044 0.024 0.216
#> GSM11720     3  0.8254     -0.219 0.000 0.324 0.344 0.164 0.168
#> GSM11726     2  0.1200      0.623 0.000 0.964 0.008 0.012 0.016
#> GSM11837     2  0.0451      0.627 0.000 0.988 0.008 0.004 0.000
#> GSM11725     2  0.7583      0.340 0.000 0.500 0.228 0.164 0.108
#> GSM11864     2  0.8132      0.184 0.000 0.368 0.244 0.280 0.108
#> GSM11687     2  0.8793      0.183 0.012 0.312 0.256 0.244 0.176
#> GSM11693     2  0.8483      0.175 0.000 0.312 0.236 0.276 0.176
#> GSM11727     2  0.0671      0.626 0.000 0.980 0.000 0.004 0.016
#> GSM11838     2  0.0162      0.627 0.000 0.996 0.000 0.004 0.000
#> GSM11681     1  0.1798      0.823 0.928 0.004 0.000 0.004 0.064
#> GSM11689     2  0.8473      0.174 0.000 0.312 0.228 0.284 0.176
#> GSM11704     2  0.8473      0.174 0.000 0.312 0.228 0.284 0.176
#> GSM11703     2  0.8487      0.172 0.000 0.308 0.228 0.284 0.180
#> GSM11705     1  0.5743      0.610 0.688 0.100 0.008 0.024 0.180
#> GSM11722     2  0.1106      0.626 0.000 0.964 0.000 0.012 0.024
#> GSM11730     2  0.1668      0.620 0.000 0.940 0.000 0.032 0.028
#> GSM11713     1  0.4659      0.724 0.784 0.080 0.000 0.044 0.092
#> GSM11728     1  0.4785      0.717 0.776 0.084 0.000 0.048 0.092
#> GSM27947     4  0.6968      0.130 0.000 0.040 0.408 0.424 0.128
#> GSM27951     1  0.4899      0.670 0.736 0.048 0.004 0.020 0.192
#> GSM11707     1  0.1410      0.818 0.940 0.000 0.000 0.000 0.060
#> GSM11716     3  0.0898      0.673 0.000 0.000 0.972 0.020 0.008
#> GSM11850     3  0.1686      0.671 0.000 0.028 0.944 0.008 0.020
#> GSM11851     3  0.1485      0.669 0.000 0.000 0.948 0.032 0.020
#> GSM11721     4  0.3059      0.726 0.000 0.028 0.108 0.860 0.004
#> GSM11852     4  0.4724      0.610 0.040 0.000 0.248 0.704 0.008
#> GSM11694     3  0.1153      0.678 0.004 0.000 0.964 0.008 0.024
#> GSM11695     3  0.1153      0.678 0.004 0.000 0.964 0.008 0.024
#> GSM11734     2  0.6132      0.346 0.000 0.576 0.140 0.276 0.008
#> GSM11861     4  0.4562      0.197 0.000 0.000 0.492 0.500 0.008
#> GSM11843     4  0.7263      0.147 0.000 0.244 0.352 0.380 0.024
#> GSM11862     4  0.3783      0.637 0.000 0.000 0.252 0.740 0.008
#> GSM11697     3  0.1267      0.678 0.004 0.000 0.960 0.012 0.024
#> GSM11714     1  0.0162      0.851 0.996 0.000 0.000 0.000 0.004
#> GSM11723     3  0.5564      0.445 0.000 0.200 0.664 0.128 0.008
#> GSM11845     3  0.4893      0.426 0.000 0.064 0.712 0.216 0.008
#> GSM11683     1  0.0290      0.850 0.992 0.000 0.008 0.000 0.000
#> GSM11691     3  0.2068      0.635 0.000 0.000 0.904 0.092 0.004
#> GSM27949     3  0.5000      0.300 0.388 0.000 0.576 0.000 0.036
#> GSM27945     3  0.1357      0.657 0.000 0.000 0.948 0.048 0.004
#> GSM11706     1  0.1270      0.825 0.948 0.000 0.000 0.000 0.052
#> GSM11853     3  0.5151      0.100 0.000 0.004 0.592 0.364 0.040
#> GSM11729     2  0.1082      0.625 0.000 0.964 0.008 0.028 0.000
#> GSM11746     2  0.1082      0.625 0.000 0.964 0.008 0.028 0.000
#> GSM11711     1  0.1341      0.827 0.944 0.000 0.000 0.000 0.056
#> GSM11854     3  0.5689     -0.156 0.040 0.000 0.492 0.448 0.020
#> GSM11731     2  0.3662      0.488 0.000 0.744 0.000 0.252 0.004
#> GSM11839     2  0.4009      0.412 0.000 0.684 0.000 0.312 0.004
#> GSM11836     2  0.5556      0.447 0.004 0.656 0.000 0.204 0.136
#> GSM11849     2  0.6024      0.394 0.084 0.616 0.000 0.268 0.032
#> GSM11682     1  0.1117      0.839 0.964 0.000 0.000 0.016 0.020
#> GSM11690     4  0.2882      0.666 0.028 0.060 0.000 0.888 0.024
#> GSM11692     4  0.2189      0.737 0.000 0.012 0.084 0.904 0.000
#> GSM11841     4  0.2293      0.737 0.000 0.016 0.084 0.900 0.000
#> GSM11901     4  0.2130      0.737 0.000 0.012 0.080 0.908 0.000
#> GSM11715     2  0.3724      0.545 0.000 0.788 0.000 0.184 0.028
#> GSM11724     2  0.3724      0.545 0.000 0.788 0.000 0.184 0.028
#> GSM11684     4  0.4699      0.418 0.016 0.236 0.000 0.716 0.032
#> GSM11696     4  0.2813      0.653 0.004 0.084 0.000 0.880 0.032
#> GSM27952     1  0.0000      0.851 1.000 0.000 0.000 0.000 0.000
#> GSM27948     4  0.1644      0.722 0.004 0.012 0.028 0.948 0.008

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     5  0.4428      0.233 0.008 0.004 0.008 0.000 0.540 0.440
#> GSM11735     5  0.1901      0.906 0.004 0.000 0.008 0.000 0.912 0.076
#> GSM11733     5  0.1267      0.926 0.000 0.000 0.000 0.000 0.940 0.060
#> GSM11863     5  0.1267      0.926 0.000 0.000 0.000 0.000 0.940 0.060
#> GSM11710     6  0.1586      0.859 0.012 0.004 0.004 0.000 0.040 0.940
#> GSM11712     4  0.4425      0.694 0.156 0.092 0.008 0.740 0.004 0.000
#> GSM11732     3  0.3116      0.718 0.016 0.012 0.836 0.004 0.132 0.000
#> GSM11844     3  0.4263      0.699 0.008 0.012 0.788 0.012 0.104 0.076
#> GSM11842     5  0.1267      0.926 0.000 0.000 0.000 0.000 0.940 0.060
#> GSM11860     5  0.1204      0.922 0.000 0.000 0.000 0.000 0.944 0.056
#> GSM11686     6  0.0692      0.866 0.000 0.000 0.004 0.020 0.000 0.976
#> GSM11688     6  0.0146      0.868 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM11846     6  0.4015      0.584 0.000 0.000 0.008 0.028 0.244 0.720
#> GSM11680     3  0.5646      0.568 0.072 0.000 0.652 0.200 0.008 0.068
#> GSM11698     3  0.6108      0.570 0.036 0.000 0.624 0.124 0.032 0.184
#> GSM11840     5  0.1267      0.926 0.000 0.000 0.000 0.000 0.940 0.060
#> GSM11847     5  0.1267      0.926 0.000 0.000 0.000 0.000 0.940 0.060
#> GSM11685     6  0.0146      0.868 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM11699     4  0.5063      0.601 0.104 0.008 0.204 0.676 0.004 0.004
#> GSM27950     6  0.1138      0.864 0.004 0.000 0.012 0.000 0.024 0.960
#> GSM27946     4  0.5218      0.607 0.188 0.000 0.160 0.644 0.004 0.004
#> GSM11709     1  0.4596      0.212 0.616 0.008 0.000 0.000 0.036 0.340
#> GSM11720     1  0.2618      0.763 0.888 0.036 0.060 0.012 0.004 0.000
#> GSM11726     2  0.2772      0.787 0.180 0.816 0.000 0.000 0.004 0.000
#> GSM11837     2  0.2146      0.824 0.116 0.880 0.000 0.000 0.004 0.000
#> GSM11725     1  0.4736      0.657 0.728 0.152 0.092 0.024 0.004 0.000
#> GSM11864     1  0.3201      0.752 0.852 0.092 0.024 0.024 0.008 0.000
#> GSM11687     1  0.1223      0.786 0.960 0.008 0.012 0.016 0.004 0.000
#> GSM11693     1  0.1268      0.790 0.952 0.008 0.004 0.036 0.000 0.000
#> GSM11727     2  0.2340      0.816 0.148 0.852 0.000 0.000 0.000 0.000
#> GSM11838     2  0.1957      0.828 0.112 0.888 0.000 0.000 0.000 0.000
#> GSM11681     6  0.1152      0.854 0.044 0.000 0.000 0.000 0.004 0.952
#> GSM11689     1  0.1268      0.790 0.952 0.008 0.004 0.036 0.000 0.000
#> GSM11704     1  0.1268      0.790 0.952 0.008 0.004 0.036 0.000 0.000
#> GSM11703     1  0.1413      0.789 0.948 0.008 0.004 0.036 0.004 0.000
#> GSM11705     6  0.4356      0.178 0.480 0.008 0.004 0.000 0.004 0.504
#> GSM11722     2  0.3263      0.816 0.152 0.816 0.016 0.016 0.000 0.000
#> GSM11730     2  0.2950      0.811 0.148 0.828 0.000 0.024 0.000 0.000
#> GSM11713     6  0.4300      0.756 0.088 0.076 0.004 0.040 0.004 0.788
#> GSM11728     6  0.4376      0.754 0.088 0.072 0.004 0.048 0.004 0.784
#> GSM27947     1  0.4637      0.515 0.700 0.008 0.072 0.216 0.004 0.000
#> GSM27951     6  0.4470      0.507 0.336 0.004 0.004 0.020 0.004 0.632
#> GSM11707     6  0.2202      0.839 0.012 0.004 0.008 0.000 0.072 0.904
#> GSM11716     3  0.2965      0.758 0.108 0.008 0.856 0.012 0.016 0.000
#> GSM11850     3  0.1785      0.727 0.008 0.000 0.928 0.048 0.016 0.000
#> GSM11851     3  0.3009      0.701 0.024 0.000 0.860 0.092 0.020 0.004
#> GSM11721     4  0.4413      0.664 0.060 0.040 0.084 0.792 0.020 0.004
#> GSM11852     4  0.5420      0.605 0.088 0.000 0.136 0.704 0.032 0.040
#> GSM11694     3  0.2346      0.764 0.124 0.000 0.868 0.000 0.008 0.000
#> GSM11695     3  0.2346      0.764 0.124 0.000 0.868 0.000 0.008 0.000
#> GSM11734     2  0.7080      0.424 0.148 0.540 0.156 0.128 0.028 0.000
#> GSM11861     4  0.5904      0.198 0.028 0.008 0.420 0.484 0.044 0.016
#> GSM11843     1  0.7828      0.109 0.392 0.204 0.148 0.232 0.024 0.000
#> GSM11862     4  0.5968      0.566 0.096 0.008 0.180 0.652 0.040 0.024
#> GSM11697     3  0.2615      0.759 0.136 0.000 0.852 0.004 0.008 0.000
#> GSM11714     6  0.1312      0.864 0.012 0.004 0.008 0.000 0.020 0.956
#> GSM11723     3  0.6462      0.515 0.096 0.208 0.592 0.076 0.028 0.000
#> GSM11845     3  0.6464      0.563 0.164 0.088 0.608 0.112 0.028 0.000
#> GSM11683     6  0.0363      0.868 0.000 0.000 0.012 0.000 0.000 0.988
#> GSM11691     3  0.5088      0.627 0.168 0.000 0.688 0.120 0.020 0.004
#> GSM27949     3  0.4389      0.522 0.008 0.000 0.660 0.004 0.024 0.304
#> GSM27945     3  0.3099      0.736 0.176 0.000 0.808 0.008 0.008 0.000
#> GSM11706     6  0.2202      0.839 0.012 0.004 0.008 0.000 0.072 0.904
#> GSM11853     4  0.6640      0.253 0.192 0.000 0.344 0.428 0.024 0.012
#> GSM11729     2  0.1949      0.833 0.088 0.904 0.000 0.004 0.004 0.000
#> GSM11746     2  0.1949      0.833 0.088 0.904 0.000 0.004 0.004 0.000
#> GSM11711     6  0.2451      0.852 0.028 0.004 0.016 0.004 0.044 0.904
#> GSM11854     4  0.6730      0.406 0.136 0.000 0.292 0.504 0.032 0.036
#> GSM11731     2  0.3839      0.710 0.020 0.784 0.016 0.168 0.012 0.000
#> GSM11839     2  0.4095      0.673 0.020 0.752 0.016 0.200 0.012 0.000
#> GSM11836     2  0.2412      0.788 0.000 0.880 0.000 0.092 0.028 0.000
#> GSM11849     2  0.3580      0.742 0.008 0.824 0.004 0.112 0.008 0.044
#> GSM11682     6  0.0520      0.866 0.000 0.000 0.000 0.008 0.008 0.984
#> GSM11690     4  0.4139      0.685 0.064 0.116 0.000 0.788 0.008 0.024
#> GSM11692     4  0.4364      0.704 0.144 0.096 0.008 0.748 0.004 0.000
#> GSM11841     4  0.4364      0.704 0.144 0.096 0.008 0.748 0.004 0.000
#> GSM11901     4  0.4364      0.704 0.144 0.096 0.008 0.748 0.004 0.000
#> GSM11715     2  0.1493      0.812 0.000 0.936 0.004 0.056 0.004 0.000
#> GSM11724     2  0.1349      0.813 0.000 0.940 0.000 0.056 0.004 0.000
#> GSM11684     4  0.4403      0.633 0.028 0.204 0.004 0.736 0.008 0.020
#> GSM11696     4  0.4171      0.681 0.064 0.140 0.004 0.776 0.008 0.008
#> GSM27952     6  0.0000      0.868 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM27948     4  0.3827      0.696 0.084 0.096 0.000 0.804 0.008 0.008

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-skmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n cell.line(p) agent(p)  time(p) k
#> SD:skmeans 73     9.95e-05    0.952 2.16e-01 2
#> SD:skmeans 80     8.71e-09    0.628 7.02e-03 3
#> SD:skmeans 40     4.26e-04    0.815 3.19e-01 4
#> SD:skmeans 56     4.61e-09    0.921 1.29e-07 5
#> SD:skmeans 75     2.98e-13    0.856 1.32e-09 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


SD:pam**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "pam"]
# you can also extract it by
# res = res_list["SD:pam"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-pam-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-pam-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.989       0.995         0.2404 0.767   0.767
#> 3 3 0.496           0.744       0.865         0.8911 0.802   0.745
#> 4 4 0.502           0.715       0.826         0.3205 0.862   0.767
#> 5 5 0.559           0.761       0.836         0.0908 0.935   0.860
#> 6 6 0.601           0.659       0.816         0.1046 0.847   0.634

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     2  0.0000      1.000 0.000 1.000
#> GSM11735     2  0.0000      1.000 0.000 1.000
#> GSM11733     2  0.0000      1.000 0.000 1.000
#> GSM11863     2  0.0000      1.000 0.000 1.000
#> GSM11710     2  0.0000      1.000 0.000 1.000
#> GSM11712     1  0.0000      0.994 1.000 0.000
#> GSM11732     1  0.0000      0.994 1.000 0.000
#> GSM11844     1  0.0000      0.994 1.000 0.000
#> GSM11842     2  0.0000      1.000 0.000 1.000
#> GSM11860     2  0.0000      1.000 0.000 1.000
#> GSM11686     1  0.0000      0.994 1.000 0.000
#> GSM11688     1  0.4161      0.908 0.916 0.084
#> GSM11846     1  0.2236      0.960 0.964 0.036
#> GSM11680     1  0.0000      0.994 1.000 0.000
#> GSM11698     1  0.0000      0.994 1.000 0.000
#> GSM11840     2  0.0000      1.000 0.000 1.000
#> GSM11847     2  0.0000      1.000 0.000 1.000
#> GSM11685     1  0.0672      0.987 0.992 0.008
#> GSM11699     1  0.0000      0.994 1.000 0.000
#> GSM27950     1  0.0000      0.994 1.000 0.000
#> GSM27946     1  0.0000      0.994 1.000 0.000
#> GSM11709     1  0.0000      0.994 1.000 0.000
#> GSM11720     1  0.0000      0.994 1.000 0.000
#> GSM11726     1  0.0000      0.994 1.000 0.000
#> GSM11837     1  0.0000      0.994 1.000 0.000
#> GSM11725     1  0.0000      0.994 1.000 0.000
#> GSM11864     1  0.0000      0.994 1.000 0.000
#> GSM11687     1  0.0000      0.994 1.000 0.000
#> GSM11693     1  0.0000      0.994 1.000 0.000
#> GSM11727     1  0.0000      0.994 1.000 0.000
#> GSM11838     1  0.0000      0.994 1.000 0.000
#> GSM11681     1  0.0000      0.994 1.000 0.000
#> GSM11689     1  0.0000      0.994 1.000 0.000
#> GSM11704     1  0.0000      0.994 1.000 0.000
#> GSM11703     1  0.0000      0.994 1.000 0.000
#> GSM11705     1  0.0000      0.994 1.000 0.000
#> GSM11722     1  0.0000      0.994 1.000 0.000
#> GSM11730     1  0.0000      0.994 1.000 0.000
#> GSM11713     1  0.0000      0.994 1.000 0.000
#> GSM11728     1  0.0000      0.994 1.000 0.000
#> GSM27947     1  0.0000      0.994 1.000 0.000
#> GSM27951     1  0.0000      0.994 1.000 0.000
#> GSM11707     2  0.0000      1.000 0.000 1.000
#> GSM11716     1  0.0000      0.994 1.000 0.000
#> GSM11850     1  0.0000      0.994 1.000 0.000
#> GSM11851     1  0.0000      0.994 1.000 0.000
#> GSM11721     1  0.0000      0.994 1.000 0.000
#> GSM11852     1  0.0000      0.994 1.000 0.000
#> GSM11694     1  0.0000      0.994 1.000 0.000
#> GSM11695     1  0.0000      0.994 1.000 0.000
#> GSM11734     1  0.0000      0.994 1.000 0.000
#> GSM11861     1  0.0000      0.994 1.000 0.000
#> GSM11843     1  0.0000      0.994 1.000 0.000
#> GSM11862     1  0.0000      0.994 1.000 0.000
#> GSM11697     1  0.0000      0.994 1.000 0.000
#> GSM11714     2  0.0000      1.000 0.000 1.000
#> GSM11723     1  0.0000      0.994 1.000 0.000
#> GSM11845     1  0.0000      0.994 1.000 0.000
#> GSM11683     1  0.0000      0.994 1.000 0.000
#> GSM11691     1  0.0000      0.994 1.000 0.000
#> GSM27949     1  0.0000      0.994 1.000 0.000
#> GSM27945     1  0.0000      0.994 1.000 0.000
#> GSM11706     1  0.8443      0.630 0.728 0.272
#> GSM11853     1  0.0000      0.994 1.000 0.000
#> GSM11729     1  0.0000      0.994 1.000 0.000
#> GSM11746     1  0.0000      0.994 1.000 0.000
#> GSM11711     1  0.0000      0.994 1.000 0.000
#> GSM11854     1  0.0000      0.994 1.000 0.000
#> GSM11731     1  0.0000      0.994 1.000 0.000
#> GSM11839     1  0.0000      0.994 1.000 0.000
#> GSM11836     1  0.0000      0.994 1.000 0.000
#> GSM11849     1  0.0000      0.994 1.000 0.000
#> GSM11682     1  0.0000      0.994 1.000 0.000
#> GSM11690     1  0.0000      0.994 1.000 0.000
#> GSM11692     1  0.0000      0.994 1.000 0.000
#> GSM11841     1  0.0000      0.994 1.000 0.000
#> GSM11901     1  0.0000      0.994 1.000 0.000
#> GSM11715     1  0.0000      0.994 1.000 0.000
#> GSM11724     1  0.0000      0.994 1.000 0.000
#> GSM11684     1  0.0000      0.994 1.000 0.000
#> GSM11696     1  0.0000      0.994 1.000 0.000
#> GSM27952     1  0.0000      0.994 1.000 0.000
#> GSM27948     1  0.0000      0.994 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     2  0.0000      1.000 0.000 1.000 0.000
#> GSM11735     2  0.0000      1.000 0.000 1.000 0.000
#> GSM11733     2  0.0000      1.000 0.000 1.000 0.000
#> GSM11863     2  0.0000      1.000 0.000 1.000 0.000
#> GSM11710     3  0.6045      0.138 0.000 0.380 0.620
#> GSM11712     1  0.5016      0.706 0.760 0.000 0.240
#> GSM11732     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11844     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11842     2  0.0000      1.000 0.000 1.000 0.000
#> GSM11860     2  0.0000      1.000 0.000 1.000 0.000
#> GSM11686     3  0.6244      0.640 0.440 0.000 0.560
#> GSM11688     3  0.6062      0.691 0.384 0.000 0.616
#> GSM11846     3  0.6476      0.624 0.448 0.004 0.548
#> GSM11680     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11698     1  0.0424      0.845 0.992 0.000 0.008
#> GSM11840     2  0.0000      1.000 0.000 1.000 0.000
#> GSM11847     2  0.0000      1.000 0.000 1.000 0.000
#> GSM11685     3  0.3941      0.566 0.156 0.000 0.844
#> GSM11699     1  0.5058      0.702 0.756 0.000 0.244
#> GSM27950     3  0.6095      0.690 0.392 0.000 0.608
#> GSM27946     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11709     1  0.1031      0.837 0.976 0.000 0.024
#> GSM11720     1  0.0424      0.845 0.992 0.000 0.008
#> GSM11726     1  0.1031      0.837 0.976 0.000 0.024
#> GSM11837     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11725     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11864     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11687     1  0.0424      0.845 0.992 0.000 0.008
#> GSM11693     1  0.0424      0.845 0.992 0.000 0.008
#> GSM11727     1  0.1031      0.837 0.976 0.000 0.024
#> GSM11838     1  0.3619      0.739 0.864 0.000 0.136
#> GSM11681     3  0.6062      0.690 0.384 0.000 0.616
#> GSM11689     1  0.0424      0.845 0.992 0.000 0.008
#> GSM11704     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11703     1  0.1031      0.837 0.976 0.000 0.024
#> GSM11705     1  0.1031      0.837 0.976 0.000 0.024
#> GSM11722     1  0.2959      0.783 0.900 0.000 0.100
#> GSM11730     1  0.1643      0.836 0.956 0.000 0.044
#> GSM11713     3  0.6168      0.469 0.412 0.000 0.588
#> GSM11728     1  0.1031      0.837 0.976 0.000 0.024
#> GSM27947     1  0.0000      0.849 1.000 0.000 0.000
#> GSM27951     1  0.1031      0.837 0.976 0.000 0.024
#> GSM11707     3  0.6062      0.130 0.000 0.384 0.616
#> GSM11716     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11850     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11851     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11721     1  0.5058      0.702 0.756 0.000 0.244
#> GSM11852     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11694     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11695     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11734     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11861     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11843     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11862     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11697     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11714     3  0.6045      0.138 0.000 0.380 0.620
#> GSM11723     1  0.5058      0.702 0.756 0.000 0.244
#> GSM11845     1  0.5058      0.702 0.756 0.000 0.244
#> GSM11683     3  0.3879      0.569 0.152 0.000 0.848
#> GSM11691     1  0.2537      0.811 0.920 0.000 0.080
#> GSM27949     1  0.0237      0.847 0.996 0.000 0.004
#> GSM27945     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11706     1  0.7740     -0.497 0.508 0.048 0.444
#> GSM11853     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11729     1  0.5591      0.640 0.696 0.000 0.304
#> GSM11746     1  0.3619      0.739 0.864 0.000 0.136
#> GSM11711     1  0.1031      0.837 0.976 0.000 0.024
#> GSM11854     1  0.0000      0.849 1.000 0.000 0.000
#> GSM11731     1  0.5948      0.587 0.640 0.000 0.360
#> GSM11839     1  0.5016      0.706 0.760 0.000 0.240
#> GSM11836     1  0.5098      0.700 0.752 0.000 0.248
#> GSM11849     1  0.6079      0.556 0.612 0.000 0.388
#> GSM11682     3  0.3816      0.567 0.148 0.000 0.852
#> GSM11690     1  0.5058      0.702 0.756 0.000 0.244
#> GSM11692     1  0.5058      0.702 0.756 0.000 0.244
#> GSM11841     1  0.5058      0.702 0.756 0.000 0.244
#> GSM11901     1  0.5058      0.702 0.756 0.000 0.244
#> GSM11715     1  0.6062      0.560 0.616 0.000 0.384
#> GSM11724     1  0.6062      0.560 0.616 0.000 0.384
#> GSM11684     1  0.6095      0.553 0.608 0.000 0.392
#> GSM11696     1  0.6045      0.562 0.620 0.000 0.380
#> GSM27952     3  0.6045      0.690 0.380 0.000 0.620
#> GSM27948     1  0.5058      0.702 0.756 0.000 0.244

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM11735     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM11733     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM11863     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM11710     1  0.4678     0.5262 0.744 0.024 0.000 0.232
#> GSM11712     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11732     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM11844     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM11842     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM11860     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM11686     1  0.3606     0.6758 0.840 0.020 0.140 0.000
#> GSM11688     1  0.3432     0.7106 0.884 0.020 0.060 0.036
#> GSM11846     1  0.6755     0.5908 0.660 0.180 0.140 0.020
#> GSM11680     3  0.3907     0.7526 0.232 0.000 0.768 0.000
#> GSM11698     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM11840     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM11847     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM11685     1  0.4585     0.4904 0.668 0.000 0.332 0.000
#> GSM11699     3  0.0817     0.7829 0.024 0.000 0.976 0.000
#> GSM27950     1  0.1940     0.6864 0.924 0.000 0.076 0.000
#> GSM27946     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11709     3  0.5873     0.6884 0.076 0.256 0.668 0.000
#> GSM11720     3  0.4422     0.7369 0.008 0.256 0.736 0.000
#> GSM11726     3  0.5744     0.6954 0.068 0.256 0.676 0.000
#> GSM11837     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11725     3  0.3907     0.7498 0.000 0.232 0.768 0.000
#> GSM11864     3  0.3907     0.7498 0.000 0.232 0.768 0.000
#> GSM11687     3  0.4103     0.7409 0.000 0.256 0.744 0.000
#> GSM11693     3  0.4103     0.7409 0.000 0.256 0.744 0.000
#> GSM11727     3  0.6209     0.4190 0.052 0.456 0.492 0.000
#> GSM11838     2  0.0817     0.6065 0.000 0.976 0.024 0.000
#> GSM11681     1  0.5537     0.5173 0.688 0.256 0.056 0.000
#> GSM11689     3  0.4103     0.7409 0.000 0.256 0.744 0.000
#> GSM11704     3  0.3907     0.7498 0.000 0.232 0.768 0.000
#> GSM11703     3  0.6050     0.6971 0.100 0.232 0.668 0.000
#> GSM11705     3  0.5873     0.6884 0.076 0.256 0.668 0.000
#> GSM11722     3  0.6141     0.6516 0.076 0.300 0.624 0.000
#> GSM11730     3  0.6409     0.5343 0.076 0.364 0.560 0.000
#> GSM11713     2  0.6135    -0.0948 0.376 0.568 0.056 0.000
#> GSM11728     3  0.2742     0.7457 0.076 0.024 0.900 0.000
#> GSM27947     3  0.2011     0.7859 0.000 0.080 0.920 0.000
#> GSM27951     3  0.5873     0.6884 0.076 0.256 0.668 0.000
#> GSM11707     1  0.1284     0.6998 0.964 0.024 0.000 0.012
#> GSM11716     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM11850     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM11851     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM11721     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11852     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11694     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM11695     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM11734     3  0.0336     0.7811 0.000 0.008 0.992 0.000
#> GSM11861     3  0.3873     0.7514 0.228 0.000 0.772 0.000
#> GSM11843     3  0.3907     0.7499 0.232 0.000 0.768 0.000
#> GSM11862     3  0.2281     0.7835 0.096 0.000 0.904 0.000
#> GSM11697     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM11714     1  0.0817     0.6997 0.976 0.024 0.000 0.000
#> GSM11723     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11845     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11683     1  0.1716     0.6968 0.936 0.000 0.064 0.000
#> GSM11691     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM27949     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM27945     3  0.4103     0.7420 0.256 0.000 0.744 0.000
#> GSM11706     1  0.6859     0.5407 0.652 0.024 0.196 0.128
#> GSM11853     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11729     2  0.4103     0.7742 0.000 0.744 0.256 0.000
#> GSM11746     2  0.0817     0.6065 0.000 0.976 0.024 0.000
#> GSM11711     3  0.3205     0.7527 0.104 0.024 0.872 0.000
#> GSM11854     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11731     3  0.4804    -0.0226 0.000 0.384 0.616 0.000
#> GSM11839     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11836     3  0.4222     0.3722 0.000 0.272 0.728 0.000
#> GSM11849     2  0.4103     0.7742 0.000 0.744 0.256 0.000
#> GSM11682     1  0.4406     0.5072 0.700 0.000 0.300 0.000
#> GSM11690     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11692     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11841     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11901     3  0.0000     0.7794 0.000 0.000 1.000 0.000
#> GSM11715     2  0.4103     0.7742 0.000 0.744 0.256 0.000
#> GSM11724     2  0.4103     0.7742 0.000 0.744 0.256 0.000
#> GSM11684     2  0.4103     0.7742 0.000 0.744 0.256 0.000
#> GSM11696     3  0.4193     0.3920 0.000 0.268 0.732 0.000
#> GSM27952     1  0.4678     0.5313 0.744 0.024 0.232 0.000
#> GSM27948     3  0.0000     0.7794 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11735     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11733     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11863     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11710     4  0.2520     0.7264 0.000 0.056 0.000 0.896 0.048
#> GSM11712     3  0.0000     0.7921 0.000 0.000 1.000 0.000 0.000
#> GSM11732     3  0.4302     0.7914 0.208 0.000 0.744 0.048 0.000
#> GSM11844     3  0.4302     0.7914 0.208 0.000 0.744 0.048 0.000
#> GSM11842     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11860     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11686     4  0.2450     0.7481 0.048 0.000 0.052 0.900 0.000
#> GSM11688     4  0.1522     0.7483 0.044 0.000 0.000 0.944 0.012
#> GSM11846     4  0.3498     0.7070 0.012 0.008 0.116 0.844 0.020
#> GSM11680     3  0.3988     0.7992 0.196 0.000 0.768 0.036 0.000
#> GSM11698     3  0.4455     0.7754 0.068 0.000 0.744 0.188 0.000
#> GSM11840     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11847     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11685     4  0.3336     0.5677 0.000 0.000 0.228 0.772 0.000
#> GSM11699     3  0.0162     0.7932 0.000 0.000 0.996 0.004 0.000
#> GSM27950     4  0.3333     0.6299 0.208 0.000 0.004 0.788 0.000
#> GSM27946     3  0.0000     0.7921 0.000 0.000 1.000 0.000 0.000
#> GSM11709     3  0.5625     0.7333 0.048 0.196 0.688 0.068 0.000
#> GSM11720     3  0.5094     0.7730 0.048 0.156 0.740 0.056 0.000
#> GSM11726     2  0.0955     0.8273 0.000 0.968 0.004 0.028 0.000
#> GSM11837     2  0.3305     0.5548 0.000 0.776 0.224 0.000 0.000
#> GSM11725     3  0.4109     0.7847 0.048 0.168 0.780 0.004 0.000
#> GSM11864     3  0.3953     0.7854 0.048 0.168 0.784 0.000 0.000
#> GSM11687     3  0.4935     0.7744 0.048 0.168 0.744 0.040 0.000
#> GSM11693     3  0.4935     0.7744 0.048 0.168 0.744 0.040 0.000
#> GSM11727     2  0.0404     0.8202 0.000 0.988 0.012 0.000 0.000
#> GSM11838     2  0.1341     0.7882 0.056 0.944 0.000 0.000 0.000
#> GSM11681     4  0.5800     0.5408 0.048 0.220 0.068 0.664 0.000
#> GSM11689     3  0.4935     0.7744 0.048 0.168 0.744 0.040 0.000
#> GSM11704     3  0.3953     0.7854 0.048 0.168 0.784 0.000 0.000
#> GSM11703     3  0.5614     0.7350 0.044 0.196 0.688 0.072 0.000
#> GSM11705     3  0.5536     0.7146 0.048 0.056 0.688 0.208 0.000
#> GSM11722     3  0.6414     0.6796 0.104 0.200 0.628 0.068 0.000
#> GSM11730     2  0.1845     0.8178 0.000 0.928 0.016 0.056 0.000
#> GSM11713     2  0.3563     0.6587 0.012 0.780 0.000 0.208 0.000
#> GSM11728     3  0.4434     0.7271 0.000 0.056 0.736 0.208 0.000
#> GSM27947     3  0.1809     0.8028 0.012 0.060 0.928 0.000 0.000
#> GSM27951     3  0.5387     0.7345 0.048 0.224 0.688 0.040 0.000
#> GSM11707     4  0.1502     0.7495 0.000 0.056 0.000 0.940 0.004
#> GSM11716     3  0.4302     0.7914 0.208 0.000 0.744 0.048 0.000
#> GSM11850     3  0.4302     0.7914 0.208 0.000 0.744 0.048 0.000
#> GSM11851     3  0.4302     0.7914 0.208 0.000 0.744 0.048 0.000
#> GSM11721     3  0.0000     0.7921 0.000 0.000 1.000 0.000 0.000
#> GSM11852     3  0.2516     0.7873 0.000 0.000 0.860 0.140 0.000
#> GSM11694     3  0.4302     0.7914 0.208 0.000 0.744 0.048 0.000
#> GSM11695     3  0.4302     0.7914 0.208 0.000 0.744 0.048 0.000
#> GSM11734     3  0.0290     0.7942 0.000 0.008 0.992 0.000 0.000
#> GSM11861     3  0.4201     0.7940 0.204 0.000 0.752 0.044 0.000
#> GSM11843     3  0.4233     0.7925 0.208 0.000 0.748 0.044 0.000
#> GSM11862     3  0.2124     0.8106 0.096 0.000 0.900 0.004 0.000
#> GSM11697     3  0.4302     0.7914 0.208 0.000 0.744 0.048 0.000
#> GSM11714     4  0.1341     0.7496 0.000 0.056 0.000 0.944 0.000
#> GSM11723     3  0.0000     0.7921 0.000 0.000 1.000 0.000 0.000
#> GSM11845     3  0.0000     0.7921 0.000 0.000 1.000 0.000 0.000
#> GSM11683     4  0.6046     0.5867 0.208 0.052 0.088 0.652 0.000
#> GSM11691     3  0.4302     0.7914 0.208 0.000 0.744 0.048 0.000
#> GSM27949     3  0.4302     0.7914 0.208 0.000 0.744 0.048 0.000
#> GSM27945     3  0.4302     0.7914 0.208 0.000 0.744 0.048 0.000
#> GSM11706     4  0.6009     0.4996 0.000 0.056 0.216 0.652 0.076
#> GSM11853     3  0.2516     0.7873 0.000 0.000 0.860 0.140 0.000
#> GSM11729     1  0.4337     0.8184 0.744 0.052 0.204 0.000 0.000
#> GSM11746     1  0.3732     0.5546 0.792 0.176 0.032 0.000 0.000
#> GSM11711     3  0.4496     0.7265 0.000 0.056 0.728 0.216 0.000
#> GSM11854     3  0.2516     0.7873 0.000 0.000 0.860 0.140 0.000
#> GSM11731     3  0.4138    -0.0513 0.384 0.000 0.616 0.000 0.000
#> GSM11839     3  0.0000     0.7921 0.000 0.000 1.000 0.000 0.000
#> GSM11836     3  0.3636     0.3595 0.272 0.000 0.728 0.000 0.000
#> GSM11849     1  0.4630     0.6992 0.744 0.000 0.116 0.140 0.000
#> GSM11682     4  0.2230     0.7050 0.000 0.000 0.116 0.884 0.000
#> GSM11690     3  0.0162     0.7911 0.000 0.000 0.996 0.004 0.000
#> GSM11692     3  0.0000     0.7921 0.000 0.000 1.000 0.000 0.000
#> GSM11841     3  0.0000     0.7921 0.000 0.000 1.000 0.000 0.000
#> GSM11901     3  0.0000     0.7921 0.000 0.000 1.000 0.000 0.000
#> GSM11715     1  0.3534     0.8495 0.744 0.000 0.256 0.000 0.000
#> GSM11724     1  0.3534     0.8495 0.744 0.000 0.256 0.000 0.000
#> GSM11684     1  0.3534     0.8495 0.744 0.000 0.256 0.000 0.000
#> GSM11696     3  0.3612     0.3880 0.268 0.000 0.732 0.000 0.000
#> GSM27952     4  0.1197     0.7428 0.000 0.000 0.048 0.952 0.000
#> GSM27948     3  0.0000     0.7921 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11735     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11733     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11863     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11710     6  0.3756      0.142 0.352 0.000 0.000 0.000 0.004 0.644
#> GSM11712     3  0.3266      0.732 0.000 0.000 0.728 0.272 0.000 0.000
#> GSM11732     3  0.0603      0.769 0.016 0.000 0.980 0.000 0.000 0.004
#> GSM11844     3  0.0820      0.770 0.016 0.000 0.972 0.000 0.000 0.012
#> GSM11842     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11860     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11686     6  0.1219      0.670 0.004 0.000 0.048 0.000 0.000 0.948
#> GSM11688     6  0.0146      0.698 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM11846     6  0.4026      0.474 0.160 0.000 0.088 0.000 0.000 0.752
#> GSM11680     3  0.0951      0.777 0.008 0.000 0.968 0.020 0.000 0.004
#> GSM11698     3  0.3073      0.701 0.008 0.000 0.788 0.000 0.000 0.204
#> GSM11840     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11847     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11685     6  0.2703      0.561 0.000 0.000 0.004 0.172 0.000 0.824
#> GSM11699     3  0.3468      0.735 0.008 0.000 0.728 0.264 0.000 0.000
#> GSM27950     6  0.3349      0.532 0.008 0.000 0.244 0.000 0.000 0.748
#> GSM27946     3  0.3151      0.742 0.000 0.000 0.748 0.252 0.000 0.000
#> GSM11709     1  0.2527      0.582 0.832 0.000 0.168 0.000 0.000 0.000
#> GSM11720     3  0.3221      0.705 0.264 0.000 0.736 0.000 0.000 0.000
#> GSM11726     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11837     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11725     3  0.3151      0.714 0.252 0.000 0.748 0.000 0.000 0.000
#> GSM11864     3  0.3151      0.714 0.252 0.000 0.748 0.000 0.000 0.000
#> GSM11687     3  0.3175      0.712 0.256 0.000 0.744 0.000 0.000 0.000
#> GSM11693     3  0.3175      0.712 0.256 0.000 0.744 0.000 0.000 0.000
#> GSM11727     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11838     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11681     1  0.3986     -0.100 0.532 0.000 0.004 0.000 0.000 0.464
#> GSM11689     3  0.3175      0.712 0.256 0.000 0.744 0.000 0.000 0.000
#> GSM11704     3  0.3151      0.714 0.252 0.000 0.748 0.000 0.000 0.000
#> GSM11703     1  0.2793      0.576 0.800 0.000 0.200 0.000 0.000 0.000
#> GSM11705     1  0.5088      0.591 0.632 0.000 0.168 0.000 0.000 0.200
#> GSM11722     1  0.3426      0.490 0.720 0.000 0.276 0.004 0.000 0.000
#> GSM11730     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11713     1  0.5421      0.394 0.580 0.216 0.000 0.000 0.000 0.204
#> GSM11728     1  0.6090      0.566 0.580 0.000 0.168 0.052 0.000 0.200
#> GSM27947     3  0.4030      0.756 0.080 0.000 0.748 0.172 0.000 0.000
#> GSM27951     1  0.2730      0.577 0.808 0.000 0.192 0.000 0.000 0.000
#> GSM11707     1  0.4453      0.252 0.524 0.000 0.020 0.000 0.004 0.452
#> GSM11716     3  0.0692      0.767 0.020 0.000 0.976 0.000 0.000 0.004
#> GSM11850     3  0.0692      0.767 0.020 0.000 0.976 0.000 0.000 0.004
#> GSM11851     3  0.0692      0.767 0.020 0.000 0.976 0.000 0.000 0.004
#> GSM11721     3  0.4783      0.632 0.088 0.000 0.636 0.276 0.000 0.000
#> GSM11852     3  0.3867      0.700 0.000 0.000 0.748 0.052 0.000 0.200
#> GSM11694     3  0.0603      0.769 0.016 0.000 0.980 0.000 0.000 0.004
#> GSM11695     3  0.0603      0.769 0.016 0.000 0.980 0.000 0.000 0.004
#> GSM11734     3  0.5076      0.610 0.132 0.000 0.620 0.248 0.000 0.000
#> GSM11861     3  0.0508      0.777 0.004 0.000 0.984 0.012 0.000 0.000
#> GSM11843     3  0.0508      0.776 0.000 0.000 0.984 0.012 0.000 0.004
#> GSM11862     3  0.2378      0.775 0.000 0.000 0.848 0.152 0.000 0.000
#> GSM11697     3  0.0603      0.769 0.016 0.000 0.980 0.000 0.000 0.004
#> GSM11714     1  0.4675      0.364 0.580 0.000 0.052 0.000 0.000 0.368
#> GSM11723     3  0.3586      0.735 0.012 0.000 0.720 0.268 0.000 0.000
#> GSM11845     3  0.3426      0.728 0.004 0.000 0.720 0.276 0.000 0.000
#> GSM11683     6  0.6003      0.287 0.268 0.000 0.252 0.004 0.000 0.476
#> GSM11691     3  0.0603      0.769 0.016 0.000 0.980 0.000 0.000 0.004
#> GSM27949     3  0.0603      0.769 0.016 0.000 0.980 0.000 0.000 0.004
#> GSM27945     3  0.0405      0.771 0.008 0.000 0.988 0.000 0.000 0.004
#> GSM11706     1  0.5294      0.417 0.580 0.000 0.044 0.000 0.040 0.336
#> GSM11853     3  0.3867      0.700 0.000 0.000 0.748 0.052 0.000 0.200
#> GSM11729     4  0.3364      0.306 0.024 0.196 0.000 0.780 0.000 0.000
#> GSM11746     4  0.3288      0.317 0.276 0.000 0.000 0.724 0.000 0.000
#> GSM11711     1  0.6001      0.571 0.580 0.000 0.180 0.040 0.000 0.200
#> GSM11854     3  0.3867      0.700 0.000 0.000 0.748 0.052 0.000 0.200
#> GSM11731     4  0.5081      0.363 0.128 0.000 0.256 0.616 0.000 0.000
#> GSM11839     3  0.5138      0.573 0.124 0.000 0.600 0.276 0.000 0.000
#> GSM11836     4  0.4165     -0.202 0.012 0.000 0.452 0.536 0.000 0.000
#> GSM11849     4  0.3394      0.312 0.024 0.000 0.000 0.776 0.000 0.200
#> GSM11682     6  0.0146      0.698 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM11690     3  0.3534      0.727 0.000 0.000 0.716 0.276 0.000 0.008
#> GSM11692     3  0.3288      0.729 0.000 0.000 0.724 0.276 0.000 0.000
#> GSM11841     3  0.3288      0.729 0.000 0.000 0.724 0.276 0.000 0.000
#> GSM11901     3  0.3288      0.729 0.000 0.000 0.724 0.276 0.000 0.000
#> GSM11715     4  0.0632      0.545 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM11724     4  0.0632      0.545 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM11684     4  0.0146      0.543 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM11696     4  0.3862     -0.282 0.000 0.000 0.476 0.524 0.000 0.000
#> GSM27952     6  0.0146      0.698 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM27948     3  0.3288      0.729 0.000 0.000 0.724 0.276 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-pam-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>         n cell.line(p) agent(p)  time(p) k
#> SD:pam 83     4.87e-05    0.184 6.54e-02 2
#> SD:pam 78     6.32e-06    0.240 3.26e-03 3
#> SD:pam 77     3.58e-07    0.827 1.05e-04 4
#> SD:pam 79     3.86e-10    0.874 8.06e-06 5
#> SD:pam 68     3.60e-09    0.200 1.73e-04 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


SD:mclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "mclust"]
# you can also extract it by
# res = res_list["SD:mclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 5.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.300           0.529       0.795         0.4127 0.520   0.520
#> 3 3 0.356           0.401       0.699         0.5555 0.686   0.470
#> 4 4 0.482           0.536       0.724         0.0594 0.804   0.554
#> 5 5 0.504           0.519       0.729         0.0694 0.890   0.696
#> 6 6 0.486           0.331       0.637         0.0651 0.922   0.742

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 5

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     2  0.4161     0.5925 0.084 0.916
#> GSM11735     2  0.4161     0.5925 0.084 0.916
#> GSM11733     2  0.2236     0.5915 0.036 0.964
#> GSM11863     2  0.9248     0.6067 0.340 0.660
#> GSM11710     2  0.8267     0.6027 0.260 0.740
#> GSM11712     1  0.3274     0.7476 0.940 0.060
#> GSM11732     1  0.9833    -0.2422 0.576 0.424
#> GSM11844     1  0.9850    -0.2383 0.572 0.428
#> GSM11842     2  0.9248     0.6067 0.340 0.660
#> GSM11860     2  0.9248     0.6067 0.340 0.660
#> GSM11686     2  0.7815     0.5763 0.232 0.768
#> GSM11688     2  0.7376     0.5990 0.208 0.792
#> GSM11846     1  0.9881    -0.2699 0.564 0.436
#> GSM11680     1  0.2778     0.7527 0.952 0.048
#> GSM11698     1  0.2948     0.7502 0.948 0.052
#> GSM11840     2  0.8327     0.6423 0.264 0.736
#> GSM11847     2  0.8327     0.6423 0.264 0.736
#> GSM11685     2  0.7299     0.5990 0.204 0.796
#> GSM11699     1  0.3114     0.7501 0.944 0.056
#> GSM27950     2  0.8327     0.5993 0.264 0.736
#> GSM27946     1  0.3114     0.7501 0.944 0.056
#> GSM11709     1  0.9795    -0.1824 0.584 0.416
#> GSM11720     1  0.1184     0.7472 0.984 0.016
#> GSM11726     2  0.9909     0.5268 0.444 0.556
#> GSM11837     2  0.9608     0.6054 0.384 0.616
#> GSM11725     1  0.1414     0.7454 0.980 0.020
#> GSM11864     1  0.0938     0.7490 0.988 0.012
#> GSM11687     1  0.1184     0.7472 0.984 0.016
#> GSM11693     1  0.1184     0.7472 0.984 0.016
#> GSM11727     2  0.9608     0.6054 0.384 0.616
#> GSM11838     2  0.9608     0.6054 0.384 0.616
#> GSM11681     2  0.8207     0.6000 0.256 0.744
#> GSM11689     1  0.1184     0.7472 0.984 0.016
#> GSM11704     1  0.1184     0.7472 0.984 0.016
#> GSM11703     1  0.1184     0.7472 0.984 0.016
#> GSM11705     1  0.9833    -0.2071 0.576 0.424
#> GSM11722     1  0.9881    -0.2447 0.564 0.436
#> GSM11730     2  0.9608     0.6054 0.384 0.616
#> GSM11713     2  0.9896     0.5303 0.440 0.560
#> GSM11728     1  0.9896    -0.2569 0.560 0.440
#> GSM27947     1  0.0938     0.7547 0.988 0.012
#> GSM27951     1  0.9732    -0.1455 0.596 0.404
#> GSM11707     2  0.8267     0.6027 0.260 0.740
#> GSM11716     1  0.0000     0.7516 1.000 0.000
#> GSM11850     1  0.0000     0.7516 1.000 0.000
#> GSM11851     1  0.2043     0.7553 0.968 0.032
#> GSM11721     1  0.3274     0.7476 0.940 0.060
#> GSM11852     1  0.3114     0.7501 0.944 0.056
#> GSM11694     1  0.0672     0.7505 0.992 0.008
#> GSM11695     1  0.0672     0.7505 0.992 0.008
#> GSM11734     1  0.4815     0.7261 0.896 0.104
#> GSM11861     1  0.3114     0.7501 0.944 0.056
#> GSM11843     1  0.3114     0.7501 0.944 0.056
#> GSM11862     1  0.3114     0.7501 0.944 0.056
#> GSM11697     1  0.0672     0.7505 0.992 0.008
#> GSM11714     2  0.8267     0.6027 0.260 0.740
#> GSM11723     1  0.2603     0.7548 0.956 0.044
#> GSM11845     1  0.3114     0.7501 0.944 0.056
#> GSM11683     1  0.9795     0.0950 0.584 0.416
#> GSM11691     1  0.0000     0.7516 1.000 0.000
#> GSM27949     1  0.5178     0.6460 0.884 0.116
#> GSM27945     1  0.0672     0.7505 0.992 0.008
#> GSM11706     2  0.8267     0.6027 0.260 0.740
#> GSM11853     1  0.0672     0.7505 0.992 0.008
#> GSM11729     2  0.9608     0.6054 0.384 0.616
#> GSM11746     2  0.9608     0.6054 0.384 0.616
#> GSM11711     1  0.9732    -0.1812 0.596 0.404
#> GSM11854     1  0.2423     0.7545 0.960 0.040
#> GSM11731     2  0.9993     0.3120 0.484 0.516
#> GSM11839     1  0.9933    -0.1506 0.548 0.452
#> GSM11836     2  0.9170     0.6077 0.332 0.668
#> GSM11849     2  0.9286     0.5997 0.344 0.656
#> GSM11682     2  0.7219     0.6015 0.200 0.800
#> GSM11690     1  0.9795    -0.0402 0.584 0.416
#> GSM11692     1  0.3274     0.7476 0.940 0.060
#> GSM11841     1  0.3274     0.7476 0.940 0.060
#> GSM11901     1  0.3274     0.7476 0.940 0.060
#> GSM11715     2  0.9087     0.6080 0.324 0.676
#> GSM11724     2  0.9129     0.6081 0.328 0.672
#> GSM11684     1  0.9993    -0.2690 0.516 0.484
#> GSM11696     1  0.9977    -0.2333 0.528 0.472
#> GSM27952     2  0.7299     0.6018 0.204 0.796
#> GSM27948     1  0.3274     0.7476 0.940 0.060

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     2  0.6168     0.3187 0.000 0.588 0.412
#> GSM11735     2  0.6168     0.3187 0.000 0.588 0.412
#> GSM11733     2  0.7251     0.5550 0.348 0.612 0.040
#> GSM11863     2  0.6398     0.5524 0.372 0.620 0.008
#> GSM11710     3  0.1647     0.5677 0.004 0.036 0.960
#> GSM11712     1  0.0892     0.5559 0.980 0.000 0.020
#> GSM11732     3  0.1399     0.5817 0.004 0.028 0.968
#> GSM11844     3  0.1399     0.5795 0.004 0.028 0.968
#> GSM11842     2  0.6398     0.5524 0.372 0.620 0.008
#> GSM11860     2  0.8392     0.4608 0.148 0.616 0.236
#> GSM11686     3  0.5905     0.3814 0.352 0.000 0.648
#> GSM11688     3  0.1315     0.5828 0.020 0.008 0.972
#> GSM11846     3  0.0829     0.5818 0.004 0.012 0.984
#> GSM11680     1  0.6427     0.4987 0.640 0.012 0.348
#> GSM11698     3  0.6470     0.0394 0.356 0.012 0.632
#> GSM11840     2  0.6529     0.5530 0.368 0.620 0.012
#> GSM11847     2  0.6398     0.5524 0.372 0.620 0.008
#> GSM11685     3  0.6079     0.2593 0.388 0.000 0.612
#> GSM11699     1  0.1860     0.5715 0.948 0.000 0.052
#> GSM27950     3  0.1031     0.5820 0.024 0.000 0.976
#> GSM27946     1  0.2356     0.5729 0.928 0.000 0.072
#> GSM11709     3  0.6704     0.3711 0.016 0.376 0.608
#> GSM11720     1  0.6566     0.4273 0.612 0.376 0.012
#> GSM11726     2  0.4723     0.4293 0.016 0.824 0.160
#> GSM11837     2  0.4059     0.4601 0.012 0.860 0.128
#> GSM11725     2  0.9952    -0.2839 0.292 0.376 0.332
#> GSM11864     1  0.8295     0.4486 0.548 0.088 0.364
#> GSM11687     1  0.6704     0.4253 0.608 0.376 0.016
#> GSM11693     1  0.6566     0.4273 0.612 0.376 0.012
#> GSM11727     2  0.4209     0.4586 0.016 0.856 0.128
#> GSM11838     2  0.4059     0.4601 0.012 0.860 0.128
#> GSM11681     3  0.6369     0.4252 0.016 0.316 0.668
#> GSM11689     1  0.6704     0.4253 0.608 0.376 0.016
#> GSM11704     1  0.6899     0.4323 0.612 0.364 0.024
#> GSM11703     1  0.6686     0.4293 0.612 0.372 0.016
#> GSM11705     3  0.6952     0.3718 0.024 0.376 0.600
#> GSM11722     3  0.9642     0.2688 0.208 0.376 0.416
#> GSM11730     2  0.4475     0.4458 0.016 0.840 0.144
#> GSM11713     2  0.5580     0.2961 0.008 0.736 0.256
#> GSM11728     3  0.4209     0.5078 0.020 0.120 0.860
#> GSM27947     1  0.6667     0.4934 0.616 0.016 0.368
#> GSM27951     3  0.9138     0.3390 0.148 0.376 0.476
#> GSM11707     3  0.5988     0.3739 0.000 0.368 0.632
#> GSM11716     1  0.7637     0.5005 0.616 0.064 0.320
#> GSM11850     1  0.8258     0.4967 0.604 0.112 0.284
#> GSM11851     1  0.7032     0.4860 0.604 0.028 0.368
#> GSM11721     1  0.1964     0.5327 0.944 0.000 0.056
#> GSM11852     1  0.1289     0.5673 0.968 0.000 0.032
#> GSM11694     1  0.7209     0.4911 0.604 0.036 0.360
#> GSM11695     1  0.7209     0.4911 0.604 0.036 0.360
#> GSM11734     1  0.4842     0.3547 0.776 0.000 0.224
#> GSM11861     1  0.1411     0.5668 0.964 0.000 0.036
#> GSM11843     1  0.6129     0.5184 0.668 0.008 0.324
#> GSM11862     1  0.0237     0.5563 0.996 0.000 0.004
#> GSM11697     1  0.7209     0.4911 0.604 0.036 0.360
#> GSM11714     3  0.5497     0.4408 0.000 0.292 0.708
#> GSM11723     3  0.6822    -0.3472 0.480 0.012 0.508
#> GSM11845     1  0.2625     0.5727 0.916 0.000 0.084
#> GSM11683     3  0.5706     0.1449 0.320 0.000 0.680
#> GSM11691     1  0.6667     0.4934 0.616 0.016 0.368
#> GSM27949     3  0.6934     0.0516 0.348 0.028 0.624
#> GSM27945     1  0.7209     0.4911 0.604 0.036 0.360
#> GSM11706     3  0.0661     0.5810 0.004 0.008 0.988
#> GSM11853     1  0.7209     0.4911 0.604 0.036 0.360
#> GSM11729     2  0.7075     0.2768 0.020 0.496 0.484
#> GSM11746     2  0.6941     0.2915 0.016 0.520 0.464
#> GSM11711     3  0.1170     0.5833 0.008 0.016 0.976
#> GSM11854     1  0.6832     0.4851 0.604 0.020 0.376
#> GSM11731     1  0.8432    -0.0397 0.576 0.112 0.312
#> GSM11839     1  0.6180    -0.0757 0.584 0.000 0.416
#> GSM11836     2  0.8895     0.5245 0.392 0.484 0.124
#> GSM11849     1  0.9651    -0.5318 0.396 0.396 0.208
#> GSM11682     3  0.7610     0.1885 0.388 0.048 0.564
#> GSM11690     1  0.5733     0.1429 0.676 0.000 0.324
#> GSM11692     1  0.1529     0.5415 0.960 0.000 0.040
#> GSM11841     1  0.3619     0.4630 0.864 0.000 0.136
#> GSM11901     1  0.3551     0.4675 0.868 0.000 0.132
#> GSM11715     2  0.8895     0.5245 0.392 0.484 0.124
#> GSM11724     2  0.8895     0.5245 0.392 0.484 0.124
#> GSM11684     3  0.8440     0.0976 0.420 0.088 0.492
#> GSM11696     1  0.5733     0.1488 0.676 0.000 0.324
#> GSM27952     3  0.2537     0.5596 0.080 0.000 0.920
#> GSM27948     1  0.2165     0.5271 0.936 0.000 0.064

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     4  0.6411     0.5340 0.308 0.000 0.092 0.600
#> GSM11735     4  0.4868     0.5760 0.304 0.000 0.012 0.684
#> GSM11733     4  0.1635     0.7853 0.008 0.000 0.044 0.948
#> GSM11863     4  0.1118     0.7904 0.000 0.000 0.036 0.964
#> GSM11710     1  0.3142     0.5493 0.860 0.008 0.132 0.000
#> GSM11712     3  0.6582     0.6136 0.088 0.008 0.612 0.292
#> GSM11732     1  0.5223     0.4661 0.584 0.004 0.408 0.004
#> GSM11844     1  0.5060     0.4656 0.584 0.004 0.412 0.000
#> GSM11842     4  0.1118     0.7904 0.000 0.000 0.036 0.964
#> GSM11860     4  0.4422     0.5836 0.008 0.000 0.256 0.736
#> GSM11686     1  0.7412     0.4074 0.504 0.000 0.296 0.200
#> GSM11688     1  0.2999     0.5500 0.864 0.004 0.132 0.000
#> GSM11846     1  0.5055     0.4845 0.624 0.008 0.368 0.000
#> GSM11680     3  0.1576     0.7088 0.004 0.000 0.948 0.048
#> GSM11698     3  0.1211     0.6802 0.040 0.000 0.960 0.000
#> GSM11840     4  0.1118     0.7904 0.000 0.000 0.036 0.964
#> GSM11847     4  0.1118     0.7904 0.000 0.000 0.036 0.964
#> GSM11685     1  0.5366     0.4440 0.684 0.000 0.040 0.276
#> GSM11699     3  0.5623     0.6383 0.048 0.000 0.660 0.292
#> GSM27950     1  0.2814     0.5499 0.868 0.000 0.132 0.000
#> GSM27946     3  0.5195     0.6490 0.032 0.000 0.692 0.276
#> GSM11709     1  0.5582     0.3417 0.576 0.400 0.024 0.000
#> GSM11720     3  0.4843     0.5011 0.000 0.396 0.604 0.000
#> GSM11726     2  0.3196     0.4947 0.136 0.856 0.008 0.000
#> GSM11837     2  0.0188     0.5908 0.000 0.996 0.004 0.000
#> GSM11725     3  0.7446     0.2148 0.172 0.396 0.432 0.000
#> GSM11864     3  0.2238     0.6964 0.004 0.072 0.920 0.004
#> GSM11687     3  0.4843     0.5011 0.000 0.396 0.604 0.000
#> GSM11693     3  0.4843     0.5011 0.000 0.396 0.604 0.000
#> GSM11727     2  0.0895     0.5918 0.020 0.976 0.004 0.000
#> GSM11838     2  0.0188     0.5908 0.000 0.996 0.004 0.000
#> GSM11681     1  0.4194     0.4606 0.764 0.228 0.008 0.000
#> GSM11689     3  0.4843     0.5011 0.000 0.396 0.604 0.000
#> GSM11704     3  0.4843     0.5011 0.000 0.396 0.604 0.000
#> GSM11703     3  0.4843     0.5011 0.000 0.396 0.604 0.000
#> GSM11705     1  0.5398     0.3384 0.580 0.404 0.016 0.000
#> GSM11722     1  0.7398     0.2531 0.424 0.412 0.164 0.000
#> GSM11730     2  0.4188     0.3156 0.244 0.752 0.004 0.000
#> GSM11713     1  0.4994     0.2373 0.520 0.480 0.000 0.000
#> GSM11728     1  0.3498     0.4896 0.832 0.160 0.008 0.000
#> GSM27947     3  0.0524     0.7066 0.004 0.008 0.988 0.000
#> GSM27951     1  0.7629     0.2356 0.404 0.392 0.204 0.000
#> GSM11707     1  0.3279     0.5450 0.872 0.032 0.096 0.000
#> GSM11716     3  0.0657     0.7079 0.004 0.012 0.984 0.000
#> GSM11850     3  0.0469     0.7072 0.000 0.012 0.988 0.000
#> GSM11851     3  0.0188     0.7049 0.004 0.000 0.996 0.000
#> GSM11721     3  0.6578     0.6036 0.096 0.004 0.604 0.296
#> GSM11852     3  0.5851     0.6324 0.068 0.000 0.660 0.272
#> GSM11694     3  0.0188     0.7049 0.004 0.000 0.996 0.000
#> GSM11695     3  0.0188     0.7049 0.004 0.000 0.996 0.000
#> GSM11734     3  0.7421     0.5281 0.164 0.008 0.536 0.292
#> GSM11861     3  0.5972     0.6292 0.068 0.000 0.640 0.292
#> GSM11843     3  0.1722     0.7105 0.000 0.008 0.944 0.048
#> GSM11862     3  0.6295     0.6134 0.088 0.000 0.616 0.296
#> GSM11697     3  0.0188     0.7049 0.004 0.000 0.996 0.000
#> GSM11714     1  0.2741     0.5424 0.892 0.012 0.096 0.000
#> GSM11723     3  0.1356     0.7082 0.000 0.008 0.960 0.032
#> GSM11845     3  0.5185     0.6687 0.032 0.008 0.728 0.232
#> GSM11683     3  0.4222     0.5294 0.272 0.000 0.728 0.000
#> GSM11691     3  0.0524     0.7066 0.004 0.008 0.988 0.000
#> GSM27949     3  0.1940     0.6466 0.076 0.000 0.924 0.000
#> GSM27945     3  0.0000     0.7053 0.000 0.000 1.000 0.000
#> GSM11706     1  0.3196     0.5504 0.856 0.008 0.136 0.000
#> GSM11853     3  0.0188     0.7049 0.004 0.000 0.996 0.000
#> GSM11729     2  0.5047     0.3651 0.004 0.636 0.356 0.004
#> GSM11746     2  0.4786     0.4256 0.004 0.688 0.304 0.004
#> GSM11711     1  0.4877     0.4695 0.592 0.000 0.408 0.000
#> GSM11854     3  0.0188     0.7049 0.004 0.000 0.996 0.000
#> GSM11731     1  0.7861     0.3715 0.536 0.040 0.132 0.292
#> GSM11839     1  0.7759     0.3735 0.536 0.028 0.148 0.288
#> GSM11836     2  0.6536     0.3469 0.096 0.612 0.004 0.288
#> GSM11849     1  0.7088     0.3199 0.564 0.144 0.004 0.288
#> GSM11682     1  0.4770     0.4274 0.700 0.012 0.000 0.288
#> GSM11690     1  0.8266    -0.0547 0.364 0.012 0.336 0.288
#> GSM11692     3  0.6524     0.6070 0.092 0.004 0.608 0.296
#> GSM11841     3  0.6962     0.5958 0.108 0.012 0.588 0.292
#> GSM11901     3  0.6751     0.5941 0.108 0.004 0.588 0.300
#> GSM11715     2  0.6536     0.3469 0.096 0.612 0.004 0.288
#> GSM11724     2  0.6536     0.3469 0.096 0.612 0.004 0.288
#> GSM11684     1  0.7293     0.3973 0.576 0.024 0.112 0.288
#> GSM11696     1  0.8246     0.0197 0.384 0.012 0.316 0.288
#> GSM27952     1  0.3375     0.5527 0.864 0.008 0.116 0.012
#> GSM27948     3  0.6578     0.6036 0.096 0.004 0.604 0.296

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     5  0.4854     0.5895 0.000 0.000 0.308 0.044 0.648
#> GSM11735     5  0.3958     0.7155 0.000 0.000 0.184 0.040 0.776
#> GSM11733     5  0.3736     0.8686 0.072 0.000 0.004 0.100 0.824
#> GSM11863     5  0.3639     0.8697 0.076 0.000 0.000 0.100 0.824
#> GSM11710     3  0.2787     0.7082 0.000 0.004 0.856 0.136 0.004
#> GSM11712     4  0.4938     0.2249 0.448 0.008 0.004 0.532 0.008
#> GSM11732     3  0.4851     0.6074 0.004 0.004 0.608 0.368 0.016
#> GSM11844     3  0.4414     0.6114 0.004 0.004 0.616 0.376 0.000
#> GSM11842     5  0.3644     0.8653 0.080 0.000 0.000 0.096 0.824
#> GSM11860     5  0.5007     0.7024 0.032 0.000 0.024 0.256 0.688
#> GSM11686     4  0.4541     0.4486 0.032 0.000 0.288 0.680 0.000
#> GSM11688     3  0.3246     0.6994 0.008 0.000 0.808 0.184 0.000
#> GSM11846     3  0.4505     0.6162 0.004 0.008 0.620 0.368 0.000
#> GSM11680     4  0.1739     0.6172 0.024 0.004 0.032 0.940 0.000
#> GSM11698     4  0.1862     0.6056 0.016 0.004 0.048 0.932 0.000
#> GSM11840     5  0.3639     0.8697 0.076 0.000 0.000 0.100 0.824
#> GSM11847     5  0.3639     0.8697 0.076 0.000 0.000 0.100 0.824
#> GSM11685     3  0.5975     0.5726 0.132 0.000 0.684 0.112 0.072
#> GSM11699     4  0.4111     0.4972 0.280 0.004 0.008 0.708 0.000
#> GSM27950     3  0.4012     0.6814 0.012 0.000 0.760 0.216 0.012
#> GSM27946     4  0.3737     0.5465 0.224 0.004 0.008 0.764 0.000
#> GSM11709     3  0.5099     0.4465 0.004 0.384 0.584 0.020 0.008
#> GSM11720     4  0.6177     0.4082 0.084 0.376 0.000 0.520 0.020
#> GSM11726     2  0.1377     0.6739 0.020 0.956 0.020 0.004 0.000
#> GSM11837     2  0.1857     0.6813 0.000 0.928 0.008 0.004 0.060
#> GSM11725     4  0.7326     0.3935 0.084 0.332 0.024 0.500 0.060
#> GSM11864     4  0.6843     0.5086 0.084 0.120 0.036 0.652 0.108
#> GSM11687     4  0.5158     0.4358 0.036 0.392 0.004 0.568 0.000
#> GSM11693     4  0.5542     0.4217 0.072 0.396 0.000 0.532 0.000
#> GSM11727     2  0.1179     0.6751 0.016 0.964 0.016 0.004 0.000
#> GSM11838     2  0.1205     0.6817 0.000 0.956 0.000 0.004 0.040
#> GSM11681     3  0.6508     0.5253 0.016 0.240 0.592 0.140 0.012
#> GSM11689     4  0.5330     0.4280 0.056 0.396 0.000 0.548 0.000
#> GSM11704     4  0.5290     0.4337 0.044 0.392 0.000 0.560 0.004
#> GSM11703     4  0.5213     0.4356 0.048 0.396 0.000 0.556 0.000
#> GSM11705     3  0.5440     0.4463 0.008 0.372 0.580 0.028 0.012
#> GSM11722     1  0.5895    -0.1077 0.556 0.376 0.032 0.016 0.020
#> GSM11730     2  0.1739     0.6673 0.032 0.940 0.024 0.004 0.000
#> GSM11713     2  0.3456     0.6325 0.036 0.844 0.108 0.000 0.012
#> GSM11728     3  0.6375     0.5508 0.080 0.248 0.620 0.040 0.012
#> GSM27947     4  0.1569     0.6262 0.032 0.008 0.012 0.948 0.000
#> GSM27951     4  0.6556     0.3898 0.020 0.332 0.096 0.540 0.012
#> GSM11707     3  0.2609     0.6614 0.000 0.004 0.896 0.048 0.052
#> GSM11716     4  0.3827     0.6087 0.016 0.060 0.008 0.840 0.076
#> GSM11850     4  0.1996     0.6222 0.000 0.032 0.004 0.928 0.036
#> GSM11851     4  0.2610     0.6060 0.076 0.000 0.028 0.892 0.004
#> GSM11721     1  0.4451    -0.2832 0.504 0.000 0.004 0.492 0.000
#> GSM11852     4  0.4645     0.3989 0.376 0.008 0.008 0.608 0.000
#> GSM11694     4  0.0693     0.6208 0.000 0.000 0.008 0.980 0.012
#> GSM11695     4  0.0451     0.6190 0.004 0.000 0.008 0.988 0.000
#> GSM11734     1  0.6414     0.0451 0.508 0.008 0.040 0.392 0.052
#> GSM11861     4  0.4562     0.2869 0.444 0.004 0.004 0.548 0.000
#> GSM11843     4  0.6046     0.4923 0.196 0.008 0.044 0.668 0.084
#> GSM11862     4  0.4302     0.2187 0.480 0.000 0.000 0.520 0.000
#> GSM11697     4  0.0451     0.6214 0.004 0.000 0.008 0.988 0.000
#> GSM11714     3  0.2623     0.6655 0.004 0.004 0.900 0.048 0.044
#> GSM11723     4  0.5514     0.5427 0.160 0.016 0.024 0.720 0.080
#> GSM11845     4  0.5179     0.4874 0.244 0.008 0.004 0.684 0.060
#> GSM11683     4  0.3756     0.5068 0.008 0.000 0.248 0.744 0.000
#> GSM11691     4  0.2629     0.6075 0.104 0.004 0.012 0.880 0.000
#> GSM27949     4  0.1408     0.6089 0.008 0.000 0.044 0.948 0.000
#> GSM27945     4  0.0693     0.6231 0.012 0.000 0.000 0.980 0.008
#> GSM11706     3  0.3264     0.7056 0.000 0.004 0.840 0.132 0.024
#> GSM11853     4  0.0771     0.6193 0.004 0.000 0.020 0.976 0.000
#> GSM11729     2  0.6128     0.5629 0.008 0.672 0.044 0.160 0.116
#> GSM11746     2  0.5512     0.5919 0.000 0.712 0.040 0.136 0.112
#> GSM11711     3  0.4264     0.6145 0.004 0.000 0.620 0.376 0.000
#> GSM11854     4  0.1471     0.6161 0.020 0.004 0.024 0.952 0.000
#> GSM11731     1  0.2800     0.4400 0.900 0.020 0.032 0.008 0.040
#> GSM11839     1  0.1616     0.4564 0.948 0.008 0.032 0.008 0.004
#> GSM11836     2  0.4676     0.4129 0.392 0.592 0.004 0.000 0.012
#> GSM11849     2  0.5014     0.3716 0.432 0.536 0.032 0.000 0.000
#> GSM11682     3  0.4365     0.4587 0.308 0.004 0.676 0.012 0.000
#> GSM11690     1  0.5289     0.1412 0.556 0.008 0.036 0.400 0.000
#> GSM11692     4  0.4278     0.2454 0.452 0.000 0.000 0.548 0.000
#> GSM11841     4  0.4305     0.1810 0.488 0.000 0.000 0.512 0.000
#> GSM11901     4  0.4307     0.1703 0.496 0.000 0.000 0.504 0.000
#> GSM11715     2  0.5299     0.4739 0.336 0.612 0.036 0.000 0.016
#> GSM11724     2  0.5242     0.4708 0.340 0.612 0.032 0.000 0.016
#> GSM11684     1  0.2623     0.4048 0.884 0.016 0.096 0.004 0.000
#> GSM11696     1  0.4160     0.5103 0.772 0.008 0.036 0.184 0.000
#> GSM27952     3  0.2629     0.7085 0.004 0.000 0.860 0.136 0.000
#> GSM27948     4  0.4420     0.2414 0.448 0.000 0.004 0.548 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     5  0.3935    0.57704 0.008 0.000 0.000 0.012 0.692 0.288
#> GSM11735     5  0.2994    0.67497 0.008 0.000 0.000 0.008 0.820 0.164
#> GSM11733     5  0.1958    0.85545 0.000 0.000 0.100 0.000 0.896 0.004
#> GSM11863     5  0.1863    0.85804 0.000 0.000 0.104 0.000 0.896 0.000
#> GSM11710     6  0.4813    0.54121 0.200 0.000 0.092 0.000 0.016 0.692
#> GSM11712     3  0.5991    0.06318 0.004 0.256 0.480 0.260 0.000 0.000
#> GSM11732     6  0.5077    0.39900 0.008 0.000 0.400 0.060 0.000 0.532
#> GSM11844     6  0.4427    0.39976 0.004 0.000 0.428 0.020 0.000 0.548
#> GSM11842     5  0.1863    0.85804 0.000 0.000 0.104 0.000 0.896 0.000
#> GSM11860     5  0.4921    0.60969 0.000 0.044 0.288 0.000 0.640 0.028
#> GSM11686     6  0.4703    0.12569 0.000 0.000 0.380 0.052 0.000 0.568
#> GSM11688     6  0.4671    0.54607 0.148 0.000 0.112 0.012 0.004 0.724
#> GSM11846     6  0.5688    0.46718 0.140 0.000 0.384 0.004 0.000 0.472
#> GSM11680     3  0.1168    0.50506 0.000 0.000 0.956 0.016 0.000 0.028
#> GSM11698     3  0.3385    0.37726 0.004 0.000 0.796 0.028 0.000 0.172
#> GSM11840     5  0.1863    0.85804 0.000 0.000 0.104 0.000 0.896 0.000
#> GSM11847     5  0.1863    0.85804 0.000 0.000 0.104 0.000 0.896 0.000
#> GSM11685     6  0.3984    0.45400 0.012 0.008 0.056 0.012 0.104 0.808
#> GSM11699     3  0.4544    0.40797 0.008 0.092 0.712 0.188 0.000 0.000
#> GSM27950     6  0.4256    0.51460 0.016 0.000 0.156 0.004 0.064 0.760
#> GSM27946     3  0.3656    0.45694 0.008 0.076 0.804 0.112 0.000 0.000
#> GSM11709     6  0.5183   -0.05273 0.396 0.004 0.040 0.020 0.000 0.540
#> GSM11720     3  0.5786    0.22050 0.364 0.008 0.484 0.144 0.000 0.000
#> GSM11726     2  0.4400    0.35815 0.428 0.552 0.004 0.004 0.000 0.012
#> GSM11837     2  0.4751    0.44033 0.316 0.620 0.004 0.060 0.000 0.000
#> GSM11725     4  0.7829   -0.05965 0.304 0.016 0.216 0.320 0.000 0.144
#> GSM11864     3  0.6404    0.15257 0.064 0.116 0.472 0.348 0.000 0.000
#> GSM11687     3  0.5283    0.25252 0.400 0.004 0.508 0.088 0.000 0.000
#> GSM11693     3  0.5558    0.24023 0.396 0.008 0.488 0.108 0.000 0.000
#> GSM11727     2  0.4093    0.34985 0.440 0.552 0.004 0.000 0.000 0.004
#> GSM11838     2  0.4441    0.42522 0.344 0.620 0.004 0.032 0.000 0.000
#> GSM11681     6  0.6350   -0.00289 0.220 0.000 0.072 0.124 0.008 0.576
#> GSM11689     3  0.5596    0.23443 0.400 0.008 0.480 0.112 0.000 0.000
#> GSM11704     3  0.5524    0.24190 0.396 0.008 0.492 0.104 0.000 0.000
#> GSM11703     3  0.5296    0.24800 0.396 0.008 0.516 0.080 0.000 0.000
#> GSM11705     6  0.4955   -0.01242 0.380 0.004 0.020 0.020 0.004 0.572
#> GSM11722     1  0.6280    0.25726 0.504 0.020 0.008 0.296 0.000 0.172
#> GSM11730     1  0.4716   -0.28386 0.552 0.404 0.004 0.000 0.000 0.040
#> GSM11713     1  0.6073    0.13823 0.564 0.212 0.000 0.020 0.008 0.196
#> GSM11728     1  0.5296    0.17507 0.536 0.036 0.000 0.024 0.008 0.396
#> GSM27947     3  0.1049    0.50371 0.008 0.000 0.960 0.032 0.000 0.000
#> GSM27951     1  0.7721   -0.02397 0.292 0.000 0.284 0.136 0.008 0.280
#> GSM11707     6  0.4845    0.47028 0.204 0.000 0.004 0.012 0.088 0.692
#> GSM11716     3  0.5130    0.40426 0.080 0.008 0.672 0.220 0.000 0.020
#> GSM11850     3  0.3023    0.47848 0.044 0.000 0.836 0.120 0.000 0.000
#> GSM11851     3  0.3487    0.42058 0.000 0.000 0.756 0.224 0.000 0.020
#> GSM11721     3  0.6493   -0.01781 0.000 0.264 0.424 0.288 0.000 0.024
#> GSM11852     3  0.4976    0.34480 0.012 0.088 0.652 0.248 0.000 0.000
#> GSM11694     3  0.1908    0.48385 0.004 0.000 0.900 0.096 0.000 0.000
#> GSM11695     3  0.1700    0.49063 0.004 0.000 0.916 0.080 0.000 0.000
#> GSM11734     4  0.7202    0.31260 0.000 0.220 0.252 0.416 0.000 0.112
#> GSM11861     4  0.5808   -0.18163 0.004 0.156 0.420 0.420 0.000 0.000
#> GSM11843     3  0.5602    0.21639 0.000 0.188 0.536 0.276 0.000 0.000
#> GSM11862     3  0.6100    0.09423 0.012 0.260 0.492 0.236 0.000 0.000
#> GSM11697     3  0.0777    0.50407 0.004 0.000 0.972 0.024 0.000 0.000
#> GSM11714     6  0.4771    0.47186 0.200 0.000 0.004 0.012 0.084 0.700
#> GSM11723     3  0.5443    0.10504 0.000 0.124 0.492 0.384 0.000 0.000
#> GSM11845     3  0.5558    0.13990 0.000 0.144 0.492 0.364 0.000 0.000
#> GSM11683     3  0.4477    0.15286 0.004 0.000 0.552 0.016 0.004 0.424
#> GSM11691     3  0.3011    0.45761 0.004 0.000 0.800 0.192 0.000 0.004
#> GSM27949     3  0.3269    0.35515 0.000 0.000 0.792 0.024 0.000 0.184
#> GSM27945     3  0.1958    0.48310 0.004 0.000 0.896 0.100 0.000 0.000
#> GSM11706     6  0.6085    0.53268 0.204 0.000 0.096 0.012 0.072 0.616
#> GSM11853     3  0.0363    0.50593 0.000 0.000 0.988 0.012 0.000 0.000
#> GSM11729     2  0.4478    0.48727 0.036 0.748 0.068 0.148 0.000 0.000
#> GSM11746     2  0.4881    0.48699 0.060 0.720 0.068 0.152 0.000 0.000
#> GSM11711     6  0.4049    0.42736 0.004 0.000 0.412 0.004 0.000 0.580
#> GSM11854     3  0.0976    0.50564 0.008 0.000 0.968 0.016 0.000 0.008
#> GSM11731     4  0.7183    0.20642 0.112 0.284 0.004 0.432 0.000 0.168
#> GSM11839     4  0.7121    0.29222 0.104 0.268 0.004 0.448 0.000 0.176
#> GSM11836     2  0.3296    0.37581 0.004 0.824 0.000 0.132 0.036 0.004
#> GSM11849     2  0.6375    0.03976 0.296 0.512 0.000 0.128 0.000 0.064
#> GSM11682     6  0.6110    0.29196 0.260 0.044 0.004 0.112 0.004 0.576
#> GSM11690     4  0.8325    0.42733 0.044 0.260 0.220 0.292 0.000 0.184
#> GSM11692     3  0.6018    0.04712 0.004 0.264 0.472 0.260 0.000 0.000
#> GSM11841     3  0.6182   -0.10911 0.004 0.264 0.392 0.340 0.000 0.000
#> GSM11901     3  0.6154   -0.07180 0.004 0.264 0.416 0.316 0.000 0.000
#> GSM11715     2  0.0858    0.50253 0.028 0.968 0.000 0.004 0.000 0.000
#> GSM11724     2  0.0858    0.50253 0.028 0.968 0.000 0.004 0.000 0.000
#> GSM11684     1  0.7682   -0.34045 0.280 0.260 0.000 0.268 0.000 0.192
#> GSM11696     4  0.8385    0.43878 0.084 0.264 0.132 0.340 0.000 0.180
#> GSM27952     6  0.4451    0.54557 0.148 0.000 0.092 0.012 0.004 0.744
#> GSM27948     3  0.6707    0.00437 0.008 0.264 0.440 0.260 0.000 0.028

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-mclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>            n cell.line(p) agent(p)  time(p) k
#> SD:mclust 68     1.22e-03    0.744 3.61e-03 2
#> SD:mclust 30     1.76e-02    0.570 4.54e-05 3
#> SD:mclust 55     1.08e-05    0.544 5.51e-04 4
#> SD:mclust 49     2.00e-06    0.643 2.25e-04 5
#> SD:mclust 20     5.42e-02    0.254 1.92e-02 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


SD:NMF

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["SD", "NMF"]
# you can also extract it by
# res = res_list["SD:NMF"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 5.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk SD-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk SD-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.657           0.826       0.927         0.4089 0.574   0.574
#> 3 3 0.319           0.450       0.715         0.4995 0.654   0.460
#> 4 4 0.451           0.603       0.760         0.1602 0.653   0.297
#> 5 5 0.633           0.613       0.799         0.0700 0.854   0.550
#> 6 6 0.578           0.486       0.688         0.0543 0.894   0.611

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 5

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     2  0.0000     0.8421 0.000 1.000
#> GSM11735     2  0.0000     0.8421 0.000 1.000
#> GSM11733     2  0.0000     0.8421 0.000 1.000
#> GSM11863     2  0.0000     0.8421 0.000 1.000
#> GSM11710     2  0.0000     0.8421 0.000 1.000
#> GSM11712     1  0.0000     0.9440 1.000 0.000
#> GSM11732     2  0.0000     0.8421 0.000 1.000
#> GSM11844     1  0.9661     0.2319 0.608 0.392
#> GSM11842     2  0.2043     0.8310 0.032 0.968
#> GSM11860     2  0.8386     0.6164 0.268 0.732
#> GSM11686     2  0.9896     0.3514 0.440 0.560
#> GSM11688     2  0.6048     0.7866 0.148 0.852
#> GSM11846     2  0.0938     0.8400 0.012 0.988
#> GSM11680     2  0.9944     0.3061 0.456 0.544
#> GSM11698     1  0.9833     0.1182 0.576 0.424
#> GSM11840     2  0.0000     0.8421 0.000 1.000
#> GSM11847     2  0.0000     0.8421 0.000 1.000
#> GSM11685     2  0.6973     0.7624 0.188 0.812
#> GSM11699     1  0.1414     0.9292 0.980 0.020
#> GSM27950     2  0.0000     0.8421 0.000 1.000
#> GSM27946     1  0.0000     0.9440 1.000 0.000
#> GSM11709     1  0.3733     0.8757 0.928 0.072
#> GSM11720     1  0.0000     0.9440 1.000 0.000
#> GSM11726     1  0.0000     0.9440 1.000 0.000
#> GSM11837     1  0.0000     0.9440 1.000 0.000
#> GSM11725     1  0.0000     0.9440 1.000 0.000
#> GSM11864     1  0.0000     0.9440 1.000 0.000
#> GSM11687     1  0.0000     0.9440 1.000 0.000
#> GSM11693     1  0.0000     0.9440 1.000 0.000
#> GSM11727     1  0.0000     0.9440 1.000 0.000
#> GSM11838     1  0.0000     0.9440 1.000 0.000
#> GSM11681     1  0.9815     0.1324 0.580 0.420
#> GSM11689     1  0.0000     0.9440 1.000 0.000
#> GSM11704     1  0.0000     0.9440 1.000 0.000
#> GSM11703     1  0.0000     0.9440 1.000 0.000
#> GSM11705     1  0.0000     0.9440 1.000 0.000
#> GSM11722     1  0.0000     0.9440 1.000 0.000
#> GSM11730     1  0.0000     0.9440 1.000 0.000
#> GSM11713     1  0.1633     0.9257 0.976 0.024
#> GSM11728     1  0.4690     0.8464 0.900 0.100
#> GSM27947     1  0.0000     0.9440 1.000 0.000
#> GSM27951     1  0.0000     0.9440 1.000 0.000
#> GSM11707     2  0.0000     0.8421 0.000 1.000
#> GSM11716     1  0.0376     0.9412 0.996 0.004
#> GSM11850     1  0.2423     0.9118 0.960 0.040
#> GSM11851     2  0.9970     0.2689 0.468 0.532
#> GSM11721     1  0.0000     0.9440 1.000 0.000
#> GSM11852     1  0.5178     0.8271 0.884 0.116
#> GSM11694     1  0.7674     0.6662 0.776 0.224
#> GSM11695     2  0.9427     0.5397 0.360 0.640
#> GSM11734     1  0.0000     0.9440 1.000 0.000
#> GSM11861     1  0.0000     0.9440 1.000 0.000
#> GSM11843     1  0.0000     0.9440 1.000 0.000
#> GSM11862     1  0.0000     0.9440 1.000 0.000
#> GSM11697     1  0.5294     0.8234 0.880 0.120
#> GSM11714     2  0.0000     0.8421 0.000 1.000
#> GSM11723     1  0.0000     0.9440 1.000 0.000
#> GSM11845     1  0.0000     0.9440 1.000 0.000
#> GSM11683     2  0.9661     0.4679 0.392 0.608
#> GSM11691     1  0.0000     0.9440 1.000 0.000
#> GSM27949     2  0.6973     0.7624 0.188 0.812
#> GSM27945     1  0.1414     0.9291 0.980 0.020
#> GSM11706     2  0.0000     0.8421 0.000 1.000
#> GSM11853     1  0.0938     0.9357 0.988 0.012
#> GSM11729     1  0.0000     0.9440 1.000 0.000
#> GSM11746     1  0.0000     0.9440 1.000 0.000
#> GSM11711     2  0.7376     0.7458 0.208 0.792
#> GSM11854     1  0.7299     0.6957 0.796 0.204
#> GSM11731     1  0.0000     0.9440 1.000 0.000
#> GSM11839     1  0.0000     0.9440 1.000 0.000
#> GSM11836     1  0.0000     0.9440 1.000 0.000
#> GSM11849     1  0.0000     0.9440 1.000 0.000
#> GSM11682     1  0.9896     0.0507 0.560 0.440
#> GSM11690     1  0.0000     0.9440 1.000 0.000
#> GSM11692     1  0.0000     0.9440 1.000 0.000
#> GSM11841     1  0.0000     0.9440 1.000 0.000
#> GSM11901     1  0.0000     0.9440 1.000 0.000
#> GSM11715     1  0.0000     0.9440 1.000 0.000
#> GSM11724     1  0.0000     0.9440 1.000 0.000
#> GSM11684     1  0.0000     0.9440 1.000 0.000
#> GSM11696     1  0.0000     0.9440 1.000 0.000
#> GSM27952     2  0.7883     0.7164 0.236 0.764
#> GSM27948     1  0.0000     0.9440 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.0000     0.7709 0.000 0.000 1.000
#> GSM11735     3  0.0000     0.7709 0.000 0.000 1.000
#> GSM11733     3  0.0592     0.7704 0.000 0.012 0.988
#> GSM11863     3  0.6252     0.4461 0.000 0.444 0.556
#> GSM11710     3  0.3038     0.7325 0.104 0.000 0.896
#> GSM11712     2  0.6274     0.1533 0.456 0.544 0.000
#> GSM11732     3  0.3482     0.7228 0.000 0.128 0.872
#> GSM11844     3  0.8538     0.1271 0.380 0.100 0.520
#> GSM11842     3  0.6286     0.4188 0.000 0.464 0.536
#> GSM11860     3  0.6295     0.4058 0.000 0.472 0.528
#> GSM11686     1  0.4291     0.4752 0.820 0.000 0.180
#> GSM11688     1  0.6295    -0.2118 0.528 0.000 0.472
#> GSM11846     3  0.2063     0.7637 0.044 0.008 0.948
#> GSM11680     1  0.6513    -0.0168 0.520 0.004 0.476
#> GSM11698     1  0.8056     0.2939 0.532 0.068 0.400
#> GSM11840     3  0.2625     0.7587 0.000 0.084 0.916
#> GSM11847     3  0.2261     0.7631 0.000 0.068 0.932
#> GSM11685     1  0.6215    -0.1083 0.572 0.000 0.428
#> GSM11699     1  0.2448     0.5850 0.924 0.076 0.000
#> GSM27950     3  0.4974     0.6520 0.236 0.000 0.764
#> GSM27946     1  0.5948     0.3012 0.640 0.360 0.000
#> GSM11709     1  0.9531     0.1319 0.476 0.216 0.308
#> GSM11720     2  0.5785     0.4126 0.332 0.668 0.000
#> GSM11726     2  0.5529     0.4878 0.296 0.704 0.000
#> GSM11837     2  0.0000     0.6049 0.000 1.000 0.000
#> GSM11725     2  0.2066     0.6252 0.060 0.940 0.000
#> GSM11864     2  0.4555     0.5676 0.200 0.800 0.000
#> GSM11687     1  0.5926     0.3051 0.644 0.356 0.000
#> GSM11693     1  0.5988     0.2875 0.632 0.368 0.000
#> GSM11727     2  0.6286     0.1155 0.464 0.536 0.000
#> GSM11838     2  0.5016     0.5433 0.240 0.760 0.000
#> GSM11681     1  0.0237     0.5805 0.996 0.000 0.004
#> GSM11689     1  0.5988     0.2876 0.632 0.368 0.000
#> GSM11704     1  0.5988     0.2876 0.632 0.368 0.000
#> GSM11703     1  0.5988     0.2876 0.632 0.368 0.000
#> GSM11705     1  0.2625     0.5839 0.916 0.084 0.000
#> GSM11722     2  0.6302     0.0640 0.480 0.520 0.000
#> GSM11730     1  0.5905     0.2878 0.648 0.352 0.000
#> GSM11713     1  0.3941     0.4504 0.844 0.156 0.000
#> GSM11728     1  0.3752     0.4643 0.856 0.144 0.000
#> GSM27947     1  0.6008     0.2793 0.628 0.372 0.000
#> GSM27951     1  0.0000     0.5816 1.000 0.000 0.000
#> GSM11707     3  0.0000     0.7709 0.000 0.000 1.000
#> GSM11716     2  0.5269     0.5612 0.200 0.784 0.016
#> GSM11850     2  0.9827     0.0334 0.376 0.380 0.244
#> GSM11851     3  0.6796     0.3341 0.368 0.020 0.612
#> GSM11721     1  0.3192     0.5715 0.888 0.112 0.000
#> GSM11852     1  0.0592     0.5855 0.988 0.012 0.000
#> GSM11694     1  0.7883     0.1737 0.516 0.056 0.428
#> GSM11695     3  0.5835     0.4140 0.340 0.000 0.660
#> GSM11734     2  0.2625     0.6245 0.084 0.916 0.000
#> GSM11861     1  0.3551     0.5623 0.868 0.132 0.000
#> GSM11843     2  0.5138     0.5308 0.252 0.748 0.000
#> GSM11862     1  0.1529     0.5890 0.960 0.040 0.000
#> GSM11697     1  0.8278     0.4023 0.620 0.132 0.248
#> GSM11714     3  0.4121     0.6897 0.168 0.000 0.832
#> GSM11723     2  0.1860     0.6241 0.052 0.948 0.000
#> GSM11845     2  0.4654     0.5639 0.208 0.792 0.000
#> GSM11683     1  0.3816     0.5007 0.852 0.000 0.148
#> GSM11691     1  0.1643     0.5890 0.956 0.044 0.000
#> GSM27949     3  0.4887     0.6140 0.228 0.000 0.772
#> GSM27945     2  0.8463     0.0993 0.444 0.468 0.088
#> GSM11706     3  0.0000     0.7709 0.000 0.000 1.000
#> GSM11853     1  0.8220     0.3824 0.636 0.212 0.152
#> GSM11729     2  0.0000     0.6049 0.000 1.000 0.000
#> GSM11746     2  0.0000     0.6049 0.000 1.000 0.000
#> GSM11711     3  0.4796     0.6193 0.220 0.000 0.780
#> GSM11854     1  0.6854     0.4858 0.716 0.068 0.216
#> GSM11731     2  0.2448     0.6261 0.076 0.924 0.000
#> GSM11839     2  0.6286     0.1074 0.464 0.536 0.000
#> GSM11836     2  0.6008     0.3578 0.372 0.628 0.000
#> GSM11849     1  0.4974     0.4266 0.764 0.236 0.000
#> GSM11682     1  0.0747     0.5778 0.984 0.000 0.016
#> GSM11690     1  0.0424     0.5841 0.992 0.008 0.000
#> GSM11692     1  0.5968     0.2945 0.636 0.364 0.000
#> GSM11841     1  0.6274     0.0451 0.544 0.456 0.000
#> GSM11901     1  0.6095     0.2355 0.608 0.392 0.000
#> GSM11715     2  0.4974     0.5476 0.236 0.764 0.000
#> GSM11724     2  0.4931     0.5511 0.232 0.768 0.000
#> GSM11684     1  0.4842     0.4461 0.776 0.224 0.000
#> GSM11696     1  0.4291     0.5321 0.820 0.180 0.000
#> GSM27952     1  0.5431     0.2926 0.716 0.000 0.284
#> GSM27948     1  0.2625     0.5826 0.916 0.084 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     4  0.0000     0.7935 0.000 0.000 0.000 1.000
#> GSM11735     4  0.0188     0.7932 0.000 0.004 0.000 0.996
#> GSM11733     4  0.1792     0.7757 0.000 0.068 0.000 0.932
#> GSM11863     2  0.4571     0.4262 0.008 0.736 0.004 0.252
#> GSM11710     4  0.3528     0.7604 0.192 0.000 0.000 0.808
#> GSM11712     3  0.3219     0.7300 0.000 0.164 0.836 0.000
#> GSM11732     4  0.1256     0.7862 0.000 0.008 0.028 0.964
#> GSM11844     3  0.5773     0.3284 0.016 0.008 0.536 0.440
#> GSM11842     2  0.3852     0.5047 0.008 0.800 0.000 0.192
#> GSM11860     2  0.3992     0.5082 0.004 0.800 0.008 0.188
#> GSM11686     1  0.5926     0.5089 0.632 0.000 0.308 0.060
#> GSM11688     4  0.6143     0.3578 0.456 0.000 0.048 0.496
#> GSM11846     4  0.3382     0.7533 0.004 0.040 0.080 0.876
#> GSM11680     3  0.5623     0.5847 0.044 0.004 0.676 0.276
#> GSM11698     3  0.4175     0.6979 0.012 0.000 0.776 0.212
#> GSM11840     4  0.5141     0.5924 0.032 0.268 0.000 0.700
#> GSM11847     4  0.5537     0.5976 0.056 0.256 0.000 0.688
#> GSM11685     4  0.6449     0.3055 0.452 0.000 0.068 0.480
#> GSM11699     3  0.4356     0.4703 0.292 0.000 0.708 0.000
#> GSM27950     4  0.3157     0.7747 0.144 0.000 0.004 0.852
#> GSM27946     3  0.1854     0.7671 0.048 0.012 0.940 0.000
#> GSM11709     3  0.6742     0.3948 0.088 0.012 0.600 0.300
#> GSM11720     3  0.2342     0.7640 0.008 0.080 0.912 0.000
#> GSM11726     3  0.7521    -0.0192 0.264 0.212 0.520 0.004
#> GSM11837     2  0.6881     0.4913 0.132 0.592 0.272 0.004
#> GSM11725     3  0.5172     0.5589 0.036 0.260 0.704 0.000
#> GSM11864     3  0.3710     0.6991 0.004 0.192 0.804 0.000
#> GSM11687     3  0.2928     0.7213 0.108 0.012 0.880 0.000
#> GSM11693     3  0.0804     0.7738 0.012 0.008 0.980 0.000
#> GSM11727     1  0.5842     0.5685 0.704 0.168 0.128 0.000
#> GSM11838     2  0.6031     0.5351 0.216 0.676 0.108 0.000
#> GSM11681     1  0.3271     0.7003 0.856 0.000 0.132 0.012
#> GSM11689     3  0.0895     0.7716 0.020 0.004 0.976 0.000
#> GSM11704     3  0.0779     0.7722 0.016 0.004 0.980 0.000
#> GSM11703     3  0.1584     0.7650 0.036 0.012 0.952 0.000
#> GSM11705     1  0.5364     0.4456 0.592 0.016 0.392 0.000
#> GSM11722     1  0.6546     0.4970 0.636 0.172 0.192 0.000
#> GSM11730     1  0.5484     0.5906 0.732 0.164 0.104 0.000
#> GSM11713     1  0.4300     0.6470 0.820 0.088 0.092 0.000
#> GSM11728     1  0.3894     0.6554 0.844 0.068 0.088 0.000
#> GSM27947     3  0.1022     0.7752 0.000 0.032 0.968 0.000
#> GSM27951     1  0.3972     0.6930 0.788 0.008 0.204 0.000
#> GSM11707     4  0.1118     0.7988 0.036 0.000 0.000 0.964
#> GSM11716     3  0.3694     0.7474 0.000 0.124 0.844 0.032
#> GSM11850     3  0.3568     0.7613 0.004 0.024 0.856 0.116
#> GSM11851     3  0.3157     0.7571 0.004 0.000 0.852 0.144
#> GSM11721     1  0.6163     0.3350 0.532 0.052 0.416 0.000
#> GSM11852     3  0.4343     0.5428 0.264 0.000 0.732 0.004
#> GSM11694     3  0.2704     0.7644 0.000 0.000 0.876 0.124
#> GSM11695     3  0.2973     0.7574 0.000 0.000 0.856 0.144
#> GSM11734     2  0.5368     0.3728 0.024 0.636 0.340 0.000
#> GSM11861     3  0.3893     0.6400 0.196 0.008 0.796 0.000
#> GSM11843     3  0.3311     0.7248 0.000 0.172 0.828 0.000
#> GSM11862     3  0.5295    -0.1940 0.488 0.008 0.504 0.000
#> GSM11697     3  0.2530     0.7686 0.000 0.000 0.888 0.112
#> GSM11714     4  0.3105     0.7759 0.140 0.000 0.004 0.856
#> GSM11723     3  0.4609     0.6503 0.024 0.224 0.752 0.000
#> GSM11845     3  0.3024     0.7380 0.000 0.148 0.852 0.000
#> GSM11683     1  0.5452     0.6436 0.736 0.000 0.156 0.108
#> GSM11691     3  0.1940     0.7652 0.076 0.000 0.924 0.000
#> GSM27949     3  0.5384     0.5670 0.028 0.000 0.648 0.324
#> GSM27945     3  0.2131     0.7782 0.000 0.036 0.932 0.032
#> GSM11706     4  0.1118     0.7988 0.036 0.000 0.000 0.964
#> GSM11853     3  0.1593     0.7807 0.004 0.016 0.956 0.024
#> GSM11729     2  0.3601     0.6476 0.056 0.860 0.084 0.000
#> GSM11746     2  0.4964     0.6111 0.068 0.764 0.168 0.000
#> GSM11711     4  0.4974     0.5994 0.040 0.000 0.224 0.736
#> GSM11854     3  0.2408     0.7695 0.044 0.000 0.920 0.036
#> GSM11731     2  0.2797     0.6466 0.068 0.900 0.032 0.000
#> GSM11839     2  0.5496     0.4536 0.312 0.652 0.036 0.000
#> GSM11836     2  0.4594     0.5274 0.280 0.712 0.008 0.000
#> GSM11849     1  0.3498     0.5942 0.832 0.160 0.008 0.000
#> GSM11682     1  0.2586     0.6870 0.900 0.004 0.092 0.004
#> GSM11690     1  0.4019     0.6695 0.792 0.012 0.196 0.000
#> GSM11692     3  0.6548     0.4811 0.188 0.176 0.636 0.000
#> GSM11841     2  0.5602    -0.0392 0.020 0.508 0.472 0.000
#> GSM11901     2  0.6451    -0.0224 0.068 0.476 0.456 0.000
#> GSM11715     2  0.4426     0.6073 0.204 0.772 0.024 0.000
#> GSM11724     2  0.4245     0.6115 0.196 0.784 0.020 0.000
#> GSM11684     1  0.5110     0.6675 0.764 0.132 0.104 0.000
#> GSM11696     1  0.5673     0.6334 0.660 0.052 0.288 0.000
#> GSM27952     1  0.3037     0.6453 0.888 0.000 0.036 0.076
#> GSM27948     1  0.5691     0.3304 0.564 0.028 0.408 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     3  0.1270     0.7404 0.000 0.000 0.948 0.000 0.052
#> GSM11735     3  0.1608     0.7373 0.000 0.000 0.928 0.000 0.072
#> GSM11733     3  0.3861     0.6071 0.000 0.000 0.712 0.004 0.284
#> GSM11863     5  0.1768     0.5204 0.000 0.000 0.072 0.004 0.924
#> GSM11710     3  0.3656     0.6727 0.000 0.000 0.784 0.196 0.020
#> GSM11712     1  0.2850     0.7878 0.872 0.000 0.000 0.092 0.036
#> GSM11732     3  0.3221     0.6921 0.064 0.048 0.872 0.008 0.008
#> GSM11844     3  0.5635    -0.0073 0.468 0.044 0.476 0.004 0.008
#> GSM11842     5  0.0865     0.5564 0.000 0.000 0.024 0.004 0.972
#> GSM11860     5  0.0566     0.5632 0.000 0.000 0.012 0.004 0.984
#> GSM11686     4  0.1809     0.6851 0.060 0.000 0.012 0.928 0.000
#> GSM11688     4  0.1478     0.6291 0.000 0.000 0.064 0.936 0.000
#> GSM11846     3  0.6894     0.5439 0.064 0.000 0.560 0.128 0.248
#> GSM11680     1  0.3837     0.3907 0.692 0.000 0.000 0.308 0.000
#> GSM11698     1  0.1251     0.8348 0.956 0.000 0.008 0.036 0.000
#> GSM11840     3  0.4450     0.3147 0.000 0.000 0.508 0.004 0.488
#> GSM11847     5  0.4907    -0.3910 0.000 0.000 0.484 0.024 0.492
#> GSM11685     4  0.1408     0.6488 0.008 0.000 0.044 0.948 0.000
#> GSM11699     4  0.4302     0.3194 0.480 0.000 0.000 0.520 0.000
#> GSM27950     3  0.2798     0.7082 0.008 0.000 0.852 0.140 0.000
#> GSM27946     1  0.4015     0.2715 0.652 0.000 0.000 0.348 0.000
#> GSM11709     1  0.7261    -0.0231 0.404 0.260 0.316 0.016 0.004
#> GSM11720     1  0.1248     0.8413 0.964 0.016 0.004 0.008 0.008
#> GSM11726     2  0.1074     0.7101 0.016 0.968 0.000 0.004 0.012
#> GSM11837     2  0.2843     0.5346 0.008 0.848 0.000 0.000 0.144
#> GSM11725     1  0.5310     0.4931 0.672 0.236 0.000 0.008 0.084
#> GSM11864     1  0.1331     0.8395 0.952 0.000 0.000 0.008 0.040
#> GSM11687     1  0.3126     0.7953 0.868 0.048 0.008 0.076 0.000
#> GSM11693     1  0.1117     0.8390 0.964 0.020 0.000 0.016 0.000
#> GSM11727     2  0.0000     0.7253 0.000 1.000 0.000 0.000 0.000
#> GSM11838     2  0.0963     0.6980 0.000 0.964 0.000 0.000 0.036
#> GSM11681     4  0.3474     0.5611 0.008 0.148 0.020 0.824 0.000
#> GSM11689     1  0.2193     0.8187 0.912 0.028 0.000 0.060 0.000
#> GSM11704     1  0.2079     0.8199 0.916 0.020 0.000 0.064 0.000
#> GSM11703     1  0.3031     0.7798 0.852 0.128 0.000 0.016 0.004
#> GSM11705     2  0.3943     0.6810 0.016 0.784 0.016 0.184 0.000
#> GSM11722     2  0.0000     0.7253 0.000 1.000 0.000 0.000 0.000
#> GSM11730     2  0.0000     0.7253 0.000 1.000 0.000 0.000 0.000
#> GSM11713     2  0.3391     0.6870 0.000 0.800 0.012 0.188 0.000
#> GSM11728     2  0.3480     0.6552 0.000 0.752 0.000 0.248 0.000
#> GSM27947     1  0.0703     0.8372 0.976 0.000 0.000 0.024 0.000
#> GSM27951     2  0.5271     0.3397 0.048 0.520 0.000 0.432 0.000
#> GSM11707     3  0.0451     0.7383 0.004 0.000 0.988 0.000 0.008
#> GSM11716     1  0.1686     0.8364 0.944 0.000 0.028 0.008 0.020
#> GSM11850     1  0.3001     0.7567 0.844 0.000 0.144 0.008 0.004
#> GSM11851     1  0.1168     0.8394 0.960 0.000 0.032 0.008 0.000
#> GSM11721     4  0.3461     0.6937 0.224 0.000 0.000 0.772 0.004
#> GSM11852     4  0.4306     0.2972 0.492 0.000 0.000 0.508 0.000
#> GSM11694     1  0.0794     0.8405 0.972 0.000 0.028 0.000 0.000
#> GSM11695     1  0.1571     0.8276 0.936 0.000 0.060 0.004 0.000
#> GSM11734     5  0.6299     0.1960 0.380 0.112 0.000 0.012 0.496
#> GSM11861     1  0.4166     0.2588 0.648 0.000 0.004 0.348 0.000
#> GSM11843     1  0.1626     0.8369 0.940 0.000 0.000 0.016 0.044
#> GSM11862     4  0.4126     0.5389 0.380 0.000 0.000 0.620 0.000
#> GSM11697     1  0.0609     0.8421 0.980 0.000 0.020 0.000 0.000
#> GSM11714     3  0.1310     0.7374 0.000 0.020 0.956 0.024 0.000
#> GSM11723     1  0.3206     0.7913 0.864 0.024 0.004 0.012 0.096
#> GSM11845     1  0.1082     0.8401 0.964 0.000 0.000 0.008 0.028
#> GSM11683     4  0.3054     0.6573 0.032 0.028 0.060 0.880 0.000
#> GSM11691     1  0.1211     0.8409 0.960 0.000 0.016 0.024 0.000
#> GSM27949     1  0.3266     0.7157 0.796 0.000 0.200 0.004 0.000
#> GSM27945     1  0.0324     0.8404 0.992 0.000 0.004 0.004 0.000
#> GSM11706     3  0.0880     0.7413 0.000 0.000 0.968 0.000 0.032
#> GSM11853     1  0.0566     0.8398 0.984 0.000 0.004 0.012 0.000
#> GSM11729     5  0.4455     0.5261 0.008 0.404 0.000 0.000 0.588
#> GSM11746     5  0.4517     0.4899 0.008 0.436 0.000 0.000 0.556
#> GSM11711     3  0.4437     0.4719 0.316 0.000 0.664 0.020 0.000
#> GSM11854     1  0.3160     0.6566 0.808 0.000 0.004 0.188 0.000
#> GSM11731     5  0.4067     0.5887 0.000 0.300 0.000 0.008 0.692
#> GSM11839     5  0.6234     0.4657 0.000 0.296 0.000 0.176 0.528
#> GSM11836     5  0.4295     0.6026 0.000 0.216 0.000 0.044 0.740
#> GSM11849     2  0.3966     0.3960 0.000 0.664 0.000 0.336 0.000
#> GSM11682     4  0.0807     0.6474 0.000 0.012 0.012 0.976 0.000
#> GSM11690     4  0.0671     0.6658 0.016 0.000 0.000 0.980 0.004
#> GSM11692     4  0.4942     0.4098 0.432 0.000 0.000 0.540 0.028
#> GSM11841     4  0.6622     0.3840 0.364 0.000 0.000 0.416 0.220
#> GSM11901     4  0.6275     0.5276 0.308 0.000 0.000 0.516 0.176
#> GSM11715     5  0.4437     0.4613 0.000 0.464 0.000 0.004 0.532
#> GSM11724     5  0.4415     0.4891 0.000 0.444 0.000 0.004 0.552
#> GSM11684     4  0.4048     0.6423 0.064 0.108 0.000 0.812 0.016
#> GSM11696     4  0.5333     0.6810 0.228 0.052 0.000 0.688 0.032
#> GSM27952     4  0.1282     0.6391 0.000 0.004 0.044 0.952 0.000
#> GSM27948     4  0.3527     0.7014 0.192 0.000 0.000 0.792 0.016

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6  0.0914     0.6830 0.000 0.000 0.000 0.016 0.016 0.968
#> GSM11735     6  0.0993     0.6814 0.000 0.000 0.000 0.012 0.024 0.964
#> GSM11733     6  0.5327     0.2879 0.000 0.072 0.000 0.028 0.296 0.604
#> GSM11863     5  0.4943     0.5280 0.000 0.328 0.000 0.004 0.596 0.072
#> GSM11710     6  0.4351     0.5930 0.052 0.000 0.000 0.176 0.028 0.744
#> GSM11712     3  0.4257     0.6416 0.012 0.028 0.756 0.024 0.180 0.000
#> GSM11732     6  0.4857     0.5483 0.012 0.196 0.048 0.000 0.032 0.712
#> GSM11844     6  0.7027     0.2658 0.012 0.288 0.188 0.008 0.044 0.460
#> GSM11842     5  0.4591     0.5068 0.004 0.360 0.000 0.008 0.604 0.024
#> GSM11860     5  0.4012     0.5067 0.000 0.344 0.000 0.000 0.640 0.016
#> GSM11686     4  0.2272     0.7044 0.004 0.000 0.056 0.900 0.040 0.000
#> GSM11688     4  0.2240     0.6845 0.008 0.000 0.000 0.904 0.056 0.032
#> GSM11846     5  0.5556     0.0966 0.008 0.008 0.012 0.312 0.588 0.072
#> GSM11680     3  0.4552     0.5798 0.012 0.000 0.708 0.232 0.024 0.024
#> GSM11698     3  0.2993     0.6976 0.012 0.000 0.876 0.044 0.036 0.032
#> GSM11840     5  0.6214     0.3746 0.004 0.184 0.000 0.020 0.508 0.284
#> GSM11847     5  0.6455     0.3665 0.004 0.164 0.000 0.044 0.508 0.280
#> GSM11685     4  0.1036     0.6975 0.004 0.000 0.000 0.964 0.008 0.024
#> GSM11699     3  0.5467     0.4252 0.020 0.000 0.608 0.256 0.116 0.000
#> GSM27950     6  0.4805     0.4829 0.012 0.000 0.012 0.300 0.032 0.644
#> GSM27946     3  0.4012     0.5826 0.008 0.000 0.712 0.256 0.024 0.000
#> GSM11709     1  0.7750     0.0790 0.412 0.024 0.288 0.012 0.172 0.092
#> GSM11720     3  0.4736     0.6373 0.072 0.040 0.736 0.004 0.148 0.000
#> GSM11726     2  0.4761     0.0642 0.468 0.492 0.008 0.000 0.032 0.000
#> GSM11837     2  0.3721     0.4623 0.308 0.684 0.004 0.000 0.004 0.000
#> GSM11725     3  0.6362     0.2102 0.048 0.368 0.452 0.000 0.132 0.000
#> GSM11864     3  0.4613     0.6289 0.036 0.048 0.716 0.000 0.200 0.000
#> GSM11687     3  0.7378     0.3193 0.252 0.024 0.468 0.084 0.168 0.004
#> GSM11693     3  0.5506     0.6105 0.096 0.024 0.680 0.032 0.168 0.000
#> GSM11727     1  0.3975    -0.1107 0.544 0.452 0.000 0.000 0.004 0.000
#> GSM11838     2  0.3907     0.3045 0.408 0.588 0.000 0.000 0.004 0.000
#> GSM11681     4  0.5385     0.4342 0.240 0.000 0.020 0.624 0.116 0.000
#> GSM11689     3  0.7245     0.4222 0.192 0.024 0.504 0.116 0.164 0.000
#> GSM11704     3  0.7089     0.4822 0.144 0.024 0.532 0.128 0.172 0.000
#> GSM11703     3  0.5384     0.5615 0.232 0.016 0.640 0.008 0.104 0.000
#> GSM11705     1  0.3322     0.5107 0.856 0.012 0.032 0.044 0.056 0.000
#> GSM11722     1  0.3619     0.2876 0.680 0.316 0.000 0.000 0.004 0.000
#> GSM11730     1  0.3446     0.3002 0.692 0.308 0.000 0.000 0.000 0.000
#> GSM11713     1  0.2675     0.5125 0.876 0.076 0.000 0.040 0.008 0.000
#> GSM11728     1  0.2725     0.5118 0.880 0.040 0.000 0.060 0.020 0.000
#> GSM27947     3  0.3188     0.6911 0.024 0.004 0.848 0.024 0.100 0.000
#> GSM27951     1  0.6701    -0.0442 0.424 0.004 0.052 0.360 0.160 0.000
#> GSM11707     6  0.0146     0.6834 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM11716     3  0.2853     0.6905 0.008 0.032 0.888 0.008 0.040 0.024
#> GSM11850     3  0.5362     0.6084 0.024 0.052 0.728 0.016 0.056 0.124
#> GSM11851     3  0.3415     0.6813 0.016 0.016 0.860 0.020 0.056 0.032
#> GSM11721     4  0.5877     0.4175 0.032 0.008 0.264 0.588 0.108 0.000
#> GSM11852     3  0.5408     0.2785 0.012 0.000 0.536 0.364 0.088 0.000
#> GSM11694     3  0.2808     0.6870 0.024 0.000 0.876 0.000 0.040 0.060
#> GSM11695     3  0.3689     0.6692 0.024 0.004 0.824 0.004 0.044 0.100
#> GSM11734     2  0.5610     0.2853 0.016 0.556 0.328 0.004 0.096 0.000
#> GSM11861     3  0.5394     0.4910 0.016 0.008 0.644 0.220 0.112 0.000
#> GSM11843     3  0.2803     0.6912 0.004 0.016 0.868 0.016 0.096 0.000
#> GSM11862     3  0.6041     0.0283 0.024 0.004 0.440 0.420 0.112 0.000
#> GSM11697     3  0.1719     0.6998 0.016 0.000 0.924 0.000 0.000 0.060
#> GSM11714     6  0.2963     0.6360 0.152 0.000 0.000 0.016 0.004 0.828
#> GSM11723     3  0.5717     0.1586 0.016 0.384 0.508 0.008 0.084 0.000
#> GSM11845     3  0.3298     0.6763 0.012 0.048 0.852 0.016 0.072 0.000
#> GSM11683     4  0.4625     0.6812 0.036 0.000 0.060 0.772 0.100 0.032
#> GSM11691     3  0.2897     0.6962 0.028 0.000 0.872 0.052 0.048 0.000
#> GSM27949     3  0.5241     0.5026 0.024 0.000 0.628 0.012 0.048 0.288
#> GSM27945     3  0.1760     0.7004 0.020 0.000 0.928 0.004 0.048 0.000
#> GSM11706     6  0.0520     0.6829 0.008 0.000 0.000 0.000 0.008 0.984
#> GSM11853     3  0.2257     0.6991 0.008 0.004 0.900 0.012 0.076 0.000
#> GSM11729     2  0.1003     0.6622 0.028 0.964 0.000 0.004 0.004 0.000
#> GSM11746     2  0.1642     0.6561 0.032 0.936 0.004 0.000 0.028 0.000
#> GSM11711     6  0.7042     0.0361 0.100 0.000 0.336 0.008 0.128 0.428
#> GSM11854     3  0.3036     0.6896 0.004 0.000 0.848 0.108 0.036 0.004
#> GSM11731     2  0.1409     0.6612 0.008 0.948 0.012 0.000 0.032 0.000
#> GSM11839     2  0.3172     0.6378 0.020 0.864 0.040 0.016 0.060 0.000
#> GSM11836     2  0.2926     0.5636 0.004 0.844 0.000 0.028 0.124 0.000
#> GSM11849     2  0.6029     0.2834 0.356 0.496 0.000 0.112 0.036 0.000
#> GSM11682     4  0.1624     0.7036 0.040 0.004 0.000 0.936 0.020 0.000
#> GSM11690     4  0.3018     0.6969 0.036 0.004 0.028 0.868 0.064 0.000
#> GSM11692     3  0.6169     0.2879 0.016 0.008 0.516 0.292 0.168 0.000
#> GSM11841     5  0.6494     0.1449 0.004 0.076 0.348 0.096 0.476 0.000
#> GSM11901     5  0.6665     0.0354 0.008 0.040 0.356 0.164 0.432 0.000
#> GSM11715     2  0.3202     0.6461 0.144 0.816 0.000 0.000 0.040 0.000
#> GSM11724     2  0.3123     0.6508 0.136 0.824 0.000 0.000 0.040 0.000
#> GSM11684     4  0.7770     0.3417 0.232 0.056 0.072 0.412 0.228 0.000
#> GSM11696     4  0.8216     0.1968 0.140 0.048 0.220 0.324 0.268 0.000
#> GSM27952     4  0.2466     0.6829 0.028 0.000 0.000 0.896 0.052 0.024
#> GSM27948     4  0.5127     0.5868 0.036 0.004 0.168 0.696 0.096 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-SD-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-SD-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-SD-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-SD-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-SD-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-SD-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-SD-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-SD-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-SD-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-SD-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-SD-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-SD-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-SD-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-SD-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-SD-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-SD-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-SD-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-SD-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-SD-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-SD-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-SD-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-NMF-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>         n cell.line(p) agent(p)  time(p) k
#> SD:NMF 75     1.43e-07   0.5848 2.94e-01 2
#> SD:NMF 42     2.18e-03   0.3622 5.47e-05 3
#> SD:NMF 65     2.45e-06   0.1399 8.40e-05 4
#> SD:NMF 63     2.27e-08   0.1533 3.50e-06 5
#> SD:NMF 50     8.95e-07   0.0685 2.04e-05 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:hclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "hclust"]
# you can also extract it by
# res = res_list["CV:hclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-hclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-hclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.472           0.793       0.907         0.3008 0.785   0.785
#> 3 3 0.396           0.686       0.820         0.5372 0.815   0.764
#> 4 4 0.279           0.594       0.752         0.2230 0.931   0.884
#> 5 5 0.324           0.435       0.675         0.1851 0.748   0.564
#> 6 6 0.411           0.429       0.703         0.0982 0.863   0.649

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 3

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1  0.0000     0.8900 1.000 0.000
#> GSM11735     1  0.0000     0.8900 1.000 0.000
#> GSM11733     1  0.0000     0.8900 1.000 0.000
#> GSM11863     1  0.0000     0.8900 1.000 0.000
#> GSM11710     1  0.0000     0.8900 1.000 0.000
#> GSM11712     1  0.0000     0.8900 1.000 0.000
#> GSM11732     1  0.1414     0.8832 0.980 0.020
#> GSM11844     1  0.1414     0.8832 0.980 0.020
#> GSM11842     1  0.9580     0.3690 0.620 0.380
#> GSM11860     1  0.9580     0.3690 0.620 0.380
#> GSM11686     1  0.0000     0.8900 1.000 0.000
#> GSM11688     1  0.0000     0.8900 1.000 0.000
#> GSM11846     1  0.0376     0.8893 0.996 0.004
#> GSM11680     1  0.0000     0.8900 1.000 0.000
#> GSM11698     1  0.0000     0.8900 1.000 0.000
#> GSM11840     1  0.0000     0.8900 1.000 0.000
#> GSM11847     1  0.0000     0.8900 1.000 0.000
#> GSM11685     1  0.0000     0.8900 1.000 0.000
#> GSM11699     1  0.0000     0.8900 1.000 0.000
#> GSM27950     1  0.0000     0.8900 1.000 0.000
#> GSM27946     1  0.0376     0.8893 0.996 0.004
#> GSM11709     1  0.9358     0.4634 0.648 0.352
#> GSM11720     1  0.5408     0.8160 0.876 0.124
#> GSM11726     2  0.1843     0.8859 0.028 0.972
#> GSM11837     2  0.1843     0.8859 0.028 0.972
#> GSM11725     1  0.9996    -0.0132 0.512 0.488
#> GSM11864     1  0.9983     0.0417 0.524 0.476
#> GSM11687     1  0.5294     0.8177 0.880 0.120
#> GSM11693     1  0.5294     0.8177 0.880 0.120
#> GSM11727     2  0.0000     0.8700 0.000 1.000
#> GSM11838     2  0.0000     0.8700 0.000 1.000
#> GSM11681     1  0.9248     0.4773 0.660 0.340
#> GSM11689     1  0.9358     0.4634 0.648 0.352
#> GSM11704     1  0.9358     0.4634 0.648 0.352
#> GSM11703     1  0.5294     0.8177 0.880 0.120
#> GSM11705     1  0.5294     0.8177 0.880 0.120
#> GSM11722     1  0.8386     0.6173 0.732 0.268
#> GSM11730     1  0.8713     0.5778 0.708 0.292
#> GSM11713     1  0.8713     0.5778 0.708 0.292
#> GSM11728     1  0.5842     0.7923 0.860 0.140
#> GSM27947     1  0.0376     0.8893 0.996 0.004
#> GSM27951     1  0.9323     0.4679 0.652 0.348
#> GSM11707     1  0.1633     0.8803 0.976 0.024
#> GSM11716     1  0.1184     0.8847 0.984 0.016
#> GSM11850     1  0.0000     0.8900 1.000 0.000
#> GSM11851     1  0.0000     0.8900 1.000 0.000
#> GSM11721     1  0.0376     0.8891 0.996 0.004
#> GSM11852     1  0.0376     0.8891 0.996 0.004
#> GSM11694     1  0.0376     0.8891 0.996 0.004
#> GSM11695     1  0.0376     0.8891 0.996 0.004
#> GSM11734     2  0.7219     0.8202 0.200 0.800
#> GSM11861     1  0.0672     0.8881 0.992 0.008
#> GSM11843     1  0.9775     0.2878 0.588 0.412
#> GSM11862     1  0.0938     0.8871 0.988 0.012
#> GSM11697     1  0.0000     0.8900 1.000 0.000
#> GSM11714     1  0.3114     0.8635 0.944 0.056
#> GSM11723     1  0.5519     0.8054 0.872 0.128
#> GSM11845     1  0.5519     0.8054 0.872 0.128
#> GSM11683     1  0.2423     0.8741 0.960 0.040
#> GSM11691     1  0.2423     0.8741 0.960 0.040
#> GSM27949     1  0.0000     0.8900 1.000 0.000
#> GSM27945     1  0.0376     0.8893 0.996 0.004
#> GSM11706     1  0.0000     0.8900 1.000 0.000
#> GSM11853     1  0.0000     0.8900 1.000 0.000
#> GSM11729     2  0.5059     0.8977 0.112 0.888
#> GSM11746     2  0.5629     0.8931 0.132 0.868
#> GSM11711     1  0.0000     0.8900 1.000 0.000
#> GSM11854     1  0.0000     0.8900 1.000 0.000
#> GSM11731     2  0.7056     0.8293 0.192 0.808
#> GSM11839     1  0.8144     0.6372 0.748 0.252
#> GSM11836     1  0.7883     0.6597 0.764 0.236
#> GSM11849     1  0.7745     0.6746 0.772 0.228
#> GSM11682     1  0.0000     0.8900 1.000 0.000
#> GSM11690     1  0.0000     0.8900 1.000 0.000
#> GSM11692     1  0.0000     0.8900 1.000 0.000
#> GSM11841     1  0.0000     0.8900 1.000 0.000
#> GSM11901     1  0.0000     0.8900 1.000 0.000
#> GSM11715     2  0.6048     0.8835 0.148 0.852
#> GSM11724     2  0.6048     0.8835 0.148 0.852
#> GSM11684     1  0.1633     0.8808 0.976 0.024
#> GSM11696     1  0.1633     0.8808 0.976 0.024
#> GSM27952     1  0.0000     0.8900 1.000 0.000
#> GSM27948     1  0.0000     0.8900 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.1163     0.7857 0.028 0.000 0.972
#> GSM11735     3  0.1163     0.7857 0.028 0.000 0.972
#> GSM11733     3  0.1411     0.7863 0.036 0.000 0.964
#> GSM11863     3  0.1411     0.7863 0.036 0.000 0.964
#> GSM11710     3  0.0592     0.7887 0.012 0.000 0.988
#> GSM11712     3  0.1411     0.7900 0.036 0.000 0.964
#> GSM11732     3  0.5072     0.6791 0.196 0.012 0.792
#> GSM11844     3  0.5072     0.6791 0.196 0.012 0.792
#> GSM11842     1  0.7922     0.7846 0.532 0.060 0.408
#> GSM11860     1  0.7922     0.7846 0.532 0.060 0.408
#> GSM11686     3  0.0424     0.7888 0.008 0.000 0.992
#> GSM11688     3  0.0424     0.7888 0.008 0.000 0.992
#> GSM11846     3  0.0592     0.7886 0.012 0.000 0.988
#> GSM11680     3  0.1163     0.7865 0.028 0.000 0.972
#> GSM11698     3  0.1860     0.7848 0.052 0.000 0.948
#> GSM11840     3  0.1411     0.7863 0.036 0.000 0.964
#> GSM11847     3  0.1411     0.7863 0.036 0.000 0.964
#> GSM11685     3  0.0424     0.7888 0.008 0.000 0.992
#> GSM11699     3  0.1529     0.7868 0.040 0.000 0.960
#> GSM27950     3  0.1163     0.7865 0.028 0.000 0.972
#> GSM27946     3  0.0747     0.7893 0.016 0.000 0.984
#> GSM11709     1  0.6717     0.8462 0.628 0.020 0.352
#> GSM11720     3  0.6702     0.3047 0.328 0.024 0.648
#> GSM11726     2  0.1525     0.8660 0.032 0.964 0.004
#> GSM11837     2  0.1525     0.8660 0.032 0.964 0.004
#> GSM11725     1  0.8982     0.7478 0.548 0.168 0.284
#> GSM11864     1  0.8491     0.7802 0.588 0.128 0.284
#> GSM11687     3  0.6416     0.3373 0.304 0.020 0.676
#> GSM11693     3  0.6416     0.3373 0.304 0.020 0.676
#> GSM11727     2  0.0237     0.8609 0.004 0.996 0.000
#> GSM11838     2  0.0237     0.8609 0.004 0.996 0.000
#> GSM11681     1  0.6398     0.8366 0.620 0.008 0.372
#> GSM11689     1  0.6603     0.8505 0.648 0.020 0.332
#> GSM11704     1  0.6603     0.8505 0.648 0.020 0.332
#> GSM11703     3  0.6553     0.3185 0.324 0.020 0.656
#> GSM11705     3  0.6553     0.3185 0.324 0.020 0.656
#> GSM11722     3  0.9721    -0.0163 0.284 0.264 0.452
#> GSM11730     3  0.9714    -0.0208 0.256 0.292 0.452
#> GSM11713     3  0.9718    -0.0198 0.260 0.288 0.452
#> GSM11728     3  0.8546     0.2563 0.276 0.136 0.588
#> GSM27947     3  0.0747     0.7893 0.016 0.000 0.984
#> GSM27951     1  0.6521     0.8517 0.644 0.016 0.340
#> GSM11707     3  0.3415     0.7677 0.080 0.020 0.900
#> GSM11716     3  0.5220     0.6677 0.208 0.012 0.780
#> GSM11850     3  0.4504     0.6894 0.196 0.000 0.804
#> GSM11851     3  0.4452     0.6921 0.192 0.000 0.808
#> GSM11721     3  0.4974     0.6370 0.236 0.000 0.764
#> GSM11852     3  0.4974     0.6370 0.236 0.000 0.764
#> GSM11694     3  0.1525     0.7882 0.032 0.004 0.964
#> GSM11695     3  0.1525     0.7882 0.032 0.004 0.964
#> GSM11734     2  0.5864     0.8010 0.288 0.704 0.008
#> GSM11861     3  0.5497     0.5799 0.292 0.000 0.708
#> GSM11843     1  0.6728     0.6129 0.736 0.080 0.184
#> GSM11862     3  0.5560     0.5725 0.300 0.000 0.700
#> GSM11697     3  0.1529     0.7884 0.040 0.000 0.960
#> GSM11714     3  0.5343     0.7043 0.132 0.052 0.816
#> GSM11723     3  0.7673     0.4558 0.236 0.100 0.664
#> GSM11845     3  0.7673     0.4558 0.236 0.100 0.664
#> GSM11683     3  0.5180     0.7090 0.156 0.032 0.812
#> GSM11691     3  0.5180     0.7090 0.156 0.032 0.812
#> GSM27949     3  0.1163     0.7865 0.028 0.000 0.972
#> GSM27945     3  0.0747     0.7893 0.016 0.000 0.984
#> GSM11706     3  0.0747     0.7911 0.016 0.000 0.984
#> GSM11853     3  0.0892     0.7904 0.020 0.000 0.980
#> GSM11729     2  0.4749     0.8747 0.172 0.816 0.012
#> GSM11746     2  0.5122     0.8661 0.200 0.788 0.012
#> GSM11711     3  0.0892     0.7904 0.020 0.000 0.980
#> GSM11854     3  0.0892     0.7904 0.020 0.000 0.980
#> GSM11731     2  0.5327     0.8135 0.272 0.728 0.000
#> GSM11839     3  0.9303     0.1188 0.316 0.184 0.500
#> GSM11836     3  0.7535     0.4582 0.132 0.176 0.692
#> GSM11849     3  0.8753     0.3334 0.224 0.188 0.588
#> GSM11682     3  0.0592     0.7888 0.012 0.000 0.988
#> GSM11690     3  0.0424     0.7888 0.008 0.000 0.992
#> GSM11692     3  0.1411     0.7900 0.036 0.000 0.964
#> GSM11841     3  0.1411     0.7900 0.036 0.000 0.964
#> GSM11901     3  0.1411     0.7900 0.036 0.000 0.964
#> GSM11715     2  0.5247     0.8666 0.224 0.768 0.008
#> GSM11724     2  0.5247     0.8666 0.224 0.768 0.008
#> GSM11684     3  0.5092     0.6515 0.176 0.020 0.804
#> GSM11696     3  0.5092     0.6515 0.176 0.020 0.804
#> GSM27952     3  0.0424     0.7888 0.008 0.000 0.992
#> GSM27948     3  0.0424     0.7888 0.008 0.000 0.992

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.3634     0.6920 0.048 0.000 0.856 0.096
#> GSM11735     3  0.3634     0.6920 0.048 0.000 0.856 0.096
#> GSM11733     3  0.4370     0.6777 0.044 0.000 0.800 0.156
#> GSM11863     3  0.4370     0.6777 0.044 0.000 0.800 0.156
#> GSM11710     3  0.1733     0.6898 0.028 0.000 0.948 0.024
#> GSM11712     3  0.3556     0.7000 0.020 0.012 0.864 0.104
#> GSM11732     3  0.7815     0.4545 0.216 0.028 0.552 0.204
#> GSM11844     3  0.7815     0.4545 0.216 0.028 0.552 0.204
#> GSM11842     1  0.6820     0.7178 0.616 0.060 0.288 0.036
#> GSM11860     1  0.6820     0.7178 0.616 0.060 0.288 0.036
#> GSM11686     3  0.0927     0.6998 0.008 0.000 0.976 0.016
#> GSM11688     3  0.0927     0.6998 0.008 0.000 0.976 0.016
#> GSM11846     3  0.0469     0.7008 0.012 0.000 0.988 0.000
#> GSM11680     3  0.3037     0.7001 0.036 0.000 0.888 0.076
#> GSM11698     3  0.2781     0.7011 0.040 0.012 0.912 0.036
#> GSM11840     3  0.4370     0.6777 0.044 0.000 0.800 0.156
#> GSM11847     3  0.4370     0.6777 0.044 0.000 0.800 0.156
#> GSM11685     3  0.1174     0.6997 0.012 0.000 0.968 0.020
#> GSM11699     3  0.2224     0.7016 0.040 0.000 0.928 0.032
#> GSM27950     3  0.3037     0.7001 0.036 0.000 0.888 0.076
#> GSM27946     3  0.1297     0.7074 0.020 0.000 0.964 0.016
#> GSM11709     1  0.4538     0.7598 0.760 0.000 0.216 0.024
#> GSM11720     3  0.5483     0.1111 0.448 0.000 0.536 0.016
#> GSM11726     2  0.3342     0.8240 0.032 0.868 0.000 0.100
#> GSM11837     2  0.3342     0.8240 0.032 0.868 0.000 0.100
#> GSM11725     1  0.7360     0.6898 0.596 0.196 0.188 0.020
#> GSM11864     1  0.7187     0.7167 0.628 0.156 0.188 0.028
#> GSM11687     3  0.5345     0.1462 0.428 0.000 0.560 0.012
#> GSM11693     3  0.5345     0.1462 0.428 0.000 0.560 0.012
#> GSM11727     2  0.2345     0.8156 0.000 0.900 0.000 0.100
#> GSM11838     2  0.2345     0.8156 0.000 0.900 0.000 0.100
#> GSM11681     1  0.4452     0.7557 0.732 0.000 0.260 0.008
#> GSM11689     1  0.4098     0.7691 0.784 0.000 0.204 0.012
#> GSM11704     1  0.4098     0.7691 0.784 0.000 0.204 0.012
#> GSM11703     3  0.5372     0.1261 0.444 0.000 0.544 0.012
#> GSM11705     3  0.5372     0.1261 0.444 0.000 0.544 0.012
#> GSM11722     4  0.8366     0.8352 0.172 0.056 0.264 0.508
#> GSM11730     4  0.9374     0.7821 0.128 0.196 0.264 0.412
#> GSM11713     4  0.8162     0.8328 0.148 0.056 0.264 0.532
#> GSM11728     4  0.8288     0.6451 0.176 0.032 0.380 0.412
#> GSM27947     3  0.1297     0.7074 0.020 0.000 0.964 0.016
#> GSM27951     1  0.4049     0.7729 0.780 0.000 0.212 0.008
#> GSM11707     3  0.6327     0.5071 0.124 0.000 0.648 0.228
#> GSM11716     3  0.7805     0.4466 0.228 0.024 0.544 0.204
#> GSM11850     3  0.7244     0.4992 0.224 0.020 0.604 0.152
#> GSM11851     3  0.7215     0.5032 0.220 0.020 0.608 0.152
#> GSM11721     3  0.5743     0.5205 0.176 0.016 0.732 0.076
#> GSM11852     3  0.5743     0.5205 0.176 0.016 0.732 0.076
#> GSM11694     3  0.3198     0.7004 0.040 0.000 0.880 0.080
#> GSM11695     3  0.3198     0.7004 0.040 0.000 0.880 0.080
#> GSM11734     2  0.7461     0.5692 0.188 0.544 0.008 0.260
#> GSM11861     3  0.7004     0.3986 0.308 0.028 0.588 0.076
#> GSM11843     1  0.6065     0.5483 0.748 0.092 0.080 0.080
#> GSM11862     3  0.6807     0.3818 0.328 0.016 0.580 0.076
#> GSM11697     3  0.3301     0.7006 0.048 0.000 0.876 0.076
#> GSM11714     3  0.6874     0.3209 0.136 0.000 0.568 0.296
#> GSM11723     3  0.9146     0.2006 0.252 0.124 0.452 0.172
#> GSM11845     3  0.9146     0.2006 0.252 0.124 0.452 0.172
#> GSM11683     3  0.7085     0.3331 0.156 0.000 0.544 0.300
#> GSM11691     3  0.7085     0.3331 0.156 0.000 0.544 0.300
#> GSM27949     3  0.3037     0.7001 0.036 0.000 0.888 0.076
#> GSM27945     3  0.1297     0.7074 0.020 0.000 0.964 0.016
#> GSM11706     3  0.1543     0.6973 0.032 0.004 0.956 0.008
#> GSM11853     3  0.1271     0.7001 0.012 0.012 0.968 0.008
#> GSM11729     2  0.2796     0.8340 0.096 0.892 0.004 0.008
#> GSM11746     2  0.3043     0.8287 0.112 0.876 0.004 0.008
#> GSM11711     3  0.1271     0.7001 0.012 0.012 0.968 0.008
#> GSM11854     3  0.1271     0.7001 0.012 0.012 0.968 0.008
#> GSM11731     2  0.4638     0.7531 0.152 0.788 0.000 0.060
#> GSM11839     3  0.8763    -0.0711 0.192 0.256 0.476 0.076
#> GSM11836     3  0.6746     0.3980 0.076 0.236 0.652 0.036
#> GSM11849     3  0.7963     0.1373 0.120 0.256 0.560 0.064
#> GSM11682     3  0.1297     0.6991 0.016 0.000 0.964 0.020
#> GSM11690     3  0.1174     0.6997 0.012 0.000 0.968 0.020
#> GSM11692     3  0.3556     0.7000 0.020 0.012 0.864 0.104
#> GSM11841     3  0.3556     0.7000 0.020 0.012 0.864 0.104
#> GSM11901     3  0.3556     0.7000 0.020 0.012 0.864 0.104
#> GSM11715     2  0.3941     0.8254 0.104 0.844 0.004 0.048
#> GSM11724     2  0.3941     0.8254 0.104 0.844 0.004 0.048
#> GSM11684     3  0.6730     0.0820 0.156 0.004 0.628 0.212
#> GSM11696     3  0.6730     0.0820 0.156 0.004 0.628 0.212
#> GSM27952     3  0.1174     0.6997 0.012 0.000 0.968 0.020
#> GSM27948     3  0.1174     0.6997 0.012 0.000 0.968 0.020

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     4  0.6004     0.4474 0.332 0.000 0.040 0.576 0.052
#> GSM11735     4  0.6004     0.4474 0.332 0.000 0.040 0.576 0.052
#> GSM11733     4  0.4752     0.4201 0.412 0.000 0.020 0.568 0.000
#> GSM11863     4  0.4752     0.4201 0.412 0.000 0.020 0.568 0.000
#> GSM11710     4  0.2908     0.6294 0.108 0.000 0.008 0.868 0.016
#> GSM11712     4  0.3647     0.5822 0.228 0.004 0.004 0.764 0.000
#> GSM11732     1  0.6339     0.1940 0.572 0.048 0.060 0.316 0.004
#> GSM11844     1  0.6339     0.1940 0.572 0.048 0.060 0.316 0.004
#> GSM11842     1  0.8306     0.3204 0.484 0.064 0.064 0.172 0.216
#> GSM11860     1  0.8306     0.3204 0.484 0.064 0.064 0.172 0.216
#> GSM11686     4  0.0000     0.6777 0.000 0.000 0.000 1.000 0.000
#> GSM11688     4  0.0000     0.6777 0.000 0.000 0.000 1.000 0.000
#> GSM11846     4  0.0955     0.6755 0.028 0.000 0.000 0.968 0.004
#> GSM11680     4  0.5107     0.5535 0.228 0.000 0.024 0.700 0.048
#> GSM11698     4  0.2398     0.6546 0.064 0.020 0.004 0.908 0.004
#> GSM11840     4  0.4752     0.4201 0.412 0.000 0.020 0.568 0.000
#> GSM11847     4  0.4752     0.4201 0.412 0.000 0.020 0.568 0.000
#> GSM11685     4  0.0324     0.6771 0.000 0.000 0.004 0.992 0.004
#> GSM11699     4  0.2354     0.6601 0.076 0.000 0.012 0.904 0.008
#> GSM27950     4  0.5107     0.5535 0.228 0.000 0.024 0.700 0.048
#> GSM27946     4  0.2295     0.6660 0.088 0.000 0.008 0.900 0.004
#> GSM11709     1  0.6400     0.2051 0.516 0.004 0.056 0.044 0.380
#> GSM11720     1  0.7215     0.2164 0.460 0.004 0.060 0.364 0.112
#> GSM11726     2  0.2408     0.7885 0.000 0.892 0.016 0.000 0.092
#> GSM11837     2  0.2408     0.7885 0.000 0.892 0.016 0.000 0.092
#> GSM11725     1  0.9065     0.1835 0.400 0.208 0.072 0.120 0.200
#> GSM11864     1  0.8953     0.2097 0.420 0.168 0.072 0.120 0.220
#> GSM11687     1  0.7058     0.2334 0.440 0.004 0.048 0.400 0.108
#> GSM11693     1  0.7058     0.2334 0.440 0.004 0.048 0.400 0.108
#> GSM11727     2  0.3075     0.7797 0.000 0.860 0.048 0.000 0.092
#> GSM11838     2  0.3075     0.7797 0.000 0.860 0.048 0.000 0.092
#> GSM11681     1  0.7773     0.2743 0.392 0.008 0.060 0.180 0.360
#> GSM11689     1  0.7021     0.2329 0.484 0.008 0.072 0.068 0.368
#> GSM11704     1  0.7021     0.2329 0.484 0.008 0.072 0.068 0.368
#> GSM11703     1  0.7133     0.2231 0.464 0.004 0.056 0.368 0.108
#> GSM11705     1  0.7133     0.2231 0.464 0.004 0.056 0.368 0.108
#> GSM11722     5  0.5141     0.8459 0.024 0.024 0.020 0.216 0.716
#> GSM11730     5  0.6383     0.7695 0.020 0.176 0.000 0.216 0.588
#> GSM11713     5  0.4483     0.8414 0.020 0.024 0.000 0.216 0.740
#> GSM11728     5  0.5976     0.7469 0.136 0.008 0.000 0.252 0.604
#> GSM27947     4  0.2295     0.6660 0.088 0.000 0.008 0.900 0.004
#> GSM27951     1  0.7067     0.2371 0.480 0.008 0.068 0.076 0.368
#> GSM11707     1  0.7310    -0.0468 0.440 0.000 0.040 0.320 0.200
#> GSM11716     1  0.6418     0.2082 0.572 0.048 0.068 0.308 0.004
#> GSM11850     1  0.6499     0.1339 0.512 0.044 0.064 0.376 0.004
#> GSM11851     1  0.6454     0.1274 0.512 0.044 0.060 0.380 0.004
#> GSM11721     4  0.5120     0.4945 0.080 0.004 0.196 0.712 0.008
#> GSM11852     4  0.5120     0.4945 0.080 0.004 0.196 0.712 0.008
#> GSM11694     4  0.5265     0.5397 0.252 0.000 0.024 0.676 0.048
#> GSM11695     4  0.5265     0.5397 0.252 0.000 0.024 0.676 0.048
#> GSM11734     3  0.3558     0.0000 0.020 0.156 0.816 0.008 0.000
#> GSM11861     4  0.7040     0.1400 0.248 0.016 0.180 0.536 0.020
#> GSM11843     1  0.8418     0.0481 0.412 0.084 0.260 0.028 0.216
#> GSM11862     4  0.6971     0.1304 0.232 0.008 0.212 0.528 0.020
#> GSM11697     4  0.5423     0.5387 0.252 0.000 0.032 0.668 0.048
#> GSM11714     1  0.7505    -0.1293 0.400 0.000 0.040 0.272 0.288
#> GSM11723     1  0.7377     0.3115 0.528 0.104 0.112 0.252 0.004
#> GSM11845     1  0.7377     0.3115 0.528 0.104 0.112 0.252 0.004
#> GSM11683     1  0.7305     0.0523 0.472 0.000 0.044 0.268 0.216
#> GSM11691     1  0.7305     0.0523 0.472 0.000 0.044 0.268 0.216
#> GSM27949     4  0.5107     0.5535 0.228 0.000 0.024 0.700 0.048
#> GSM27945     4  0.2295     0.6660 0.088 0.000 0.008 0.900 0.004
#> GSM11706     4  0.2753     0.6259 0.104 0.012 0.000 0.876 0.008
#> GSM11853     4  0.1365     0.6760 0.040 0.004 0.000 0.952 0.004
#> GSM11729     2  0.1996     0.7814 0.036 0.928 0.032 0.004 0.000
#> GSM11746     2  0.2411     0.7741 0.052 0.912 0.024 0.004 0.008
#> GSM11711     4  0.1365     0.6760 0.040 0.004 0.000 0.952 0.004
#> GSM11854     4  0.1365     0.6760 0.040 0.004 0.000 0.952 0.004
#> GSM11731     2  0.3689     0.5299 0.004 0.740 0.256 0.000 0.000
#> GSM11839     4  0.7776     0.0691 0.064 0.208 0.240 0.476 0.012
#> GSM11836     4  0.7040     0.2752 0.148 0.204 0.048 0.584 0.016
#> GSM11849     4  0.7385     0.2013 0.100 0.252 0.028 0.552 0.068
#> GSM11682     4  0.0613     0.6775 0.004 0.000 0.004 0.984 0.008
#> GSM11690     4  0.0324     0.6771 0.000 0.000 0.004 0.992 0.004
#> GSM11692     4  0.3647     0.5822 0.228 0.004 0.004 0.764 0.000
#> GSM11841     4  0.3647     0.5822 0.228 0.004 0.004 0.764 0.000
#> GSM11901     4  0.3647     0.5822 0.228 0.004 0.004 0.764 0.000
#> GSM11715     2  0.3819     0.7540 0.064 0.844 0.036 0.004 0.052
#> GSM11724     2  0.3819     0.7540 0.064 0.844 0.036 0.004 0.052
#> GSM11684     4  0.6571    -0.3076 0.144 0.004 0.008 0.488 0.356
#> GSM11696     4  0.6571    -0.3076 0.144 0.004 0.008 0.488 0.356
#> GSM27952     4  0.0324     0.6771 0.000 0.000 0.004 0.992 0.004
#> GSM27948     4  0.0324     0.6771 0.000 0.000 0.004 0.992 0.004

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     3  0.6368     0.2684 0.008 0.000 0.412 0.312 0.004 0.264
#> GSM11735     3  0.6368     0.2684 0.008 0.000 0.412 0.312 0.004 0.264
#> GSM11733     3  0.4144     0.3509 0.008 0.000 0.580 0.408 0.000 0.004
#> GSM11863     3  0.4144     0.3509 0.008 0.000 0.580 0.408 0.000 0.004
#> GSM11710     4  0.2945     0.5378 0.020 0.000 0.156 0.824 0.000 0.000
#> GSM11712     4  0.3314     0.4248 0.004 0.000 0.256 0.740 0.000 0.000
#> GSM11732     3  0.4119     0.5429 0.068 0.004 0.756 0.168 0.000 0.004
#> GSM11844     3  0.4119     0.5429 0.068 0.004 0.756 0.168 0.000 0.004
#> GSM11842     1  0.5758     0.3970 0.596 0.040 0.268 0.092 0.000 0.004
#> GSM11860     1  0.5758     0.3970 0.596 0.040 0.268 0.092 0.000 0.004
#> GSM11686     4  0.0146     0.6276 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM11688     4  0.0146     0.6276 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM11846     4  0.1152     0.6207 0.004 0.000 0.044 0.952 0.000 0.000
#> GSM11680     4  0.5656     0.0726 0.000 0.000 0.256 0.532 0.000 0.212
#> GSM11698     4  0.2051     0.6007 0.004 0.004 0.096 0.896 0.000 0.000
#> GSM11840     3  0.4144     0.3509 0.008 0.000 0.580 0.408 0.000 0.004
#> GSM11847     3  0.4144     0.3509 0.008 0.000 0.580 0.408 0.000 0.004
#> GSM11685     4  0.0146     0.6283 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM11699     4  0.2507     0.6067 0.040 0.000 0.072 0.884 0.000 0.004
#> GSM27950     4  0.5656     0.0726 0.000 0.000 0.256 0.532 0.000 0.212
#> GSM27946     4  0.2520     0.5645 0.004 0.000 0.152 0.844 0.000 0.000
#> GSM11709     1  0.2408     0.4853 0.900 0.000 0.056 0.012 0.004 0.028
#> GSM11720     1  0.4908     0.4324 0.596 0.000 0.068 0.332 0.000 0.004
#> GSM11726     2  0.2060     0.8143 0.000 0.900 0.016 0.000 0.000 0.084
#> GSM11837     2  0.2060     0.8143 0.000 0.900 0.016 0.000 0.000 0.084
#> GSM11725     1  0.5702     0.4250 0.648 0.160 0.080 0.112 0.000 0.000
#> GSM11864     1  0.5446     0.4490 0.680 0.120 0.088 0.112 0.000 0.000
#> GSM11687     1  0.4818     0.4358 0.572 0.000 0.064 0.364 0.000 0.000
#> GSM11693     1  0.4818     0.4358 0.572 0.000 0.064 0.364 0.000 0.000
#> GSM11727     2  0.2290     0.8081 0.000 0.892 0.004 0.000 0.020 0.084
#> GSM11838     2  0.2290     0.8081 0.000 0.892 0.004 0.000 0.020 0.084
#> GSM11681     1  0.3048     0.5241 0.824 0.000 0.004 0.152 0.000 0.020
#> GSM11689     1  0.1408     0.5271 0.944 0.000 0.000 0.036 0.000 0.020
#> GSM11704     1  0.1408     0.5271 0.944 0.000 0.000 0.036 0.000 0.020
#> GSM11703     1  0.4822     0.4354 0.596 0.000 0.072 0.332 0.000 0.000
#> GSM11705     1  0.4822     0.4354 0.596 0.000 0.072 0.332 0.000 0.000
#> GSM11722     6  0.4505     0.4979 0.160 0.016 0.000 0.092 0.000 0.732
#> GSM11730     6  0.6246     0.4398 0.136 0.188 0.000 0.092 0.000 0.584
#> GSM11713     6  0.4289     0.4928 0.136 0.016 0.000 0.092 0.000 0.756
#> GSM11728     6  0.5237     0.4989 0.268 0.004 0.000 0.124 0.000 0.604
#> GSM27947     4  0.2520     0.5645 0.004 0.000 0.152 0.844 0.000 0.000
#> GSM27951     1  0.1549     0.5308 0.936 0.000 0.000 0.044 0.000 0.020
#> GSM11707     6  0.7220     0.1174 0.152 0.000 0.352 0.092 0.012 0.392
#> GSM11716     3  0.4051     0.5358 0.076 0.004 0.756 0.164 0.000 0.000
#> GSM11850     3  0.4865     0.5213 0.076 0.004 0.672 0.240 0.004 0.004
#> GSM11851     3  0.4751     0.5218 0.076 0.004 0.672 0.244 0.000 0.004
#> GSM11721     4  0.4693     0.4585 0.004 0.004 0.100 0.700 0.192 0.000
#> GSM11852     4  0.4693     0.4585 0.004 0.004 0.100 0.700 0.192 0.000
#> GSM11694     4  0.6202     0.0475 0.024 0.000 0.256 0.508 0.000 0.212
#> GSM11695     4  0.6202     0.0475 0.024 0.000 0.256 0.508 0.000 0.212
#> GSM11734     5  0.1644     0.0000 0.000 0.012 0.052 0.004 0.932 0.000
#> GSM11861     4  0.6883     0.1896 0.136 0.000 0.224 0.496 0.144 0.000
#> GSM11843     1  0.6144     0.2629 0.592 0.060 0.140 0.000 0.204 0.004
#> GSM11862     4  0.7065     0.2035 0.140 0.004 0.172 0.492 0.192 0.000
#> GSM11697     4  0.6346     0.0382 0.032 0.000 0.260 0.496 0.000 0.212
#> GSM11714     6  0.6913     0.2299 0.172 0.000 0.260 0.076 0.008 0.484
#> GSM11723     3  0.6079     0.4453 0.104 0.032 0.660 0.136 0.064 0.004
#> GSM11845     3  0.6079     0.4453 0.104 0.032 0.660 0.136 0.064 0.004
#> GSM11683     3  0.7234    -0.1030 0.196 0.000 0.428 0.092 0.008 0.276
#> GSM11691     3  0.7300    -0.1011 0.192 0.000 0.428 0.092 0.012 0.276
#> GSM27949     4  0.5656     0.0726 0.000 0.000 0.256 0.532 0.000 0.212
#> GSM27945     4  0.2520     0.5645 0.004 0.000 0.152 0.844 0.000 0.000
#> GSM11706     4  0.2839     0.5800 0.092 0.000 0.044 0.860 0.000 0.004
#> GSM11853     4  0.1349     0.6242 0.000 0.000 0.056 0.940 0.000 0.004
#> GSM11729     2  0.2585     0.8089 0.048 0.880 0.068 0.000 0.004 0.000
#> GSM11746     2  0.2714     0.8054 0.060 0.872 0.064 0.000 0.004 0.000
#> GSM11711     4  0.1349     0.6242 0.000 0.000 0.056 0.940 0.000 0.004
#> GSM11854     4  0.1349     0.6242 0.000 0.000 0.056 0.940 0.000 0.004
#> GSM11731     2  0.3622     0.5994 0.004 0.744 0.016 0.000 0.236 0.000
#> GSM11839     4  0.7204     0.1495 0.008 0.220 0.096 0.452 0.224 0.000
#> GSM11836     4  0.6909     0.2915 0.100 0.204 0.112 0.552 0.032 0.000
#> GSM11849     4  0.7238     0.2616 0.052 0.220 0.144 0.520 0.004 0.060
#> GSM11682     4  0.0405     0.6287 0.004 0.000 0.008 0.988 0.000 0.000
#> GSM11690     4  0.0146     0.6283 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM11692     4  0.3314     0.4248 0.004 0.000 0.256 0.740 0.000 0.000
#> GSM11841     4  0.3314     0.4248 0.004 0.000 0.256 0.740 0.000 0.000
#> GSM11901     4  0.3314     0.4248 0.004 0.000 0.256 0.740 0.000 0.000
#> GSM11715     2  0.4156     0.7770 0.072 0.796 0.068 0.000 0.004 0.060
#> GSM11724     2  0.4156     0.7770 0.072 0.796 0.068 0.000 0.004 0.060
#> GSM11684     4  0.6437    -0.3423 0.264 0.000 0.016 0.364 0.000 0.356
#> GSM11696     4  0.6437    -0.3423 0.264 0.000 0.016 0.364 0.000 0.356
#> GSM27952     4  0.0146     0.6283 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM27948     4  0.0146     0.6283 0.000 0.000 0.004 0.996 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-hclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-hclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-hclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-hclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-hclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-hclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-hclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>            n cell.line(p) agent(p)  time(p) k
#> CV:hclust 73     3.52e-02   0.3951 4.87e-05 2
#> CV:hclust 69     1.34e-06   0.1669 6.89e-06 3
#> CV:hclust 62     7.35e-06   0.0080 4.30e-05 4
#> CV:hclust 41     1.38e-04   0.0464 1.75e-06 5
#> CV:hclust 36     2.37e-05   0.3045 6.63e-06 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:kmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "kmeans"]
# you can also extract it by
# res = res_list["CV:kmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-kmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.745           0.882       0.935         0.4690 0.533   0.533
#> 3 3 0.367           0.449       0.659         0.3136 0.808   0.661
#> 4 4 0.439           0.575       0.724         0.1594 0.777   0.496
#> 5 5 0.551           0.524       0.685         0.0774 0.946   0.797
#> 6 6 0.577           0.611       0.720         0.0484 0.904   0.630

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1  0.0938      0.922 0.988 0.012
#> GSM11735     1  0.0938      0.922 0.988 0.012
#> GSM11733     1  0.0938      0.922 0.988 0.012
#> GSM11863     1  0.1843      0.916 0.972 0.028
#> GSM11710     1  0.0000      0.928 1.000 0.000
#> GSM11712     1  0.0000      0.928 1.000 0.000
#> GSM11732     1  0.1414      0.919 0.980 0.020
#> GSM11844     1  0.0938      0.923 0.988 0.012
#> GSM11842     1  0.1843      0.916 0.972 0.028
#> GSM11860     1  0.1633      0.918 0.976 0.024
#> GSM11686     1  0.0000      0.928 1.000 0.000
#> GSM11688     1  0.0000      0.928 1.000 0.000
#> GSM11846     1  0.0000      0.928 1.000 0.000
#> GSM11680     1  0.0000      0.928 1.000 0.000
#> GSM11698     1  0.0000      0.928 1.000 0.000
#> GSM11840     1  0.0938      0.922 0.988 0.012
#> GSM11847     1  0.0938      0.922 0.988 0.012
#> GSM11685     1  0.0000      0.928 1.000 0.000
#> GSM11699     1  0.0000      0.928 1.000 0.000
#> GSM27950     1  0.0000      0.928 1.000 0.000
#> GSM27946     1  0.0000      0.928 1.000 0.000
#> GSM11709     2  0.3733      0.941 0.072 0.928
#> GSM11720     2  0.3114      0.946 0.056 0.944
#> GSM11726     2  0.0938      0.945 0.012 0.988
#> GSM11837     2  0.0938      0.945 0.012 0.988
#> GSM11725     2  0.2948      0.947 0.052 0.948
#> GSM11864     2  0.7219      0.798 0.200 0.800
#> GSM11687     2  0.3733      0.941 0.072 0.928
#> GSM11693     2  0.3733      0.941 0.072 0.928
#> GSM11727     2  0.0938      0.945 0.012 0.988
#> GSM11838     2  0.0938      0.945 0.012 0.988
#> GSM11681     2  0.7815      0.769 0.232 0.768
#> GSM11689     2  0.3733      0.941 0.072 0.928
#> GSM11704     2  0.3114      0.946 0.056 0.944
#> GSM11703     2  0.4161      0.933 0.084 0.916
#> GSM11705     2  0.4161      0.933 0.084 0.916
#> GSM11722     2  0.0938      0.945 0.012 0.988
#> GSM11730     2  0.0938      0.945 0.012 0.988
#> GSM11713     2  0.1843      0.943 0.028 0.972
#> GSM11728     1  0.9775      0.367 0.588 0.412
#> GSM27947     1  0.0000      0.928 1.000 0.000
#> GSM27951     2  0.3733      0.941 0.072 0.928
#> GSM11707     1  0.1414      0.919 0.980 0.020
#> GSM11716     1  0.8763      0.547 0.704 0.296
#> GSM11850     1  0.7453      0.751 0.788 0.212
#> GSM11851     1  0.0000      0.928 1.000 0.000
#> GSM11721     1  0.6048      0.811 0.852 0.148
#> GSM11852     1  0.0000      0.928 1.000 0.000
#> GSM11694     1  0.0938      0.923 0.988 0.012
#> GSM11695     1  0.0376      0.927 0.996 0.004
#> GSM11734     2  0.2778      0.947 0.048 0.952
#> GSM11861     1  0.7219      0.757 0.800 0.200
#> GSM11843     2  0.2948      0.947 0.052 0.948
#> GSM11862     1  0.7376      0.748 0.792 0.208
#> GSM11697     1  0.0376      0.927 0.996 0.004
#> GSM11714     1  0.6623      0.789 0.828 0.172
#> GSM11723     2  0.3274      0.944 0.060 0.940
#> GSM11845     2  0.7299      0.795 0.204 0.796
#> GSM11683     1  0.9460      0.472 0.636 0.364
#> GSM11691     1  0.9460      0.472 0.636 0.364
#> GSM27949     1  0.0000      0.928 1.000 0.000
#> GSM27945     1  0.0000      0.928 1.000 0.000
#> GSM11706     1  0.0000      0.928 1.000 0.000
#> GSM11853     1  0.0000      0.928 1.000 0.000
#> GSM11729     2  0.0938      0.945 0.012 0.988
#> GSM11746     2  0.0938      0.945 0.012 0.988
#> GSM11711     1  0.0000      0.928 1.000 0.000
#> GSM11854     1  0.0000      0.928 1.000 0.000
#> GSM11731     2  0.0938      0.945 0.012 0.988
#> GSM11839     2  0.0938      0.945 0.012 0.988
#> GSM11836     2  0.6887      0.801 0.184 0.816
#> GSM11849     1  0.9815      0.369 0.580 0.420
#> GSM11682     1  0.0000      0.928 1.000 0.000
#> GSM11690     1  0.0000      0.928 1.000 0.000
#> GSM11692     1  0.0000      0.928 1.000 0.000
#> GSM11841     1  0.1184      0.921 0.984 0.016
#> GSM11901     1  0.1184      0.921 0.984 0.016
#> GSM11715     2  0.0938      0.945 0.012 0.988
#> GSM11724     2  0.0938      0.945 0.012 0.988
#> GSM11684     1  0.7219      0.759 0.800 0.200
#> GSM11696     1  0.7219      0.759 0.800 0.200
#> GSM27952     1  0.0000      0.928 1.000 0.000
#> GSM27948     1  0.0000      0.928 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.7589     0.6183 0.052 0.360 0.588
#> GSM11735     3  0.7607     0.6152 0.052 0.364 0.584
#> GSM11733     3  0.6867     0.6491 0.028 0.336 0.636
#> GSM11863     3  0.7032     0.6257 0.028 0.368 0.604
#> GSM11710     3  0.1015     0.7573 0.008 0.012 0.980
#> GSM11712     3  0.2280     0.7502 0.008 0.052 0.940
#> GSM11732     2  0.8271    -0.3483 0.080 0.520 0.400
#> GSM11844     3  0.7676     0.6113 0.056 0.360 0.584
#> GSM11842     3  0.7083     0.6134 0.028 0.380 0.592
#> GSM11860     3  0.7777     0.6019 0.060 0.364 0.576
#> GSM11686     3  0.0000     0.7570 0.000 0.000 1.000
#> GSM11688     3  0.1031     0.7588 0.000 0.024 0.976
#> GSM11846     3  0.3310     0.7551 0.028 0.064 0.908
#> GSM11680     3  0.6491     0.6947 0.052 0.216 0.732
#> GSM11698     3  0.6124     0.6999 0.036 0.220 0.744
#> GSM11840     3  0.6867     0.6491 0.028 0.336 0.636
#> GSM11847     3  0.6867     0.6491 0.028 0.336 0.636
#> GSM11685     3  0.1711     0.7591 0.008 0.032 0.960
#> GSM11699     3  0.3192     0.6960 0.112 0.000 0.888
#> GSM27950     3  0.6535     0.6939 0.052 0.220 0.728
#> GSM27946     3  0.0592     0.7555 0.000 0.012 0.988
#> GSM11709     1  0.2860     0.5434 0.912 0.004 0.084
#> GSM11720     1  0.2682     0.5373 0.920 0.004 0.076
#> GSM11726     1  0.4555     0.2769 0.800 0.200 0.000
#> GSM11837     2  0.6244     0.4004 0.440 0.560 0.000
#> GSM11725     1  0.7056    -0.2884 0.572 0.404 0.024
#> GSM11864     1  0.7997    -0.2189 0.568 0.360 0.072
#> GSM11687     1  0.3030     0.5462 0.904 0.004 0.092
#> GSM11693     1  0.3193     0.5462 0.896 0.004 0.100
#> GSM11727     1  0.6305    -0.3327 0.516 0.484 0.000
#> GSM11838     2  0.6244     0.4004 0.440 0.560 0.000
#> GSM11681     1  0.4121     0.5106 0.832 0.000 0.168
#> GSM11689     1  0.2945     0.5434 0.908 0.004 0.088
#> GSM11704     1  0.2945     0.5434 0.908 0.004 0.088
#> GSM11703     1  0.4261     0.5260 0.848 0.012 0.140
#> GSM11705     1  0.3918     0.5373 0.868 0.012 0.120
#> GSM11722     1  0.6062    -0.1012 0.616 0.384 0.000
#> GSM11730     1  0.5178     0.2118 0.744 0.256 0.000
#> GSM11713     1  0.5366     0.3181 0.776 0.208 0.016
#> GSM11728     1  0.7479     0.4001 0.660 0.076 0.264
#> GSM27947     3  0.1337     0.7581 0.016 0.012 0.972
#> GSM27951     1  0.2959     0.5465 0.900 0.000 0.100
#> GSM11707     3  0.9916     0.3495 0.316 0.288 0.396
#> GSM11716     2  0.8820    -0.3650 0.116 0.476 0.408
#> GSM11850     2  0.9857    -0.3471 0.252 0.380 0.368
#> GSM11851     3  0.6148     0.7044 0.028 0.244 0.728
#> GSM11721     3  0.5746     0.6422 0.180 0.040 0.780
#> GSM11852     3  0.4280     0.6958 0.124 0.020 0.856
#> GSM11694     3  0.9679     0.3825 0.320 0.232 0.448
#> GSM11695     3  0.9574     0.4401 0.292 0.232 0.476
#> GSM11734     1  0.7188    -0.3672 0.492 0.484 0.024
#> GSM11861     3  0.7146     0.4868 0.264 0.060 0.676
#> GSM11843     1  0.6937    -0.2400 0.576 0.404 0.020
#> GSM11862     3  0.6956     0.4431 0.300 0.040 0.660
#> GSM11697     3  0.9574     0.4401 0.292 0.232 0.476
#> GSM11714     1  0.9811    -0.2797 0.384 0.240 0.376
#> GSM11723     2  0.7438     0.2858 0.428 0.536 0.036
#> GSM11845     2  0.8326     0.1986 0.432 0.488 0.080
#> GSM11683     1  0.8496     0.0408 0.492 0.092 0.416
#> GSM11691     1  0.8556     0.0390 0.488 0.096 0.416
#> GSM27949     3  0.6124     0.7002 0.036 0.220 0.744
#> GSM27945     3  0.5932     0.7175 0.056 0.164 0.780
#> GSM11706     3  0.2229     0.7584 0.012 0.044 0.944
#> GSM11853     3  0.1170     0.7580 0.016 0.008 0.976
#> GSM11729     2  0.6280     0.4283 0.460 0.540 0.000
#> GSM11746     2  0.6295     0.4176 0.472 0.528 0.000
#> GSM11711     3  0.0747     0.7571 0.016 0.000 0.984
#> GSM11854     3  0.0848     0.7563 0.008 0.008 0.984
#> GSM11731     2  0.6235     0.4347 0.436 0.564 0.000
#> GSM11839     2  0.6823     0.3524 0.484 0.504 0.012
#> GSM11836     2  0.8991     0.2736 0.392 0.476 0.132
#> GSM11849     3  0.8849     0.2096 0.292 0.152 0.556
#> GSM11682     3  0.1337     0.7506 0.016 0.012 0.972
#> GSM11690     3  0.1751     0.7473 0.012 0.028 0.960
#> GSM11692     3  0.2229     0.7473 0.012 0.044 0.944
#> GSM11841     3  0.3690     0.7229 0.016 0.100 0.884
#> GSM11901     3  0.3690     0.7229 0.016 0.100 0.884
#> GSM11715     2  0.6244     0.4303 0.440 0.560 0.000
#> GSM11724     2  0.6244     0.4303 0.440 0.560 0.000
#> GSM11684     3  0.7768     0.2552 0.344 0.064 0.592
#> GSM11696     3  0.7768     0.2552 0.344 0.064 0.592
#> GSM27952     3  0.1015     0.7538 0.008 0.012 0.980
#> GSM27948     3  0.1751     0.7473 0.012 0.028 0.960

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.6945     0.5817 0.032 0.084 0.624 0.260
#> GSM11735     3  0.6627     0.5914 0.032 0.072 0.656 0.240
#> GSM11733     3  0.7101     0.5164 0.032 0.068 0.560 0.340
#> GSM11863     3  0.7090     0.5318 0.032 0.076 0.584 0.308
#> GSM11710     4  0.2894     0.7282 0.020 0.024 0.048 0.908
#> GSM11712     4  0.2552     0.7231 0.012 0.020 0.048 0.920
#> GSM11732     3  0.6701     0.5494 0.024 0.160 0.672 0.144
#> GSM11844     3  0.6642     0.5838 0.024 0.116 0.672 0.188
#> GSM11842     3  0.7360     0.5325 0.032 0.100 0.572 0.296
#> GSM11860     3  0.7537     0.5369 0.040 0.100 0.560 0.300
#> GSM11686     4  0.2275     0.7387 0.004 0.020 0.048 0.928
#> GSM11688     4  0.3442     0.6984 0.012 0.028 0.084 0.876
#> GSM11846     4  0.4596     0.6297 0.028 0.024 0.140 0.808
#> GSM11680     3  0.6380     0.4066 0.052 0.004 0.480 0.464
#> GSM11698     4  0.5607    -0.4098 0.020 0.000 0.488 0.492
#> GSM11840     3  0.7101     0.5164 0.032 0.068 0.560 0.340
#> GSM11847     3  0.7101     0.5164 0.032 0.068 0.560 0.340
#> GSM11685     4  0.3057     0.7139 0.012 0.024 0.068 0.896
#> GSM11699     4  0.2739     0.7263 0.060 0.000 0.036 0.904
#> GSM27950     3  0.6735     0.4257 0.048 0.020 0.496 0.436
#> GSM27946     4  0.1082     0.7551 0.020 0.004 0.004 0.972
#> GSM11709     1  0.2360     0.7508 0.924 0.020 0.004 0.052
#> GSM11720     1  0.2486     0.7478 0.920 0.028 0.004 0.048
#> GSM11726     1  0.6370     0.3888 0.644 0.252 0.100 0.004
#> GSM11837     2  0.5784     0.6725 0.200 0.700 0.100 0.000
#> GSM11725     2  0.5675     0.7349 0.272 0.676 0.048 0.004
#> GSM11864     2  0.7569     0.6275 0.316 0.552 0.076 0.056
#> GSM11687     1  0.2467     0.7493 0.920 0.024 0.004 0.052
#> GSM11693     1  0.2408     0.7525 0.920 0.016 0.004 0.060
#> GSM11727     2  0.6450     0.5562 0.276 0.616 0.108 0.000
#> GSM11838     2  0.5875     0.6679 0.204 0.692 0.104 0.000
#> GSM11681     1  0.2983     0.7153 0.880 0.008 0.004 0.108
#> GSM11689     1  0.2408     0.7525 0.920 0.016 0.004 0.060
#> GSM11704     1  0.2408     0.7525 0.920 0.016 0.004 0.060
#> GSM11703     1  0.2716     0.7441 0.908 0.012 0.012 0.068
#> GSM11705     1  0.2587     0.7492 0.916 0.020 0.008 0.056
#> GSM11722     1  0.6957    -0.0851 0.472 0.416 0.112 0.000
#> GSM11730     1  0.6641     0.3332 0.600 0.276 0.124 0.000
#> GSM11713     1  0.6483     0.4756 0.664 0.192 0.136 0.008
#> GSM11728     1  0.5633     0.6534 0.772 0.056 0.072 0.100
#> GSM27947     4  0.1362     0.7556 0.020 0.004 0.012 0.964
#> GSM27951     1  0.2408     0.7525 0.920 0.016 0.004 0.060
#> GSM11707     3  0.8003     0.4457 0.312 0.048 0.516 0.124
#> GSM11716     3  0.7157     0.5810 0.040 0.136 0.644 0.180
#> GSM11850     3  0.7875     0.4603 0.108 0.184 0.604 0.104
#> GSM11851     3  0.5919     0.3536 0.016 0.012 0.492 0.480
#> GSM11721     4  0.5391     0.6095 0.160 0.036 0.040 0.764
#> GSM11852     4  0.4331     0.6585 0.136 0.016 0.028 0.820
#> GSM11694     3  0.7781     0.4190 0.316 0.012 0.488 0.184
#> GSM11695     3  0.7711     0.4290 0.312 0.008 0.488 0.192
#> GSM11734     2  0.5176     0.7623 0.192 0.748 0.056 0.004
#> GSM11861     4  0.7348     0.3954 0.256 0.048 0.092 0.604
#> GSM11843     2  0.6350     0.6500 0.296 0.612 0.092 0.000
#> GSM11862     4  0.7272     0.3871 0.280 0.052 0.072 0.596
#> GSM11697     3  0.7725     0.4342 0.308 0.008 0.488 0.196
#> GSM11714     3  0.7827     0.2960 0.372 0.036 0.480 0.112
#> GSM11723     2  0.6753     0.5854 0.092 0.620 0.272 0.016
#> GSM11845     2  0.8101     0.4561 0.104 0.536 0.284 0.076
#> GSM11683     1  0.8289     0.0761 0.468 0.028 0.268 0.236
#> GSM11691     1  0.8545     0.0515 0.448 0.040 0.276 0.236
#> GSM27949     3  0.6670     0.4173 0.044 0.020 0.496 0.440
#> GSM27945     4  0.6249    -0.2404 0.048 0.004 0.408 0.540
#> GSM11706     4  0.3204     0.7097 0.016 0.028 0.064 0.892
#> GSM11853     4  0.1059     0.7561 0.016 0.000 0.012 0.972
#> GSM11729     2  0.3636     0.7757 0.172 0.820 0.008 0.000
#> GSM11746     2  0.3494     0.7748 0.172 0.824 0.004 0.000
#> GSM11711     4  0.2196     0.7510 0.016 0.016 0.032 0.936
#> GSM11854     4  0.1059     0.7561 0.016 0.000 0.012 0.972
#> GSM11731     2  0.3913     0.7785 0.148 0.824 0.028 0.000
#> GSM11839     2  0.5257     0.7562 0.172 0.764 0.032 0.032
#> GSM11836     2  0.5974     0.7108 0.096 0.744 0.040 0.120
#> GSM11849     4  0.7244     0.3251 0.256 0.180 0.004 0.560
#> GSM11682     4  0.1993     0.7546 0.016 0.016 0.024 0.944
#> GSM11690     4  0.1082     0.7559 0.020 0.004 0.004 0.972
#> GSM11692     4  0.1697     0.7474 0.016 0.004 0.028 0.952
#> GSM11841     4  0.3722     0.6914 0.016 0.044 0.072 0.868
#> GSM11901     4  0.3722     0.6914 0.016 0.044 0.072 0.868
#> GSM11715     2  0.3672     0.7717 0.164 0.824 0.012 0.000
#> GSM11724     2  0.3900     0.7694 0.164 0.816 0.020 0.000
#> GSM11684     4  0.6703     0.4394 0.292 0.036 0.052 0.620
#> GSM11696     4  0.6703     0.4394 0.292 0.036 0.052 0.620
#> GSM27952     4  0.2089     0.7476 0.012 0.020 0.028 0.940
#> GSM27948     4  0.0895     0.7556 0.020 0.004 0.000 0.976

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     5  0.4069     0.4565 0.000 0.004 0.088 0.108 0.800
#> GSM11735     5  0.3237     0.4737 0.000 0.000 0.048 0.104 0.848
#> GSM11733     5  0.3109     0.5288 0.000 0.000 0.000 0.200 0.800
#> GSM11863     5  0.3562     0.5212 0.000 0.000 0.016 0.196 0.788
#> GSM11710     4  0.3322     0.7534 0.000 0.012 0.064 0.860 0.064
#> GSM11712     4  0.1800     0.7537 0.000 0.000 0.020 0.932 0.048
#> GSM11732     5  0.6586    -0.0518 0.012 0.060 0.372 0.040 0.516
#> GSM11844     5  0.6549    -0.0267 0.012 0.032 0.368 0.068 0.520
#> GSM11842     5  0.4210     0.5075 0.000 0.016 0.028 0.184 0.772
#> GSM11860     5  0.4702     0.4992 0.008 0.016 0.032 0.200 0.744
#> GSM11686     4  0.3517     0.7456 0.012 0.012 0.056 0.860 0.060
#> GSM11688     4  0.4117     0.7246 0.012 0.012 0.060 0.820 0.096
#> GSM11846     4  0.4764     0.6766 0.024 0.012 0.064 0.780 0.120
#> GSM11680     5  0.7691    -0.0574 0.048 0.000 0.316 0.304 0.332
#> GSM11698     4  0.7225    -0.4440 0.016 0.000 0.320 0.336 0.328
#> GSM11840     5  0.3109     0.5288 0.000 0.000 0.000 0.200 0.800
#> GSM11847     5  0.3109     0.5288 0.000 0.000 0.000 0.200 0.800
#> GSM11685     4  0.3348     0.7484 0.004 0.012 0.056 0.864 0.064
#> GSM11699     4  0.2609     0.7535 0.052 0.000 0.048 0.896 0.004
#> GSM27950     5  0.7769     0.0307 0.040 0.008 0.300 0.272 0.380
#> GSM27946     4  0.1153     0.7662 0.008 0.000 0.024 0.964 0.004
#> GSM11709     1  0.1507     0.8153 0.952 0.012 0.012 0.024 0.000
#> GSM11720     1  0.1806     0.8131 0.940 0.016 0.016 0.028 0.000
#> GSM11726     1  0.6777     0.4307 0.540 0.220 0.220 0.008 0.012
#> GSM11837     2  0.4492     0.6545 0.052 0.740 0.204 0.000 0.004
#> GSM11725     2  0.4755     0.6920 0.172 0.744 0.072 0.000 0.012
#> GSM11864     2  0.6274     0.5856 0.264 0.608 0.088 0.004 0.036
#> GSM11687     1  0.1106     0.8160 0.964 0.012 0.000 0.024 0.000
#> GSM11693     1  0.0992     0.8161 0.968 0.008 0.000 0.024 0.000
#> GSM11727     2  0.5289     0.5918 0.108 0.680 0.208 0.000 0.004
#> GSM11838     2  0.4459     0.6561 0.052 0.744 0.200 0.000 0.004
#> GSM11681     1  0.1124     0.8049 0.960 0.004 0.000 0.036 0.000
#> GSM11689     1  0.0992     0.8161 0.968 0.008 0.000 0.024 0.000
#> GSM11704     1  0.0992     0.8161 0.968 0.008 0.000 0.024 0.000
#> GSM11703     1  0.1954     0.8059 0.932 0.008 0.032 0.028 0.000
#> GSM11705     1  0.1690     0.8095 0.944 0.008 0.024 0.024 0.000
#> GSM11722     2  0.6814    -0.0467 0.356 0.404 0.236 0.000 0.004
#> GSM11730     1  0.6908     0.3434 0.444 0.220 0.324 0.000 0.012
#> GSM11713     1  0.6772     0.4057 0.480 0.176 0.328 0.000 0.016
#> GSM11728     1  0.5964     0.5822 0.632 0.040 0.276 0.036 0.016
#> GSM27947     4  0.1690     0.7637 0.008 0.000 0.024 0.944 0.024
#> GSM27951     1  0.0992     0.8161 0.968 0.008 0.000 0.024 0.000
#> GSM11707     5  0.7435    -0.3616 0.292 0.008 0.248 0.024 0.428
#> GSM11716     5  0.7454    -0.1939 0.056 0.036 0.412 0.072 0.424
#> GSM11850     3  0.7511     0.1869 0.068 0.092 0.444 0.020 0.376
#> GSM11851     3  0.7163    -0.0746 0.016 0.000 0.388 0.272 0.324
#> GSM11721     4  0.5399     0.6453 0.096 0.020 0.088 0.752 0.044
#> GSM11852     4  0.4897     0.6593 0.096 0.008 0.084 0.776 0.036
#> GSM11694     3  0.8046     0.4899 0.276 0.000 0.348 0.088 0.288
#> GSM11695     3  0.8046     0.4899 0.276 0.000 0.348 0.088 0.288
#> GSM11734     2  0.4841     0.6945 0.056 0.752 0.160 0.000 0.032
#> GSM11861     4  0.6765     0.4524 0.092 0.020 0.236 0.604 0.048
#> GSM11843     2  0.6297     0.6172 0.148 0.644 0.164 0.004 0.040
#> GSM11862     4  0.7002     0.4644 0.148 0.032 0.172 0.608 0.040
#> GSM11697     3  0.8041     0.4742 0.252 0.000 0.364 0.092 0.292
#> GSM11714     3  0.7737     0.3845 0.292 0.012 0.336 0.028 0.332
#> GSM11723     2  0.6674     0.1292 0.036 0.452 0.412 0.000 0.100
#> GSM11845     3  0.7627    -0.1319 0.052 0.384 0.416 0.020 0.128
#> GSM11683     3  0.7948     0.4311 0.376 0.012 0.384 0.136 0.092
#> GSM11691     3  0.8132     0.4294 0.328 0.016 0.412 0.136 0.108
#> GSM27949     5  0.7876     0.0184 0.048 0.008 0.300 0.272 0.372
#> GSM27945     4  0.7766    -0.3700 0.068 0.000 0.320 0.388 0.224
#> GSM11706     4  0.4087     0.7277 0.008 0.012 0.072 0.820 0.088
#> GSM11853     4  0.2228     0.7640 0.000 0.012 0.040 0.920 0.028
#> GSM11729     2  0.1877     0.7474 0.052 0.932 0.008 0.004 0.004
#> GSM11746     2  0.1752     0.7472 0.052 0.936 0.004 0.004 0.004
#> GSM11711     4  0.2774     0.7579 0.000 0.012 0.048 0.892 0.048
#> GSM11854     4  0.2305     0.7641 0.000 0.012 0.044 0.916 0.028
#> GSM11731     2  0.3251     0.7350 0.040 0.864 0.080 0.000 0.016
#> GSM11839     2  0.5510     0.6875 0.072 0.740 0.124 0.044 0.020
#> GSM11836     2  0.5412     0.6714 0.048 0.740 0.088 0.116 0.008
#> GSM11849     4  0.6277     0.5429 0.068 0.200 0.064 0.656 0.012
#> GSM11682     4  0.2452     0.7652 0.012 0.000 0.052 0.908 0.028
#> GSM11690     4  0.1369     0.7620 0.008 0.000 0.028 0.956 0.008
#> GSM11692     4  0.2379     0.7513 0.012 0.000 0.048 0.912 0.028
#> GSM11841     4  0.3472     0.7288 0.012 0.008 0.064 0.860 0.056
#> GSM11901     4  0.3472     0.7288 0.012 0.008 0.064 0.860 0.056
#> GSM11715     2  0.2609     0.7423 0.048 0.896 0.052 0.004 0.000
#> GSM11724     2  0.2769     0.7418 0.048 0.892 0.052 0.004 0.004
#> GSM11684     4  0.6470     0.4924 0.172 0.016 0.192 0.608 0.012
#> GSM11696     4  0.6470     0.4924 0.172 0.016 0.192 0.608 0.012
#> GSM27952     4  0.2985     0.7576 0.008 0.012 0.044 0.888 0.048
#> GSM27948     4  0.1082     0.7617 0.000 0.000 0.028 0.964 0.008

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     5  0.5490     0.6562 0.000 0.008 0.244 0.052 0.640 0.056
#> GSM11735     5  0.4616     0.7444 0.000 0.008 0.196 0.048 0.724 0.024
#> GSM11733     5  0.3375     0.8762 0.000 0.000 0.096 0.088 0.816 0.000
#> GSM11863     5  0.3198     0.8608 0.000 0.000 0.060 0.084 0.844 0.012
#> GSM11710     4  0.4045     0.7142 0.004 0.004 0.080 0.808 0.044 0.060
#> GSM11712     4  0.2325     0.7336 0.000 0.008 0.004 0.900 0.068 0.020
#> GSM11732     3  0.5254     0.3694 0.000 0.096 0.656 0.008 0.224 0.016
#> GSM11844     3  0.5410     0.3751 0.000 0.080 0.656 0.024 0.224 0.016
#> GSM11842     5  0.3889     0.8423 0.000 0.016 0.056 0.088 0.816 0.024
#> GSM11860     5  0.4391     0.8261 0.004 0.016 0.068 0.104 0.784 0.024
#> GSM11686     4  0.4326     0.6925 0.004 0.004 0.140 0.772 0.032 0.048
#> GSM11688     4  0.4511     0.6805 0.000 0.004 0.140 0.756 0.052 0.048
#> GSM11846     4  0.4589     0.6767 0.012 0.000 0.140 0.756 0.052 0.040
#> GSM11680     3  0.4471     0.5249 0.016 0.000 0.684 0.268 0.028 0.004
#> GSM11698     3  0.4248     0.5026 0.004 0.000 0.672 0.296 0.024 0.004
#> GSM11840     5  0.3375     0.8762 0.000 0.000 0.096 0.088 0.816 0.000
#> GSM11847     5  0.3375     0.8762 0.000 0.000 0.096 0.088 0.816 0.000
#> GSM11685     4  0.3492     0.7188 0.000 0.004 0.084 0.836 0.028 0.048
#> GSM11699     4  0.2948     0.7330 0.028 0.000 0.072 0.872 0.012 0.016
#> GSM27950     3  0.5654     0.4776 0.012 0.004 0.640 0.236 0.068 0.040
#> GSM27946     4  0.2876     0.7307 0.004 0.008 0.104 0.860 0.024 0.000
#> GSM11709     1  0.0551     0.9160 0.984 0.000 0.000 0.004 0.004 0.008
#> GSM11720     1  0.0603     0.9135 0.980 0.000 0.000 0.004 0.000 0.016
#> GSM11726     6  0.4768     0.4249 0.416 0.052 0.000 0.000 0.000 0.532
#> GSM11837     6  0.4780     0.2452 0.040 0.472 0.000 0.000 0.004 0.484
#> GSM11725     2  0.4374     0.6359 0.160 0.752 0.064 0.000 0.004 0.020
#> GSM11864     2  0.6940     0.4681 0.252 0.548 0.088 0.012 0.052 0.048
#> GSM11687     1  0.0291     0.9185 0.992 0.004 0.000 0.004 0.000 0.000
#> GSM11693     1  0.0551     0.9168 0.984 0.004 0.008 0.004 0.000 0.000
#> GSM11727     6  0.5004     0.3457 0.060 0.420 0.000 0.000 0.004 0.516
#> GSM11838     6  0.4780     0.2452 0.040 0.472 0.000 0.000 0.004 0.484
#> GSM11681     1  0.0909     0.8984 0.968 0.000 0.020 0.012 0.000 0.000
#> GSM11689     1  0.0436     0.9195 0.988 0.004 0.004 0.004 0.000 0.000
#> GSM11704     1  0.0436     0.9195 0.988 0.004 0.004 0.004 0.000 0.000
#> GSM11703     1  0.1511     0.8913 0.940 0.000 0.012 0.004 0.000 0.044
#> GSM11705     1  0.1484     0.8886 0.944 0.000 0.008 0.004 0.004 0.040
#> GSM11722     6  0.5689     0.5883 0.252 0.180 0.000 0.000 0.008 0.560
#> GSM11730     6  0.4254     0.5613 0.272 0.048 0.000 0.000 0.000 0.680
#> GSM11713     6  0.4693     0.4866 0.312 0.028 0.000 0.000 0.024 0.636
#> GSM11728     1  0.5270     0.1006 0.516 0.004 0.020 0.008 0.028 0.424
#> GSM27947     4  0.3192     0.7262 0.012 0.008 0.100 0.848 0.032 0.000
#> GSM27951     1  0.0436     0.9195 0.988 0.004 0.004 0.004 0.000 0.000
#> GSM11707     3  0.7498     0.3630 0.240 0.008 0.476 0.024 0.144 0.108
#> GSM11716     3  0.5516     0.4881 0.028 0.100 0.716 0.028 0.108 0.020
#> GSM11850     3  0.5585     0.4923 0.028 0.128 0.712 0.032 0.076 0.024
#> GSM11851     3  0.5610     0.4454 0.000 0.028 0.624 0.256 0.076 0.016
#> GSM11721     4  0.5986     0.6135 0.092 0.080 0.044 0.700 0.032 0.052
#> GSM11852     4  0.6164     0.6163 0.092 0.076 0.064 0.688 0.032 0.048
#> GSM11694     3  0.5016     0.5668 0.268 0.004 0.636 0.088 0.004 0.000
#> GSM11695     3  0.5016     0.5668 0.268 0.004 0.636 0.088 0.004 0.000
#> GSM11734     2  0.4614     0.6148 0.012 0.744 0.164 0.000 0.044 0.036
#> GSM11861     4  0.7706     0.3708 0.044 0.088 0.240 0.504 0.048 0.076
#> GSM11843     2  0.6437     0.5328 0.120 0.644 0.076 0.004 0.084 0.072
#> GSM11862     4  0.8192     0.3981 0.128 0.116 0.120 0.500 0.040 0.096
#> GSM11697     3  0.5019     0.5716 0.248 0.000 0.652 0.088 0.004 0.008
#> GSM11714     3  0.7035     0.4539 0.260 0.004 0.524 0.040 0.076 0.096
#> GSM11723     3  0.6048    -0.0433 0.000 0.408 0.464 0.004 0.080 0.044
#> GSM11845     3  0.6750     0.0618 0.008 0.348 0.476 0.016 0.100 0.052
#> GSM11683     3  0.7395     0.3867 0.332 0.028 0.448 0.096 0.020 0.076
#> GSM11691     3  0.7931     0.4398 0.252 0.084 0.468 0.096 0.024 0.076
#> GSM27949     3  0.5600     0.4863 0.020 0.004 0.648 0.236 0.056 0.036
#> GSM27945     3  0.4838     0.5183 0.048 0.000 0.640 0.296 0.012 0.004
#> GSM11706     4  0.4509     0.6825 0.000 0.004 0.116 0.764 0.056 0.060
#> GSM11853     4  0.2684     0.7380 0.004 0.000 0.052 0.888 0.032 0.024
#> GSM11729     2  0.3603     0.6429 0.032 0.820 0.008 0.004 0.012 0.124
#> GSM11746     2  0.3558     0.6265 0.052 0.808 0.004 0.004 0.000 0.132
#> GSM11711     4  0.3303     0.7262 0.004 0.004 0.080 0.852 0.024 0.036
#> GSM11854     4  0.2684     0.7378 0.004 0.000 0.052 0.888 0.032 0.024
#> GSM11731     2  0.2859     0.6764 0.024 0.884 0.032 0.000 0.016 0.044
#> GSM11839     2  0.5490     0.5974 0.040 0.740 0.056 0.044 0.044 0.076
#> GSM11836     2  0.5186     0.6005 0.004 0.740 0.056 0.108 0.040 0.052
#> GSM11849     4  0.7291     0.5209 0.064 0.128 0.040 0.548 0.024 0.196
#> GSM11682     4  0.4155     0.7197 0.004 0.012 0.080 0.796 0.016 0.092
#> GSM11690     4  0.3545     0.7171 0.004 0.012 0.032 0.840 0.024 0.088
#> GSM11692     4  0.4199     0.6964 0.000 0.012 0.036 0.788 0.044 0.120
#> GSM11841     4  0.5777     0.6147 0.000 0.028 0.044 0.668 0.112 0.148
#> GSM11901     4  0.5777     0.6147 0.000 0.028 0.044 0.668 0.112 0.148
#> GSM11715     2  0.3845     0.6018 0.024 0.772 0.000 0.004 0.016 0.184
#> GSM11724     2  0.3877     0.6009 0.024 0.768 0.000 0.004 0.016 0.188
#> GSM11684     4  0.7206     0.4024 0.088 0.016 0.044 0.472 0.052 0.328
#> GSM11696     4  0.7206     0.4024 0.088 0.016 0.044 0.472 0.052 0.328
#> GSM27952     4  0.3689     0.7172 0.004 0.004 0.100 0.824 0.024 0.044
#> GSM27948     4  0.3494     0.7197 0.004 0.012 0.032 0.844 0.024 0.084

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-kmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-kmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-kmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-kmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-kmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-kmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-kmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>            n cell.line(p) agent(p)  time(p) k
#> CV:kmeans 79     3.23e-09    0.312 2.67e-02 2
#> CV:kmeans 47     4.94e-09    0.349 2.44e-01 3
#> CV:kmeans 59     6.11e-10    0.532 4.36e-06 4
#> CV:kmeans 53     4.44e-08    0.591 5.09e-06 5
#> CV:kmeans 59     2.09e-12    0.376 7.81e-06 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:skmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "skmeans"]
# you can also extract it by
# res = res_list["CV:skmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-skmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-skmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.741           0.853       0.942         0.5009 0.500   0.500
#> 3 3 0.562           0.779       0.853         0.3299 0.719   0.492
#> 4 4 0.609           0.706       0.833         0.1243 0.893   0.688
#> 5 5 0.655           0.647       0.773         0.0671 0.927   0.730
#> 6 6 0.667           0.535       0.741         0.0403 0.931   0.708

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1  0.0000     0.9348 1.000 0.000
#> GSM11735     1  0.0000     0.9348 1.000 0.000
#> GSM11733     1  0.0000     0.9348 1.000 0.000
#> GSM11863     1  0.0000     0.9348 1.000 0.000
#> GSM11710     1  0.0000     0.9348 1.000 0.000
#> GSM11712     1  0.0000     0.9348 1.000 0.000
#> GSM11732     1  0.4939     0.8353 0.892 0.108
#> GSM11844     1  0.0000     0.9348 1.000 0.000
#> GSM11842     1  0.0000     0.9348 1.000 0.000
#> GSM11860     1  0.3733     0.8724 0.928 0.072
#> GSM11686     1  0.0000     0.9348 1.000 0.000
#> GSM11688     1  0.0000     0.9348 1.000 0.000
#> GSM11846     1  0.0000     0.9348 1.000 0.000
#> GSM11680     1  0.0000     0.9348 1.000 0.000
#> GSM11698     1  0.0000     0.9348 1.000 0.000
#> GSM11840     1  0.0000     0.9348 1.000 0.000
#> GSM11847     1  0.0000     0.9348 1.000 0.000
#> GSM11685     1  0.0000     0.9348 1.000 0.000
#> GSM11699     1  0.0000     0.9348 1.000 0.000
#> GSM27950     1  0.0000     0.9348 1.000 0.000
#> GSM27946     1  0.0000     0.9348 1.000 0.000
#> GSM11709     2  0.0000     0.9321 0.000 1.000
#> GSM11720     2  0.0000     0.9321 0.000 1.000
#> GSM11726     2  0.0000     0.9321 0.000 1.000
#> GSM11837     2  0.0000     0.9321 0.000 1.000
#> GSM11725     2  0.0000     0.9321 0.000 1.000
#> GSM11864     2  0.7219     0.7310 0.200 0.800
#> GSM11687     2  0.0000     0.9321 0.000 1.000
#> GSM11693     2  0.0000     0.9321 0.000 1.000
#> GSM11727     2  0.0000     0.9321 0.000 1.000
#> GSM11838     2  0.0000     0.9321 0.000 1.000
#> GSM11681     2  0.6712     0.7626 0.176 0.824
#> GSM11689     2  0.0000     0.9321 0.000 1.000
#> GSM11704     2  0.0000     0.9321 0.000 1.000
#> GSM11703     2  0.0000     0.9321 0.000 1.000
#> GSM11705     2  0.0000     0.9321 0.000 1.000
#> GSM11722     2  0.0000     0.9321 0.000 1.000
#> GSM11730     2  0.0000     0.9321 0.000 1.000
#> GSM11713     2  0.0000     0.9321 0.000 1.000
#> GSM11728     2  0.0000     0.9321 0.000 1.000
#> GSM27947     1  0.0000     0.9348 1.000 0.000
#> GSM27951     2  0.0000     0.9321 0.000 1.000
#> GSM11707     1  0.6973     0.7405 0.812 0.188
#> GSM11716     1  0.9775     0.2732 0.588 0.412
#> GSM11850     2  0.9635     0.3286 0.388 0.612
#> GSM11851     1  0.0000     0.9348 1.000 0.000
#> GSM11721     1  0.7219     0.7186 0.800 0.200
#> GSM11852     1  0.0000     0.9348 1.000 0.000
#> GSM11694     1  0.8608     0.5815 0.716 0.284
#> GSM11695     1  0.1184     0.9231 0.984 0.016
#> GSM11734     2  0.0000     0.9321 0.000 1.000
#> GSM11861     1  0.9983     0.0892 0.524 0.476
#> GSM11843     2  0.0000     0.9321 0.000 1.000
#> GSM11862     1  0.9983     0.0892 0.524 0.476
#> GSM11697     1  0.1184     0.9231 0.984 0.016
#> GSM11714     1  0.9775     0.3049 0.588 0.412
#> GSM11723     2  0.0000     0.9321 0.000 1.000
#> GSM11845     2  0.7219     0.7310 0.200 0.800
#> GSM11683     2  0.7453     0.7125 0.212 0.788
#> GSM11691     2  0.6801     0.7578 0.180 0.820
#> GSM27949     1  0.0000     0.9348 1.000 0.000
#> GSM27945     1  0.0000     0.9348 1.000 0.000
#> GSM11706     1  0.0000     0.9348 1.000 0.000
#> GSM11853     1  0.0000     0.9348 1.000 0.000
#> GSM11729     2  0.0000     0.9321 0.000 1.000
#> GSM11746     2  0.0000     0.9321 0.000 1.000
#> GSM11711     1  0.0000     0.9348 1.000 0.000
#> GSM11854     1  0.0000     0.9348 1.000 0.000
#> GSM11731     2  0.0000     0.9321 0.000 1.000
#> GSM11839     2  0.0000     0.9321 0.000 1.000
#> GSM11836     2  0.0672     0.9266 0.008 0.992
#> GSM11849     2  0.2423     0.9037 0.040 0.960
#> GSM11682     1  0.0000     0.9348 1.000 0.000
#> GSM11690     1  0.0000     0.9348 1.000 0.000
#> GSM11692     1  0.0000     0.9348 1.000 0.000
#> GSM11841     1  0.0000     0.9348 1.000 0.000
#> GSM11901     1  0.0000     0.9348 1.000 0.000
#> GSM11715     2  0.0000     0.9321 0.000 1.000
#> GSM11724     2  0.0000     0.9321 0.000 1.000
#> GSM11684     2  0.9661     0.3560 0.392 0.608
#> GSM11696     2  0.9661     0.3560 0.392 0.608
#> GSM27952     1  0.0000     0.9348 1.000 0.000
#> GSM27948     1  0.0000     0.9348 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.4555      0.774 0.200 0.000 0.800
#> GSM11735     3  0.4555      0.774 0.200 0.000 0.800
#> GSM11733     3  0.5905      0.635 0.352 0.000 0.648
#> GSM11863     3  0.5902      0.652 0.316 0.004 0.680
#> GSM11710     1  0.0424      0.889 0.992 0.000 0.008
#> GSM11712     1  0.0592      0.885 0.988 0.000 0.012
#> GSM11732     3  0.4902      0.759 0.064 0.092 0.844
#> GSM11844     3  0.4921      0.765 0.084 0.072 0.844
#> GSM11842     3  0.6445      0.658 0.308 0.020 0.672
#> GSM11860     3  0.7495      0.689 0.248 0.084 0.668
#> GSM11686     1  0.0892      0.885 0.980 0.000 0.020
#> GSM11688     1  0.2796      0.822 0.908 0.000 0.092
#> GSM11846     1  0.4887      0.606 0.772 0.000 0.228
#> GSM11680     3  0.4504      0.775 0.196 0.000 0.804
#> GSM11698     3  0.4555      0.774 0.200 0.000 0.800
#> GSM11840     3  0.5926      0.629 0.356 0.000 0.644
#> GSM11847     3  0.5926      0.629 0.356 0.000 0.644
#> GSM11685     1  0.0592      0.888 0.988 0.000 0.012
#> GSM11699     1  0.2200      0.863 0.940 0.004 0.056
#> GSM27950     3  0.4504      0.775 0.196 0.000 0.804
#> GSM27946     1  0.0000      0.889 1.000 0.000 0.000
#> GSM11709     2  0.3879      0.875 0.000 0.848 0.152
#> GSM11720     2  0.3816      0.877 0.000 0.852 0.148
#> GSM11726     2  0.1411      0.890 0.000 0.964 0.036
#> GSM11837     2  0.1411      0.884 0.000 0.964 0.036
#> GSM11725     2  0.1753      0.880 0.000 0.952 0.048
#> GSM11864     2  0.6054      0.719 0.052 0.768 0.180
#> GSM11687     2  0.3941      0.875 0.000 0.844 0.156
#> GSM11693     2  0.3941      0.875 0.000 0.844 0.156
#> GSM11727     2  0.0000      0.889 0.000 1.000 0.000
#> GSM11838     2  0.1411      0.884 0.000 0.964 0.036
#> GSM11681     2  0.7016      0.785 0.116 0.728 0.156
#> GSM11689     2  0.3941      0.875 0.000 0.844 0.156
#> GSM11704     2  0.3941      0.875 0.000 0.844 0.156
#> GSM11703     2  0.3879      0.875 0.000 0.848 0.152
#> GSM11705     2  0.3879      0.875 0.000 0.848 0.152
#> GSM11722     2  0.0424      0.890 0.000 0.992 0.008
#> GSM11730     2  0.2448      0.887 0.000 0.924 0.076
#> GSM11713     2  0.3340      0.881 0.000 0.880 0.120
#> GSM11728     2  0.5237      0.854 0.056 0.824 0.120
#> GSM27947     1  0.0747      0.886 0.984 0.000 0.016
#> GSM27951     2  0.3941      0.875 0.000 0.844 0.156
#> GSM11707     3  0.2050      0.743 0.028 0.020 0.952
#> GSM11716     3  0.4921      0.765 0.084 0.072 0.844
#> GSM11850     3  0.4750      0.684 0.000 0.216 0.784
#> GSM11851     3  0.4796      0.764 0.220 0.000 0.780
#> GSM11721     1  0.5413      0.748 0.800 0.164 0.036
#> GSM11852     1  0.3482      0.816 0.872 0.000 0.128
#> GSM11694     3  0.1585      0.745 0.028 0.008 0.964
#> GSM11695     3  0.1525      0.746 0.032 0.004 0.964
#> GSM11734     2  0.2165      0.870 0.000 0.936 0.064
#> GSM11861     1  0.6705      0.710 0.740 0.084 0.176
#> GSM11843     2  0.3267      0.884 0.000 0.884 0.116
#> GSM11862     1  0.6856      0.682 0.740 0.128 0.132
#> GSM11697     3  0.1774      0.743 0.024 0.016 0.960
#> GSM11714     3  0.4609      0.660 0.028 0.128 0.844
#> GSM11723     3  0.6299      0.187 0.000 0.476 0.524
#> GSM11845     3  0.7850      0.514 0.076 0.316 0.608
#> GSM11683     3  0.6398      0.174 0.008 0.372 0.620
#> GSM11691     3  0.6228      0.168 0.004 0.372 0.624
#> GSM27949     3  0.4504      0.775 0.196 0.000 0.804
#> GSM27945     3  0.4605      0.773 0.204 0.000 0.796
#> GSM11706     1  0.1163      0.879 0.972 0.000 0.028
#> GSM11853     1  0.0747      0.887 0.984 0.000 0.016
#> GSM11729     2  0.1411      0.884 0.000 0.964 0.036
#> GSM11746     2  0.1411      0.884 0.000 0.964 0.036
#> GSM11711     1  0.0747      0.887 0.984 0.000 0.016
#> GSM11854     1  0.0424      0.889 0.992 0.000 0.008
#> GSM11731     2  0.1529      0.883 0.000 0.960 0.040
#> GSM11839     2  0.2116      0.880 0.012 0.948 0.040
#> GSM11836     2  0.6506      0.622 0.236 0.720 0.044
#> GSM11849     1  0.6825      0.138 0.500 0.488 0.012
#> GSM11682     1  0.0000      0.889 1.000 0.000 0.000
#> GSM11690     1  0.0000      0.889 1.000 0.000 0.000
#> GSM11692     1  0.0000      0.889 1.000 0.000 0.000
#> GSM11841     1  0.1647      0.868 0.960 0.004 0.036
#> GSM11901     1  0.1647      0.868 0.960 0.004 0.036
#> GSM11715     2  0.1411      0.884 0.000 0.964 0.036
#> GSM11724     2  0.1411      0.884 0.000 0.964 0.036
#> GSM11684     1  0.5737      0.750 0.804 0.104 0.092
#> GSM11696     1  0.5737      0.750 0.804 0.104 0.092
#> GSM27952     1  0.0000      0.889 1.000 0.000 0.000
#> GSM27948     1  0.0000      0.889 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.1724     0.7733 0.000 0.020 0.948 0.032
#> GSM11735     3  0.1733     0.7737 0.000 0.024 0.948 0.028
#> GSM11733     3  0.5420     0.5601 0.000 0.044 0.684 0.272
#> GSM11863     3  0.6690     0.5709 0.000 0.188 0.620 0.192
#> GSM11710     4  0.1576     0.8422 0.000 0.004 0.048 0.948
#> GSM11712     4  0.1284     0.8453 0.000 0.024 0.012 0.964
#> GSM11732     3  0.2149     0.7615 0.000 0.088 0.912 0.000
#> GSM11844     3  0.2281     0.7636 0.000 0.096 0.904 0.000
#> GSM11842     3  0.6798     0.3290 0.000 0.396 0.504 0.100
#> GSM11860     3  0.7484     0.2968 0.060 0.392 0.496 0.052
#> GSM11686     4  0.2654     0.8126 0.000 0.004 0.108 0.888
#> GSM11688     4  0.3982     0.6973 0.000 0.004 0.220 0.776
#> GSM11846     4  0.6848     0.1291 0.056 0.020 0.420 0.504
#> GSM11680     3  0.1296     0.7768 0.004 0.004 0.964 0.028
#> GSM11698     3  0.1284     0.7767 0.000 0.012 0.964 0.024
#> GSM11840     3  0.5592     0.5120 0.000 0.044 0.656 0.300
#> GSM11847     3  0.5569     0.5194 0.000 0.044 0.660 0.296
#> GSM11685     4  0.0921     0.8451 0.000 0.000 0.028 0.972
#> GSM11699     4  0.1732     0.8457 0.008 0.004 0.040 0.948
#> GSM27950     3  0.1004     0.7764 0.004 0.000 0.972 0.024
#> GSM27946     4  0.1305     0.8445 0.000 0.004 0.036 0.960
#> GSM11709     1  0.0592     0.8360 0.984 0.016 0.000 0.000
#> GSM11720     1  0.0921     0.8294 0.972 0.028 0.000 0.000
#> GSM11726     1  0.4632     0.4347 0.688 0.308 0.004 0.000
#> GSM11837     2  0.3402     0.8343 0.164 0.832 0.004 0.000
#> GSM11725     2  0.3852     0.8126 0.180 0.808 0.012 0.000
#> GSM11864     2  0.6110     0.6685 0.176 0.680 0.144 0.000
#> GSM11687     1  0.0188     0.8381 0.996 0.004 0.000 0.000
#> GSM11693     1  0.0188     0.8381 0.996 0.004 0.000 0.000
#> GSM11727     2  0.4741     0.6088 0.328 0.668 0.004 0.000
#> GSM11838     2  0.3448     0.8315 0.168 0.828 0.004 0.000
#> GSM11681     1  0.1807     0.7927 0.940 0.008 0.000 0.052
#> GSM11689     1  0.0188     0.8381 0.996 0.004 0.000 0.000
#> GSM11704     1  0.0188     0.8381 0.996 0.004 0.000 0.000
#> GSM11703     1  0.0336     0.8373 0.992 0.008 0.000 0.000
#> GSM11705     1  0.0469     0.8371 0.988 0.012 0.000 0.000
#> GSM11722     2  0.5163     0.2080 0.480 0.516 0.004 0.000
#> GSM11730     1  0.4761     0.3876 0.664 0.332 0.004 0.000
#> GSM11713     1  0.2773     0.7626 0.880 0.116 0.004 0.000
#> GSM11728     1  0.3043     0.7757 0.876 0.112 0.004 0.008
#> GSM27947     4  0.2197     0.8252 0.004 0.000 0.080 0.916
#> GSM27951     1  0.0188     0.8381 0.996 0.004 0.000 0.000
#> GSM11707     3  0.2992     0.7448 0.084 0.016 0.892 0.008
#> GSM11716     3  0.2149     0.7617 0.000 0.088 0.912 0.000
#> GSM11850     3  0.4746     0.4547 0.000 0.368 0.632 0.000
#> GSM11851     3  0.5463     0.5937 0.000 0.052 0.692 0.256
#> GSM11721     4  0.4772     0.7573 0.044 0.152 0.012 0.792
#> GSM11852     4  0.4358     0.7775 0.016 0.036 0.124 0.824
#> GSM11694     3  0.5136     0.6284 0.188 0.056 0.752 0.004
#> GSM11695     3  0.5200     0.6289 0.188 0.052 0.752 0.008
#> GSM11734     2  0.2179     0.8326 0.064 0.924 0.012 0.000
#> GSM11861     4  0.6467     0.6677 0.168 0.144 0.012 0.676
#> GSM11843     2  0.4018     0.7423 0.224 0.772 0.004 0.000
#> GSM11862     4  0.6133     0.6435 0.220 0.100 0.004 0.676
#> GSM11697     3  0.3842     0.7042 0.128 0.036 0.836 0.000
#> GSM11714     3  0.5173     0.4165 0.320 0.020 0.660 0.000
#> GSM11723     2  0.1970     0.7903 0.008 0.932 0.060 0.000
#> GSM11845     2  0.4119     0.6452 0.012 0.796 0.188 0.004
#> GSM11683     1  0.6176     0.1892 0.524 0.052 0.424 0.000
#> GSM11691     1  0.6384     0.2105 0.532 0.068 0.400 0.000
#> GSM27949     3  0.1004     0.7764 0.004 0.000 0.972 0.024
#> GSM27945     3  0.3279     0.7612 0.008 0.024 0.880 0.088
#> GSM11706     4  0.2928     0.8055 0.000 0.012 0.108 0.880
#> GSM11853     4  0.1209     0.8442 0.000 0.004 0.032 0.964
#> GSM11729     2  0.2814     0.8491 0.132 0.868 0.000 0.000
#> GSM11746     2  0.2973     0.8456 0.144 0.856 0.000 0.000
#> GSM11711     4  0.1109     0.8443 0.000 0.004 0.028 0.968
#> GSM11854     4  0.1109     0.8451 0.000 0.004 0.028 0.968
#> GSM11731     2  0.2401     0.8458 0.092 0.904 0.004 0.000
#> GSM11839     2  0.2156     0.8349 0.060 0.928 0.004 0.008
#> GSM11836     2  0.2300     0.8282 0.048 0.924 0.000 0.028
#> GSM11849     4  0.7372     0.0776 0.140 0.400 0.004 0.456
#> GSM11682     4  0.0817     0.8411 0.000 0.024 0.000 0.976
#> GSM11690     4  0.0817     0.8411 0.000 0.024 0.000 0.976
#> GSM11692     4  0.1191     0.8416 0.004 0.024 0.004 0.968
#> GSM11841     4  0.4051     0.7217 0.004 0.208 0.004 0.784
#> GSM11901     4  0.3933     0.7347 0.004 0.196 0.004 0.796
#> GSM11715     2  0.2814     0.8491 0.132 0.868 0.000 0.000
#> GSM11724     2  0.2944     0.8488 0.128 0.868 0.004 0.000
#> GSM11684     4  0.5242     0.6789 0.184 0.064 0.004 0.748
#> GSM11696     4  0.5242     0.6789 0.184 0.064 0.004 0.748
#> GSM27952     4  0.0657     0.8457 0.000 0.004 0.012 0.984
#> GSM27948     4  0.0817     0.8411 0.000 0.024 0.000 0.976

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     5  0.3966     0.3604 0.000 0.000 0.336 0.000 0.664
#> GSM11735     5  0.4074     0.2717 0.000 0.000 0.364 0.000 0.636
#> GSM11733     5  0.2344     0.7266 0.000 0.000 0.064 0.032 0.904
#> GSM11863     5  0.2476     0.7225 0.000 0.012 0.064 0.020 0.904
#> GSM11710     4  0.4327     0.6174 0.000 0.000 0.008 0.632 0.360
#> GSM11712     4  0.3920     0.6810 0.000 0.004 0.004 0.724 0.268
#> GSM11732     3  0.4828     0.5365 0.000 0.056 0.712 0.008 0.224
#> GSM11844     3  0.5002     0.4094 0.000 0.036 0.644 0.008 0.312
#> GSM11842     5  0.3698     0.6676 0.000 0.104 0.052 0.012 0.832
#> GSM11860     5  0.4362     0.6277 0.020 0.136 0.048 0.004 0.792
#> GSM11686     4  0.4907     0.6501 0.000 0.000 0.056 0.664 0.280
#> GSM11688     4  0.5230     0.4076 0.000 0.000 0.044 0.504 0.452
#> GSM11846     5  0.5705     0.1887 0.024 0.000 0.064 0.288 0.624
#> GSM11680     3  0.3877     0.6427 0.000 0.000 0.764 0.024 0.212
#> GSM11698     3  0.3844     0.6576 0.000 0.000 0.792 0.044 0.164
#> GSM11840     5  0.2344     0.7266 0.000 0.000 0.064 0.032 0.904
#> GSM11847     5  0.2344     0.7266 0.000 0.000 0.064 0.032 0.904
#> GSM11685     4  0.4141     0.6979 0.000 0.000 0.028 0.736 0.236
#> GSM11699     4  0.4411     0.7097 0.004 0.000 0.096 0.772 0.128
#> GSM27950     3  0.3999     0.6223 0.000 0.000 0.740 0.020 0.240
#> GSM27946     4  0.3488     0.7163 0.000 0.000 0.024 0.808 0.168
#> GSM11709     1  0.0992     0.8937 0.968 0.024 0.008 0.000 0.000
#> GSM11720     1  0.1205     0.8876 0.956 0.040 0.004 0.000 0.000
#> GSM11726     1  0.4801     0.3459 0.584 0.396 0.012 0.000 0.008
#> GSM11837     2  0.1498     0.8261 0.024 0.952 0.008 0.000 0.016
#> GSM11725     2  0.4166     0.7620 0.148 0.788 0.056 0.000 0.008
#> GSM11864     2  0.6032     0.6499 0.204 0.652 0.100 0.000 0.044
#> GSM11687     1  0.0162     0.8937 0.996 0.000 0.004 0.000 0.000
#> GSM11693     1  0.0162     0.8937 0.996 0.000 0.004 0.000 0.000
#> GSM11727     2  0.2533     0.7796 0.096 0.888 0.008 0.000 0.008
#> GSM11838     2  0.1153     0.8248 0.024 0.964 0.004 0.000 0.008
#> GSM11681     1  0.1059     0.8800 0.968 0.000 0.008 0.020 0.004
#> GSM11689     1  0.0162     0.8937 0.996 0.000 0.004 0.000 0.000
#> GSM11704     1  0.0162     0.8937 0.996 0.000 0.004 0.000 0.000
#> GSM11703     1  0.1728     0.8854 0.940 0.036 0.020 0.000 0.004
#> GSM11705     1  0.1568     0.8866 0.944 0.036 0.020 0.000 0.000
#> GSM11722     2  0.4082     0.5820 0.240 0.740 0.008 0.000 0.012
#> GSM11730     2  0.5236     0.0107 0.432 0.532 0.016 0.000 0.020
#> GSM11713     1  0.5185     0.6955 0.716 0.212 0.028 0.016 0.028
#> GSM11728     1  0.5762     0.7045 0.704 0.180 0.028 0.056 0.032
#> GSM27947     4  0.4965     0.6914 0.040 0.000 0.028 0.716 0.216
#> GSM27951     1  0.0162     0.8937 0.996 0.000 0.004 0.000 0.000
#> GSM11707     3  0.4744     0.0650 0.016 0.000 0.508 0.000 0.476
#> GSM11716     3  0.4042     0.6210 0.000 0.044 0.792 0.008 0.156
#> GSM11850     3  0.3888     0.5935 0.000 0.120 0.804 0.000 0.076
#> GSM11851     5  0.5980     0.2435 0.000 0.004 0.412 0.096 0.488
#> GSM11721     4  0.7226     0.6122 0.060 0.080 0.056 0.600 0.204
#> GSM11852     4  0.6296     0.5954 0.052 0.004 0.056 0.584 0.304
#> GSM11694     3  0.3180     0.6849 0.136 0.004 0.844 0.004 0.012
#> GSM11695     3  0.3087     0.6875 0.128 0.004 0.852 0.004 0.012
#> GSM11734     2  0.3521     0.7678 0.008 0.808 0.172 0.000 0.012
#> GSM11861     4  0.6947     0.4337 0.056 0.028 0.244 0.592 0.080
#> GSM11843     2  0.5129     0.6922 0.180 0.724 0.068 0.000 0.028
#> GSM11862     4  0.7331     0.4204 0.200 0.036 0.100 0.588 0.076
#> GSM11697     3  0.2569     0.6970 0.068 0.000 0.896 0.004 0.032
#> GSM11714     3  0.4910     0.6190 0.208 0.036 0.724 0.000 0.032
#> GSM11723     2  0.4665     0.6593 0.000 0.692 0.260 0.000 0.048
#> GSM11845     2  0.5599     0.5062 0.000 0.580 0.328 0.000 0.092
#> GSM11683     3  0.5632     0.5519 0.260 0.040 0.660 0.012 0.028
#> GSM11691     3  0.5561     0.5505 0.260 0.036 0.664 0.012 0.028
#> GSM27949     3  0.4223     0.6122 0.000 0.000 0.724 0.028 0.248
#> GSM27945     3  0.4126     0.6390 0.004 0.000 0.796 0.096 0.104
#> GSM11706     4  0.4743     0.4210 0.000 0.000 0.016 0.512 0.472
#> GSM11853     4  0.4003     0.6817 0.000 0.000 0.008 0.704 0.288
#> GSM11729     2  0.0798     0.8273 0.016 0.976 0.000 0.000 0.008
#> GSM11746     2  0.0898     0.8277 0.020 0.972 0.000 0.000 0.008
#> GSM11711     4  0.4016     0.6847 0.000 0.000 0.012 0.716 0.272
#> GSM11854     4  0.3980     0.6847 0.000 0.000 0.008 0.708 0.284
#> GSM11731     2  0.2152     0.8191 0.032 0.924 0.032 0.000 0.012
#> GSM11839     2  0.2807     0.8141 0.028 0.900 0.040 0.024 0.008
#> GSM11836     2  0.1616     0.8223 0.008 0.948 0.008 0.032 0.004
#> GSM11849     4  0.5431     0.0541 0.032 0.444 0.004 0.512 0.008
#> GSM11682     4  0.0889     0.6994 0.004 0.004 0.004 0.976 0.012
#> GSM11690     4  0.0613     0.6995 0.000 0.004 0.004 0.984 0.008
#> GSM11692     4  0.2488     0.6810 0.000 0.004 0.000 0.872 0.124
#> GSM11841     4  0.3694     0.6286 0.000 0.032 0.000 0.796 0.172
#> GSM11901     4  0.3612     0.6306 0.000 0.028 0.000 0.800 0.172
#> GSM11715     2  0.0510     0.8264 0.016 0.984 0.000 0.000 0.000
#> GSM11724     2  0.0693     0.8253 0.012 0.980 0.000 0.000 0.008
#> GSM11684     4  0.4345     0.6296 0.040 0.076 0.016 0.820 0.048
#> GSM11696     4  0.4419     0.6270 0.044 0.076 0.016 0.816 0.048
#> GSM27952     4  0.3690     0.7019 0.000 0.000 0.012 0.764 0.224
#> GSM27948     4  0.1285     0.7071 0.000 0.004 0.004 0.956 0.036

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     5  0.4405    0.58194 0.000 0.000 0.240 0.000 0.688 0.072
#> GSM11735     5  0.3487    0.62703 0.000 0.000 0.224 0.000 0.756 0.020
#> GSM11733     5  0.1151    0.81499 0.000 0.000 0.012 0.000 0.956 0.032
#> GSM11863     5  0.0964    0.80876 0.000 0.004 0.012 0.000 0.968 0.016
#> GSM11710     6  0.2748    0.56863 0.000 0.000 0.000 0.024 0.128 0.848
#> GSM11712     6  0.4203    0.48901 0.000 0.000 0.000 0.124 0.136 0.740
#> GSM11732     3  0.5912    0.39465 0.000 0.056 0.580 0.100 0.264 0.000
#> GSM11844     3  0.6241    0.26610 0.000 0.052 0.504 0.100 0.340 0.004
#> GSM11842     5  0.1003    0.79628 0.000 0.028 0.004 0.000 0.964 0.004
#> GSM11860     5  0.2055    0.78709 0.012 0.036 0.004 0.004 0.924 0.020
#> GSM11686     6  0.3716    0.55894 0.000 0.000 0.044 0.044 0.096 0.816
#> GSM11688     6  0.4748    0.44443 0.000 0.000 0.040 0.036 0.240 0.684
#> GSM11846     6  0.6021    0.28752 0.036 0.000 0.048 0.036 0.328 0.552
#> GSM11680     3  0.3694    0.58254 0.000 0.000 0.788 0.008 0.156 0.048
#> GSM11698     3  0.4225    0.59295 0.000 0.000 0.764 0.016 0.116 0.104
#> GSM11840     5  0.1151    0.81499 0.000 0.000 0.012 0.000 0.956 0.032
#> GSM11847     5  0.1151    0.81499 0.000 0.000 0.012 0.000 0.956 0.032
#> GSM11685     6  0.2688    0.59216 0.000 0.000 0.024 0.044 0.048 0.884
#> GSM11699     6  0.5149    0.37084 0.000 0.000 0.120 0.184 0.024 0.672
#> GSM27950     3  0.4267    0.52331 0.000 0.000 0.728 0.012 0.208 0.052
#> GSM27946     6  0.4116    0.54867 0.000 0.000 0.036 0.140 0.048 0.776
#> GSM11709     1  0.1852    0.84268 0.928 0.024 0.004 0.040 0.004 0.000
#> GSM11720     1  0.2321    0.83245 0.900 0.052 0.008 0.040 0.000 0.000
#> GSM11726     2  0.5417   -0.00763 0.436 0.488 0.016 0.052 0.008 0.000
#> GSM11837     2  0.1578    0.71162 0.012 0.944 0.012 0.028 0.004 0.000
#> GSM11725     2  0.4372    0.63001 0.184 0.744 0.036 0.032 0.004 0.000
#> GSM11864     2  0.6061    0.48151 0.284 0.580 0.068 0.036 0.032 0.000
#> GSM11687     1  0.0000    0.85436 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11693     1  0.0000    0.85436 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11727     2  0.3327    0.67973 0.060 0.844 0.016 0.076 0.004 0.000
#> GSM11838     2  0.1801    0.70965 0.012 0.932 0.012 0.040 0.004 0.000
#> GSM11681     1  0.0520    0.84431 0.984 0.000 0.008 0.000 0.000 0.008
#> GSM11689     1  0.0000    0.85436 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11704     1  0.0000    0.85436 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11703     1  0.2637    0.82015 0.872 0.024 0.008 0.096 0.000 0.000
#> GSM11705     1  0.2666    0.82126 0.872 0.028 0.008 0.092 0.000 0.000
#> GSM11722     2  0.4794    0.58061 0.152 0.716 0.016 0.112 0.004 0.000
#> GSM11730     2  0.6300    0.25576 0.276 0.512 0.016 0.184 0.012 0.000
#> GSM11713     1  0.6750    0.24526 0.408 0.268 0.020 0.292 0.012 0.000
#> GSM11728     1  0.6928    0.31027 0.420 0.188 0.024 0.344 0.012 0.012
#> GSM27947     6  0.5394    0.52515 0.048 0.000 0.040 0.132 0.068 0.712
#> GSM27951     1  0.0000    0.85436 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11707     5  0.6015    0.16858 0.004 0.000 0.392 0.056 0.484 0.064
#> GSM11716     3  0.5419    0.50698 0.000 0.080 0.680 0.104 0.136 0.000
#> GSM11850     3  0.5657    0.49805 0.000 0.104 0.660 0.124 0.112 0.000
#> GSM11851     3  0.7222    0.20568 0.000 0.004 0.444 0.112 0.224 0.216
#> GSM11721     6  0.5945    0.17808 0.016 0.024 0.012 0.308 0.064 0.576
#> GSM11852     6  0.5512    0.26302 0.016 0.000 0.020 0.276 0.072 0.616
#> GSM11694     3  0.3194    0.63551 0.104 0.000 0.840 0.044 0.012 0.000
#> GSM11695     3  0.3058    0.63683 0.104 0.000 0.848 0.036 0.012 0.000
#> GSM11734     2  0.4435    0.62746 0.008 0.748 0.140 0.096 0.008 0.000
#> GSM11861     4  0.6658    0.40854 0.008 0.008 0.176 0.516 0.036 0.256
#> GSM11843     2  0.5418    0.58632 0.068 0.668 0.024 0.212 0.028 0.000
#> GSM11862     4  0.6376    0.43704 0.056 0.012 0.036 0.588 0.048 0.260
#> GSM11697     3  0.2706    0.64119 0.028 0.000 0.880 0.068 0.024 0.000
#> GSM11714     3  0.6735    0.51186 0.096 0.024 0.600 0.192 0.060 0.028
#> GSM11723     2  0.6265    0.29732 0.000 0.492 0.316 0.156 0.036 0.000
#> GSM11845     2  0.6758    0.10216 0.000 0.392 0.380 0.160 0.068 0.000
#> GSM11683     3  0.5931    0.45765 0.104 0.028 0.576 0.280 0.012 0.000
#> GSM11691     3  0.5612    0.46714 0.096 0.012 0.584 0.296 0.012 0.000
#> GSM27949     3  0.4485    0.52160 0.000 0.000 0.716 0.012 0.200 0.072
#> GSM27945     3  0.3746    0.61077 0.004 0.000 0.812 0.020 0.056 0.108
#> GSM11706     6  0.3673    0.47449 0.000 0.000 0.016 0.004 0.244 0.736
#> GSM11853     6  0.1838    0.59327 0.000 0.000 0.000 0.016 0.068 0.916
#> GSM11729     2  0.0748    0.71249 0.004 0.976 0.000 0.016 0.004 0.000
#> GSM11746     2  0.0717    0.71424 0.016 0.976 0.000 0.008 0.000 0.000
#> GSM11711     6  0.1745    0.59116 0.000 0.000 0.000 0.012 0.068 0.920
#> GSM11854     6  0.1926    0.59255 0.000 0.000 0.000 0.020 0.068 0.912
#> GSM11731     2  0.2757    0.68227 0.008 0.848 0.004 0.136 0.004 0.000
#> GSM11839     2  0.3530    0.65827 0.008 0.776 0.012 0.200 0.000 0.004
#> GSM11836     2  0.2473    0.69622 0.000 0.876 0.012 0.104 0.000 0.008
#> GSM11849     2  0.6015   -0.15431 0.012 0.444 0.000 0.380 0.000 0.164
#> GSM11682     6  0.3955    0.27330 0.004 0.000 0.008 0.340 0.000 0.648
#> GSM11690     6  0.4022    0.24694 0.004 0.000 0.000 0.360 0.008 0.628
#> GSM11692     6  0.5067    0.21435 0.000 0.004 0.000 0.312 0.088 0.596
#> GSM11841     6  0.5882    0.06121 0.000 0.012 0.000 0.328 0.156 0.504
#> GSM11901     6  0.5838    0.06484 0.000 0.012 0.000 0.332 0.148 0.508
#> GSM11715     2  0.1555    0.70974 0.004 0.932 0.000 0.060 0.004 0.000
#> GSM11724     2  0.1588    0.70613 0.004 0.924 0.000 0.072 0.000 0.000
#> GSM11684     4  0.4946    0.50539 0.008 0.048 0.004 0.624 0.004 0.312
#> GSM11696     4  0.4946    0.50539 0.008 0.048 0.004 0.624 0.004 0.312
#> GSM27952     6  0.2683    0.58611 0.000 0.000 0.012 0.056 0.052 0.880
#> GSM27948     6  0.3670    0.35537 0.000 0.000 0.000 0.284 0.012 0.704

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-skmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n cell.line(p) agent(p)  time(p) k
#> CV:skmeans 76     1.87e-08   0.1268 2.28e-02 2
#> CV:skmeans 79     1.02e-12   0.7205 1.48e-05 3
#> CV:skmeans 72     2.95e-12   0.7097 1.46e-07 4
#> CV:skmeans 70     1.28e-14   0.5543 1.48e-09 5
#> CV:skmeans 53     1.11e-11   0.0832 1.28e-06 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:pam

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "pam"]
# you can also extract it by
# res = res_list["CV:pam"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 5.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-pam-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-pam-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.438           0.784       0.878         0.3445 0.670   0.670
#> 3 3 0.246           0.470       0.747         0.6893 0.718   0.591
#> 4 4 0.374           0.567       0.731         0.1690 0.804   0.591
#> 5 5 0.615           0.657       0.803         0.1206 0.791   0.458
#> 6 6 0.672           0.564       0.773         0.0593 0.864   0.503

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 5

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1  0.0000     0.8533 1.000 0.000
#> GSM11735     1  0.0000     0.8533 1.000 0.000
#> GSM11733     1  0.0000     0.8533 1.000 0.000
#> GSM11863     1  0.2423     0.8562 0.960 0.040
#> GSM11710     1  0.1414     0.8551 0.980 0.020
#> GSM11712     1  0.2423     0.8562 0.960 0.040
#> GSM11732     1  0.2603     0.8563 0.956 0.044
#> GSM11844     1  0.2043     0.8565 0.968 0.032
#> GSM11842     1  0.2603     0.8563 0.956 0.044
#> GSM11860     1  0.2603     0.8563 0.956 0.044
#> GSM11686     1  0.0000     0.8533 1.000 0.000
#> GSM11688     1  0.0000     0.8533 1.000 0.000
#> GSM11846     1  0.0000     0.8533 1.000 0.000
#> GSM11680     1  0.2423     0.8562 0.960 0.040
#> GSM11698     1  0.0000     0.8533 1.000 0.000
#> GSM11840     1  0.1184     0.8556 0.984 0.016
#> GSM11847     1  0.2423     0.8562 0.960 0.040
#> GSM11685     1  0.0000     0.8533 1.000 0.000
#> GSM11699     1  0.5842     0.8230 0.860 0.140
#> GSM27950     1  0.1633     0.8558 0.976 0.024
#> GSM27946     1  0.2423     0.8562 0.960 0.040
#> GSM11709     1  0.7376     0.7837 0.792 0.208
#> GSM11720     1  0.8386     0.7105 0.732 0.268
#> GSM11726     1  0.7745     0.7854 0.772 0.228
#> GSM11837     2  0.9087     0.4911 0.324 0.676
#> GSM11725     2  0.9522     0.3685 0.372 0.628
#> GSM11864     1  0.7883     0.7917 0.764 0.236
#> GSM11687     1  0.8081     0.7816 0.752 0.248
#> GSM11693     1  0.7883     0.7917 0.764 0.236
#> GSM11727     2  0.7950     0.6425 0.240 0.760
#> GSM11838     2  0.0000     0.7993 0.000 1.000
#> GSM11681     1  0.7883     0.7917 0.764 0.236
#> GSM11689     1  0.7883     0.7917 0.764 0.236
#> GSM11704     1  0.7883     0.7917 0.764 0.236
#> GSM11703     1  0.7453     0.7844 0.788 0.212
#> GSM11705     1  0.7376     0.7837 0.792 0.208
#> GSM11722     2  0.0000     0.7993 0.000 1.000
#> GSM11730     2  0.7745     0.6586 0.228 0.772
#> GSM11713     2  0.2423     0.7849 0.040 0.960
#> GSM11728     1  0.7745     0.7852 0.772 0.228
#> GSM27947     1  0.2603     0.8563 0.956 0.044
#> GSM27951     1  0.8081     0.7816 0.752 0.248
#> GSM11707     1  0.7376     0.7837 0.792 0.208
#> GSM11716     1  0.2948     0.8575 0.948 0.052
#> GSM11850     1  0.6623     0.8081 0.828 0.172
#> GSM11851     1  0.0000     0.8533 1.000 0.000
#> GSM11721     1  0.7139     0.7918 0.804 0.196
#> GSM11852     1  0.4815     0.8371 0.896 0.104
#> GSM11694     1  0.7883     0.7917 0.764 0.236
#> GSM11695     1  0.7883     0.7917 0.764 0.236
#> GSM11734     2  0.9998     0.0356 0.492 0.508
#> GSM11861     1  0.6973     0.7991 0.812 0.188
#> GSM11843     1  0.8081     0.7816 0.752 0.248
#> GSM11862     1  0.7745     0.7939 0.772 0.228
#> GSM11697     1  0.8016     0.7853 0.756 0.244
#> GSM11714     1  0.7376     0.7837 0.792 0.208
#> GSM11723     2  0.6887     0.6769 0.184 0.816
#> GSM11845     1  0.2778     0.8567 0.952 0.048
#> GSM11683     1  0.8016     0.7830 0.756 0.244
#> GSM11691     1  0.8081     0.7816 0.752 0.248
#> GSM27949     1  0.0000     0.8533 1.000 0.000
#> GSM27945     1  0.2423     0.8562 0.960 0.040
#> GSM11706     1  0.0000     0.8533 1.000 0.000
#> GSM11853     1  0.0000     0.8533 1.000 0.000
#> GSM11729     2  0.0376     0.7992 0.004 0.996
#> GSM11746     2  0.4815     0.7817 0.104 0.896
#> GSM11711     1  0.0000     0.8533 1.000 0.000
#> GSM11854     1  0.0000     0.8533 1.000 0.000
#> GSM11731     2  0.0672     0.7994 0.008 0.992
#> GSM11839     1  0.8713     0.7229 0.708 0.292
#> GSM11836     1  0.9129     0.3305 0.672 0.328
#> GSM11849     2  0.9896     0.2970 0.440 0.560
#> GSM11682     1  0.0000     0.8533 1.000 0.000
#> GSM11690     1  0.2423     0.8562 0.960 0.040
#> GSM11692     1  0.2423     0.8562 0.960 0.040
#> GSM11841     1  0.2423     0.8562 0.960 0.040
#> GSM11901     1  0.2423     0.8562 0.960 0.040
#> GSM11715     2  0.0000     0.7993 0.000 1.000
#> GSM11724     2  0.0000     0.7993 0.000 1.000
#> GSM11684     2  0.5946     0.7690 0.144 0.856
#> GSM11696     2  0.4690     0.7805 0.100 0.900
#> GSM27952     1  0.0000     0.8533 1.000 0.000
#> GSM27948     1  0.2423     0.8562 0.960 0.040

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     1  0.5678     0.2813 0.684 0.000 0.316
#> GSM11735     1  0.4452     0.4645 0.808 0.000 0.192
#> GSM11733     3  0.5926     0.4956 0.356 0.000 0.644
#> GSM11863     3  0.3752     0.5788 0.144 0.000 0.856
#> GSM11710     3  0.5894     0.5633 0.220 0.028 0.752
#> GSM11712     3  0.0000     0.6266 0.000 0.000 1.000
#> GSM11732     3  0.6483    -0.3705 0.452 0.004 0.544
#> GSM11844     3  0.3619     0.5597 0.136 0.000 0.864
#> GSM11842     3  0.3752     0.5788 0.144 0.000 0.856
#> GSM11860     3  0.3816     0.5797 0.148 0.000 0.852
#> GSM11686     3  0.4750     0.5694 0.216 0.000 0.784
#> GSM11688     3  0.4750     0.5694 0.216 0.000 0.784
#> GSM11846     3  0.4750     0.5694 0.216 0.000 0.784
#> GSM11680     3  0.4931     0.3237 0.212 0.004 0.784
#> GSM11698     1  0.5810     0.4550 0.664 0.000 0.336
#> GSM11840     3  0.4291     0.5825 0.180 0.000 0.820
#> GSM11847     3  0.3752     0.5788 0.144 0.000 0.856
#> GSM11685     3  0.4750     0.5694 0.216 0.000 0.784
#> GSM11699     1  0.5378     0.5540 0.756 0.008 0.236
#> GSM27950     1  0.5650     0.4837 0.688 0.000 0.312
#> GSM27946     3  0.0000     0.6266 0.000 0.000 1.000
#> GSM11709     3  0.8355     0.3619 0.408 0.084 0.508
#> GSM11720     1  0.9512     0.1751 0.492 0.260 0.248
#> GSM11726     3  0.8868     0.3826 0.228 0.196 0.576
#> GSM11837     2  0.5291     0.5442 0.000 0.732 0.268
#> GSM11725     2  0.9305     0.3156 0.188 0.504 0.308
#> GSM11864     3  0.6858     0.4668 0.188 0.084 0.728
#> GSM11687     3  0.6906     0.4623 0.192 0.084 0.724
#> GSM11693     3  0.6808     0.4713 0.184 0.084 0.732
#> GSM11727     2  0.5115     0.5874 0.004 0.768 0.228
#> GSM11838     2  0.0000     0.6946 0.000 1.000 0.000
#> GSM11681     3  0.6808     0.4713 0.184 0.084 0.732
#> GSM11689     3  0.6808     0.4713 0.184 0.084 0.732
#> GSM11704     3  0.6808     0.4713 0.184 0.084 0.732
#> GSM11703     1  0.6252     0.5583 0.772 0.084 0.144
#> GSM11705     1  0.8363    -0.1982 0.504 0.084 0.412
#> GSM11722     2  0.0237     0.6952 0.004 0.996 0.000
#> GSM11730     2  0.8972     0.3213 0.236 0.564 0.200
#> GSM11713     2  0.0237     0.6952 0.004 0.996 0.000
#> GSM11728     3  0.6431     0.5258 0.156 0.084 0.760
#> GSM27947     3  0.0424     0.6249 0.000 0.008 0.992
#> GSM27951     3  0.6906     0.4623 0.192 0.084 0.724
#> GSM11707     1  0.4921     0.5580 0.844 0.084 0.072
#> GSM11716     3  0.7049    -0.3905 0.452 0.020 0.528
#> GSM11850     1  0.6239     0.5878 0.768 0.072 0.160
#> GSM11851     3  0.5016     0.5512 0.240 0.000 0.760
#> GSM11721     3  0.7940     0.4468 0.332 0.076 0.592
#> GSM11852     3  0.7400     0.5174 0.264 0.072 0.664
#> GSM11694     1  0.8064     0.5359 0.588 0.084 0.328
#> GSM11695     1  0.8179     0.5382 0.564 0.084 0.352
#> GSM11734     3  0.9955    -0.2851 0.304 0.316 0.380
#> GSM11861     3  0.7842     0.4604 0.328 0.072 0.600
#> GSM11843     1  0.7788     0.4986 0.632 0.084 0.284
#> GSM11862     3  0.6313     0.5188 0.148 0.084 0.768
#> GSM11697     1  0.8162     0.5402 0.568 0.084 0.348
#> GSM11714     1  0.4830     0.5548 0.848 0.084 0.068
#> GSM11723     2  0.4233     0.6042 0.004 0.836 0.160
#> GSM11845     3  0.6925    -0.3817 0.452 0.016 0.532
#> GSM11683     1  0.7697     0.5192 0.644 0.084 0.272
#> GSM11691     1  0.7758     0.5042 0.636 0.084 0.280
#> GSM27949     1  0.5810     0.4538 0.664 0.000 0.336
#> GSM27945     3  0.0829     0.6212 0.012 0.004 0.984
#> GSM11706     3  0.4750     0.5694 0.216 0.000 0.784
#> GSM11853     3  0.4750     0.5694 0.216 0.000 0.784
#> GSM11729     2  0.3607     0.7009 0.112 0.880 0.008
#> GSM11746     2  0.7756     0.5127 0.128 0.672 0.200
#> GSM11711     3  0.4750     0.5694 0.216 0.000 0.784
#> GSM11854     3  0.4750     0.5694 0.216 0.000 0.784
#> GSM11731     2  0.2165     0.7069 0.064 0.936 0.000
#> GSM11839     3  0.7160     0.4571 0.148 0.132 0.720
#> GSM11836     3  0.4887     0.4586 0.000 0.228 0.772
#> GSM11849     2  0.9888     0.0407 0.328 0.400 0.272
#> GSM11682     3  0.4750     0.5694 0.216 0.000 0.784
#> GSM11690     3  0.0000     0.6266 0.000 0.000 1.000
#> GSM11692     3  0.0000     0.6266 0.000 0.000 1.000
#> GSM11841     3  0.0000     0.6266 0.000 0.000 1.000
#> GSM11901     3  0.0000     0.6266 0.000 0.000 1.000
#> GSM11715     2  0.3192     0.6997 0.112 0.888 0.000
#> GSM11724     2  0.3425     0.7008 0.112 0.884 0.004
#> GSM11684     2  0.7731     0.5254 0.228 0.664 0.108
#> GSM11696     1  0.7913    -0.0600 0.492 0.452 0.056
#> GSM27952     3  0.4750     0.5694 0.216 0.000 0.784
#> GSM27948     3  0.0000     0.6266 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     4  0.4322     0.8542 0.152 0.000 0.044 0.804
#> GSM11735     4  0.3486     0.7055 0.000 0.000 0.188 0.812
#> GSM11733     4  0.3486     0.8839 0.188 0.000 0.000 0.812
#> GSM11863     4  0.4336     0.7936 0.060 0.128 0.000 0.812
#> GSM11710     1  0.2469     0.6630 0.892 0.000 0.108 0.000
#> GSM11712     1  0.4336     0.6534 0.812 0.128 0.060 0.000
#> GSM11732     3  0.5522     0.5731 0.288 0.000 0.668 0.044
#> GSM11844     1  0.3895     0.6010 0.832 0.000 0.132 0.036
#> GSM11842     4  0.4336     0.7936 0.060 0.128 0.000 0.812
#> GSM11860     4  0.3486     0.8839 0.188 0.000 0.000 0.812
#> GSM11686     1  0.0000     0.6780 1.000 0.000 0.000 0.000
#> GSM11688     1  0.0000     0.6780 1.000 0.000 0.000 0.000
#> GSM11846     1  0.0188     0.6775 0.996 0.000 0.004 0.000
#> GSM11680     1  0.4888     0.1619 0.588 0.000 0.412 0.000
#> GSM11698     3  0.5000     0.4226 0.496 0.000 0.504 0.000
#> GSM11840     4  0.3486     0.8839 0.188 0.000 0.000 0.812
#> GSM11847     4  0.3486     0.8839 0.188 0.000 0.000 0.812
#> GSM11685     1  0.1792     0.6743 0.932 0.068 0.000 0.000
#> GSM11699     3  0.4972     0.4657 0.456 0.000 0.544 0.000
#> GSM27950     3  0.4746     0.5492 0.368 0.000 0.632 0.000
#> GSM27946     1  0.1637     0.6777 0.940 0.000 0.060 0.000
#> GSM11709     1  0.7374     0.4163 0.504 0.000 0.308 0.188
#> GSM11720     3  0.9565    -0.0196 0.280 0.160 0.380 0.180
#> GSM11726     1  0.7663     0.4681 0.584 0.168 0.212 0.036
#> GSM11837     2  0.5244     0.6710 0.084 0.796 0.056 0.064
#> GSM11725     3  0.9232    -0.3402 0.100 0.356 0.356 0.188
#> GSM11864     1  0.7509     0.4223 0.452 0.000 0.360 0.188
#> GSM11687     1  0.7521     0.4139 0.444 0.000 0.368 0.188
#> GSM11693     1  0.7509     0.4223 0.452 0.000 0.360 0.188
#> GSM11727     2  0.5962     0.6725 0.040 0.740 0.076 0.144
#> GSM11838     2  0.2760     0.7049 0.000 0.872 0.000 0.128
#> GSM11681     1  0.7502     0.4250 0.456 0.000 0.356 0.188
#> GSM11689     1  0.7509     0.4223 0.452 0.000 0.360 0.188
#> GSM11704     1  0.7509     0.4223 0.452 0.000 0.360 0.188
#> GSM11703     3  0.4206     0.4761 0.048 0.000 0.816 0.136
#> GSM11705     1  0.6111     0.3762 0.556 0.000 0.392 0.052
#> GSM11722     2  0.3335     0.7111 0.000 0.856 0.016 0.128
#> GSM11730     2  0.7963     0.2698 0.016 0.440 0.364 0.180
#> GSM11713     2  0.3217     0.7069 0.000 0.860 0.012 0.128
#> GSM11728     1  0.4134     0.6126 0.740 0.000 0.260 0.000
#> GSM27947     1  0.1792     0.6785 0.932 0.000 0.068 0.000
#> GSM27951     1  0.7521     0.4139 0.444 0.000 0.368 0.188
#> GSM11707     3  0.3764     0.5529 0.216 0.000 0.784 0.000
#> GSM11716     3  0.3942     0.6116 0.236 0.000 0.764 0.000
#> GSM11850     3  0.3400     0.6286 0.180 0.000 0.820 0.000
#> GSM11851     1  0.2596     0.6476 0.908 0.000 0.068 0.024
#> GSM11721     1  0.6075     0.5862 0.680 0.128 0.192 0.000
#> GSM11852     1  0.3400     0.6226 0.820 0.000 0.180 0.000
#> GSM11694     3  0.1940     0.6302 0.076 0.000 0.924 0.000
#> GSM11695     3  0.2408     0.6365 0.104 0.000 0.896 0.000
#> GSM11734     3  0.9913    -0.1464 0.252 0.272 0.288 0.188
#> GSM11861     1  0.3311     0.6395 0.828 0.000 0.172 0.000
#> GSM11843     3  0.2032     0.5613 0.036 0.000 0.936 0.028
#> GSM11862     1  0.4193     0.6082 0.732 0.000 0.268 0.000
#> GSM11697     3  0.2408     0.6368 0.104 0.000 0.896 0.000
#> GSM11714     3  0.2011     0.5980 0.080 0.000 0.920 0.000
#> GSM11723     2  0.5784     0.6070 0.100 0.700 0.200 0.000
#> GSM11845     3  0.5592     0.5779 0.264 0.056 0.680 0.000
#> GSM11683     3  0.1118     0.6079 0.036 0.000 0.964 0.000
#> GSM11691     3  0.0707     0.5962 0.020 0.000 0.980 0.000
#> GSM27949     3  0.4746     0.5492 0.368 0.000 0.632 0.000
#> GSM27945     1  0.3688     0.6002 0.792 0.000 0.208 0.000
#> GSM11706     1  0.0000     0.6780 1.000 0.000 0.000 0.000
#> GSM11853     1  0.0000     0.6780 1.000 0.000 0.000 0.000
#> GSM11729     2  0.3498     0.7071 0.008 0.832 0.160 0.000
#> GSM11746     2  0.8752     0.4808 0.204 0.516 0.160 0.120
#> GSM11711     1  0.0188     0.6780 0.996 0.000 0.004 0.000
#> GSM11854     1  0.0000     0.6780 1.000 0.000 0.000 0.000
#> GSM11731     2  0.2216     0.7219 0.000 0.908 0.092 0.000
#> GSM11839     1  0.7566     0.4873 0.508 0.172 0.312 0.008
#> GSM11836     1  0.5865     0.4426 0.612 0.340 0.048 0.000
#> GSM11849     1  0.7310     0.0158 0.480 0.360 0.160 0.000
#> GSM11682     1  0.0000     0.6780 1.000 0.000 0.000 0.000
#> GSM11690     1  0.4336     0.6534 0.812 0.128 0.060 0.000
#> GSM11692     1  0.4336     0.6534 0.812 0.128 0.060 0.000
#> GSM11841     1  0.4518     0.6521 0.808 0.128 0.060 0.004
#> GSM11901     1  0.4336     0.6534 0.812 0.128 0.060 0.000
#> GSM11715     2  0.3266     0.7063 0.000 0.832 0.168 0.000
#> GSM11724     2  0.3402     0.7073 0.004 0.832 0.164 0.000
#> GSM11684     2  0.6089     0.5006 0.080 0.640 0.280 0.000
#> GSM11696     3  0.5290     0.1277 0.012 0.404 0.584 0.000
#> GSM27952     1  0.0000     0.6780 1.000 0.000 0.000 0.000
#> GSM27948     1  0.4336     0.6534 0.812 0.128 0.060 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     5  0.2020     0.8536 0.000 0.000 0.000 0.100 0.900
#> GSM11735     5  0.1965     0.7746 0.000 0.000 0.096 0.000 0.904
#> GSM11733     5  0.1965     0.8566 0.000 0.000 0.000 0.096 0.904
#> GSM11863     5  0.0000     0.7947 0.000 0.000 0.000 0.000 1.000
#> GSM11710     4  0.2127     0.7445 0.108 0.000 0.000 0.892 0.000
#> GSM11712     4  0.3340     0.7309 0.000 0.044 0.008 0.852 0.096
#> GSM11732     3  0.3548     0.7046 0.012 0.000 0.796 0.188 0.004
#> GSM11844     4  0.6147     0.3322 0.004 0.000 0.188 0.580 0.228
#> GSM11842     5  0.0000     0.7947 0.000 0.000 0.000 0.000 1.000
#> GSM11860     5  0.1965     0.8566 0.000 0.000 0.000 0.096 0.904
#> GSM11686     4  0.0000     0.7889 0.000 0.000 0.000 1.000 0.000
#> GSM11688     4  0.0000     0.7889 0.000 0.000 0.000 1.000 0.000
#> GSM11846     4  0.0510     0.7871 0.016 0.000 0.000 0.984 0.000
#> GSM11680     3  0.3949     0.6090 0.004 0.000 0.696 0.300 0.000
#> GSM11698     4  0.4066     0.3763 0.004 0.000 0.324 0.672 0.000
#> GSM11840     5  0.1965     0.8566 0.000 0.000 0.000 0.096 0.904
#> GSM11847     5  0.1965     0.8566 0.000 0.000 0.000 0.096 0.904
#> GSM11685     4  0.1943     0.7671 0.000 0.020 0.000 0.924 0.056
#> GSM11699     4  0.5156     0.3190 0.060 0.000 0.320 0.620 0.000
#> GSM27950     3  0.3177     0.6974 0.000 0.000 0.792 0.208 0.000
#> GSM27946     4  0.0290     0.7877 0.000 0.000 0.008 0.992 0.000
#> GSM11709     1  0.0771     0.7924 0.976 0.020 0.000 0.004 0.000
#> GSM11720     1  0.5312     0.3680 0.628 0.056 0.008 0.308 0.000
#> GSM11726     4  0.7295     0.2490 0.244 0.056 0.200 0.500 0.000
#> GSM11837     2  0.4829     0.7267 0.068 0.724 0.200 0.008 0.000
#> GSM11725     1  0.0566     0.8002 0.984 0.012 0.000 0.004 0.000
#> GSM11864     1  0.1168     0.8227 0.960 0.000 0.008 0.032 0.000
#> GSM11687     1  0.1168     0.8227 0.960 0.000 0.008 0.032 0.000
#> GSM11693     1  0.1168     0.8227 0.960 0.000 0.008 0.032 0.000
#> GSM11727     2  0.5958     0.5926 0.204 0.592 0.204 0.000 0.000
#> GSM11838     2  0.5490     0.6721 0.148 0.652 0.200 0.000 0.000
#> GSM11681     1  0.1251     0.8201 0.956 0.000 0.008 0.036 0.000
#> GSM11689     1  0.1168     0.8227 0.960 0.000 0.008 0.032 0.000
#> GSM11704     1  0.1168     0.8227 0.960 0.000 0.008 0.032 0.000
#> GSM11703     1  0.6763    -0.1089 0.396 0.000 0.324 0.280 0.000
#> GSM11705     4  0.4666     0.2721 0.412 0.000 0.016 0.572 0.000
#> GSM11722     2  0.1121     0.7792 0.044 0.956 0.000 0.000 0.000
#> GSM11730     1  0.5354     0.4305 0.664 0.128 0.208 0.000 0.000
#> GSM11713     2  0.4237     0.7381 0.048 0.752 0.200 0.000 0.000
#> GSM11728     4  0.4455     0.6139 0.216 0.012 0.032 0.740 0.000
#> GSM27947     4  0.0693     0.7874 0.012 0.000 0.008 0.980 0.000
#> GSM27951     1  0.1168     0.8227 0.960 0.000 0.008 0.032 0.000
#> GSM11707     3  0.6554     0.1650 0.200 0.000 0.408 0.392 0.000
#> GSM11716     3  0.3906     0.7249 0.068 0.000 0.800 0.132 0.000
#> GSM11850     3  0.3462     0.7244 0.196 0.000 0.792 0.012 0.000
#> GSM11851     4  0.2411     0.7343 0.008 0.000 0.108 0.884 0.000
#> GSM11721     4  0.5956     0.5879 0.200 0.044 0.000 0.660 0.096
#> GSM11852     4  0.3003     0.6661 0.188 0.000 0.000 0.812 0.000
#> GSM11694     3  0.3109     0.7240 0.200 0.000 0.800 0.000 0.000
#> GSM11695     3  0.3109     0.7240 0.200 0.000 0.800 0.000 0.000
#> GSM11734     1  0.5120     0.5524 0.716 0.064 0.024 0.196 0.000
#> GSM11861     4  0.3039     0.6755 0.192 0.000 0.000 0.808 0.000
#> GSM11843     3  0.4341     0.4348 0.404 0.000 0.592 0.004 0.000
#> GSM11862     4  0.3700     0.6091 0.240 0.000 0.008 0.752 0.000
#> GSM11697     3  0.3109     0.7240 0.200 0.000 0.800 0.000 0.000
#> GSM11714     3  0.3388     0.7221 0.200 0.000 0.792 0.008 0.000
#> GSM11723     2  0.2463     0.7525 0.004 0.888 0.100 0.008 0.000
#> GSM11845     3  0.5353     0.6961 0.036 0.028 0.736 0.164 0.036
#> GSM11683     3  0.3109     0.7240 0.200 0.000 0.800 0.000 0.000
#> GSM11691     3  0.3109     0.7240 0.200 0.000 0.800 0.000 0.000
#> GSM27949     3  0.3210     0.6961 0.000 0.000 0.788 0.212 0.000
#> GSM27945     3  0.4201     0.4163 0.000 0.000 0.592 0.408 0.000
#> GSM11706     4  0.0000     0.7889 0.000 0.000 0.000 1.000 0.000
#> GSM11853     4  0.0000     0.7889 0.000 0.000 0.000 1.000 0.000
#> GSM11729     2  0.0000     0.7835 0.000 1.000 0.000 0.000 0.000
#> GSM11746     2  0.2408     0.7656 0.092 0.892 0.000 0.016 0.000
#> GSM11711     4  0.0162     0.7885 0.004 0.000 0.000 0.996 0.000
#> GSM11854     4  0.0000     0.7889 0.000 0.000 0.000 1.000 0.000
#> GSM11731     2  0.4283     0.7653 0.068 0.812 0.064 0.000 0.056
#> GSM11839     3  0.9364     0.1404 0.296 0.196 0.304 0.108 0.096
#> GSM11836     2  0.5766     0.3645 0.000 0.560 0.004 0.348 0.088
#> GSM11849     4  0.4201     0.3403 0.000 0.408 0.000 0.592 0.000
#> GSM11682     4  0.0000     0.7889 0.000 0.000 0.000 1.000 0.000
#> GSM11690     4  0.3340     0.7309 0.000 0.044 0.008 0.852 0.096
#> GSM11692     4  0.3340     0.7309 0.000 0.044 0.008 0.852 0.096
#> GSM11841     5  0.5476     0.0233 0.000 0.044 0.008 0.440 0.508
#> GSM11901     4  0.5706     0.4317 0.000 0.260 0.012 0.632 0.096
#> GSM11715     2  0.1341     0.7744 0.000 0.944 0.000 0.000 0.056
#> GSM11724     2  0.1341     0.7744 0.000 0.944 0.000 0.000 0.056
#> GSM11684     2  0.2812     0.7432 0.004 0.876 0.000 0.024 0.096
#> GSM11696     2  0.5933     0.3718 0.012 0.584 0.308 0.000 0.096
#> GSM27952     4  0.0000     0.7889 0.000 0.000 0.000 1.000 0.000
#> GSM27948     4  0.3340     0.7309 0.000 0.044 0.008 0.852 0.096

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     5  0.0713     0.9580 0.000 0.000 0.000 0.000 0.972 0.028
#> GSM11735     5  0.0000     0.9941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11733     5  0.0000     0.9941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11863     5  0.0000     0.9941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11710     6  0.5790     0.5544 0.020 0.000 0.140 0.284 0.000 0.556
#> GSM11712     4  0.0000     0.6840 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11732     3  0.1333     0.7311 0.008 0.000 0.944 0.048 0.000 0.000
#> GSM11844     3  0.7509    -0.1017 0.000 0.000 0.308 0.136 0.288 0.268
#> GSM11842     5  0.0000     0.9941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11860     5  0.0000     0.9941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11686     6  0.4057     0.5889 0.008 0.000 0.000 0.436 0.000 0.556
#> GSM11688     6  0.4057     0.5889 0.008 0.000 0.000 0.436 0.000 0.556
#> GSM11846     6  0.4289     0.5876 0.020 0.000 0.000 0.424 0.000 0.556
#> GSM11680     3  0.2664     0.6456 0.000 0.000 0.816 0.184 0.000 0.000
#> GSM11698     6  0.4952     0.2315 0.000 0.000 0.408 0.068 0.000 0.524
#> GSM11840     5  0.0000     0.9941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11847     5  0.0000     0.9941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11685     4  0.2883     0.2710 0.000 0.000 0.000 0.788 0.000 0.212
#> GSM11699     6  0.5159     0.2144 0.016 0.000 0.408 0.052 0.000 0.524
#> GSM27950     3  0.2491     0.6690 0.000 0.000 0.836 0.164 0.000 0.000
#> GSM27946     6  0.3843     0.5783 0.000 0.000 0.000 0.452 0.000 0.548
#> GSM11709     1  0.1644     0.8285 0.920 0.076 0.004 0.000 0.000 0.000
#> GSM11720     1  0.6946     0.3336 0.528 0.220 0.036 0.056 0.000 0.160
#> GSM11726     2  0.4249     0.2579 0.032 0.640 0.000 0.000 0.000 0.328
#> GSM11837     2  0.0000     0.7180 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11725     1  0.0000     0.8928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11864     1  0.0000     0.8928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11687     1  0.0000     0.8928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11693     1  0.0000     0.8928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11727     2  0.0000     0.7180 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11838     2  0.0000     0.7180 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11681     1  0.0000     0.8928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11689     1  0.0000     0.8928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11704     1  0.0000     0.8928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11703     3  0.6327     0.0875 0.260 0.000 0.408 0.012 0.000 0.320
#> GSM11705     6  0.5836     0.3583 0.352 0.000 0.044 0.080 0.000 0.524
#> GSM11722     2  0.3833     0.5883 0.000 0.556 0.000 0.000 0.000 0.444
#> GSM11730     2  0.1444     0.6603 0.072 0.928 0.000 0.000 0.000 0.000
#> GSM11713     2  0.0632     0.7182 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM11728     6  0.7258     0.4631 0.196 0.056 0.052 0.196 0.000 0.500
#> GSM27947     6  0.4057     0.5889 0.008 0.000 0.000 0.436 0.000 0.556
#> GSM27951     1  0.0000     0.8928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11707     3  0.4829     0.1015 0.056 0.000 0.520 0.000 0.000 0.424
#> GSM11716     3  0.1418     0.7364 0.024 0.000 0.944 0.032 0.000 0.000
#> GSM11850     3  0.1204     0.7356 0.056 0.000 0.944 0.000 0.000 0.000
#> GSM11851     6  0.5908     0.4780 0.000 0.000 0.248 0.284 0.000 0.468
#> GSM11721     4  0.5861     0.3592 0.100 0.000 0.100 0.632 0.000 0.168
#> GSM11852     6  0.5726     0.5412 0.008 0.000 0.192 0.244 0.000 0.556
#> GSM11694     3  0.1556     0.7331 0.080 0.000 0.920 0.000 0.000 0.000
#> GSM11695     3  0.2597     0.6723 0.176 0.000 0.824 0.000 0.000 0.000
#> GSM11734     1  0.5453     0.3377 0.592 0.220 0.004 0.184 0.000 0.000
#> GSM11861     6  0.5614     0.5294 0.176 0.000 0.004 0.264 0.000 0.556
#> GSM11843     3  0.3634     0.3341 0.356 0.000 0.644 0.000 0.000 0.000
#> GSM11862     6  0.6319     0.5021 0.160 0.000 0.064 0.224 0.000 0.552
#> GSM11697     3  0.1204     0.7356 0.056 0.000 0.944 0.000 0.000 0.000
#> GSM11714     3  0.0146     0.7300 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM11723     2  0.6117     0.3195 0.000 0.356 0.344 0.000 0.000 0.300
#> GSM11845     3  0.2446     0.6965 0.012 0.000 0.864 0.124 0.000 0.000
#> GSM11683     3  0.0000     0.7285 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM11691     3  0.2260     0.6657 0.140 0.000 0.860 0.000 0.000 0.000
#> GSM27949     3  0.2762     0.6355 0.000 0.000 0.804 0.196 0.000 0.000
#> GSM27945     3  0.3695     0.3282 0.000 0.000 0.624 0.376 0.000 0.000
#> GSM11706     6  0.3833     0.5861 0.000 0.000 0.000 0.444 0.000 0.556
#> GSM11853     6  0.3833     0.5861 0.000 0.000 0.000 0.444 0.000 0.556
#> GSM11729     2  0.3833     0.5883 0.000 0.556 0.000 0.000 0.000 0.444
#> GSM11746     6  0.5548    -0.4913 0.184 0.268 0.000 0.000 0.000 0.548
#> GSM11711     6  0.5035     0.5787 0.000 0.000 0.084 0.360 0.000 0.556
#> GSM11854     6  0.3961     0.5875 0.000 0.000 0.004 0.440 0.000 0.556
#> GSM11731     2  0.7323     0.4495 0.056 0.492 0.056 0.184 0.000 0.212
#> GSM11839     4  0.7291     0.0701 0.228 0.016 0.336 0.360 0.000 0.060
#> GSM11836     4  0.4544     0.5336 0.004 0.076 0.000 0.688 0.000 0.232
#> GSM11849     6  0.0790     0.3006 0.000 0.000 0.000 0.032 0.000 0.968
#> GSM11682     6  0.3833     0.5861 0.000 0.000 0.000 0.444 0.000 0.556
#> GSM11690     4  0.0000     0.6840 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11692     4  0.0000     0.6840 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11841     4  0.0790     0.6742 0.000 0.000 0.000 0.968 0.032 0.000
#> GSM11901     4  0.0000     0.6840 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11715     6  0.5833    -0.5710 0.000 0.364 0.000 0.192 0.000 0.444
#> GSM11724     6  0.5847    -0.5686 0.000 0.360 0.000 0.196 0.000 0.444
#> GSM11684     4  0.4388     0.1783 0.004 0.004 0.012 0.560 0.000 0.420
#> GSM11696     4  0.4961     0.1889 0.004 0.000 0.368 0.564 0.000 0.064
#> GSM27952     6  0.3833     0.5861 0.000 0.000 0.000 0.444 0.000 0.556
#> GSM27948     4  0.0000     0.6840 0.000 0.000 0.000 1.000 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-pam-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>         n cell.line(p) agent(p)  time(p) k
#> CV:pam 78     5.04e-03   0.0732 3.28e-04 2
#> CV:pam 52     6.93e-06   0.2531 9.80e-04 3
#> CV:pam 60     2.52e-09   0.4305 6.67e-06 4
#> CV:pam 66     4.32e-12   0.1193 1.99e-06 5
#> CV:pam 59     4.65e-15   0.2316 1.66e-05 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:mclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "mclust"]
# you can also extract it by
# res = res_list["CV:mclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.372           0.833       0.895         0.3515 0.685   0.685
#> 3 3 0.223           0.659       0.730         0.5981 0.727   0.614
#> 4 4 0.595           0.720       0.844         0.2947 0.758   0.493
#> 5 5 0.618           0.674       0.798         0.0695 0.862   0.541
#> 6 6 0.676           0.616       0.752         0.0499 0.951   0.774

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 4

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1  0.5737      0.825 0.864 0.136
#> GSM11735     1  0.5737      0.825 0.864 0.136
#> GSM11733     1  0.6048      0.815 0.852 0.148
#> GSM11863     1  0.5737      0.825 0.864 0.136
#> GSM11710     1  0.4939      0.841 0.892 0.108
#> GSM11712     1  0.0376      0.887 0.996 0.004
#> GSM11732     1  0.7219      0.765 0.800 0.200
#> GSM11844     1  0.7219      0.765 0.800 0.200
#> GSM11842     1  0.5737      0.825 0.864 0.136
#> GSM11860     1  0.5737      0.825 0.864 0.136
#> GSM11686     1  0.5059      0.842 0.888 0.112
#> GSM11688     1  0.4939      0.841 0.892 0.108
#> GSM11846     1  0.3274      0.867 0.940 0.060
#> GSM11680     1  0.2948      0.871 0.948 0.052
#> GSM11698     1  0.3584      0.863 0.932 0.068
#> GSM11840     1  0.5737      0.825 0.864 0.136
#> GSM11847     1  0.5737      0.825 0.864 0.136
#> GSM11685     1  0.4939      0.841 0.892 0.108
#> GSM11699     1  0.4161      0.858 0.916 0.084
#> GSM27950     1  0.0672      0.886 0.992 0.008
#> GSM27946     1  0.3584      0.863 0.932 0.068
#> GSM11709     1  0.5842      0.826 0.860 0.140
#> GSM11720     1  0.7674      0.714 0.776 0.224
#> GSM11726     1  0.8713      0.624 0.708 0.292
#> GSM11837     2  0.4815      0.929 0.104 0.896
#> GSM11725     2  0.4815      0.929 0.104 0.896
#> GSM11864     2  0.6148      0.897 0.152 0.848
#> GSM11687     1  0.0938      0.887 0.988 0.012
#> GSM11693     1  0.0672      0.887 0.992 0.008
#> GSM11727     2  0.4815      0.929 0.104 0.896
#> GSM11838     2  0.4815      0.929 0.104 0.896
#> GSM11681     1  0.0938      0.887 0.988 0.012
#> GSM11689     1  0.6712      0.723 0.824 0.176
#> GSM11704     2  0.9996      0.343 0.488 0.512
#> GSM11703     1  0.0672      0.887 0.992 0.008
#> GSM11705     1  0.0672      0.887 0.992 0.008
#> GSM11722     2  0.4815      0.929 0.104 0.896
#> GSM11730     2  0.8016      0.783 0.244 0.756
#> GSM11713     1  0.9323      0.345 0.652 0.348
#> GSM11728     1  0.1184      0.886 0.984 0.016
#> GSM27947     1  0.4431      0.848 0.908 0.092
#> GSM27951     1  0.0672      0.887 0.992 0.008
#> GSM11707     1  0.5842      0.824 0.860 0.140
#> GSM11716     1  0.5946      0.819 0.856 0.144
#> GSM11850     1  0.7219      0.765 0.800 0.200
#> GSM11851     1  0.6048      0.844 0.852 0.148
#> GSM11721     1  0.5946      0.823 0.856 0.144
#> GSM11852     1  0.4939      0.841 0.892 0.108
#> GSM11694     1  0.0376      0.887 0.996 0.004
#> GSM11695     1  0.0376      0.887 0.996 0.004
#> GSM11734     2  0.4815      0.929 0.104 0.896
#> GSM11861     1  0.2603      0.878 0.956 0.044
#> GSM11843     2  0.7674      0.818 0.224 0.776
#> GSM11862     1  0.0938      0.887 0.988 0.012
#> GSM11697     1  0.0376      0.887 0.996 0.004
#> GSM11714     1  0.0672      0.887 0.992 0.008
#> GSM11723     2  0.8499      0.729 0.276 0.724
#> GSM11845     1  0.9491      0.417 0.632 0.368
#> GSM11683     1  0.1633      0.884 0.976 0.024
#> GSM11691     1  0.1414      0.885 0.980 0.020
#> GSM27949     1  0.1414      0.883 0.980 0.020
#> GSM27945     1  0.2423      0.876 0.960 0.040
#> GSM11706     1  0.3431      0.865 0.936 0.064
#> GSM11853     1  0.4815      0.839 0.896 0.104
#> GSM11729     2  0.4815      0.929 0.104 0.896
#> GSM11746     2  0.4815      0.929 0.104 0.896
#> GSM11711     1  0.4815      0.839 0.896 0.104
#> GSM11854     1  0.4815      0.839 0.896 0.104
#> GSM11731     2  0.4815      0.929 0.104 0.896
#> GSM11839     1  0.9732      0.334 0.596 0.404
#> GSM11836     1  0.7299      0.762 0.796 0.204
#> GSM11849     1  0.3114      0.872 0.944 0.056
#> GSM11682     1  0.0376      0.887 0.996 0.004
#> GSM11690     1  0.0000      0.887 1.000 0.000
#> GSM11692     1  0.0000      0.887 1.000 0.000
#> GSM11841     1  0.0376      0.887 0.996 0.004
#> GSM11901     1  0.0376      0.887 0.996 0.004
#> GSM11715     2  0.4815      0.929 0.104 0.896
#> GSM11724     2  0.4815      0.929 0.104 0.896
#> GSM11684     1  0.0376      0.887 0.996 0.004
#> GSM11696     1  0.0376      0.887 0.996 0.004
#> GSM27952     1  0.4690      0.847 0.900 0.100
#> GSM27948     1  0.0000      0.887 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.5058     0.7306 0.032 0.148 0.820
#> GSM11735     3  0.5058     0.7306 0.032 0.148 0.820
#> GSM11733     3  0.5285     0.7263 0.040 0.148 0.812
#> GSM11863     3  0.5058     0.7306 0.032 0.148 0.820
#> GSM11710     3  0.5690     0.6750 0.288 0.004 0.708
#> GSM11712     3  0.7766     0.7456 0.176 0.148 0.676
#> GSM11732     3  0.6297     0.6024 0.008 0.352 0.640
#> GSM11844     3  0.5506     0.6977 0.016 0.220 0.764
#> GSM11842     3  0.5180     0.7299 0.032 0.156 0.812
#> GSM11860     3  0.5235     0.7356 0.036 0.152 0.812
#> GSM11686     3  0.5656     0.6866 0.264 0.008 0.728
#> GSM11688     3  0.2682     0.7211 0.076 0.004 0.920
#> GSM11846     3  0.1905     0.7360 0.016 0.028 0.956
#> GSM11680     3  0.2434     0.7430 0.024 0.036 0.940
#> GSM11698     3  0.1905     0.7352 0.016 0.028 0.956
#> GSM11840     3  0.5058     0.7306 0.032 0.148 0.820
#> GSM11847     3  0.5058     0.7306 0.032 0.148 0.820
#> GSM11685     3  0.5588     0.6824 0.276 0.004 0.720
#> GSM11699     3  0.6333     0.6507 0.332 0.012 0.656
#> GSM27950     3  0.3590     0.7540 0.028 0.076 0.896
#> GSM27946     3  0.5574     0.7351 0.184 0.032 0.784
#> GSM11709     1  0.8476     0.5894 0.560 0.332 0.108
#> GSM11720     1  0.7671     0.5404 0.544 0.408 0.048
#> GSM11726     2  0.9281     0.0395 0.204 0.520 0.276
#> GSM11837     2  0.0848     0.7740 0.008 0.984 0.008
#> GSM11725     2  0.0237     0.7746 0.000 0.996 0.004
#> GSM11864     2  0.4136     0.6677 0.020 0.864 0.116
#> GSM11687     1  0.6402     0.7336 0.744 0.200 0.056
#> GSM11693     1  0.6527     0.7348 0.744 0.188 0.068
#> GSM11727     2  0.1315     0.7676 0.020 0.972 0.008
#> GSM11838     2  0.0848     0.7740 0.008 0.984 0.008
#> GSM11681     1  0.6431     0.6926 0.760 0.084 0.156
#> GSM11689     1  0.6319     0.7279 0.732 0.228 0.040
#> GSM11704     1  0.6744     0.6948 0.668 0.300 0.032
#> GSM11703     1  0.5181     0.6917 0.832 0.084 0.084
#> GSM11705     1  0.6001     0.6907 0.784 0.072 0.144
#> GSM11722     2  0.5618     0.3687 0.260 0.732 0.008
#> GSM11730     1  0.6633     0.4917 0.548 0.444 0.008
#> GSM11713     1  0.6598     0.5257 0.564 0.428 0.008
#> GSM11728     1  0.7091     0.2097 0.676 0.056 0.268
#> GSM27947     3  0.4723     0.7350 0.160 0.016 0.824
#> GSM27951     1  0.6292     0.7266 0.740 0.216 0.044
#> GSM11707     3  0.8030     0.6847 0.144 0.204 0.652
#> GSM11716     3  0.5008     0.7212 0.016 0.180 0.804
#> GSM11850     3  0.6228     0.5801 0.004 0.372 0.624
#> GSM11851     3  0.2774     0.7342 0.008 0.072 0.920
#> GSM11721     3  0.9335     0.6639 0.324 0.184 0.492
#> GSM11852     3  0.6255     0.6553 0.320 0.012 0.668
#> GSM11694     3  0.7661     0.7062 0.144 0.172 0.684
#> GSM11695     3  0.7603     0.7086 0.140 0.172 0.688
#> GSM11734     2  0.0237     0.7746 0.000 0.996 0.004
#> GSM11861     3  0.9480     0.6382 0.296 0.216 0.488
#> GSM11843     2  0.4033     0.5908 0.136 0.856 0.008
#> GSM11862     3  0.9367     0.6252 0.344 0.180 0.476
#> GSM11697     3  0.7595     0.7101 0.136 0.176 0.688
#> GSM11714     3  0.8542     0.6494 0.172 0.220 0.608
#> GSM11723     2  0.0661     0.7743 0.004 0.988 0.008
#> GSM11845     2  0.4413     0.6569 0.024 0.852 0.124
#> GSM11683     3  0.7710     0.5268 0.368 0.056 0.576
#> GSM11691     3  0.7726     0.5179 0.372 0.056 0.572
#> GSM27949     3  0.3031     0.7471 0.012 0.076 0.912
#> GSM27945     3  0.4489     0.7468 0.108 0.036 0.856
#> GSM11706     3  0.2031     0.7374 0.016 0.032 0.952
#> GSM11853     3  0.3983     0.7233 0.144 0.004 0.852
#> GSM11729     2  0.0237     0.7746 0.000 0.996 0.004
#> GSM11746     2  0.0424     0.7751 0.000 0.992 0.008
#> GSM11711     3  0.5201     0.6933 0.236 0.004 0.760
#> GSM11854     3  0.5285     0.6972 0.244 0.004 0.752
#> GSM11731     2  0.0237     0.7746 0.000 0.996 0.004
#> GSM11839     2  0.6521     0.1636 0.016 0.644 0.340
#> GSM11836     2  0.8141    -0.4165 0.068 0.472 0.460
#> GSM11849     3  0.9756     0.5852 0.316 0.248 0.436
#> GSM11682     3  0.8157     0.7067 0.308 0.096 0.596
#> GSM11690     3  0.8526     0.7101 0.308 0.120 0.572
#> GSM11692     3  0.7635     0.7333 0.212 0.112 0.676
#> GSM11841     3  0.8355     0.7138 0.184 0.188 0.628
#> GSM11901     3  0.8355     0.7138 0.184 0.188 0.628
#> GSM11715     2  0.0829     0.7704 0.012 0.984 0.004
#> GSM11724     2  0.1015     0.7705 0.012 0.980 0.008
#> GSM11684     3  0.9254     0.6375 0.332 0.172 0.496
#> GSM11696     3  0.9239     0.6422 0.328 0.172 0.500
#> GSM27952     3  0.5156     0.7004 0.216 0.008 0.776
#> GSM27948     3  0.7501     0.7329 0.212 0.104 0.684

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.0524     0.7913 0.000 0.008 0.988 0.004
#> GSM11735     3  0.0524     0.7913 0.000 0.008 0.988 0.004
#> GSM11733     3  0.0469     0.7904 0.000 0.012 0.988 0.000
#> GSM11863     3  0.0469     0.7904 0.000 0.012 0.988 0.000
#> GSM11710     4  0.4844     0.4497 0.012 0.000 0.300 0.688
#> GSM11712     4  0.1867     0.7653 0.000 0.000 0.072 0.928
#> GSM11732     3  0.4249     0.7445 0.008 0.176 0.800 0.016
#> GSM11844     3  0.4388     0.7921 0.004 0.048 0.812 0.136
#> GSM11842     3  0.0657     0.7921 0.000 0.012 0.984 0.004
#> GSM11860     3  0.0657     0.7921 0.000 0.012 0.984 0.004
#> GSM11686     4  0.3945     0.5954 0.004 0.000 0.216 0.780
#> GSM11688     4  0.4898     0.2058 0.000 0.000 0.416 0.584
#> GSM11846     3  0.3975     0.7408 0.000 0.000 0.760 0.240
#> GSM11680     3  0.4134     0.7455 0.000 0.000 0.740 0.260
#> GSM11698     3  0.4193     0.7224 0.000 0.000 0.732 0.268
#> GSM11840     3  0.0336     0.7908 0.000 0.008 0.992 0.000
#> GSM11847     3  0.0524     0.7913 0.000 0.008 0.988 0.004
#> GSM11685     4  0.1792     0.7579 0.000 0.000 0.068 0.932
#> GSM11699     4  0.1406     0.7735 0.024 0.000 0.016 0.960
#> GSM27950     3  0.4302     0.7674 0.004 0.004 0.756 0.236
#> GSM27946     4  0.3837     0.6199 0.000 0.000 0.224 0.776
#> GSM11709     1  0.4271     0.7763 0.816 0.140 0.004 0.040
#> GSM11720     1  0.2515     0.8166 0.912 0.072 0.004 0.012
#> GSM11726     1  0.3972     0.7214 0.816 0.164 0.016 0.004
#> GSM11837     2  0.1661     0.9053 0.052 0.944 0.000 0.004
#> GSM11725     2  0.0188     0.9192 0.004 0.996 0.000 0.000
#> GSM11864     2  0.3052     0.7937 0.004 0.860 0.000 0.136
#> GSM11687     1  0.1389     0.8556 0.952 0.000 0.000 0.048
#> GSM11693     1  0.1576     0.8567 0.948 0.000 0.004 0.048
#> GSM11727     2  0.1978     0.8998 0.068 0.928 0.000 0.004
#> GSM11838     2  0.1743     0.9053 0.056 0.940 0.000 0.004
#> GSM11681     1  0.2238     0.8462 0.920 0.004 0.004 0.072
#> GSM11689     1  0.1576     0.8567 0.948 0.000 0.004 0.048
#> GSM11704     1  0.1762     0.8560 0.944 0.004 0.004 0.048
#> GSM11703     1  0.1576     0.8567 0.948 0.000 0.004 0.048
#> GSM11705     1  0.1576     0.8567 0.948 0.000 0.004 0.048
#> GSM11722     2  0.4509     0.5966 0.288 0.708 0.000 0.004
#> GSM11730     1  0.3355     0.7232 0.836 0.160 0.000 0.004
#> GSM11713     1  0.4425     0.7590 0.800 0.160 0.004 0.036
#> GSM11728     1  0.3583     0.7591 0.816 0.000 0.004 0.180
#> GSM27947     4  0.4877     0.1445 0.000 0.000 0.408 0.592
#> GSM27951     1  0.1576     0.8567 0.948 0.000 0.004 0.048
#> GSM11707     3  0.6792     0.6593 0.140 0.140 0.680 0.040
#> GSM11716     3  0.3708     0.7912 0.000 0.020 0.832 0.148
#> GSM11850     3  0.3688     0.7260 0.000 0.208 0.792 0.000
#> GSM11851     3  0.3895     0.7785 0.000 0.012 0.804 0.184
#> GSM11721     4  0.4171     0.6950 0.084 0.088 0.000 0.828
#> GSM11852     4  0.1707     0.7743 0.020 0.004 0.024 0.952
#> GSM11694     3  0.5914     0.6662 0.228 0.008 0.692 0.072
#> GSM11695     3  0.5954     0.7405 0.112 0.008 0.712 0.168
#> GSM11734     2  0.0188     0.9192 0.004 0.996 0.000 0.000
#> GSM11861     4  0.3612     0.7230 0.100 0.044 0.000 0.856
#> GSM11843     2  0.3479     0.7897 0.148 0.840 0.000 0.012
#> GSM11862     4  0.3450     0.6755 0.156 0.008 0.000 0.836
#> GSM11697     3  0.5982     0.7435 0.108 0.008 0.708 0.176
#> GSM11714     3  0.7391     0.5517 0.224 0.132 0.608 0.036
#> GSM11723     2  0.0188     0.9192 0.004 0.996 0.000 0.000
#> GSM11845     2  0.3052     0.7937 0.004 0.860 0.000 0.136
#> GSM11683     1  0.6597     0.1680 0.540 0.000 0.372 0.088
#> GSM11691     1  0.5990     0.3281 0.608 0.000 0.336 0.056
#> GSM27949     3  0.3626     0.7805 0.000 0.004 0.812 0.184
#> GSM27945     3  0.4605     0.6451 0.000 0.000 0.664 0.336
#> GSM11706     3  0.4193     0.7276 0.000 0.000 0.732 0.268
#> GSM11853     3  0.4996     0.2088 0.000 0.000 0.516 0.484
#> GSM11729     2  0.0188     0.9197 0.004 0.996 0.000 0.000
#> GSM11746     2  0.0188     0.9197 0.004 0.996 0.000 0.000
#> GSM11711     4  0.4978     0.2005 0.004 0.000 0.384 0.612
#> GSM11854     4  0.4837     0.3321 0.004 0.000 0.348 0.648
#> GSM11731     2  0.0657     0.9177 0.012 0.984 0.000 0.004
#> GSM11839     2  0.2988     0.8415 0.012 0.876 0.000 0.112
#> GSM11836     4  0.4999    -0.0544 0.000 0.492 0.000 0.508
#> GSM11849     4  0.4841     0.6562 0.080 0.140 0.000 0.780
#> GSM11682     4  0.0779     0.7761 0.000 0.004 0.016 0.980
#> GSM11690     4  0.0376     0.7744 0.004 0.000 0.004 0.992
#> GSM11692     4  0.1302     0.7723 0.000 0.000 0.044 0.956
#> GSM11841     4  0.1211     0.7731 0.000 0.000 0.040 0.960
#> GSM11901     4  0.1211     0.7731 0.000 0.000 0.040 0.960
#> GSM11715     2  0.0188     0.9197 0.004 0.996 0.000 0.000
#> GSM11724     2  0.0188     0.9197 0.004 0.996 0.000 0.000
#> GSM11684     4  0.3508     0.6955 0.136 0.012 0.004 0.848
#> GSM11696     4  0.3914     0.6949 0.120 0.036 0.004 0.840
#> GSM27952     4  0.1389     0.7730 0.000 0.000 0.048 0.952
#> GSM27948     4  0.1302     0.7723 0.000 0.000 0.044 0.956

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     3  0.4287     0.3096 0.000 0.000 0.540 0.000 0.460
#> GSM11735     3  0.4305     0.2369 0.000 0.000 0.512 0.000 0.488
#> GSM11733     5  0.0771     0.8242 0.000 0.004 0.020 0.000 0.976
#> GSM11863     5  0.0162     0.8235 0.000 0.000 0.004 0.000 0.996
#> GSM11710     3  0.1608     0.6708 0.000 0.000 0.928 0.072 0.000
#> GSM11712     4  0.3882     0.7794 0.000 0.000 0.224 0.756 0.020
#> GSM11732     5  0.4027     0.7648 0.000 0.144 0.044 0.012 0.800
#> GSM11844     5  0.3909     0.7234 0.000 0.048 0.148 0.004 0.800
#> GSM11842     5  0.0000     0.8233 0.000 0.000 0.000 0.000 1.000
#> GSM11860     5  0.0510     0.8241 0.000 0.000 0.016 0.000 0.984
#> GSM11686     3  0.2127     0.6533 0.000 0.000 0.892 0.108 0.000
#> GSM11688     3  0.0880     0.6897 0.000 0.000 0.968 0.032 0.000
#> GSM11846     3  0.2852     0.6750 0.000 0.000 0.828 0.000 0.172
#> GSM11680     3  0.2929     0.6686 0.000 0.000 0.820 0.000 0.180
#> GSM11698     3  0.2719     0.6875 0.000 0.000 0.852 0.004 0.144
#> GSM11840     5  0.1965     0.7772 0.000 0.000 0.096 0.000 0.904
#> GSM11847     5  0.3966     0.2927 0.000 0.000 0.336 0.000 0.664
#> GSM11685     3  0.2424     0.6286 0.000 0.000 0.868 0.132 0.000
#> GSM11699     4  0.5006     0.6896 0.048 0.000 0.328 0.624 0.000
#> GSM27950     3  0.3210     0.6460 0.000 0.000 0.788 0.000 0.212
#> GSM27946     3  0.4504    -0.0359 0.000 0.000 0.564 0.428 0.008
#> GSM11709     1  0.3265     0.7918 0.868 0.068 0.000 0.036 0.028
#> GSM11720     1  0.1251     0.8383 0.956 0.036 0.000 0.000 0.008
#> GSM11726     1  0.4811     0.6899 0.748 0.096 0.000 0.144 0.012
#> GSM11837     2  0.3365     0.7964 0.004 0.808 0.000 0.180 0.008
#> GSM11725     2  0.0794     0.8464 0.000 0.972 0.000 0.028 0.000
#> GSM11864     2  0.3088     0.7295 0.000 0.828 0.164 0.004 0.004
#> GSM11687     1  0.0000     0.8515 1.000 0.000 0.000 0.000 0.000
#> GSM11693     1  0.0000     0.8515 1.000 0.000 0.000 0.000 0.000
#> GSM11727     2  0.4022     0.7770 0.024 0.772 0.000 0.196 0.008
#> GSM11838     2  0.3509     0.7882 0.004 0.792 0.000 0.196 0.008
#> GSM11681     1  0.0671     0.8480 0.980 0.016 0.000 0.004 0.000
#> GSM11689     1  0.0000     0.8515 1.000 0.000 0.000 0.000 0.000
#> GSM11704     1  0.0290     0.8496 0.992 0.000 0.000 0.000 0.008
#> GSM11703     1  0.0162     0.8513 0.996 0.004 0.000 0.000 0.000
#> GSM11705     1  0.0000     0.8515 1.000 0.000 0.000 0.000 0.000
#> GSM11722     2  0.6555     0.3255 0.316 0.500 0.000 0.176 0.008
#> GSM11730     1  0.5430     0.6181 0.680 0.124 0.000 0.188 0.008
#> GSM11713     1  0.5398     0.6221 0.684 0.124 0.000 0.184 0.008
#> GSM11728     1  0.1041     0.8324 0.964 0.004 0.000 0.032 0.000
#> GSM27947     3  0.3362     0.6922 0.000 0.000 0.844 0.076 0.080
#> GSM27951     1  0.0000     0.8515 1.000 0.000 0.000 0.000 0.000
#> GSM11707     3  0.7703     0.4476 0.188 0.060 0.528 0.028 0.196
#> GSM11716     5  0.3538     0.7029 0.000 0.016 0.176 0.004 0.804
#> GSM11850     5  0.3807     0.7337 0.004 0.176 0.000 0.028 0.792
#> GSM11851     3  0.3707     0.6355 0.000 0.008 0.768 0.004 0.220
#> GSM11721     4  0.5058     0.7708 0.172 0.028 0.068 0.732 0.000
#> GSM11852     3  0.5360    -0.1945 0.060 0.000 0.556 0.384 0.000
#> GSM11694     3  0.6392     0.4587 0.272 0.004 0.532 0.000 0.192
#> GSM11695     3  0.6078     0.5209 0.212 0.004 0.592 0.000 0.192
#> GSM11734     2  0.0794     0.8464 0.000 0.972 0.000 0.028 0.000
#> GSM11861     4  0.5391     0.7626 0.192 0.020 0.072 0.708 0.008
#> GSM11843     2  0.3039     0.7133 0.192 0.808 0.000 0.000 0.000
#> GSM11862     4  0.5044     0.7396 0.224 0.004 0.060 0.704 0.008
#> GSM11697     3  0.6046     0.5241 0.216 0.004 0.596 0.000 0.184
#> GSM11714     3  0.7655     0.4251 0.268 0.048 0.516 0.040 0.128
#> GSM11723     2  0.1243     0.8464 0.004 0.960 0.000 0.028 0.008
#> GSM11845     2  0.3477     0.7277 0.004 0.816 0.164 0.004 0.012
#> GSM11683     1  0.4649     0.1229 0.580 0.000 0.404 0.000 0.016
#> GSM11691     1  0.4015     0.3177 0.652 0.000 0.348 0.000 0.000
#> GSM27949     3  0.3305     0.6344 0.000 0.000 0.776 0.000 0.224
#> GSM27945     3  0.3326     0.6884 0.000 0.000 0.824 0.024 0.152
#> GSM11706     3  0.2471     0.6863 0.000 0.000 0.864 0.000 0.136
#> GSM11853     3  0.2248     0.6787 0.000 0.000 0.900 0.088 0.012
#> GSM11729     2  0.0324     0.8526 0.000 0.992 0.000 0.004 0.004
#> GSM11746     2  0.0162     0.8518 0.000 0.996 0.000 0.004 0.000
#> GSM11711     3  0.1732     0.6751 0.000 0.000 0.920 0.080 0.000
#> GSM11854     3  0.2179     0.6490 0.000 0.000 0.888 0.112 0.000
#> GSM11731     2  0.0566     0.8523 0.000 0.984 0.000 0.012 0.004
#> GSM11839     2  0.3963     0.5737 0.008 0.732 0.000 0.256 0.004
#> GSM11836     4  0.4675     0.1378 0.004 0.444 0.000 0.544 0.008
#> GSM11849     4  0.5487     0.7384 0.184 0.052 0.044 0.712 0.008
#> GSM11682     4  0.4111     0.7541 0.008 0.000 0.280 0.708 0.004
#> GSM11690     4  0.3491     0.7884 0.004 0.000 0.228 0.768 0.000
#> GSM11692     4  0.3336     0.7869 0.000 0.000 0.228 0.772 0.000
#> GSM11841     4  0.3305     0.7880 0.000 0.000 0.224 0.776 0.000
#> GSM11901     4  0.3305     0.7880 0.000 0.000 0.224 0.776 0.000
#> GSM11715     2  0.0162     0.8525 0.000 0.996 0.000 0.004 0.000
#> GSM11724     2  0.0324     0.8523 0.004 0.992 0.000 0.000 0.004
#> GSM11684     4  0.5117     0.7620 0.196 0.012 0.064 0.720 0.008
#> GSM11696     4  0.5117     0.7620 0.196 0.012 0.064 0.720 0.008
#> GSM27952     3  0.2813     0.5776 0.000 0.000 0.832 0.168 0.000
#> GSM27948     4  0.3366     0.7861 0.000 0.000 0.232 0.768 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6  0.4844    0.42849 0.000 0.000 0.080 0.000 0.312 0.608
#> GSM11735     6  0.4760    0.39540 0.000 0.000 0.068 0.000 0.328 0.604
#> GSM11733     5  0.1082    0.83295 0.000 0.000 0.004 0.000 0.956 0.040
#> GSM11863     5  0.0547    0.83856 0.000 0.000 0.000 0.000 0.980 0.020
#> GSM11710     3  0.1390    0.58125 0.032 0.004 0.948 0.016 0.000 0.000
#> GSM11712     4  0.2665    0.75252 0.000 0.000 0.060 0.884 0.032 0.024
#> GSM11732     5  0.3864    0.78699 0.000 0.096 0.008 0.004 0.796 0.096
#> GSM11844     5  0.4094    0.79116 0.000 0.068 0.036 0.008 0.800 0.088
#> GSM11842     5  0.0000    0.83631 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11860     5  0.0972    0.83670 0.000 0.000 0.008 0.000 0.964 0.028
#> GSM11686     3  0.2454    0.58801 0.000 0.000 0.840 0.160 0.000 0.000
#> GSM11688     3  0.1109    0.57471 0.004 0.004 0.964 0.012 0.000 0.016
#> GSM11846     3  0.5181    0.01064 0.004 0.000 0.544 0.008 0.060 0.384
#> GSM11680     3  0.5272    0.09401 0.008 0.000 0.576 0.008 0.068 0.340
#> GSM11698     3  0.3954    0.48452 0.008 0.000 0.788 0.012 0.052 0.140
#> GSM11840     5  0.1480    0.82506 0.000 0.000 0.020 0.000 0.940 0.040
#> GSM11847     5  0.3551    0.57110 0.000 0.000 0.192 0.000 0.772 0.036
#> GSM11685     3  0.2527    0.58494 0.000 0.000 0.832 0.168 0.000 0.000
#> GSM11699     3  0.4750    0.41511 0.128 0.004 0.688 0.180 0.000 0.000
#> GSM27950     3  0.5366   -0.18756 0.004 0.000 0.476 0.004 0.080 0.436
#> GSM27946     3  0.3725    0.50234 0.000 0.000 0.676 0.316 0.000 0.008
#> GSM11709     1  0.3839    0.73776 0.816 0.060 0.004 0.004 0.024 0.092
#> GSM11720     1  0.1816    0.80604 0.936 0.028 0.004 0.016 0.004 0.012
#> GSM11726     1  0.4804    0.65024 0.712 0.124 0.000 0.008 0.008 0.148
#> GSM11837     2  0.3288    0.75885 0.008 0.800 0.000 0.016 0.000 0.176
#> GSM11725     2  0.1958    0.80332 0.000 0.896 0.000 0.004 0.000 0.100
#> GSM11864     2  0.3215    0.79291 0.008 0.852 0.048 0.012 0.000 0.080
#> GSM11687     1  0.0146    0.82018 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM11693     1  0.0436    0.82030 0.988 0.004 0.004 0.004 0.000 0.000
#> GSM11727     2  0.4158    0.72238 0.036 0.740 0.000 0.020 0.000 0.204
#> GSM11838     2  0.3623    0.73872 0.008 0.764 0.000 0.020 0.000 0.208
#> GSM11681     1  0.1149    0.81277 0.960 0.024 0.008 0.008 0.000 0.000
#> GSM11689     1  0.0146    0.82018 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM11704     1  0.0767    0.81973 0.976 0.008 0.004 0.000 0.000 0.012
#> GSM11703     1  0.0508    0.81895 0.984 0.004 0.012 0.000 0.000 0.000
#> GSM11705     1  0.0146    0.82018 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM11722     2  0.6491    0.08117 0.368 0.428 0.004 0.032 0.000 0.168
#> GSM11730     1  0.5590    0.56331 0.624 0.148 0.004 0.020 0.000 0.204
#> GSM11713     1  0.5718    0.56879 0.624 0.148 0.008 0.024 0.000 0.196
#> GSM11728     1  0.1942    0.79049 0.928 0.004 0.020 0.020 0.000 0.028
#> GSM27947     3  0.3050    0.55699 0.004 0.000 0.856 0.028 0.016 0.096
#> GSM27951     1  0.0551    0.81971 0.984 0.008 0.004 0.004 0.000 0.000
#> GSM11707     6  0.7626    0.63642 0.168 0.056 0.212 0.004 0.080 0.480
#> GSM11716     5  0.4159    0.77832 0.004 0.036 0.096 0.008 0.800 0.056
#> GSM11850     5  0.4122    0.78501 0.004 0.080 0.000 0.016 0.780 0.120
#> GSM11851     3  0.6831    0.00151 0.004 0.036 0.464 0.008 0.260 0.228
#> GSM11721     4  0.4015    0.74332 0.160 0.016 0.016 0.780 0.000 0.028
#> GSM11852     3  0.3098    0.50170 0.120 0.004 0.836 0.040 0.000 0.000
#> GSM11694     6  0.7660    0.63408 0.244 0.008 0.232 0.008 0.112 0.396
#> GSM11695     6  0.7350    0.61292 0.240 0.004 0.260 0.004 0.088 0.404
#> GSM11734     2  0.1858    0.80724 0.000 0.904 0.000 0.004 0.000 0.092
#> GSM11861     4  0.4883    0.74845 0.160 0.040 0.060 0.728 0.000 0.012
#> GSM11843     2  0.3109    0.71442 0.168 0.812 0.004 0.016 0.000 0.000
#> GSM11862     4  0.4289    0.72089 0.216 0.016 0.044 0.724 0.000 0.000
#> GSM11697     6  0.7384    0.55897 0.224 0.004 0.304 0.004 0.088 0.376
#> GSM11714     6  0.7559    0.61546 0.212 0.052 0.216 0.004 0.056 0.460
#> GSM11723     2  0.2101    0.80166 0.000 0.892 0.000 0.004 0.004 0.100
#> GSM11845     2  0.3320    0.78966 0.008 0.848 0.052 0.008 0.004 0.080
#> GSM11683     1  0.5052    0.01974 0.600 0.000 0.308 0.004 0.000 0.088
#> GSM11691     1  0.3734    0.34889 0.716 0.000 0.264 0.000 0.000 0.020
#> GSM27949     3  0.5764   -0.20153 0.008 0.004 0.464 0.008 0.088 0.428
#> GSM27945     3  0.5590    0.22001 0.004 0.000 0.580 0.052 0.048 0.316
#> GSM11706     3  0.5067    0.21456 0.008 0.000 0.624 0.008 0.064 0.296
#> GSM11853     3  0.4061    0.58561 0.000 0.000 0.748 0.164 0.000 0.088
#> GSM11729     2  0.0260    0.82858 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM11746     2  0.0363    0.82789 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM11711     3  0.3381    0.59831 0.004 0.000 0.808 0.148 0.000 0.040
#> GSM11854     3  0.2581    0.60143 0.000 0.000 0.856 0.128 0.000 0.016
#> GSM11731     2  0.1442    0.82070 0.004 0.944 0.000 0.012 0.000 0.040
#> GSM11839     2  0.4245    0.37300 0.004 0.644 0.000 0.328 0.000 0.024
#> GSM11836     4  0.5357    0.27272 0.000 0.340 0.000 0.536 0.000 0.124
#> GSM11849     4  0.4839    0.74283 0.168 0.048 0.044 0.728 0.000 0.012
#> GSM11682     4  0.4746    0.20599 0.000 0.004 0.424 0.532 0.000 0.040
#> GSM11690     4  0.2510    0.76171 0.008 0.000 0.080 0.884 0.000 0.028
#> GSM11692     4  0.1765    0.76820 0.000 0.000 0.052 0.924 0.000 0.024
#> GSM11841     4  0.1765    0.76820 0.000 0.000 0.052 0.924 0.000 0.024
#> GSM11901     4  0.1765    0.76820 0.000 0.000 0.052 0.924 0.000 0.024
#> GSM11715     2  0.0291    0.82818 0.004 0.992 0.000 0.004 0.000 0.000
#> GSM11724     2  0.0508    0.82851 0.004 0.984 0.000 0.012 0.000 0.000
#> GSM11684     4  0.4930    0.74367 0.176 0.016 0.044 0.720 0.000 0.044
#> GSM11696     4  0.4866    0.74541 0.176 0.016 0.044 0.724 0.000 0.040
#> GSM27952     3  0.2805    0.57405 0.000 0.000 0.812 0.184 0.000 0.004
#> GSM27948     4  0.2019    0.76278 0.000 0.000 0.088 0.900 0.000 0.012

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-mclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>            n cell.line(p) agent(p)  time(p) k
#> CV:mclust 79     2.38e-02    0.553 1.23e-04 2
#> CV:mclust 77     1.17e-10    0.711 3.66e-04 3
#> CV:mclust 74     2.95e-13    0.789 1.34e-05 4
#> CV:mclust 71     5.36e-11    0.294 2.43e-04 5
#> CV:mclust 66     2.25e-13    0.503 8.69e-06 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


CV:NMF

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["CV", "NMF"]
# you can also extract it by
# res = res_list["CV:NMF"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk CV-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk CV-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.510           0.825       0.902         0.4671 0.533   0.533
#> 3 3 0.486           0.656       0.814         0.3706 0.745   0.557
#> 4 4 0.459           0.648       0.779         0.1609 0.771   0.457
#> 5 5 0.636           0.675       0.793         0.0693 0.885   0.597
#> 6 6 0.602           0.478       0.700         0.0386 0.974   0.878

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1  0.0000     0.8597 1.000 0.000
#> GSM11735     1  0.0000     0.8597 1.000 0.000
#> GSM11733     1  0.0000     0.8597 1.000 0.000
#> GSM11863     1  0.0000     0.8597 1.000 0.000
#> GSM11710     1  0.0376     0.8597 0.996 0.004
#> GSM11712     1  0.7745     0.8055 0.772 0.228
#> GSM11732     1  0.8016     0.7872 0.756 0.244
#> GSM11844     1  0.6973     0.8297 0.812 0.188
#> GSM11842     1  0.1843     0.8521 0.972 0.028
#> GSM11860     1  0.0000     0.8597 1.000 0.000
#> GSM11686     1  0.0376     0.8597 0.996 0.004
#> GSM11688     1  0.0000     0.8597 1.000 0.000
#> GSM11846     1  0.0000     0.8597 1.000 0.000
#> GSM11680     1  0.0000     0.8597 1.000 0.000
#> GSM11698     1  0.0000     0.8597 1.000 0.000
#> GSM11840     1  0.0000     0.8597 1.000 0.000
#> GSM11847     1  0.0000     0.8597 1.000 0.000
#> GSM11685     1  0.2043     0.8638 0.968 0.032
#> GSM11699     1  0.7219     0.8240 0.800 0.200
#> GSM27950     1  0.0000     0.8597 1.000 0.000
#> GSM27946     1  0.2603     0.8645 0.956 0.044
#> GSM11709     2  0.5842     0.7966 0.140 0.860
#> GSM11720     2  0.0000     0.9437 0.000 1.000
#> GSM11726     2  0.0376     0.9431 0.004 0.996
#> GSM11837     2  0.0376     0.9431 0.004 0.996
#> GSM11725     2  0.0376     0.9431 0.004 0.996
#> GSM11864     2  0.0000     0.9437 0.000 1.000
#> GSM11687     2  0.0000     0.9437 0.000 1.000
#> GSM11693     2  0.3879     0.8645 0.076 0.924
#> GSM11727     2  0.0000     0.9437 0.000 1.000
#> GSM11838     2  0.0376     0.9431 0.004 0.996
#> GSM11681     1  0.8386     0.7593 0.732 0.268
#> GSM11689     2  0.0000     0.9437 0.000 1.000
#> GSM11704     2  0.0000     0.9437 0.000 1.000
#> GSM11703     2  0.6973     0.6975 0.188 0.812
#> GSM11705     1  0.9732     0.5305 0.596 0.404
#> GSM11722     2  0.0000     0.9437 0.000 1.000
#> GSM11730     2  0.0000     0.9437 0.000 1.000
#> GSM11713     2  0.0000     0.9437 0.000 1.000
#> GSM11728     1  0.9795     0.5072 0.584 0.416
#> GSM27947     1  0.0938     0.8615 0.988 0.012
#> GSM27951     2  0.0000     0.9437 0.000 1.000
#> GSM11707     1  0.0000     0.8597 1.000 0.000
#> GSM11716     1  0.9491     0.3724 0.632 0.368
#> GSM11850     2  0.9944    -0.1217 0.456 0.544
#> GSM11851     1  0.0000     0.8597 1.000 0.000
#> GSM11721     1  0.7219     0.8240 0.800 0.200
#> GSM11852     1  0.3584     0.8648 0.932 0.068
#> GSM11694     1  0.5059     0.8593 0.888 0.112
#> GSM11695     1  0.6623     0.8387 0.828 0.172
#> GSM11734     2  0.0376     0.9431 0.004 0.996
#> GSM11861     1  0.7453     0.8158 0.788 0.212
#> GSM11843     2  0.0000     0.9437 0.000 1.000
#> GSM11862     1  0.8081     0.7848 0.752 0.248
#> GSM11697     1  0.5178     0.8583 0.884 0.116
#> GSM11714     1  0.3584     0.8645 0.932 0.068
#> GSM11723     2  0.0376     0.9431 0.004 0.996
#> GSM11845     2  0.0376     0.9431 0.004 0.996
#> GSM11683     1  0.9686     0.5535 0.604 0.396
#> GSM11691     1  0.9732     0.5351 0.596 0.404
#> GSM27949     1  0.0000     0.8597 1.000 0.000
#> GSM27945     1  0.5059     0.8594 0.888 0.112
#> GSM11706     1  0.0000     0.8597 1.000 0.000
#> GSM11853     1  0.6343     0.8442 0.840 0.160
#> GSM11729     2  0.0376     0.9431 0.004 0.996
#> GSM11746     2  0.0376     0.9431 0.004 0.996
#> GSM11711     1  0.5629     0.8541 0.868 0.132
#> GSM11854     1  0.3733     0.8646 0.928 0.072
#> GSM11731     2  0.0376     0.9431 0.004 0.996
#> GSM11839     2  0.0000     0.9437 0.000 1.000
#> GSM11836     2  0.0938     0.9379 0.012 0.988
#> GSM11849     2  0.9754     0.0627 0.408 0.592
#> GSM11682     1  0.5842     0.8520 0.860 0.140
#> GSM11690     1  0.7219     0.8240 0.800 0.200
#> GSM11692     1  0.7219     0.8240 0.800 0.200
#> GSM11841     1  0.9850     0.4735 0.572 0.428
#> GSM11901     1  0.8713     0.7347 0.708 0.292
#> GSM11715     2  0.0000     0.9437 0.000 1.000
#> GSM11724     2  0.0000     0.9437 0.000 1.000
#> GSM11684     1  0.7219     0.8240 0.800 0.200
#> GSM11696     1  0.7299     0.8217 0.796 0.204
#> GSM27952     1  0.0672     0.8607 0.992 0.008
#> GSM27948     1  0.7219     0.8240 0.800 0.200

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.0892      0.725 0.020 0.000 0.980
#> GSM11735     3  0.0475      0.722 0.004 0.004 0.992
#> GSM11733     3  0.1411      0.710 0.000 0.036 0.964
#> GSM11863     3  0.2261      0.693 0.000 0.068 0.932
#> GSM11710     3  0.4887      0.728 0.228 0.000 0.772
#> GSM11712     3  0.9217      0.542 0.260 0.208 0.532
#> GSM11732     2  0.5621      0.510 0.000 0.692 0.308
#> GSM11844     3  0.5956      0.470 0.004 0.324 0.672
#> GSM11842     3  0.4796      0.512 0.000 0.220 0.780
#> GSM11860     3  0.2096      0.703 0.004 0.052 0.944
#> GSM11686     3  0.5859      0.686 0.344 0.000 0.656
#> GSM11688     3  0.1964      0.735 0.056 0.000 0.944
#> GSM11846     3  0.1753      0.728 0.048 0.000 0.952
#> GSM11680     3  0.2537      0.735 0.080 0.000 0.920
#> GSM11698     3  0.1031      0.730 0.024 0.000 0.976
#> GSM11840     3  0.0592      0.720 0.000 0.012 0.988
#> GSM11847     3  0.0237      0.722 0.000 0.004 0.996
#> GSM11685     3  0.5706      0.699 0.320 0.000 0.680
#> GSM11699     3  0.5948      0.669 0.360 0.000 0.640
#> GSM27950     3  0.1289      0.728 0.032 0.000 0.968
#> GSM27946     3  0.5882      0.679 0.348 0.000 0.652
#> GSM11709     1  0.7501      0.518 0.684 0.104 0.212
#> GSM11720     1  0.4605      0.657 0.796 0.204 0.000
#> GSM11726     2  0.6308      0.093 0.492 0.508 0.000
#> GSM11837     2  0.1031      0.819 0.024 0.976 0.000
#> GSM11725     2  0.1411      0.817 0.036 0.964 0.000
#> GSM11864     2  0.0892      0.818 0.020 0.980 0.000
#> GSM11687     1  0.2400      0.814 0.932 0.064 0.004
#> GSM11693     1  0.1129      0.834 0.976 0.020 0.004
#> GSM11727     2  0.5465      0.544 0.288 0.712 0.000
#> GSM11838     2  0.2165      0.804 0.064 0.936 0.000
#> GSM11681     1  0.0424      0.828 0.992 0.000 0.008
#> GSM11689     1  0.2165      0.816 0.936 0.064 0.000
#> GSM11704     1  0.3116      0.779 0.892 0.108 0.000
#> GSM11703     1  0.0424      0.833 0.992 0.008 0.000
#> GSM11705     1  0.0661      0.834 0.988 0.008 0.004
#> GSM11722     2  0.6302      0.127 0.480 0.520 0.000
#> GSM11730     1  0.6079      0.214 0.612 0.388 0.000
#> GSM11713     1  0.4062      0.719 0.836 0.164 0.000
#> GSM11728     1  0.0424      0.833 0.992 0.008 0.000
#> GSM27947     3  0.6126      0.623 0.400 0.000 0.600
#> GSM27951     1  0.0892      0.834 0.980 0.020 0.000
#> GSM11707     3  0.2066      0.722 0.060 0.000 0.940
#> GSM11716     3  0.6308     -0.149 0.000 0.492 0.508
#> GSM11850     2  0.6282      0.327 0.004 0.612 0.384
#> GSM11851     3  0.1267      0.724 0.004 0.024 0.972
#> GSM11721     3  0.6546      0.711 0.240 0.044 0.716
#> GSM11852     3  0.5591      0.708 0.304 0.000 0.696
#> GSM11694     3  0.5754      0.686 0.296 0.004 0.700
#> GSM11695     3  0.6180      0.599 0.416 0.000 0.584
#> GSM11734     2  0.1964      0.809 0.056 0.944 0.000
#> GSM11861     1  0.4475      0.781 0.864 0.064 0.072
#> GSM11843     2  0.3879      0.689 0.152 0.848 0.000
#> GSM11862     1  0.4654      0.531 0.792 0.000 0.208
#> GSM11697     3  0.6140      0.598 0.404 0.000 0.596
#> GSM11714     3  0.6079      0.525 0.388 0.000 0.612
#> GSM11723     2  0.0237      0.816 0.000 0.996 0.004
#> GSM11845     2  0.1491      0.814 0.016 0.968 0.016
#> GSM11683     1  0.5708      0.562 0.768 0.028 0.204
#> GSM11691     1  0.1129      0.835 0.976 0.020 0.004
#> GSM27949     3  0.1289      0.728 0.032 0.000 0.968
#> GSM27945     3  0.6026      0.657 0.376 0.000 0.624
#> GSM11706     3  0.2959      0.739 0.100 0.000 0.900
#> GSM11853     3  0.5678      0.700 0.316 0.000 0.684
#> GSM11729     2  0.0237      0.816 0.000 0.996 0.004
#> GSM11746     2  0.1411      0.817 0.036 0.964 0.000
#> GSM11711     3  0.5948      0.678 0.360 0.000 0.640
#> GSM11854     3  0.5706      0.699 0.320 0.000 0.680
#> GSM11731     2  0.0237      0.816 0.000 0.996 0.004
#> GSM11839     2  0.1289      0.818 0.032 0.968 0.000
#> GSM11836     2  0.1129      0.811 0.004 0.976 0.020
#> GSM11849     1  0.3933      0.785 0.880 0.092 0.028
#> GSM11682     1  0.6204     -0.246 0.576 0.000 0.424
#> GSM11690     3  0.6168      0.607 0.412 0.000 0.588
#> GSM11692     3  0.6333      0.686 0.332 0.012 0.656
#> GSM11841     2  0.9887     -0.154 0.288 0.408 0.304
#> GSM11901     3  0.9956      0.336 0.308 0.312 0.380
#> GSM11715     2  0.0747      0.817 0.016 0.984 0.000
#> GSM11724     2  0.1964      0.811 0.056 0.944 0.000
#> GSM11684     1  0.1163      0.812 0.972 0.000 0.028
#> GSM11696     1  0.1399      0.817 0.968 0.004 0.028
#> GSM27952     3  0.6079      0.646 0.388 0.000 0.612
#> GSM27948     3  0.6189      0.665 0.364 0.004 0.632

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.0000     0.7764 0.000 0.000 1.000 0.000
#> GSM11735     3  0.0188     0.7768 0.000 0.000 0.996 0.004
#> GSM11733     3  0.2310     0.7694 0.004 0.008 0.920 0.068
#> GSM11863     3  0.4265     0.7467 0.016 0.068 0.840 0.076
#> GSM11710     4  0.5678     0.2857 0.024 0.000 0.452 0.524
#> GSM11712     4  0.7051     0.5809 0.032 0.268 0.088 0.612
#> GSM11732     2  0.5244    -0.0116 0.008 0.556 0.436 0.000
#> GSM11844     3  0.5622     0.5310 0.024 0.328 0.640 0.008
#> GSM11842     3  0.6401     0.3806 0.016 0.360 0.580 0.044
#> GSM11860     3  0.3380     0.7428 0.088 0.028 0.876 0.008
#> GSM11686     4  0.5972     0.7303 0.132 0.000 0.176 0.692
#> GSM11688     3  0.5085     0.1443 0.008 0.000 0.616 0.376
#> GSM11846     3  0.3821     0.7192 0.120 0.000 0.840 0.040
#> GSM11680     3  0.2021     0.7735 0.012 0.000 0.932 0.056
#> GSM11698     3  0.2342     0.7675 0.008 0.000 0.912 0.080
#> GSM11840     3  0.2384     0.7680 0.004 0.008 0.916 0.072
#> GSM11847     3  0.2197     0.7654 0.000 0.004 0.916 0.080
#> GSM11685     4  0.4122     0.7040 0.004 0.000 0.236 0.760
#> GSM11699     4  0.3497     0.7582 0.024 0.000 0.124 0.852
#> GSM27950     3  0.0707     0.7774 0.000 0.000 0.980 0.020
#> GSM27946     4  0.5110     0.7379 0.132 0.000 0.104 0.764
#> GSM11709     1  0.4604     0.6084 0.756 0.012 0.224 0.008
#> GSM11720     1  0.5712     0.6978 0.756 0.072 0.036 0.136
#> GSM11726     1  0.6786     0.4886 0.640 0.256 0.044 0.060
#> GSM11837     2  0.3088     0.7923 0.128 0.864 0.000 0.008
#> GSM11725     2  0.4008     0.6762 0.244 0.756 0.000 0.000
#> GSM11864     2  0.4059     0.7483 0.200 0.788 0.000 0.012
#> GSM11687     1  0.2055     0.7428 0.936 0.008 0.008 0.048
#> GSM11693     1  0.2048     0.7442 0.928 0.000 0.008 0.064
#> GSM11727     1  0.6878     0.1231 0.472 0.424 0.000 0.104
#> GSM11838     2  0.5292     0.6420 0.208 0.728 0.000 0.064
#> GSM11681     1  0.3626     0.6882 0.812 0.000 0.004 0.184
#> GSM11689     1  0.2382     0.7446 0.912 0.004 0.004 0.080
#> GSM11704     1  0.2376     0.7438 0.916 0.016 0.000 0.068
#> GSM11703     1  0.4222     0.6275 0.728 0.000 0.000 0.272
#> GSM11705     1  0.3992     0.7199 0.800 0.004 0.008 0.188
#> GSM11722     1  0.6729     0.4731 0.588 0.284 0.000 0.128
#> GSM11730     1  0.5951     0.6344 0.696 0.152 0.000 0.152
#> GSM11713     1  0.5508     0.6945 0.692 0.056 0.000 0.252
#> GSM11728     1  0.5088     0.5176 0.572 0.000 0.004 0.424
#> GSM27947     4  0.6461     0.6448 0.240 0.000 0.128 0.632
#> GSM27951     1  0.2401     0.7398 0.904 0.000 0.004 0.092
#> GSM11707     3  0.1356     0.7746 0.032 0.000 0.960 0.008
#> GSM11716     3  0.5628     0.6123 0.080 0.216 0.704 0.000
#> GSM11850     3  0.5987     0.2206 0.040 0.440 0.520 0.000
#> GSM11851     3  0.5447     0.7148 0.048 0.052 0.776 0.124
#> GSM11721     4  0.6312     0.7319 0.080 0.052 0.148 0.720
#> GSM11852     4  0.5532     0.7175 0.068 0.000 0.228 0.704
#> GSM11694     3  0.4423     0.6894 0.176 0.000 0.788 0.036
#> GSM11695     3  0.5123     0.6317 0.232 0.000 0.724 0.044
#> GSM11734     2  0.3743     0.7899 0.160 0.824 0.000 0.016
#> GSM11861     4  0.6119     0.5407 0.272 0.052 0.016 0.660
#> GSM11843     2  0.4328     0.7068 0.244 0.748 0.000 0.008
#> GSM11862     4  0.5021     0.5736 0.240 0.000 0.036 0.724
#> GSM11697     3  0.4458     0.7144 0.116 0.000 0.808 0.076
#> GSM11714     3  0.5185     0.6710 0.176 0.000 0.748 0.076
#> GSM11723     2  0.1109     0.8062 0.028 0.968 0.000 0.004
#> GSM11845     2  0.3547     0.7548 0.144 0.840 0.000 0.016
#> GSM11683     1  0.6510     0.4313 0.524 0.004 0.064 0.408
#> GSM11691     1  0.4648     0.6962 0.748 0.004 0.016 0.232
#> GSM27949     3  0.0469     0.7769 0.012 0.000 0.988 0.000
#> GSM27945     3  0.7880    -0.1563 0.284 0.000 0.372 0.344
#> GSM11706     3  0.2281     0.7573 0.000 0.000 0.904 0.096
#> GSM11853     4  0.6483     0.4606 0.096 0.000 0.312 0.592
#> GSM11729     2  0.0592     0.8054 0.016 0.984 0.000 0.000
#> GSM11746     2  0.2888     0.7927 0.124 0.872 0.000 0.004
#> GSM11711     4  0.6309     0.5174 0.076 0.000 0.336 0.588
#> GSM11854     4  0.4814     0.5996 0.008 0.000 0.316 0.676
#> GSM11731     2  0.0336     0.8044 0.008 0.992 0.000 0.000
#> GSM11839     2  0.3320     0.8094 0.068 0.876 0.000 0.056
#> GSM11836     2  0.3278     0.7378 0.020 0.864 0.000 0.116
#> GSM11849     4  0.4470     0.5605 0.172 0.032 0.004 0.792
#> GSM11682     4  0.4535     0.7219 0.112 0.000 0.084 0.804
#> GSM11690     4  0.3935     0.7503 0.060 0.000 0.100 0.840
#> GSM11692     4  0.3317     0.7545 0.008 0.012 0.112 0.868
#> GSM11841     4  0.5512     0.5909 0.020 0.268 0.020 0.692
#> GSM11901     4  0.4932     0.6855 0.024 0.160 0.032 0.784
#> GSM11715     2  0.2335     0.8073 0.060 0.920 0.000 0.020
#> GSM11724     2  0.5383     0.7054 0.100 0.740 0.000 0.160
#> GSM11684     4  0.2859     0.6367 0.112 0.000 0.008 0.880
#> GSM11696     4  0.2345     0.6406 0.100 0.000 0.000 0.900
#> GSM27952     4  0.4776     0.7582 0.060 0.000 0.164 0.776
#> GSM27948     4  0.3013     0.7533 0.032 0.000 0.080 0.888

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     3  0.0290     0.8266 0.000 0.000 0.992 0.008 0.000
#> GSM11735     3  0.0290     0.8266 0.000 0.000 0.992 0.008 0.000
#> GSM11733     3  0.1978     0.8200 0.004 0.024 0.928 0.044 0.000
#> GSM11863     3  0.3936     0.7371 0.004 0.144 0.800 0.052 0.000
#> GSM11710     4  0.3544     0.7784 0.028 0.000 0.120 0.836 0.016
#> GSM11712     4  0.3435     0.7696 0.012 0.148 0.004 0.828 0.008
#> GSM11732     3  0.4456     0.6145 0.000 0.320 0.660 0.000 0.020
#> GSM11844     3  0.4143     0.7097 0.004 0.260 0.724 0.004 0.008
#> GSM11842     2  0.5041     0.2189 0.004 0.564 0.404 0.028 0.000
#> GSM11860     3  0.6183    -0.0643 0.404 0.088 0.492 0.016 0.000
#> GSM11686     4  0.4035     0.7557 0.220 0.000 0.008 0.756 0.016
#> GSM11688     4  0.4990     0.5657 0.048 0.000 0.324 0.628 0.000
#> GSM11846     1  0.4286     0.6262 0.716 0.004 0.260 0.020 0.000
#> GSM11680     3  0.1869     0.8330 0.036 0.000 0.936 0.016 0.012
#> GSM11698     3  0.3896     0.8205 0.044 0.032 0.848 0.056 0.020
#> GSM11840     3  0.2125     0.8163 0.004 0.024 0.920 0.052 0.000
#> GSM11847     3  0.2166     0.8122 0.004 0.012 0.912 0.072 0.000
#> GSM11685     4  0.0740     0.8294 0.004 0.000 0.008 0.980 0.008
#> GSM11699     4  0.1630     0.8331 0.036 0.000 0.004 0.944 0.016
#> GSM27950     3  0.1106     0.8316 0.024 0.000 0.964 0.012 0.000
#> GSM27946     4  0.4237     0.6999 0.240 0.008 0.004 0.736 0.012
#> GSM11709     1  0.4779     0.7073 0.748 0.008 0.124 0.000 0.120
#> GSM11720     1  0.4489     0.7351 0.780 0.028 0.008 0.028 0.156
#> GSM11726     5  0.3457     0.7132 0.048 0.084 0.016 0.000 0.852
#> GSM11837     2  0.4101     0.4532 0.000 0.628 0.000 0.000 0.372
#> GSM11725     2  0.5706     0.2629 0.380 0.540 0.004 0.000 0.076
#> GSM11864     1  0.6271     0.1473 0.480 0.384 0.004 0.000 0.132
#> GSM11687     1  0.2722     0.7625 0.868 0.008 0.000 0.004 0.120
#> GSM11693     1  0.2326     0.7730 0.908 0.012 0.004 0.004 0.072
#> GSM11727     5  0.2574     0.6940 0.012 0.112 0.000 0.000 0.876
#> GSM11838     5  0.3838     0.4952 0.004 0.280 0.000 0.000 0.716
#> GSM11681     1  0.2964     0.7325 0.856 0.000 0.000 0.024 0.120
#> GSM11689     1  0.1205     0.7764 0.956 0.000 0.000 0.004 0.040
#> GSM11704     1  0.1365     0.7760 0.952 0.004 0.000 0.004 0.040
#> GSM11703     1  0.4521     0.7161 0.748 0.000 0.000 0.088 0.164
#> GSM11705     5  0.4995     0.2341 0.384 0.000 0.004 0.028 0.584
#> GSM11722     5  0.2514     0.7319 0.044 0.060 0.000 0.000 0.896
#> GSM11730     5  0.1800     0.7396 0.048 0.020 0.000 0.000 0.932
#> GSM11713     5  0.2439     0.7316 0.120 0.000 0.000 0.004 0.876
#> GSM11728     5  0.3904     0.6987 0.156 0.000 0.000 0.052 0.792
#> GSM27947     1  0.3521     0.7136 0.824 0.000 0.024 0.144 0.008
#> GSM27951     1  0.2172     0.7739 0.908 0.000 0.000 0.016 0.076
#> GSM11707     3  0.0486     0.8272 0.004 0.000 0.988 0.004 0.004
#> GSM11716     3  0.5275     0.7399 0.096 0.156 0.724 0.004 0.020
#> GSM11850     3  0.5188     0.5931 0.036 0.320 0.632 0.004 0.008
#> GSM11851     3  0.5422     0.7779 0.060 0.104 0.752 0.064 0.020
#> GSM11721     4  0.3646     0.8046 0.036 0.032 0.000 0.844 0.088
#> GSM11852     4  0.4474     0.7977 0.056 0.012 0.052 0.812 0.068
#> GSM11694     3  0.4232     0.7750 0.152 0.040 0.788 0.000 0.020
#> GSM11695     3  0.4892     0.7327 0.208 0.044 0.724 0.000 0.024
#> GSM11734     2  0.3527     0.6648 0.024 0.804 0.000 0.000 0.172
#> GSM11861     4  0.6037     0.6436 0.240 0.092 0.000 0.632 0.036
#> GSM11843     2  0.4541     0.6171 0.140 0.760 0.004 0.000 0.096
#> GSM11862     4  0.5363     0.7261 0.156 0.040 0.000 0.720 0.084
#> GSM11697     3  0.4426     0.8015 0.080 0.040 0.816 0.020 0.044
#> GSM11714     3  0.4026     0.7925 0.080 0.012 0.820 0.004 0.084
#> GSM11723     2  0.2529     0.6945 0.032 0.904 0.004 0.004 0.056
#> GSM11845     2  0.3523     0.6613 0.076 0.844 0.008 0.000 0.072
#> GSM11683     5  0.5433     0.6554 0.120 0.020 0.080 0.036 0.744
#> GSM11691     5  0.4915     0.6752 0.144 0.028 0.036 0.024 0.768
#> GSM27949     3  0.0794     0.8296 0.028 0.000 0.972 0.000 0.000
#> GSM27945     1  0.3225     0.7422 0.880 0.052 0.012 0.032 0.024
#> GSM11706     3  0.2286     0.8063 0.004 0.000 0.888 0.108 0.000
#> GSM11853     1  0.4944     0.1246 0.508 0.004 0.012 0.472 0.004
#> GSM11729     2  0.2284     0.6936 0.000 0.896 0.004 0.004 0.096
#> GSM11746     2  0.4111     0.6727 0.084 0.796 0.004 0.000 0.116
#> GSM11711     4  0.5049    -0.0612 0.472 0.000 0.024 0.500 0.004
#> GSM11854     4  0.2196     0.8249 0.056 0.000 0.024 0.916 0.004
#> GSM11731     2  0.1908     0.6963 0.000 0.908 0.000 0.000 0.092
#> GSM11839     2  0.4712     0.6055 0.020 0.716 0.000 0.028 0.236
#> GSM11836     2  0.5730     0.3208 0.000 0.548 0.000 0.356 0.096
#> GSM11849     4  0.4672     0.7137 0.032 0.024 0.000 0.736 0.208
#> GSM11682     4  0.3340     0.8123 0.124 0.000 0.004 0.840 0.032
#> GSM11690     4  0.2074     0.8312 0.060 0.000 0.004 0.920 0.016
#> GSM11692     4  0.0324     0.8278 0.000 0.004 0.000 0.992 0.004
#> GSM11841     4  0.2411     0.8018 0.000 0.108 0.000 0.884 0.008
#> GSM11901     4  0.0798     0.8279 0.000 0.016 0.000 0.976 0.008
#> GSM11715     2  0.3274     0.6573 0.000 0.780 0.000 0.000 0.220
#> GSM11724     5  0.5049     0.0490 0.004 0.408 0.000 0.028 0.560
#> GSM11684     4  0.2966     0.7957 0.016 0.000 0.000 0.848 0.136
#> GSM11696     4  0.2727     0.8073 0.016 0.000 0.000 0.868 0.116
#> GSM27952     4  0.2452     0.8268 0.084 0.000 0.004 0.896 0.016
#> GSM27948     4  0.0703     0.8297 0.024 0.000 0.000 0.976 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     3  0.0551    0.64354 0.004 0.000 0.984 0.004 0.000 0.008
#> GSM11735     3  0.0665    0.64286 0.000 0.004 0.980 0.008 0.000 0.008
#> GSM11733     3  0.3467    0.58281 0.004 0.092 0.836 0.032 0.000 0.036
#> GSM11863     3  0.6672    0.08326 0.004 0.324 0.476 0.092 0.000 0.104
#> GSM11710     4  0.5259    0.60817 0.128 0.004 0.112 0.708 0.008 0.040
#> GSM11712     4  0.5409    0.59874 0.036 0.152 0.008 0.688 0.004 0.112
#> GSM11732     3  0.3975    0.54969 0.000 0.244 0.716 0.000 0.000 0.040
#> GSM11844     3  0.3744    0.59076 0.000 0.200 0.756 0.000 0.000 0.044
#> GSM11842     2  0.6722    0.16035 0.004 0.460 0.332 0.076 0.000 0.128
#> GSM11860     3  0.7695   -0.03186 0.308 0.180 0.392 0.032 0.004 0.084
#> GSM11686     4  0.4876    0.62378 0.220 0.000 0.024 0.696 0.012 0.048
#> GSM11688     4  0.5420    0.44622 0.120 0.000 0.296 0.576 0.000 0.008
#> GSM11846     1  0.4305    0.54976 0.724 0.000 0.216 0.048 0.004 0.008
#> GSM11680     3  0.4150    0.60488 0.012 0.000 0.740 0.048 0.000 0.200
#> GSM11698     3  0.4656    0.56639 0.008 0.000 0.668 0.064 0.000 0.260
#> GSM11840     3  0.5293    0.46451 0.004 0.120 0.692 0.136 0.000 0.048
#> GSM11847     3  0.4229    0.53790 0.004 0.056 0.776 0.132 0.000 0.032
#> GSM11685     4  0.1377    0.69937 0.004 0.000 0.024 0.952 0.004 0.016
#> GSM11699     4  0.4052    0.55483 0.012 0.000 0.004 0.692 0.008 0.284
#> GSM27950     3  0.2063    0.65399 0.020 0.000 0.912 0.008 0.000 0.060
#> GSM27946     4  0.4037    0.62748 0.200 0.000 0.000 0.736 0.000 0.064
#> GSM11709     1  0.3963    0.66543 0.748 0.000 0.016 0.000 0.208 0.028
#> GSM11720     1  0.3894    0.68646 0.776 0.008 0.000 0.000 0.152 0.064
#> GSM11726     5  0.3364    0.65682 0.024 0.104 0.020 0.000 0.840 0.012
#> GSM11837     2  0.4720    0.20529 0.000 0.560 0.000 0.000 0.388 0.052
#> GSM11725     2  0.5058    0.12790 0.400 0.540 0.000 0.000 0.020 0.040
#> GSM11864     1  0.6912    0.14791 0.416 0.336 0.000 0.000 0.088 0.160
#> GSM11687     1  0.3473    0.68201 0.780 0.000 0.000 0.004 0.192 0.024
#> GSM11693     1  0.3663    0.66350 0.784 0.000 0.000 0.000 0.068 0.148
#> GSM11727     5  0.2234    0.65586 0.000 0.124 0.000 0.000 0.872 0.004
#> GSM11838     5  0.4712    0.14409 0.000 0.384 0.000 0.000 0.564 0.052
#> GSM11681     1  0.3223    0.65535 0.836 0.000 0.000 0.008 0.104 0.052
#> GSM11689     1  0.2145    0.69058 0.900 0.000 0.000 0.000 0.028 0.072
#> GSM11704     1  0.2795    0.68646 0.856 0.000 0.000 0.000 0.044 0.100
#> GSM11703     1  0.6758    0.15444 0.356 0.000 0.000 0.036 0.316 0.292
#> GSM11705     5  0.4089    0.15658 0.352 0.000 0.000 0.004 0.632 0.012
#> GSM11722     5  0.1493    0.68781 0.004 0.056 0.000 0.000 0.936 0.004
#> GSM11730     5  0.0984    0.68891 0.012 0.012 0.000 0.000 0.968 0.008
#> GSM11713     5  0.2563    0.66090 0.040 0.000 0.000 0.008 0.884 0.068
#> GSM11728     5  0.5213    0.51185 0.160 0.000 0.000 0.036 0.680 0.124
#> GSM27947     1  0.4452    0.59625 0.764 0.000 0.036 0.120 0.004 0.076
#> GSM27951     1  0.2261    0.70866 0.884 0.000 0.000 0.004 0.104 0.008
#> GSM11707     3  0.0820    0.64173 0.012 0.000 0.972 0.000 0.016 0.000
#> GSM11716     3  0.5154    0.53508 0.008 0.080 0.632 0.008 0.000 0.272
#> GSM11850     3  0.5484    0.42524 0.000 0.148 0.568 0.004 0.000 0.280
#> GSM11851     3  0.4809    0.56152 0.000 0.024 0.668 0.052 0.000 0.256
#> GSM11721     4  0.4726    0.66927 0.036 0.028 0.008 0.776 0.072 0.080
#> GSM11852     4  0.4365    0.64186 0.044 0.000 0.020 0.788 0.052 0.096
#> GSM11694     3  0.4893    0.54747 0.040 0.008 0.668 0.004 0.016 0.264
#> GSM11695     3  0.5081    0.50480 0.036 0.004 0.624 0.024 0.004 0.308
#> GSM11734     2  0.5453    0.08083 0.000 0.464 0.000 0.004 0.104 0.428
#> GSM11861     6  0.5199    0.17703 0.032 0.040 0.000 0.368 0.000 0.560
#> GSM11843     2  0.5653    0.03199 0.048 0.520 0.004 0.000 0.044 0.384
#> GSM11862     4  0.5846    0.23840 0.064 0.004 0.000 0.548 0.052 0.332
#> GSM11697     3  0.4788    0.52911 0.020 0.000 0.640 0.020 0.012 0.308
#> GSM11714     3  0.4952    0.55175 0.036 0.000 0.708 0.000 0.148 0.108
#> GSM11723     6  0.5323   -0.00852 0.000 0.460 0.044 0.008 0.016 0.472
#> GSM11845     6  0.4294    0.26900 0.004 0.304 0.008 0.008 0.008 0.668
#> GSM11683     6  0.7352    0.27336 0.036 0.000 0.216 0.048 0.280 0.420
#> GSM11691     6  0.6043    0.44137 0.032 0.000 0.096 0.056 0.172 0.644
#> GSM27949     3  0.1531    0.65369 0.004 0.000 0.928 0.000 0.000 0.068
#> GSM27945     6  0.5839    0.08505 0.384 0.012 0.020 0.080 0.000 0.504
#> GSM11706     3  0.5740    0.29467 0.160 0.000 0.580 0.244 0.004 0.012
#> GSM11853     1  0.4242    0.09889 0.536 0.000 0.000 0.448 0.000 0.016
#> GSM11729     2  0.1649    0.53085 0.000 0.932 0.000 0.000 0.036 0.032
#> GSM11746     2  0.4635    0.46963 0.148 0.712 0.000 0.000 0.132 0.008
#> GSM11711     4  0.4572    0.05855 0.460 0.000 0.016 0.512 0.000 0.012
#> GSM11854     4  0.2113    0.69833 0.044 0.000 0.028 0.916 0.004 0.008
#> GSM11731     2  0.1261    0.52463 0.000 0.952 0.000 0.000 0.024 0.024
#> GSM11839     2  0.6080    0.39635 0.012 0.584 0.000 0.032 0.236 0.136
#> GSM11836     2  0.5647    0.34147 0.000 0.596 0.004 0.288 0.056 0.056
#> GSM11849     4  0.4291    0.57253 0.020 0.020 0.000 0.708 0.248 0.004
#> GSM11682     4  0.3920    0.66889 0.136 0.000 0.000 0.788 0.024 0.052
#> GSM11690     4  0.2471    0.69629 0.056 0.000 0.000 0.888 0.004 0.052
#> GSM11692     4  0.3016    0.67199 0.000 0.016 0.000 0.836 0.012 0.136
#> GSM11841     4  0.4979    0.56642 0.000 0.164 0.000 0.672 0.008 0.156
#> GSM11901     4  0.4436    0.62173 0.000 0.080 0.000 0.728 0.012 0.180
#> GSM11715     2  0.4380    0.39561 0.000 0.700 0.000 0.000 0.220 0.080
#> GSM11724     5  0.6255    0.33394 0.000 0.292 0.000 0.040 0.512 0.156
#> GSM11684     4  0.5804    0.41333 0.012 0.000 0.000 0.552 0.252 0.184
#> GSM11696     4  0.5292    0.47764 0.000 0.000 0.000 0.600 0.180 0.220
#> GSM27952     4  0.2948    0.69171 0.144 0.000 0.008 0.836 0.004 0.008
#> GSM27948     4  0.0914    0.69899 0.016 0.000 0.000 0.968 0.000 0.016

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-CV-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-CV-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-CV-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-CV-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-CV-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-CV-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-CV-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-CV-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-CV-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-CV-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-CV-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-CV-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-CV-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-CV-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-CV-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-CV-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-CV-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-CV-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-CV-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-CV-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-NMF-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>         n cell.line(p) agent(p)  time(p) k
#> CV:NMF 79     5.42e-07   0.4410 4.91e-03 2
#> CV:NMF 74     1.38e-06   0.0537 1.40e-03 3
#> CV:NMF 72     1.02e-11   0.6430 2.74e-06 4
#> CV:NMF 72     1.83e-11   0.1116 5.84e-07 5
#> CV:NMF 52     1.16e-10   0.3268 2.60e-05 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:hclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "hclust"]
# you can also extract it by
# res = res_list["MAD:hclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-hclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-hclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.250           0.768       0.854         0.4234 0.584   0.584
#> 3 3 0.260           0.684       0.771         0.2362 0.960   0.932
#> 4 4 0.299           0.648       0.730         0.2353 0.781   0.616
#> 5 5 0.449           0.615       0.734         0.0833 0.957   0.888
#> 6 6 0.614           0.598       0.737         0.1061 0.855   0.593

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     2   0.000      0.847 0.000 1.000
#> GSM11735     2   0.000      0.847 0.000 1.000
#> GSM11733     2   0.730      0.732 0.204 0.796
#> GSM11863     2   0.730      0.732 0.204 0.796
#> GSM11710     2   0.141      0.853 0.020 0.980
#> GSM11712     1   0.625      0.833 0.844 0.156
#> GSM11732     2   0.943      0.476 0.360 0.640
#> GSM11844     2   0.961      0.412 0.384 0.616
#> GSM11842     1   0.913      0.645 0.672 0.328
#> GSM11860     1   0.913      0.645 0.672 0.328
#> GSM11686     2   0.311      0.835 0.056 0.944
#> GSM11688     2   0.141      0.853 0.020 0.980
#> GSM11846     1   0.929      0.632 0.656 0.344
#> GSM11680     1   0.855      0.754 0.720 0.280
#> GSM11698     1   0.861      0.749 0.716 0.284
#> GSM11840     2   0.730      0.732 0.204 0.796
#> GSM11847     2   0.730      0.732 0.204 0.796
#> GSM11685     2   0.141      0.853 0.020 0.980
#> GSM11699     1   0.781      0.797 0.768 0.232
#> GSM27950     2   0.416      0.824 0.084 0.916
#> GSM27946     1   0.775      0.791 0.772 0.228
#> GSM11709     1   0.861      0.697 0.716 0.284
#> GSM11720     1   0.000      0.820 1.000 0.000
#> GSM11726     1   0.000      0.820 1.000 0.000
#> GSM11837     1   0.000      0.820 1.000 0.000
#> GSM11725     1   0.000      0.820 1.000 0.000
#> GSM11864     1   0.000      0.820 1.000 0.000
#> GSM11687     1   0.775      0.756 0.772 0.228
#> GSM11693     1   0.775      0.756 0.772 0.228
#> GSM11727     1   0.000      0.820 1.000 0.000
#> GSM11838     1   0.000      0.820 1.000 0.000
#> GSM11681     2   0.141      0.853 0.020 0.980
#> GSM11689     1   0.775      0.756 0.772 0.228
#> GSM11704     1   0.775      0.756 0.772 0.228
#> GSM11703     1   0.714      0.812 0.804 0.196
#> GSM11705     1   0.745      0.802 0.788 0.212
#> GSM11722     1   0.000      0.820 1.000 0.000
#> GSM11730     1   0.000      0.820 1.000 0.000
#> GSM11713     2   0.141      0.853 0.020 0.980
#> GSM11728     2   0.141      0.853 0.020 0.980
#> GSM27947     1   0.775      0.791 0.772 0.228
#> GSM27951     1   0.991      0.407 0.556 0.444
#> GSM11707     2   0.000      0.847 0.000 1.000
#> GSM11716     1   0.343      0.826 0.936 0.064
#> GSM11850     1   0.949      0.525 0.632 0.368
#> GSM11851     1   0.949      0.525 0.632 0.368
#> GSM11721     1   0.634      0.832 0.840 0.160
#> GSM11852     1   0.634      0.832 0.840 0.160
#> GSM11694     1   0.821      0.756 0.744 0.256
#> GSM11695     1   0.821      0.756 0.744 0.256
#> GSM11734     1   0.000      0.820 1.000 0.000
#> GSM11861     1   0.644      0.832 0.836 0.164
#> GSM11843     1   0.000      0.820 1.000 0.000
#> GSM11862     1   0.634      0.832 0.840 0.160
#> GSM11697     1   0.833      0.758 0.736 0.264
#> GSM11714     2   0.000      0.847 0.000 1.000
#> GSM11723     1   0.327      0.825 0.940 0.060
#> GSM11845     1   0.327      0.825 0.940 0.060
#> GSM11683     2   0.952      0.229 0.372 0.628
#> GSM11691     2   0.961      0.184 0.384 0.616
#> GSM27949     2   0.653      0.772 0.168 0.832
#> GSM27945     1   0.821      0.756 0.744 0.256
#> GSM11706     2   0.000      0.847 0.000 1.000
#> GSM11853     1   0.775      0.795 0.772 0.228
#> GSM11729     1   0.000      0.820 1.000 0.000
#> GSM11746     1   0.000      0.820 1.000 0.000
#> GSM11711     1   0.839      0.760 0.732 0.268
#> GSM11854     1   0.775      0.795 0.772 0.228
#> GSM11731     1   0.000      0.820 1.000 0.000
#> GSM11839     1   0.000      0.820 1.000 0.000
#> GSM11836     1   0.653      0.833 0.832 0.168
#> GSM11849     1   0.653      0.833 0.832 0.168
#> GSM11682     2   0.141      0.853 0.020 0.980
#> GSM11690     1   0.625      0.834 0.844 0.156
#> GSM11692     1   0.625      0.833 0.844 0.156
#> GSM11841     1   0.625      0.833 0.844 0.156
#> GSM11901     1   0.625      0.833 0.844 0.156
#> GSM11715     1   0.204      0.822 0.968 0.032
#> GSM11724     1   0.204      0.822 0.968 0.032
#> GSM11684     1   0.625      0.834 0.844 0.156
#> GSM11696     1   0.625      0.834 0.844 0.156
#> GSM27952     2   0.141      0.853 0.020 0.980
#> GSM27948     1   0.625      0.834 0.844 0.156

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3   0.327      0.517 0.000 0.116 0.884
#> GSM11735     3   0.327      0.517 0.000 0.116 0.884
#> GSM11733     3   0.433      0.648 0.100 0.036 0.864
#> GSM11863     3   0.433      0.648 0.100 0.036 0.864
#> GSM11710     2   0.784      0.845 0.072 0.600 0.328
#> GSM11712     1   0.321      0.775 0.904 0.084 0.012
#> GSM11732     3   0.554      0.552 0.252 0.008 0.740
#> GSM11844     3   0.626      0.519 0.284 0.020 0.696
#> GSM11842     1   0.754      0.552 0.632 0.064 0.304
#> GSM11860     1   0.754      0.552 0.632 0.064 0.304
#> GSM11686     2   0.821      0.838 0.104 0.600 0.296
#> GSM11688     2   0.759      0.889 0.072 0.640 0.288
#> GSM11846     1   0.759      0.544 0.624 0.064 0.312
#> GSM11680     1   0.710      0.672 0.692 0.068 0.240
#> GSM11698     1   0.714      0.677 0.700 0.080 0.220
#> GSM11840     3   0.433      0.648 0.100 0.036 0.864
#> GSM11847     3   0.433      0.648 0.100 0.036 0.864
#> GSM11685     2   0.764      0.883 0.072 0.632 0.296
#> GSM11699     1   0.641      0.723 0.756 0.072 0.172
#> GSM27950     3   0.641      0.487 0.080 0.160 0.760
#> GSM27946     1   0.648      0.682 0.716 0.040 0.244
#> GSM11709     1   0.642      0.684 0.752 0.180 0.068
#> GSM11720     1   0.482      0.763 0.848 0.088 0.064
#> GSM11726     1   0.414      0.752 0.860 0.124 0.016
#> GSM11837     1   0.414      0.752 0.860 0.124 0.016
#> GSM11725     1   0.482      0.763 0.848 0.088 0.064
#> GSM11864     1   0.482      0.763 0.848 0.088 0.064
#> GSM11687     1   0.504      0.726 0.808 0.172 0.020
#> GSM11693     1   0.504      0.726 0.808 0.172 0.020
#> GSM11727     1   0.334      0.754 0.880 0.120 0.000
#> GSM11838     1   0.334      0.754 0.880 0.120 0.000
#> GSM11681     2   0.756      0.891 0.072 0.644 0.284
#> GSM11689     1   0.504      0.726 0.808 0.172 0.020
#> GSM11704     1   0.504      0.726 0.808 0.172 0.020
#> GSM11703     1   0.585      0.731 0.780 0.048 0.172
#> GSM11705     1   0.611      0.719 0.760 0.048 0.192
#> GSM11722     1   0.327      0.755 0.884 0.116 0.000
#> GSM11730     1   0.334      0.754 0.880 0.120 0.000
#> GSM11713     2   0.447      0.723 0.076 0.864 0.060
#> GSM11728     2   0.447      0.723 0.076 0.864 0.060
#> GSM27947     1   0.648      0.682 0.716 0.040 0.244
#> GSM27951     1   0.740      0.493 0.612 0.340 0.048
#> GSM11707     3   0.327      0.517 0.000 0.116 0.884
#> GSM11716     1   0.628      0.729 0.760 0.064 0.176
#> GSM11850     1   0.681      0.236 0.520 0.012 0.468
#> GSM11851     1   0.681      0.236 0.520 0.012 0.468
#> GSM11721     1   0.329      0.773 0.900 0.088 0.012
#> GSM11852     1   0.329      0.773 0.900 0.088 0.012
#> GSM11694     1   0.714      0.606 0.644 0.044 0.312
#> GSM11695     1   0.714      0.606 0.644 0.044 0.312
#> GSM11734     1   0.355      0.749 0.868 0.132 0.000
#> GSM11861     1   0.397      0.773 0.880 0.088 0.032
#> GSM11843     1   0.375      0.756 0.872 0.120 0.008
#> GSM11862     1   0.372      0.774 0.888 0.088 0.024
#> GSM11697     1   0.700      0.635 0.672 0.048 0.280
#> GSM11714     3   0.362      0.486 0.000 0.136 0.864
#> GSM11723     1   0.623      0.731 0.764 0.064 0.172
#> GSM11845     1   0.623      0.731 0.764 0.064 0.172
#> GSM11683     3   0.963      0.203 0.340 0.216 0.444
#> GSM11691     3   0.955      0.166 0.352 0.200 0.448
#> GSM27949     3   0.603      0.605 0.116 0.096 0.788
#> GSM27945     1   0.714      0.606 0.644 0.044 0.312
#> GSM11706     3   0.327      0.517 0.000 0.116 0.884
#> GSM11853     1   0.630      0.716 0.756 0.060 0.184
#> GSM11729     1   0.421      0.751 0.856 0.128 0.016
#> GSM11746     1   0.421      0.751 0.856 0.128 0.016
#> GSM11711     1   0.685      0.682 0.712 0.064 0.224
#> GSM11854     1   0.630      0.716 0.756 0.060 0.184
#> GSM11731     1   0.355      0.749 0.868 0.132 0.000
#> GSM11839     1   0.355      0.749 0.868 0.132 0.000
#> GSM11836     1   0.354      0.773 0.888 0.100 0.012
#> GSM11849     1   0.354      0.773 0.888 0.100 0.012
#> GSM11682     2   0.756      0.891 0.072 0.644 0.284
#> GSM11690     1   0.329      0.774 0.900 0.088 0.012
#> GSM11692     1   0.321      0.775 0.904 0.084 0.012
#> GSM11841     1   0.321      0.775 0.904 0.084 0.012
#> GSM11901     1   0.321      0.775 0.904 0.084 0.012
#> GSM11715     1   0.362      0.753 0.864 0.136 0.000
#> GSM11724     1   0.362      0.753 0.864 0.136 0.000
#> GSM11684     1   0.329      0.774 0.900 0.088 0.012
#> GSM11696     1   0.329      0.774 0.900 0.088 0.012
#> GSM27952     2   0.756      0.891 0.072 0.644 0.284
#> GSM27948     1   0.329      0.774 0.900 0.088 0.012

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3   0.162      0.614 0.028 0.020 0.952 0.000
#> GSM11735     3   0.162      0.614 0.028 0.020 0.952 0.000
#> GSM11733     3   0.557      0.700 0.008 0.044 0.700 0.248
#> GSM11863     3   0.557      0.700 0.008 0.044 0.700 0.248
#> GSM11710     1   0.657      0.830 0.604 0.000 0.280 0.116
#> GSM11712     4   0.334      0.650 0.016 0.128 0.000 0.856
#> GSM11732     3   0.701      0.580 0.008 0.124 0.580 0.288
#> GSM11844     3   0.720      0.517 0.016 0.100 0.536 0.348
#> GSM11842     4   0.599      0.560 0.012 0.084 0.200 0.704
#> GSM11860     4   0.599      0.560 0.012 0.084 0.200 0.704
#> GSM11686     1   0.675      0.828 0.604 0.000 0.244 0.152
#> GSM11688     1   0.632      0.872 0.644 0.000 0.240 0.116
#> GSM11846     4   0.536      0.572 0.012 0.048 0.200 0.740
#> GSM11680     4   0.412      0.660 0.004 0.048 0.116 0.832
#> GSM11698     4   0.349      0.675 0.012 0.020 0.100 0.868
#> GSM11840     3   0.557      0.700 0.008 0.044 0.700 0.248
#> GSM11847     3   0.557      0.700 0.008 0.044 0.700 0.248
#> GSM11685     1   0.637      0.868 0.636 0.000 0.248 0.116
#> GSM11699     4   0.283      0.689 0.004 0.032 0.060 0.904
#> GSM27950     3   0.625      0.533 0.120 0.016 0.700 0.164
#> GSM27946     4   0.464      0.668 0.004 0.076 0.116 0.804
#> GSM11709     4   0.701      0.616 0.184 0.108 0.048 0.660
#> GSM11720     4   0.581      0.353 0.012 0.460 0.012 0.516
#> GSM11726     2   0.435      0.888 0.000 0.756 0.012 0.232
#> GSM11837     2   0.435      0.888 0.000 0.756 0.012 0.232
#> GSM11725     4   0.581      0.353 0.012 0.460 0.012 0.516
#> GSM11864     4   0.581      0.353 0.012 0.460 0.012 0.516
#> GSM11687     4   0.572      0.609 0.176 0.112 0.000 0.712
#> GSM11693     4   0.572      0.609 0.176 0.112 0.000 0.712
#> GSM11727     2   0.417      0.894 0.012 0.776 0.000 0.212
#> GSM11838     2   0.417      0.894 0.012 0.776 0.000 0.212
#> GSM11681     1   0.626      0.875 0.652 0.000 0.232 0.116
#> GSM11689     4   0.572      0.609 0.176 0.112 0.000 0.712
#> GSM11704     4   0.572      0.609 0.176 0.112 0.000 0.712
#> GSM11703     4   0.385      0.687 0.012 0.060 0.068 0.860
#> GSM11705     4   0.440      0.686 0.016 0.068 0.084 0.832
#> GSM11722     2   0.410      0.896 0.012 0.784 0.000 0.204
#> GSM11730     2   0.417      0.894 0.012 0.776 0.000 0.212
#> GSM11713     1   0.172      0.675 0.944 0.008 0.000 0.048
#> GSM11728     1   0.172      0.675 0.944 0.008 0.000 0.048
#> GSM27947     4   0.464      0.668 0.004 0.076 0.116 0.804
#> GSM27951     4   0.585      0.420 0.356 0.044 0.000 0.600
#> GSM11707     3   0.162      0.614 0.028 0.020 0.952 0.000
#> GSM11716     4   0.635      0.430 0.016 0.396 0.036 0.552
#> GSM11850     4   0.747      0.282 0.016 0.136 0.312 0.536
#> GSM11851     4   0.747      0.282 0.016 0.136 0.312 0.536
#> GSM11721     4   0.328      0.650 0.016 0.124 0.000 0.860
#> GSM11852     4   0.328      0.650 0.016 0.124 0.000 0.860
#> GSM11694     4   0.694      0.497 0.008 0.212 0.164 0.616
#> GSM11695     4   0.694      0.497 0.008 0.212 0.164 0.616
#> GSM11734     2   0.215      0.825 0.000 0.912 0.000 0.088
#> GSM11861     4   0.339      0.665 0.016 0.132 0.000 0.852
#> GSM11843     2   0.344      0.726 0.000 0.816 0.000 0.184
#> GSM11862     4   0.328      0.659 0.016 0.124 0.000 0.860
#> GSM11697     4   0.494      0.626 0.004 0.072 0.144 0.780
#> GSM11714     3   0.217      0.586 0.052 0.020 0.928 0.000
#> GSM11723     4   0.626      0.428 0.012 0.400 0.036 0.552
#> GSM11845     4   0.626      0.428 0.012 0.400 0.036 0.552
#> GSM11683     4   0.781      0.106 0.164 0.016 0.344 0.476
#> GSM11691     4   0.788      0.117 0.148 0.024 0.348 0.480
#> GSM27949     3   0.649      0.653 0.080 0.052 0.704 0.164
#> GSM27945     4   0.694      0.497 0.008 0.212 0.164 0.616
#> GSM11706     3   0.162      0.614 0.028 0.020 0.952 0.000
#> GSM11853     4   0.333      0.688 0.008 0.044 0.064 0.884
#> GSM11729     2   0.425      0.889 0.000 0.768 0.012 0.220
#> GSM11746     2   0.425      0.889 0.000 0.768 0.012 0.220
#> GSM11711     4   0.415      0.677 0.012 0.048 0.100 0.840
#> GSM11854     4   0.333      0.688 0.008 0.044 0.064 0.884
#> GSM11731     2   0.222      0.830 0.000 0.908 0.000 0.092
#> GSM11839     2   0.222      0.830 0.000 0.908 0.000 0.092
#> GSM11836     4   0.448      0.624 0.052 0.152 0.000 0.796
#> GSM11849     4   0.448      0.624 0.052 0.152 0.000 0.796
#> GSM11682     1   0.626      0.875 0.652 0.000 0.232 0.116
#> GSM11690     4   0.376      0.640 0.024 0.144 0.000 0.832
#> GSM11692     4   0.334      0.650 0.016 0.128 0.000 0.856
#> GSM11841     4   0.334      0.650 0.016 0.128 0.000 0.856
#> GSM11901     4   0.334      0.650 0.016 0.128 0.000 0.856
#> GSM11715     2   0.506      0.873 0.044 0.732 0.000 0.224
#> GSM11724     2   0.506      0.873 0.044 0.732 0.000 0.224
#> GSM11684     4   0.376      0.640 0.024 0.144 0.000 0.832
#> GSM11696     4   0.376      0.640 0.024 0.144 0.000 0.832
#> GSM27952     1   0.626      0.875 0.652 0.000 0.232 0.116
#> GSM27948     4   0.376      0.640 0.024 0.144 0.000 0.832

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     3   0.463     0.9862 0.188 0.000 0.732 0.000 0.080
#> GSM11735     3   0.463     0.9862 0.188 0.000 0.732 0.000 0.080
#> GSM11733     5   0.351     0.6499 0.036 0.000 0.040 0.068 0.856
#> GSM11863     5   0.351     0.6499 0.036 0.000 0.040 0.068 0.856
#> GSM11710     1   0.327     0.8314 0.852 0.000 0.044 0.100 0.004
#> GSM11712     4   0.127     0.6592 0.000 0.052 0.000 0.948 0.000
#> GSM11732     5   0.345     0.6366 0.000 0.016 0.012 0.144 0.828
#> GSM11844     5   0.418     0.5999 0.008 0.008 0.016 0.204 0.764
#> GSM11842     4   0.544     0.4289 0.000 0.036 0.032 0.640 0.292
#> GSM11860     4   0.544     0.4289 0.000 0.036 0.032 0.640 0.292
#> GSM11686     1   0.302     0.8144 0.848 0.000 0.004 0.136 0.012
#> GSM11688     1   0.230     0.8639 0.892 0.000 0.008 0.100 0.000
#> GSM11846     4   0.458     0.4509 0.000 0.000 0.032 0.672 0.296
#> GSM11680     4   0.448     0.5720 0.008 0.016 0.008 0.724 0.244
#> GSM11698     4   0.400     0.5951 0.012 0.004 0.008 0.768 0.208
#> GSM11840     5   0.351     0.6499 0.036 0.000 0.040 0.068 0.856
#> GSM11847     5   0.351     0.6499 0.036 0.000 0.040 0.068 0.856
#> GSM11685     1   0.257     0.8613 0.884 0.000 0.012 0.100 0.004
#> GSM11699     4   0.321     0.6289 0.004 0.008 0.000 0.824 0.164
#> GSM27950     5   0.761     0.1928 0.152 0.000 0.236 0.116 0.496
#> GSM27946     4   0.424     0.5733 0.004 0.016 0.000 0.712 0.268
#> GSM11709     4   0.623     0.5603 0.128 0.024 0.028 0.672 0.148
#> GSM11720     4   0.727     0.2981 0.000 0.368 0.048 0.424 0.160
#> GSM11726     2   0.298     0.8786 0.000 0.860 0.000 0.108 0.032
#> GSM11837     2   0.298     0.8786 0.000 0.860 0.000 0.108 0.032
#> GSM11725     4   0.728     0.2935 0.000 0.372 0.048 0.420 0.160
#> GSM11864     4   0.728     0.2935 0.000 0.372 0.048 0.420 0.160
#> GSM11687     4   0.547     0.5917 0.120 0.028 0.024 0.740 0.088
#> GSM11693     4   0.547     0.5917 0.120 0.028 0.024 0.740 0.088
#> GSM11727     2   0.230     0.8770 0.008 0.892 0.000 0.100 0.000
#> GSM11838     2   0.230     0.8770 0.008 0.892 0.000 0.100 0.000
#> GSM11681     1   0.202     0.8665 0.900 0.000 0.000 0.100 0.000
#> GSM11689     4   0.547     0.5917 0.120 0.028 0.024 0.740 0.088
#> GSM11704     4   0.547     0.5917 0.120 0.028 0.024 0.740 0.088
#> GSM11703     4   0.400     0.6150 0.004 0.016 0.000 0.748 0.232
#> GSM11705     4   0.438     0.5996 0.008 0.020 0.000 0.716 0.256
#> GSM11722     2   0.317     0.8664 0.008 0.836 0.008 0.148 0.000
#> GSM11730     2   0.230     0.8770 0.008 0.892 0.000 0.100 0.000
#> GSM11713     1   0.477     0.6040 0.728 0.008 0.216 0.008 0.040
#> GSM11728     1   0.477     0.6040 0.728 0.008 0.216 0.008 0.040
#> GSM27947     4   0.424     0.5733 0.004 0.016 0.000 0.712 0.268
#> GSM27951     4   0.574     0.4397 0.256 0.008 0.072 0.648 0.016
#> GSM11707     3   0.463     0.9862 0.188 0.000 0.732 0.000 0.080
#> GSM11716     4   0.762     0.2487 0.000 0.260 0.052 0.408 0.280
#> GSM11850     5   0.492    -0.0238 0.000 0.024 0.004 0.384 0.588
#> GSM11851     5   0.492    -0.0238 0.000 0.024 0.004 0.384 0.588
#> GSM11721     4   0.120     0.6585 0.000 0.048 0.000 0.952 0.000
#> GSM11852     4   0.120     0.6585 0.000 0.048 0.000 0.952 0.000
#> GSM11694     4   0.680     0.2995 0.004 0.104 0.036 0.488 0.368
#> GSM11695     4   0.680     0.2995 0.004 0.104 0.036 0.488 0.368
#> GSM11734     2   0.284     0.8205 0.000 0.892 0.048 0.036 0.024
#> GSM11861     4   0.213     0.6622 0.000 0.052 0.004 0.920 0.024
#> GSM11843     2   0.455     0.7212 0.000 0.776 0.048 0.144 0.032
#> GSM11862     4   0.167     0.6612 0.000 0.052 0.000 0.936 0.012
#> GSM11697     4   0.449     0.5101 0.004 0.004 0.008 0.660 0.324
#> GSM11714     3   0.449     0.9429 0.224 0.000 0.724 0.000 0.052
#> GSM11723     4   0.762     0.2518 0.000 0.264 0.052 0.408 0.276
#> GSM11845     4   0.762     0.2518 0.000 0.264 0.052 0.408 0.276
#> GSM11683     4   0.698    -0.0600 0.172 0.000 0.024 0.420 0.384
#> GSM11691     4   0.697    -0.0559 0.156 0.000 0.028 0.420 0.396
#> GSM27949     5   0.648     0.4122 0.068 0.000 0.224 0.096 0.612
#> GSM27945     4   0.680     0.2995 0.004 0.104 0.036 0.488 0.368
#> GSM11706     3   0.463     0.9862 0.188 0.000 0.732 0.000 0.080
#> GSM11853     4   0.358     0.6157 0.008 0.004 0.000 0.784 0.204
#> GSM11729     2   0.298     0.8776 0.000 0.864 0.000 0.096 0.040
#> GSM11746     2   0.298     0.8776 0.000 0.864 0.000 0.096 0.040
#> GSM11711     4   0.414     0.5896 0.012 0.004 0.004 0.736 0.244
#> GSM11854     4   0.358     0.6157 0.008 0.004 0.000 0.784 0.204
#> GSM11731     2   0.299     0.8284 0.000 0.884 0.048 0.044 0.024
#> GSM11839     2   0.299     0.8284 0.000 0.884 0.048 0.044 0.024
#> GSM11836     4   0.304     0.6374 0.040 0.100 0.000 0.860 0.000
#> GSM11849     4   0.298     0.6382 0.040 0.096 0.000 0.864 0.000
#> GSM11682     1   0.202     0.8665 0.900 0.000 0.000 0.100 0.000
#> GSM11690     4   0.207     0.6532 0.012 0.076 0.000 0.912 0.000
#> GSM11692     4   0.127     0.6592 0.000 0.052 0.000 0.948 0.000
#> GSM11841     4   0.127     0.6592 0.000 0.052 0.000 0.948 0.000
#> GSM11901     4   0.127     0.6592 0.000 0.052 0.000 0.948 0.000
#> GSM11715     2   0.419     0.7968 0.040 0.748 0.000 0.212 0.000
#> GSM11724     2   0.419     0.7968 0.040 0.748 0.000 0.212 0.000
#> GSM11684     4   0.207     0.6532 0.012 0.076 0.000 0.912 0.000
#> GSM11696     4   0.207     0.6532 0.012 0.076 0.000 0.912 0.000
#> GSM27952     1   0.202     0.8665 0.900 0.000 0.000 0.100 0.000
#> GSM27948     4   0.207     0.6532 0.012 0.076 0.000 0.912 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     5  0.3385    0.98428 0.000 0.000 0.032 0.000 0.788 0.180
#> GSM11735     5  0.3385    0.98428 0.000 0.000 0.032 0.000 0.788 0.180
#> GSM11733     3  0.2013    0.68730 0.008 0.000 0.908 0.000 0.008 0.076
#> GSM11863     3  0.2013    0.68730 0.008 0.000 0.908 0.000 0.008 0.076
#> GSM11710     6  0.1780    0.80990 0.000 0.000 0.000 0.028 0.048 0.924
#> GSM11712     4  0.0713    0.69592 0.000 0.028 0.000 0.972 0.000 0.000
#> GSM11732     3  0.3314    0.48181 0.256 0.000 0.740 0.004 0.000 0.000
#> GSM11844     3  0.4497    0.46533 0.232 0.000 0.696 0.064 0.000 0.008
#> GSM11842     4  0.5613    0.41627 0.064 0.036 0.300 0.592 0.008 0.000
#> GSM11860     4  0.5613    0.41627 0.064 0.036 0.300 0.592 0.008 0.000
#> GSM11686     6  0.1779    0.79630 0.000 0.000 0.016 0.064 0.000 0.920
#> GSM11688     6  0.0972    0.84288 0.000 0.000 0.000 0.028 0.008 0.964
#> GSM11846     4  0.4755    0.45947 0.056 0.000 0.304 0.632 0.008 0.000
#> GSM11680     4  0.5103    0.59953 0.120 0.000 0.200 0.664 0.000 0.016
#> GSM11698     4  0.4604    0.63271 0.084 0.000 0.184 0.716 0.000 0.016
#> GSM11840     3  0.2013    0.68730 0.008 0.000 0.908 0.000 0.008 0.076
#> GSM11847     3  0.2013    0.68730 0.008 0.000 0.908 0.000 0.008 0.076
#> GSM11685     6  0.1218    0.84004 0.000 0.000 0.004 0.028 0.012 0.956
#> GSM11699     4  0.3812    0.66293 0.072 0.000 0.132 0.788 0.000 0.008
#> GSM27950     3  0.6458    0.36047 0.008 0.000 0.540 0.044 0.212 0.196
#> GSM27946     4  0.5118    0.57595 0.132 0.004 0.208 0.652 0.000 0.004
#> GSM11709     1  0.6901    0.41475 0.472 0.032 0.048 0.364 0.024 0.060
#> GSM11720     1  0.3343    0.52175 0.824 0.128 0.016 0.032 0.000 0.000
#> GSM11726     2  0.1882    0.79732 0.060 0.920 0.008 0.012 0.000 0.000
#> GSM11837     2  0.1882    0.79732 0.060 0.920 0.008 0.012 0.000 0.000
#> GSM11725     1  0.3233    0.51799 0.828 0.132 0.016 0.024 0.000 0.000
#> GSM11864     1  0.3233    0.51799 0.828 0.132 0.016 0.024 0.000 0.000
#> GSM11687     1  0.5924    0.36970 0.456 0.032 0.000 0.440 0.020 0.052
#> GSM11693     1  0.5924    0.36970 0.456 0.032 0.000 0.440 0.020 0.052
#> GSM11727     2  0.0458    0.79441 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM11838     2  0.0458    0.79441 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM11681     6  0.0713    0.84574 0.000 0.000 0.000 0.028 0.000 0.972
#> GSM11689     1  0.5924    0.36970 0.456 0.032 0.000 0.440 0.020 0.052
#> GSM11704     1  0.5924    0.36970 0.456 0.032 0.000 0.440 0.020 0.052
#> GSM11703     4  0.6081    0.06956 0.364 0.016 0.144 0.472 0.000 0.004
#> GSM11705     4  0.6290    0.00559 0.376 0.016 0.160 0.440 0.000 0.008
#> GSM11722     2  0.2623    0.75430 0.016 0.852 0.000 0.132 0.000 0.000
#> GSM11730     2  0.0458    0.79441 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM11713     6  0.6888    0.52853 0.112 0.020 0.084 0.012 0.208 0.564
#> GSM11728     6  0.6888    0.52853 0.112 0.020 0.084 0.012 0.208 0.564
#> GSM27947     4  0.5118    0.57595 0.132 0.004 0.208 0.652 0.000 0.004
#> GSM27951     4  0.6337    0.40511 0.056 0.020 0.052 0.656 0.068 0.148
#> GSM11707     5  0.3385    0.98428 0.000 0.000 0.032 0.000 0.788 0.180
#> GSM11716     1  0.3015    0.51550 0.844 0.024 0.120 0.012 0.000 0.000
#> GSM11850     1  0.4045    0.13979 0.564 0.000 0.428 0.008 0.000 0.000
#> GSM11851     1  0.4045    0.13979 0.564 0.000 0.428 0.008 0.000 0.000
#> GSM11721     4  0.0632    0.69563 0.000 0.024 0.000 0.976 0.000 0.000
#> GSM11852     4  0.0632    0.69563 0.000 0.024 0.000 0.976 0.000 0.000
#> GSM11694     4  0.6190    0.20073 0.340 0.000 0.268 0.388 0.000 0.004
#> GSM11695     4  0.6190    0.20073 0.340 0.000 0.268 0.388 0.000 0.004
#> GSM11734     2  0.4274    0.67534 0.336 0.636 0.000 0.024 0.004 0.000
#> GSM11861     4  0.1693    0.69417 0.032 0.020 0.012 0.936 0.000 0.000
#> GSM11843     2  0.5407    0.54341 0.348 0.536 0.000 0.112 0.004 0.000
#> GSM11862     4  0.1490    0.69598 0.016 0.024 0.008 0.948 0.004 0.000
#> GSM11697     4  0.5461    0.50581 0.164 0.000 0.248 0.584 0.000 0.004
#> GSM11714     5  0.3052    0.94137 0.000 0.000 0.004 0.000 0.780 0.216
#> GSM11723     1  0.3048    0.51844 0.844 0.028 0.116 0.012 0.000 0.000
#> GSM11845     1  0.3048    0.51844 0.844 0.028 0.116 0.012 0.000 0.000
#> GSM11683     3  0.6616    0.16005 0.020 0.000 0.396 0.376 0.012 0.196
#> GSM11691     3  0.6732    0.15636 0.032 0.000 0.400 0.376 0.012 0.180
#> GSM27949     3  0.6273    0.50963 0.084 0.000 0.616 0.036 0.200 0.064
#> GSM27945     4  0.6190    0.20073 0.340 0.000 0.268 0.388 0.000 0.004
#> GSM11706     5  0.3455    0.98030 0.000 0.000 0.036 0.000 0.784 0.180
#> GSM11853     4  0.4430    0.63912 0.108 0.000 0.152 0.732 0.000 0.008
#> GSM11729     2  0.2425    0.79809 0.100 0.880 0.008 0.012 0.000 0.000
#> GSM11746     2  0.2425    0.79809 0.100 0.880 0.008 0.012 0.000 0.000
#> GSM11711     4  0.5080    0.61227 0.124 0.000 0.184 0.676 0.004 0.012
#> GSM11854     4  0.4430    0.63912 0.108 0.000 0.152 0.732 0.000 0.008
#> GSM11731     2  0.4385    0.67946 0.328 0.636 0.000 0.032 0.004 0.000
#> GSM11839     2  0.4385    0.67946 0.328 0.636 0.000 0.032 0.004 0.000
#> GSM11836     4  0.2728    0.66839 0.012 0.084 0.004 0.876 0.000 0.024
#> GSM11849     4  0.2675    0.67003 0.012 0.080 0.004 0.880 0.000 0.024
#> GSM11682     6  0.0713    0.84574 0.000 0.000 0.000 0.028 0.000 0.972
#> GSM11690     4  0.1578    0.69013 0.012 0.048 0.000 0.936 0.000 0.004
#> GSM11692     4  0.0713    0.69592 0.000 0.028 0.000 0.972 0.000 0.000
#> GSM11841     4  0.0713    0.69592 0.000 0.028 0.000 0.972 0.000 0.000
#> GSM11901     4  0.0713    0.69592 0.000 0.028 0.000 0.972 0.000 0.000
#> GSM11715     2  0.3967    0.65879 0.012 0.748 0.004 0.212 0.000 0.024
#> GSM11724     2  0.3967    0.65879 0.012 0.748 0.004 0.212 0.000 0.024
#> GSM11684     4  0.1578    0.69013 0.012 0.048 0.000 0.936 0.000 0.004
#> GSM11696     4  0.1578    0.69013 0.012 0.048 0.000 0.936 0.000 0.004
#> GSM27952     6  0.0713    0.84574 0.000 0.000 0.000 0.028 0.000 0.972
#> GSM27948     4  0.1578    0.69013 0.012 0.048 0.000 0.936 0.000 0.004

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-hclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-hclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-hclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-hclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-hclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-hclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-hclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n cell.line(p) agent(p)  time(p) k
#> MAD:hclust 78      0.00329    0.520 4.81e-01 2
#> MAD:hclust 76      0.00214    0.491 1.14e-03 3
#> MAD:hclust 69      0.00735    0.599 3.88e-07 4
#> MAD:hclust 64      0.00198    0.481 9.91e-08 5
#> MAD:hclust 62      0.00118    0.222 1.73e-06 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:kmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "kmeans"]
# you can also extract it by
# res = res_list["MAD:kmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-kmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.546           0.589       0.829         0.4730 0.617   0.617
#> 3 3 0.311           0.527       0.693         0.3364 0.673   0.498
#> 4 4 0.420           0.453       0.664         0.1386 0.852   0.626
#> 5 5 0.509           0.459       0.616         0.0732 0.833   0.487
#> 6 6 0.631           0.576       0.695         0.0509 0.894   0.564

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     2   0.997     0.9828 0.468 0.532
#> GSM11735     2   0.997     0.9828 0.468 0.532
#> GSM11733     2   0.997     0.9828 0.468 0.532
#> GSM11863     1   0.992    -0.8366 0.552 0.448
#> GSM11710     2   0.995     0.9811 0.460 0.540
#> GSM11712     1   0.995     0.7559 0.540 0.460
#> GSM11732     1   0.900    -0.5926 0.684 0.316
#> GSM11844     1   0.850    -0.4897 0.724 0.276
#> GSM11842     1   1.000    -0.6892 0.512 0.488
#> GSM11860     1   1.000    -0.6892 0.512 0.488
#> GSM11686     2   0.995     0.9811 0.460 0.540
#> GSM11688     2   0.995     0.9811 0.460 0.540
#> GSM11846     2   0.996     0.9822 0.464 0.536
#> GSM11680     1   0.814    -0.4203 0.748 0.252
#> GSM11698     1   0.855    -0.4959 0.720 0.280
#> GSM11840     2   0.997     0.9828 0.468 0.532
#> GSM11847     2   0.997     0.9828 0.468 0.532
#> GSM11685     2   0.995     0.9811 0.460 0.540
#> GSM11699     1   0.358     0.4449 0.932 0.068
#> GSM27950     2   0.997     0.9828 0.468 0.532
#> GSM27946     1   0.714     0.5905 0.804 0.196
#> GSM11709     1   0.969    -0.0471 0.604 0.396
#> GSM11720     1   0.995     0.7559 0.540 0.460
#> GSM11726     1   0.995     0.7559 0.540 0.460
#> GSM11837     1   0.995     0.7559 0.540 0.460
#> GSM11725     1   0.995     0.7559 0.540 0.460
#> GSM11864     1   0.995     0.7559 0.540 0.460
#> GSM11687     1   0.995     0.7559 0.540 0.460
#> GSM11693     1   0.995     0.7559 0.540 0.460
#> GSM11727     1   0.997     0.7532 0.532 0.468
#> GSM11838     1   0.997     0.7532 0.532 0.468
#> GSM11681     2   0.995     0.9811 0.460 0.540
#> GSM11689     1   0.995     0.7559 0.540 0.460
#> GSM11704     1   0.995     0.7559 0.540 0.460
#> GSM11703     1   0.995     0.7559 0.540 0.460
#> GSM11705     1   0.971    -0.2156 0.600 0.400
#> GSM11722     1   0.997     0.7532 0.532 0.468
#> GSM11730     1   0.997     0.7532 0.532 0.468
#> GSM11713     2   0.971     0.7037 0.400 0.600
#> GSM11728     1   0.929    -0.0282 0.656 0.344
#> GSM27947     1   0.995     0.7559 0.540 0.460
#> GSM27951     1   0.827     0.3944 0.740 0.260
#> GSM11707     2   0.997     0.9828 0.468 0.532
#> GSM11716     1   0.995     0.7559 0.540 0.460
#> GSM11850     1   0.373     0.1635 0.928 0.072
#> GSM11851     1   0.469     0.0794 0.900 0.100
#> GSM11721     1   0.981     0.7410 0.580 0.420
#> GSM11852     1   0.204     0.2670 0.968 0.032
#> GSM11694     1   0.224     0.2584 0.964 0.036
#> GSM11695     1   0.469     0.0794 0.900 0.100
#> GSM11734     1   0.995     0.7559 0.540 0.460
#> GSM11861     1   0.689     0.5782 0.816 0.184
#> GSM11843     1   0.995     0.7559 0.540 0.460
#> GSM11862     1   0.775     0.6167 0.772 0.228
#> GSM11697     1   0.184     0.2759 0.972 0.028
#> GSM11714     2   0.995     0.9811 0.460 0.540
#> GSM11723     1   0.995     0.7559 0.540 0.460
#> GSM11845     1   0.995     0.7559 0.540 0.460
#> GSM11683     2   0.997     0.9828 0.468 0.532
#> GSM11691     1   0.242     0.4012 0.960 0.040
#> GSM27949     2   0.997     0.9828 0.468 0.532
#> GSM27945     1   0.506     0.5013 0.888 0.112
#> GSM11706     2   0.997     0.9828 0.468 0.532
#> GSM11853     1   0.204     0.2670 0.968 0.032
#> GSM11729     1   0.995     0.7559 0.540 0.460
#> GSM11746     1   0.995     0.7559 0.540 0.460
#> GSM11711     2   0.997     0.9828 0.468 0.532
#> GSM11854     1   0.224     0.2580 0.964 0.036
#> GSM11731     1   0.995     0.7559 0.540 0.460
#> GSM11839     1   0.995     0.7559 0.540 0.460
#> GSM11836     1   0.998     0.7481 0.528 0.472
#> GSM11849     1   0.998     0.7481 0.528 0.472
#> GSM11682     2   0.995     0.9811 0.460 0.540
#> GSM11690     1   0.983     0.7391 0.576 0.424
#> GSM11692     1   0.995     0.7559 0.540 0.460
#> GSM11841     1   0.995     0.7559 0.540 0.460
#> GSM11901     1   0.995     0.7559 0.540 0.460
#> GSM11715     1   0.997     0.7532 0.532 0.468
#> GSM11724     1   0.997     0.7532 0.532 0.468
#> GSM11684     1   0.995     0.7527 0.540 0.460
#> GSM11696     1   0.997     0.7532 0.532 0.468
#> GSM27952     2   0.995     0.9811 0.460 0.540
#> GSM27948     1   0.995     0.7527 0.540 0.460

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3   0.228     0.8102 0.008 0.052 0.940
#> GSM11735     3   0.238     0.8088 0.008 0.056 0.936
#> GSM11733     3   0.517     0.7783 0.116 0.056 0.828
#> GSM11863     3   0.749     0.6193 0.248 0.084 0.668
#> GSM11710     3   0.230     0.8308 0.060 0.004 0.936
#> GSM11712     1   0.522     0.4167 0.740 0.260 0.000
#> GSM11732     1   0.719     0.3376 0.608 0.036 0.356
#> GSM11844     1   0.695     0.3421 0.620 0.028 0.352
#> GSM11842     3   0.778     0.5902 0.264 0.092 0.644
#> GSM11860     3   0.775     0.4940 0.340 0.064 0.596
#> GSM11686     3   0.397     0.8125 0.088 0.032 0.880
#> GSM11688     3   0.275     0.8282 0.064 0.012 0.924
#> GSM11846     3   0.506     0.7303 0.244 0.000 0.756
#> GSM11680     1   0.587     0.4455 0.684 0.004 0.312
#> GSM11698     1   0.610     0.3663 0.648 0.004 0.348
#> GSM11840     3   0.547     0.7703 0.128 0.060 0.812
#> GSM11847     3   0.547     0.7703 0.128 0.060 0.812
#> GSM11685     3   0.294     0.8260 0.072 0.012 0.916
#> GSM11699     1   0.321     0.5974 0.912 0.028 0.060
#> GSM27950     3   0.164     0.8326 0.044 0.000 0.956
#> GSM27946     1   0.231     0.5951 0.944 0.024 0.032
#> GSM11709     1   0.832     0.4325 0.604 0.276 0.120
#> GSM11720     1   0.620     0.3626 0.576 0.424 0.000
#> GSM11726     1   0.629     0.2776 0.536 0.464 0.000
#> GSM11837     2   0.604     0.1560 0.380 0.620 0.000
#> GSM11725     1   0.630     0.2393 0.520 0.480 0.000
#> GSM11864     1   0.620     0.3169 0.576 0.424 0.000
#> GSM11687     1   0.586     0.4487 0.656 0.344 0.000
#> GSM11693     1   0.595     0.4335 0.640 0.360 0.000
#> GSM11727     2   0.271     0.6348 0.088 0.912 0.000
#> GSM11838     2   0.271     0.6323 0.088 0.912 0.000
#> GSM11681     3   0.563     0.7609 0.144 0.056 0.800
#> GSM11689     1   0.597     0.4284 0.636 0.364 0.000
#> GSM11704     1   0.597     0.4284 0.636 0.364 0.000
#> GSM11703     1   0.588     0.4440 0.652 0.348 0.000
#> GSM11705     1   0.888     0.3441 0.572 0.244 0.184
#> GSM11722     2   0.271     0.6326 0.088 0.912 0.000
#> GSM11730     2   0.271     0.6348 0.088 0.912 0.000
#> GSM11713     2   0.921     0.2720 0.184 0.520 0.296
#> GSM11728     2   0.923     0.3116 0.204 0.528 0.268
#> GSM27947     1   0.383     0.5865 0.868 0.124 0.008
#> GSM27951     2   0.925     0.2066 0.392 0.452 0.156
#> GSM11707     3   0.164     0.8326 0.044 0.000 0.956
#> GSM11716     1   0.562     0.5302 0.744 0.244 0.012
#> GSM11850     1   0.481     0.6082 0.804 0.008 0.188
#> GSM11851     1   0.483     0.6009 0.792 0.004 0.204
#> GSM11721     1   0.585     0.2927 0.720 0.268 0.012
#> GSM11852     1   0.323     0.5986 0.908 0.020 0.072
#> GSM11694     1   0.470     0.6099 0.812 0.008 0.180
#> GSM11695     1   0.463     0.6069 0.808 0.004 0.188
#> GSM11734     2   0.627     0.0953 0.456 0.544 0.000
#> GSM11861     1   0.249     0.5789 0.936 0.048 0.016
#> GSM11843     1   0.613     0.3073 0.600 0.400 0.000
#> GSM11862     1   0.327     0.5563 0.904 0.080 0.016
#> GSM11697     1   0.470     0.6099 0.812 0.008 0.180
#> GSM11714     3   0.165     0.8322 0.036 0.004 0.960
#> GSM11723     1   0.601     0.3481 0.628 0.372 0.000
#> GSM11845     1   0.581     0.4066 0.664 0.336 0.000
#> GSM11683     3   0.413     0.8031 0.132 0.012 0.856
#> GSM11691     1   0.313     0.6110 0.904 0.008 0.088
#> GSM27949     1   0.631    -0.0522 0.508 0.000 0.492
#> GSM27945     1   0.441     0.6197 0.844 0.016 0.140
#> GSM11706     3   0.164     0.8326 0.044 0.000 0.956
#> GSM11853     1   0.364     0.6151 0.872 0.004 0.124
#> GSM11729     2   0.595     0.2723 0.360 0.640 0.000
#> GSM11746     2   0.595     0.2723 0.360 0.640 0.000
#> GSM11711     3   0.651     0.2739 0.472 0.004 0.524
#> GSM11854     1   0.385     0.6065 0.860 0.004 0.136
#> GSM11731     2   0.497     0.5895 0.236 0.764 0.000
#> GSM11839     2   0.553     0.5818 0.296 0.704 0.000
#> GSM11836     2   0.556     0.6032 0.300 0.700 0.000
#> GSM11849     2   0.651     0.5868 0.300 0.676 0.024
#> GSM11682     3   0.644     0.7035 0.168 0.076 0.756
#> GSM11690     2   0.668     0.5079 0.404 0.584 0.012
#> GSM11692     1   0.556     0.2409 0.700 0.300 0.000
#> GSM11841     1   0.590     0.2020 0.648 0.352 0.000
#> GSM11901     1   0.583     0.2040 0.660 0.340 0.000
#> GSM11715     2   0.334     0.6426 0.120 0.880 0.000
#> GSM11724     2   0.334     0.6426 0.120 0.880 0.000
#> GSM11684     2   0.620     0.5794 0.336 0.656 0.008
#> GSM11696     2   0.581     0.5851 0.336 0.664 0.000
#> GSM27952     3   0.359     0.8158 0.088 0.020 0.892
#> GSM27948     2   0.651     0.4055 0.476 0.520 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     1   0.388    0.66992 0.824 0.004 0.016 0.156
#> GSM11735     1   0.510    0.64273 0.732 0.004 0.036 0.228
#> GSM11733     1   0.703    0.57771 0.568 0.004 0.136 0.292
#> GSM11863     1   0.756    0.47290 0.456 0.004 0.168 0.372
#> GSM11710     1   0.141    0.70327 0.960 0.000 0.020 0.020
#> GSM11712     3   0.748   -0.12405 0.000 0.176 0.416 0.408
#> GSM11732     3   0.389    0.61686 0.132 0.004 0.836 0.028
#> GSM11844     3   0.346    0.62764 0.124 0.004 0.856 0.016
#> GSM11842     1   0.757    0.46510 0.448 0.004 0.168 0.380
#> GSM11860     1   0.789    0.43716 0.412 0.004 0.232 0.352
#> GSM11686     1   0.487    0.62205 0.776 0.012 0.036 0.176
#> GSM11688     1   0.281    0.69129 0.904 0.004 0.028 0.064
#> GSM11846     1   0.559    0.50923 0.652 0.004 0.312 0.032
#> GSM11680     3   0.284    0.64928 0.076 0.000 0.896 0.028
#> GSM11698     3   0.312    0.64255 0.092 0.000 0.880 0.028
#> GSM11840     1   0.713    0.57153 0.556 0.004 0.144 0.296
#> GSM11847     1   0.713    0.57153 0.556 0.004 0.144 0.296
#> GSM11685     1   0.317    0.68293 0.884 0.004 0.028 0.084
#> GSM11699     3   0.437    0.56682 0.008 0.004 0.760 0.228
#> GSM27950     1   0.158    0.70542 0.948 0.000 0.048 0.004
#> GSM27946     3   0.493    0.53559 0.004 0.016 0.712 0.268
#> GSM11709     3   0.802    0.34665 0.080 0.276 0.548 0.096
#> GSM11720     3   0.624    0.24814 0.000 0.392 0.548 0.060
#> GSM11726     2   0.590    0.27168 0.000 0.616 0.332 0.052
#> GSM11837     2   0.464    0.48794 0.000 0.776 0.180 0.044
#> GSM11725     2   0.675    0.16841 0.000 0.540 0.356 0.104
#> GSM11864     2   0.694    0.09905 0.000 0.508 0.376 0.116
#> GSM11687     3   0.667    0.37476 0.004 0.304 0.592 0.100
#> GSM11693     3   0.701    0.34651 0.004 0.316 0.556 0.124
#> GSM11727     2   0.333    0.44978 0.000 0.864 0.024 0.112
#> GSM11838     2   0.181    0.49140 0.000 0.940 0.008 0.052
#> GSM11681     1   0.641    0.51617 0.672 0.028 0.068 0.232
#> GSM11689     3   0.728    0.30439 0.004 0.324 0.524 0.148
#> GSM11704     3   0.729    0.29780 0.004 0.328 0.520 0.148
#> GSM11703     3   0.667    0.37695 0.004 0.304 0.592 0.100
#> GSM11705     3   0.877    0.28573 0.140 0.252 0.496 0.112
#> GSM11722     2   0.295    0.47813 0.000 0.888 0.024 0.088
#> GSM11730     2   0.366    0.42548 0.000 0.840 0.024 0.136
#> GSM11713     1   0.875   -0.13524 0.336 0.304 0.036 0.324
#> GSM11728     4   0.875    0.08025 0.308 0.320 0.036 0.336
#> GSM27947     3   0.439    0.61664 0.000 0.052 0.804 0.144
#> GSM27951     4   0.988    0.04605 0.232 0.292 0.184 0.292
#> GSM11707     1   0.112    0.70613 0.964 0.000 0.036 0.000
#> GSM11716     3   0.298    0.63302 0.000 0.120 0.872 0.008
#> GSM11850     3   0.145    0.66530 0.036 0.000 0.956 0.008
#> GSM11851     3   0.209    0.66150 0.048 0.000 0.932 0.020
#> GSM11721     4   0.702    0.32360 0.000 0.132 0.344 0.524
#> GSM11852     3   0.520    0.47880 0.016 0.004 0.668 0.312
#> GSM11694     3   0.121    0.66589 0.040 0.000 0.960 0.000
#> GSM11695     3   0.121    0.66589 0.040 0.000 0.960 0.000
#> GSM11734     2   0.710    0.24642 0.000 0.540 0.156 0.304
#> GSM11861     3   0.492    0.44055 0.000 0.008 0.656 0.336
#> GSM11843     3   0.776   -0.07538 0.000 0.372 0.392 0.236
#> GSM11862     3   0.555    0.32521 0.000 0.024 0.588 0.388
#> GSM11697     3   0.121    0.66589 0.040 0.000 0.960 0.000
#> GSM11714     1   0.121    0.70623 0.960 0.000 0.040 0.000
#> GSM11723     3   0.699    0.24305 0.000 0.304 0.552 0.144
#> GSM11845     3   0.684    0.32512 0.000 0.260 0.588 0.152
#> GSM11683     1   0.539    0.60592 0.752 0.004 0.140 0.104
#> GSM11691     3   0.241    0.66078 0.016 0.004 0.920 0.060
#> GSM27949     3   0.376    0.59724 0.172 0.000 0.816 0.012
#> GSM27945     3   0.106    0.66659 0.016 0.012 0.972 0.000
#> GSM11706     1   0.112    0.70613 0.964 0.000 0.036 0.000
#> GSM11853     3   0.303    0.65693 0.020 0.004 0.888 0.088
#> GSM11729     2   0.512    0.51530 0.000 0.764 0.128 0.108
#> GSM11746     2   0.500    0.51757 0.000 0.772 0.128 0.100
#> GSM11711     3   0.551    0.49311 0.252 0.000 0.692 0.056
#> GSM11854     3   0.334    0.64358 0.012 0.004 0.860 0.124
#> GSM11731     2   0.593    0.20528 0.000 0.596 0.048 0.356
#> GSM11839     2   0.618    0.00695 0.000 0.520 0.052 0.428
#> GSM11836     4   0.587    0.33001 0.000 0.416 0.036 0.548
#> GSM11849     4   0.650    0.35400 0.016 0.396 0.044 0.544
#> GSM11682     1   0.557    0.51001 0.692 0.028 0.016 0.264
#> GSM11690     4   0.669    0.46500 0.012 0.280 0.092 0.616
#> GSM11692     4   0.743    0.32146 0.000 0.184 0.336 0.480
#> GSM11841     4   0.754    0.30781 0.000 0.204 0.328 0.468
#> GSM11901     4   0.754    0.30781 0.000 0.204 0.328 0.468
#> GSM11715     2   0.445    0.32433 0.000 0.732 0.008 0.260
#> GSM11724     2   0.445    0.32433 0.000 0.732 0.008 0.260
#> GSM11684     4   0.643    0.42702 0.012 0.340 0.056 0.592
#> GSM11696     4   0.649    0.43486 0.008 0.336 0.068 0.588
#> GSM27952     1   0.389    0.64622 0.828 0.004 0.020 0.148
#> GSM27948     4   0.625    0.45215 0.000 0.224 0.120 0.656

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     4  0.4539    0.56601 0.044 0.000 0.008 0.736 0.212
#> GSM11735     4  0.5630    0.26378 0.044 0.000 0.016 0.528 0.412
#> GSM11733     5  0.5671    0.10482 0.000 0.000 0.096 0.336 0.568
#> GSM11863     5  0.5403    0.25670 0.000 0.000 0.108 0.248 0.644
#> GSM11710     4  0.2447    0.76540 0.032 0.000 0.032 0.912 0.024
#> GSM11712     5  0.8478    0.20953 0.260 0.184 0.228 0.000 0.328
#> GSM11732     3  0.1739    0.71766 0.004 0.000 0.940 0.024 0.032
#> GSM11844     3  0.1310    0.72576 0.000 0.000 0.956 0.020 0.024
#> GSM11842     5  0.5798    0.25893 0.004 0.008 0.108 0.244 0.636
#> GSM11860     5  0.6120    0.25243 0.012 0.008 0.120 0.240 0.620
#> GSM11686     4  0.4286    0.73925 0.016 0.016 0.072 0.816 0.080
#> GSM11688     4  0.2037    0.77207 0.004 0.000 0.064 0.920 0.012
#> GSM11846     4  0.5656    0.40088 0.020 0.004 0.332 0.600 0.044
#> GSM11680     3  0.1012    0.73223 0.000 0.000 0.968 0.020 0.012
#> GSM11698     3  0.0912    0.73191 0.000 0.000 0.972 0.016 0.012
#> GSM11840     5  0.5683    0.17330 0.000 0.000 0.108 0.304 0.588
#> GSM11847     5  0.5683    0.17330 0.000 0.000 0.108 0.304 0.588
#> GSM11685     4  0.2037    0.77207 0.004 0.000 0.064 0.920 0.012
#> GSM11699     3  0.5566    0.57489 0.108 0.012 0.700 0.012 0.168
#> GSM27950     4  0.2925    0.76950 0.036 0.000 0.064 0.884 0.016
#> GSM27946     3  0.6283    0.51566 0.164 0.012 0.624 0.012 0.188
#> GSM11709     1  0.4846    0.64408 0.612 0.000 0.360 0.024 0.004
#> GSM11720     1  0.5152    0.66163 0.632 0.052 0.312 0.000 0.004
#> GSM11726     1  0.6281    0.15599 0.460 0.388 0.152 0.000 0.000
#> GSM11837     2  0.6022    0.13684 0.396 0.516 0.068 0.000 0.020
#> GSM11725     1  0.6131    0.50896 0.616 0.172 0.196 0.000 0.016
#> GSM11864     1  0.6092    0.50696 0.628 0.160 0.192 0.000 0.020
#> GSM11687     1  0.4341    0.65140 0.628 0.000 0.364 0.000 0.008
#> GSM11693     1  0.4127    0.68240 0.680 0.000 0.312 0.000 0.008
#> GSM11727     2  0.3730    0.40520 0.288 0.712 0.000 0.000 0.000
#> GSM11838     2  0.3700    0.42742 0.240 0.752 0.000 0.000 0.008
#> GSM11681     4  0.6120    0.63570 0.156 0.024 0.056 0.692 0.072
#> GSM11689     1  0.4206    0.68155 0.708 0.000 0.272 0.000 0.020
#> GSM11704     1  0.4206    0.68155 0.708 0.000 0.272 0.000 0.020
#> GSM11703     1  0.4268    0.66852 0.648 0.000 0.344 0.000 0.008
#> GSM11705     1  0.6223    0.60260 0.564 0.016 0.328 0.084 0.008
#> GSM11722     2  0.4268    0.40317 0.344 0.648 0.000 0.000 0.008
#> GSM11730     2  0.3814    0.41259 0.276 0.720 0.000 0.000 0.004
#> GSM11713     4  0.7894    0.00692 0.160 0.372 0.004 0.372 0.092
#> GSM11728     2  0.8115   -0.05288 0.172 0.380 0.008 0.340 0.100
#> GSM27947     3  0.4973    0.51717 0.236 0.004 0.692 0.000 0.068
#> GSM27951     1  0.8485    0.17599 0.460 0.136 0.088 0.252 0.064
#> GSM11707     4  0.2772    0.76070 0.044 0.000 0.032 0.896 0.028
#> GSM11716     3  0.4211    0.58622 0.148 0.028 0.792 0.000 0.032
#> GSM11850     3  0.2149    0.71454 0.036 0.000 0.924 0.012 0.028
#> GSM11851     3  0.2152    0.71807 0.032 0.000 0.924 0.012 0.032
#> GSM11721     5  0.8691    0.21576 0.208 0.204 0.240 0.008 0.340
#> GSM11852     3  0.6590    0.46863 0.156 0.020 0.596 0.012 0.216
#> GSM11694     3  0.0912    0.72707 0.016 0.000 0.972 0.012 0.000
#> GSM11695     3  0.0912    0.72707 0.016 0.000 0.972 0.012 0.000
#> GSM11734     2  0.7201    0.29096 0.308 0.460 0.036 0.000 0.196
#> GSM11861     3  0.7237    0.38344 0.172 0.044 0.524 0.008 0.252
#> GSM11843     1  0.8398    0.01985 0.344 0.256 0.240 0.000 0.160
#> GSM11862     3  0.7777    0.20880 0.192 0.068 0.456 0.008 0.276
#> GSM11697     3  0.0912    0.72707 0.016 0.000 0.972 0.012 0.000
#> GSM11714     4  0.3081    0.76626 0.044 0.000 0.048 0.880 0.028
#> GSM11723     3  0.7812    0.15933 0.208 0.188 0.476 0.000 0.128
#> GSM11845     3  0.7488    0.25725 0.216 0.140 0.520 0.000 0.124
#> GSM11683     4  0.3674    0.71931 0.008 0.004 0.152 0.816 0.020
#> GSM11691     3  0.2196    0.71383 0.056 0.000 0.916 0.004 0.024
#> GSM27949     3  0.1430    0.71055 0.000 0.000 0.944 0.052 0.004
#> GSM27945     3  0.1430    0.71949 0.052 0.000 0.944 0.004 0.000
#> GSM11706     4  0.2772    0.76070 0.044 0.000 0.032 0.896 0.028
#> GSM11853     3  0.3108    0.69073 0.068 0.004 0.872 0.004 0.052
#> GSM11729     2  0.6440    0.18888 0.388 0.500 0.060 0.000 0.052
#> GSM11746     2  0.6440    0.18888 0.388 0.500 0.060 0.000 0.052
#> GSM11711     3  0.4564    0.60952 0.052 0.000 0.780 0.132 0.036
#> GSM11854     3  0.3349    0.68841 0.060 0.004 0.864 0.012 0.060
#> GSM11731     2  0.6607    0.34055 0.228 0.544 0.016 0.000 0.212
#> GSM11839     2  0.6928    0.23087 0.220 0.468 0.016 0.000 0.296
#> GSM11836     2  0.6553    0.20707 0.100 0.520 0.020 0.008 0.352
#> GSM11849     2  0.5996    0.33142 0.056 0.640 0.020 0.024 0.260
#> GSM11682     4  0.5141    0.67782 0.024 0.052 0.036 0.764 0.124
#> GSM11690     5  0.7903   -0.14795 0.136 0.388 0.044 0.040 0.392
#> GSM11692     5  0.8474    0.21161 0.240 0.224 0.196 0.000 0.340
#> GSM11841     5  0.8460    0.20993 0.240 0.224 0.192 0.000 0.344
#> GSM11901     5  0.8460    0.20993 0.240 0.224 0.192 0.000 0.344
#> GSM11715     2  0.3181    0.52182 0.072 0.856 0.000 0.000 0.072
#> GSM11724     2  0.3181    0.52182 0.072 0.856 0.000 0.000 0.072
#> GSM11684     2  0.7328    0.19453 0.120 0.508 0.040 0.024 0.308
#> GSM11696     2  0.7441    0.16243 0.140 0.484 0.040 0.020 0.316
#> GSM27952     4  0.2979    0.75896 0.004 0.004 0.056 0.880 0.056
#> GSM27948     5  0.8222   -0.00506 0.184 0.320 0.080 0.020 0.396

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6   0.571     0.4965 0.060 0.056 0.016 0.000 0.232 0.636
#> GSM11735     5   0.581     0.4109 0.056 0.056 0.012 0.000 0.596 0.280
#> GSM11733     5   0.307     0.8844 0.000 0.000 0.056 0.024 0.860 0.060
#> GSM11863     5   0.354     0.9086 0.000 0.000 0.072 0.052 0.832 0.044
#> GSM11710     6   0.416     0.7166 0.056 0.048 0.024 0.000 0.064 0.808
#> GSM11712     4   0.481     0.5926 0.068 0.028 0.120 0.752 0.032 0.000
#> GSM11732     3   0.186     0.7580 0.008 0.004 0.924 0.000 0.056 0.008
#> GSM11844     3   0.206     0.7609 0.008 0.004 0.920 0.008 0.052 0.008
#> GSM11842     5   0.379     0.9053 0.004 0.000 0.076 0.056 0.820 0.044
#> GSM11860     5   0.379     0.9053 0.004 0.000 0.076 0.056 0.820 0.044
#> GSM11686     6   0.274     0.7175 0.028 0.004 0.040 0.028 0.008 0.892
#> GSM11688     6   0.149     0.7351 0.000 0.000 0.036 0.000 0.024 0.940
#> GSM11846     6   0.612     0.3029 0.032 0.012 0.336 0.028 0.044 0.548
#> GSM11680     3   0.169     0.7670 0.000 0.000 0.936 0.032 0.020 0.012
#> GSM11698     3   0.184     0.7660 0.004 0.000 0.932 0.032 0.020 0.012
#> GSM11840     5   0.355     0.9100 0.000 0.000 0.064 0.048 0.832 0.056
#> GSM11847     5   0.355     0.9100 0.000 0.000 0.064 0.048 0.832 0.056
#> GSM11685     6   0.149     0.7351 0.000 0.000 0.036 0.000 0.024 0.940
#> GSM11699     3   0.474     0.4383 0.036 0.000 0.632 0.316 0.012 0.004
#> GSM27950     6   0.375     0.7249 0.032 0.048 0.048 0.000 0.036 0.836
#> GSM27946     3   0.502     0.3292 0.048 0.000 0.572 0.364 0.016 0.000
#> GSM11709     1   0.409     0.7411 0.680 0.004 0.296 0.004 0.000 0.016
#> GSM11720     1   0.502     0.6875 0.648 0.084 0.256 0.008 0.004 0.000
#> GSM11726     2   0.504     0.4430 0.348 0.580 0.064 0.004 0.004 0.000
#> GSM11837     2   0.462     0.5961 0.220 0.712 0.024 0.032 0.012 0.000
#> GSM11725     1   0.717     0.3428 0.532 0.212 0.124 0.092 0.036 0.004
#> GSM11864     1   0.735     0.3410 0.524 0.188 0.120 0.124 0.040 0.004
#> GSM11687     1   0.380     0.7579 0.692 0.000 0.292 0.016 0.000 0.000
#> GSM11693     1   0.429     0.7642 0.688 0.004 0.264 0.044 0.000 0.000
#> GSM11727     2   0.431     0.6303 0.220 0.712 0.000 0.064 0.000 0.004
#> GSM11838     2   0.333     0.6683 0.132 0.820 0.000 0.040 0.008 0.000
#> GSM11681     6   0.395     0.6149 0.200 0.004 0.016 0.016 0.004 0.760
#> GSM11689     1   0.454     0.7515 0.688 0.004 0.232 0.076 0.000 0.000
#> GSM11704     1   0.454     0.7515 0.688 0.004 0.232 0.076 0.000 0.000
#> GSM11703     1   0.403     0.7612 0.680 0.000 0.292 0.028 0.000 0.000
#> GSM11705     1   0.486     0.7153 0.660 0.008 0.272 0.016 0.000 0.044
#> GSM11722     2   0.537     0.5793 0.268 0.608 0.000 0.112 0.008 0.004
#> GSM11730     2   0.495     0.6120 0.220 0.676 0.000 0.088 0.012 0.004
#> GSM11713     6   0.789     0.0186 0.236 0.268 0.004 0.108 0.024 0.360
#> GSM11728     6   0.802    -0.0228 0.240 0.268 0.004 0.128 0.024 0.336
#> GSM27947     3   0.507     0.5162 0.164 0.000 0.668 0.156 0.012 0.000
#> GSM27951     1   0.647     0.2700 0.580 0.036 0.068 0.052 0.008 0.256
#> GSM11707     6   0.461     0.7061 0.060 0.056 0.036 0.000 0.068 0.780
#> GSM11716     3   0.472     0.6085 0.120 0.040 0.768 0.020 0.040 0.012
#> GSM11850     3   0.250     0.7408 0.048 0.012 0.904 0.012 0.016 0.008
#> GSM11851     3   0.289     0.7418 0.044 0.020 0.888 0.020 0.016 0.012
#> GSM11721     4   0.473     0.5980 0.060 0.028 0.116 0.760 0.036 0.000
#> GSM11852     4   0.620     0.0643 0.056 0.020 0.408 0.472 0.040 0.004
#> GSM11694     3   0.115     0.7611 0.020 0.000 0.960 0.000 0.016 0.004
#> GSM11695     3   0.115     0.7611 0.020 0.000 0.960 0.000 0.016 0.004
#> GSM11734     4   0.768     0.1150 0.148 0.300 0.028 0.428 0.080 0.016
#> GSM11861     4   0.727     0.1563 0.092 0.048 0.364 0.432 0.052 0.012
#> GSM11843     4   0.870     0.1655 0.192 0.228 0.128 0.352 0.084 0.016
#> GSM11862     4   0.689     0.3868 0.080 0.048 0.260 0.548 0.052 0.012
#> GSM11697     3   0.115     0.7629 0.016 0.000 0.960 0.000 0.020 0.004
#> GSM11714     6   0.458     0.7126 0.060 0.056 0.044 0.000 0.056 0.784
#> GSM11723     3   0.845     0.0763 0.168 0.144 0.400 0.208 0.064 0.016
#> GSM11845     3   0.848     0.0404 0.168 0.128 0.384 0.236 0.068 0.016
#> GSM11683     6   0.201     0.7272 0.000 0.000 0.080 0.000 0.016 0.904
#> GSM11691     3   0.218     0.7512 0.056 0.004 0.912 0.020 0.004 0.004
#> GSM27949     3   0.184     0.7565 0.004 0.004 0.932 0.004 0.020 0.036
#> GSM27945     3   0.131     0.7586 0.032 0.000 0.952 0.008 0.008 0.000
#> GSM11706     6   0.455     0.7076 0.056 0.056 0.036 0.000 0.068 0.784
#> GSM11853     3   0.378     0.7048 0.064 0.012 0.824 0.072 0.028 0.000
#> GSM11729     2   0.621     0.5531 0.276 0.576 0.020 0.080 0.044 0.004
#> GSM11746     2   0.621     0.5531 0.276 0.576 0.020 0.080 0.044 0.004
#> GSM11711     3   0.422     0.6927 0.056 0.008 0.812 0.040 0.024 0.060
#> GSM11854     3   0.402     0.6987 0.056 0.012 0.812 0.088 0.028 0.004
#> GSM11731     4   0.626     0.1476 0.084 0.312 0.000 0.532 0.064 0.008
#> GSM11839     4   0.437     0.4846 0.040 0.152 0.000 0.760 0.044 0.004
#> GSM11836     4   0.511     0.4460 0.072 0.124 0.000 0.732 0.040 0.032
#> GSM11849     4   0.660     0.2399 0.092 0.224 0.004 0.584 0.044 0.052
#> GSM11682     6   0.376     0.6582 0.056 0.004 0.012 0.080 0.020 0.828
#> GSM11690     4   0.474     0.5088 0.064 0.048 0.016 0.784 0.032 0.056
#> GSM11692     4   0.349     0.6115 0.044 0.012 0.092 0.836 0.016 0.000
#> GSM11841     4   0.344     0.6114 0.044 0.012 0.088 0.840 0.016 0.000
#> GSM11901     4   0.344     0.6114 0.044 0.012 0.088 0.840 0.016 0.000
#> GSM11715     2   0.618     0.4085 0.072 0.560 0.000 0.296 0.052 0.020
#> GSM11724     2   0.618     0.4085 0.072 0.560 0.000 0.296 0.052 0.020
#> GSM11684     4   0.583     0.3976 0.076 0.128 0.004 0.688 0.044 0.060
#> GSM11696     4   0.529     0.4399 0.060 0.112 0.004 0.732 0.044 0.048
#> GSM27952     6   0.107     0.7314 0.004 0.004 0.024 0.000 0.004 0.964
#> GSM27948     4   0.356     0.5705 0.032 0.016 0.036 0.856 0.024 0.036

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-kmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-kmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-kmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n cell.line(p) agent(p)  time(p) k
#> MAD:kmeans 62     1.62e-04   0.7144 1.35e-01 2
#> MAD:kmeans 49     1.34e-07   0.0836 1.40e-01 3
#> MAD:kmeans 38     2.73e-02   0.5487 2.47e-02 4
#> MAD:kmeans 44     6.49e-07   0.4453 6.49e-04 5
#> MAD:kmeans 57     7.45e-09   0.9585 5.64e-08 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:skmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "skmeans"]
# you can also extract it by
# res = res_list["MAD:skmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-skmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-skmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.586           0.781       0.914         0.5038 0.494   0.494
#> 3 3 0.499           0.539       0.781         0.3264 0.772   0.569
#> 4 4 0.594           0.727       0.813         0.1258 0.849   0.589
#> 5 5 0.646           0.547       0.694         0.0615 0.892   0.609
#> 6 6 0.705           0.639       0.794         0.0423 0.902   0.578

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1  0.0000     0.8759 1.000 0.000
#> GSM11735     1  0.0000     0.8759 1.000 0.000
#> GSM11733     1  0.0000     0.8759 1.000 0.000
#> GSM11863     1  0.0000     0.8759 1.000 0.000
#> GSM11710     1  0.0000     0.8759 1.000 0.000
#> GSM11712     2  0.0000     0.9115 0.000 1.000
#> GSM11732     1  0.0000     0.8759 1.000 0.000
#> GSM11844     1  0.0000     0.8759 1.000 0.000
#> GSM11842     1  0.0000     0.8759 1.000 0.000
#> GSM11860     1  0.0000     0.8759 1.000 0.000
#> GSM11686     1  0.0000     0.8759 1.000 0.000
#> GSM11688     1  0.0000     0.8759 1.000 0.000
#> GSM11846     1  0.0000     0.8759 1.000 0.000
#> GSM11680     1  0.6973     0.7608 0.812 0.188
#> GSM11698     1  0.0000     0.8759 1.000 0.000
#> GSM11840     1  0.0000     0.8759 1.000 0.000
#> GSM11847     1  0.0000     0.8759 1.000 0.000
#> GSM11685     1  0.0000     0.8759 1.000 0.000
#> GSM11699     2  0.9988    -0.0483 0.480 0.520
#> GSM27950     1  0.0000     0.8759 1.000 0.000
#> GSM27946     2  0.9775     0.1915 0.412 0.588
#> GSM11709     1  0.9775     0.2470 0.588 0.412
#> GSM11720     2  0.0000     0.9115 0.000 1.000
#> GSM11726     2  0.5737     0.7872 0.136 0.864
#> GSM11837     2  0.0000     0.9115 0.000 1.000
#> GSM11725     2  0.0000     0.9115 0.000 1.000
#> GSM11864     2  0.0000     0.9115 0.000 1.000
#> GSM11687     2  0.0000     0.9115 0.000 1.000
#> GSM11693     2  0.0000     0.9115 0.000 1.000
#> GSM11727     2  0.5408     0.7994 0.124 0.876
#> GSM11838     2  0.0000     0.9115 0.000 1.000
#> GSM11681     1  0.0000     0.8759 1.000 0.000
#> GSM11689     2  0.0000     0.9115 0.000 1.000
#> GSM11704     2  0.0000     0.9115 0.000 1.000
#> GSM11703     2  0.0000     0.9115 0.000 1.000
#> GSM11705     1  0.9775     0.2470 0.588 0.412
#> GSM11722     2  0.0000     0.9115 0.000 1.000
#> GSM11730     2  0.5408     0.7994 0.124 0.876
#> GSM11713     1  0.9881     0.1796 0.564 0.436
#> GSM11728     1  0.9896     0.1679 0.560 0.440
#> GSM27947     2  0.0000     0.9115 0.000 1.000
#> GSM27951     2  0.9896     0.2134 0.440 0.560
#> GSM11707     1  0.0000     0.8759 1.000 0.000
#> GSM11716     2  0.1184     0.8989 0.016 0.984
#> GSM11850     1  0.7139     0.7546 0.804 0.196
#> GSM11851     1  0.7139     0.7546 0.804 0.196
#> GSM11721     2  0.0672     0.9056 0.008 0.992
#> GSM11852     1  0.7219     0.7505 0.800 0.200
#> GSM11694     1  0.7139     0.7546 0.804 0.196
#> GSM11695     1  0.7139     0.7546 0.804 0.196
#> GSM11734     2  0.0000     0.9115 0.000 1.000
#> GSM11861     2  0.9944     0.0446 0.456 0.544
#> GSM11843     2  0.0000     0.9115 0.000 1.000
#> GSM11862     2  0.9686     0.2387 0.396 0.604
#> GSM11697     1  0.7219     0.7507 0.800 0.200
#> GSM11714     1  0.0000     0.8759 1.000 0.000
#> GSM11723     2  0.0000     0.9115 0.000 1.000
#> GSM11845     2  0.0000     0.9115 0.000 1.000
#> GSM11683     1  0.0000     0.8759 1.000 0.000
#> GSM11691     1  0.8016     0.6942 0.756 0.244
#> GSM27949     1  0.0000     0.8759 1.000 0.000
#> GSM27945     1  0.9988     0.1496 0.520 0.480
#> GSM11706     1  0.0000     0.8759 1.000 0.000
#> GSM11853     1  0.7139     0.7546 0.804 0.196
#> GSM11729     2  0.0000     0.9115 0.000 1.000
#> GSM11746     2  0.0000     0.9115 0.000 1.000
#> GSM11711     1  0.0000     0.8759 1.000 0.000
#> GSM11854     1  0.7139     0.7546 0.804 0.196
#> GSM11731     2  0.0000     0.9115 0.000 1.000
#> GSM11839     2  0.0000     0.9115 0.000 1.000
#> GSM11836     2  0.7139     0.7104 0.196 0.804
#> GSM11849     2  0.7139     0.7104 0.196 0.804
#> GSM11682     1  0.0000     0.8759 1.000 0.000
#> GSM11690     2  0.0376     0.9086 0.004 0.996
#> GSM11692     2  0.0000     0.9115 0.000 1.000
#> GSM11841     2  0.0000     0.9115 0.000 1.000
#> GSM11901     2  0.0000     0.9115 0.000 1.000
#> GSM11715     2  0.0000     0.9115 0.000 1.000
#> GSM11724     2  0.0000     0.9115 0.000 1.000
#> GSM11684     2  0.0000     0.9115 0.000 1.000
#> GSM11696     2  0.0000     0.9115 0.000 1.000
#> GSM27952     1  0.0000     0.8759 1.000 0.000
#> GSM27948     2  0.0000     0.9115 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.0000     0.7951 0.000 0.000 1.000
#> GSM11735     3  0.0000     0.7951 0.000 0.000 1.000
#> GSM11733     3  0.0000     0.7951 0.000 0.000 1.000
#> GSM11863     3  0.4062     0.6664 0.000 0.164 0.836
#> GSM11710     3  0.0424     0.7937 0.000 0.008 0.992
#> GSM11712     2  0.3816     0.5299 0.148 0.852 0.000
#> GSM11732     3  0.3695     0.7345 0.108 0.012 0.880
#> GSM11844     3  0.1015     0.7912 0.008 0.012 0.980
#> GSM11842     3  0.5363     0.5008 0.000 0.276 0.724
#> GSM11860     3  0.4915     0.6777 0.036 0.132 0.832
#> GSM11686     3  0.1411     0.7836 0.000 0.036 0.964
#> GSM11688     3  0.0424     0.7937 0.000 0.008 0.992
#> GSM11846     3  0.0000     0.7951 0.000 0.000 1.000
#> GSM11680     3  0.6319     0.6011 0.040 0.228 0.732
#> GSM11698     3  0.1337     0.7893 0.012 0.016 0.972
#> GSM11840     3  0.0000     0.7951 0.000 0.000 1.000
#> GSM11847     3  0.0000     0.7951 0.000 0.000 1.000
#> GSM11685     3  0.1289     0.7856 0.000 0.032 0.968
#> GSM11699     2  0.4799     0.4973 0.032 0.836 0.132
#> GSM27950     3  0.0000     0.7951 0.000 0.000 1.000
#> GSM27946     2  0.4589     0.4684 0.172 0.820 0.008
#> GSM11709     1  0.4974     0.5109 0.764 0.000 0.236
#> GSM11720     1  0.4555     0.6119 0.800 0.200 0.000
#> GSM11726     1  0.1182     0.5898 0.976 0.012 0.012
#> GSM11837     1  0.1643     0.5799 0.956 0.044 0.000
#> GSM11725     1  0.4654     0.6139 0.792 0.208 0.000
#> GSM11864     1  0.4887     0.5965 0.772 0.228 0.000
#> GSM11687     1  0.4452     0.6166 0.808 0.192 0.000
#> GSM11693     1  0.4452     0.6166 0.808 0.192 0.000
#> GSM11727     1  0.5678     0.2632 0.684 0.316 0.000
#> GSM11838     1  0.5678     0.2632 0.684 0.316 0.000
#> GSM11681     3  0.5470     0.6224 0.168 0.036 0.796
#> GSM11689     1  0.4555     0.6174 0.800 0.200 0.000
#> GSM11704     1  0.4555     0.6174 0.800 0.200 0.000
#> GSM11703     1  0.4452     0.6166 0.808 0.192 0.000
#> GSM11705     1  0.6126     0.2724 0.600 0.000 0.400
#> GSM11722     1  0.5678     0.2632 0.684 0.316 0.000
#> GSM11730     1  0.5678     0.2632 0.684 0.316 0.000
#> GSM11713     1  0.8756     0.1084 0.540 0.332 0.128
#> GSM11728     1  0.8821     0.0729 0.524 0.348 0.128
#> GSM27947     1  0.5291     0.5501 0.732 0.268 0.000
#> GSM27951     1  0.7474     0.3815 0.696 0.128 0.176
#> GSM11707     3  0.0000     0.7951 0.000 0.000 1.000
#> GSM11716     1  0.5285     0.5715 0.752 0.244 0.004
#> GSM11850     3  0.9713     0.2288 0.316 0.240 0.444
#> GSM11851     3  0.9484     0.3167 0.264 0.240 0.496
#> GSM11721     2  0.4504     0.6243 0.196 0.804 0.000
#> GSM11852     2  0.6143     0.3689 0.024 0.720 0.256
#> GSM11694     3  0.9700     0.2377 0.312 0.240 0.448
#> GSM11695     3  0.9700     0.2377 0.312 0.240 0.448
#> GSM11734     2  0.4346     0.4806 0.184 0.816 0.000
#> GSM11861     2  0.1753     0.5979 0.048 0.952 0.000
#> GSM11843     2  0.6267    -0.0206 0.452 0.548 0.000
#> GSM11862     2  0.0237     0.6213 0.004 0.996 0.000
#> GSM11697     3  0.9700     0.2377 0.312 0.240 0.448
#> GSM11714     3  0.0000     0.7951 0.000 0.000 1.000
#> GSM11723     2  0.6274    -0.0339 0.456 0.544 0.000
#> GSM11845     2  0.6260    -0.0124 0.448 0.552 0.000
#> GSM11683     3  0.1289     0.7856 0.000 0.032 0.968
#> GSM11691     2  0.9991    -0.1214 0.332 0.352 0.316
#> GSM27949     3  0.1337     0.7889 0.016 0.012 0.972
#> GSM27945     3  0.9829     0.1277 0.352 0.248 0.400
#> GSM11706     3  0.0000     0.7951 0.000 0.000 1.000
#> GSM11853     3  0.9767     0.2105 0.320 0.248 0.432
#> GSM11729     1  0.3551     0.5069 0.868 0.132 0.000
#> GSM11746     1  0.2165     0.5649 0.936 0.064 0.000
#> GSM11711     3  0.0000     0.7951 0.000 0.000 1.000
#> GSM11854     3  0.9355     0.3523 0.232 0.252 0.516
#> GSM11731     2  0.5327     0.5919 0.272 0.728 0.000
#> GSM11839     2  0.4750     0.6210 0.216 0.784 0.000
#> GSM11836     2  0.5335     0.6046 0.232 0.760 0.008
#> GSM11849     2  0.5216     0.5875 0.260 0.740 0.000
#> GSM11682     3  0.4047     0.6928 0.004 0.148 0.848
#> GSM11690     2  0.4702     0.6190 0.212 0.788 0.000
#> GSM11692     2  0.0892     0.6229 0.020 0.980 0.000
#> GSM11841     2  0.1163     0.6211 0.028 0.972 0.000
#> GSM11901     2  0.0892     0.6229 0.020 0.980 0.000
#> GSM11715     2  0.5926     0.5056 0.356 0.644 0.000
#> GSM11724     2  0.5859     0.5210 0.344 0.656 0.000
#> GSM11684     2  0.5016     0.6033 0.240 0.760 0.000
#> GSM11696     2  0.5016     0.6033 0.240 0.760 0.000
#> GSM27952     3  0.1411     0.7836 0.000 0.036 0.964
#> GSM27948     2  0.4654     0.6213 0.208 0.792 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     1  0.1209      0.848 0.964 0.004 0.032 0.000
#> GSM11735     1  0.3852      0.753 0.808 0.012 0.180 0.000
#> GSM11733     1  0.5972      0.715 0.716 0.088 0.180 0.016
#> GSM11863     1  0.6770      0.692 0.676 0.088 0.188 0.048
#> GSM11710     1  0.0000      0.852 1.000 0.000 0.000 0.000
#> GSM11712     4  0.3674      0.760 0.000 0.036 0.116 0.848
#> GSM11732     3  0.3828      0.768 0.068 0.084 0.848 0.000
#> GSM11844     3  0.4194      0.669 0.228 0.008 0.764 0.000
#> GSM11842     1  0.6989      0.679 0.660 0.088 0.196 0.056
#> GSM11860     1  0.6722      0.687 0.668 0.100 0.200 0.032
#> GSM11686     1  0.0592      0.847 0.984 0.000 0.000 0.016
#> GSM11688     1  0.0000      0.852 1.000 0.000 0.000 0.000
#> GSM11846     1  0.0524      0.853 0.988 0.004 0.008 0.000
#> GSM11680     3  0.3505      0.800 0.088 0.000 0.864 0.048
#> GSM11698     3  0.4788      0.671 0.232 0.008 0.744 0.016
#> GSM11840     1  0.6038      0.716 0.716 0.088 0.176 0.020
#> GSM11847     1  0.6038      0.716 0.716 0.088 0.176 0.020
#> GSM11685     1  0.0000      0.852 1.000 0.000 0.000 0.000
#> GSM11699     4  0.6504      0.356 0.044 0.016 0.396 0.544
#> GSM27950     1  0.0921      0.851 0.972 0.000 0.028 0.000
#> GSM27946     4  0.6351      0.391 0.020 0.032 0.388 0.560
#> GSM11709     2  0.4406      0.728 0.192 0.780 0.028 0.000
#> GSM11720     2  0.3444      0.796 0.000 0.816 0.184 0.000
#> GSM11726     2  0.1811      0.798 0.020 0.948 0.028 0.004
#> GSM11837     2  0.2623      0.796 0.000 0.908 0.064 0.028
#> GSM11725     2  0.4136      0.792 0.000 0.788 0.196 0.016
#> GSM11864     2  0.4175      0.788 0.000 0.784 0.200 0.016
#> GSM11687     2  0.3355      0.808 0.000 0.836 0.160 0.004
#> GSM11693     2  0.3577      0.808 0.000 0.832 0.156 0.012
#> GSM11727     2  0.3266      0.747 0.000 0.832 0.000 0.168
#> GSM11838     2  0.3991      0.740 0.000 0.808 0.020 0.172
#> GSM11681     1  0.2266      0.804 0.912 0.084 0.000 0.004
#> GSM11689     2  0.3547      0.810 0.000 0.840 0.144 0.016
#> GSM11704     2  0.3547      0.810 0.000 0.840 0.144 0.016
#> GSM11703     2  0.3529      0.809 0.000 0.836 0.152 0.012
#> GSM11705     2  0.4040      0.657 0.248 0.752 0.000 0.000
#> GSM11722     2  0.3266      0.747 0.000 0.832 0.000 0.168
#> GSM11730     2  0.3266      0.747 0.000 0.832 0.000 0.168
#> GSM11713     1  0.7082      0.300 0.540 0.308 0.000 0.152
#> GSM11728     1  0.7102      0.331 0.548 0.288 0.000 0.164
#> GSM27947     2  0.6845      0.122 0.000 0.452 0.448 0.100
#> GSM27951     2  0.5560      0.673 0.156 0.728 0.000 0.116
#> GSM11707     1  0.0779      0.852 0.980 0.004 0.016 0.000
#> GSM11716     3  0.0707      0.817 0.000 0.020 0.980 0.000
#> GSM11850     3  0.1042      0.833 0.020 0.008 0.972 0.000
#> GSM11851     3  0.1004      0.832 0.024 0.004 0.972 0.000
#> GSM11721     4  0.1526      0.789 0.016 0.012 0.012 0.960
#> GSM11852     4  0.6815      0.562 0.168 0.004 0.208 0.620
#> GSM11694     3  0.1042      0.833 0.020 0.008 0.972 0.000
#> GSM11695     3  0.1042      0.833 0.020 0.008 0.972 0.000
#> GSM11734     4  0.6324      0.640 0.000 0.168 0.172 0.660
#> GSM11861     4  0.5291      0.569 0.024 0.000 0.324 0.652
#> GSM11843     4  0.7519      0.399 0.000 0.256 0.248 0.496
#> GSM11862     4  0.4018      0.738 0.016 0.004 0.168 0.812
#> GSM11697     3  0.1042      0.833 0.020 0.008 0.972 0.000
#> GSM11714     1  0.0592      0.853 0.984 0.000 0.016 0.000
#> GSM11723     3  0.6049      0.479 0.000 0.120 0.680 0.200
#> GSM11845     3  0.6278      0.421 0.000 0.120 0.652 0.228
#> GSM11683     1  0.0336      0.851 0.992 0.000 0.008 0.000
#> GSM11691     3  0.4256      0.761 0.132 0.012 0.824 0.032
#> GSM27949     3  0.4283      0.647 0.256 0.004 0.740 0.000
#> GSM27945     3  0.1411      0.829 0.020 0.020 0.960 0.000
#> GSM11706     1  0.0779      0.852 0.980 0.004 0.016 0.000
#> GSM11853     3  0.4260      0.781 0.080 0.016 0.840 0.064
#> GSM11729     2  0.3687      0.771 0.000 0.856 0.064 0.080
#> GSM11746     2  0.3323      0.785 0.000 0.876 0.064 0.060
#> GSM11711     1  0.0524      0.853 0.988 0.004 0.008 0.000
#> GSM11854     3  0.5686      0.693 0.156 0.004 0.728 0.112
#> GSM11731     4  0.2813      0.769 0.000 0.080 0.024 0.896
#> GSM11839     4  0.1284      0.790 0.000 0.024 0.012 0.964
#> GSM11836     4  0.2271      0.762 0.000 0.076 0.008 0.916
#> GSM11849     4  0.3616      0.729 0.036 0.112 0.000 0.852
#> GSM11682     1  0.2142      0.816 0.928 0.016 0.000 0.056
#> GSM11690     4  0.1174      0.784 0.012 0.020 0.000 0.968
#> GSM11692     4  0.3342      0.771 0.000 0.032 0.100 0.868
#> GSM11841     4  0.3342      0.771 0.000 0.032 0.100 0.868
#> GSM11901     4  0.3279      0.773 0.000 0.032 0.096 0.872
#> GSM11715     4  0.4767      0.571 0.000 0.256 0.020 0.724
#> GSM11724     4  0.4642      0.597 0.000 0.240 0.020 0.740
#> GSM11684     4  0.1584      0.780 0.012 0.036 0.000 0.952
#> GSM11696     4  0.0927      0.785 0.008 0.016 0.000 0.976
#> GSM27952     1  0.0188      0.851 0.996 0.000 0.000 0.004
#> GSM27948     4  0.0657      0.787 0.012 0.000 0.004 0.984

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     5  0.4641    -0.4023 0.456 0.000 0.012 0.000 0.532
#> GSM11735     5  0.3064     0.6412 0.108 0.000 0.036 0.000 0.856
#> GSM11733     5  0.1455     0.7526 0.008 0.000 0.032 0.008 0.952
#> GSM11863     5  0.2277     0.7365 0.000 0.028 0.024 0.028 0.920
#> GSM11710     1  0.4283     0.5248 0.544 0.000 0.000 0.000 0.456
#> GSM11712     4  0.2122     0.7584 0.008 0.040 0.008 0.928 0.016
#> GSM11732     3  0.2439     0.7526 0.004 0.000 0.876 0.000 0.120
#> GSM11844     3  0.3911     0.6961 0.060 0.000 0.796 0.000 0.144
#> GSM11842     5  0.2444     0.7308 0.000 0.036 0.024 0.028 0.912
#> GSM11860     5  0.2745     0.7220 0.016 0.040 0.024 0.016 0.904
#> GSM11686     1  0.4903     0.5667 0.576 0.000 0.008 0.016 0.400
#> GSM11688     1  0.4735     0.5651 0.572 0.000 0.008 0.008 0.412
#> GSM11846     5  0.4182    -0.2207 0.400 0.000 0.000 0.000 0.600
#> GSM11680     3  0.3406     0.7525 0.040 0.000 0.856 0.084 0.020
#> GSM11698     3  0.3845     0.7168 0.100 0.000 0.824 0.012 0.064
#> GSM11840     5  0.1455     0.7526 0.008 0.000 0.032 0.008 0.952
#> GSM11847     5  0.1455     0.7526 0.008 0.000 0.032 0.008 0.952
#> GSM11685     1  0.4828     0.5666 0.572 0.000 0.008 0.012 0.408
#> GSM11699     4  0.4819     0.5362 0.024 0.012 0.252 0.704 0.008
#> GSM27950     1  0.5175     0.5352 0.548 0.000 0.044 0.000 0.408
#> GSM27946     4  0.4463     0.5893 0.016 0.012 0.212 0.748 0.012
#> GSM11709     1  0.4976    -0.4263 0.540 0.436 0.012 0.000 0.012
#> GSM11720     2  0.6390     0.6262 0.264 0.572 0.144 0.020 0.000
#> GSM11726     2  0.3888     0.6677 0.112 0.816 0.008 0.000 0.064
#> GSM11837     2  0.2426     0.6436 0.004 0.908 0.008 0.016 0.064
#> GSM11725     2  0.5813     0.6473 0.160 0.684 0.112 0.044 0.000
#> GSM11864     2  0.6211     0.6409 0.168 0.660 0.116 0.052 0.004
#> GSM11687     2  0.6640     0.6122 0.352 0.500 0.120 0.028 0.000
#> GSM11693     2  0.6839     0.6182 0.340 0.500 0.116 0.044 0.000
#> GSM11727     2  0.3454     0.6208 0.156 0.816 0.000 0.028 0.000
#> GSM11838     2  0.2616     0.6006 0.076 0.888 0.000 0.036 0.000
#> GSM11681     1  0.3659     0.4706 0.768 0.000 0.000 0.012 0.220
#> GSM11689     2  0.6898     0.6215 0.340 0.500 0.104 0.056 0.000
#> GSM11704     2  0.6898     0.6215 0.340 0.500 0.104 0.056 0.000
#> GSM11703     2  0.6839     0.6182 0.340 0.500 0.116 0.044 0.000
#> GSM11705     1  0.4193    -0.1065 0.684 0.304 0.000 0.000 0.012
#> GSM11722     2  0.3194     0.6302 0.148 0.832 0.000 0.020 0.000
#> GSM11730     2  0.3527     0.6176 0.172 0.804 0.000 0.024 0.000
#> GSM11713     1  0.4957     0.3528 0.752 0.136 0.000 0.032 0.080
#> GSM11728     1  0.5456     0.3126 0.708 0.172 0.000 0.040 0.080
#> GSM27947     3  0.8872    -0.1947 0.204 0.240 0.280 0.264 0.012
#> GSM27951     1  0.3318     0.1103 0.800 0.192 0.000 0.008 0.000
#> GSM11707     1  0.4641     0.5005 0.532 0.000 0.012 0.000 0.456
#> GSM11716     3  0.0771     0.7953 0.000 0.020 0.976 0.000 0.004
#> GSM11850     3  0.0451     0.7994 0.000 0.000 0.988 0.004 0.008
#> GSM11851     3  0.1106     0.7991 0.000 0.000 0.964 0.012 0.024
#> GSM11721     4  0.1256     0.7615 0.012 0.008 0.004 0.964 0.012
#> GSM11852     4  0.4551     0.6680 0.112 0.000 0.048 0.788 0.052
#> GSM11694     3  0.0000     0.7995 0.000 0.000 1.000 0.000 0.000
#> GSM11695     3  0.0000     0.7995 0.000 0.000 1.000 0.000 0.000
#> GSM11734     4  0.6560     0.0969 0.012 0.428 0.108 0.444 0.008
#> GSM11861     4  0.4970     0.5851 0.028 0.004 0.216 0.720 0.032
#> GSM11843     2  0.6899     0.1746 0.016 0.496 0.160 0.320 0.008
#> GSM11862     4  0.2604     0.7478 0.024 0.004 0.036 0.908 0.028
#> GSM11697     3  0.0000     0.7995 0.000 0.000 1.000 0.000 0.000
#> GSM11714     1  0.4767     0.5461 0.560 0.000 0.020 0.000 0.420
#> GSM11723     3  0.6396     0.3459 0.004 0.272 0.560 0.156 0.008
#> GSM11845     3  0.6703     0.3122 0.008 0.264 0.532 0.188 0.008
#> GSM11683     1  0.4920     0.5671 0.572 0.000 0.012 0.012 0.404
#> GSM11691     3  0.1806     0.7887 0.016 0.000 0.940 0.028 0.016
#> GSM27949     3  0.3555     0.7032 0.124 0.000 0.824 0.000 0.052
#> GSM27945     3  0.0671     0.7948 0.004 0.016 0.980 0.000 0.000
#> GSM11706     1  0.4443     0.4872 0.524 0.000 0.004 0.000 0.472
#> GSM11853     3  0.5951     0.6496 0.068 0.012 0.700 0.148 0.072
#> GSM11729     2  0.2869     0.6302 0.004 0.888 0.008 0.036 0.064
#> GSM11746     2  0.2616     0.6380 0.004 0.900 0.008 0.024 0.064
#> GSM11711     1  0.4787     0.5183 0.528 0.000 0.012 0.004 0.456
#> GSM11854     3  0.6824     0.4444 0.060 0.004 0.564 0.272 0.100
#> GSM11731     4  0.4686     0.3963 0.012 0.396 0.000 0.588 0.004
#> GSM11839     4  0.3934     0.6340 0.012 0.236 0.000 0.748 0.004
#> GSM11836     4  0.6903     0.3557 0.084 0.368 0.000 0.480 0.068
#> GSM11849     4  0.6246     0.4304 0.132 0.324 0.000 0.536 0.008
#> GSM11682     1  0.5220     0.5378 0.596 0.004 0.004 0.036 0.360
#> GSM11690     4  0.2592     0.7447 0.056 0.052 0.000 0.892 0.000
#> GSM11692     4  0.1243     0.7615 0.000 0.028 0.008 0.960 0.004
#> GSM11841     4  0.1455     0.7605 0.000 0.032 0.008 0.952 0.008
#> GSM11901     4  0.1243     0.7615 0.000 0.028 0.008 0.960 0.004
#> GSM11715     2  0.5473     0.1214 0.080 0.620 0.000 0.296 0.004
#> GSM11724     2  0.5526     0.0854 0.080 0.608 0.000 0.308 0.004
#> GSM11684     4  0.3967     0.6930 0.092 0.108 0.000 0.800 0.000
#> GSM11696     4  0.3180     0.7309 0.076 0.068 0.000 0.856 0.000
#> GSM27952     1  0.4806     0.5656 0.572 0.000 0.004 0.016 0.408
#> GSM27948     4  0.1106     0.7606 0.012 0.024 0.000 0.964 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6  0.3010     0.7565 0.000 0.004 0.028 0.000 0.132 0.836
#> GSM11735     5  0.4555     0.5591 0.000 0.004 0.040 0.000 0.616 0.340
#> GSM11733     5  0.2312     0.9324 0.000 0.000 0.012 0.000 0.876 0.112
#> GSM11863     5  0.2070     0.9361 0.000 0.000 0.008 0.000 0.892 0.100
#> GSM11710     6  0.1082     0.8421 0.000 0.000 0.004 0.000 0.040 0.956
#> GSM11712     4  0.2338     0.7475 0.012 0.068 0.004 0.900 0.016 0.000
#> GSM11732     3  0.2001     0.7568 0.000 0.004 0.900 0.000 0.092 0.004
#> GSM11844     3  0.2940     0.7321 0.000 0.004 0.848 0.000 0.112 0.036
#> GSM11842     5  0.2020     0.9337 0.000 0.000 0.008 0.000 0.896 0.096
#> GSM11860     5  0.1970     0.9309 0.000 0.000 0.008 0.000 0.900 0.092
#> GSM11686     6  0.0665     0.8407 0.008 0.008 0.004 0.000 0.000 0.980
#> GSM11688     6  0.0363     0.8452 0.000 0.000 0.000 0.000 0.012 0.988
#> GSM11846     6  0.3724     0.5393 0.000 0.012 0.004 0.000 0.268 0.716
#> GSM11680     3  0.3219     0.7500 0.000 0.008 0.848 0.048 0.008 0.088
#> GSM11698     3  0.3331     0.7178 0.000 0.008 0.828 0.008 0.028 0.128
#> GSM11840     5  0.2165     0.9367 0.000 0.000 0.008 0.000 0.884 0.108
#> GSM11847     5  0.2165     0.9367 0.000 0.000 0.008 0.000 0.884 0.108
#> GSM11685     6  0.0363     0.8452 0.000 0.000 0.000 0.000 0.012 0.988
#> GSM11699     4  0.4274     0.6946 0.008 0.024 0.160 0.768 0.004 0.036
#> GSM27950     6  0.1769     0.8327 0.000 0.004 0.060 0.000 0.012 0.924
#> GSM27946     4  0.3725     0.7207 0.012 0.020 0.104 0.828 0.016 0.020
#> GSM11709     1  0.2538     0.6640 0.860 0.000 0.016 0.000 0.000 0.124
#> GSM11720     1  0.2445     0.7001 0.896 0.060 0.032 0.004 0.008 0.000
#> GSM11726     1  0.5256    -0.1920 0.476 0.452 0.004 0.008 0.060 0.000
#> GSM11837     2  0.5221     0.4697 0.268 0.640 0.008 0.024 0.060 0.000
#> GSM11725     1  0.4755     0.5186 0.716 0.204 0.032 0.020 0.028 0.000
#> GSM11864     1  0.5039     0.5044 0.700 0.204 0.036 0.024 0.036 0.000
#> GSM11687     1  0.0363     0.7402 0.988 0.000 0.012 0.000 0.000 0.000
#> GSM11693     1  0.0508     0.7408 0.984 0.000 0.012 0.004 0.000 0.000
#> GSM11727     2  0.3429     0.5344 0.252 0.740 0.000 0.004 0.004 0.000
#> GSM11838     2  0.3018     0.5915 0.168 0.816 0.000 0.004 0.012 0.000
#> GSM11681     6  0.2615     0.7509 0.136 0.008 0.000 0.000 0.004 0.852
#> GSM11689     1  0.0508     0.7408 0.984 0.000 0.012 0.004 0.000 0.000
#> GSM11704     1  0.0508     0.7408 0.984 0.000 0.012 0.004 0.000 0.000
#> GSM11703     1  0.0363     0.7402 0.988 0.000 0.012 0.000 0.000 0.000
#> GSM11705     1  0.3463     0.5693 0.748 0.004 0.008 0.000 0.000 0.240
#> GSM11722     2  0.3421     0.5457 0.256 0.736 0.000 0.000 0.008 0.000
#> GSM11730     2  0.3667     0.5356 0.240 0.740 0.000 0.008 0.012 0.000
#> GSM11713     6  0.6521     0.3428 0.172 0.276 0.000 0.016 0.028 0.508
#> GSM11728     6  0.6609     0.3288 0.172 0.280 0.000 0.020 0.028 0.500
#> GSM27947     1  0.5533     0.4658 0.632 0.032 0.100 0.232 0.004 0.000
#> GSM27951     1  0.5374     0.3777 0.584 0.136 0.000 0.000 0.004 0.276
#> GSM11707     6  0.2052     0.8291 0.000 0.004 0.028 0.000 0.056 0.912
#> GSM11716     3  0.2450     0.7703 0.040 0.048 0.896 0.000 0.016 0.000
#> GSM11850     3  0.1086     0.7876 0.012 0.012 0.964 0.000 0.012 0.000
#> GSM11851     3  0.2716     0.7759 0.012 0.024 0.896 0.020 0.040 0.008
#> GSM11721     4  0.2080     0.7553 0.004 0.016 0.012 0.924 0.036 0.008
#> GSM11852     4  0.4816     0.6899 0.004 0.040 0.056 0.772 0.056 0.072
#> GSM11694     3  0.0982     0.7888 0.020 0.004 0.968 0.000 0.004 0.004
#> GSM11695     3  0.0982     0.7888 0.020 0.004 0.968 0.000 0.004 0.004
#> GSM11734     2  0.7001     0.3811 0.136 0.512 0.048 0.256 0.048 0.000
#> GSM11861     4  0.6114     0.5760 0.012 0.048 0.180 0.652 0.072 0.036
#> GSM11843     2  0.7972     0.3054 0.184 0.404 0.120 0.240 0.052 0.000
#> GSM11862     4  0.4562     0.7013 0.004 0.048 0.060 0.788 0.068 0.032
#> GSM11697     3  0.1210     0.7886 0.020 0.008 0.960 0.000 0.004 0.008
#> GSM11714     6  0.1599     0.8425 0.000 0.008 0.028 0.000 0.024 0.940
#> GSM11723     3  0.7150     0.1160 0.068 0.344 0.444 0.096 0.048 0.000
#> GSM11845     3  0.7821     0.0272 0.100 0.312 0.384 0.152 0.052 0.000
#> GSM11683     6  0.1642     0.8376 0.000 0.004 0.032 0.000 0.028 0.936
#> GSM11691     3  0.3786     0.7533 0.024 0.028 0.840 0.064 0.028 0.016
#> GSM27949     3  0.2905     0.7149 0.000 0.008 0.836 0.000 0.012 0.144
#> GSM27945     3  0.1780     0.7856 0.044 0.008 0.932 0.008 0.008 0.000
#> GSM11706     6  0.1890     0.8297 0.000 0.000 0.024 0.000 0.060 0.916
#> GSM11853     3  0.7606     0.3996 0.120 0.036 0.500 0.240 0.072 0.032
#> GSM11729     2  0.5264     0.4826 0.256 0.644 0.008 0.024 0.068 0.000
#> GSM11746     2  0.5264     0.4826 0.256 0.644 0.008 0.024 0.068 0.000
#> GSM11711     6  0.1989     0.8355 0.000 0.000 0.028 0.004 0.052 0.916
#> GSM11854     3  0.7404     0.1760 0.024 0.032 0.432 0.356 0.068 0.088
#> GSM11731     2  0.5084     0.2581 0.016 0.556 0.004 0.384 0.040 0.000
#> GSM11839     4  0.4896     0.0787 0.016 0.424 0.000 0.528 0.032 0.000
#> GSM11836     2  0.5266     0.3283 0.008 0.632 0.000 0.268 0.076 0.016
#> GSM11849     2  0.5303     0.2871 0.016 0.632 0.000 0.280 0.028 0.044
#> GSM11682     6  0.1804     0.8172 0.008 0.020 0.000 0.016 0.020 0.936
#> GSM11690     4  0.4455     0.6539 0.012 0.196 0.000 0.736 0.028 0.028
#> GSM11692     4  0.2086     0.7595 0.012 0.064 0.004 0.912 0.008 0.000
#> GSM11841     4  0.2144     0.7586 0.012 0.068 0.004 0.908 0.008 0.000
#> GSM11901     4  0.1985     0.7596 0.008 0.064 0.004 0.916 0.008 0.000
#> GSM11715     2  0.2573     0.6028 0.012 0.872 0.000 0.104 0.012 0.000
#> GSM11724     2  0.2573     0.6028 0.012 0.872 0.000 0.104 0.012 0.000
#> GSM11684     4  0.4842     0.5156 0.008 0.308 0.000 0.636 0.028 0.020
#> GSM11696     4  0.4447     0.5923 0.008 0.260 0.000 0.692 0.028 0.012
#> GSM27952     6  0.0405     0.8419 0.004 0.008 0.000 0.000 0.000 0.988
#> GSM27948     4  0.3057     0.7392 0.012 0.100 0.000 0.856 0.012 0.020

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-skmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n cell.line(p) agent(p)  time(p) k
#> MAD:skmeans 73     3.58e-07    0.759 2.14e-01 2
#> MAD:skmeans 59     5.49e-12    0.105 8.30e-01 3
#> MAD:skmeans 75     1.19e-16    0.835 1.88e-01 4
#> MAD:skmeans 63     1.02e-12    0.857 1.93e-05 5
#> MAD:skmeans 65     4.81e-12    0.739 1.77e-08 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:pam**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "pam"]
# you can also extract it by
# res = res_list["MAD:pam"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-pam-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-pam-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.920       0.950         0.3129 0.700   0.700
#> 3 3 0.241           0.429       0.727         0.7322 0.761   0.670
#> 4 4 0.546           0.526       0.739         0.2161 0.828   0.678
#> 5 5 0.594           0.352       0.660         0.1251 0.793   0.517
#> 6 6 0.702           0.529       0.791         0.0962 0.755   0.282

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     2  0.0000      0.929 0.000 1.000
#> GSM11735     2  0.0000      0.929 0.000 1.000
#> GSM11733     2  0.0000      0.929 0.000 1.000
#> GSM11863     2  0.3879      0.894 0.076 0.924
#> GSM11710     2  0.0000      0.929 0.000 1.000
#> GSM11712     1  0.0000      0.950 1.000 0.000
#> GSM11732     1  0.3584      0.950 0.932 0.068
#> GSM11844     1  0.3879      0.948 0.924 0.076
#> GSM11842     2  0.3879      0.894 0.076 0.924
#> GSM11860     2  0.0672      0.927 0.008 0.992
#> GSM11686     1  0.3879      0.948 0.924 0.076
#> GSM11688     2  0.4690      0.854 0.100 0.900
#> GSM11846     2  0.9988     -0.051 0.480 0.520
#> GSM11680     1  0.0000      0.950 1.000 0.000
#> GSM11698     1  0.3879      0.948 0.924 0.076
#> GSM11840     2  0.0000      0.929 0.000 1.000
#> GSM11847     2  0.2043      0.919 0.032 0.968
#> GSM11685     2  0.3431      0.901 0.064 0.936
#> GSM11699     1  0.2043      0.951 0.968 0.032
#> GSM27950     1  0.4022      0.946 0.920 0.080
#> GSM27946     1  0.0000      0.950 1.000 0.000
#> GSM11709     1  0.3879      0.948 0.924 0.076
#> GSM11720     1  0.3584      0.950 0.932 0.068
#> GSM11726     1  0.3733      0.949 0.928 0.072
#> GSM11837     1  0.0000      0.950 1.000 0.000
#> GSM11725     1  0.0000      0.950 1.000 0.000
#> GSM11864     1  0.0000      0.950 1.000 0.000
#> GSM11687     1  0.3584      0.950 0.932 0.068
#> GSM11693     1  0.3584      0.950 0.932 0.068
#> GSM11727     1  0.0000      0.950 1.000 0.000
#> GSM11838     1  0.0000      0.950 1.000 0.000
#> GSM11681     1  0.3879      0.948 0.924 0.076
#> GSM11689     1  0.3584      0.950 0.932 0.068
#> GSM11704     1  0.0000      0.950 1.000 0.000
#> GSM11703     1  0.3584      0.950 0.932 0.068
#> GSM11705     1  0.3879      0.948 0.924 0.076
#> GSM11722     1  0.0000      0.950 1.000 0.000
#> GSM11730     1  0.0000      0.950 1.000 0.000
#> GSM11713     1  0.3879      0.948 0.924 0.076
#> GSM11728     1  0.3879      0.948 0.924 0.076
#> GSM27947     1  0.0000      0.950 1.000 0.000
#> GSM27951     1  0.3733      0.949 0.928 0.072
#> GSM11707     2  0.0000      0.929 0.000 1.000
#> GSM11716     1  0.3114      0.951 0.944 0.056
#> GSM11850     1  0.3879      0.948 0.924 0.076
#> GSM11851     1  0.3879      0.948 0.924 0.076
#> GSM11721     1  0.0000      0.950 1.000 0.000
#> GSM11852     1  0.3879      0.948 0.924 0.076
#> GSM11694     1  0.3584      0.950 0.932 0.068
#> GSM11695     1  0.3584      0.950 0.932 0.068
#> GSM11734     1  0.0000      0.950 1.000 0.000
#> GSM11861     1  0.3584      0.950 0.932 0.068
#> GSM11843     1  0.0000      0.950 1.000 0.000
#> GSM11862     1  0.0000      0.950 1.000 0.000
#> GSM11697     1  0.3584      0.950 0.932 0.068
#> GSM11714     2  0.0000      0.929 0.000 1.000
#> GSM11723     1  0.0000      0.950 1.000 0.000
#> GSM11845     1  0.0000      0.950 1.000 0.000
#> GSM11683     1  0.3879      0.948 0.924 0.076
#> GSM11691     1  0.0000      0.950 1.000 0.000
#> GSM27949     1  0.3879      0.948 0.924 0.076
#> GSM27945     1  0.3584      0.950 0.932 0.068
#> GSM11706     2  0.4022      0.875 0.080 0.920
#> GSM11853     1  0.3879      0.948 0.924 0.076
#> GSM11729     1  0.0000      0.950 1.000 0.000
#> GSM11746     1  0.3584      0.950 0.932 0.068
#> GSM11711     1  0.3879      0.948 0.924 0.076
#> GSM11854     1  0.3879      0.948 0.924 0.076
#> GSM11731     1  0.0000      0.950 1.000 0.000
#> GSM11839     1  0.0000      0.950 1.000 0.000
#> GSM11836     1  0.0376      0.948 0.996 0.004
#> GSM11849     1  0.3879      0.948 0.924 0.076
#> GSM11682     1  0.7883      0.754 0.764 0.236
#> GSM11690     1  0.0000      0.950 1.000 0.000
#> GSM11692     1  0.0000      0.950 1.000 0.000
#> GSM11841     1  0.0000      0.950 1.000 0.000
#> GSM11901     1  0.0000      0.950 1.000 0.000
#> GSM11715     1  0.0000      0.950 1.000 0.000
#> GSM11724     1  0.0000      0.950 1.000 0.000
#> GSM11684     1  0.0000      0.950 1.000 0.000
#> GSM11696     1  0.0000      0.950 1.000 0.000
#> GSM27952     1  0.9954      0.211 0.540 0.460
#> GSM27948     1  0.0000      0.950 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.6026     0.4537 0.000 0.376 0.624
#> GSM11735     3  0.6026     0.4537 0.000 0.376 0.624
#> GSM11733     3  0.6026     0.4537 0.000 0.376 0.624
#> GSM11863     2  0.6286    -0.2993 0.000 0.536 0.464
#> GSM11710     3  0.0000     0.5263 0.000 0.000 1.000
#> GSM11712     1  0.6095     0.2470 0.608 0.392 0.000
#> GSM11732     1  0.4062     0.6476 0.836 0.000 0.164
#> GSM11844     1  0.4293     0.6472 0.832 0.004 0.164
#> GSM11842     2  0.6286    -0.2993 0.000 0.536 0.464
#> GSM11860     3  0.6026     0.4537 0.000 0.376 0.624
#> GSM11686     1  0.6081     0.4388 0.652 0.004 0.344
#> GSM11688     3  0.3377     0.5065 0.092 0.012 0.896
#> GSM11846     3  0.6566     0.1914 0.376 0.012 0.612
#> GSM11680     1  0.4062     0.6084 0.836 0.164 0.000
#> GSM11698     1  0.4293     0.6472 0.832 0.004 0.164
#> GSM11840     3  0.6026     0.4537 0.000 0.376 0.624
#> GSM11847     3  0.6260     0.3510 0.000 0.448 0.552
#> GSM11685     3  0.6154     0.1143 0.000 0.408 0.592
#> GSM11699     1  0.7291     0.2747 0.604 0.356 0.040
#> GSM27950     3  0.6305    -0.1257 0.484 0.000 0.516
#> GSM27946     1  0.4062     0.6084 0.836 0.164 0.000
#> GSM11709     1  0.4605     0.5243 0.796 0.000 0.204
#> GSM11720     1  0.4121     0.5552 0.832 0.000 0.168
#> GSM11726     1  0.5397     0.5247 0.720 0.000 0.280
#> GSM11837     1  0.4062     0.6084 0.836 0.164 0.000
#> GSM11725     1  0.0000     0.6455 1.000 0.000 0.000
#> GSM11864     1  0.0000     0.6455 1.000 0.000 0.000
#> GSM11687     1  0.4452     0.5339 0.808 0.000 0.192
#> GSM11693     1  0.0000     0.6455 1.000 0.000 0.000
#> GSM11727     1  0.5778     0.4944 0.768 0.032 0.200
#> GSM11838     1  0.4887     0.3418 0.772 0.228 0.000
#> GSM11681     1  0.6026     0.1811 0.624 0.000 0.376
#> GSM11689     1  0.0000     0.6455 1.000 0.000 0.000
#> GSM11704     1  0.0000     0.6455 1.000 0.000 0.000
#> GSM11703     1  0.4555     0.5258 0.800 0.000 0.200
#> GSM11705     1  0.5968     0.4773 0.636 0.000 0.364
#> GSM11722     1  0.8802     0.1795 0.584 0.216 0.200
#> GSM11730     1  0.8838     0.1839 0.580 0.220 0.200
#> GSM11713     3  0.9213     0.2414 0.228 0.236 0.536
#> GSM11728     1  0.6189     0.4787 0.632 0.004 0.364
#> GSM27947     1  0.0000     0.6455 1.000 0.000 0.000
#> GSM27951     1  0.4605     0.5243 0.796 0.000 0.204
#> GSM11707     3  0.0000     0.5263 0.000 0.000 1.000
#> GSM11716     1  0.0000     0.6455 1.000 0.000 0.000
#> GSM11850     1  0.4062     0.6476 0.836 0.000 0.164
#> GSM11851     1  0.4293     0.6472 0.832 0.004 0.164
#> GSM11721     1  0.6111     0.2378 0.604 0.396 0.000
#> GSM11852     1  0.4293     0.6472 0.832 0.004 0.164
#> GSM11694     1  0.0237     0.6466 0.996 0.000 0.004
#> GSM11695     1  0.4002     0.6487 0.840 0.000 0.160
#> GSM11734     1  0.4062     0.6084 0.836 0.164 0.000
#> GSM11861     1  0.4353     0.6485 0.836 0.008 0.156
#> GSM11843     1  0.3752     0.6181 0.856 0.144 0.000
#> GSM11862     1  0.4062     0.6084 0.836 0.164 0.000
#> GSM11697     1  0.4233     0.6480 0.836 0.004 0.160
#> GSM11714     3  0.0000     0.5263 0.000 0.000 1.000
#> GSM11723     1  0.6079     0.2557 0.612 0.388 0.000
#> GSM11845     1  0.6111     0.2378 0.604 0.396 0.000
#> GSM11683     3  0.9213     0.1326 0.228 0.236 0.536
#> GSM11691     1  0.4121     0.6053 0.832 0.168 0.000
#> GSM27949     1  0.4062     0.6476 0.836 0.000 0.164
#> GSM27945     1  0.0000     0.6455 1.000 0.000 0.000
#> GSM11706     3  0.4914     0.5173 0.068 0.088 0.844
#> GSM11853     1  0.4293     0.6472 0.832 0.004 0.164
#> GSM11729     1  0.6204     0.1194 0.576 0.424 0.000
#> GSM11746     1  0.4887     0.3418 0.772 0.228 0.000
#> GSM11711     1  0.6189     0.4787 0.632 0.004 0.364
#> GSM11854     1  0.4293     0.6472 0.832 0.004 0.164
#> GSM11731     2  0.6026     0.4430 0.376 0.624 0.000
#> GSM11839     1  0.6111     0.2378 0.604 0.396 0.000
#> GSM11836     2  0.6111     0.3997 0.396 0.604 0.000
#> GSM11849     2  0.9417     0.1730 0.180 0.456 0.364
#> GSM11682     3  0.9243     0.1265 0.232 0.236 0.532
#> GSM11690     1  0.6111     0.2378 0.604 0.396 0.000
#> GSM11692     1  0.6111     0.2378 0.604 0.396 0.000
#> GSM11841     1  0.6111     0.2378 0.604 0.396 0.000
#> GSM11901     1  0.6111     0.2378 0.604 0.396 0.000
#> GSM11715     2  0.8399     0.4587 0.188 0.624 0.188
#> GSM11724     2  0.8221     0.4806 0.248 0.624 0.128
#> GSM11684     2  0.6839     0.4625 0.352 0.624 0.024
#> GSM11696     2  0.6026     0.4430 0.376 0.624 0.000
#> GSM27952     3  0.6215     0.0365 0.428 0.000 0.572
#> GSM27948     1  0.6111     0.2378 0.604 0.396 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     4  0.4933      0.823 0.432 0.000 0.000 0.568
#> GSM11735     4  0.4933      0.823 0.432 0.000 0.000 0.568
#> GSM11733     4  0.4933      0.823 0.432 0.000 0.000 0.568
#> GSM11863     4  0.4933      0.823 0.432 0.000 0.000 0.568
#> GSM11710     1  0.1042      0.322 0.972 0.008 0.020 0.000
#> GSM11712     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11732     3  0.0000      0.578 0.000 0.000 1.000 0.000
#> GSM11844     3  0.0188      0.576 0.004 0.000 0.996 0.000
#> GSM11842     4  0.4933      0.823 0.432 0.000 0.000 0.568
#> GSM11860     4  0.4933      0.823 0.432 0.000 0.000 0.568
#> GSM11686     1  0.6144      0.552 0.508 0.008 0.452 0.032
#> GSM11688     1  0.2675      0.287 0.908 0.000 0.044 0.048
#> GSM11846     1  0.5351      0.450 0.756 0.172 0.056 0.016
#> GSM11680     3  0.0707      0.585 0.000 0.000 0.980 0.020
#> GSM11698     3  0.0188      0.576 0.004 0.000 0.996 0.000
#> GSM11840     4  0.4933      0.823 0.432 0.000 0.000 0.568
#> GSM11847     4  0.4933      0.823 0.432 0.000 0.000 0.568
#> GSM11685     1  0.4989      0.174 0.528 0.000 0.000 0.472
#> GSM11699     3  0.4837      0.612 0.004 0.000 0.648 0.348
#> GSM27950     1  0.4998      0.543 0.512 0.000 0.488 0.000
#> GSM27946     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11709     3  0.6928      0.456 0.068 0.416 0.500 0.016
#> GSM11720     3  0.6869      0.458 0.064 0.416 0.504 0.016
#> GSM11726     3  0.6903      0.463 0.068 0.400 0.516 0.016
#> GSM11837     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11725     3  0.5602      0.522 0.000 0.408 0.568 0.024
#> GSM11864     3  0.5602      0.522 0.000 0.408 0.568 0.024
#> GSM11687     3  0.6869      0.458 0.064 0.416 0.504 0.016
#> GSM11693     3  0.5427      0.519 0.000 0.416 0.568 0.016
#> GSM11727     2  0.5321      0.324 0.064 0.764 0.156 0.016
#> GSM11838     2  0.0336      0.453 0.000 0.992 0.000 0.008
#> GSM11681     1  0.6746      0.180 0.512 0.416 0.056 0.016
#> GSM11689     3  0.5427      0.519 0.000 0.416 0.568 0.016
#> GSM11704     3  0.5602      0.522 0.000 0.408 0.568 0.024
#> GSM11703     3  0.6347      0.458 0.064 0.412 0.524 0.000
#> GSM11705     3  0.6895      0.464 0.068 0.396 0.520 0.016
#> GSM11722     2  0.5397      0.270 0.064 0.716 0.220 0.000
#> GSM11730     2  0.2809      0.430 0.064 0.904 0.004 0.028
#> GSM11713     2  0.4642      0.213 0.240 0.740 0.020 0.000
#> GSM11728     3  0.6691      0.558 0.068 0.008 0.520 0.404
#> GSM27947     3  0.5602      0.522 0.000 0.408 0.568 0.024
#> GSM27951     3  0.6928      0.456 0.068 0.416 0.500 0.016
#> GSM11707     1  0.5161      0.568 0.592 0.008 0.400 0.000
#> GSM11716     3  0.0707      0.582 0.000 0.020 0.980 0.000
#> GSM11850     3  0.0188      0.576 0.004 0.000 0.996 0.000
#> GSM11851     3  0.0188      0.576 0.004 0.000 0.996 0.000
#> GSM11721     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11852     3  0.5060      0.606 0.004 0.000 0.584 0.412
#> GSM11694     3  0.0707      0.582 0.000 0.020 0.980 0.000
#> GSM11695     3  0.0000      0.578 0.000 0.000 1.000 0.000
#> GSM11734     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11861     3  0.2589      0.624 0.000 0.000 0.884 0.116
#> GSM11843     3  0.2412      0.613 0.000 0.008 0.908 0.084
#> GSM11862     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11697     3  0.0000      0.578 0.000 0.000 1.000 0.000
#> GSM11714     1  0.5220      0.566 0.568 0.008 0.424 0.000
#> GSM11723     3  0.4888      0.605 0.000 0.000 0.588 0.412
#> GSM11845     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11683     1  0.4981      0.558 0.536 0.000 0.464 0.000
#> GSM11691     3  0.0707      0.585 0.000 0.000 0.980 0.020
#> GSM27949     3  0.0188      0.576 0.004 0.000 0.996 0.000
#> GSM27945     3  0.1297      0.591 0.000 0.020 0.964 0.016
#> GSM11706     1  0.5641     -0.435 0.636 0.008 0.024 0.332
#> GSM11853     3  0.5060      0.606 0.004 0.000 0.584 0.412
#> GSM11729     2  0.4898      0.589 0.000 0.584 0.000 0.416
#> GSM11746     2  0.0336      0.453 0.000 0.992 0.000 0.008
#> GSM11711     3  0.6005      0.601 0.068 0.032 0.724 0.176
#> GSM11854     3  0.5050      0.608 0.004 0.000 0.588 0.408
#> GSM11731     4  0.7545     -0.549 0.000 0.396 0.188 0.416
#> GSM11839     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11836     2  0.5444      0.578 0.000 0.560 0.016 0.424
#> GSM11849     2  0.5476      0.577 0.000 0.584 0.020 0.396
#> GSM11682     1  0.6222      0.177 0.532 0.000 0.056 0.412
#> GSM11690     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11692     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11841     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11901     3  0.4933      0.605 0.000 0.000 0.568 0.432
#> GSM11715     2  0.4898      0.589 0.000 0.584 0.000 0.416
#> GSM11724     2  0.4898      0.589 0.000 0.584 0.000 0.416
#> GSM11684     2  0.4898      0.589 0.000 0.584 0.000 0.416
#> GSM11696     2  0.7184      0.464 0.000 0.448 0.136 0.416
#> GSM27952     1  0.3105      0.396 0.888 0.008 0.020 0.084
#> GSM27948     3  0.4933      0.605 0.000 0.000 0.568 0.432

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11735     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11733     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11863     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11710     4  0.6288     0.6103 0.360 0.004 0.084 0.532 0.020
#> GSM11712     1  0.4171     0.5870 0.604 0.000 0.000 0.396 0.000
#> GSM11732     3  0.4307    -0.3498 0.500 0.000 0.500 0.000 0.000
#> GSM11844     3  0.4307    -0.3498 0.500 0.000 0.500 0.000 0.000
#> GSM11842     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11860     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11686     4  0.4321     0.6458 0.396 0.000 0.004 0.600 0.000
#> GSM11688     4  0.5056     0.6452 0.360 0.000 0.000 0.596 0.044
#> GSM11846     4  0.6981     0.4500 0.372 0.004 0.212 0.404 0.008
#> GSM11680     1  0.4307     0.2966 0.500 0.000 0.500 0.000 0.000
#> GSM11698     1  0.2516     0.3077 0.860 0.000 0.140 0.000 0.000
#> GSM11840     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11847     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM11685     4  0.1732     0.2726 0.080 0.000 0.000 0.920 0.000
#> GSM11699     1  0.5896     0.5542 0.564 0.000 0.128 0.308 0.000
#> GSM27950     4  0.5010     0.2927 0.036 0.000 0.392 0.572 0.000
#> GSM27946     1  0.4171     0.5870 0.604 0.000 0.000 0.396 0.000
#> GSM11709     3  0.6100     0.2519 0.108 0.416 0.472 0.004 0.000
#> GSM11720     2  0.6637    -0.3050 0.188 0.416 0.392 0.004 0.000
#> GSM11726     3  0.6547     0.2780 0.216 0.276 0.504 0.004 0.000
#> GSM11837     1  0.5531     0.5474 0.560 0.020 0.036 0.384 0.000
#> GSM11725     1  0.4934     0.3348 0.544 0.432 0.020 0.004 0.000
#> GSM11864     1  0.4924     0.3672 0.552 0.420 0.000 0.028 0.000
#> GSM11687     3  0.6205     0.2471 0.120 0.416 0.460 0.004 0.000
#> GSM11693     1  0.5206     0.3216 0.544 0.416 0.036 0.004 0.000
#> GSM11727     3  0.5683     0.2332 0.068 0.428 0.500 0.004 0.000
#> GSM11838     2  0.1041     0.3211 0.000 0.964 0.032 0.004 0.000
#> GSM11681     3  0.6724     0.2169 0.016 0.416 0.416 0.152 0.000
#> GSM11689     1  0.5206     0.3216 0.544 0.416 0.036 0.004 0.000
#> GSM11704     1  0.5052     0.3320 0.552 0.412 0.036 0.000 0.000
#> GSM11703     3  0.5130     0.2569 0.032 0.412 0.552 0.004 0.000
#> GSM11705     3  0.5550     0.1248 0.468 0.056 0.472 0.004 0.000
#> GSM11722     2  0.4803    -0.2887 0.012 0.500 0.484 0.004 0.000
#> GSM11730     3  0.5081     0.1740 0.008 0.472 0.500 0.020 0.000
#> GSM11713     3  0.6584     0.0480 0.360 0.112 0.500 0.028 0.000
#> GSM11728     1  0.4594    -0.4278 0.508 0.004 0.484 0.004 0.000
#> GSM27947     1  0.5052     0.3711 0.552 0.412 0.000 0.036 0.000
#> GSM27951     3  0.6136     0.2500 0.112 0.416 0.468 0.004 0.000
#> GSM11707     3  0.5657    -0.0152 0.360 0.004 0.560 0.076 0.000
#> GSM11716     1  0.4307     0.2966 0.500 0.000 0.500 0.000 0.000
#> GSM11850     1  0.4307     0.2966 0.500 0.000 0.500 0.000 0.000
#> GSM11851     3  0.4307    -0.3498 0.500 0.000 0.500 0.000 0.000
#> GSM11721     1  0.4171     0.5870 0.604 0.000 0.000 0.396 0.000
#> GSM11852     1  0.0963     0.4147 0.964 0.000 0.000 0.036 0.000
#> GSM11694     3  0.4307    -0.3498 0.500 0.000 0.500 0.000 0.000
#> GSM11695     1  0.4307     0.2966 0.500 0.000 0.500 0.000 0.000
#> GSM11734     1  0.4171     0.5870 0.604 0.000 0.000 0.396 0.000
#> GSM11861     1  0.1892     0.4377 0.916 0.000 0.080 0.004 0.000
#> GSM11843     1  0.4251     0.4150 0.624 0.004 0.372 0.000 0.000
#> GSM11862     1  0.4171     0.5870 0.604 0.000 0.000 0.396 0.000
#> GSM11697     3  0.4307    -0.3498 0.500 0.000 0.500 0.000 0.000
#> GSM11714     3  0.6128    -0.1093 0.380 0.004 0.500 0.116 0.000
#> GSM11723     1  0.5729     0.5628 0.516 0.000 0.088 0.396 0.000
#> GSM11845     1  0.4171     0.5870 0.604 0.000 0.000 0.396 0.000
#> GSM11683     3  0.2300     0.1117 0.040 0.000 0.908 0.052 0.000
#> GSM11691     1  0.4307     0.2966 0.500 0.000 0.500 0.000 0.000
#> GSM27949     3  0.4307    -0.3498 0.500 0.000 0.500 0.000 0.000
#> GSM27945     1  0.4235     0.3722 0.576 0.000 0.424 0.000 0.000
#> GSM11706     3  0.6821    -0.0246 0.360 0.004 0.468 0.016 0.152
#> GSM11853     1  0.0963     0.4147 0.964 0.000 0.000 0.036 0.000
#> GSM11729     2  0.5193     0.5074 0.052 0.584 0.000 0.364 0.000
#> GSM11746     2  0.0162     0.3321 0.000 0.996 0.000 0.004 0.000
#> GSM11711     3  0.4562     0.0944 0.444 0.004 0.548 0.004 0.000
#> GSM11854     1  0.1661     0.4042 0.940 0.000 0.024 0.036 0.000
#> GSM11731     4  0.6697    -0.4471 0.240 0.376 0.000 0.384 0.000
#> GSM11839     1  0.4171     0.5870 0.604 0.000 0.000 0.396 0.000
#> GSM11836     2  0.5591     0.4882 0.076 0.528 0.000 0.396 0.000
#> GSM11849     2  0.4682    -0.0300 0.420 0.564 0.000 0.016 0.000
#> GSM11682     4  0.4088     0.6447 0.368 0.000 0.000 0.632 0.000
#> GSM11690     1  0.4219     0.5758 0.584 0.000 0.000 0.416 0.000
#> GSM11692     1  0.4171     0.5870 0.604 0.000 0.000 0.396 0.000
#> GSM11841     1  0.4171     0.5870 0.604 0.000 0.000 0.396 0.000
#> GSM11901     1  0.4171     0.5870 0.604 0.000 0.000 0.396 0.000
#> GSM11715     2  0.5193     0.5074 0.052 0.584 0.000 0.364 0.000
#> GSM11724     2  0.5193     0.5074 0.052 0.584 0.000 0.364 0.000
#> GSM11684     2  0.5386     0.4943 0.060 0.544 0.000 0.396 0.000
#> GSM11696     2  0.6536     0.3169 0.196 0.408 0.000 0.396 0.000
#> GSM27952     4  0.5070     0.6416 0.360 0.004 0.036 0.600 0.000
#> GSM27948     1  0.4171     0.5870 0.604 0.000 0.000 0.396 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     5  0.0000     0.9105 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11735     5  0.0000     0.9105 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11733     5  0.0000     0.9105 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11863     5  0.0000     0.9105 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11710     6  0.3742     0.6661 0.004 0.348 0.000 0.000 0.000 0.648
#> GSM11712     4  0.0000     0.7945 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11732     3  0.0260     0.7754 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM11844     3  0.0547     0.7708 0.000 0.000 0.980 0.020 0.000 0.000
#> GSM11842     5  0.0000     0.9105 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11860     5  0.0000     0.9105 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11686     6  0.4026     0.6648 0.000 0.348 0.016 0.000 0.000 0.636
#> GSM11688     6  0.4026     0.6653 0.000 0.348 0.000 0.000 0.016 0.636
#> GSM11846     6  0.4384     0.6359 0.036 0.348 0.000 0.000 0.000 0.616
#> GSM11680     3  0.1075     0.7558 0.000 0.000 0.952 0.048 0.000 0.000
#> GSM11698     3  0.4580     0.3564 0.000 0.348 0.608 0.040 0.000 0.004
#> GSM11840     5  0.0000     0.9105 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11847     5  0.0000     0.9105 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11685     6  0.4687     0.2922 0.000 0.072 0.000 0.296 0.000 0.632
#> GSM11699     3  0.5065     0.3488 0.000 0.092 0.568 0.340 0.000 0.000
#> GSM27950     6  0.3747     0.1973 0.000 0.000 0.396 0.000 0.000 0.604
#> GSM27946     4  0.0000     0.7945 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11709     1  0.1657     0.7186 0.928 0.000 0.000 0.056 0.000 0.016
#> GSM11720     1  0.3457     0.6688 0.800 0.000 0.164 0.020 0.000 0.016
#> GSM11726     1  0.6244     0.0819 0.456 0.148 0.032 0.000 0.000 0.364
#> GSM11837     6  0.8043    -0.2541 0.064 0.148 0.116 0.324 0.000 0.348
#> GSM11725     1  0.3345     0.7127 0.788 0.000 0.028 0.184 0.000 0.000
#> GSM11864     1  0.3542     0.7134 0.788 0.000 0.052 0.160 0.000 0.000
#> GSM11687     1  0.1267     0.7245 0.940 0.000 0.000 0.060 0.000 0.000
#> GSM11693     1  0.3703     0.6986 0.788 0.000 0.104 0.108 0.000 0.000
#> GSM11727     1  0.5811     0.1183 0.492 0.152 0.008 0.000 0.000 0.348
#> GSM11838     2  0.4909     0.3123 0.056 0.588 0.008 0.000 0.000 0.348
#> GSM11681     1  0.2823     0.5906 0.796 0.000 0.000 0.000 0.000 0.204
#> GSM11689     1  0.2883     0.7034 0.788 0.000 0.000 0.212 0.000 0.000
#> GSM11704     1  0.2883     0.7034 0.788 0.000 0.000 0.212 0.000 0.000
#> GSM11703     1  0.2581     0.6704 0.856 0.000 0.128 0.000 0.000 0.016
#> GSM11705     1  0.5323     0.2318 0.576 0.348 0.012 0.044 0.000 0.020
#> GSM11722     1  0.1942     0.6898 0.928 0.028 0.004 0.020 0.000 0.020
#> GSM11730     2  0.6140     0.2502 0.212 0.416 0.008 0.000 0.000 0.364
#> GSM11713     2  0.3980     0.0209 0.216 0.732 0.000 0.000 0.000 0.052
#> GSM11728     4  0.7376    -0.1177 0.176 0.356 0.080 0.368 0.000 0.020
#> GSM27947     1  0.2996     0.6929 0.772 0.000 0.000 0.228 0.000 0.000
#> GSM27951     1  0.1204     0.7225 0.944 0.000 0.000 0.056 0.000 0.000
#> GSM11707     2  0.7560    -0.3521 0.152 0.348 0.192 0.000 0.004 0.304
#> GSM11716     3  0.0260     0.7754 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM11850     3  0.0260     0.7754 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM11851     3  0.0260     0.7754 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM11721     4  0.0000     0.7945 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11852     4  0.3742     0.3426 0.000 0.348 0.000 0.648 0.000 0.004
#> GSM11694     3  0.0260     0.7754 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM11695     3  0.0260     0.7754 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM11734     4  0.0547     0.7832 0.020 0.000 0.000 0.980 0.000 0.000
#> GSM11861     3  0.6083     0.0677 0.000 0.272 0.364 0.364 0.000 0.000
#> GSM11843     3  0.5714     0.1487 0.168 0.000 0.464 0.368 0.000 0.000
#> GSM11862     4  0.1196     0.7681 0.008 0.000 0.040 0.952 0.000 0.000
#> GSM11697     3  0.0260     0.7754 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM11714     2  0.7383    -0.3503 0.120 0.348 0.236 0.000 0.000 0.296
#> GSM11723     4  0.3868    -0.0526 0.000 0.000 0.492 0.508 0.000 0.000
#> GSM11845     4  0.1765     0.7189 0.000 0.000 0.096 0.904 0.000 0.000
#> GSM11683     3  0.3439     0.6088 0.120 0.000 0.808 0.000 0.000 0.072
#> GSM11691     3  0.0260     0.7754 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM27949     3  0.0260     0.7754 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM27945     3  0.1007     0.7549 0.000 0.000 0.956 0.044 0.000 0.000
#> GSM11706     5  0.7087    -0.1813 0.156 0.348 0.000 0.000 0.384 0.112
#> GSM11853     4  0.3742     0.3426 0.000 0.348 0.000 0.648 0.000 0.004
#> GSM11729     2  0.5574     0.3555 0.000 0.504 0.000 0.152 0.000 0.344
#> GSM11746     2  0.4097    -0.2145 0.488 0.504 0.000 0.000 0.000 0.008
#> GSM11711     3  0.6467     0.1143 0.156 0.348 0.460 0.016 0.000 0.020
#> GSM11854     3  0.6149     0.1131 0.000 0.348 0.400 0.248 0.000 0.004
#> GSM11731     4  0.1075     0.7637 0.000 0.048 0.000 0.952 0.000 0.000
#> GSM11839     4  0.0000     0.7945 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11836     4  0.3706     0.3059 0.000 0.380 0.000 0.620 0.000 0.000
#> GSM11849     2  0.2340     0.1642 0.000 0.852 0.000 0.148 0.000 0.000
#> GSM11682     6  0.4026     0.6635 0.000 0.348 0.000 0.016 0.000 0.636
#> GSM11690     4  0.0000     0.7945 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11692     4  0.0000     0.7945 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11841     4  0.0000     0.7945 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11901     4  0.0000     0.7945 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11715     2  0.3868    -0.1159 0.000 0.504 0.000 0.496 0.000 0.000
#> GSM11724     2  0.3868    -0.1159 0.000 0.504 0.000 0.496 0.000 0.000
#> GSM11684     4  0.3499     0.4219 0.000 0.320 0.000 0.680 0.000 0.000
#> GSM11696     4  0.1267     0.7522 0.000 0.060 0.000 0.940 0.000 0.000
#> GSM27952     6  0.3607     0.6676 0.000 0.348 0.000 0.000 0.000 0.652
#> GSM27948     4  0.0000     0.7945 0.000 0.000 0.000 1.000 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-pam-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>          n cell.line(p) agent(p)  time(p) k
#> MAD:pam 81     5.50e-06    0.226 0.371088 2
#> MAD:pam 39     2.04e-01    0.612 0.588873 3
#> MAD:pam 60     7.67e-07    0.820 0.000933 4
#> MAD:pam 31     9.20e-03    0.407 0.016859 5
#> MAD:pam 54     7.45e-16    0.713 0.001618 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:mclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "mclust"]
# you can also extract it by
# res = res_list["MAD:mclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.449           0.831       0.898         0.3693 0.700   0.700
#> 3 3 0.379           0.715       0.770         0.6643 0.431   0.300
#> 4 4 0.451           0.638       0.771         0.1391 0.892   0.707
#> 5 5 0.501           0.578       0.742         0.0832 0.874   0.595
#> 6 6 0.585           0.659       0.772         0.0469 0.957   0.814

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 3

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     2  0.0672      0.949 0.008 0.992
#> GSM11735     2  0.0672      0.949 0.008 0.992
#> GSM11733     2  0.1414      0.949 0.020 0.980
#> GSM11863     1  0.8207      0.763 0.744 0.256
#> GSM11710     2  0.1414      0.958 0.020 0.980
#> GSM11712     1  0.0000      0.874 1.000 0.000
#> GSM11732     1  0.7139      0.783 0.804 0.196
#> GSM11844     1  0.6887      0.790 0.816 0.184
#> GSM11842     1  0.7528      0.786 0.784 0.216
#> GSM11860     1  0.7453      0.787 0.788 0.212
#> GSM11686     2  0.6623      0.793 0.172 0.828
#> GSM11688     2  0.1414      0.958 0.020 0.980
#> GSM11846     1  0.9775      0.540 0.588 0.412
#> GSM11680     1  0.7453      0.728 0.788 0.212
#> GSM11698     1  0.7745      0.725 0.772 0.228
#> GSM11840     1  0.9970      0.423 0.532 0.468
#> GSM11847     1  0.9909      0.483 0.556 0.444
#> GSM11685     2  0.1414      0.958 0.020 0.980
#> GSM11699     1  0.3114      0.858 0.944 0.056
#> GSM27950     2  0.2603      0.941 0.044 0.956
#> GSM27946     1  0.0376      0.874 0.996 0.004
#> GSM11709     1  0.5408      0.839 0.876 0.124
#> GSM11720     1  0.0000      0.874 1.000 0.000
#> GSM11726     1  0.7219      0.794 0.800 0.200
#> GSM11837     1  0.7219      0.794 0.800 0.200
#> GSM11725     1  0.0000      0.874 1.000 0.000
#> GSM11864     1  0.0000      0.874 1.000 0.000
#> GSM11687     1  0.0376      0.873 0.996 0.004
#> GSM11693     1  0.0376      0.873 0.996 0.004
#> GSM11727     1  0.7219      0.794 0.800 0.200
#> GSM11838     1  0.7219      0.794 0.800 0.200
#> GSM11681     2  0.2778      0.938 0.048 0.952
#> GSM11689     1  0.0376      0.873 0.996 0.004
#> GSM11704     1  0.0376      0.873 0.996 0.004
#> GSM11703     1  0.0376      0.873 0.996 0.004
#> GSM11705     1  0.5946      0.836 0.856 0.144
#> GSM11722     1  0.0000      0.874 1.000 0.000
#> GSM11730     1  0.7219      0.794 0.800 0.200
#> GSM11713     1  0.8909      0.708 0.692 0.308
#> GSM11728     1  0.9000      0.698 0.684 0.316
#> GSM27947     1  0.0000      0.874 1.000 0.000
#> GSM27951     1  0.2948      0.868 0.948 0.052
#> GSM11707     2  0.1414      0.958 0.020 0.980
#> GSM11716     1  0.0000      0.874 1.000 0.000
#> GSM11850     1  0.1414      0.871 0.980 0.020
#> GSM11851     1  0.6343      0.786 0.840 0.160
#> GSM11721     1  0.0000      0.874 1.000 0.000
#> GSM11852     1  0.5842      0.804 0.860 0.140
#> GSM11694     1  0.2948      0.861 0.948 0.052
#> GSM11695     1  0.6148      0.796 0.848 0.152
#> GSM11734     1  0.0000      0.874 1.000 0.000
#> GSM11861     1  0.0376      0.874 0.996 0.004
#> GSM11843     1  0.0000      0.874 1.000 0.000
#> GSM11862     1  0.0000      0.874 1.000 0.000
#> GSM11697     1  0.4298      0.843 0.912 0.088
#> GSM11714     2  0.1414      0.958 0.020 0.980
#> GSM11723     1  0.0000      0.874 1.000 0.000
#> GSM11845     1  0.0000      0.874 1.000 0.000
#> GSM11683     2  0.8327      0.670 0.264 0.736
#> GSM11691     1  0.1414      0.871 0.980 0.020
#> GSM27949     1  0.9608      0.447 0.616 0.384
#> GSM27945     1  0.0376      0.873 0.996 0.004
#> GSM11706     2  0.1414      0.958 0.020 0.980
#> GSM11853     1  0.1633      0.870 0.976 0.024
#> GSM11729     1  0.7219      0.794 0.800 0.200
#> GSM11746     1  0.7219      0.794 0.800 0.200
#> GSM11711     1  0.8713      0.695 0.708 0.292
#> GSM11854     1  0.5737      0.807 0.864 0.136
#> GSM11731     1  0.0000      0.874 1.000 0.000
#> GSM11839     1  0.0000      0.874 1.000 0.000
#> GSM11836     1  0.7299      0.791 0.796 0.204
#> GSM11849     1  0.7139      0.796 0.804 0.196
#> GSM11682     2  0.1633      0.956 0.024 0.976
#> GSM11690     1  0.2603      0.870 0.956 0.044
#> GSM11692     1  0.0000      0.874 1.000 0.000
#> GSM11841     1  0.0000      0.874 1.000 0.000
#> GSM11901     1  0.0000      0.874 1.000 0.000
#> GSM11715     1  0.7219      0.794 0.800 0.200
#> GSM11724     1  0.7219      0.794 0.800 0.200
#> GSM11684     1  0.6973      0.801 0.812 0.188
#> GSM11696     1  0.0000      0.874 1.000 0.000
#> GSM27952     2  0.1414      0.958 0.020 0.980
#> GSM27948     1  0.0000      0.874 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.5363      0.611 0.000 0.276 0.724
#> GSM11735     3  0.5363      0.611 0.000 0.276 0.724
#> GSM11733     2  0.3043      0.608 0.008 0.908 0.084
#> GSM11863     2  0.3183      0.656 0.076 0.908 0.016
#> GSM11710     3  0.0829      0.716 0.004 0.012 0.984
#> GSM11712     2  0.7558      0.767 0.284 0.644 0.072
#> GSM11732     3  0.3193      0.759 0.100 0.004 0.896
#> GSM11844     3  0.3213      0.760 0.092 0.008 0.900
#> GSM11842     2  0.3183      0.656 0.076 0.908 0.016
#> GSM11860     3  0.8100      0.451 0.068 0.420 0.512
#> GSM11686     3  0.6159      0.731 0.196 0.048 0.756
#> GSM11688     3  0.0475      0.715 0.004 0.004 0.992
#> GSM11846     3  0.3183      0.753 0.076 0.016 0.908
#> GSM11680     3  0.5797      0.764 0.280 0.008 0.712
#> GSM11698     3  0.5588      0.768 0.276 0.004 0.720
#> GSM11840     2  0.3234      0.654 0.072 0.908 0.020
#> GSM11847     2  0.3183      0.656 0.076 0.908 0.016
#> GSM11685     2  0.6470      0.641 0.012 0.632 0.356
#> GSM11699     2  0.9391      0.617 0.284 0.504 0.212
#> GSM27950     3  0.1015      0.721 0.008 0.012 0.980
#> GSM27946     2  0.9741      0.474 0.284 0.448 0.268
#> GSM11709     1  0.4504      0.779 0.804 0.000 0.196
#> GSM11720     1  0.0237      0.789 0.996 0.000 0.004
#> GSM11726     1  0.5659      0.773 0.796 0.052 0.152
#> GSM11837     3  0.6857      0.596 0.252 0.052 0.696
#> GSM11725     1  0.0237      0.789 0.996 0.000 0.004
#> GSM11864     3  0.5988      0.708 0.368 0.000 0.632
#> GSM11687     1  0.0237      0.789 0.996 0.000 0.004
#> GSM11693     1  0.0237      0.789 0.996 0.000 0.004
#> GSM11727     1  0.6808      0.757 0.732 0.084 0.184
#> GSM11838     1  0.6808      0.757 0.732 0.084 0.184
#> GSM11681     1  0.5517      0.735 0.728 0.004 0.268
#> GSM11689     1  0.0237      0.789 0.996 0.000 0.004
#> GSM11704     1  0.0237      0.789 0.996 0.000 0.004
#> GSM11703     1  0.0237      0.789 0.996 0.000 0.004
#> GSM11705     1  0.4504      0.779 0.804 0.000 0.196
#> GSM11722     1  0.2200      0.780 0.940 0.056 0.004
#> GSM11730     1  0.6808      0.757 0.732 0.084 0.184
#> GSM11713     1  0.6804      0.749 0.724 0.072 0.204
#> GSM11728     3  0.6804      0.485 0.204 0.072 0.724
#> GSM27947     3  0.5656      0.764 0.284 0.004 0.712
#> GSM27951     1  0.2486      0.780 0.932 0.060 0.008
#> GSM11707     3  0.5643      0.439 0.220 0.020 0.760
#> GSM11716     3  0.5465      0.765 0.288 0.000 0.712
#> GSM11850     3  0.5591      0.761 0.304 0.000 0.696
#> GSM11851     3  0.5763      0.767 0.276 0.008 0.716
#> GSM11721     2  0.7384      0.772 0.272 0.660 0.068
#> GSM11852     2  0.8435      0.739 0.284 0.592 0.124
#> GSM11694     3  0.5763      0.767 0.276 0.008 0.716
#> GSM11695     3  0.5623      0.768 0.280 0.004 0.716
#> GSM11734     2  0.7528      0.768 0.280 0.648 0.072
#> GSM11861     2  0.8938      0.690 0.284 0.552 0.164
#> GSM11843     3  0.6262      0.754 0.284 0.020 0.696
#> GSM11862     2  0.7558      0.767 0.284 0.644 0.072
#> GSM11697     3  0.5763      0.767 0.276 0.008 0.716
#> GSM11714     3  0.3910      0.636 0.104 0.020 0.876
#> GSM11723     3  0.7220      0.711 0.284 0.056 0.660
#> GSM11845     2  0.8491      0.733 0.284 0.588 0.128
#> GSM11683     3  0.4473      0.767 0.164 0.008 0.828
#> GSM11691     3  0.5497      0.765 0.292 0.000 0.708
#> GSM27949     3  0.3983      0.775 0.144 0.004 0.852
#> GSM27945     3  0.5763      0.767 0.276 0.008 0.716
#> GSM11706     3  0.0747      0.719 0.000 0.016 0.984
#> GSM11853     3  0.5763      0.767 0.276 0.008 0.716
#> GSM11729     3  0.4790      0.753 0.096 0.056 0.848
#> GSM11746     3  0.4920      0.751 0.108 0.052 0.840
#> GSM11711     3  0.2711      0.756 0.088 0.000 0.912
#> GSM11854     3  0.5763      0.767 0.276 0.008 0.716
#> GSM11731     2  0.7145      0.774 0.236 0.692 0.072
#> GSM11839     2  0.7022      0.772 0.232 0.700 0.068
#> GSM11836     2  0.5881      0.652 0.016 0.728 0.256
#> GSM11849     2  0.6912      0.470 0.016 0.540 0.444
#> GSM11682     2  0.6275      0.639 0.008 0.644 0.348
#> GSM11690     2  0.6939      0.768 0.216 0.712 0.072
#> GSM11692     2  0.7528      0.768 0.280 0.648 0.072
#> GSM11841     2  0.5953      0.753 0.280 0.708 0.012
#> GSM11901     2  0.6096      0.755 0.280 0.704 0.016
#> GSM11715     2  0.7072      0.371 0.020 0.504 0.476
#> GSM11724     2  0.6294      0.649 0.020 0.692 0.288
#> GSM11684     2  0.6887      0.705 0.076 0.720 0.204
#> GSM11696     2  0.6897      0.768 0.220 0.712 0.068
#> GSM27952     3  0.0661      0.715 0.004 0.008 0.988
#> GSM27948     2  0.6897      0.768 0.220 0.712 0.068

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     2  0.6996     0.6184 0.004 0.600 0.200 0.196
#> GSM11735     2  0.5384     0.5347 0.000 0.728 0.076 0.196
#> GSM11733     4  0.4576     0.5648 0.020 0.232 0.000 0.748
#> GSM11863     4  0.4722     0.5680 0.020 0.228 0.004 0.748
#> GSM11710     2  0.7599     0.7923 0.196 0.520 0.276 0.008
#> GSM11712     4  0.3907     0.7878 0.000 0.000 0.232 0.768
#> GSM11732     3  0.3933     0.4491 0.196 0.004 0.796 0.004
#> GSM11844     3  0.3544     0.5864 0.128 0.012 0.852 0.008
#> GSM11842     4  0.4722     0.5680 0.020 0.228 0.004 0.748
#> GSM11860     3  0.7150     0.1872 0.012 0.100 0.520 0.368
#> GSM11686     2  0.8054     0.2764 0.016 0.428 0.360 0.196
#> GSM11688     2  0.8070     0.7839 0.196 0.528 0.240 0.036
#> GSM11846     3  0.7834    -0.5085 0.196 0.352 0.444 0.008
#> GSM11680     3  0.4499     0.5706 0.000 0.072 0.804 0.124
#> GSM11698     3  0.3052     0.6467 0.004 0.104 0.880 0.012
#> GSM11840     4  0.4722     0.5680 0.020 0.228 0.004 0.748
#> GSM11847     4  0.4722     0.5680 0.020 0.228 0.004 0.748
#> GSM11685     4  0.6425     0.5965 0.200 0.092 0.024 0.684
#> GSM11699     4  0.4713     0.6559 0.000 0.000 0.360 0.640
#> GSM27950     2  0.7626     0.7913 0.200 0.516 0.276 0.008
#> GSM27946     4  0.4661     0.6783 0.000 0.000 0.348 0.652
#> GSM11709     1  0.1109     0.7209 0.968 0.004 0.028 0.000
#> GSM11720     1  0.3873     0.8039 0.772 0.000 0.228 0.000
#> GSM11726     1  0.4627     0.7426 0.772 0.196 0.028 0.004
#> GSM11837     3  0.7189     0.3940 0.136 0.256 0.592 0.016
#> GSM11725     1  0.3873     0.8039 0.772 0.000 0.228 0.000
#> GSM11864     3  0.3334     0.6794 0.048 0.060 0.884 0.008
#> GSM11687     1  0.4018     0.8050 0.772 0.000 0.224 0.004
#> GSM11693     1  0.4018     0.8050 0.772 0.000 0.224 0.004
#> GSM11727     1  0.4686     0.7401 0.780 0.184 0.016 0.020
#> GSM11838     1  0.4606     0.7316 0.772 0.200 0.008 0.020
#> GSM11681     1  0.0927     0.7120 0.976 0.008 0.016 0.000
#> GSM11689     1  0.4018     0.8050 0.772 0.000 0.224 0.004
#> GSM11704     1  0.4018     0.8050 0.772 0.000 0.224 0.004
#> GSM11703     1  0.4018     0.8050 0.772 0.000 0.224 0.004
#> GSM11705     1  0.1109     0.7209 0.968 0.004 0.028 0.000
#> GSM11722     1  0.3982     0.8048 0.776 0.000 0.220 0.004
#> GSM11730     1  0.4686     0.7401 0.780 0.184 0.016 0.020
#> GSM11713     1  0.0927     0.7137 0.976 0.008 0.016 0.000
#> GSM11728     1  0.6293     0.0144 0.628 0.276 0.096 0.000
#> GSM27947     3  0.0188     0.7323 0.000 0.000 0.996 0.004
#> GSM27951     1  0.3801     0.8056 0.780 0.000 0.220 0.000
#> GSM11707     2  0.7487     0.7907 0.196 0.520 0.280 0.004
#> GSM11716     3  0.1637     0.7130 0.000 0.060 0.940 0.000
#> GSM11850     3  0.0000     0.7325 0.000 0.000 1.000 0.000
#> GSM11851     3  0.0376     0.7313 0.000 0.004 0.992 0.004
#> GSM11721     4  0.3649     0.7979 0.000 0.000 0.204 0.796
#> GSM11852     4  0.4543     0.7061 0.000 0.000 0.324 0.676
#> GSM11694     3  0.0000     0.7325 0.000 0.000 1.000 0.000
#> GSM11695     3  0.0336     0.7313 0.000 0.008 0.992 0.000
#> GSM11734     4  0.4040     0.7786 0.000 0.000 0.248 0.752
#> GSM11861     4  0.4661     0.6739 0.000 0.000 0.348 0.652
#> GSM11843     3  0.2335     0.7049 0.000 0.060 0.920 0.020
#> GSM11862     4  0.4008     0.7781 0.000 0.000 0.244 0.756
#> GSM11697     3  0.0188     0.7324 0.000 0.004 0.996 0.000
#> GSM11714     2  0.7469     0.7921 0.196 0.524 0.276 0.004
#> GSM11723     3  0.2131     0.7075 0.000 0.036 0.932 0.032
#> GSM11845     3  0.4916    -0.1413 0.000 0.000 0.576 0.424
#> GSM11683     3  0.5464    -0.3320 0.008 0.492 0.496 0.004
#> GSM11691     3  0.0779     0.7275 0.000 0.016 0.980 0.004
#> GSM27949     3  0.3768     0.5364 0.008 0.184 0.808 0.000
#> GSM27945     3  0.0000     0.7325 0.000 0.000 1.000 0.000
#> GSM11706     2  0.7487     0.7907 0.196 0.520 0.280 0.004
#> GSM11853     3  0.0188     0.7324 0.000 0.004 0.996 0.000
#> GSM11729     3  0.5404     0.4934 0.012 0.256 0.704 0.028
#> GSM11746     3  0.5883     0.4796 0.040 0.256 0.684 0.020
#> GSM11711     3  0.7369    -0.2231 0.196 0.256 0.544 0.004
#> GSM11854     3  0.0927     0.7256 0.000 0.016 0.976 0.008
#> GSM11731     4  0.3893     0.7994 0.008 0.000 0.196 0.796
#> GSM11839     4  0.3791     0.7989 0.004 0.000 0.200 0.796
#> GSM11836     4  0.3950     0.6857 0.008 0.184 0.004 0.804
#> GSM11849     4  0.5405     0.6552 0.156 0.052 0.028 0.764
#> GSM11682     4  0.5075     0.6240 0.200 0.040 0.008 0.752
#> GSM11690     4  0.3973     0.7988 0.004 0.004 0.200 0.792
#> GSM11692     4  0.3726     0.7953 0.000 0.000 0.212 0.788
#> GSM11841     4  0.3649     0.7982 0.000 0.000 0.204 0.796
#> GSM11901     4  0.3610     0.7982 0.000 0.000 0.200 0.800
#> GSM11715     4  0.6900     0.5590 0.016 0.184 0.160 0.640
#> GSM11724     4  0.4547     0.6794 0.008 0.184 0.024 0.784
#> GSM11684     4  0.4235     0.7980 0.016 0.004 0.188 0.792
#> GSM11696     4  0.3933     0.7984 0.004 0.004 0.196 0.796
#> GSM27952     2  0.8574     0.7404 0.200 0.524 0.188 0.088
#> GSM27948     4  0.3791     0.7989 0.004 0.000 0.200 0.796

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     4  0.5528    0.64351 0.000 0.000 0.140 0.644 0.216
#> GSM11735     4  0.4497    0.39759 0.000 0.000 0.008 0.568 0.424
#> GSM11733     5  0.5498    0.57184 0.000 0.096 0.292 0.000 0.612
#> GSM11863     5  0.5498    0.57184 0.000 0.096 0.292 0.000 0.612
#> GSM11710     4  0.2929    0.80351 0.000 0.000 0.180 0.820 0.000
#> GSM11712     2  0.3246    0.73268 0.008 0.808 0.184 0.000 0.000
#> GSM11732     3  0.3525    0.55982 0.004 0.016 0.840 0.120 0.020
#> GSM11844     3  0.3366    0.59537 0.004 0.040 0.860 0.084 0.012
#> GSM11842     5  0.5498    0.57184 0.000 0.096 0.292 0.000 0.612
#> GSM11860     3  0.5956    0.04509 0.000 0.140 0.564 0.000 0.296
#> GSM11686     4  0.6829    0.60592 0.016 0.180 0.224 0.564 0.016
#> GSM11688     4  0.3289    0.80233 0.000 0.008 0.172 0.816 0.004
#> GSM11846     3  0.3913    0.32634 0.000 0.000 0.676 0.324 0.000
#> GSM11680     3  0.2407    0.63729 0.000 0.088 0.896 0.004 0.012
#> GSM11698     3  0.2130    0.65231 0.004 0.060 0.920 0.004 0.012
#> GSM11840     5  0.5498    0.57184 0.000 0.096 0.292 0.000 0.612
#> GSM11847     5  0.5498    0.57184 0.000 0.096 0.292 0.000 0.612
#> GSM11685     4  0.5726    0.51422 0.004 0.188 0.000 0.640 0.168
#> GSM11699     3  0.4165    0.40525 0.000 0.320 0.672 0.000 0.008
#> GSM27950     4  0.3575    0.79528 0.004 0.016 0.180 0.800 0.000
#> GSM27946     3  0.4218    0.38744 0.000 0.332 0.660 0.000 0.008
#> GSM11709     1  0.4377    0.71659 0.776 0.016 0.036 0.168 0.004
#> GSM11720     1  0.4848    0.72040 0.724 0.016 0.208 0.000 0.052
#> GSM11726     1  0.2657    0.71743 0.900 0.000 0.024 0.024 0.052
#> GSM11837     5  0.8057    0.26417 0.216 0.000 0.240 0.124 0.420
#> GSM11725     1  0.7343    0.43853 0.452 0.044 0.204 0.000 0.300
#> GSM11864     3  0.7990   -0.05643 0.060 0.032 0.420 0.140 0.348
#> GSM11687     1  0.4150    0.74392 0.772 0.044 0.180 0.000 0.004
#> GSM11693     1  0.3519    0.73941 0.776 0.008 0.216 0.000 0.000
#> GSM11727     1  0.1248    0.71105 0.964 0.016 0.008 0.008 0.004
#> GSM11838     1  0.4928    0.44365 0.664 0.028 0.004 0.008 0.296
#> GSM11681     1  0.4894    0.62316 0.692 0.024 0.008 0.264 0.012
#> GSM11689     1  0.3519    0.73941 0.776 0.008 0.216 0.000 0.000
#> GSM11704     1  0.3596    0.73992 0.776 0.012 0.212 0.000 0.000
#> GSM11703     1  0.3876    0.74237 0.776 0.032 0.192 0.000 0.000
#> GSM11705     1  0.4377    0.71659 0.776 0.016 0.036 0.168 0.004
#> GSM11722     1  0.7241    0.55928 0.532 0.172 0.048 0.008 0.240
#> GSM11730     1  0.1220    0.70839 0.964 0.020 0.004 0.008 0.004
#> GSM11713     1  0.3269    0.71220 0.836 0.004 0.004 0.144 0.012
#> GSM11728     1  0.6757    0.50137 0.536 0.028 0.104 0.320 0.012
#> GSM27947     3  0.1026    0.66934 0.000 0.024 0.968 0.004 0.004
#> GSM27951     1  0.4674    0.73908 0.776 0.116 0.088 0.008 0.012
#> GSM11707     4  0.2929    0.80351 0.000 0.000 0.180 0.820 0.000
#> GSM11716     3  0.3896    0.49406 0.012 0.008 0.780 0.004 0.196
#> GSM11850     3  0.0451    0.66829 0.008 0.004 0.988 0.000 0.000
#> GSM11851     3  0.1243    0.66381 0.000 0.008 0.960 0.004 0.028
#> GSM11721     2  0.2516    0.76186 0.000 0.860 0.140 0.000 0.000
#> GSM11852     3  0.4252    0.36324 0.000 0.340 0.652 0.000 0.008
#> GSM11694     3  0.0000    0.66953 0.000 0.000 1.000 0.000 0.000
#> GSM11695     3  0.0162    0.67005 0.000 0.004 0.996 0.000 0.000
#> GSM11734     2  0.8070    0.37479 0.008 0.432 0.168 0.108 0.284
#> GSM11861     3  0.4415    0.27890 0.000 0.388 0.604 0.000 0.008
#> GSM11843     3  0.8078   -0.00685 0.020 0.092 0.440 0.144 0.304
#> GSM11862     2  0.3274    0.70708 0.000 0.780 0.220 0.000 0.000
#> GSM11697     3  0.0000    0.66953 0.000 0.000 1.000 0.000 0.000
#> GSM11714     4  0.2929    0.80351 0.000 0.000 0.180 0.820 0.000
#> GSM11723     3  0.6298    0.24383 0.016 0.076 0.588 0.020 0.300
#> GSM11845     3  0.7105    0.08829 0.020 0.252 0.444 0.000 0.284
#> GSM11683     3  0.5719    0.22657 0.012 0.072 0.588 0.328 0.000
#> GSM11691     3  0.0775    0.66957 0.004 0.004 0.980 0.004 0.008
#> GSM27949     3  0.2460    0.63893 0.004 0.072 0.900 0.024 0.000
#> GSM27945     3  0.0000    0.66953 0.000 0.000 1.000 0.000 0.000
#> GSM11706     4  0.2929    0.80351 0.000 0.000 0.180 0.820 0.000
#> GSM11853     3  0.0510    0.66980 0.000 0.016 0.984 0.000 0.000
#> GSM11729     5  0.8965    0.25683 0.144 0.060 0.248 0.148 0.400
#> GSM11746     5  0.8106    0.26493 0.164 0.000 0.252 0.164 0.420
#> GSM11711     3  0.3819    0.47175 0.004 0.016 0.772 0.208 0.000
#> GSM11854     3  0.0968    0.66960 0.000 0.012 0.972 0.004 0.012
#> GSM11731     2  0.4783    0.57245 0.012 0.700 0.020 0.008 0.260
#> GSM11839     2  0.0865    0.74940 0.000 0.972 0.024 0.004 0.000
#> GSM11836     2  0.3231    0.67983 0.196 0.800 0.000 0.004 0.000
#> GSM11849     2  0.5471    0.62252 0.128 0.692 0.000 0.164 0.016
#> GSM11682     4  0.5441    0.25324 0.032 0.376 0.000 0.572 0.020
#> GSM11690     2  0.1518    0.75634 0.004 0.944 0.048 0.004 0.000
#> GSM11692     2  0.2848    0.75378 0.004 0.840 0.156 0.000 0.000
#> GSM11841     2  0.2770    0.76855 0.008 0.864 0.124 0.000 0.004
#> GSM11901     2  0.2597    0.77010 0.000 0.872 0.120 0.004 0.004
#> GSM11715     2  0.8308    0.35239 0.196 0.428 0.008 0.148 0.220
#> GSM11724     2  0.8148    0.37586 0.196 0.444 0.004 0.148 0.208
#> GSM11684     2  0.0775    0.73206 0.004 0.980 0.004 0.008 0.004
#> GSM11696     2  0.1991    0.76906 0.000 0.916 0.076 0.004 0.004
#> GSM27952     4  0.3980    0.79476 0.012 0.012 0.168 0.796 0.012
#> GSM27948     2  0.2233    0.77066 0.000 0.892 0.104 0.004 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6  0.4109     0.5641 0.000 0.012 0.040 0.000 0.212 0.736
#> GSM11735     5  0.4150     0.2199 0.000 0.012 0.000 0.004 0.612 0.372
#> GSM11733     5  0.1858     0.8737 0.000 0.000 0.092 0.004 0.904 0.000
#> GSM11863     5  0.1918     0.8716 0.000 0.000 0.088 0.008 0.904 0.000
#> GSM11710     6  0.2442     0.7471 0.000 0.000 0.144 0.004 0.000 0.852
#> GSM11712     4  0.2595     0.7951 0.004 0.000 0.160 0.836 0.000 0.000
#> GSM11732     3  0.4868     0.7113 0.028 0.068 0.768 0.012 0.036 0.088
#> GSM11844     3  0.2978     0.7432 0.028 0.012 0.872 0.020 0.000 0.068
#> GSM11842     5  0.3175     0.7964 0.000 0.000 0.080 0.088 0.832 0.000
#> GSM11860     3  0.5705     0.3696 0.000 0.004 0.548 0.156 0.288 0.004
#> GSM11686     6  0.6284     0.6408 0.008 0.056 0.176 0.144 0.008 0.608
#> GSM11688     6  0.3014     0.7435 0.000 0.056 0.068 0.016 0.000 0.860
#> GSM11846     3  0.3243     0.6139 0.004 0.008 0.780 0.000 0.000 0.208
#> GSM11680     3  0.2360     0.7521 0.000 0.012 0.900 0.044 0.000 0.044
#> GSM11698     3  0.2063     0.7550 0.000 0.008 0.912 0.060 0.000 0.020
#> GSM11840     5  0.1858     0.8737 0.000 0.000 0.092 0.004 0.904 0.000
#> GSM11847     5  0.1858     0.8737 0.000 0.000 0.092 0.004 0.904 0.000
#> GSM11685     6  0.6005     0.1666 0.024 0.056 0.000 0.032 0.392 0.496
#> GSM11699     3  0.4424     0.4351 0.000 0.024 0.628 0.340 0.004 0.004
#> GSM27950     6  0.3430     0.7397 0.024 0.008 0.076 0.004 0.040 0.848
#> GSM27946     3  0.4266     0.5093 0.000 0.024 0.668 0.300 0.004 0.004
#> GSM11709     1  0.3324     0.7646 0.824 0.004 0.040 0.004 0.000 0.128
#> GSM11720     1  0.4267     0.7641 0.772 0.028 0.148 0.040 0.012 0.000
#> GSM11726     1  0.3359     0.7361 0.836 0.024 0.004 0.000 0.108 0.028
#> GSM11837     2  0.5678     0.5315 0.112 0.660 0.072 0.000 0.152 0.004
#> GSM11725     1  0.6327     0.5362 0.560 0.236 0.152 0.040 0.012 0.000
#> GSM11864     2  0.5410     0.5701 0.068 0.660 0.228 0.028 0.012 0.004
#> GSM11687     1  0.3493     0.7693 0.796 0.000 0.148 0.056 0.000 0.000
#> GSM11693     1  0.3279     0.7680 0.796 0.000 0.176 0.028 0.000 0.000
#> GSM11727     1  0.1523     0.7353 0.940 0.044 0.000 0.008 0.008 0.000
#> GSM11838     1  0.3589     0.5609 0.752 0.228 0.000 0.008 0.012 0.000
#> GSM11681     1  0.5207     0.7013 0.708 0.016 0.004 0.060 0.040 0.172
#> GSM11689     1  0.3318     0.7693 0.796 0.000 0.172 0.032 0.000 0.000
#> GSM11704     1  0.3318     0.7693 0.796 0.000 0.172 0.032 0.000 0.000
#> GSM11703     1  0.3417     0.7673 0.796 0.000 0.160 0.044 0.000 0.000
#> GSM11705     1  0.3343     0.7553 0.816 0.004 0.024 0.000 0.008 0.148
#> GSM11722     1  0.5033     0.7420 0.720 0.080 0.020 0.160 0.012 0.008
#> GSM11730     1  0.1410     0.7361 0.944 0.044 0.000 0.008 0.004 0.000
#> GSM11713     1  0.3648     0.7284 0.820 0.008 0.000 0.020 0.040 0.112
#> GSM11728     1  0.7265     0.5469 0.584 0.124 0.084 0.040 0.040 0.128
#> GSM27947     3  0.1296     0.7557 0.004 0.004 0.948 0.044 0.000 0.000
#> GSM27951     1  0.4278     0.7626 0.768 0.004 0.016 0.164 0.024 0.024
#> GSM11707     6  0.2917     0.7493 0.000 0.004 0.104 0.000 0.040 0.852
#> GSM11716     3  0.5489     0.5914 0.052 0.228 0.664 0.024 0.012 0.020
#> GSM11850     3  0.3121     0.7227 0.044 0.116 0.836 0.004 0.000 0.000
#> GSM11851     3  0.3930     0.7258 0.008 0.120 0.808 0.016 0.012 0.036
#> GSM11721     4  0.2442     0.8078 0.000 0.000 0.144 0.852 0.000 0.004
#> GSM11852     3  0.4499     0.3634 0.000 0.024 0.604 0.364 0.004 0.004
#> GSM11694     3  0.2222     0.7475 0.012 0.084 0.896 0.008 0.000 0.000
#> GSM11695     3  0.2282     0.7562 0.012 0.068 0.900 0.020 0.000 0.000
#> GSM11734     2  0.5549     0.3647 0.000 0.532 0.164 0.304 0.000 0.000
#> GSM11861     3  0.4629     0.2437 0.000 0.028 0.576 0.388 0.004 0.004
#> GSM11843     2  0.4728     0.5831 0.004 0.660 0.256 0.080 0.000 0.000
#> GSM11862     4  0.2913     0.7731 0.000 0.004 0.180 0.812 0.000 0.004
#> GSM11697     3  0.1737     0.7579 0.008 0.040 0.932 0.020 0.000 0.000
#> GSM11714     6  0.2451     0.7410 0.000 0.004 0.068 0.000 0.040 0.888
#> GSM11723     3  0.5190     0.2576 0.004 0.324 0.576 0.096 0.000 0.000
#> GSM11845     3  0.6187    -0.0497 0.004 0.268 0.392 0.336 0.000 0.000
#> GSM11683     3  0.4712     0.5852 0.020 0.012 0.708 0.044 0.000 0.216
#> GSM11691     3  0.1167     0.7602 0.020 0.012 0.960 0.008 0.000 0.000
#> GSM27949     3  0.2024     0.7607 0.020 0.012 0.924 0.036 0.000 0.008
#> GSM27945     3  0.2315     0.7501 0.008 0.084 0.892 0.016 0.000 0.000
#> GSM11706     6  0.3682     0.7083 0.000 0.004 0.200 0.000 0.032 0.764
#> GSM11853     3  0.1296     0.7574 0.004 0.012 0.952 0.032 0.000 0.000
#> GSM11729     2  0.5724     0.5876 0.036 0.684 0.080 0.060 0.140 0.000
#> GSM11746     2  0.5011     0.5550 0.040 0.720 0.080 0.004 0.152 0.004
#> GSM11711     3  0.3306     0.6657 0.032 0.004 0.820 0.004 0.000 0.140
#> GSM11854     3  0.1082     0.7556 0.000 0.004 0.956 0.040 0.000 0.000
#> GSM11731     4  0.2587     0.7218 0.004 0.120 0.004 0.864 0.000 0.008
#> GSM11839     4  0.1230     0.7953 0.000 0.028 0.008 0.956 0.000 0.008
#> GSM11836     4  0.3385     0.6926 0.172 0.028 0.000 0.796 0.004 0.000
#> GSM11849     4  0.6292     0.4701 0.124 0.148 0.024 0.624 0.000 0.080
#> GSM11682     6  0.6869     0.3932 0.064 0.060 0.020 0.296 0.032 0.528
#> GSM11690     4  0.0665     0.7946 0.000 0.004 0.008 0.980 0.000 0.008
#> GSM11692     4  0.2442     0.8074 0.000 0.000 0.144 0.852 0.000 0.004
#> GSM11841     4  0.2538     0.8126 0.000 0.016 0.124 0.860 0.000 0.000
#> GSM11901     4  0.2389     0.8132 0.000 0.008 0.128 0.864 0.000 0.000
#> GSM11715     2  0.6295     0.3529 0.172 0.472 0.008 0.332 0.000 0.016
#> GSM11724     2  0.6383     0.3312 0.172 0.460 0.008 0.340 0.000 0.020
#> GSM11684     4  0.3126     0.7615 0.060 0.016 0.012 0.864 0.000 0.048
#> GSM11696     4  0.2046     0.8018 0.000 0.008 0.032 0.916 0.000 0.044
#> GSM27952     6  0.5895     0.7069 0.056 0.060 0.144 0.024 0.028 0.688
#> GSM27948     4  0.1524     0.8190 0.000 0.000 0.060 0.932 0.000 0.008

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-mclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n cell.line(p) agent(p)  time(p) k
#> MAD:mclust 80     1.96e-02    0.627 0.132299 2
#> MAD:mclust 77     1.10e-12    0.208 0.156890 3
#> MAD:mclust 72     5.63e-14    0.321 0.028965 4
#> MAD:mclust 60     4.77e-15    0.832 0.001103 5
#> MAD:mclust 70     2.00e-14    0.462 0.000612 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:NMF

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "NMF"]
# you can also extract it by
# res = res_list["MAD:NMF"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.633           0.800       0.917         0.4554 0.540   0.540
#> 3 3 0.435           0.718       0.808         0.4251 0.677   0.461
#> 4 4 0.500           0.642       0.809         0.1282 0.797   0.486
#> 5 5 0.629           0.629       0.825         0.0665 0.827   0.453
#> 6 6 0.576           0.474       0.690         0.0514 0.916   0.635

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     2  0.0000     0.8635 0.000 1.000
#> GSM11735     2  0.0000     0.8635 0.000 1.000
#> GSM11733     2  0.0000     0.8635 0.000 1.000
#> GSM11863     2  0.0000     0.8635 0.000 1.000
#> GSM11710     2  0.0000     0.8635 0.000 1.000
#> GSM11712     1  0.0000     0.9204 1.000 0.000
#> GSM11732     2  0.0000     0.8635 0.000 1.000
#> GSM11844     2  0.9129     0.5609 0.328 0.672
#> GSM11842     2  0.9944     0.1254 0.456 0.544
#> GSM11860     1  0.8555     0.5823 0.720 0.280
#> GSM11686     2  0.9358     0.5260 0.352 0.648
#> GSM11688     2  0.0000     0.8635 0.000 1.000
#> GSM11846     2  0.4298     0.8180 0.088 0.912
#> GSM11680     2  0.8909     0.5962 0.308 0.692
#> GSM11698     2  0.9608     0.4664 0.384 0.616
#> GSM11840     2  0.0000     0.8635 0.000 1.000
#> GSM11847     2  0.0000     0.8635 0.000 1.000
#> GSM11685     2  0.0000     0.8635 0.000 1.000
#> GSM11699     1  0.7745     0.6571 0.772 0.228
#> GSM27950     2  0.0000     0.8635 0.000 1.000
#> GSM27946     1  0.0672     0.9151 0.992 0.008
#> GSM11709     1  0.6438     0.7648 0.836 0.164
#> GSM11720     1  0.0000     0.9204 1.000 0.000
#> GSM11726     1  0.6887     0.7381 0.816 0.184
#> GSM11837     1  0.6623     0.7546 0.828 0.172
#> GSM11725     1  0.0000     0.9204 1.000 0.000
#> GSM11864     1  0.0000     0.9204 1.000 0.000
#> GSM11687     1  0.0000     0.9204 1.000 0.000
#> GSM11693     1  0.0000     0.9204 1.000 0.000
#> GSM11727     1  0.0000     0.9204 1.000 0.000
#> GSM11838     1  0.0000     0.9204 1.000 0.000
#> GSM11681     2  0.9775     0.3999 0.412 0.588
#> GSM11689     1  0.0000     0.9204 1.000 0.000
#> GSM11704     1  0.0000     0.9204 1.000 0.000
#> GSM11703     1  0.0000     0.9204 1.000 0.000
#> GSM11705     1  0.0000     0.9204 1.000 0.000
#> GSM11722     1  0.0000     0.9204 1.000 0.000
#> GSM11730     1  0.0000     0.9204 1.000 0.000
#> GSM11713     1  0.3274     0.8747 0.940 0.060
#> GSM11728     1  0.8081     0.6213 0.752 0.248
#> GSM27947     1  0.0000     0.9204 1.000 0.000
#> GSM27951     1  0.0000     0.9204 1.000 0.000
#> GSM11707     2  0.0000     0.8635 0.000 1.000
#> GSM11716     1  0.6712     0.7496 0.824 0.176
#> GSM11850     1  0.9850     0.2306 0.572 0.428
#> GSM11851     2  0.1184     0.8592 0.016 0.984
#> GSM11721     1  0.0000     0.9204 1.000 0.000
#> GSM11852     1  0.9580     0.2945 0.620 0.380
#> GSM11694     2  0.9993     0.0412 0.484 0.516
#> GSM11695     2  0.2948     0.8423 0.052 0.948
#> GSM11734     1  0.0000     0.9204 1.000 0.000
#> GSM11861     1  0.0000     0.9204 1.000 0.000
#> GSM11843     1  0.0000     0.9204 1.000 0.000
#> GSM11862     1  0.0000     0.9204 1.000 0.000
#> GSM11697     1  0.8861     0.5063 0.696 0.304
#> GSM11714     2  0.0000     0.8635 0.000 1.000
#> GSM11723     1  0.0000     0.9204 1.000 0.000
#> GSM11845     1  0.0000     0.9204 1.000 0.000
#> GSM11683     2  0.2043     0.8530 0.032 0.968
#> GSM11691     1  0.4161     0.8522 0.916 0.084
#> GSM27949     2  0.0000     0.8635 0.000 1.000
#> GSM27945     1  0.5294     0.8163 0.880 0.120
#> GSM11706     2  0.0000     0.8635 0.000 1.000
#> GSM11853     1  0.3431     0.8786 0.936 0.064
#> GSM11729     1  0.0000     0.9204 1.000 0.000
#> GSM11746     1  0.0000     0.9204 1.000 0.000
#> GSM11711     2  0.1414     0.8578 0.020 0.980
#> GSM11854     1  0.9754     0.2017 0.592 0.408
#> GSM11731     1  0.0000     0.9204 1.000 0.000
#> GSM11839     1  0.0000     0.9204 1.000 0.000
#> GSM11836     1  0.0000     0.9204 1.000 0.000
#> GSM11849     1  0.0000     0.9204 1.000 0.000
#> GSM11682     2  0.9686     0.4370 0.396 0.604
#> GSM11690     1  0.6343     0.7623 0.840 0.160
#> GSM11692     1  0.0000     0.9204 1.000 0.000
#> GSM11841     1  0.0000     0.9204 1.000 0.000
#> GSM11901     1  0.0000     0.9204 1.000 0.000
#> GSM11715     1  0.0000     0.9204 1.000 0.000
#> GSM11724     1  0.0000     0.9204 1.000 0.000
#> GSM11684     1  0.0000     0.9204 1.000 0.000
#> GSM11696     1  0.0000     0.9204 1.000 0.000
#> GSM27952     2  0.3879     0.8264 0.076 0.924
#> GSM27948     1  0.0000     0.9204 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.0000     0.8127 0.000 0.000 1.000
#> GSM11735     3  0.0000     0.8127 0.000 0.000 1.000
#> GSM11733     3  0.0983     0.8124 0.016 0.004 0.980
#> GSM11863     3  0.6559     0.7185 0.040 0.252 0.708
#> GSM11710     3  0.0424     0.8109 0.008 0.000 0.992
#> GSM11712     2  0.3340     0.8016 0.120 0.880 0.000
#> GSM11732     3  0.3192     0.7949 0.000 0.112 0.888
#> GSM11844     3  0.7011     0.7051 0.092 0.188 0.720
#> GSM11842     3  0.6835     0.6909 0.040 0.284 0.676
#> GSM11860     3  0.7424     0.5633 0.040 0.388 0.572
#> GSM11686     1  0.4677     0.7614 0.840 0.028 0.132
#> GSM11688     1  0.6111     0.3882 0.604 0.000 0.396
#> GSM11846     3  0.2356     0.8129 0.000 0.072 0.928
#> GSM11680     3  0.6511     0.6882 0.136 0.104 0.760
#> GSM11698     3  0.7453     0.6338 0.152 0.148 0.700
#> GSM11840     3  0.4369     0.7944 0.040 0.096 0.864
#> GSM11847     3  0.4206     0.7929 0.040 0.088 0.872
#> GSM11685     1  0.6008     0.4380 0.628 0.000 0.372
#> GSM11699     1  0.4121     0.7121 0.832 0.168 0.000
#> GSM27950     3  0.0000     0.8127 0.000 0.000 1.000
#> GSM27946     2  0.5859     0.6788 0.344 0.656 0.000
#> GSM11709     2  0.6590     0.7447 0.112 0.756 0.132
#> GSM11720     2  0.2878     0.7904 0.096 0.904 0.000
#> GSM11726     2  0.4979     0.6819 0.020 0.812 0.168
#> GSM11837     2  0.1636     0.7655 0.020 0.964 0.016
#> GSM11725     2  0.0892     0.7850 0.020 0.980 0.000
#> GSM11864     2  0.0237     0.7780 0.004 0.996 0.000
#> GSM11687     2  0.5465     0.7496 0.288 0.712 0.000
#> GSM11693     2  0.5138     0.7649 0.252 0.748 0.000
#> GSM11727     2  0.6225     0.5859 0.432 0.568 0.000
#> GSM11838     2  0.4555     0.7875 0.200 0.800 0.000
#> GSM11681     1  0.1647     0.8229 0.960 0.036 0.004
#> GSM11689     2  0.5431     0.7462 0.284 0.716 0.000
#> GSM11704     2  0.5397     0.7502 0.280 0.720 0.000
#> GSM11703     2  0.5363     0.7507 0.276 0.724 0.000
#> GSM11705     2  0.6280     0.4877 0.460 0.540 0.000
#> GSM11722     2  0.5859     0.7075 0.344 0.656 0.000
#> GSM11730     1  0.5948     0.0945 0.640 0.360 0.000
#> GSM11713     1  0.1163     0.8243 0.972 0.028 0.000
#> GSM11728     1  0.1163     0.8243 0.972 0.028 0.000
#> GSM27947     2  0.5058     0.7687 0.244 0.756 0.000
#> GSM27951     1  0.1643     0.8203 0.956 0.044 0.000
#> GSM11707     3  0.0000     0.8127 0.000 0.000 1.000
#> GSM11716     2  0.1015     0.7784 0.008 0.980 0.012
#> GSM11850     3  0.7223     0.4481 0.028 0.424 0.548
#> GSM11851     3  0.2945     0.8006 0.004 0.088 0.908
#> GSM11721     1  0.1643     0.8192 0.956 0.044 0.000
#> GSM11852     1  0.4539     0.7425 0.836 0.148 0.016
#> GSM11694     3  0.7820     0.5582 0.072 0.324 0.604
#> GSM11695     3  0.2703     0.8066 0.016 0.056 0.928
#> GSM11734     2  0.2448     0.7992 0.076 0.924 0.000
#> GSM11861     1  0.5327     0.5177 0.728 0.272 0.000
#> GSM11843     2  0.0424     0.7799 0.008 0.992 0.000
#> GSM11862     1  0.2261     0.8096 0.932 0.068 0.000
#> GSM11697     3  0.9319     0.2202 0.176 0.340 0.484
#> GSM11714     3  0.0237     0.8118 0.004 0.000 0.996
#> GSM11723     2  0.1031     0.7862 0.024 0.976 0.000
#> GSM11845     2  0.0424     0.7799 0.008 0.992 0.000
#> GSM11683     1  0.5268     0.6832 0.776 0.012 0.212
#> GSM11691     1  0.6062     0.4933 0.708 0.276 0.016
#> GSM27949     3  0.0892     0.8135 0.000 0.020 0.980
#> GSM27945     2  0.3550     0.7865 0.080 0.896 0.024
#> GSM11706     3  0.0000     0.8127 0.000 0.000 1.000
#> GSM11853     2  0.7984     0.6808 0.216 0.652 0.132
#> GSM11729     2  0.1643     0.7653 0.044 0.956 0.000
#> GSM11746     2  0.1529     0.7670 0.040 0.960 0.000
#> GSM11711     3  0.0661     0.8139 0.008 0.004 0.988
#> GSM11854     3  0.9452     0.2935 0.232 0.268 0.500
#> GSM11731     2  0.3752     0.7863 0.144 0.856 0.000
#> GSM11839     2  0.5948     0.7067 0.360 0.640 0.000
#> GSM11836     1  0.3412     0.7340 0.876 0.124 0.000
#> GSM11849     1  0.0000     0.8233 1.000 0.000 0.000
#> GSM11682     1  0.1031     0.8201 0.976 0.000 0.024
#> GSM11690     1  0.0000     0.8233 1.000 0.000 0.000
#> GSM11692     2  0.6299     0.4553 0.476 0.524 0.000
#> GSM11841     2  0.4346     0.7929 0.184 0.816 0.000
#> GSM11901     2  0.5560     0.7496 0.300 0.700 0.000
#> GSM11715     2  0.4842     0.7766 0.224 0.776 0.000
#> GSM11724     2  0.5138     0.7609 0.252 0.748 0.000
#> GSM11684     1  0.0000     0.8233 1.000 0.000 0.000
#> GSM11696     1  0.0592     0.8251 0.988 0.012 0.000
#> GSM27952     1  0.4702     0.6846 0.788 0.000 0.212
#> GSM27948     1  0.0592     0.8256 0.988 0.012 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.0000    0.77335 0.000 0.000 1.000 0.000
#> GSM11735     3  0.0336    0.77196 0.000 0.008 0.992 0.000
#> GSM11733     3  0.2644    0.73601 0.000 0.032 0.908 0.060
#> GSM11863     2  0.3687    0.66803 0.000 0.856 0.080 0.064
#> GSM11710     3  0.2589    0.70932 0.000 0.000 0.884 0.116
#> GSM11712     2  0.4872    0.36632 0.356 0.640 0.000 0.004
#> GSM11732     3  0.1042    0.77166 0.020 0.008 0.972 0.000
#> GSM11844     3  0.5167    0.45694 0.340 0.016 0.644 0.000
#> GSM11842     2  0.2623    0.70411 0.000 0.908 0.028 0.064
#> GSM11860     2  0.1042    0.72533 0.000 0.972 0.020 0.008
#> GSM11686     4  0.3681    0.69707 0.176 0.000 0.008 0.816
#> GSM11688     4  0.4998    0.00939 0.000 0.000 0.488 0.512
#> GSM11846     3  0.1398    0.76340 0.004 0.040 0.956 0.000
#> GSM11680     3  0.5940    0.52432 0.304 0.004 0.640 0.052
#> GSM11698     3  0.5310    0.29922 0.412 0.012 0.576 0.000
#> GSM11840     3  0.6412    0.39838 0.000 0.320 0.592 0.088
#> GSM11847     3  0.6746    0.38078 0.000 0.316 0.568 0.116
#> GSM11685     4  0.4697    0.42086 0.000 0.000 0.356 0.644
#> GSM11699     4  0.4539    0.66415 0.272 0.008 0.000 0.720
#> GSM27950     3  0.0188    0.77309 0.000 0.000 0.996 0.004
#> GSM27946     1  0.5174    0.62503 0.740 0.048 0.004 0.208
#> GSM11709     1  0.3486    0.68987 0.812 0.000 0.188 0.000
#> GSM11720     1  0.2081    0.78576 0.916 0.084 0.000 0.000
#> GSM11726     1  0.6401    0.64183 0.724 0.068 0.104 0.104
#> GSM11837     1  0.4991    0.44077 0.608 0.388 0.000 0.004
#> GSM11725     1  0.3400    0.74619 0.820 0.180 0.000 0.000
#> GSM11864     1  0.3649    0.73156 0.796 0.204 0.000 0.000
#> GSM11687     1  0.0817    0.77448 0.976 0.000 0.000 0.024
#> GSM11693     1  0.0817    0.78707 0.976 0.024 0.000 0.000
#> GSM11727     4  0.4477    0.63151 0.312 0.000 0.000 0.688
#> GSM11838     2  0.5448    0.58955 0.244 0.700 0.000 0.056
#> GSM11681     4  0.3494    0.74463 0.172 0.000 0.004 0.824
#> GSM11689     1  0.0188    0.78207 0.996 0.000 0.000 0.004
#> GSM11704     1  0.0188    0.78223 0.996 0.000 0.000 0.004
#> GSM11703     1  0.0000    0.78249 1.000 0.000 0.000 0.000
#> GSM11705     1  0.3893    0.60135 0.796 0.000 0.008 0.196
#> GSM11722     1  0.5297    0.45884 0.676 0.032 0.000 0.292
#> GSM11730     4  0.3649    0.72930 0.204 0.000 0.000 0.796
#> GSM11713     4  0.3311    0.74264 0.172 0.000 0.000 0.828
#> GSM11728     4  0.3219    0.74537 0.164 0.000 0.000 0.836
#> GSM27947     1  0.2216    0.78346 0.908 0.092 0.000 0.000
#> GSM27951     4  0.4103    0.69440 0.256 0.000 0.000 0.744
#> GSM11707     3  0.0000    0.77335 0.000 0.000 1.000 0.000
#> GSM11716     1  0.4282    0.77008 0.816 0.124 0.060 0.000
#> GSM11850     1  0.3486    0.73868 0.812 0.000 0.188 0.000
#> GSM11851     3  0.5167    0.03778 0.488 0.004 0.508 0.000
#> GSM11721     4  0.5228    0.65499 0.124 0.120 0.000 0.756
#> GSM11852     4  0.4632    0.61473 0.308 0.000 0.004 0.688
#> GSM11694     1  0.3710    0.73365 0.804 0.004 0.192 0.000
#> GSM11695     1  0.4406    0.58499 0.700 0.000 0.300 0.000
#> GSM11734     2  0.3710    0.66191 0.192 0.804 0.000 0.004
#> GSM11861     4  0.5268    0.48235 0.396 0.012 0.000 0.592
#> GSM11843     1  0.3942    0.70359 0.764 0.236 0.000 0.000
#> GSM11862     4  0.4088    0.68943 0.232 0.004 0.000 0.764
#> GSM11697     1  0.3668    0.73369 0.808 0.004 0.188 0.000
#> GSM11714     3  0.0188    0.77309 0.000 0.000 0.996 0.004
#> GSM11723     1  0.4304    0.64255 0.716 0.284 0.000 0.000
#> GSM11845     1  0.4277    0.64969 0.720 0.280 0.000 0.000
#> GSM11683     4  0.5407    0.71765 0.108 0.000 0.152 0.740
#> GSM11691     1  0.0992    0.78453 0.976 0.008 0.004 0.012
#> GSM27949     3  0.4697    0.41908 0.356 0.000 0.644 0.000
#> GSM27945     1  0.4171    0.77697 0.828 0.084 0.088 0.000
#> GSM11706     3  0.0000    0.77335 0.000 0.000 1.000 0.000
#> GSM11853     1  0.3550    0.78461 0.860 0.044 0.096 0.000
#> GSM11729     2  0.3688    0.59952 0.208 0.792 0.000 0.000
#> GSM11746     2  0.4992   -0.14764 0.476 0.524 0.000 0.000
#> GSM11711     3  0.2149    0.74389 0.088 0.000 0.912 0.000
#> GSM11854     1  0.5112    0.54267 0.716 0.004 0.252 0.028
#> GSM11731     2  0.0804    0.73372 0.008 0.980 0.000 0.012
#> GSM11839     2  0.4673    0.54553 0.008 0.700 0.000 0.292
#> GSM11836     2  0.4250    0.56676 0.000 0.724 0.000 0.276
#> GSM11849     4  0.1356    0.75698 0.032 0.008 0.000 0.960
#> GSM11682     4  0.0000    0.75201 0.000 0.000 0.000 1.000
#> GSM11690     4  0.0592    0.74854 0.000 0.016 0.000 0.984
#> GSM11692     2  0.7566    0.25218 0.212 0.468 0.000 0.320
#> GSM11841     2  0.4008    0.69430 0.148 0.820 0.000 0.032
#> GSM11901     2  0.5309    0.67049 0.164 0.744 0.000 0.092
#> GSM11715     2  0.1677    0.73886 0.012 0.948 0.000 0.040
#> GSM11724     2  0.1635    0.73826 0.008 0.948 0.000 0.044
#> GSM11684     4  0.1042    0.75111 0.008 0.020 0.000 0.972
#> GSM11696     4  0.3015    0.76262 0.092 0.024 0.000 0.884
#> GSM27952     4  0.0524    0.75308 0.004 0.000 0.008 0.988
#> GSM27948     4  0.3731    0.71905 0.120 0.036 0.000 0.844

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     3  0.0290     0.8256 0.000 0.000 0.992 0.008 0.000
#> GSM11735     3  0.0290     0.8256 0.000 0.000 0.992 0.008 0.000
#> GSM11733     3  0.3562     0.6257 0.000 0.000 0.788 0.016 0.196
#> GSM11863     5  0.0880     0.7506 0.000 0.000 0.032 0.000 0.968
#> GSM11710     3  0.3661     0.6157 0.000 0.000 0.724 0.276 0.000
#> GSM11712     1  0.4410     0.6536 0.764 0.000 0.000 0.112 0.124
#> GSM11732     3  0.1116     0.8146 0.028 0.004 0.964 0.004 0.000
#> GSM11844     3  0.4610     0.2348 0.388 0.000 0.596 0.016 0.000
#> GSM11842     5  0.0290     0.7530 0.000 0.000 0.008 0.000 0.992
#> GSM11860     5  0.0162     0.7526 0.000 0.000 0.004 0.000 0.996
#> GSM11686     4  0.1270     0.7892 0.052 0.000 0.000 0.948 0.000
#> GSM11688     4  0.0794     0.7649 0.000 0.000 0.028 0.972 0.000
#> GSM11846     3  0.3188     0.7552 0.028 0.000 0.860 0.012 0.100
#> GSM11680     1  0.4323     0.3081 0.656 0.000 0.012 0.332 0.000
#> GSM11698     1  0.2193     0.7761 0.912 0.000 0.060 0.028 0.000
#> GSM11840     5  0.4278     0.1537 0.000 0.000 0.452 0.000 0.548
#> GSM11847     5  0.4774     0.2004 0.000 0.000 0.424 0.020 0.556
#> GSM11685     4  0.0703     0.7671 0.000 0.000 0.024 0.976 0.000
#> GSM11699     4  0.4278     0.3938 0.452 0.000 0.000 0.548 0.000
#> GSM27950     3  0.1544     0.8029 0.000 0.000 0.932 0.068 0.000
#> GSM27946     1  0.4249    -0.0773 0.568 0.000 0.000 0.432 0.000
#> GSM11709     2  0.5847     0.4320 0.264 0.592 0.144 0.000 0.000
#> GSM11720     1  0.3218     0.7492 0.848 0.124 0.016 0.000 0.012
#> GSM11726     2  0.1173     0.7746 0.020 0.964 0.012 0.000 0.004
#> GSM11837     2  0.5008     0.1246 0.024 0.544 0.004 0.000 0.428
#> GSM11725     1  0.4258     0.7029 0.768 0.072 0.000 0.000 0.160
#> GSM11864     1  0.2522     0.7736 0.880 0.012 0.000 0.000 0.108
#> GSM11687     2  0.4504     0.1741 0.428 0.564 0.008 0.000 0.000
#> GSM11693     1  0.1965     0.7754 0.904 0.096 0.000 0.000 0.000
#> GSM11727     2  0.0451     0.7850 0.000 0.988 0.000 0.008 0.004
#> GSM11838     2  0.1892     0.7397 0.004 0.916 0.000 0.000 0.080
#> GSM11681     2  0.3895     0.4974 0.000 0.680 0.000 0.320 0.000
#> GSM11689     1  0.3741     0.6166 0.732 0.264 0.000 0.004 0.000
#> GSM11704     1  0.3612     0.6724 0.764 0.228 0.000 0.008 0.000
#> GSM11703     1  0.4074     0.4593 0.636 0.364 0.000 0.000 0.000
#> GSM11705     2  0.0324     0.7826 0.004 0.992 0.004 0.000 0.000
#> GSM11722     2  0.0451     0.7850 0.000 0.988 0.000 0.008 0.004
#> GSM11730     2  0.0451     0.7850 0.000 0.988 0.000 0.008 0.004
#> GSM11713     2  0.0703     0.7824 0.000 0.976 0.000 0.024 0.000
#> GSM11728     2  0.1121     0.7764 0.000 0.956 0.000 0.044 0.000
#> GSM27947     1  0.0290     0.7820 0.992 0.000 0.000 0.008 0.000
#> GSM27951     2  0.2127     0.7446 0.000 0.892 0.000 0.108 0.000
#> GSM11707     3  0.0000     0.8252 0.000 0.000 1.000 0.000 0.000
#> GSM11716     1  0.3018     0.7657 0.860 0.012 0.116 0.000 0.012
#> GSM11850     1  0.3934     0.5895 0.716 0.008 0.276 0.000 0.000
#> GSM11851     1  0.2971     0.7477 0.836 0.000 0.156 0.008 0.000
#> GSM11721     4  0.2777     0.7887 0.120 0.000 0.000 0.864 0.016
#> GSM11852     4  0.4201     0.4704 0.408 0.000 0.000 0.592 0.000
#> GSM11694     1  0.2233     0.7762 0.892 0.004 0.104 0.000 0.000
#> GSM11695     1  0.3675     0.6749 0.772 0.008 0.216 0.004 0.000
#> GSM11734     5  0.4383     0.1368 0.424 0.004 0.000 0.000 0.572
#> GSM11861     1  0.4291    -0.2035 0.536 0.000 0.000 0.464 0.000
#> GSM11843     1  0.2352     0.7807 0.896 0.008 0.000 0.004 0.092
#> GSM11862     4  0.3861     0.6754 0.284 0.004 0.000 0.712 0.000
#> GSM11697     1  0.1892     0.7856 0.916 0.000 0.080 0.004 0.000
#> GSM11714     3  0.0451     0.8253 0.000 0.004 0.988 0.008 0.000
#> GSM11723     1  0.3128     0.7387 0.824 0.004 0.000 0.004 0.168
#> GSM11845     1  0.1764     0.7842 0.928 0.000 0.000 0.008 0.064
#> GSM11683     4  0.3544     0.7291 0.016 0.028 0.120 0.836 0.000
#> GSM11691     1  0.1197     0.7688 0.952 0.000 0.000 0.048 0.000
#> GSM27949     3  0.4449    -0.0876 0.484 0.000 0.512 0.004 0.000
#> GSM27945     1  0.0162     0.7829 0.996 0.000 0.000 0.004 0.000
#> GSM11706     3  0.0000     0.8252 0.000 0.000 1.000 0.000 0.000
#> GSM11853     1  0.0693     0.7842 0.980 0.000 0.012 0.008 0.000
#> GSM11729     5  0.1830     0.7340 0.008 0.068 0.000 0.000 0.924
#> GSM11746     5  0.3141     0.7018 0.040 0.096 0.004 0.000 0.860
#> GSM11711     3  0.0693     0.8222 0.008 0.012 0.980 0.000 0.000
#> GSM11854     1  0.3455     0.5989 0.784 0.000 0.008 0.208 0.000
#> GSM11731     5  0.0324     0.7525 0.000 0.004 0.000 0.004 0.992
#> GSM11839     5  0.3662     0.5572 0.004 0.000 0.000 0.252 0.744
#> GSM11836     5  0.1410     0.7406 0.000 0.000 0.000 0.060 0.940
#> GSM11849     2  0.4617     0.1472 0.000 0.552 0.000 0.436 0.012
#> GSM11682     4  0.0963     0.7633 0.000 0.036 0.000 0.964 0.000
#> GSM11690     4  0.1153     0.7716 0.008 0.024 0.000 0.964 0.004
#> GSM11692     4  0.4608     0.5943 0.336 0.000 0.000 0.640 0.024
#> GSM11841     5  0.6569    -0.0162 0.232 0.000 0.000 0.304 0.464
#> GSM11901     4  0.6202     0.5419 0.228 0.000 0.000 0.552 0.220
#> GSM11715     5  0.2773     0.6671 0.000 0.164 0.000 0.000 0.836
#> GSM11724     5  0.2329     0.7034 0.000 0.124 0.000 0.000 0.876
#> GSM11684     4  0.3299     0.6925 0.004 0.152 0.000 0.828 0.016
#> GSM11696     4  0.4564     0.7480 0.196 0.036 0.000 0.748 0.020
#> GSM27952     4  0.0955     0.7651 0.000 0.028 0.004 0.968 0.000
#> GSM27948     4  0.2672     0.7904 0.116 0.004 0.000 0.872 0.008

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6  0.0000     0.7473 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM11735     6  0.0000     0.7473 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM11733     6  0.4423     0.4233 0.016 0.000 0.000 0.020 0.320 0.644
#> GSM11863     5  0.0972     0.6478 0.008 0.000 0.000 0.000 0.964 0.028
#> GSM11710     6  0.5237     0.4987 0.140 0.000 0.000 0.240 0.004 0.616
#> GSM11712     3  0.6257     0.3797 0.052 0.000 0.544 0.124 0.276 0.004
#> GSM11732     6  0.2432     0.7044 0.024 0.000 0.100 0.000 0.000 0.876
#> GSM11844     6  0.4567     0.2892 0.004 0.024 0.352 0.008 0.000 0.612
#> GSM11842     5  0.0653     0.6496 0.004 0.000 0.000 0.004 0.980 0.012
#> GSM11860     5  0.0935     0.6457 0.032 0.000 0.000 0.000 0.964 0.004
#> GSM11686     4  0.2800     0.6951 0.100 0.000 0.036 0.860 0.000 0.004
#> GSM11688     4  0.2831     0.6609 0.136 0.000 0.000 0.840 0.000 0.024
#> GSM11846     1  0.7097     0.1876 0.440 0.000 0.004 0.112 0.296 0.148
#> GSM11680     3  0.5267     0.4760 0.028 0.000 0.644 0.236 0.000 0.092
#> GSM11698     3  0.4165     0.6091 0.020 0.000 0.772 0.088 0.000 0.120
#> GSM11840     5  0.2963     0.5883 0.016 0.000 0.000 0.004 0.828 0.152
#> GSM11847     5  0.3782     0.5700 0.016 0.000 0.000 0.044 0.788 0.152
#> GSM11685     4  0.1713     0.6885 0.044 0.000 0.000 0.928 0.000 0.028
#> GSM11699     3  0.5172    -0.0209 0.060 0.012 0.524 0.404 0.000 0.000
#> GSM27950     6  0.2215     0.7321 0.012 0.000 0.012 0.076 0.000 0.900
#> GSM27946     3  0.5400     0.0175 0.116 0.000 0.484 0.400 0.000 0.000
#> GSM11709     1  0.5979     0.5356 0.656 0.104 0.132 0.000 0.020 0.088
#> GSM11720     1  0.5507     0.4178 0.532 0.044 0.376 0.000 0.048 0.000
#> GSM11726     2  0.4323     0.4154 0.324 0.648 0.012 0.000 0.012 0.004
#> GSM11837     2  0.6380    -0.2162 0.136 0.428 0.036 0.000 0.396 0.004
#> GSM11725     1  0.6288     0.3806 0.472 0.048 0.356 0.000 0.124 0.000
#> GSM11864     3  0.5727    -0.2843 0.396 0.004 0.456 0.000 0.144 0.000
#> GSM11687     1  0.4468     0.5965 0.712 0.076 0.204 0.008 0.000 0.000
#> GSM11693     1  0.4307     0.4549 0.604 0.008 0.376 0.004 0.008 0.000
#> GSM11727     2  0.1765     0.7168 0.096 0.904 0.000 0.000 0.000 0.000
#> GSM11838     2  0.2954     0.6196 0.048 0.852 0.004 0.000 0.096 0.000
#> GSM11681     1  0.4934     0.2085 0.628 0.108 0.000 0.264 0.000 0.000
#> GSM11689     1  0.4456     0.5675 0.676 0.028 0.276 0.020 0.000 0.000
#> GSM11704     1  0.4433     0.5421 0.656 0.016 0.304 0.024 0.000 0.000
#> GSM11703     1  0.5223     0.4348 0.508 0.096 0.396 0.000 0.000 0.000
#> GSM11705     1  0.4089    -0.2214 0.524 0.468 0.008 0.000 0.000 0.000
#> GSM11722     2  0.1910     0.7185 0.108 0.892 0.000 0.000 0.000 0.000
#> GSM11730     2  0.1714     0.7211 0.092 0.908 0.000 0.000 0.000 0.000
#> GSM11713     2  0.3374     0.6408 0.208 0.772 0.000 0.020 0.000 0.000
#> GSM11728     2  0.3290     0.6448 0.208 0.776 0.000 0.016 0.000 0.000
#> GSM27947     3  0.4335     0.2012 0.324 0.000 0.644 0.024 0.008 0.000
#> GSM27951     1  0.4012     0.3307 0.752 0.164 0.000 0.084 0.000 0.000
#> GSM11707     6  0.0363     0.7468 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM11716     3  0.2519     0.6000 0.044 0.004 0.884 0.000 0.000 0.068
#> GSM11850     3  0.4214     0.4805 0.044 0.000 0.680 0.000 0.000 0.276
#> GSM11851     3  0.3141     0.5808 0.012 0.000 0.788 0.000 0.000 0.200
#> GSM11721     4  0.3718     0.6830 0.052 0.000 0.080 0.824 0.040 0.004
#> GSM11852     4  0.4809     0.5009 0.080 0.000 0.272 0.644 0.000 0.004
#> GSM11694     3  0.3948     0.5460 0.064 0.000 0.748 0.000 0.000 0.188
#> GSM11695     3  0.4652     0.4277 0.064 0.000 0.624 0.000 0.000 0.312
#> GSM11734     3  0.5677     0.2603 0.012 0.136 0.596 0.008 0.248 0.000
#> GSM11861     3  0.3848     0.4816 0.040 0.000 0.752 0.204 0.004 0.000
#> GSM11843     3  0.2630     0.5870 0.032 0.004 0.872 0.000 0.092 0.000
#> GSM11862     4  0.5487     0.2547 0.052 0.012 0.416 0.504 0.016 0.000
#> GSM11697     3  0.3239     0.5909 0.024 0.000 0.808 0.004 0.000 0.164
#> GSM11714     6  0.1555     0.7356 0.004 0.060 0.000 0.004 0.000 0.932
#> GSM11723     3  0.3493     0.5421 0.016 0.144 0.812 0.004 0.024 0.000
#> GSM11845     3  0.1312     0.6071 0.012 0.004 0.956 0.008 0.020 0.000
#> GSM11683     4  0.7053     0.2803 0.104 0.064 0.044 0.480 0.000 0.308
#> GSM11691     3  0.3298     0.6109 0.060 0.000 0.844 0.072 0.000 0.024
#> GSM27949     6  0.4799     0.2364 0.068 0.000 0.340 0.000 0.000 0.592
#> GSM27945     3  0.2196     0.5689 0.108 0.000 0.884 0.004 0.000 0.004
#> GSM11706     6  0.2362     0.6852 0.136 0.000 0.000 0.000 0.004 0.860
#> GSM11853     3  0.4808     0.0641 0.384 0.000 0.568 0.036 0.012 0.000
#> GSM11729     5  0.5479     0.5353 0.104 0.240 0.024 0.004 0.628 0.000
#> GSM11746     5  0.6111     0.4353 0.196 0.240 0.020 0.004 0.540 0.000
#> GSM11711     6  0.4389     0.1641 0.448 0.000 0.024 0.000 0.000 0.528
#> GSM11854     3  0.5081     0.4305 0.128 0.000 0.616 0.256 0.000 0.000
#> GSM11731     5  0.4605     0.5972 0.016 0.216 0.056 0.004 0.708 0.000
#> GSM11839     5  0.7201     0.4668 0.016 0.196 0.144 0.144 0.500 0.000
#> GSM11836     5  0.3777     0.6320 0.004 0.124 0.000 0.084 0.788 0.000
#> GSM11849     2  0.4750     0.4150 0.064 0.672 0.004 0.252 0.008 0.000
#> GSM11682     4  0.2165     0.6788 0.108 0.008 0.000 0.884 0.000 0.000
#> GSM11690     4  0.1925     0.7029 0.060 0.004 0.008 0.920 0.008 0.000
#> GSM11692     4  0.6036     0.5045 0.088 0.016 0.252 0.596 0.048 0.000
#> GSM11841     5  0.7026    -0.0571 0.044 0.008 0.300 0.224 0.420 0.004
#> GSM11901     4  0.7428     0.3047 0.064 0.016 0.272 0.396 0.248 0.004
#> GSM11715     5  0.5622     0.4221 0.048 0.388 0.024 0.016 0.524 0.000
#> GSM11724     5  0.5613     0.4421 0.044 0.376 0.028 0.016 0.536 0.000
#> GSM11684     4  0.6080     0.3802 0.048 0.328 0.036 0.548 0.040 0.000
#> GSM11696     4  0.7584     0.4643 0.084 0.224 0.196 0.452 0.044 0.000
#> GSM27952     4  0.2544     0.6627 0.140 0.004 0.000 0.852 0.000 0.004
#> GSM27948     4  0.3667     0.6889 0.088 0.004 0.056 0.824 0.028 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-NMF-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>          n cell.line(p) agent(p)  time(p) k
#> MAD:NMF 75     8.35e-07    0.569 2.12e-01 2
#> MAD:NMF 74     1.64e-06    0.571 7.03e-05 3
#> MAD:NMF 69     6.52e-06    0.150 3.06e-06 4
#> MAD:NMF 66     4.65e-10    0.158 3.40e-05 5
#> MAD:NMF 45     1.64e-09    0.277 9.10e-06 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:hclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "hclust"]
# you can also extract it by
# res = res_list["ATC:hclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-hclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-hclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.461           0.788       0.896         0.4139 0.584   0.584
#> 3 3 0.321           0.417       0.718         0.3963 0.918   0.865
#> 4 4 0.493           0.573       0.720         0.2350 0.619   0.362
#> 5 5 0.635           0.592       0.754         0.0848 0.944   0.800
#> 6 6 0.669           0.640       0.740         0.0461 0.875   0.525

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1  0.0938     0.8831 0.988 0.012
#> GSM11735     1  0.0938     0.8831 0.988 0.012
#> GSM11733     1  0.8555     0.6022 0.720 0.280
#> GSM11863     2  0.8813     0.6630 0.300 0.700
#> GSM11710     1  0.0938     0.8831 0.988 0.012
#> GSM11712     2  0.8813     0.6630 0.300 0.700
#> GSM11732     1  0.9580     0.3858 0.620 0.380
#> GSM11844     1  0.9580     0.3858 0.620 0.380
#> GSM11842     2  0.6531     0.8229 0.168 0.832
#> GSM11860     2  0.7299     0.7907 0.204 0.796
#> GSM11686     1  0.0938     0.8831 0.988 0.012
#> GSM11688     1  0.0938     0.8831 0.988 0.012
#> GSM11846     1  0.1843     0.8867 0.972 0.028
#> GSM11680     1  0.0000     0.8862 1.000 0.000
#> GSM11698     1  0.1633     0.8866 0.976 0.024
#> GSM11840     1  0.8608     0.5951 0.716 0.284
#> GSM11847     1  0.8608     0.5951 0.716 0.284
#> GSM11685     1  0.0938     0.8831 0.988 0.012
#> GSM11699     1  0.1843     0.8861 0.972 0.028
#> GSM27950     1  0.0938     0.8831 0.988 0.012
#> GSM27946     1  0.2043     0.8854 0.968 0.032
#> GSM11709     1  0.1414     0.8876 0.980 0.020
#> GSM11720     1  0.5946     0.7879 0.856 0.144
#> GSM11726     1  0.5946     0.7879 0.856 0.144
#> GSM11837     2  0.3733     0.8533 0.072 0.928
#> GSM11725     2  0.0938     0.8482 0.012 0.988
#> GSM11864     2  0.0938     0.8482 0.012 0.988
#> GSM11687     1  0.1414     0.8876 0.980 0.020
#> GSM11693     1  0.1414     0.8876 0.980 0.020
#> GSM11727     2  0.5946     0.8375 0.144 0.856
#> GSM11838     2  0.0938     0.8482 0.012 0.988
#> GSM11681     1  0.1184     0.8876 0.984 0.016
#> GSM11689     1  0.1414     0.8876 0.980 0.020
#> GSM11704     1  0.1414     0.8876 0.980 0.020
#> GSM11703     1  0.1633     0.8869 0.976 0.024
#> GSM11705     1  0.1633     0.8869 0.976 0.024
#> GSM11722     1  0.9944     0.0763 0.544 0.456
#> GSM11730     1  0.9944     0.0763 0.544 0.456
#> GSM11713     1  0.1184     0.8876 0.984 0.016
#> GSM11728     1  0.1184     0.8876 0.984 0.016
#> GSM27947     1  0.2043     0.8854 0.968 0.032
#> GSM27951     1  0.1414     0.8876 0.980 0.020
#> GSM11707     1  0.0938     0.8831 0.988 0.012
#> GSM11716     2  0.8016     0.7404 0.244 0.756
#> GSM11850     1  0.5059     0.8355 0.888 0.112
#> GSM11851     1  0.2236     0.8842 0.964 0.036
#> GSM11721     1  0.9393     0.4410 0.644 0.356
#> GSM11852     1  0.2043     0.8856 0.968 0.032
#> GSM11694     1  0.0376     0.8869 0.996 0.004
#> GSM11695     1  0.0376     0.8869 0.996 0.004
#> GSM11734     2  0.0938     0.8482 0.012 0.988
#> GSM11861     1  0.9393     0.4410 0.644 0.356
#> GSM11843     2  0.2423     0.8522 0.040 0.960
#> GSM11862     1  0.9393     0.4410 0.644 0.356
#> GSM11697     1  0.0000     0.8862 1.000 0.000
#> GSM11714     1  0.0938     0.8831 0.988 0.012
#> GSM11723     2  0.5178     0.8486 0.116 0.884
#> GSM11845     2  0.5178     0.8486 0.116 0.884
#> GSM11683     1  0.2043     0.8852 0.968 0.032
#> GSM11691     1  0.1633     0.8870 0.976 0.024
#> GSM27949     1  0.0938     0.8831 0.988 0.012
#> GSM27945     1  0.2043     0.8854 0.968 0.032
#> GSM11706     1  0.0938     0.8831 0.988 0.012
#> GSM11853     1  0.2043     0.8856 0.968 0.032
#> GSM11729     2  0.0938     0.8482 0.012 0.988
#> GSM11746     2  0.0938     0.8482 0.012 0.988
#> GSM11711     1  0.2043     0.8856 0.968 0.032
#> GSM11854     1  0.2043     0.8856 0.968 0.032
#> GSM11731     2  0.0938     0.8482 0.012 0.988
#> GSM11839     2  0.5519     0.8458 0.128 0.872
#> GSM11836     2  0.6048     0.8363 0.148 0.852
#> GSM11849     1  0.6048     0.7880 0.852 0.148
#> GSM11682     1  0.0938     0.8831 0.988 0.012
#> GSM11690     1  0.6148     0.7889 0.848 0.152
#> GSM11692     2  0.9977     0.1649 0.472 0.528
#> GSM11841     2  0.8813     0.6630 0.300 0.700
#> GSM11901     2  0.8813     0.6630 0.300 0.700
#> GSM11715     2  0.0938     0.8482 0.012 0.988
#> GSM11724     2  0.0938     0.8482 0.012 0.988
#> GSM11684     1  0.5519     0.8082 0.872 0.128
#> GSM11696     1  0.5519     0.8082 0.872 0.128
#> GSM27952     1  0.0938     0.8831 0.988 0.012
#> GSM27948     1  0.6887     0.7490 0.816 0.184

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     1  0.5706   0.511765 0.680 0.000 0.320
#> GSM11735     1  0.5706   0.511765 0.680 0.000 0.320
#> GSM11733     1  0.5678   0.233355 0.684 0.000 0.316
#> GSM11863     3  0.9894   0.610660 0.264 0.356 0.380
#> GSM11710     1  0.5706   0.521823 0.680 0.000 0.320
#> GSM11712     3  0.9894   0.610660 0.264 0.356 0.380
#> GSM11732     1  0.7676  -0.050157 0.584 0.056 0.360
#> GSM11844     1  0.7676  -0.050157 0.584 0.056 0.360
#> GSM11842     2  0.9130  -0.146850 0.152 0.492 0.356
#> GSM11860     2  0.9442  -0.269044 0.184 0.456 0.360
#> GSM11686     1  0.5733   0.512204 0.676 0.000 0.324
#> GSM11688     1  0.5733   0.512204 0.676 0.000 0.324
#> GSM11846     1  0.2711   0.611546 0.912 0.000 0.088
#> GSM11680     1  0.2165   0.617420 0.936 0.000 0.064
#> GSM11698     1  0.1163   0.618979 0.972 0.000 0.028
#> GSM11840     1  0.5902   0.224732 0.680 0.004 0.316
#> GSM11847     1  0.5902   0.224732 0.680 0.004 0.316
#> GSM11685     1  0.5733   0.512204 0.676 0.000 0.324
#> GSM11699     1  0.0892   0.617772 0.980 0.000 0.020
#> GSM27950     1  0.5706   0.511765 0.680 0.000 0.320
#> GSM27946     1  0.1031   0.616872 0.976 0.000 0.024
#> GSM11709     1  0.5968   0.425046 0.636 0.000 0.364
#> GSM11720     1  0.8610   0.264017 0.548 0.116 0.336
#> GSM11726     1  0.8610   0.264017 0.548 0.116 0.336
#> GSM11837     2  0.5117   0.520135 0.060 0.832 0.108
#> GSM11725     2  0.0000   0.625647 0.000 1.000 0.000
#> GSM11864     2  0.0000   0.625647 0.000 1.000 0.000
#> GSM11687     1  0.5968   0.425046 0.636 0.000 0.364
#> GSM11693     1  0.5968   0.425046 0.636 0.000 0.364
#> GSM11727     2  0.6936   0.356917 0.108 0.732 0.160
#> GSM11838     2  0.0000   0.625647 0.000 1.000 0.000
#> GSM11681     1  0.6045   0.429074 0.620 0.000 0.380
#> GSM11689     1  0.5968   0.425046 0.636 0.000 0.364
#> GSM11704     1  0.5968   0.425046 0.636 0.000 0.364
#> GSM11703     1  0.6148   0.426734 0.640 0.004 0.356
#> GSM11705     1  0.6148   0.426734 0.640 0.004 0.356
#> GSM11722     3  0.9951   0.375098 0.296 0.324 0.380
#> GSM11730     3  0.9951   0.375098 0.296 0.324 0.380
#> GSM11713     1  0.5835   0.452004 0.660 0.000 0.340
#> GSM11728     1  0.5835   0.452004 0.660 0.000 0.340
#> GSM27947     1  0.1031   0.616872 0.976 0.000 0.024
#> GSM27951     1  0.5968   0.425046 0.636 0.000 0.364
#> GSM11707     1  0.5706   0.511765 0.680 0.000 0.320
#> GSM11716     2  0.9714  -0.503339 0.224 0.420 0.356
#> GSM11850     1  0.3875   0.570094 0.888 0.044 0.068
#> GSM11851     1  0.1411   0.615007 0.964 0.000 0.036
#> GSM11721     1  0.7339  -0.026827 0.572 0.036 0.392
#> GSM11852     1  0.1529   0.617467 0.960 0.000 0.040
#> GSM11694     1  0.0747   0.621325 0.984 0.000 0.016
#> GSM11695     1  0.0747   0.621325 0.984 0.000 0.016
#> GSM11734     2  0.0000   0.625647 0.000 1.000 0.000
#> GSM11861     1  0.7339  -0.026827 0.572 0.036 0.392
#> GSM11843     2  0.6608   0.317584 0.016 0.628 0.356
#> GSM11862     1  0.7339  -0.026827 0.572 0.036 0.392
#> GSM11697     1  0.1031   0.621375 0.976 0.000 0.024
#> GSM11714     1  0.5706   0.511765 0.680 0.000 0.320
#> GSM11723     2  0.8457   0.080121 0.100 0.544 0.356
#> GSM11845     2  0.8457   0.080121 0.100 0.544 0.356
#> GSM11683     1  0.4931   0.563649 0.768 0.000 0.232
#> GSM11691     1  0.0892   0.619658 0.980 0.000 0.020
#> GSM27949     1  0.5291   0.538368 0.732 0.000 0.268
#> GSM27945     1  0.1031   0.616872 0.976 0.000 0.024
#> GSM11706     1  0.5706   0.511765 0.680 0.000 0.320
#> GSM11853     1  0.1529   0.617467 0.960 0.000 0.040
#> GSM11729     2  0.0000   0.625647 0.000 1.000 0.000
#> GSM11746     2  0.0000   0.625647 0.000 1.000 0.000
#> GSM11711     1  0.1529   0.617467 0.960 0.000 0.040
#> GSM11854     1  0.1529   0.617467 0.960 0.000 0.040
#> GSM11731     2  0.0000   0.625647 0.000 1.000 0.000
#> GSM11839     2  0.8346   0.093674 0.092 0.548 0.360
#> GSM11836     2  0.8649   0.000203 0.112 0.528 0.360
#> GSM11849     1  0.4974   0.456582 0.764 0.000 0.236
#> GSM11682     1  0.5859   0.514436 0.656 0.000 0.344
#> GSM11690     1  0.5327   0.453525 0.728 0.000 0.272
#> GSM11692     1  0.9520  -0.518219 0.416 0.188 0.396
#> GSM11841     3  0.9894   0.610660 0.264 0.356 0.380
#> GSM11901     3  0.9894   0.610660 0.264 0.356 0.380
#> GSM11715     2  0.0000   0.625647 0.000 1.000 0.000
#> GSM11724     2  0.0000   0.625647 0.000 1.000 0.000
#> GSM11684     1  0.4750   0.484854 0.784 0.000 0.216
#> GSM11696     1  0.4750   0.484854 0.784 0.000 0.216
#> GSM27952     1  0.5706   0.514785 0.680 0.000 0.320
#> GSM27948     1  0.6025   0.403145 0.740 0.028 0.232

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.0000     0.6847 0.000 0.000 1.000 0.000
#> GSM11735     3  0.0000     0.6847 0.000 0.000 1.000 0.000
#> GSM11733     4  0.4671     0.3675 0.028 0.000 0.220 0.752
#> GSM11863     4  0.4277     0.3134 0.000 0.280 0.000 0.720
#> GSM11710     3  0.2944     0.6451 0.004 0.000 0.868 0.128
#> GSM11712     4  0.4277     0.3134 0.000 0.280 0.000 0.720
#> GSM11732     4  0.3577     0.4869 0.000 0.012 0.156 0.832
#> GSM11844     4  0.3577     0.4869 0.000 0.012 0.156 0.832
#> GSM11842     4  0.5337     0.0715 0.012 0.424 0.000 0.564
#> GSM11860     4  0.6306     0.1425 0.064 0.392 0.000 0.544
#> GSM11686     3  0.2281     0.6472 0.000 0.000 0.904 0.096
#> GSM11688     3  0.2281     0.6472 0.000 0.000 0.904 0.096
#> GSM11846     3  0.7325     0.5760 0.208 0.000 0.528 0.264
#> GSM11680     3  0.5633     0.7153 0.100 0.000 0.716 0.184
#> GSM11698     3  0.6377     0.6988 0.112 0.000 0.632 0.256
#> GSM11840     4  0.5397     0.3322 0.064 0.000 0.220 0.716
#> GSM11847     4  0.5397     0.3322 0.064 0.000 0.220 0.716
#> GSM11685     3  0.2281     0.6472 0.000 0.000 0.904 0.096
#> GSM11699     3  0.6477     0.6920 0.116 0.000 0.620 0.264
#> GSM27950     3  0.0188     0.6855 0.000 0.000 0.996 0.004
#> GSM27946     3  0.6422     0.6872 0.104 0.000 0.616 0.280
#> GSM11709     1  0.0000     0.8679 1.000 0.000 0.000 0.000
#> GSM11720     1  0.4426     0.7289 0.812 0.092 0.000 0.096
#> GSM11726     1  0.4426     0.7289 0.812 0.092 0.000 0.096
#> GSM11837     2  0.3649     0.6657 0.000 0.796 0.000 0.204
#> GSM11725     2  0.0000     0.8462 0.000 1.000 0.000 0.000
#> GSM11864     2  0.0000     0.8462 0.000 1.000 0.000 0.000
#> GSM11687     1  0.0000     0.8679 1.000 0.000 0.000 0.000
#> GSM11693     1  0.0000     0.8679 1.000 0.000 0.000 0.000
#> GSM11727     2  0.5657     0.5291 0.068 0.688 0.000 0.244
#> GSM11838     2  0.0000     0.8462 0.000 1.000 0.000 0.000
#> GSM11681     1  0.1356     0.8504 0.960 0.000 0.032 0.008
#> GSM11689     1  0.0000     0.8679 1.000 0.000 0.000 0.000
#> GSM11704     1  0.0000     0.8679 1.000 0.000 0.000 0.000
#> GSM11703     1  0.0376     0.8665 0.992 0.000 0.004 0.004
#> GSM11705     1  0.0376     0.8665 0.992 0.000 0.004 0.004
#> GSM11722     1  0.7622     0.1954 0.472 0.280 0.000 0.248
#> GSM11730     1  0.7622     0.1954 0.472 0.280 0.000 0.248
#> GSM11713     1  0.1624     0.8405 0.952 0.000 0.028 0.020
#> GSM11728     1  0.1624     0.8405 0.952 0.000 0.028 0.020
#> GSM27947     3  0.6422     0.6872 0.104 0.000 0.616 0.280
#> GSM27951     1  0.0000     0.8679 1.000 0.000 0.000 0.000
#> GSM11707     3  0.0000     0.6847 0.000 0.000 1.000 0.000
#> GSM11716     4  0.5428     0.1480 0.004 0.360 0.016 0.620
#> GSM11850     3  0.6502     0.5144 0.048 0.012 0.528 0.412
#> GSM11851     3  0.6240     0.6624 0.076 0.000 0.604 0.320
#> GSM11721     4  0.4957     0.4379 0.112 0.000 0.112 0.776
#> GSM11852     3  0.6477     0.6768 0.100 0.000 0.600 0.300
#> GSM11694     3  0.6198     0.7093 0.116 0.000 0.660 0.224
#> GSM11695     3  0.6198     0.7093 0.116 0.000 0.660 0.224
#> GSM11734     2  0.0000     0.8462 0.000 1.000 0.000 0.000
#> GSM11861     4  0.5012     0.4369 0.116 0.000 0.112 0.772
#> GSM11843     2  0.4898     0.2528 0.000 0.584 0.000 0.416
#> GSM11862     4  0.5012     0.4369 0.116 0.000 0.112 0.772
#> GSM11697     3  0.6083     0.7111 0.112 0.000 0.672 0.216
#> GSM11714     3  0.0000     0.6847 0.000 0.000 1.000 0.000
#> GSM11723     4  0.4996    -0.1049 0.000 0.484 0.000 0.516
#> GSM11845     4  0.4996    -0.1049 0.000 0.484 0.000 0.516
#> GSM11683     3  0.3734     0.6871 0.108 0.000 0.848 0.044
#> GSM11691     3  0.6373     0.7011 0.116 0.000 0.636 0.248
#> GSM27949     3  0.1940     0.7022 0.000 0.000 0.924 0.076
#> GSM27945     3  0.6422     0.6872 0.104 0.000 0.616 0.280
#> GSM11706     3  0.2216     0.6491 0.000 0.000 0.908 0.092
#> GSM11853     3  0.6477     0.6768 0.100 0.000 0.600 0.300
#> GSM11729     2  0.0000     0.8462 0.000 1.000 0.000 0.000
#> GSM11746     2  0.0000     0.8462 0.000 1.000 0.000 0.000
#> GSM11711     3  0.6477     0.6768 0.100 0.000 0.600 0.300
#> GSM11854     3  0.6477     0.6768 0.100 0.000 0.600 0.300
#> GSM11731     2  0.0000     0.8462 0.000 1.000 0.000 0.000
#> GSM11839     2  0.5697     0.0287 0.024 0.488 0.000 0.488
#> GSM11836     4  0.5688    -0.0615 0.024 0.464 0.000 0.512
#> GSM11849     4  0.7106     0.2403 0.324 0.000 0.148 0.528
#> GSM11682     3  0.3166     0.6306 0.016 0.000 0.868 0.116
#> GSM11690     4  0.7443     0.2263 0.312 0.000 0.196 0.492
#> GSM11692     4  0.4734     0.4930 0.072 0.128 0.004 0.796
#> GSM11841     4  0.4277     0.3134 0.000 0.280 0.000 0.720
#> GSM11901     4  0.4277     0.3134 0.000 0.280 0.000 0.720
#> GSM11715     2  0.0000     0.8462 0.000 1.000 0.000 0.000
#> GSM11724     2  0.0000     0.8462 0.000 1.000 0.000 0.000
#> GSM11684     4  0.7207     0.2090 0.376 0.000 0.144 0.480
#> GSM11696     4  0.7207     0.2090 0.376 0.000 0.144 0.480
#> GSM27952     3  0.2466     0.6474 0.004 0.000 0.900 0.096
#> GSM27948     4  0.6729     0.2965 0.312 0.000 0.116 0.572

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     3  0.0162      0.571 0.000 0.000 0.996 0.000 0.004
#> GSM11735     3  0.0162      0.571 0.000 0.000 0.996 0.000 0.004
#> GSM11733     5  0.6392     -0.131 0.000 0.000 0.176 0.356 0.468
#> GSM11863     5  0.2069      0.621 0.000 0.012 0.000 0.076 0.912
#> GSM11710     3  0.3607      0.423 0.000 0.000 0.752 0.244 0.004
#> GSM11712     5  0.3242      0.632 0.000 0.012 0.000 0.172 0.816
#> GSM11732     5  0.5365      0.177 0.000 0.000 0.116 0.228 0.656
#> GSM11844     5  0.5365      0.177 0.000 0.000 0.116 0.228 0.656
#> GSM11842     5  0.5917      0.613 0.000 0.180 0.000 0.224 0.596
#> GSM11860     5  0.6735      0.569 0.020 0.176 0.000 0.288 0.516
#> GSM11686     3  0.3333      0.440 0.000 0.000 0.788 0.208 0.004
#> GSM11688     3  0.3333      0.440 0.000 0.000 0.788 0.208 0.004
#> GSM11846     3  0.6991      0.447 0.148 0.000 0.492 0.320 0.040
#> GSM11680     3  0.4577      0.602 0.024 0.000 0.676 0.296 0.004
#> GSM11698     3  0.5161      0.586 0.024 0.000 0.568 0.396 0.012
#> GSM11840     4  0.6439      0.122 0.000 0.000 0.176 0.416 0.408
#> GSM11847     4  0.6439      0.122 0.000 0.000 0.176 0.416 0.408
#> GSM11685     3  0.3333      0.440 0.000 0.000 0.788 0.208 0.004
#> GSM11699     3  0.5270      0.578 0.024 0.000 0.556 0.404 0.016
#> GSM27950     3  0.0510      0.576 0.000 0.000 0.984 0.016 0.000
#> GSM27946     3  0.5121      0.574 0.012 0.000 0.552 0.416 0.020
#> GSM11709     1  0.0162      0.865 0.996 0.000 0.000 0.004 0.000
#> GSM11720     1  0.3556      0.741 0.808 0.020 0.000 0.004 0.168
#> GSM11726     1  0.3556      0.741 0.808 0.020 0.000 0.004 0.168
#> GSM11837     2  0.4030      0.407 0.000 0.648 0.000 0.000 0.352
#> GSM11725     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000
#> GSM11864     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000
#> GSM11687     1  0.0162      0.865 0.996 0.000 0.000 0.004 0.000
#> GSM11693     1  0.0162      0.865 0.996 0.000 0.000 0.004 0.000
#> GSM11727     2  0.6795      0.151 0.048 0.524 0.000 0.112 0.316
#> GSM11838     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000
#> GSM11681     1  0.1564      0.844 0.948 0.000 0.024 0.024 0.004
#> GSM11689     1  0.0162      0.865 0.996 0.000 0.000 0.004 0.000
#> GSM11704     1  0.0162      0.865 0.996 0.000 0.000 0.004 0.000
#> GSM11703     1  0.0566      0.862 0.984 0.000 0.000 0.012 0.004
#> GSM11705     1  0.0566      0.862 0.984 0.000 0.000 0.012 0.004
#> GSM11722     1  0.7572      0.206 0.452 0.116 0.000 0.112 0.320
#> GSM11730     1  0.7572      0.206 0.452 0.116 0.000 0.112 0.320
#> GSM11713     1  0.1628      0.835 0.936 0.000 0.008 0.056 0.000
#> GSM11728     1  0.1628      0.835 0.936 0.000 0.008 0.056 0.000
#> GSM27947     3  0.5121      0.574 0.012 0.000 0.552 0.416 0.020
#> GSM27951     1  0.0162      0.862 0.996 0.000 0.000 0.000 0.004
#> GSM11707     3  0.0162      0.571 0.000 0.000 0.996 0.000 0.004
#> GSM11716     5  0.3222      0.596 0.004 0.104 0.012 0.020 0.860
#> GSM11850     3  0.6684      0.404 0.008 0.000 0.488 0.296 0.208
#> GSM11851     3  0.5718      0.551 0.008 0.000 0.544 0.380 0.068
#> GSM11721     4  0.2179      0.581 0.000 0.000 0.000 0.888 0.112
#> GSM11852     3  0.4855      0.562 0.004 0.000 0.544 0.436 0.016
#> GSM11694     3  0.4934      0.594 0.024 0.000 0.616 0.352 0.008
#> GSM11695     3  0.4934      0.594 0.024 0.000 0.616 0.352 0.008
#> GSM11734     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000
#> GSM11861     4  0.2020      0.591 0.000 0.000 0.000 0.900 0.100
#> GSM11843     5  0.6374      0.398 0.000 0.360 0.000 0.172 0.468
#> GSM11862     4  0.2020      0.591 0.000 0.000 0.000 0.900 0.100
#> GSM11697     3  0.4790      0.597 0.024 0.000 0.628 0.344 0.004
#> GSM11714     3  0.0162      0.571 0.000 0.000 0.996 0.000 0.004
#> GSM11723     5  0.3727      0.533 0.000 0.216 0.000 0.016 0.768
#> GSM11845     5  0.3727      0.533 0.000 0.216 0.000 0.016 0.768
#> GSM11683     3  0.3865      0.554 0.100 0.000 0.808 0.092 0.000
#> GSM11691     3  0.5152      0.588 0.024 0.000 0.572 0.392 0.012
#> GSM27949     3  0.2020      0.593 0.000 0.000 0.900 0.100 0.000
#> GSM27945     3  0.5121      0.574 0.012 0.000 0.552 0.416 0.020
#> GSM11706     3  0.3160      0.463 0.000 0.000 0.808 0.188 0.004
#> GSM11853     3  0.4855      0.562 0.004 0.000 0.544 0.436 0.016
#> GSM11729     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000
#> GSM11746     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000
#> GSM11711     3  0.4855      0.562 0.004 0.000 0.544 0.436 0.016
#> GSM11854     3  0.4855      0.562 0.004 0.000 0.544 0.436 0.016
#> GSM11731     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000
#> GSM11839     5  0.6523      0.489 0.000 0.232 0.000 0.288 0.480
#> GSM11836     5  0.6402      0.514 0.000 0.208 0.000 0.288 0.504
#> GSM11849     4  0.3843      0.684 0.184 0.000 0.012 0.788 0.016
#> GSM11682     3  0.3963      0.395 0.008 0.000 0.732 0.256 0.004
#> GSM11690     4  0.4709      0.659 0.176 0.000 0.060 0.748 0.016
#> GSM11692     5  0.4420      0.250 0.000 0.004 0.000 0.448 0.548
#> GSM11841     5  0.3242      0.632 0.000 0.012 0.000 0.172 0.816
#> GSM11901     5  0.3242      0.632 0.000 0.012 0.000 0.172 0.816
#> GSM11715     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000
#> GSM11724     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000
#> GSM11684     4  0.4153      0.656 0.236 0.000 0.008 0.740 0.016
#> GSM11696     4  0.4153      0.656 0.236 0.000 0.008 0.740 0.016
#> GSM27952     3  0.3489      0.439 0.004 0.000 0.784 0.208 0.004
#> GSM27948     4  0.4059      0.682 0.172 0.000 0.000 0.776 0.052

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6  0.3419    0.74208 0.000 0.000 0.084 0.104 0.000 0.812
#> GSM11735     6  0.3419    0.74208 0.000 0.000 0.084 0.104 0.000 0.812
#> GSM11733     3  0.4989    0.21532 0.000 0.000 0.640 0.092 0.260 0.008
#> GSM11863     5  0.2135    0.69573 0.000 0.000 0.128 0.000 0.872 0.000
#> GSM11710     6  0.1984    0.75468 0.000 0.000 0.056 0.032 0.000 0.912
#> GSM11712     5  0.0713    0.72580 0.000 0.000 0.028 0.000 0.972 0.000
#> GSM11732     3  0.5005   -0.00464 0.000 0.000 0.612 0.088 0.296 0.004
#> GSM11844     3  0.5005   -0.00464 0.000 0.000 0.612 0.088 0.296 0.004
#> GSM11842     5  0.3973    0.70122 0.000 0.048 0.028 0.140 0.784 0.000
#> GSM11860     5  0.5475    0.63229 0.020 0.048 0.092 0.148 0.692 0.000
#> GSM11686     6  0.1176    0.77813 0.000 0.000 0.020 0.024 0.000 0.956
#> GSM11688     6  0.1176    0.77813 0.000 0.000 0.020 0.024 0.000 0.956
#> GSM11846     3  0.5881    0.54368 0.140 0.000 0.572 0.032 0.000 0.256
#> GSM11680     3  0.4399    0.41969 0.000 0.000 0.516 0.024 0.000 0.460
#> GSM11698     3  0.4098    0.65687 0.000 0.000 0.676 0.032 0.000 0.292
#> GSM11840     3  0.4467    0.27604 0.000 0.000 0.696 0.060 0.236 0.008
#> GSM11847     3  0.4467    0.27604 0.000 0.000 0.696 0.060 0.236 0.008
#> GSM11685     6  0.1176    0.77813 0.000 0.000 0.020 0.024 0.000 0.956
#> GSM11699     3  0.4040    0.66355 0.000 0.000 0.688 0.032 0.000 0.280
#> GSM27950     6  0.2994    0.62050 0.000 0.000 0.208 0.004 0.000 0.788
#> GSM27946     3  0.3799    0.66990 0.000 0.000 0.704 0.020 0.000 0.276
#> GSM11709     1  0.0000    0.89492 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11720     1  0.3098    0.74723 0.812 0.000 0.000 0.024 0.164 0.000
#> GSM11726     1  0.3098    0.74723 0.812 0.000 0.000 0.024 0.164 0.000
#> GSM11837     2  0.5544    0.35135 0.000 0.608 0.092 0.036 0.264 0.000
#> GSM11725     2  0.0000    0.89093 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11864     2  0.1088    0.86164 0.000 0.960 0.000 0.016 0.024 0.000
#> GSM11687     1  0.0000    0.89492 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11693     1  0.0000    0.89492 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11727     2  0.6523   -0.03161 0.048 0.448 0.000 0.164 0.340 0.000
#> GSM11838     2  0.0146    0.88924 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM11681     1  0.2467    0.84722 0.884 0.000 0.012 0.088 0.000 0.016
#> GSM11689     1  0.0000    0.89492 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11704     1  0.0000    0.89492 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11703     1  0.0405    0.89195 0.988 0.000 0.008 0.000 0.004 0.000
#> GSM11705     1  0.0405    0.89195 0.988 0.000 0.008 0.000 0.004 0.000
#> GSM11722     4  0.6780   -0.11289 0.264 0.040 0.000 0.356 0.340 0.000
#> GSM11730     4  0.6780   -0.11289 0.264 0.040 0.000 0.356 0.340 0.000
#> GSM11713     1  0.3802    0.64189 0.676 0.000 0.012 0.312 0.000 0.000
#> GSM11728     1  0.3802    0.64189 0.676 0.000 0.012 0.312 0.000 0.000
#> GSM27947     3  0.3799    0.66990 0.000 0.000 0.704 0.020 0.000 0.276
#> GSM27951     1  0.0935    0.88447 0.964 0.000 0.004 0.032 0.000 0.000
#> GSM11707     6  0.3419    0.74208 0.000 0.000 0.084 0.104 0.000 0.812
#> GSM11716     5  0.5306    0.59651 0.004 0.024 0.276 0.072 0.624 0.000
#> GSM11850     3  0.6228    0.54686 0.000 0.000 0.552 0.064 0.128 0.256
#> GSM11851     3  0.4570    0.65055 0.000 0.000 0.672 0.048 0.012 0.268
#> GSM11721     4  0.7462    0.56682 0.000 0.000 0.204 0.384 0.240 0.172
#> GSM11852     3  0.4214    0.65739 0.000 0.000 0.680 0.044 0.000 0.276
#> GSM11694     3  0.4292    0.56697 0.000 0.000 0.588 0.024 0.000 0.388
#> GSM11695     3  0.4292    0.56697 0.000 0.000 0.588 0.024 0.000 0.388
#> GSM11734     2  0.0146    0.88848 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM11861     4  0.7416    0.57689 0.000 0.000 0.204 0.400 0.224 0.172
#> GSM11843     5  0.4503    0.59407 0.000 0.240 0.000 0.080 0.680 0.000
#> GSM11862     4  0.7416    0.57689 0.000 0.000 0.204 0.400 0.224 0.172
#> GSM11697     3  0.4319    0.54589 0.000 0.000 0.576 0.024 0.000 0.400
#> GSM11714     6  0.3419    0.74208 0.000 0.000 0.084 0.104 0.000 0.812
#> GSM11723     5  0.5786    0.66515 0.000 0.064 0.188 0.120 0.628 0.000
#> GSM11845     5  0.5786    0.66515 0.000 0.064 0.188 0.120 0.628 0.000
#> GSM11683     6  0.5763    0.31011 0.048 0.000 0.320 0.076 0.000 0.556
#> GSM11691     3  0.4011    0.64840 0.000 0.000 0.672 0.024 0.000 0.304
#> GSM27949     6  0.3499    0.36539 0.000 0.000 0.320 0.000 0.000 0.680
#> GSM27945     3  0.3717    0.66943 0.000 0.000 0.708 0.016 0.000 0.276
#> GSM11706     6  0.1719    0.77843 0.000 0.000 0.060 0.016 0.000 0.924
#> GSM11853     3  0.4214    0.65739 0.000 0.000 0.680 0.044 0.000 0.276
#> GSM11729     2  0.0000    0.89093 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11746     2  0.0000    0.89093 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11711     3  0.4214    0.65739 0.000 0.000 0.680 0.044 0.000 0.276
#> GSM11854     3  0.4214    0.65739 0.000 0.000 0.680 0.044 0.000 0.276
#> GSM11731     2  0.0000    0.89093 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11839     5  0.4770    0.61412 0.000 0.100 0.004 0.224 0.672 0.000
#> GSM11836     5  0.4560    0.62376 0.000 0.088 0.004 0.212 0.696 0.000
#> GSM11849     4  0.6009    0.68204 0.004 0.000 0.244 0.556 0.020 0.176
#> GSM11682     6  0.2199    0.73757 0.000 0.000 0.020 0.088 0.000 0.892
#> GSM11690     4  0.6070    0.67061 0.000 0.000 0.228 0.528 0.020 0.224
#> GSM11692     5  0.4662    0.36136 0.000 0.000 0.172 0.140 0.688 0.000
#> GSM11841     5  0.0713    0.72580 0.000 0.000 0.028 0.000 0.972 0.000
#> GSM11901     5  0.0713    0.72580 0.000 0.000 0.028 0.000 0.972 0.000
#> GSM11715     2  0.0000    0.89093 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11724     2  0.0000    0.89093 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11684     4  0.5302    0.67225 0.004 0.000 0.208 0.616 0.000 0.172
#> GSM11696     4  0.5302    0.67225 0.004 0.000 0.208 0.616 0.000 0.172
#> GSM27952     6  0.1257    0.77726 0.000 0.000 0.020 0.028 0.000 0.952
#> GSM27948     4  0.6290    0.67924 0.000 0.000 0.244 0.536 0.048 0.172

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-hclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-hclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n cell.line(p) agent(p)  time(p) k
#> ATC:hclust 75     4.01e-01    0.177 1.28e-04 2
#> ATC:hclust 45     2.35e-03    0.480 1.18e-03 3
#> ATC:hclust 55     1.29e-08    0.466 7.79e-05 4
#> ATC:hclust 62     2.67e-09    0.427 2.42e-04 5
#> ATC:hclust 70     6.65e-10    0.847 2.51e-03 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:kmeans**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "kmeans"]
# you can also extract it by
# res = res_list["ATC:kmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-kmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.966       0.987         0.4552 0.540   0.540
#> 3 3 0.487           0.542       0.717         0.3897 0.724   0.520
#> 4 4 0.692           0.777       0.871         0.1676 0.756   0.418
#> 5 5 0.677           0.643       0.795         0.0730 0.859   0.528
#> 6 6 0.722           0.673       0.783         0.0406 0.945   0.742

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1   0.000      0.996 1.000 0.000
#> GSM11735     1   0.000      0.996 1.000 0.000
#> GSM11733     1   0.000      0.996 1.000 0.000
#> GSM11863     2   0.000      0.968 0.000 1.000
#> GSM11710     1   0.000      0.996 1.000 0.000
#> GSM11712     2   0.000      0.968 0.000 1.000
#> GSM11732     2   0.997      0.136 0.468 0.532
#> GSM11844     1   0.000      0.996 1.000 0.000
#> GSM11842     2   0.000      0.968 0.000 1.000
#> GSM11860     2   0.000      0.968 0.000 1.000
#> GSM11686     1   0.000      0.996 1.000 0.000
#> GSM11688     1   0.000      0.996 1.000 0.000
#> GSM11846     1   0.000      0.996 1.000 0.000
#> GSM11680     1   0.000      0.996 1.000 0.000
#> GSM11698     1   0.000      0.996 1.000 0.000
#> GSM11840     1   0.000      0.996 1.000 0.000
#> GSM11847     1   0.000      0.996 1.000 0.000
#> GSM11685     1   0.000      0.996 1.000 0.000
#> GSM11699     1   0.000      0.996 1.000 0.000
#> GSM27950     1   0.000      0.996 1.000 0.000
#> GSM27946     1   0.000      0.996 1.000 0.000
#> GSM11709     1   0.000      0.996 1.000 0.000
#> GSM11720     2   0.000      0.968 0.000 1.000
#> GSM11726     2   0.000      0.968 0.000 1.000
#> GSM11837     2   0.000      0.968 0.000 1.000
#> GSM11725     2   0.000      0.968 0.000 1.000
#> GSM11864     2   0.000      0.968 0.000 1.000
#> GSM11687     1   0.000      0.996 1.000 0.000
#> GSM11693     1   0.000      0.996 1.000 0.000
#> GSM11727     2   0.000      0.968 0.000 1.000
#> GSM11838     2   0.000      0.968 0.000 1.000
#> GSM11681     1   0.000      0.996 1.000 0.000
#> GSM11689     1   0.000      0.996 1.000 0.000
#> GSM11704     2   0.985      0.271 0.428 0.572
#> GSM11703     1   0.000      0.996 1.000 0.000
#> GSM11705     1   0.000      0.996 1.000 0.000
#> GSM11722     2   0.000      0.968 0.000 1.000
#> GSM11730     2   0.000      0.968 0.000 1.000
#> GSM11713     1   0.000      0.996 1.000 0.000
#> GSM11728     1   0.000      0.996 1.000 0.000
#> GSM27947     1   0.000      0.996 1.000 0.000
#> GSM27951     1   0.000      0.996 1.000 0.000
#> GSM11707     1   0.000      0.996 1.000 0.000
#> GSM11716     2   0.000      0.968 0.000 1.000
#> GSM11850     1   0.000      0.996 1.000 0.000
#> GSM11851     1   0.000      0.996 1.000 0.000
#> GSM11721     1   0.443      0.897 0.908 0.092
#> GSM11852     1   0.000      0.996 1.000 0.000
#> GSM11694     1   0.000      0.996 1.000 0.000
#> GSM11695     1   0.000      0.996 1.000 0.000
#> GSM11734     2   0.000      0.968 0.000 1.000
#> GSM11861     1   0.000      0.996 1.000 0.000
#> GSM11843     2   0.000      0.968 0.000 1.000
#> GSM11862     1   0.000      0.996 1.000 0.000
#> GSM11697     1   0.000      0.996 1.000 0.000
#> GSM11714     1   0.000      0.996 1.000 0.000
#> GSM11723     2   0.000      0.968 0.000 1.000
#> GSM11845     2   0.000      0.968 0.000 1.000
#> GSM11683     1   0.000      0.996 1.000 0.000
#> GSM11691     1   0.000      0.996 1.000 0.000
#> GSM27949     1   0.000      0.996 1.000 0.000
#> GSM27945     1   0.000      0.996 1.000 0.000
#> GSM11706     1   0.000      0.996 1.000 0.000
#> GSM11853     1   0.000      0.996 1.000 0.000
#> GSM11729     2   0.000      0.968 0.000 1.000
#> GSM11746     2   0.000      0.968 0.000 1.000
#> GSM11711     1   0.000      0.996 1.000 0.000
#> GSM11854     1   0.000      0.996 1.000 0.000
#> GSM11731     2   0.000      0.968 0.000 1.000
#> GSM11839     2   0.000      0.968 0.000 1.000
#> GSM11836     2   0.000      0.968 0.000 1.000
#> GSM11849     1   0.000      0.996 1.000 0.000
#> GSM11682     1   0.000      0.996 1.000 0.000
#> GSM11690     1   0.000      0.996 1.000 0.000
#> GSM11692     1   0.443      0.897 0.908 0.092
#> GSM11841     2   0.000      0.968 0.000 1.000
#> GSM11901     2   0.000      0.968 0.000 1.000
#> GSM11715     2   0.000      0.968 0.000 1.000
#> GSM11724     2   0.000      0.968 0.000 1.000
#> GSM11684     1   0.000      0.996 1.000 0.000
#> GSM11696     1   0.000      0.996 1.000 0.000
#> GSM27952     1   0.000      0.996 1.000 0.000
#> GSM27948     1   0.000      0.996 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.4974     0.6562 0.236 0.000 0.764
#> GSM11735     3  0.4974     0.6562 0.236 0.000 0.764
#> GSM11733     1  0.3349     0.6221 0.888 0.004 0.108
#> GSM11863     2  0.5926     0.6008 0.356 0.644 0.000
#> GSM11710     3  0.5363     0.6269 0.276 0.000 0.724
#> GSM11712     2  0.5926     0.6008 0.356 0.644 0.000
#> GSM11732     1  0.6056     0.5768 0.744 0.032 0.224
#> GSM11844     1  0.5406     0.5858 0.764 0.012 0.224
#> GSM11842     2  0.5926     0.6008 0.356 0.644 0.000
#> GSM11860     1  0.6745    -0.0861 0.560 0.428 0.012
#> GSM11686     3  0.5216     0.6468 0.260 0.000 0.740
#> GSM11688     3  0.5216     0.6468 0.260 0.000 0.740
#> GSM11846     1  0.6008     0.3337 0.628 0.000 0.372
#> GSM11680     3  0.4974     0.6562 0.236 0.000 0.764
#> GSM11698     3  0.4974     0.6562 0.236 0.000 0.764
#> GSM11840     1  0.2866     0.6416 0.916 0.008 0.076
#> GSM11847     1  0.2866     0.6416 0.916 0.008 0.076
#> GSM11685     3  0.5216     0.6468 0.260 0.000 0.740
#> GSM11699     1  0.3267     0.6445 0.884 0.000 0.116
#> GSM27950     3  0.4974     0.6562 0.236 0.000 0.764
#> GSM27946     1  0.1529     0.6668 0.960 0.000 0.040
#> GSM11709     3  0.6931    -0.1283 0.456 0.016 0.528
#> GSM11720     2  0.4733     0.7456 0.004 0.800 0.196
#> GSM11726     1  0.9813     0.1842 0.424 0.316 0.260
#> GSM11837     2  0.1289     0.8455 0.000 0.968 0.032
#> GSM11725     2  0.1289     0.8455 0.000 0.968 0.032
#> GSM11864     2  0.1289     0.8455 0.000 0.968 0.032
#> GSM11687     3  0.6654    -0.1243 0.456 0.008 0.536
#> GSM11693     3  0.6931    -0.1283 0.456 0.016 0.528
#> GSM11727     2  0.4110     0.7786 0.004 0.844 0.152
#> GSM11838     2  0.1289     0.8455 0.000 0.968 0.032
#> GSM11681     3  0.5291     0.2857 0.268 0.000 0.732
#> GSM11689     3  0.6936    -0.1289 0.460 0.016 0.524
#> GSM11704     1  0.9520     0.1956 0.460 0.200 0.340
#> GSM11703     3  0.6676    -0.1548 0.476 0.008 0.516
#> GSM11705     3  0.6664    -0.1284 0.464 0.008 0.528
#> GSM11722     2  0.3879     0.7793 0.000 0.848 0.152
#> GSM11730     2  0.9757    -0.0481 0.384 0.388 0.228
#> GSM11713     1  0.6307     0.1308 0.512 0.000 0.488
#> GSM11728     1  0.6260     0.2018 0.552 0.000 0.448
#> GSM27947     1  0.4504     0.5867 0.804 0.000 0.196
#> GSM27951     3  0.6659    -0.1245 0.460 0.008 0.532
#> GSM11707     3  0.4974     0.6562 0.236 0.000 0.764
#> GSM11716     2  0.1989     0.8404 0.004 0.948 0.048
#> GSM11850     1  0.5591     0.4877 0.696 0.000 0.304
#> GSM11851     1  0.2711     0.6427 0.912 0.000 0.088
#> GSM11721     1  0.1643     0.6363 0.956 0.044 0.000
#> GSM11852     1  0.1643     0.6661 0.956 0.000 0.044
#> GSM11694     1  0.6140     0.2702 0.596 0.000 0.404
#> GSM11695     1  0.6225     0.1887 0.568 0.000 0.432
#> GSM11734     2  0.0424     0.8509 0.008 0.992 0.000
#> GSM11861     1  0.1163     0.6475 0.972 0.028 0.000
#> GSM11843     2  0.0424     0.8509 0.008 0.992 0.000
#> GSM11862     1  0.1289     0.6448 0.968 0.032 0.000
#> GSM11697     1  0.6225     0.1887 0.568 0.000 0.432
#> GSM11714     3  0.4974     0.6562 0.236 0.000 0.764
#> GSM11723     2  0.0424     0.8509 0.008 0.992 0.000
#> GSM11845     2  0.0424     0.8509 0.008 0.992 0.000
#> GSM11683     3  0.5178     0.6490 0.256 0.000 0.744
#> GSM11691     1  0.5785     0.3318 0.668 0.000 0.332
#> GSM27949     3  0.4887     0.6498 0.228 0.000 0.772
#> GSM27945     1  0.4750     0.5838 0.784 0.000 0.216
#> GSM11706     3  0.4974     0.6562 0.236 0.000 0.764
#> GSM11853     1  0.4974     0.5769 0.764 0.000 0.236
#> GSM11729     2  0.0000     0.8502 0.000 1.000 0.000
#> GSM11746     2  0.1289     0.8455 0.000 0.968 0.032
#> GSM11711     1  0.6008     0.3081 0.628 0.000 0.372
#> GSM11854     1  0.3482     0.6445 0.872 0.000 0.128
#> GSM11731     2  0.0424     0.8509 0.008 0.992 0.000
#> GSM11839     2  0.0592     0.8498 0.012 0.988 0.000
#> GSM11836     2  0.5926     0.6008 0.356 0.644 0.000
#> GSM11849     1  0.1289     0.6666 0.968 0.000 0.032
#> GSM11682     3  0.5733     0.5913 0.324 0.000 0.676
#> GSM11690     1  0.1411     0.6664 0.964 0.000 0.036
#> GSM11692     1  0.1643     0.6363 0.956 0.044 0.000
#> GSM11841     2  0.5926     0.6008 0.356 0.644 0.000
#> GSM11901     2  0.5948     0.5955 0.360 0.640 0.000
#> GSM11715     2  0.0424     0.8509 0.008 0.992 0.000
#> GSM11724     2  0.0424     0.8509 0.008 0.992 0.000
#> GSM11684     1  0.2066     0.6599 0.940 0.000 0.060
#> GSM11696     1  0.1964     0.6596 0.944 0.000 0.056
#> GSM27952     3  0.5216     0.6468 0.260 0.000 0.740
#> GSM27948     1  0.1031     0.6497 0.976 0.024 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.0817      0.838 0.024 0.000 0.976 0.000
#> GSM11735     3  0.0707      0.837 0.020 0.000 0.980 0.000
#> GSM11733     4  0.2480      0.789 0.008 0.000 0.088 0.904
#> GSM11863     4  0.3625      0.731 0.012 0.160 0.000 0.828
#> GSM11710     3  0.2222      0.826 0.016 0.000 0.924 0.060
#> GSM11712     4  0.3895      0.707 0.012 0.184 0.000 0.804
#> GSM11732     4  0.7064      0.487 0.208 0.000 0.220 0.572
#> GSM11844     4  0.6640      0.554 0.168 0.000 0.208 0.624
#> GSM11842     4  0.4012      0.707 0.016 0.184 0.000 0.800
#> GSM11860     4  0.6193      0.634 0.180 0.148 0.000 0.672
#> GSM11686     3  0.1722      0.830 0.008 0.000 0.944 0.048
#> GSM11688     3  0.1722      0.830 0.008 0.000 0.944 0.048
#> GSM11846     1  0.6102      0.512 0.672 0.000 0.212 0.116
#> GSM11680     3  0.0895      0.838 0.020 0.000 0.976 0.004
#> GSM11698     3  0.1297      0.832 0.016 0.000 0.964 0.020
#> GSM11840     4  0.1545      0.801 0.008 0.000 0.040 0.952
#> GSM11847     4  0.1452      0.801 0.008 0.000 0.036 0.956
#> GSM11685     3  0.1807      0.829 0.008 0.000 0.940 0.052
#> GSM11699     4  0.2965      0.791 0.072 0.000 0.036 0.892
#> GSM27950     3  0.0592      0.838 0.016 0.000 0.984 0.000
#> GSM27946     4  0.2125      0.797 0.076 0.000 0.004 0.920
#> GSM11709     1  0.1109      0.925 0.968 0.000 0.004 0.028
#> GSM11720     1  0.4857      0.440 0.668 0.324 0.000 0.008
#> GSM11726     1  0.1339      0.911 0.964 0.008 0.004 0.024
#> GSM11837     2  0.0469      0.955 0.012 0.988 0.000 0.000
#> GSM11725     2  0.0336      0.955 0.008 0.992 0.000 0.000
#> GSM11864     2  0.0336      0.955 0.008 0.992 0.000 0.000
#> GSM11687     1  0.1109      0.925 0.968 0.000 0.004 0.028
#> GSM11693     1  0.1109      0.925 0.968 0.000 0.004 0.028
#> GSM11727     2  0.3545      0.815 0.164 0.828 0.000 0.008
#> GSM11838     2  0.0336      0.955 0.008 0.992 0.000 0.000
#> GSM11681     1  0.1637      0.884 0.940 0.000 0.060 0.000
#> GSM11689     1  0.1109      0.925 0.968 0.000 0.004 0.028
#> GSM11704     1  0.1004      0.924 0.972 0.000 0.004 0.024
#> GSM11703     1  0.1109      0.925 0.968 0.000 0.004 0.028
#> GSM11705     1  0.1109      0.925 0.968 0.000 0.004 0.028
#> GSM11722     2  0.3306      0.825 0.156 0.840 0.000 0.004
#> GSM11730     1  0.2124      0.890 0.932 0.040 0.000 0.028
#> GSM11713     1  0.2124      0.906 0.932 0.000 0.040 0.028
#> GSM11728     1  0.2751      0.895 0.904 0.000 0.040 0.056
#> GSM27947     4  0.5771      0.250 0.460 0.000 0.028 0.512
#> GSM27951     1  0.1004      0.924 0.972 0.000 0.004 0.024
#> GSM11707     3  0.0817      0.838 0.024 0.000 0.976 0.000
#> GSM11716     2  0.5032      0.648 0.220 0.744 0.016 0.020
#> GSM11850     4  0.7588      0.343 0.312 0.000 0.220 0.468
#> GSM11851     4  0.3806      0.731 0.020 0.000 0.156 0.824
#> GSM11721     4  0.0712      0.801 0.008 0.004 0.004 0.984
#> GSM11852     4  0.2402      0.796 0.076 0.000 0.012 0.912
#> GSM11694     3  0.7203      0.356 0.312 0.000 0.524 0.164
#> GSM11695     3  0.6993      0.408 0.296 0.000 0.556 0.148
#> GSM11734     2  0.0000      0.956 0.000 1.000 0.000 0.000
#> GSM11861     4  0.1191      0.803 0.024 0.004 0.004 0.968
#> GSM11843     2  0.0000      0.956 0.000 1.000 0.000 0.000
#> GSM11862     4  0.0844      0.802 0.012 0.004 0.004 0.980
#> GSM11697     3  0.6993      0.408 0.296 0.000 0.556 0.148
#> GSM11714     3  0.0707      0.838 0.020 0.000 0.980 0.000
#> GSM11723     2  0.0672      0.950 0.008 0.984 0.000 0.008
#> GSM11845     2  0.0672      0.950 0.008 0.984 0.000 0.008
#> GSM11683     3  0.1938      0.829 0.012 0.000 0.936 0.052
#> GSM11691     3  0.7218      0.374 0.316 0.000 0.520 0.164
#> GSM27949     3  0.1182      0.834 0.016 0.000 0.968 0.016
#> GSM27945     4  0.7253      0.404 0.308 0.000 0.172 0.520
#> GSM11706     3  0.0817      0.838 0.024 0.000 0.976 0.000
#> GSM11853     4  0.7099      0.462 0.280 0.000 0.168 0.552
#> GSM11729     2  0.0000      0.956 0.000 1.000 0.000 0.000
#> GSM11746     2  0.0336      0.955 0.008 0.992 0.000 0.000
#> GSM11711     3  0.7644      0.301 0.260 0.000 0.468 0.272
#> GSM11854     4  0.5011      0.706 0.076 0.000 0.160 0.764
#> GSM11731     2  0.0000      0.956 0.000 1.000 0.000 0.000
#> GSM11839     2  0.0927      0.946 0.008 0.976 0.000 0.016
#> GSM11836     4  0.3937      0.703 0.012 0.188 0.000 0.800
#> GSM11849     4  0.2708      0.795 0.076 0.004 0.016 0.904
#> GSM11682     3  0.2048      0.823 0.008 0.000 0.928 0.064
#> GSM11690     4  0.2708      0.795 0.076 0.004 0.016 0.904
#> GSM11692     4  0.0712      0.801 0.008 0.004 0.004 0.984
#> GSM11841     4  0.3852      0.710 0.012 0.180 0.000 0.808
#> GSM11901     4  0.3377      0.745 0.012 0.140 0.000 0.848
#> GSM11715     2  0.0000      0.956 0.000 1.000 0.000 0.000
#> GSM11724     2  0.0000      0.956 0.000 1.000 0.000 0.000
#> GSM11684     4  0.2658      0.794 0.080 0.004 0.012 0.904
#> GSM11696     4  0.2658      0.794 0.080 0.004 0.012 0.904
#> GSM27952     3  0.1970      0.826 0.008 0.000 0.932 0.060
#> GSM27948     4  0.0967      0.802 0.016 0.004 0.004 0.976

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     4  0.2304   8.54e-01 0.000 0.000 0.100 0.892 0.008
#> GSM11735     4  0.2358   8.52e-01 0.000 0.000 0.104 0.888 0.008
#> GSM11733     5  0.4152   4.42e-01 0.000 0.000 0.296 0.012 0.692
#> GSM11863     5  0.0955   7.55e-01 0.000 0.028 0.004 0.000 0.968
#> GSM11710     4  0.2069   8.46e-01 0.000 0.000 0.076 0.912 0.012
#> GSM11712     5  0.0794   7.55e-01 0.000 0.028 0.000 0.000 0.972
#> GSM11732     3  0.5973   2.72e-01 0.020 0.004 0.516 0.052 0.408
#> GSM11844     3  0.5759   3.12e-01 0.020 0.004 0.568 0.044 0.364
#> GSM11842     5  0.0955   7.55e-01 0.000 0.028 0.004 0.000 0.968
#> GSM11860     5  0.4500   4.98e-01 0.040 0.020 0.180 0.000 0.760
#> GSM11686     4  0.1341   8.58e-01 0.000 0.000 0.056 0.944 0.000
#> GSM11688     4  0.1341   8.58e-01 0.000 0.000 0.056 0.944 0.000
#> GSM11846     3  0.5617   2.81e-01 0.424 0.000 0.516 0.048 0.012
#> GSM11680     4  0.4256   2.91e-01 0.000 0.000 0.436 0.564 0.000
#> GSM11698     3  0.4242   5.15e-02 0.000 0.000 0.572 0.428 0.000
#> GSM11840     5  0.2068   7.58e-01 0.000 0.000 0.092 0.004 0.904
#> GSM11847     5  0.2068   7.58e-01 0.000 0.000 0.092 0.004 0.904
#> GSM11685     4  0.1341   8.58e-01 0.000 0.000 0.056 0.944 0.000
#> GSM11699     3  0.6094   3.84e-02 0.024 0.000 0.516 0.068 0.392
#> GSM27950     4  0.2020   8.54e-01 0.000 0.000 0.100 0.900 0.000
#> GSM27946     5  0.5087   3.74e-01 0.028 0.000 0.376 0.008 0.588
#> GSM11709     1  0.0854   8.95e-01 0.976 0.000 0.012 0.004 0.008
#> GSM11720     1  0.5738   6.25e-01 0.696 0.160 0.080 0.000 0.064
#> GSM11726     1  0.3494   8.05e-01 0.848 0.012 0.084 0.000 0.056
#> GSM11837     2  0.2630   8.84e-01 0.016 0.892 0.080 0.000 0.012
#> GSM11725     2  0.0451   9.14e-01 0.004 0.988 0.008 0.000 0.000
#> GSM11864     2  0.0162   9.15e-01 0.000 0.996 0.004 0.000 0.000
#> GSM11687     1  0.0854   8.95e-01 0.976 0.000 0.012 0.004 0.008
#> GSM11693     1  0.0854   8.95e-01 0.976 0.000 0.012 0.004 0.008
#> GSM11727     2  0.6169   6.56e-01 0.200 0.648 0.088 0.000 0.064
#> GSM11838     2  0.0451   9.14e-01 0.004 0.988 0.008 0.000 0.000
#> GSM11681     1  0.1568   8.77e-01 0.944 0.000 0.036 0.020 0.000
#> GSM11689     1  0.0854   8.95e-01 0.976 0.000 0.012 0.004 0.008
#> GSM11704     1  0.0854   8.94e-01 0.976 0.004 0.012 0.000 0.008
#> GSM11703     1  0.0960   8.94e-01 0.972 0.000 0.016 0.004 0.008
#> GSM11705     1  0.0960   8.94e-01 0.972 0.000 0.016 0.004 0.008
#> GSM11722     2  0.5006   7.99e-01 0.104 0.760 0.084 0.000 0.052
#> GSM11730     1  0.4011   7.99e-01 0.808 0.012 0.124 0.000 0.056
#> GSM11713     1  0.3196   7.71e-01 0.804 0.000 0.192 0.004 0.000
#> GSM11728     1  0.4588   4.94e-01 0.604 0.000 0.380 0.016 0.000
#> GSM27947     3  0.6143   4.90e-01 0.272 0.000 0.584 0.012 0.132
#> GSM27951     1  0.0771   8.90e-01 0.976 0.000 0.020 0.004 0.000
#> GSM11707     4  0.2304   8.54e-01 0.000 0.000 0.100 0.892 0.008
#> GSM11716     3  0.8041  -6.64e-02 0.120 0.332 0.372 0.000 0.176
#> GSM11850     3  0.5937   5.38e-01 0.132 0.004 0.688 0.048 0.128
#> GSM11851     3  0.5126   3.51e-01 0.008 0.000 0.596 0.032 0.364
#> GSM11721     5  0.2561   7.53e-01 0.000 0.000 0.144 0.000 0.856
#> GSM11852     5  0.5804   2.32e-01 0.024 0.000 0.420 0.044 0.512
#> GSM11694     3  0.5885   5.11e-01 0.120 0.000 0.644 0.216 0.020
#> GSM11695     3  0.5771   4.99e-01 0.108 0.000 0.644 0.232 0.016
#> GSM11734     2  0.0290   9.15e-01 0.000 0.992 0.000 0.000 0.008
#> GSM11861     5  0.3461   6.89e-01 0.004 0.000 0.224 0.000 0.772
#> GSM11843     2  0.0510   9.15e-01 0.000 0.984 0.000 0.000 0.016
#> GSM11862     5  0.3074   7.21e-01 0.000 0.000 0.196 0.000 0.804
#> GSM11697     3  0.5771   4.99e-01 0.108 0.000 0.644 0.232 0.016
#> GSM11714     4  0.2304   8.54e-01 0.000 0.000 0.100 0.892 0.008
#> GSM11723     2  0.4237   8.38e-01 0.012 0.796 0.080 0.000 0.112
#> GSM11845     2  0.4498   8.23e-01 0.012 0.772 0.076 0.000 0.140
#> GSM11683     4  0.1792   8.47e-01 0.000 0.000 0.084 0.916 0.000
#> GSM11691     3  0.5557   5.19e-01 0.120 0.000 0.680 0.184 0.016
#> GSM27949     3  0.4291   6.58e-05 0.000 0.000 0.536 0.464 0.000
#> GSM27945     3  0.6424   5.17e-01 0.148 0.000 0.612 0.040 0.200
#> GSM11706     4  0.2411   8.53e-01 0.000 0.000 0.108 0.884 0.008
#> GSM11853     3  0.6390   4.97e-01 0.120 0.000 0.604 0.040 0.236
#> GSM11729     2  0.0162   9.15e-01 0.000 0.996 0.000 0.000 0.004
#> GSM11746     2  0.0451   9.14e-01 0.004 0.988 0.008 0.000 0.000
#> GSM11711     3  0.5793   5.49e-01 0.072 0.000 0.688 0.172 0.068
#> GSM11854     3  0.5319   4.08e-01 0.024 0.000 0.640 0.036 0.300
#> GSM11731     2  0.0290   9.15e-01 0.000 0.992 0.000 0.000 0.008
#> GSM11839     2  0.4339   8.16e-01 0.012 0.772 0.048 0.000 0.168
#> GSM11836     5  0.1668   7.33e-01 0.000 0.028 0.032 0.000 0.940
#> GSM11849     3  0.5845  -2.14e-01 0.032 0.000 0.484 0.036 0.448
#> GSM11682     4  0.3628   7.04e-01 0.012 0.000 0.216 0.772 0.000
#> GSM11690     3  0.6186  -1.69e-01 0.036 0.000 0.488 0.056 0.420
#> GSM11692     5  0.2471   7.55e-01 0.000 0.000 0.136 0.000 0.864
#> GSM11841     5  0.0794   7.55e-01 0.000 0.028 0.000 0.000 0.972
#> GSM11901     5  0.0703   7.57e-01 0.000 0.024 0.000 0.000 0.976
#> GSM11715     2  0.0290   9.15e-01 0.000 0.992 0.000 0.000 0.008
#> GSM11724     2  0.0671   9.15e-01 0.000 0.980 0.004 0.000 0.016
#> GSM11684     3  0.6173  -1.62e-01 0.036 0.000 0.500 0.056 0.408
#> GSM11696     3  0.6173  -1.62e-01 0.036 0.000 0.500 0.056 0.408
#> GSM27952     4  0.1792   8.42e-01 0.000 0.000 0.084 0.916 0.000
#> GSM27948     5  0.3835   6.50e-01 0.000 0.000 0.260 0.008 0.732

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6  0.1908      0.810 0.000 0.000 0.096 0.000 0.004 0.900
#> GSM11735     6  0.1908      0.810 0.000 0.000 0.096 0.000 0.004 0.900
#> GSM11733     5  0.5081      0.252 0.000 0.000 0.376 0.064 0.552 0.008
#> GSM11863     5  0.1630      0.715 0.000 0.016 0.020 0.024 0.940 0.000
#> GSM11710     6  0.3718      0.795 0.000 0.000 0.052 0.164 0.004 0.780
#> GSM11712     5  0.0603      0.721 0.000 0.016 0.004 0.000 0.980 0.000
#> GSM11732     3  0.5748      0.510 0.012 0.000 0.616 0.116 0.232 0.024
#> GSM11844     3  0.5075      0.585 0.008 0.000 0.688 0.080 0.200 0.024
#> GSM11842     5  0.1173      0.719 0.000 0.016 0.016 0.008 0.960 0.000
#> GSM11860     5  0.4725      0.586 0.036 0.012 0.132 0.072 0.748 0.000
#> GSM11686     6  0.3419      0.806 0.000 0.000 0.028 0.176 0.004 0.792
#> GSM11688     6  0.3419      0.806 0.000 0.000 0.028 0.176 0.004 0.792
#> GSM11846     3  0.3711      0.589 0.260 0.000 0.720 0.020 0.000 0.000
#> GSM11680     3  0.3731      0.595 0.000 0.000 0.736 0.020 0.004 0.240
#> GSM11698     3  0.3650      0.618 0.000 0.000 0.756 0.024 0.004 0.216
#> GSM11840     5  0.3513      0.671 0.000 0.000 0.144 0.060 0.796 0.000
#> GSM11847     5  0.3513      0.671 0.000 0.000 0.144 0.060 0.796 0.000
#> GSM11685     6  0.3419      0.806 0.000 0.000 0.028 0.176 0.004 0.792
#> GSM11699     3  0.5426      0.278 0.000 0.000 0.656 0.160 0.148 0.036
#> GSM27950     6  0.2356      0.811 0.000 0.000 0.096 0.016 0.004 0.884
#> GSM27946     3  0.5505      0.134 0.008 0.000 0.604 0.120 0.260 0.008
#> GSM11709     1  0.0000      0.869 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11720     1  0.5612      0.633 0.668 0.072 0.032 0.192 0.036 0.000
#> GSM11726     1  0.4638      0.696 0.732 0.020 0.032 0.188 0.028 0.000
#> GSM11837     2  0.3866      0.785 0.000 0.764 0.036 0.188 0.012 0.000
#> GSM11725     2  0.1010      0.847 0.000 0.960 0.004 0.036 0.000 0.000
#> GSM11864     2  0.0935      0.848 0.000 0.964 0.004 0.032 0.000 0.000
#> GSM11687     1  0.0146      0.868 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM11693     1  0.0146      0.868 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM11727     2  0.6846      0.545 0.188 0.520 0.036 0.220 0.036 0.000
#> GSM11838     2  0.0622      0.847 0.000 0.980 0.008 0.012 0.000 0.000
#> GSM11681     1  0.1434      0.845 0.940 0.000 0.000 0.048 0.000 0.012
#> GSM11689     1  0.0146      0.869 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM11704     1  0.0146      0.869 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM11703     1  0.0291      0.868 0.992 0.000 0.004 0.004 0.000 0.000
#> GSM11705     1  0.0603      0.866 0.980 0.000 0.004 0.016 0.000 0.000
#> GSM11722     2  0.5841      0.705 0.076 0.636 0.036 0.220 0.032 0.000
#> GSM11730     1  0.4851      0.609 0.608 0.000 0.028 0.336 0.028 0.000
#> GSM11713     1  0.4473      0.378 0.576 0.000 0.008 0.396 0.000 0.020
#> GSM11728     4  0.5978      0.347 0.292 0.000 0.152 0.532 0.000 0.024
#> GSM27947     3  0.3646      0.659 0.132 0.000 0.800 0.008 0.060 0.000
#> GSM27951     1  0.0790      0.859 0.968 0.000 0.000 0.032 0.000 0.000
#> GSM11707     6  0.1908      0.810 0.000 0.000 0.096 0.000 0.004 0.900
#> GSM11716     3  0.7907      0.250 0.056 0.160 0.436 0.212 0.136 0.000
#> GSM11850     3  0.4477      0.674 0.064 0.000 0.784 0.076 0.056 0.020
#> GSM11851     3  0.3513      0.634 0.000 0.000 0.796 0.060 0.144 0.000
#> GSM11721     5  0.4218      0.593 0.000 0.000 0.112 0.136 0.748 0.004
#> GSM11852     3  0.6589     -0.416 0.000 0.000 0.444 0.264 0.256 0.036
#> GSM11694     3  0.3301      0.685 0.068 0.000 0.828 0.004 0.000 0.100
#> GSM11695     3  0.3301      0.685 0.068 0.000 0.828 0.004 0.000 0.100
#> GSM11734     2  0.0547      0.845 0.000 0.980 0.000 0.000 0.020 0.000
#> GSM11861     5  0.5495      0.376 0.000 0.000 0.156 0.228 0.604 0.012
#> GSM11843     2  0.2301      0.828 0.000 0.884 0.000 0.020 0.096 0.000
#> GSM11862     5  0.5401      0.404 0.000 0.000 0.144 0.228 0.616 0.012
#> GSM11697     3  0.3510      0.683 0.068 0.000 0.820 0.012 0.000 0.100
#> GSM11714     6  0.1908      0.810 0.000 0.000 0.096 0.000 0.004 0.900
#> GSM11723     2  0.5681      0.726 0.000 0.616 0.032 0.196 0.156 0.000
#> GSM11845     2  0.5904      0.699 0.000 0.584 0.032 0.188 0.196 0.000
#> GSM11683     6  0.4668      0.725 0.000 0.000 0.116 0.204 0.000 0.680
#> GSM11691     3  0.3405      0.683 0.068 0.000 0.832 0.016 0.000 0.084
#> GSM27949     3  0.3426      0.623 0.000 0.000 0.764 0.012 0.004 0.220
#> GSM27945     3  0.3266      0.680 0.084 0.000 0.832 0.004 0.080 0.000
#> GSM11706     6  0.2243      0.809 0.000 0.000 0.112 0.004 0.004 0.880
#> GSM11853     3  0.3610      0.668 0.052 0.000 0.824 0.036 0.088 0.000
#> GSM11729     2  0.0000      0.845 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11746     2  0.1010      0.847 0.000 0.960 0.004 0.036 0.000 0.000
#> GSM11711     3  0.2878      0.666 0.020 0.000 0.884 0.032 0.024 0.040
#> GSM11854     3  0.3076      0.633 0.000 0.000 0.840 0.044 0.112 0.004
#> GSM11731     2  0.0547      0.845 0.000 0.980 0.000 0.000 0.020 0.000
#> GSM11839     2  0.5518      0.640 0.000 0.596 0.024 0.104 0.276 0.000
#> GSM11836     5  0.1887      0.699 0.000 0.016 0.012 0.048 0.924 0.000
#> GSM11849     4  0.6506      0.713 0.000 0.000 0.260 0.456 0.252 0.032
#> GSM11682     6  0.4739      0.437 0.000 0.000 0.048 0.436 0.000 0.516
#> GSM11690     4  0.6641      0.744 0.000 0.000 0.256 0.464 0.232 0.048
#> GSM11692     5  0.3740      0.628 0.000 0.000 0.096 0.120 0.784 0.000
#> GSM11841     5  0.0914      0.718 0.000 0.016 0.000 0.016 0.968 0.000
#> GSM11901     5  0.0717      0.718 0.000 0.008 0.000 0.016 0.976 0.000
#> GSM11715     2  0.0993      0.846 0.000 0.964 0.000 0.012 0.024 0.000
#> GSM11724     2  0.1552      0.845 0.000 0.940 0.004 0.020 0.036 0.000
#> GSM11684     4  0.6141      0.783 0.000 0.000 0.236 0.552 0.172 0.040
#> GSM11696     4  0.6141      0.783 0.000 0.000 0.236 0.552 0.172 0.040
#> GSM27952     6  0.3512      0.790 0.000 0.000 0.032 0.196 0.000 0.772
#> GSM27948     5  0.5496      0.270 0.000 0.000 0.184 0.228 0.584 0.004

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-kmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-kmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n cell.line(p) agent(p)  time(p) k
#> ATC:kmeans 81     2.30e-01    0.175 1.71e-05 2
#> ATC:kmeans 62     1.60e-02    0.470 6.34e-04 3
#> ATC:kmeans 72     3.53e-09    0.698 6.52e-04 4
#> ATC:kmeans 60     1.60e-08    0.943 8.77e-03 5
#> ATC:kmeans 72     5.17e-10    0.753 1.44e-03 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:skmeans

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "skmeans"]
# you can also extract it by
# res = res_list["ATC:skmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-skmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-skmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.878           0.899       0.959         0.4986 0.500   0.500
#> 3 3 0.695           0.785       0.890         0.2941 0.778   0.591
#> 4 4 0.864           0.839       0.930         0.1386 0.828   0.570
#> 5 5 0.778           0.683       0.853         0.0721 0.908   0.679
#> 6 6 0.773           0.629       0.816         0.0429 0.938   0.729

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1   0.000      0.967 1.000 0.000
#> GSM11735     1   0.000      0.967 1.000 0.000
#> GSM11733     1   0.981      0.191 0.580 0.420
#> GSM11863     2   0.000      0.940 0.000 1.000
#> GSM11710     1   0.000      0.967 1.000 0.000
#> GSM11712     2   0.000      0.940 0.000 1.000
#> GSM11732     2   0.000      0.940 0.000 1.000
#> GSM11844     2   0.827      0.660 0.260 0.740
#> GSM11842     2   0.000      0.940 0.000 1.000
#> GSM11860     2   0.000      0.940 0.000 1.000
#> GSM11686     1   0.000      0.967 1.000 0.000
#> GSM11688     1   0.000      0.967 1.000 0.000
#> GSM11846     1   0.000      0.967 1.000 0.000
#> GSM11680     1   0.000      0.967 1.000 0.000
#> GSM11698     1   0.000      0.967 1.000 0.000
#> GSM11840     2   0.814      0.671 0.252 0.748
#> GSM11847     2   0.991      0.263 0.444 0.556
#> GSM11685     1   0.000      0.967 1.000 0.000
#> GSM11699     1   0.000      0.967 1.000 0.000
#> GSM27950     1   0.000      0.967 1.000 0.000
#> GSM27946     1   0.000      0.967 1.000 0.000
#> GSM11709     1   0.833      0.635 0.736 0.264
#> GSM11720     2   0.000      0.940 0.000 1.000
#> GSM11726     2   0.000      0.940 0.000 1.000
#> GSM11837     2   0.000      0.940 0.000 1.000
#> GSM11725     2   0.000      0.940 0.000 1.000
#> GSM11864     2   0.000      0.940 0.000 1.000
#> GSM11687     1   0.388      0.893 0.924 0.076
#> GSM11693     1   0.802      0.669 0.756 0.244
#> GSM11727     2   0.000      0.940 0.000 1.000
#> GSM11838     2   0.000      0.940 0.000 1.000
#> GSM11681     1   0.000      0.967 1.000 0.000
#> GSM11689     1   0.861      0.599 0.716 0.284
#> GSM11704     2   0.981      0.246 0.420 0.580
#> GSM11703     1   0.000      0.967 1.000 0.000
#> GSM11705     1   0.000      0.967 1.000 0.000
#> GSM11722     2   0.000      0.940 0.000 1.000
#> GSM11730     2   0.000      0.940 0.000 1.000
#> GSM11713     1   0.000      0.967 1.000 0.000
#> GSM11728     1   0.000      0.967 1.000 0.000
#> GSM27947     1   0.000      0.967 1.000 0.000
#> GSM27951     1   0.000      0.967 1.000 0.000
#> GSM11707     1   0.000      0.967 1.000 0.000
#> GSM11716     2   0.000      0.940 0.000 1.000
#> GSM11850     1   0.388      0.897 0.924 0.076
#> GSM11851     1   0.000      0.967 1.000 0.000
#> GSM11721     2   0.000      0.940 0.000 1.000
#> GSM11852     1   0.000      0.967 1.000 0.000
#> GSM11694     1   0.000      0.967 1.000 0.000
#> GSM11695     1   0.000      0.967 1.000 0.000
#> GSM11734     2   0.000      0.940 0.000 1.000
#> GSM11861     2   0.814      0.673 0.252 0.748
#> GSM11843     2   0.000      0.940 0.000 1.000
#> GSM11862     2   0.000      0.940 0.000 1.000
#> GSM11697     1   0.000      0.967 1.000 0.000
#> GSM11714     1   0.000      0.967 1.000 0.000
#> GSM11723     2   0.000      0.940 0.000 1.000
#> GSM11845     2   0.000      0.940 0.000 1.000
#> GSM11683     1   0.000      0.967 1.000 0.000
#> GSM11691     1   0.000      0.967 1.000 0.000
#> GSM27949     1   0.000      0.967 1.000 0.000
#> GSM27945     1   0.000      0.967 1.000 0.000
#> GSM11706     1   0.000      0.967 1.000 0.000
#> GSM11853     1   0.000      0.967 1.000 0.000
#> GSM11729     2   0.000      0.940 0.000 1.000
#> GSM11746     2   0.000      0.940 0.000 1.000
#> GSM11711     1   0.000      0.967 1.000 0.000
#> GSM11854     1   0.000      0.967 1.000 0.000
#> GSM11731     2   0.000      0.940 0.000 1.000
#> GSM11839     2   0.000      0.940 0.000 1.000
#> GSM11836     2   0.000      0.940 0.000 1.000
#> GSM11849     1   0.000      0.967 1.000 0.000
#> GSM11682     1   0.000      0.967 1.000 0.000
#> GSM11690     1   0.000      0.967 1.000 0.000
#> GSM11692     2   0.000      0.940 0.000 1.000
#> GSM11841     2   0.000      0.940 0.000 1.000
#> GSM11901     2   0.000      0.940 0.000 1.000
#> GSM11715     2   0.000      0.940 0.000 1.000
#> GSM11724     2   0.000      0.940 0.000 1.000
#> GSM11684     1   0.000      0.967 1.000 0.000
#> GSM11696     1   0.000      0.967 1.000 0.000
#> GSM27952     1   0.000      0.967 1.000 0.000
#> GSM27948     2   0.966      0.407 0.392 0.608

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11735     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11733     3  0.3802     0.8502 0.080 0.032 0.888
#> GSM11863     2  0.2448     0.8315 0.076 0.924 0.000
#> GSM11710     3  0.0424     0.9005 0.008 0.000 0.992
#> GSM11712     2  0.2448     0.8315 0.076 0.924 0.000
#> GSM11732     2  0.6008     0.3902 0.000 0.628 0.372
#> GSM11844     3  0.5621     0.5583 0.000 0.308 0.692
#> GSM11842     2  0.2448     0.8315 0.076 0.924 0.000
#> GSM11860     2  0.1031     0.8551 0.024 0.976 0.000
#> GSM11686     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11688     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11846     3  0.6062     0.3026 0.384 0.000 0.616
#> GSM11680     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11698     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11840     3  0.7653     0.5659 0.080 0.276 0.644
#> GSM11847     3  0.5339     0.8001 0.080 0.096 0.824
#> GSM11685     3  0.0237     0.9016 0.004 0.000 0.996
#> GSM11699     3  0.3141     0.8643 0.068 0.020 0.912
#> GSM27950     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM27946     3  0.3550     0.8542 0.080 0.024 0.896
#> GSM11709     1  0.2902     0.8839 0.920 0.016 0.064
#> GSM11720     1  0.5859     0.5062 0.656 0.344 0.000
#> GSM11726     1  0.5650     0.5725 0.688 0.312 0.000
#> GSM11837     2  0.2796     0.8196 0.092 0.908 0.000
#> GSM11725     2  0.2878     0.8166 0.096 0.904 0.000
#> GSM11864     2  0.2796     0.8196 0.092 0.908 0.000
#> GSM11687     1  0.2902     0.8839 0.920 0.016 0.064
#> GSM11693     1  0.2902     0.8839 0.920 0.016 0.064
#> GSM11727     2  0.6192     0.2067 0.420 0.580 0.000
#> GSM11838     2  0.2796     0.8196 0.092 0.908 0.000
#> GSM11681     1  0.3267     0.8655 0.884 0.000 0.116
#> GSM11689     1  0.2982     0.8796 0.920 0.024 0.056
#> GSM11704     1  0.2682     0.8368 0.920 0.076 0.004
#> GSM11703     1  0.2774     0.8840 0.920 0.008 0.072
#> GSM11705     1  0.2878     0.8772 0.904 0.000 0.096
#> GSM11722     2  0.6308    -0.0632 0.492 0.508 0.000
#> GSM11730     1  0.5497     0.6064 0.708 0.292 0.000
#> GSM11713     1  0.2959     0.8757 0.900 0.000 0.100
#> GSM11728     1  0.3619     0.8504 0.864 0.000 0.136
#> GSM27947     1  0.4887     0.7478 0.772 0.000 0.228
#> GSM27951     1  0.2537     0.8827 0.920 0.000 0.080
#> GSM11707     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11716     2  0.2878     0.8166 0.096 0.904 0.000
#> GSM11850     3  0.3780     0.8393 0.044 0.064 0.892
#> GSM11851     3  0.2165     0.8762 0.064 0.000 0.936
#> GSM11721     2  0.2537     0.8294 0.080 0.920 0.000
#> GSM11852     3  0.3276     0.8620 0.068 0.024 0.908
#> GSM11694     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11695     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11734     2  0.1031     0.8551 0.024 0.976 0.000
#> GSM11861     2  0.6807     0.6215 0.092 0.736 0.172
#> GSM11843     2  0.1031     0.8551 0.024 0.976 0.000
#> GSM11862     2  0.2537     0.8294 0.080 0.920 0.000
#> GSM11697     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11714     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11723     2  0.1031     0.8551 0.024 0.976 0.000
#> GSM11845     2  0.1031     0.8551 0.024 0.976 0.000
#> GSM11683     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11691     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM27949     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM27945     3  0.0424     0.8982 0.008 0.000 0.992
#> GSM11706     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11853     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11729     2  0.1031     0.8551 0.024 0.976 0.000
#> GSM11746     2  0.2796     0.8196 0.092 0.908 0.000
#> GSM11711     3  0.0000     0.9026 0.000 0.000 1.000
#> GSM11854     3  0.2165     0.8762 0.064 0.000 0.936
#> GSM11731     2  0.1031     0.8551 0.024 0.976 0.000
#> GSM11839     2  0.0237     0.8527 0.004 0.996 0.000
#> GSM11836     2  0.0592     0.8494 0.012 0.988 0.000
#> GSM11849     3  0.7974     0.5254 0.312 0.084 0.604
#> GSM11682     3  0.1289     0.8872 0.032 0.000 0.968
#> GSM11690     3  0.5650     0.7928 0.108 0.084 0.808
#> GSM11692     2  0.2537     0.8294 0.080 0.920 0.000
#> GSM11841     2  0.2448     0.8315 0.076 0.924 0.000
#> GSM11901     2  0.2537     0.8294 0.080 0.920 0.000
#> GSM11715     2  0.1031     0.8551 0.024 0.976 0.000
#> GSM11724     2  0.1031     0.8551 0.024 0.976 0.000
#> GSM11684     3  0.8257     0.3993 0.372 0.084 0.544
#> GSM11696     3  0.8257     0.3993 0.372 0.084 0.544
#> GSM27952     3  0.0237     0.9016 0.004 0.000 0.996
#> GSM27948     2  0.8744    -0.0973 0.108 0.448 0.444

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11735     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11733     3  0.4543     0.5142 0.000 0.000 0.676 0.324
#> GSM11863     4  0.4605     0.5731 0.000 0.336 0.000 0.664
#> GSM11710     3  0.0817     0.9252 0.000 0.000 0.976 0.024
#> GSM11712     4  0.4643     0.5599 0.000 0.344 0.000 0.656
#> GSM11732     2  0.5040     0.4161 0.000 0.628 0.364 0.008
#> GSM11844     3  0.3803     0.7819 0.000 0.132 0.836 0.032
#> GSM11842     4  0.4661     0.5526 0.000 0.348 0.000 0.652
#> GSM11860     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11686     3  0.0188     0.9374 0.000 0.000 0.996 0.004
#> GSM11688     3  0.0188     0.9374 0.000 0.000 0.996 0.004
#> GSM11846     3  0.4907     0.2970 0.420 0.000 0.580 0.000
#> GSM11680     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11698     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11840     4  0.2081     0.8069 0.000 0.000 0.084 0.916
#> GSM11847     4  0.1637     0.8183 0.000 0.000 0.060 0.940
#> GSM11685     3  0.0707     0.9280 0.000 0.000 0.980 0.020
#> GSM11699     3  0.4855     0.3074 0.000 0.000 0.600 0.400
#> GSM27950     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM27946     4  0.2281     0.8114 0.000 0.000 0.096 0.904
#> GSM11709     1  0.0000     0.9358 1.000 0.000 0.000 0.000
#> GSM11720     2  0.4103     0.6372 0.256 0.744 0.000 0.000
#> GSM11726     2  0.4661     0.4560 0.348 0.652 0.000 0.000
#> GSM11837     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11725     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11864     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11687     1  0.0000     0.9358 1.000 0.000 0.000 0.000
#> GSM11693     1  0.0000     0.9358 1.000 0.000 0.000 0.000
#> GSM11727     2  0.0817     0.9225 0.024 0.976 0.000 0.000
#> GSM11838     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11681     1  0.0000     0.9358 1.000 0.000 0.000 0.000
#> GSM11689     1  0.0000     0.9358 1.000 0.000 0.000 0.000
#> GSM11704     1  0.0000     0.9358 1.000 0.000 0.000 0.000
#> GSM11703     1  0.0000     0.9358 1.000 0.000 0.000 0.000
#> GSM11705     1  0.0000     0.9358 1.000 0.000 0.000 0.000
#> GSM11722     2  0.1792     0.8830 0.068 0.932 0.000 0.000
#> GSM11730     1  0.4999    -0.0634 0.508 0.492 0.000 0.000
#> GSM11713     1  0.0188     0.9333 0.996 0.000 0.000 0.004
#> GSM11728     1  0.1389     0.8986 0.952 0.000 0.000 0.048
#> GSM27947     1  0.3474     0.8143 0.868 0.000 0.064 0.068
#> GSM27951     1  0.0000     0.9358 1.000 0.000 0.000 0.000
#> GSM11707     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11716     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11850     3  0.0921     0.9158 0.000 0.028 0.972 0.000
#> GSM11851     3  0.0188     0.9367 0.000 0.000 0.996 0.004
#> GSM11721     4  0.0000     0.8257 0.000 0.000 0.000 1.000
#> GSM11852     4  0.4661     0.4257 0.000 0.000 0.348 0.652
#> GSM11694     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11695     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11734     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11861     4  0.0000     0.8257 0.000 0.000 0.000 1.000
#> GSM11843     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11862     4  0.0000     0.8257 0.000 0.000 0.000 1.000
#> GSM11697     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11714     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11723     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11845     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11683     3  0.0188     0.9374 0.000 0.000 0.996 0.004
#> GSM11691     3  0.0188     0.9374 0.000 0.000 0.996 0.004
#> GSM27949     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM27945     3  0.0376     0.9355 0.004 0.000 0.992 0.004
#> GSM11706     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11853     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11729     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11746     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11711     3  0.0000     0.9385 0.000 0.000 1.000 0.000
#> GSM11854     3  0.0188     0.9372 0.000 0.000 0.996 0.004
#> GSM11731     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11839     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11836     2  0.0592     0.9254 0.000 0.984 0.000 0.016
#> GSM11849     4  0.2149     0.8168 0.000 0.000 0.088 0.912
#> GSM11682     3  0.3688     0.7215 0.000 0.000 0.792 0.208
#> GSM11690     4  0.2149     0.8168 0.000 0.000 0.088 0.912
#> GSM11692     4  0.0000     0.8257 0.000 0.000 0.000 1.000
#> GSM11841     4  0.4193     0.6634 0.000 0.268 0.000 0.732
#> GSM11901     4  0.3266     0.7579 0.000 0.168 0.000 0.832
#> GSM11715     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11724     2  0.0000     0.9396 0.000 1.000 0.000 0.000
#> GSM11684     4  0.2149     0.8168 0.000 0.000 0.088 0.912
#> GSM11696     4  0.2149     0.8168 0.000 0.000 0.088 0.912
#> GSM27952     3  0.0921     0.9224 0.000 0.000 0.972 0.028
#> GSM27948     4  0.0000     0.8257 0.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     3  0.0510    0.79020 0.000 0.000 0.984 0.016 0.000
#> GSM11735     3  0.0404    0.78841 0.000 0.000 0.988 0.000 0.012
#> GSM11733     5  0.2362    0.57389 0.000 0.000 0.076 0.024 0.900
#> GSM11863     5  0.2903    0.66899 0.000 0.080 0.000 0.048 0.872
#> GSM11710     3  0.4211    0.47699 0.000 0.000 0.636 0.360 0.004
#> GSM11712     5  0.4847    0.63053 0.000 0.216 0.000 0.080 0.704
#> GSM11732     5  0.6145   -0.06808 0.000 0.076 0.416 0.020 0.488
#> GSM11844     3  0.4829    0.16140 0.000 0.000 0.500 0.020 0.480
#> GSM11842     5  0.4558    0.63407 0.000 0.216 0.000 0.060 0.724
#> GSM11860     2  0.1121    0.91292 0.000 0.956 0.000 0.000 0.044
#> GSM11686     3  0.4196    0.48386 0.000 0.000 0.640 0.356 0.004
#> GSM11688     3  0.4196    0.48386 0.000 0.000 0.640 0.356 0.004
#> GSM11846     1  0.4875    0.24917 0.576 0.000 0.400 0.020 0.004
#> GSM11680     3  0.0566    0.78983 0.000 0.000 0.984 0.012 0.004
#> GSM11698     3  0.0566    0.79024 0.000 0.000 0.984 0.012 0.004
#> GSM11840     5  0.0703    0.63782 0.000 0.000 0.000 0.024 0.976
#> GSM11847     5  0.0794    0.63888 0.000 0.000 0.000 0.028 0.972
#> GSM11685     3  0.4225    0.46964 0.000 0.000 0.632 0.364 0.004
#> GSM11699     4  0.4610    0.01810 0.000 0.000 0.432 0.556 0.012
#> GSM27950     3  0.0404    0.79029 0.000 0.000 0.988 0.012 0.000
#> GSM27946     4  0.2719    0.67631 0.000 0.000 0.068 0.884 0.048
#> GSM11709     1  0.0000    0.91289 1.000 0.000 0.000 0.000 0.000
#> GSM11720     2  0.3707    0.63771 0.284 0.716 0.000 0.000 0.000
#> GSM11726     2  0.4101    0.46766 0.372 0.628 0.000 0.000 0.000
#> GSM11837     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11725     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11864     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11687     1  0.0000    0.91289 1.000 0.000 0.000 0.000 0.000
#> GSM11693     1  0.0000    0.91289 1.000 0.000 0.000 0.000 0.000
#> GSM11727     2  0.0451    0.93810 0.008 0.988 0.000 0.000 0.004
#> GSM11838     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11681     1  0.0000    0.91289 1.000 0.000 0.000 0.000 0.000
#> GSM11689     1  0.0000    0.91289 1.000 0.000 0.000 0.000 0.000
#> GSM11704     1  0.0000    0.91289 1.000 0.000 0.000 0.000 0.000
#> GSM11703     1  0.0000    0.91289 1.000 0.000 0.000 0.000 0.000
#> GSM11705     1  0.0000    0.91289 1.000 0.000 0.000 0.000 0.000
#> GSM11722     2  0.0566    0.93553 0.012 0.984 0.000 0.000 0.004
#> GSM11730     2  0.3456    0.74162 0.204 0.788 0.000 0.004 0.004
#> GSM11713     1  0.3398    0.67235 0.780 0.000 0.000 0.216 0.004
#> GSM11728     4  0.4783    0.00448 0.452 0.000 0.012 0.532 0.004
#> GSM27947     1  0.3446    0.78024 0.844 0.000 0.044 0.104 0.008
#> GSM27951     1  0.0000    0.91289 1.000 0.000 0.000 0.000 0.000
#> GSM11707     3  0.0510    0.79020 0.000 0.000 0.984 0.016 0.000
#> GSM11716     2  0.1557    0.90087 0.000 0.940 0.008 0.000 0.052
#> GSM11850     3  0.4318    0.55065 0.000 0.000 0.688 0.020 0.292
#> GSM11851     3  0.5077    0.41451 0.000 0.000 0.568 0.040 0.392
#> GSM11721     5  0.4297    0.20333 0.000 0.000 0.000 0.472 0.528
#> GSM11852     4  0.2189    0.66537 0.000 0.000 0.084 0.904 0.012
#> GSM11694     3  0.1012    0.78329 0.000 0.000 0.968 0.012 0.020
#> GSM11695     3  0.1012    0.78329 0.000 0.000 0.968 0.012 0.020
#> GSM11734     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11861     4  0.4242   -0.06803 0.000 0.000 0.000 0.572 0.428
#> GSM11843     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11862     4  0.4300   -0.20014 0.000 0.000 0.000 0.524 0.476
#> GSM11697     3  0.0671    0.78703 0.000 0.000 0.980 0.004 0.016
#> GSM11714     3  0.0510    0.79020 0.000 0.000 0.984 0.016 0.000
#> GSM11723     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11845     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11683     3  0.4084    0.52260 0.000 0.000 0.668 0.328 0.004
#> GSM11691     3  0.2011    0.75559 0.000 0.000 0.908 0.088 0.004
#> GSM27949     3  0.0162    0.78972 0.000 0.000 0.996 0.000 0.004
#> GSM27945     3  0.2269    0.76427 0.020 0.000 0.920 0.032 0.028
#> GSM11706     3  0.1041    0.78552 0.000 0.000 0.964 0.032 0.004
#> GSM11853     3  0.4522    0.60368 0.000 0.000 0.708 0.044 0.248
#> GSM11729     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11746     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11711     3  0.1952    0.76270 0.000 0.000 0.912 0.084 0.004
#> GSM11854     3  0.5216    0.60311 0.000 0.000 0.660 0.092 0.248
#> GSM11731     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11839     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11836     2  0.0880    0.91972 0.000 0.968 0.000 0.000 0.032
#> GSM11849     4  0.1893    0.68667 0.000 0.000 0.048 0.928 0.024
#> GSM11682     4  0.3730    0.43439 0.000 0.000 0.288 0.712 0.000
#> GSM11690     4  0.1893    0.68667 0.000 0.000 0.048 0.928 0.024
#> GSM11692     5  0.4150    0.38211 0.000 0.000 0.000 0.388 0.612
#> GSM11841     5  0.5127    0.63387 0.000 0.184 0.000 0.124 0.692
#> GSM11901     5  0.5122    0.61161 0.000 0.112 0.000 0.200 0.688
#> GSM11715     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11724     2  0.0000    0.94425 0.000 1.000 0.000 0.000 0.000
#> GSM11684     4  0.1893    0.68667 0.000 0.000 0.048 0.928 0.024
#> GSM11696     4  0.1893    0.68667 0.000 0.000 0.048 0.928 0.024
#> GSM27952     3  0.4341    0.38647 0.000 0.000 0.592 0.404 0.004
#> GSM27948     4  0.3336    0.41377 0.000 0.000 0.000 0.772 0.228

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6  0.2048     0.6888 0.000 0.000 0.120 0.000 0.000 0.880
#> GSM11735     6  0.3081     0.5968 0.000 0.000 0.220 0.000 0.004 0.776
#> GSM11733     5  0.4249     0.4083 0.000 0.000 0.328 0.000 0.640 0.032
#> GSM11863     5  0.1341     0.7058 0.000 0.024 0.028 0.000 0.948 0.000
#> GSM11710     6  0.1995     0.6762 0.000 0.000 0.036 0.052 0.000 0.912
#> GSM11712     5  0.2776     0.6990 0.000 0.088 0.000 0.052 0.860 0.000
#> GSM11732     3  0.4259     0.4295 0.000 0.012 0.744 0.004 0.188 0.052
#> GSM11844     3  0.4288     0.4070 0.000 0.000 0.716 0.004 0.216 0.064
#> GSM11842     5  0.2068     0.7025 0.000 0.080 0.008 0.008 0.904 0.000
#> GSM11860     2  0.2199     0.8513 0.000 0.892 0.020 0.000 0.088 0.000
#> GSM11686     6  0.1501     0.6888 0.000 0.000 0.000 0.076 0.000 0.924
#> GSM11688     6  0.1501     0.6888 0.000 0.000 0.000 0.076 0.000 0.924
#> GSM11846     1  0.5472     0.0697 0.464 0.000 0.124 0.000 0.000 0.412
#> GSM11680     6  0.4076     0.3418 0.000 0.000 0.364 0.016 0.000 0.620
#> GSM11698     6  0.3337     0.5625 0.000 0.000 0.260 0.004 0.000 0.736
#> GSM11840     5  0.2912     0.6038 0.000 0.000 0.216 0.000 0.784 0.000
#> GSM11847     5  0.2793     0.6176 0.000 0.000 0.200 0.000 0.800 0.000
#> GSM11685     6  0.1700     0.6875 0.000 0.000 0.004 0.080 0.000 0.916
#> GSM11699     6  0.4911     0.3357 0.000 0.000 0.060 0.332 0.008 0.600
#> GSM27950     6  0.2340     0.6741 0.000 0.000 0.148 0.000 0.000 0.852
#> GSM27946     4  0.5056     0.6086 0.000 0.000 0.092 0.716 0.080 0.112
#> GSM11709     1  0.0000     0.8728 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11720     2  0.3725     0.5620 0.316 0.676 0.008 0.000 0.000 0.000
#> GSM11726     2  0.4372     0.2752 0.432 0.544 0.024 0.000 0.000 0.000
#> GSM11837     2  0.0146     0.9140 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM11725     2  0.0146     0.9140 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM11864     2  0.0146     0.9140 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM11687     1  0.0000     0.8728 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11693     1  0.0000     0.8728 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11727     2  0.0291     0.9125 0.004 0.992 0.000 0.000 0.004 0.000
#> GSM11838     2  0.0000     0.9140 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11681     1  0.0547     0.8597 0.980 0.000 0.000 0.000 0.000 0.020
#> GSM11689     1  0.0000     0.8728 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11704     1  0.0000     0.8728 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11703     1  0.0000     0.8728 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11705     1  0.0000     0.8728 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11722     2  0.0291     0.9125 0.004 0.992 0.000 0.000 0.004 0.000
#> GSM11730     2  0.4311     0.6367 0.228 0.708 0.000 0.060 0.004 0.000
#> GSM11713     1  0.4386     0.3467 0.600 0.000 0.000 0.372 0.004 0.024
#> GSM11728     4  0.4617     0.3923 0.284 0.000 0.000 0.652 0.004 0.060
#> GSM27947     1  0.5116     0.5814 0.684 0.000 0.188 0.088 0.000 0.040
#> GSM27951     1  0.0000     0.8728 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11707     6  0.2048     0.6888 0.000 0.000 0.120 0.000 0.000 0.880
#> GSM11716     2  0.3746     0.6394 0.000 0.712 0.272 0.004 0.012 0.000
#> GSM11850     3  0.2714     0.5139 0.000 0.000 0.872 0.004 0.060 0.064
#> GSM11851     3  0.5446     0.3709 0.000 0.000 0.568 0.000 0.176 0.256
#> GSM11721     5  0.3714     0.4594 0.000 0.000 0.004 0.340 0.656 0.000
#> GSM11852     4  0.4449     0.6042 0.000 0.000 0.036 0.684 0.016 0.264
#> GSM11694     3  0.4254     0.2113 0.000 0.000 0.576 0.020 0.000 0.404
#> GSM11695     3  0.4261     0.2030 0.000 0.000 0.572 0.020 0.000 0.408
#> GSM11734     2  0.0363     0.9145 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM11861     4  0.4676    -0.0250 0.000 0.000 0.044 0.528 0.428 0.000
#> GSM11843     2  0.0363     0.9145 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM11862     5  0.4592     0.0908 0.000 0.000 0.036 0.468 0.496 0.000
#> GSM11697     3  0.4328     0.0428 0.000 0.000 0.520 0.020 0.000 0.460
#> GSM11714     6  0.2048     0.6888 0.000 0.000 0.120 0.000 0.000 0.880
#> GSM11723     2  0.0458     0.9140 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM11845     2  0.0458     0.9140 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM11683     6  0.2237     0.6967 0.000 0.000 0.036 0.068 0.000 0.896
#> GSM11691     6  0.4411     0.2821 0.004 0.000 0.356 0.028 0.000 0.612
#> GSM27949     6  0.3833     0.3810 0.000 0.000 0.344 0.008 0.000 0.648
#> GSM27945     3  0.5255     0.3131 0.028 0.000 0.596 0.048 0.004 0.324
#> GSM11706     6  0.1387     0.6916 0.000 0.000 0.068 0.000 0.000 0.932
#> GSM11853     3  0.4838     0.2246 0.000 0.000 0.544 0.000 0.060 0.396
#> GSM11729     2  0.0146     0.9145 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM11746     2  0.0146     0.9140 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM11711     6  0.1913     0.6830 0.000 0.000 0.080 0.012 0.000 0.908
#> GSM11854     6  0.4878    -0.1146 0.000 0.000 0.424 0.000 0.060 0.516
#> GSM11731     2  0.0458     0.9140 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM11839     2  0.0935     0.9040 0.000 0.964 0.000 0.004 0.032 0.000
#> GSM11836     2  0.2176     0.8492 0.000 0.896 0.000 0.024 0.080 0.000
#> GSM11849     4  0.0972     0.7153 0.000 0.000 0.000 0.964 0.008 0.028
#> GSM11682     4  0.3765     0.3501 0.000 0.000 0.000 0.596 0.000 0.404
#> GSM11690     4  0.1594     0.7123 0.000 0.000 0.000 0.932 0.016 0.052
#> GSM11692     5  0.2912     0.6378 0.000 0.000 0.000 0.216 0.784 0.000
#> GSM11841     5  0.3295     0.6942 0.000 0.056 0.000 0.128 0.816 0.000
#> GSM11901     5  0.3139     0.6871 0.000 0.032 0.000 0.152 0.816 0.000
#> GSM11715     2  0.0458     0.9140 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM11724     2  0.0458     0.9140 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM11684     4  0.0547     0.7134 0.000 0.000 0.000 0.980 0.000 0.020
#> GSM11696     4  0.0603     0.7118 0.000 0.000 0.000 0.980 0.004 0.016
#> GSM27952     6  0.1958     0.6677 0.000 0.000 0.004 0.100 0.000 0.896
#> GSM27948     4  0.3411     0.5028 0.000 0.000 0.004 0.756 0.232 0.008

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-skmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n cell.line(p) agent(p)  time(p) k
#> ATC:skmeans 79     8.50e-01   0.0961 6.51e-06 2
#> ATC:skmeans 76     8.39e-12   0.4412 1.72e-02 3
#> ATC:skmeans 77     6.75e-10   0.3696 2.35e-04 4
#> ATC:skmeans 65     3.59e-09   0.3210 8.99e-06 5
#> ATC:skmeans 61     3.14e-07   0.2247 7.28e-05 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:pam*

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "pam"]
# you can also extract it by
# res = res_list["ATC:pam"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-pam-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-pam-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.949           0.935       0.974         0.4047 0.606   0.606
#> 3 3 0.598           0.727       0.851         0.4771 0.797   0.670
#> 4 4 0.893           0.884       0.931         0.1685 0.784   0.538
#> 5 5 0.823           0.834       0.904         0.1234 0.904   0.679
#> 6 6 0.766           0.736       0.850         0.0339 0.964   0.831

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1   0.000      0.972 1.000 0.000
#> GSM11735     1   0.000      0.972 1.000 0.000
#> GSM11733     1   0.000      0.972 1.000 0.000
#> GSM11863     1   0.973      0.317 0.596 0.404
#> GSM11710     1   0.000      0.972 1.000 0.000
#> GSM11712     2   0.913      0.507 0.328 0.672
#> GSM11732     1   0.000      0.972 1.000 0.000
#> GSM11844     1   0.000      0.972 1.000 0.000
#> GSM11842     2   0.827      0.643 0.260 0.740
#> GSM11860     1   0.689      0.761 0.816 0.184
#> GSM11686     1   0.000      0.972 1.000 0.000
#> GSM11688     1   0.000      0.972 1.000 0.000
#> GSM11846     1   0.000      0.972 1.000 0.000
#> GSM11680     1   0.000      0.972 1.000 0.000
#> GSM11698     1   0.000      0.972 1.000 0.000
#> GSM11840     1   0.000      0.972 1.000 0.000
#> GSM11847     1   0.000      0.972 1.000 0.000
#> GSM11685     1   0.000      0.972 1.000 0.000
#> GSM11699     1   0.000      0.972 1.000 0.000
#> GSM27950     1   0.000      0.972 1.000 0.000
#> GSM27946     1   0.000      0.972 1.000 0.000
#> GSM11709     1   0.000      0.972 1.000 0.000
#> GSM11720     1   0.973      0.317 0.596 0.404
#> GSM11726     1   0.000      0.972 1.000 0.000
#> GSM11837     2   0.000      0.971 0.000 1.000
#> GSM11725     2   0.000      0.971 0.000 1.000
#> GSM11864     2   0.000      0.971 0.000 1.000
#> GSM11687     1   0.000      0.972 1.000 0.000
#> GSM11693     1   0.000      0.972 1.000 0.000
#> GSM11727     2   0.000      0.971 0.000 1.000
#> GSM11838     2   0.000      0.971 0.000 1.000
#> GSM11681     1   0.000      0.972 1.000 0.000
#> GSM11689     1   0.000      0.972 1.000 0.000
#> GSM11704     1   0.000      0.972 1.000 0.000
#> GSM11703     1   0.000      0.972 1.000 0.000
#> GSM11705     1   0.000      0.972 1.000 0.000
#> GSM11722     2   0.000      0.971 0.000 1.000
#> GSM11730     2   0.000      0.971 0.000 1.000
#> GSM11713     1   0.000      0.972 1.000 0.000
#> GSM11728     1   0.000      0.972 1.000 0.000
#> GSM27947     1   0.000      0.972 1.000 0.000
#> GSM27951     1   0.000      0.972 1.000 0.000
#> GSM11707     1   0.000      0.972 1.000 0.000
#> GSM11716     1   0.913      0.506 0.672 0.328
#> GSM11850     1   0.000      0.972 1.000 0.000
#> GSM11851     1   0.000      0.972 1.000 0.000
#> GSM11721     1   0.000      0.972 1.000 0.000
#> GSM11852     1   0.000      0.972 1.000 0.000
#> GSM11694     1   0.000      0.972 1.000 0.000
#> GSM11695     1   0.000      0.972 1.000 0.000
#> GSM11734     2   0.000      0.971 0.000 1.000
#> GSM11861     1   0.000      0.972 1.000 0.000
#> GSM11843     2   0.000      0.971 0.000 1.000
#> GSM11862     1   0.000      0.972 1.000 0.000
#> GSM11697     1   0.000      0.972 1.000 0.000
#> GSM11714     1   0.000      0.972 1.000 0.000
#> GSM11723     2   0.000      0.971 0.000 1.000
#> GSM11845     2   0.000      0.971 0.000 1.000
#> GSM11683     1   0.000      0.972 1.000 0.000
#> GSM11691     1   0.000      0.972 1.000 0.000
#> GSM27949     1   0.000      0.972 1.000 0.000
#> GSM27945     1   0.000      0.972 1.000 0.000
#> GSM11706     1   0.000      0.972 1.000 0.000
#> GSM11853     1   0.000      0.972 1.000 0.000
#> GSM11729     2   0.000      0.971 0.000 1.000
#> GSM11746     2   0.000      0.971 0.000 1.000
#> GSM11711     1   0.000      0.972 1.000 0.000
#> GSM11854     1   0.000      0.972 1.000 0.000
#> GSM11731     2   0.000      0.971 0.000 1.000
#> GSM11839     2   0.000      0.971 0.000 1.000
#> GSM11836     2   0.000      0.971 0.000 1.000
#> GSM11849     1   0.000      0.972 1.000 0.000
#> GSM11682     1   0.000      0.972 1.000 0.000
#> GSM11690     1   0.000      0.972 1.000 0.000
#> GSM11692     1   0.000      0.972 1.000 0.000
#> GSM11841     2   0.000      0.971 0.000 1.000
#> GSM11901     2   0.000      0.971 0.000 1.000
#> GSM11715     2   0.000      0.971 0.000 1.000
#> GSM11724     2   0.000      0.971 0.000 1.000
#> GSM11684     1   0.260      0.931 0.956 0.044
#> GSM11696     1   0.722      0.737 0.800 0.200
#> GSM27952     1   0.000      0.972 1.000 0.000
#> GSM27948     1   0.000      0.972 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.2711      0.818 0.088 0.000 0.912
#> GSM11735     3  0.2711      0.818 0.088 0.000 0.912
#> GSM11733     3  0.0000      0.837 0.000 0.000 1.000
#> GSM11863     2  0.8458     -0.171 0.088 0.476 0.436
#> GSM11710     3  0.2711      0.818 0.088 0.000 0.912
#> GSM11712     2  0.4063      0.672 0.020 0.868 0.112
#> GSM11732     3  0.2878      0.806 0.096 0.000 0.904
#> GSM11844     3  0.0892      0.835 0.020 0.000 0.980
#> GSM11842     2  0.1753      0.770 0.000 0.952 0.048
#> GSM11860     3  0.6168      0.236 0.412 0.000 0.588
#> GSM11686     3  0.2711      0.818 0.088 0.000 0.912
#> GSM11688     3  0.2711      0.818 0.088 0.000 0.912
#> GSM11846     3  0.0000      0.837 0.000 0.000 1.000
#> GSM11680     3  0.3267      0.829 0.116 0.000 0.884
#> GSM11698     3  0.2448      0.823 0.076 0.000 0.924
#> GSM11840     3  0.4369      0.786 0.096 0.040 0.864
#> GSM11847     3  0.7677      0.588 0.096 0.244 0.660
#> GSM11685     3  0.2711      0.818 0.088 0.000 0.912
#> GSM11699     3  0.0000      0.837 0.000 0.000 1.000
#> GSM27950     3  0.2711      0.818 0.088 0.000 0.912
#> GSM27946     3  0.5663      0.744 0.096 0.096 0.808
#> GSM11709     1  0.2711      0.799 0.912 0.000 0.088
#> GSM11720     1  0.3590      0.768 0.896 0.028 0.076
#> GSM11726     1  0.2711      0.799 0.912 0.000 0.088
#> GSM11837     2  0.5058      0.738 0.244 0.756 0.000
#> GSM11725     2  0.5058      0.738 0.244 0.756 0.000
#> GSM11864     2  0.5058      0.738 0.244 0.756 0.000
#> GSM11687     1  0.2711      0.799 0.912 0.000 0.088
#> GSM11693     1  0.2711      0.799 0.912 0.000 0.088
#> GSM11727     2  0.8169      0.377 0.388 0.536 0.076
#> GSM11838     2  0.5058      0.738 0.244 0.756 0.000
#> GSM11681     1  0.6215      0.536 0.572 0.000 0.428
#> GSM11689     1  0.2711      0.799 0.912 0.000 0.088
#> GSM11704     1  0.2711      0.799 0.912 0.000 0.088
#> GSM11703     1  0.5785      0.618 0.668 0.000 0.332
#> GSM11705     3  0.6252     -0.255 0.444 0.000 0.556
#> GSM11722     2  0.5058      0.738 0.244 0.756 0.000
#> GSM11730     1  0.8213      0.264 0.568 0.344 0.088
#> GSM11713     3  0.0000      0.837 0.000 0.000 1.000
#> GSM11728     3  0.2165      0.822 0.064 0.000 0.936
#> GSM27947     1  0.6235      0.402 0.564 0.000 0.436
#> GSM27951     1  0.6192      0.546 0.580 0.000 0.420
#> GSM11707     3  0.2711      0.818 0.088 0.000 0.912
#> GSM11716     1  0.2945      0.797 0.908 0.004 0.088
#> GSM11850     3  0.2878      0.806 0.096 0.000 0.904
#> GSM11851     3  0.0000      0.837 0.000 0.000 1.000
#> GSM11721     3  0.7677      0.588 0.096 0.244 0.660
#> GSM11852     3  0.0000      0.837 0.000 0.000 1.000
#> GSM11694     3  0.2878      0.806 0.096 0.000 0.904
#> GSM11695     3  0.2878      0.806 0.096 0.000 0.904
#> GSM11734     2  0.1643      0.807 0.044 0.956 0.000
#> GSM11861     3  0.2280      0.827 0.052 0.008 0.940
#> GSM11843     2  0.4291      0.767 0.180 0.820 0.000
#> GSM11862     3  0.7677      0.588 0.096 0.244 0.660
#> GSM11697     3  0.1163      0.834 0.028 0.000 0.972
#> GSM11714     3  0.2711      0.818 0.088 0.000 0.912
#> GSM11723     2  0.0000      0.813 0.000 1.000 0.000
#> GSM11845     2  0.0000      0.813 0.000 1.000 0.000
#> GSM11683     3  0.2537      0.822 0.080 0.000 0.920
#> GSM11691     3  0.2878      0.806 0.096 0.000 0.904
#> GSM27949     3  0.2448      0.823 0.076 0.000 0.924
#> GSM27945     3  0.2878      0.806 0.096 0.000 0.904
#> GSM11706     3  0.1289      0.834 0.032 0.000 0.968
#> GSM11853     3  0.0000      0.837 0.000 0.000 1.000
#> GSM11729     2  0.5058      0.738 0.244 0.756 0.000
#> GSM11746     2  0.5058      0.738 0.244 0.756 0.000
#> GSM11711     3  0.0000      0.837 0.000 0.000 1.000
#> GSM11854     3  0.0000      0.837 0.000 0.000 1.000
#> GSM11731     2  0.0000      0.813 0.000 1.000 0.000
#> GSM11839     2  0.0000      0.813 0.000 1.000 0.000
#> GSM11836     2  0.0237      0.811 0.000 0.996 0.004
#> GSM11849     3  0.2448      0.817 0.076 0.000 0.924
#> GSM11682     3  0.2711      0.818 0.088 0.000 0.912
#> GSM11690     3  0.7677      0.588 0.096 0.244 0.660
#> GSM11692     3  0.7677      0.588 0.096 0.244 0.660
#> GSM11841     2  0.0000      0.813 0.000 1.000 0.000
#> GSM11901     2  0.0000      0.813 0.000 1.000 0.000
#> GSM11715     2  0.0000      0.813 0.000 1.000 0.000
#> GSM11724     2  0.0000      0.813 0.000 1.000 0.000
#> GSM11684     3  0.6026      0.634 0.024 0.244 0.732
#> GSM11696     3  0.7713      0.583 0.096 0.248 0.656
#> GSM27952     3  0.2711      0.818 0.088 0.000 0.912
#> GSM27948     3  0.7677      0.588 0.096 0.244 0.660

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.0804      0.926 0.008 0.000 0.980 0.012
#> GSM11735     3  0.0188      0.929 0.000 0.000 0.996 0.004
#> GSM11733     3  0.2334      0.928 0.004 0.000 0.908 0.088
#> GSM11863     4  0.0657      0.886 0.012 0.004 0.000 0.984
#> GSM11710     3  0.1151      0.933 0.024 0.000 0.968 0.008
#> GSM11712     4  0.1557      0.878 0.000 0.056 0.000 0.944
#> GSM11732     3  0.4679      0.811 0.044 0.000 0.772 0.184
#> GSM11844     3  0.2751      0.934 0.040 0.000 0.904 0.056
#> GSM11842     4  0.1940      0.872 0.000 0.076 0.000 0.924
#> GSM11860     3  0.6595      0.555 0.120 0.000 0.604 0.276
#> GSM11686     3  0.0672      0.927 0.008 0.000 0.984 0.008
#> GSM11688     3  0.0804      0.926 0.008 0.000 0.980 0.012
#> GSM11846     3  0.2489      0.932 0.068 0.000 0.912 0.020
#> GSM11680     3  0.1174      0.935 0.020 0.000 0.968 0.012
#> GSM11698     3  0.0376      0.932 0.004 0.000 0.992 0.004
#> GSM11840     4  0.4453      0.616 0.012 0.000 0.244 0.744
#> GSM11847     4  0.0469      0.886 0.012 0.000 0.000 0.988
#> GSM11685     3  0.0804      0.926 0.008 0.000 0.980 0.012
#> GSM11699     3  0.2565      0.936 0.032 0.000 0.912 0.056
#> GSM27950     3  0.0804      0.926 0.008 0.000 0.980 0.012
#> GSM27946     4  0.4417      0.694 0.044 0.000 0.160 0.796
#> GSM11709     1  0.0336      0.900 0.992 0.000 0.000 0.008
#> GSM11720     1  0.1109      0.899 0.968 0.004 0.000 0.028
#> GSM11726     1  0.1637      0.886 0.940 0.000 0.000 0.060
#> GSM11837     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM11725     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM11864     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM11687     1  0.0336      0.900 0.992 0.000 0.000 0.008
#> GSM11693     1  0.0592      0.902 0.984 0.000 0.000 0.016
#> GSM11727     1  0.1677      0.893 0.948 0.012 0.000 0.040
#> GSM11838     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM11681     1  0.0707      0.888 0.980 0.000 0.020 0.000
#> GSM11689     1  0.0592      0.902 0.984 0.000 0.000 0.016
#> GSM11704     1  0.0336      0.900 0.992 0.000 0.000 0.008
#> GSM11703     1  0.0707      0.902 0.980 0.000 0.000 0.020
#> GSM11705     1  0.4661      0.447 0.652 0.000 0.348 0.000
#> GSM11722     1  0.2011      0.839 0.920 0.080 0.000 0.000
#> GSM11730     1  0.1474      0.891 0.948 0.000 0.000 0.052
#> GSM11713     3  0.2266      0.925 0.084 0.000 0.912 0.004
#> GSM11728     3  0.2699      0.934 0.068 0.000 0.904 0.028
#> GSM27947     1  0.6733      0.367 0.564 0.000 0.324 0.112
#> GSM27951     1  0.0592      0.891 0.984 0.000 0.016 0.000
#> GSM11707     3  0.0188      0.929 0.000 0.000 0.996 0.004
#> GSM11716     1  0.1792      0.880 0.932 0.000 0.000 0.068
#> GSM11850     3  0.2996      0.930 0.044 0.000 0.892 0.064
#> GSM11851     3  0.2565      0.936 0.032 0.000 0.912 0.056
#> GSM11721     4  0.0469      0.886 0.012 0.000 0.000 0.988
#> GSM11852     3  0.2565      0.936 0.032 0.000 0.912 0.056
#> GSM11694     3  0.2996      0.930 0.044 0.000 0.892 0.064
#> GSM11695     3  0.2996      0.930 0.044 0.000 0.892 0.064
#> GSM11734     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM11861     4  0.5250      0.091 0.008 0.000 0.440 0.552
#> GSM11843     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM11862     4  0.0469      0.886 0.012 0.000 0.000 0.988
#> GSM11697     3  0.2644      0.936 0.032 0.000 0.908 0.060
#> GSM11714     3  0.0804      0.926 0.008 0.000 0.980 0.012
#> GSM11723     4  0.1940      0.872 0.000 0.076 0.000 0.924
#> GSM11845     4  0.1940      0.872 0.000 0.076 0.000 0.924
#> GSM11683     3  0.0524      0.933 0.008 0.000 0.988 0.004
#> GSM11691     3  0.2996      0.930 0.044 0.000 0.892 0.064
#> GSM27949     3  0.0657      0.935 0.004 0.000 0.984 0.012
#> GSM27945     3  0.2996      0.930 0.044 0.000 0.892 0.064
#> GSM11706     3  0.2089      0.936 0.048 0.000 0.932 0.020
#> GSM11853     3  0.2565      0.936 0.032 0.000 0.912 0.056
#> GSM11729     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM11746     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM11711     3  0.2546      0.934 0.060 0.000 0.912 0.028
#> GSM11854     3  0.2565      0.936 0.032 0.000 0.912 0.056
#> GSM11731     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM11839     4  0.1940      0.872 0.000 0.076 0.000 0.924
#> GSM11836     4  0.1940      0.872 0.000 0.076 0.000 0.924
#> GSM11849     3  0.2830      0.933 0.040 0.000 0.900 0.060
#> GSM11682     3  0.0672      0.927 0.008 0.000 0.984 0.008
#> GSM11690     4  0.0469      0.886 0.012 0.000 0.000 0.988
#> GSM11692     4  0.0469      0.886 0.012 0.000 0.000 0.988
#> GSM11841     4  0.1940      0.872 0.000 0.076 0.000 0.924
#> GSM11901     4  0.1940      0.872 0.000 0.076 0.000 0.924
#> GSM11715     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM11724     4  0.3610      0.744 0.000 0.200 0.000 0.800
#> GSM11684     4  0.0592      0.882 0.000 0.000 0.016 0.984
#> GSM11696     4  0.0469      0.886 0.012 0.000 0.000 0.988
#> GSM27952     3  0.0672      0.927 0.008 0.000 0.984 0.008
#> GSM27948     4  0.0469      0.886 0.012 0.000 0.000 0.988

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     4  0.3816     0.6896 0.000 0.000 0.304 0.696 0.000
#> GSM11735     3  0.1965     0.7352 0.000 0.000 0.904 0.096 0.000
#> GSM11733     4  0.0162     0.8669 0.000 0.000 0.000 0.996 0.004
#> GSM11863     5  0.0000     0.9331 0.000 0.000 0.000 0.000 1.000
#> GSM11710     4  0.0162     0.8684 0.004 0.000 0.000 0.996 0.000
#> GSM11712     5  0.0000     0.9331 0.000 0.000 0.000 0.000 1.000
#> GSM11732     3  0.5072     0.6806 0.000 0.000 0.696 0.116 0.188
#> GSM11844     4  0.0000     0.8681 0.000 0.000 0.000 1.000 0.000
#> GSM11842     5  0.0000     0.9331 0.000 0.000 0.000 0.000 1.000
#> GSM11860     4  0.5635     0.4886 0.128 0.000 0.000 0.620 0.252
#> GSM11686     4  0.3586     0.7233 0.000 0.000 0.264 0.736 0.000
#> GSM11688     4  0.3816     0.6896 0.000 0.000 0.304 0.696 0.000
#> GSM11846     4  0.0162     0.8684 0.004 0.000 0.000 0.996 0.000
#> GSM11680     3  0.2471     0.7561 0.000 0.000 0.864 0.136 0.000
#> GSM11698     4  0.1121     0.8481 0.000 0.000 0.044 0.956 0.000
#> GSM11840     5  0.3586     0.6337 0.000 0.000 0.000 0.264 0.736
#> GSM11847     5  0.0162     0.9318 0.000 0.000 0.000 0.004 0.996
#> GSM11685     4  0.3816     0.6896 0.000 0.000 0.304 0.696 0.000
#> GSM11699     4  0.0703     0.8490 0.000 0.000 0.024 0.976 0.000
#> GSM27950     3  0.0000     0.6494 0.000 0.000 1.000 0.000 0.000
#> GSM27946     5  0.3109     0.7337 0.000 0.000 0.000 0.200 0.800
#> GSM11709     1  0.0000     0.9303 1.000 0.000 0.000 0.000 0.000
#> GSM11720     1  0.0162     0.9310 0.996 0.000 0.000 0.004 0.000
#> GSM11726     1  0.0290     0.9281 0.992 0.000 0.000 0.008 0.000
#> GSM11837     2  0.0000     0.9995 0.000 1.000 0.000 0.000 0.000
#> GSM11725     2  0.0000     0.9995 0.000 1.000 0.000 0.000 0.000
#> GSM11864     2  0.0000     0.9995 0.000 1.000 0.000 0.000 0.000
#> GSM11687     1  0.0000     0.9303 1.000 0.000 0.000 0.000 0.000
#> GSM11693     1  0.0162     0.9310 0.996 0.000 0.000 0.004 0.000
#> GSM11727     1  0.0162     0.9310 0.996 0.000 0.000 0.004 0.000
#> GSM11838     2  0.0000     0.9995 0.000 1.000 0.000 0.000 0.000
#> GSM11681     1  0.0000     0.9303 1.000 0.000 0.000 0.000 0.000
#> GSM11689     1  0.0162     0.9310 0.996 0.000 0.000 0.004 0.000
#> GSM11704     1  0.0000     0.9303 1.000 0.000 0.000 0.000 0.000
#> GSM11703     1  0.0609     0.9161 0.980 0.000 0.020 0.000 0.000
#> GSM11705     1  0.3932     0.4866 0.672 0.000 0.000 0.328 0.000
#> GSM11722     1  0.0162     0.9310 0.996 0.000 0.000 0.004 0.000
#> GSM11730     1  0.0162     0.9310 0.996 0.000 0.000 0.004 0.000
#> GSM11713     4  0.0609     0.8615 0.020 0.000 0.000 0.980 0.000
#> GSM11728     4  0.0162     0.8684 0.004 0.000 0.000 0.996 0.000
#> GSM27947     1  0.5707     0.3602 0.568 0.000 0.004 0.344 0.084
#> GSM27951     1  0.0000     0.9303 1.000 0.000 0.000 0.000 0.000
#> GSM11707     4  0.3366     0.7378 0.000 0.000 0.232 0.768 0.000
#> GSM11716     3  0.4791     0.4046 0.336 0.000 0.636 0.020 0.008
#> GSM11850     3  0.3816     0.8139 0.000 0.000 0.696 0.304 0.000
#> GSM11851     4  0.0000     0.8681 0.000 0.000 0.000 1.000 0.000
#> GSM11721     5  0.0000     0.9331 0.000 0.000 0.000 0.000 1.000
#> GSM11852     4  0.0000     0.8681 0.000 0.000 0.000 1.000 0.000
#> GSM11694     3  0.3816     0.8139 0.000 0.000 0.696 0.304 0.000
#> GSM11695     3  0.3816     0.8139 0.000 0.000 0.696 0.304 0.000
#> GSM11734     2  0.0000     0.9995 0.000 1.000 0.000 0.000 0.000
#> GSM11861     5  0.4273     0.1611 0.000 0.000 0.000 0.448 0.552
#> GSM11843     2  0.0162     0.9957 0.000 0.996 0.000 0.000 0.004
#> GSM11862     5  0.0000     0.9331 0.000 0.000 0.000 0.000 1.000
#> GSM11697     3  0.3816     0.8139 0.000 0.000 0.696 0.304 0.000
#> GSM11714     3  0.4114    -0.0366 0.000 0.000 0.624 0.376 0.000
#> GSM11723     5  0.0000     0.9331 0.000 0.000 0.000 0.000 1.000
#> GSM11845     5  0.0000     0.9331 0.000 0.000 0.000 0.000 1.000
#> GSM11683     3  0.3913     0.7851 0.000 0.000 0.676 0.324 0.000
#> GSM11691     3  0.3816     0.8139 0.000 0.000 0.696 0.304 0.000
#> GSM27949     3  0.3774     0.8126 0.000 0.000 0.704 0.296 0.000
#> GSM27945     3  0.3932     0.7950 0.000 0.000 0.672 0.328 0.000
#> GSM11706     4  0.0162     0.8684 0.004 0.000 0.000 0.996 0.000
#> GSM11853     4  0.0000     0.8681 0.000 0.000 0.000 1.000 0.000
#> GSM11729     2  0.0000     0.9995 0.000 1.000 0.000 0.000 0.000
#> GSM11746     2  0.0000     0.9995 0.000 1.000 0.000 0.000 0.000
#> GSM11711     4  0.0162     0.8684 0.004 0.000 0.000 0.996 0.000
#> GSM11854     4  0.0000     0.8681 0.000 0.000 0.000 1.000 0.000
#> GSM11731     2  0.0000     0.9995 0.000 1.000 0.000 0.000 0.000
#> GSM11839     5  0.0000     0.9331 0.000 0.000 0.000 0.000 1.000
#> GSM11836     5  0.0000     0.9331 0.000 0.000 0.000 0.000 1.000
#> GSM11849     4  0.0000     0.8681 0.000 0.000 0.000 1.000 0.000
#> GSM11682     4  0.3003     0.7793 0.000 0.000 0.188 0.812 0.000
#> GSM11690     5  0.0162     0.9318 0.000 0.000 0.000 0.004 0.996
#> GSM11692     5  0.0162     0.9318 0.000 0.000 0.000 0.004 0.996
#> GSM11841     5  0.0000     0.9331 0.000 0.000 0.000 0.000 1.000
#> GSM11901     5  0.0000     0.9331 0.000 0.000 0.000 0.000 1.000
#> GSM11715     2  0.0000     0.9995 0.000 1.000 0.000 0.000 0.000
#> GSM11724     5  0.3109     0.7153 0.000 0.200 0.000 0.000 0.800
#> GSM11684     5  0.0290     0.9293 0.000 0.000 0.000 0.008 0.992
#> GSM11696     5  0.0162     0.9318 0.000 0.000 0.000 0.004 0.996
#> GSM27952     4  0.2773     0.7931 0.000 0.000 0.164 0.836 0.000
#> GSM27948     5  0.0162     0.9318 0.000 0.000 0.000 0.004 0.996

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6  0.5410     0.5676 0.000 0.000 0.280 0.000 0.156 0.564
#> GSM11735     3  0.2724     0.6721 0.000 0.000 0.864 0.000 0.052 0.084
#> GSM11733     6  0.0520     0.8262 0.000 0.000 0.000 0.008 0.008 0.984
#> GSM11863     4  0.0260     0.9002 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM11710     6  0.0405     0.8294 0.004 0.000 0.000 0.000 0.008 0.988
#> GSM11712     4  0.0000     0.9031 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11732     3  0.4777     0.5573 0.000 0.000 0.712 0.168 0.096 0.024
#> GSM11844     6  0.0405     0.8267 0.000 0.000 0.004 0.000 0.008 0.988
#> GSM11842     4  0.0260     0.9002 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM11860     6  0.5368     0.4655 0.116 0.000 0.000 0.252 0.016 0.616
#> GSM11686     6  0.4827     0.6502 0.000 0.000 0.236 0.000 0.112 0.652
#> GSM11688     6  0.5029     0.6174 0.000 0.000 0.276 0.000 0.112 0.612
#> GSM11846     6  0.0458     0.8284 0.016 0.000 0.000 0.000 0.000 0.984
#> GSM11680     3  0.2178     0.7290 0.000 0.000 0.868 0.000 0.000 0.132
#> GSM11698     6  0.1204     0.8024 0.000 0.000 0.056 0.000 0.000 0.944
#> GSM11840     4  0.3398     0.5983 0.000 0.000 0.000 0.740 0.008 0.252
#> GSM11847     4  0.0260     0.9002 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM11685     6  0.5029     0.6174 0.000 0.000 0.276 0.000 0.112 0.612
#> GSM11699     6  0.1007     0.8018 0.000 0.000 0.044 0.000 0.000 0.956
#> GSM27950     3  0.2482     0.5061 0.000 0.000 0.848 0.000 0.148 0.004
#> GSM27946     4  0.2793     0.6898 0.000 0.000 0.000 0.800 0.000 0.200
#> GSM11709     1  0.0458     0.8462 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM11720     1  0.2146     0.7635 0.880 0.000 0.000 0.000 0.116 0.004
#> GSM11726     1  0.2257     0.7620 0.876 0.000 0.000 0.000 0.116 0.008
#> GSM11837     2  0.2048     0.8174 0.000 0.880 0.000 0.000 0.120 0.000
#> GSM11725     2  0.0000     0.9272 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11864     2  0.0000     0.9272 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11687     1  0.0000     0.8494 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11693     1  0.0146     0.8499 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM11727     5  0.3652     0.4461 0.324 0.000 0.000 0.000 0.672 0.004
#> GSM11838     5  0.3851     0.0886 0.000 0.460 0.000 0.000 0.540 0.000
#> GSM11681     1  0.0000     0.8494 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11689     1  0.0146     0.8499 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM11704     1  0.0405     0.8476 0.988 0.000 0.000 0.000 0.008 0.004
#> GSM11703     1  0.1074     0.8296 0.960 0.000 0.028 0.000 0.000 0.012
#> GSM11705     1  0.3563     0.4140 0.664 0.000 0.000 0.000 0.000 0.336
#> GSM11722     5  0.2491     0.5768 0.164 0.000 0.000 0.000 0.836 0.000
#> GSM11730     5  0.3714     0.4198 0.340 0.000 0.000 0.000 0.656 0.004
#> GSM11713     5  0.4504     0.2419 0.032 0.000 0.000 0.000 0.536 0.432
#> GSM11728     6  0.0603     0.8283 0.016 0.000 0.004 0.000 0.000 0.980
#> GSM27947     1  0.5493     0.2983 0.544 0.000 0.016 0.092 0.000 0.348
#> GSM27951     1  0.0000     0.8494 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11707     6  0.4142     0.6640 0.000 0.000 0.232 0.000 0.056 0.712
#> GSM11716     3  0.5458     0.4680 0.184 0.000 0.644 0.004 0.148 0.020
#> GSM11850     3  0.4545     0.7285 0.000 0.000 0.696 0.000 0.112 0.192
#> GSM11851     6  0.0146     0.8284 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM11721     4  0.0000     0.9031 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11852     6  0.0146     0.8295 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM11694     3  0.3309     0.7809 0.000 0.000 0.720 0.000 0.000 0.280
#> GSM11695     3  0.3309     0.7809 0.000 0.000 0.720 0.000 0.000 0.280
#> GSM11734     2  0.0000     0.9272 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11861     4  0.3838     0.1413 0.000 0.000 0.000 0.552 0.000 0.448
#> GSM11843     2  0.2631     0.7945 0.000 0.820 0.000 0.000 0.180 0.000
#> GSM11862     4  0.0000     0.9031 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11697     3  0.3309     0.7809 0.000 0.000 0.720 0.000 0.000 0.280
#> GSM11714     3  0.5229     0.1750 0.000 0.000 0.604 0.000 0.156 0.240
#> GSM11723     5  0.2562     0.5663 0.000 0.000 0.000 0.172 0.828 0.000
#> GSM11845     4  0.2631     0.7315 0.000 0.000 0.000 0.820 0.180 0.000
#> GSM11683     3  0.3592     0.7256 0.000 0.000 0.656 0.000 0.000 0.344
#> GSM11691     3  0.3309     0.7809 0.000 0.000 0.720 0.000 0.000 0.280
#> GSM27949     3  0.3266     0.7802 0.000 0.000 0.728 0.000 0.000 0.272
#> GSM27945     3  0.3499     0.7582 0.000 0.000 0.680 0.000 0.000 0.320
#> GSM11706     6  0.0260     0.8297 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM11853     6  0.0146     0.8294 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM11729     2  0.0000     0.9272 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11746     2  0.0000     0.9272 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11711     6  0.0260     0.8297 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM11854     6  0.0146     0.8295 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM11731     2  0.0000     0.9272 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11839     4  0.2631     0.7315 0.000 0.000 0.000 0.820 0.180 0.000
#> GSM11836     4  0.0146     0.9012 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM11849     6  0.0146     0.8295 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM11682     6  0.4319     0.7022 0.000 0.000 0.168 0.000 0.108 0.724
#> GSM11690     4  0.0000     0.9031 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11692     4  0.0000     0.9031 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11841     4  0.0000     0.9031 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11901     4  0.0000     0.9031 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM11715     2  0.2793     0.7780 0.000 0.800 0.000 0.000 0.200 0.000
#> GSM11724     5  0.3629     0.4886 0.000 0.016 0.000 0.260 0.724 0.000
#> GSM11684     4  0.0146     0.9008 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM11696     4  0.0000     0.9031 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM27952     6  0.4104     0.7160 0.000 0.000 0.148 0.000 0.104 0.748
#> GSM27948     4  0.0000     0.9031 0.000 0.000 0.000 1.000 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-pam-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>          n cell.line(p) agent(p)  time(p) k
#> ATC:pam 81     8.09e-02    0.327 9.83e-05 2
#> ATC:pam 77     4.48e-08    0.437 1.55e-03 3
#> ATC:pam 80     7.79e-10    0.367 6.09e-02 4
#> ATC:pam 77     2.10e-11    0.163 2.79e-02 5
#> ATC:pam 72     8.26e-10    0.140 1.99e-02 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:mclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "mclust"]
# you can also extract it by
# res = res_list["ATC:mclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.225           0.469       0.781         0.3113 0.750   0.750
#> 3 3 0.177           0.444       0.675         0.6598 0.494   0.369
#> 4 4 0.505           0.760       0.820         0.3174 0.753   0.427
#> 5 5 0.561           0.691       0.798         0.0944 0.860   0.540
#> 6 6 0.781           0.786       0.861         0.1094 0.890   0.541

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 4

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1  0.7815    0.52499 0.768 0.232
#> GSM11735     1  0.1414    0.67241 0.980 0.020
#> GSM11733     1  0.0376    0.66710 0.996 0.004
#> GSM11863     1  0.8813   -0.32598 0.700 0.300
#> GSM11710     1  0.0672    0.67168 0.992 0.008
#> GSM11712     1  0.9248   -0.48223 0.660 0.340
#> GSM11732     1  0.0000    0.66927 1.000 0.000
#> GSM11844     1  0.0000    0.66927 1.000 0.000
#> GSM11842     1  0.9286   -0.48706 0.656 0.344
#> GSM11860     1  0.5519    0.50659 0.872 0.128
#> GSM11686     1  0.2948    0.66097 0.948 0.052
#> GSM11688     1  0.2423    0.66622 0.960 0.040
#> GSM11846     1  0.5519    0.50659 0.872 0.128
#> GSM11680     1  0.7815    0.52499 0.768 0.232
#> GSM11698     1  0.5946    0.60111 0.856 0.144
#> GSM11840     1  0.0376    0.66710 0.996 0.004
#> GSM11847     1  0.0376    0.66710 0.996 0.004
#> GSM11685     1  0.0000    0.66927 1.000 0.000
#> GSM11699     1  0.0000    0.66927 1.000 0.000
#> GSM27950     1  0.7815    0.52499 0.768 0.232
#> GSM27946     1  0.0000    0.66927 1.000 0.000
#> GSM11709     1  0.9460    0.23763 0.636 0.364
#> GSM11720     1  0.9977   -0.90403 0.528 0.472
#> GSM11726     1  0.5629    0.49925 0.868 0.132
#> GSM11837     2  1.0000    0.99805 0.496 0.504
#> GSM11725     2  0.9998    0.99031 0.492 0.508
#> GSM11864     2  1.0000    0.99805 0.496 0.504
#> GSM11687     1  0.9460    0.23763 0.636 0.364
#> GSM11693     1  0.9460    0.23763 0.636 0.364
#> GSM11727     1  0.9970   -0.89849 0.532 0.468
#> GSM11838     2  0.9998    0.99031 0.492 0.508
#> GSM11681     1  0.8081    0.37947 0.752 0.248
#> GSM11689     1  0.9460    0.23763 0.636 0.364
#> GSM11704     1  0.9460    0.23763 0.636 0.364
#> GSM11703     1  0.5629    0.49925 0.868 0.132
#> GSM11705     1  0.8955    0.29918 0.688 0.312
#> GSM11722     1  0.9988   -0.92669 0.520 0.480
#> GSM11730     1  0.8499   -0.04676 0.724 0.276
#> GSM11713     1  0.5842    0.49281 0.860 0.140
#> GSM11728     1  0.1184    0.66008 0.984 0.016
#> GSM27947     1  0.1843    0.67149 0.972 0.028
#> GSM27951     1  0.9460    0.23763 0.636 0.364
#> GSM11707     1  0.2778    0.66214 0.952 0.048
#> GSM11716     1  0.9248   -0.48562 0.660 0.340
#> GSM11850     1  0.6247    0.59094 0.844 0.156
#> GSM11851     1  0.0000    0.66927 1.000 0.000
#> GSM11721     1  0.0672    0.66842 0.992 0.008
#> GSM11852     1  0.0000    0.66927 1.000 0.000
#> GSM11694     1  0.7453    0.54268 0.788 0.212
#> GSM11695     1  0.7815    0.52499 0.768 0.232
#> GSM11734     2  1.0000    0.99805 0.496 0.504
#> GSM11861     1  0.0672    0.67081 0.992 0.008
#> GSM11843     2  1.0000    0.99805 0.496 0.504
#> GSM11862     1  0.0672    0.67084 0.992 0.008
#> GSM11697     1  0.7815    0.52499 0.768 0.232
#> GSM11714     1  0.7815    0.52499 0.768 0.232
#> GSM11723     2  1.0000    0.99805 0.496 0.504
#> GSM11845     1  0.9988   -0.93626 0.520 0.480
#> GSM11683     1  0.1633    0.67142 0.976 0.024
#> GSM11691     1  0.0938    0.67219 0.988 0.012
#> GSM27949     1  0.7815    0.52499 0.768 0.232
#> GSM27945     1  0.6712    0.57410 0.824 0.176
#> GSM11706     1  0.7815    0.52499 0.768 0.232
#> GSM11853     1  0.5629    0.60981 0.868 0.132
#> GSM11729     2  1.0000    0.99805 0.496 0.504
#> GSM11746     2  1.0000    0.99805 0.496 0.504
#> GSM11711     1  0.3114    0.65896 0.944 0.056
#> GSM11854     1  0.0000    0.66927 1.000 0.000
#> GSM11731     2  1.0000    0.99805 0.496 0.504
#> GSM11839     1  0.9286   -0.49594 0.656 0.344
#> GSM11836     1  0.6247    0.36835 0.844 0.156
#> GSM11849     1  0.0000    0.66927 1.000 0.000
#> GSM11682     1  0.1414    0.67269 0.980 0.020
#> GSM11690     1  0.1184    0.66968 0.984 0.016
#> GSM11692     1  0.0672    0.66842 0.992 0.008
#> GSM11841     1  0.9286   -0.48706 0.656 0.344
#> GSM11901     1  0.7950   -0.00138 0.760 0.240
#> GSM11715     2  1.0000    0.99805 0.496 0.504
#> GSM11724     2  1.0000    0.99805 0.496 0.504
#> GSM11684     1  0.2043    0.66570 0.968 0.032
#> GSM11696     1  0.1843    0.66530 0.972 0.028
#> GSM27952     1  0.1414    0.67189 0.980 0.020
#> GSM27948     1  0.0672    0.67081 0.992 0.008

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.0592     0.4465 0.012 0.000 0.988
#> GSM11735     3  0.5785     0.6312 0.332 0.000 0.668
#> GSM11733     1  0.4062     0.6054 0.836 0.000 0.164
#> GSM11863     1  0.3771     0.6584 0.876 0.012 0.112
#> GSM11710     1  0.2261     0.6843 0.932 0.000 0.068
#> GSM11712     1  0.1182     0.6901 0.976 0.012 0.012
#> GSM11732     3  0.6280     0.5435 0.460 0.000 0.540
#> GSM11844     3  0.6280     0.5435 0.460 0.000 0.540
#> GSM11842     1  0.1182     0.6901 0.976 0.012 0.012
#> GSM11860     1  0.9152    -0.2220 0.484 0.152 0.364
#> GSM11686     3  0.5926     0.6140 0.356 0.000 0.644
#> GSM11688     3  0.6095     0.5699 0.392 0.000 0.608
#> GSM11846     1  0.8918    -0.2560 0.492 0.128 0.380
#> GSM11680     3  0.4796     0.6377 0.220 0.000 0.780
#> GSM11698     3  0.4931     0.6419 0.232 0.000 0.768
#> GSM11840     1  0.3686     0.6323 0.860 0.000 0.140
#> GSM11847     1  0.3619     0.6363 0.864 0.000 0.136
#> GSM11685     1  0.5016     0.4984 0.760 0.000 0.240
#> GSM11699     1  0.2448     0.6810 0.924 0.000 0.076
#> GSM27950     3  0.0592     0.4465 0.012 0.000 0.988
#> GSM27946     1  0.3752     0.5895 0.856 0.000 0.144
#> GSM11709     2  0.6079     0.4890 0.388 0.612 0.000
#> GSM11720     2  0.6280     0.3947 0.460 0.540 0.000
#> GSM11726     1  0.9356    -0.1442 0.460 0.368 0.172
#> GSM11837     2  0.8824     0.0916 0.124 0.512 0.364
#> GSM11725     2  0.3412     0.4598 0.124 0.876 0.000
#> GSM11864     2  0.8812     0.0987 0.124 0.516 0.360
#> GSM11687     2  0.6079     0.4890 0.388 0.612 0.000
#> GSM11693     2  0.6079     0.4890 0.388 0.612 0.000
#> GSM11727     1  0.9653    -0.1449 0.456 0.232 0.312
#> GSM11838     2  0.3412     0.4598 0.124 0.876 0.000
#> GSM11681     2  0.6079     0.4890 0.388 0.612 0.000
#> GSM11689     2  0.6079     0.4890 0.388 0.612 0.000
#> GSM11704     2  0.6079     0.4890 0.388 0.612 0.000
#> GSM11703     2  0.6948     0.3757 0.472 0.512 0.016
#> GSM11705     2  0.6079     0.4890 0.388 0.612 0.000
#> GSM11722     2  0.6244     0.4149 0.440 0.560 0.000
#> GSM11730     2  0.6280     0.3947 0.460 0.540 0.000
#> GSM11713     2  0.6295     0.3929 0.472 0.528 0.000
#> GSM11728     1  0.5968    -0.0957 0.636 0.000 0.364
#> GSM27947     1  0.5988    -0.1088 0.632 0.000 0.368
#> GSM27951     2  0.6079     0.4890 0.388 0.612 0.000
#> GSM11707     3  0.0747     0.4477 0.016 0.000 0.984
#> GSM11716     3  0.6280     0.5435 0.460 0.000 0.540
#> GSM11850     3  0.6274     0.5508 0.456 0.000 0.544
#> GSM11851     1  0.4178     0.6002 0.828 0.000 0.172
#> GSM11721     1  0.0592     0.6906 0.988 0.000 0.012
#> GSM11852     1  0.0592     0.6977 0.988 0.000 0.012
#> GSM11694     3  0.6168     0.5980 0.412 0.000 0.588
#> GSM11695     3  0.5905     0.6348 0.352 0.000 0.648
#> GSM11734     2  0.6307     0.2385 0.488 0.512 0.000
#> GSM11861     1  0.0237     0.6943 0.996 0.004 0.000
#> GSM11843     2  0.6307     0.2385 0.488 0.512 0.000
#> GSM11862     1  0.0424     0.6925 0.992 0.000 0.008
#> GSM11697     3  0.5859     0.6371 0.344 0.000 0.656
#> GSM11714     3  0.0592     0.4465 0.012 0.000 0.988
#> GSM11723     1  0.8925    -0.2014 0.504 0.132 0.364
#> GSM11845     1  0.5010     0.6091 0.840 0.076 0.084
#> GSM11683     1  0.6062    -0.1425 0.616 0.000 0.384
#> GSM11691     1  0.6192    -0.2597 0.580 0.000 0.420
#> GSM27949     3  0.5760     0.6408 0.328 0.000 0.672
#> GSM27945     3  0.6274     0.5508 0.456 0.000 0.544
#> GSM11706     3  0.4796     0.6371 0.220 0.000 0.780
#> GSM11853     3  0.6274     0.5508 0.456 0.000 0.544
#> GSM11729     2  0.8824     0.0916 0.124 0.512 0.364
#> GSM11746     2  0.8824     0.0916 0.124 0.512 0.364
#> GSM11711     3  0.6295     0.5176 0.472 0.000 0.528
#> GSM11854     1  0.6225    -0.2312 0.568 0.000 0.432
#> GSM11731     2  0.6307     0.2385 0.488 0.512 0.000
#> GSM11839     1  0.1129     0.6882 0.976 0.020 0.004
#> GSM11836     1  0.1182     0.6901 0.976 0.012 0.012
#> GSM11849     1  0.0000     0.6939 1.000 0.000 0.000
#> GSM11682     1  0.0592     0.6977 0.988 0.000 0.012
#> GSM11690     1  0.0829     0.6975 0.984 0.004 0.012
#> GSM11692     1  0.0592     0.6906 0.988 0.000 0.012
#> GSM11841     1  0.1182     0.6901 0.976 0.012 0.012
#> GSM11901     1  0.1182     0.6901 0.976 0.012 0.012
#> GSM11715     2  0.6307     0.2385 0.488 0.512 0.000
#> GSM11724     2  0.6307     0.2385 0.488 0.512 0.000
#> GSM11684     1  0.2116     0.6694 0.948 0.040 0.012
#> GSM11696     1  0.2116     0.6694 0.948 0.040 0.012
#> GSM27952     1  0.4235     0.5729 0.824 0.000 0.176
#> GSM27948     1  0.0237     0.6943 0.996 0.004 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.3172      0.663 0.000 0.000 0.840 0.160
#> GSM11735     3  0.0336      0.813 0.000 0.000 0.992 0.008
#> GSM11733     4  0.4193      0.823 0.000 0.000 0.268 0.732
#> GSM11863     4  0.3172      0.932 0.000 0.000 0.160 0.840
#> GSM11710     3  0.4761      0.407 0.000 0.004 0.664 0.332
#> GSM11712     4  0.3172      0.932 0.000 0.000 0.160 0.840
#> GSM11732     3  0.3074      0.786 0.000 0.000 0.848 0.152
#> GSM11844     3  0.2760      0.798 0.000 0.000 0.872 0.128
#> GSM11842     4  0.3172      0.932 0.000 0.000 0.160 0.840
#> GSM11860     2  0.6930      0.180 0.000 0.524 0.356 0.120
#> GSM11686     3  0.1398      0.817 0.000 0.004 0.956 0.040
#> GSM11688     3  0.3157      0.740 0.000 0.004 0.852 0.144
#> GSM11846     3  0.5403      0.738 0.116 0.016 0.768 0.100
#> GSM11680     3  0.0000      0.810 0.000 0.000 1.000 0.000
#> GSM11698     3  0.0592      0.816 0.000 0.000 0.984 0.016
#> GSM11840     4  0.3528      0.916 0.000 0.000 0.192 0.808
#> GSM11847     4  0.3569      0.913 0.000 0.000 0.196 0.804
#> GSM11685     4  0.5105      0.540 0.000 0.004 0.432 0.564
#> GSM11699     4  0.3764      0.904 0.000 0.000 0.216 0.784
#> GSM27950     3  0.3172      0.663 0.000 0.000 0.840 0.160
#> GSM27946     3  0.4761      0.416 0.000 0.000 0.628 0.372
#> GSM11709     1  0.0000      0.785 1.000 0.000 0.000 0.000
#> GSM11720     1  0.6914      0.668 0.652 0.204 0.112 0.032
#> GSM11726     1  0.6710      0.712 0.684 0.112 0.164 0.040
#> GSM11837     2  0.1492      0.787 0.036 0.956 0.004 0.004
#> GSM11725     2  0.3257      0.708 0.152 0.844 0.000 0.004
#> GSM11864     2  0.2382      0.769 0.080 0.912 0.004 0.004
#> GSM11687     1  0.0000      0.785 1.000 0.000 0.000 0.000
#> GSM11693     1  0.0000      0.785 1.000 0.000 0.000 0.000
#> GSM11727     2  0.4450      0.687 0.040 0.832 0.096 0.032
#> GSM11838     2  0.2197      0.769 0.080 0.916 0.000 0.004
#> GSM11681     1  0.4144      0.762 0.816 0.004 0.152 0.028
#> GSM11689     1  0.0000      0.785 1.000 0.000 0.000 0.000
#> GSM11704     1  0.0000      0.785 1.000 0.000 0.000 0.000
#> GSM11703     1  0.6138      0.730 0.716 0.076 0.176 0.032
#> GSM11705     1  0.4549      0.783 0.820 0.056 0.108 0.016
#> GSM11722     2  0.5168     -0.119 0.492 0.504 0.000 0.004
#> GSM11730     1  0.7536      0.626 0.592 0.216 0.160 0.032
#> GSM11713     1  0.5859      0.750 0.740 0.072 0.156 0.032
#> GSM11728     3  0.5169      0.616 0.000 0.032 0.696 0.272
#> GSM27947     3  0.2973      0.794 0.000 0.000 0.856 0.144
#> GSM27951     1  0.0000      0.785 1.000 0.000 0.000 0.000
#> GSM11707     3  0.3172      0.663 0.000 0.000 0.840 0.160
#> GSM11716     2  0.7002      0.308 0.032 0.544 0.368 0.056
#> GSM11850     3  0.2345      0.813 0.000 0.000 0.900 0.100
#> GSM11851     4  0.4855      0.596 0.000 0.000 0.400 0.600
#> GSM11721     4  0.3172      0.932 0.000 0.000 0.160 0.840
#> GSM11852     4  0.4188      0.861 0.000 0.004 0.244 0.752
#> GSM11694     3  0.2345      0.813 0.000 0.000 0.900 0.100
#> GSM11695     3  0.0921      0.818 0.000 0.000 0.972 0.028
#> GSM11734     2  0.1716      0.812 0.000 0.936 0.000 0.064
#> GSM11861     4  0.3583      0.927 0.000 0.004 0.180 0.816
#> GSM11843     2  0.1716      0.812 0.000 0.936 0.000 0.064
#> GSM11862     4  0.3172      0.932 0.000 0.000 0.160 0.840
#> GSM11697     3  0.0921      0.818 0.000 0.000 0.972 0.028
#> GSM11714     3  0.3172      0.663 0.000 0.000 0.840 0.160
#> GSM11723     2  0.2473      0.800 0.000 0.908 0.012 0.080
#> GSM11845     2  0.3441      0.760 0.000 0.856 0.024 0.120
#> GSM11683     3  0.3569      0.710 0.000 0.000 0.804 0.196
#> GSM11691     3  0.2281      0.816 0.000 0.000 0.904 0.096
#> GSM27949     3  0.0000      0.810 0.000 0.000 1.000 0.000
#> GSM27945     3  0.2345      0.813 0.000 0.000 0.900 0.100
#> GSM11706     3  0.0188      0.812 0.000 0.000 0.996 0.004
#> GSM11853     3  0.2345      0.813 0.000 0.000 0.900 0.100
#> GSM11729     2  0.1576      0.811 0.000 0.948 0.004 0.048
#> GSM11746     2  0.1585      0.786 0.040 0.952 0.004 0.004
#> GSM11711     3  0.2345      0.813 0.000 0.000 0.900 0.100
#> GSM11854     3  0.3528      0.741 0.000 0.000 0.808 0.192
#> GSM11731     2  0.1716      0.812 0.000 0.936 0.000 0.064
#> GSM11839     4  0.5141      0.847 0.000 0.084 0.160 0.756
#> GSM11836     4  0.3172      0.932 0.000 0.000 0.160 0.840
#> GSM11849     4  0.3945      0.898 0.000 0.004 0.216 0.780
#> GSM11682     3  0.4889      0.350 0.000 0.004 0.636 0.360
#> GSM11690     4  0.3583      0.927 0.000 0.004 0.180 0.816
#> GSM11692     4  0.3172      0.932 0.000 0.000 0.160 0.840
#> GSM11841     4  0.3172      0.932 0.000 0.000 0.160 0.840
#> GSM11901     4  0.3172      0.932 0.000 0.000 0.160 0.840
#> GSM11715     2  0.1637      0.812 0.000 0.940 0.000 0.060
#> GSM11724     2  0.1716      0.812 0.000 0.936 0.000 0.064
#> GSM11684     4  0.3768      0.925 0.000 0.008 0.184 0.808
#> GSM11696     4  0.3768      0.925 0.000 0.008 0.184 0.808
#> GSM27952     3  0.4401      0.577 0.000 0.004 0.724 0.272
#> GSM27948     4  0.3355      0.931 0.000 0.004 0.160 0.836

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     3  0.5887     0.6360 0.000 0.000 0.592 0.156 0.252
#> GSM11735     3  0.4779     0.6146 0.000 0.000 0.588 0.388 0.024
#> GSM11733     5  0.6009     0.6603 0.000 0.000 0.180 0.240 0.580
#> GSM11863     5  0.3662     0.8952 0.000 0.000 0.004 0.252 0.744
#> GSM11710     4  0.1043     0.6853 0.000 0.000 0.040 0.960 0.000
#> GSM11712     5  0.3508     0.8962 0.000 0.000 0.000 0.252 0.748
#> GSM11732     3  0.3671     0.7046 0.000 0.000 0.756 0.236 0.008
#> GSM11844     3  0.3452     0.7045 0.000 0.000 0.756 0.244 0.000
#> GSM11842     5  0.3508     0.8962 0.000 0.000 0.000 0.252 0.748
#> GSM11860     2  0.7057     0.0551 0.000 0.460 0.264 0.256 0.020
#> GSM11686     4  0.3966     0.1604 0.000 0.000 0.336 0.664 0.000
#> GSM11688     4  0.3707     0.3287 0.000 0.000 0.284 0.716 0.000
#> GSM11846     3  0.3170     0.7327 0.008 0.004 0.828 0.160 0.000
#> GSM11680     3  0.2690     0.6745 0.000 0.000 0.844 0.156 0.000
#> GSM11698     3  0.2690     0.6745 0.000 0.000 0.844 0.156 0.000
#> GSM11840     5  0.4602     0.8495 0.000 0.000 0.052 0.240 0.708
#> GSM11847     5  0.4086     0.8739 0.000 0.000 0.024 0.240 0.736
#> GSM11685     4  0.0955     0.6881 0.000 0.000 0.028 0.968 0.004
#> GSM11699     4  0.3368     0.7051 0.000 0.000 0.024 0.820 0.156
#> GSM27950     3  0.5887     0.6360 0.000 0.000 0.592 0.156 0.252
#> GSM27946     4  0.5163     0.5883 0.000 0.000 0.152 0.692 0.156
#> GSM11709     1  0.0000     0.7769 1.000 0.000 0.000 0.000 0.000
#> GSM11720     2  0.6138     0.1869 0.324 0.548 0.000 0.120 0.008
#> GSM11726     1  0.7446     0.3597 0.440 0.292 0.028 0.232 0.008
#> GSM11837     2  0.0290     0.8441 0.000 0.992 0.000 0.000 0.008
#> GSM11725     2  0.0000     0.8451 0.000 1.000 0.000 0.000 0.000
#> GSM11864     2  0.0000     0.8451 0.000 1.000 0.000 0.000 0.000
#> GSM11687     1  0.0000     0.7769 1.000 0.000 0.000 0.000 0.000
#> GSM11693     1  0.0000     0.7769 1.000 0.000 0.000 0.000 0.000
#> GSM11727     2  0.3373     0.6436 0.008 0.816 0.000 0.168 0.008
#> GSM11838     2  0.0000     0.8451 0.000 1.000 0.000 0.000 0.000
#> GSM11681     1  0.3521     0.6334 0.764 0.000 0.004 0.232 0.000
#> GSM11689     1  0.0000     0.7769 1.000 0.000 0.000 0.000 0.000
#> GSM11704     1  0.0000     0.7769 1.000 0.000 0.000 0.000 0.000
#> GSM11703     1  0.3706     0.6284 0.756 0.004 0.004 0.236 0.000
#> GSM11705     1  0.1991     0.7608 0.916 0.004 0.004 0.076 0.000
#> GSM11722     2  0.3783     0.5649 0.252 0.740 0.000 0.000 0.008
#> GSM11730     1  0.6804     0.4371 0.500 0.256 0.004 0.232 0.008
#> GSM11713     1  0.3676     0.6329 0.760 0.004 0.004 0.232 0.000
#> GSM11728     4  0.3425     0.6500 0.112 0.000 0.004 0.840 0.044
#> GSM27947     3  0.3424     0.7077 0.000 0.000 0.760 0.240 0.000
#> GSM27951     1  0.0000     0.7769 1.000 0.000 0.000 0.000 0.000
#> GSM11707     3  0.5887     0.6360 0.000 0.000 0.592 0.156 0.252
#> GSM11716     3  0.5527     0.6092 0.000 0.104 0.656 0.232 0.008
#> GSM11850     3  0.3424     0.7077 0.000 0.000 0.760 0.240 0.000
#> GSM11851     3  0.4276     0.6755 0.000 0.000 0.724 0.244 0.032
#> GSM11721     5  0.3561     0.8924 0.000 0.000 0.000 0.260 0.740
#> GSM11852     4  0.3368     0.7051 0.000 0.000 0.024 0.820 0.156
#> GSM11694     3  0.2179     0.7343 0.000 0.000 0.888 0.112 0.000
#> GSM11695     3  0.0290     0.6959 0.000 0.000 0.992 0.008 0.000
#> GSM11734     2  0.1831     0.8379 0.000 0.920 0.000 0.004 0.076
#> GSM11861     4  0.2848     0.6996 0.000 0.000 0.004 0.840 0.156
#> GSM11843     2  0.1831     0.8379 0.000 0.920 0.000 0.004 0.076
#> GSM11862     5  0.4306     0.3810 0.000 0.000 0.000 0.492 0.508
#> GSM11697     3  0.0404     0.6966 0.000 0.000 0.988 0.012 0.000
#> GSM11714     3  0.5887     0.6360 0.000 0.000 0.592 0.156 0.252
#> GSM11723     2  0.2362     0.8323 0.000 0.900 0.000 0.024 0.076
#> GSM11845     2  0.3003     0.8083 0.000 0.864 0.000 0.044 0.092
#> GSM11683     4  0.4219    -0.1848 0.000 0.000 0.416 0.584 0.000
#> GSM11691     3  0.3452     0.7079 0.000 0.000 0.756 0.244 0.000
#> GSM27949     3  0.2690     0.6745 0.000 0.000 0.844 0.156 0.000
#> GSM27945     3  0.3424     0.7077 0.000 0.000 0.760 0.240 0.000
#> GSM11706     3  0.2690     0.6745 0.000 0.000 0.844 0.156 0.000
#> GSM11853     3  0.3242     0.7207 0.000 0.000 0.784 0.216 0.000
#> GSM11729     2  0.0162     0.8453 0.000 0.996 0.000 0.004 0.000
#> GSM11746     2  0.0000     0.8451 0.000 1.000 0.000 0.000 0.000
#> GSM11711     3  0.2424     0.7373 0.000 0.000 0.868 0.132 0.000
#> GSM11854     3  0.3452     0.7045 0.000 0.000 0.756 0.244 0.000
#> GSM11731     2  0.1831     0.8379 0.000 0.920 0.000 0.004 0.076
#> GSM11839     5  0.5875     0.6957 0.000 0.152 0.000 0.256 0.592
#> GSM11836     5  0.3809     0.8899 0.000 0.008 0.000 0.256 0.736
#> GSM11849     4  0.2848     0.6996 0.000 0.000 0.004 0.840 0.156
#> GSM11682     4  0.0510     0.6892 0.000 0.000 0.016 0.984 0.000
#> GSM11690     4  0.2848     0.6996 0.000 0.000 0.004 0.840 0.156
#> GSM11692     5  0.3586     0.8913 0.000 0.000 0.000 0.264 0.736
#> GSM11841     5  0.3508     0.8962 0.000 0.000 0.000 0.252 0.748
#> GSM11901     5  0.3508     0.8962 0.000 0.000 0.000 0.252 0.748
#> GSM11715     2  0.0566     0.8467 0.000 0.984 0.000 0.004 0.012
#> GSM11724     2  0.1952     0.8370 0.000 0.912 0.000 0.004 0.084
#> GSM11684     4  0.2690     0.6962 0.000 0.000 0.000 0.844 0.156
#> GSM11696     4  0.2690     0.6962 0.000 0.000 0.000 0.844 0.156
#> GSM27952     4  0.0880     0.6885 0.000 0.000 0.032 0.968 0.000
#> GSM27948     4  0.3123     0.6676 0.000 0.000 0.004 0.812 0.184

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     6  0.3221     0.8799 0.000 0.000 0.264 0.000 0.000 0.736
#> GSM11735     6  0.3221     0.8799 0.000 0.000 0.264 0.000 0.000 0.736
#> GSM11733     3  0.3464     0.5147 0.000 0.000 0.688 0.000 0.312 0.000
#> GSM11863     5  0.0000     0.8735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11710     6  0.3531     0.4999 0.000 0.000 0.000 0.328 0.000 0.672
#> GSM11712     5  0.0000     0.8735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11732     3  0.1812     0.8077 0.000 0.000 0.912 0.000 0.008 0.080
#> GSM11844     3  0.0000     0.8455 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM11842     5  0.0000     0.8735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11860     3  0.4663     0.5951 0.000 0.132 0.700 0.000 0.164 0.004
#> GSM11686     6  0.4191     0.8647 0.000 0.000 0.240 0.056 0.000 0.704
#> GSM11688     6  0.4620     0.8061 0.000 0.000 0.176 0.132 0.000 0.692
#> GSM11846     3  0.0622     0.8386 0.012 0.000 0.980 0.000 0.000 0.008
#> GSM11680     6  0.3351     0.8673 0.000 0.000 0.288 0.000 0.000 0.712
#> GSM11698     6  0.3330     0.8706 0.000 0.000 0.284 0.000 0.000 0.716
#> GSM11840     3  0.3860     0.1171 0.000 0.000 0.528 0.000 0.472 0.000
#> GSM11847     5  0.3823     0.0961 0.000 0.000 0.436 0.000 0.564 0.000
#> GSM11685     6  0.3601     0.5227 0.000 0.000 0.000 0.312 0.004 0.684
#> GSM11699     4  0.2178     0.8039 0.000 0.000 0.132 0.868 0.000 0.000
#> GSM27950     6  0.3221     0.8799 0.000 0.000 0.264 0.000 0.000 0.736
#> GSM27946     3  0.2854     0.6763 0.000 0.000 0.792 0.208 0.000 0.000
#> GSM11709     1  0.0000     0.8833 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11720     1  0.6510     0.3590 0.520 0.232 0.000 0.000 0.064 0.184
#> GSM11726     1  0.6518     0.5987 0.608 0.080 0.064 0.000 0.064 0.184
#> GSM11837     2  0.3490     0.8435 0.000 0.784 0.000 0.000 0.040 0.176
#> GSM11725     2  0.2664     0.8482 0.000 0.816 0.000 0.000 0.000 0.184
#> GSM11864     2  0.2664     0.8482 0.000 0.816 0.000 0.000 0.000 0.184
#> GSM11687     1  0.0000     0.8833 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11693     1  0.0000     0.8833 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11727     2  0.5831     0.7071 0.128 0.624 0.000 0.000 0.064 0.184
#> GSM11838     2  0.2664     0.8482 0.000 0.816 0.000 0.000 0.000 0.184
#> GSM11681     1  0.0000     0.8833 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11689     1  0.0000     0.8833 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11704     1  0.0000     0.8833 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11703     1  0.2664     0.7787 0.816 0.000 0.000 0.000 0.000 0.184
#> GSM11705     1  0.0146     0.8824 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM11722     2  0.5603     0.7377 0.104 0.648 0.000 0.000 0.064 0.184
#> GSM11730     1  0.5643     0.6099 0.644 0.108 0.000 0.000 0.064 0.184
#> GSM11713     1  0.0291     0.8812 0.992 0.000 0.000 0.004 0.000 0.004
#> GSM11728     4  0.2664     0.6860 0.000 0.000 0.184 0.816 0.000 0.000
#> GSM27947     3  0.0000     0.8455 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM27951     1  0.0000     0.8833 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM11707     6  0.3221     0.8799 0.000 0.000 0.264 0.000 0.000 0.736
#> GSM11716     3  0.4392     0.5919 0.000 0.000 0.680 0.000 0.064 0.256
#> GSM11850     3  0.0000     0.8455 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM11851     3  0.3172     0.7268 0.000 0.000 0.824 0.048 0.128 0.000
#> GSM11721     5  0.1462     0.8439 0.000 0.000 0.008 0.056 0.936 0.000
#> GSM11852     4  0.0260     0.9119 0.000 0.000 0.008 0.992 0.000 0.000
#> GSM11694     3  0.0000     0.8455 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM11695     3  0.0000     0.8455 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM11734     2  0.0000     0.8635 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11861     4  0.0260     0.9119 0.000 0.000 0.008 0.992 0.000 0.000
#> GSM11843     2  0.0937     0.8615 0.000 0.960 0.000 0.000 0.040 0.000
#> GSM11862     5  0.2980     0.6983 0.000 0.000 0.008 0.192 0.800 0.000
#> GSM11697     3  0.0000     0.8455 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM11714     6  0.3221     0.8799 0.000 0.000 0.264 0.000 0.000 0.736
#> GSM11723     2  0.1387     0.8523 0.000 0.932 0.000 0.000 0.068 0.000
#> GSM11845     2  0.2378     0.7824 0.000 0.848 0.000 0.000 0.152 0.000
#> GSM11683     6  0.5202     0.7415 0.000 0.000 0.196 0.188 0.000 0.616
#> GSM11691     3  0.0000     0.8455 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM27949     3  0.3428     0.2569 0.000 0.000 0.696 0.000 0.000 0.304
#> GSM27945     3  0.0000     0.8455 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM11706     6  0.3330     0.8706 0.000 0.000 0.284 0.000 0.000 0.716
#> GSM11853     3  0.0000     0.8455 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM11729     2  0.0000     0.8635 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11746     2  0.2664     0.8482 0.000 0.816 0.000 0.000 0.000 0.184
#> GSM11711     3  0.0000     0.8455 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM11854     3  0.0790     0.8303 0.000 0.000 0.968 0.032 0.000 0.000
#> GSM11731     2  0.0000     0.8635 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11839     5  0.2416     0.7725 0.000 0.156 0.000 0.000 0.844 0.000
#> GSM11836     5  0.2632     0.7630 0.000 0.164 0.000 0.004 0.832 0.000
#> GSM11849     4  0.0260     0.9119 0.000 0.000 0.008 0.992 0.000 0.000
#> GSM11682     4  0.1204     0.8688 0.000 0.000 0.000 0.944 0.000 0.056
#> GSM11690     4  0.0260     0.9119 0.000 0.000 0.008 0.992 0.000 0.000
#> GSM11692     5  0.1462     0.8439 0.000 0.000 0.008 0.056 0.936 0.000
#> GSM11841     5  0.0000     0.8735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11901     5  0.0000     0.8735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM11715     2  0.0000     0.8635 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM11724     2  0.1204     0.8577 0.000 0.944 0.000 0.000 0.056 0.000
#> GSM11684     4  0.0260     0.9119 0.000 0.000 0.008 0.992 0.000 0.000
#> GSM11696     4  0.0260     0.9119 0.000 0.000 0.008 0.992 0.000 0.000
#> GSM27952     4  0.3725     0.4648 0.000 0.000 0.008 0.676 0.000 0.316
#> GSM27948     4  0.0622     0.9050 0.000 0.000 0.008 0.980 0.012 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-mclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n cell.line(p) agent(p)  time(p) k
#> ATC:mclust 59     3.57e-03    0.460 2.17e-03 2
#> ATC:mclust 44     1.62e-01    0.715 1.81e-03 3
#> ATC:mclust 77     1.70e-09    0.715 6.18e-05 4
#> ATC:mclust 75     1.63e-08    0.402 1.62e-07 5
#> ATC:mclust 77     2.09e-09    0.741 2.89e-04 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:NMF

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "NMF"]
# you can also extract it by
# res = res_list["ATC:NMF"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 14502 rows and 83 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.684           0.856       0.935         0.4922 0.500   0.500
#> 3 3 0.612           0.782       0.889         0.3518 0.694   0.462
#> 4 4 0.720           0.747       0.872         0.1275 0.797   0.481
#> 5 5 0.584           0.587       0.756         0.0560 0.896   0.633
#> 6 6 0.612           0.495       0.697         0.0391 0.931   0.707

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM11708     1  0.0000      0.905 1.000 0.000
#> GSM11735     1  0.0000      0.905 1.000 0.000
#> GSM11733     1  0.0000      0.905 1.000 0.000
#> GSM11863     2  0.0000      0.953 0.000 1.000
#> GSM11710     1  0.0000      0.905 1.000 0.000
#> GSM11712     2  0.0000      0.953 0.000 1.000
#> GSM11732     2  0.8267      0.609 0.260 0.740
#> GSM11844     1  0.9993      0.178 0.516 0.484
#> GSM11842     2  0.0000      0.953 0.000 1.000
#> GSM11860     2  0.0000      0.953 0.000 1.000
#> GSM11686     1  0.0000      0.905 1.000 0.000
#> GSM11688     1  0.0000      0.905 1.000 0.000
#> GSM11846     1  0.7139      0.781 0.804 0.196
#> GSM11680     1  0.0000      0.905 1.000 0.000
#> GSM11698     1  0.0000      0.905 1.000 0.000
#> GSM11840     1  0.7528      0.759 0.784 0.216
#> GSM11847     1  0.4298      0.863 0.912 0.088
#> GSM11685     1  0.0000      0.905 1.000 0.000
#> GSM11699     1  0.0000      0.905 1.000 0.000
#> GSM27950     1  0.0000      0.905 1.000 0.000
#> GSM27946     1  0.5946      0.826 0.856 0.144
#> GSM11709     2  0.6438      0.774 0.164 0.836
#> GSM11720     2  0.0000      0.953 0.000 1.000
#> GSM11726     2  0.0000      0.953 0.000 1.000
#> GSM11837     2  0.0000      0.953 0.000 1.000
#> GSM11725     2  0.0000      0.953 0.000 1.000
#> GSM11864     2  0.0000      0.953 0.000 1.000
#> GSM11687     2  0.9881      0.104 0.436 0.564
#> GSM11693     2  0.6247      0.785 0.156 0.844
#> GSM11727     2  0.0000      0.953 0.000 1.000
#> GSM11838     2  0.0000      0.953 0.000 1.000
#> GSM11681     1  0.0000      0.905 1.000 0.000
#> GSM11689     2  0.0376      0.951 0.004 0.996
#> GSM11704     2  0.0000      0.953 0.000 1.000
#> GSM11703     1  0.9983      0.210 0.524 0.476
#> GSM11705     1  0.7602      0.755 0.780 0.220
#> GSM11722     2  0.0000      0.953 0.000 1.000
#> GSM11730     2  0.0000      0.953 0.000 1.000
#> GSM11713     1  0.7299      0.773 0.796 0.204
#> GSM11728     1  0.3879      0.870 0.924 0.076
#> GSM27947     1  0.8016      0.724 0.756 0.244
#> GSM27951     1  0.9209      0.576 0.664 0.336
#> GSM11707     1  0.0000      0.905 1.000 0.000
#> GSM11716     2  0.0000      0.953 0.000 1.000
#> GSM11850     1  0.9552      0.492 0.624 0.376
#> GSM11851     1  0.0000      0.905 1.000 0.000
#> GSM11721     2  0.1184      0.941 0.016 0.984
#> GSM11852     1  0.0000      0.905 1.000 0.000
#> GSM11694     1  0.0000      0.905 1.000 0.000
#> GSM11695     1  0.0000      0.905 1.000 0.000
#> GSM11734     2  0.0000      0.953 0.000 1.000
#> GSM11861     2  0.9209      0.431 0.336 0.664
#> GSM11843     2  0.0000      0.953 0.000 1.000
#> GSM11862     2  0.2948      0.908 0.052 0.948
#> GSM11697     1  0.0000      0.905 1.000 0.000
#> GSM11714     1  0.0000      0.905 1.000 0.000
#> GSM11723     2  0.0000      0.953 0.000 1.000
#> GSM11845     2  0.0000      0.953 0.000 1.000
#> GSM11683     1  0.0000      0.905 1.000 0.000
#> GSM11691     1  0.0000      0.905 1.000 0.000
#> GSM27949     1  0.0000      0.905 1.000 0.000
#> GSM27945     1  0.6247      0.817 0.844 0.156
#> GSM11706     1  0.0000      0.905 1.000 0.000
#> GSM11853     1  0.5842      0.829 0.860 0.140
#> GSM11729     2  0.0000      0.953 0.000 1.000
#> GSM11746     2  0.0000      0.953 0.000 1.000
#> GSM11711     1  0.0000      0.905 1.000 0.000
#> GSM11854     1  0.0000      0.905 1.000 0.000
#> GSM11731     2  0.0000      0.953 0.000 1.000
#> GSM11839     2  0.0000      0.953 0.000 1.000
#> GSM11836     2  0.0000      0.953 0.000 1.000
#> GSM11849     1  0.6973      0.790 0.812 0.188
#> GSM11682     1  0.0000      0.905 1.000 0.000
#> GSM11690     1  0.0000      0.905 1.000 0.000
#> GSM11692     2  0.1184      0.941 0.016 0.984
#> GSM11841     2  0.0000      0.953 0.000 1.000
#> GSM11901     2  0.0000      0.953 0.000 1.000
#> GSM11715     2  0.0000      0.953 0.000 1.000
#> GSM11724     2  0.0000      0.953 0.000 1.000
#> GSM11684     1  0.0000      0.905 1.000 0.000
#> GSM11696     1  0.2603      0.886 0.956 0.044
#> GSM27952     1  0.0000      0.905 1.000 0.000
#> GSM27948     1  0.9491      0.509 0.632 0.368

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM11708     3  0.5835      0.465 0.340 0.000 0.660
#> GSM11735     3  0.3412      0.768 0.124 0.000 0.876
#> GSM11733     3  0.0747      0.831 0.000 0.016 0.984
#> GSM11863     2  0.5327      0.571 0.000 0.728 0.272
#> GSM11710     3  0.0000      0.832 0.000 0.000 1.000
#> GSM11712     2  0.1753      0.887 0.000 0.952 0.048
#> GSM11732     2  0.2749      0.878 0.012 0.924 0.064
#> GSM11844     3  0.6305      0.204 0.000 0.484 0.516
#> GSM11842     2  0.2165      0.875 0.000 0.936 0.064
#> GSM11860     2  0.0424      0.914 0.008 0.992 0.000
#> GSM11686     3  0.1163      0.824 0.028 0.000 0.972
#> GSM11688     3  0.0592      0.829 0.012 0.000 0.988
#> GSM11846     1  0.1878      0.891 0.952 0.044 0.004
#> GSM11680     1  0.5254      0.611 0.736 0.000 0.264
#> GSM11698     3  0.2796      0.792 0.092 0.000 0.908
#> GSM11840     3  0.4555      0.720 0.000 0.200 0.800
#> GSM11847     3  0.3116      0.794 0.000 0.108 0.892
#> GSM11685     3  0.0237      0.831 0.004 0.000 0.996
#> GSM11699     3  0.0000      0.832 0.000 0.000 1.000
#> GSM27950     3  0.6140      0.311 0.404 0.000 0.596
#> GSM27946     3  0.3454      0.797 0.008 0.104 0.888
#> GSM11709     1  0.1031      0.893 0.976 0.024 0.000
#> GSM11720     1  0.5810      0.506 0.664 0.336 0.000
#> GSM11726     1  0.4702      0.736 0.788 0.212 0.000
#> GSM11837     2  0.1163      0.907 0.028 0.972 0.000
#> GSM11725     2  0.2356      0.878 0.072 0.928 0.000
#> GSM11864     2  0.0892      0.911 0.020 0.980 0.000
#> GSM11687     1  0.0747      0.892 0.984 0.016 0.000
#> GSM11693     1  0.1031      0.893 0.976 0.024 0.000
#> GSM11727     2  0.2959      0.855 0.100 0.900 0.000
#> GSM11838     2  0.0892      0.911 0.020 0.980 0.000
#> GSM11681     1  0.0000      0.888 1.000 0.000 0.000
#> GSM11689     1  0.1411      0.891 0.964 0.036 0.000
#> GSM11704     1  0.1860      0.886 0.948 0.052 0.000
#> GSM11703     1  0.1753      0.888 0.952 0.048 0.000
#> GSM11705     1  0.0237      0.889 0.996 0.004 0.000
#> GSM11722     2  0.4346      0.762 0.184 0.816 0.000
#> GSM11730     2  0.5678      0.542 0.316 0.684 0.000
#> GSM11713     1  0.1753      0.889 0.952 0.048 0.000
#> GSM11728     1  0.6128      0.802 0.780 0.084 0.136
#> GSM27947     1  0.3272      0.855 0.892 0.104 0.004
#> GSM27951     1  0.0424      0.890 0.992 0.008 0.000
#> GSM11707     1  0.5216      0.639 0.740 0.000 0.260
#> GSM11716     2  0.5678      0.540 0.316 0.684 0.000
#> GSM11850     1  0.4555      0.752 0.800 0.200 0.000
#> GSM11851     3  0.0000      0.832 0.000 0.000 1.000
#> GSM11721     3  0.5882      0.518 0.000 0.348 0.652
#> GSM11852     3  0.0000      0.832 0.000 0.000 1.000
#> GSM11694     1  0.1529      0.877 0.960 0.000 0.040
#> GSM11695     1  0.2959      0.837 0.900 0.000 0.100
#> GSM11734     2  0.0000      0.915 0.000 1.000 0.000
#> GSM11861     3  0.5882      0.522 0.000 0.348 0.652
#> GSM11843     2  0.0000      0.915 0.000 1.000 0.000
#> GSM11862     3  0.6008      0.475 0.000 0.372 0.628
#> GSM11697     1  0.1964      0.868 0.944 0.000 0.056
#> GSM11714     3  0.5363      0.581 0.276 0.000 0.724
#> GSM11723     2  0.0000      0.915 0.000 1.000 0.000
#> GSM11845     2  0.0000      0.915 0.000 1.000 0.000
#> GSM11683     3  0.0424      0.831 0.008 0.000 0.992
#> GSM11691     1  0.1031      0.882 0.976 0.000 0.024
#> GSM27949     1  0.3686      0.801 0.860 0.000 0.140
#> GSM27945     1  0.4636      0.858 0.852 0.104 0.044
#> GSM11706     3  0.4974      0.640 0.236 0.000 0.764
#> GSM11853     3  0.8512      0.521 0.212 0.176 0.612
#> GSM11729     2  0.0000      0.915 0.000 1.000 0.000
#> GSM11746     2  0.1289      0.905 0.032 0.968 0.000
#> GSM11711     3  0.1753      0.816 0.048 0.000 0.952
#> GSM11854     3  0.0000      0.832 0.000 0.000 1.000
#> GSM11731     2  0.0000      0.915 0.000 1.000 0.000
#> GSM11839     2  0.0237      0.913 0.000 0.996 0.004
#> GSM11836     2  0.0237      0.913 0.000 0.996 0.004
#> GSM11849     3  0.4062      0.759 0.000 0.164 0.836
#> GSM11682     3  0.0000      0.832 0.000 0.000 1.000
#> GSM11690     3  0.0237      0.832 0.000 0.004 0.996
#> GSM11692     3  0.6274      0.269 0.000 0.456 0.544
#> GSM11841     2  0.2796      0.848 0.000 0.908 0.092
#> GSM11901     2  0.4931      0.651 0.000 0.768 0.232
#> GSM11715     2  0.0000      0.915 0.000 1.000 0.000
#> GSM11724     2  0.0000      0.915 0.000 1.000 0.000
#> GSM11684     3  0.0592      0.831 0.000 0.012 0.988
#> GSM11696     3  0.1753      0.823 0.000 0.048 0.952
#> GSM27952     3  0.0000      0.832 0.000 0.000 1.000
#> GSM27948     3  0.5058      0.671 0.000 0.244 0.756

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM11708     3  0.1118     0.8360 0.000 0.000 0.964 0.036
#> GSM11735     3  0.0592     0.8358 0.000 0.000 0.984 0.016
#> GSM11733     3  0.4567     0.6782 0.000 0.008 0.716 0.276
#> GSM11863     2  0.2002     0.8622 0.000 0.936 0.044 0.020
#> GSM11710     3  0.4866     0.4653 0.000 0.000 0.596 0.404
#> GSM11712     2  0.0921     0.8876 0.000 0.972 0.000 0.028
#> GSM11732     3  0.1716     0.8236 0.000 0.064 0.936 0.000
#> GSM11844     3  0.2944     0.7841 0.000 0.128 0.868 0.004
#> GSM11842     2  0.0895     0.8915 0.000 0.976 0.004 0.020
#> GSM11860     2  0.0000     0.8999 0.000 1.000 0.000 0.000
#> GSM11686     4  0.3443     0.6923 0.016 0.000 0.136 0.848
#> GSM11688     4  0.5112     0.1219 0.008 0.000 0.384 0.608
#> GSM11846     3  0.5614     0.4018 0.336 0.036 0.628 0.000
#> GSM11680     3  0.5699     0.4292 0.380 0.000 0.588 0.032
#> GSM11698     3  0.2888     0.8113 0.004 0.000 0.872 0.124
#> GSM11840     3  0.7486     0.3839 0.000 0.272 0.500 0.228
#> GSM11847     4  0.7442     0.0802 0.000 0.184 0.340 0.476
#> GSM11685     4  0.1305     0.7866 0.004 0.000 0.036 0.960
#> GSM11699     4  0.0592     0.7965 0.000 0.000 0.016 0.984
#> GSM27950     3  0.2542     0.8287 0.012 0.000 0.904 0.084
#> GSM27946     4  0.2530     0.7853 0.112 0.000 0.000 0.888
#> GSM11709     1  0.3208     0.7833 0.848 0.004 0.148 0.000
#> GSM11720     2  0.5695     0.0645 0.476 0.500 0.024 0.000
#> GSM11726     1  0.7400     0.1404 0.468 0.360 0.172 0.000
#> GSM11837     2  0.0188     0.8993 0.004 0.996 0.000 0.000
#> GSM11725     2  0.0921     0.8886 0.028 0.972 0.000 0.000
#> GSM11864     2  0.0188     0.8993 0.004 0.996 0.000 0.000
#> GSM11687     1  0.0779     0.8992 0.980 0.004 0.016 0.000
#> GSM11693     1  0.0657     0.9005 0.984 0.004 0.012 0.000
#> GSM11727     2  0.4164     0.6259 0.264 0.736 0.000 0.000
#> GSM11838     2  0.0592     0.8954 0.016 0.984 0.000 0.000
#> GSM11681     1  0.0817     0.8952 0.976 0.000 0.000 0.024
#> GSM11689     1  0.0376     0.9022 0.992 0.004 0.004 0.000
#> GSM11704     1  0.0336     0.9023 0.992 0.008 0.000 0.000
#> GSM11703     1  0.0657     0.9014 0.984 0.004 0.000 0.012
#> GSM11705     1  0.0779     0.8991 0.980 0.004 0.016 0.000
#> GSM11722     2  0.5000     0.0628 0.496 0.504 0.000 0.000
#> GSM11730     1  0.2399     0.8699 0.920 0.048 0.000 0.032
#> GSM11713     1  0.2281     0.8342 0.904 0.000 0.000 0.096
#> GSM11728     1  0.4008     0.6131 0.756 0.000 0.000 0.244
#> GSM27947     1  0.0657     0.9019 0.984 0.000 0.004 0.012
#> GSM27951     1  0.0000     0.9025 1.000 0.000 0.000 0.000
#> GSM11707     3  0.0921     0.8319 0.028 0.000 0.972 0.000
#> GSM11716     2  0.5366     0.5551 0.040 0.684 0.276 0.000
#> GSM11850     3  0.1629     0.8321 0.024 0.024 0.952 0.000
#> GSM11851     3  0.4158     0.7366 0.000 0.008 0.768 0.224
#> GSM11721     4  0.2149     0.7928 0.000 0.088 0.000 0.912
#> GSM11852     4  0.0188     0.7991 0.000 0.000 0.004 0.996
#> GSM11694     3  0.1118     0.8307 0.036 0.000 0.964 0.000
#> GSM11695     3  0.1022     0.8315 0.032 0.000 0.968 0.000
#> GSM11734     2  0.0000     0.8999 0.000 1.000 0.000 0.000
#> GSM11861     4  0.1867     0.7973 0.000 0.072 0.000 0.928
#> GSM11843     2  0.0188     0.8989 0.000 0.996 0.000 0.004
#> GSM11862     4  0.2760     0.7718 0.000 0.128 0.000 0.872
#> GSM11697     3  0.2011     0.8151 0.080 0.000 0.920 0.000
#> GSM11714     3  0.1970     0.8339 0.008 0.000 0.932 0.060
#> GSM11723     2  0.0000     0.8999 0.000 1.000 0.000 0.000
#> GSM11845     2  0.0000     0.8999 0.000 1.000 0.000 0.000
#> GSM11683     4  0.3099     0.7897 0.104 0.000 0.020 0.876
#> GSM11691     1  0.1256     0.8925 0.964 0.000 0.008 0.028
#> GSM27949     3  0.1022     0.8313 0.032 0.000 0.968 0.000
#> GSM27945     3  0.4800     0.6941 0.196 0.044 0.760 0.000
#> GSM11706     3  0.1118     0.8357 0.000 0.000 0.964 0.036
#> GSM11853     3  0.2156     0.8253 0.004 0.060 0.928 0.008
#> GSM11729     2  0.0000     0.8999 0.000 1.000 0.000 0.000
#> GSM11746     2  0.0336     0.8983 0.008 0.992 0.000 0.000
#> GSM11711     3  0.3444     0.7732 0.000 0.000 0.816 0.184
#> GSM11854     3  0.4382     0.6551 0.000 0.000 0.704 0.296
#> GSM11731     2  0.0188     0.8989 0.000 0.996 0.000 0.004
#> GSM11839     2  0.0469     0.8961 0.000 0.988 0.000 0.012
#> GSM11836     2  0.1940     0.8482 0.000 0.924 0.000 0.076
#> GSM11849     4  0.3975     0.6793 0.240 0.000 0.000 0.760
#> GSM11682     4  0.3726     0.7133 0.212 0.000 0.000 0.788
#> GSM11690     4  0.2814     0.7735 0.132 0.000 0.000 0.868
#> GSM11692     4  0.2704     0.7756 0.000 0.124 0.000 0.876
#> GSM11841     2  0.4250     0.5577 0.000 0.724 0.000 0.276
#> GSM11901     4  0.4925     0.2768 0.000 0.428 0.000 0.572
#> GSM11715     2  0.0376     0.8996 0.004 0.992 0.000 0.004
#> GSM11724     2  0.0376     0.8996 0.004 0.992 0.000 0.004
#> GSM11684     4  0.4164     0.6452 0.264 0.000 0.000 0.736
#> GSM11696     4  0.3975     0.6788 0.240 0.000 0.000 0.760
#> GSM27952     4  0.0804     0.7995 0.012 0.000 0.008 0.980
#> GSM27948     4  0.1677     0.8040 0.040 0.012 0.000 0.948

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM11708     3  0.1281     0.8710 0.000 0.000 0.956 0.032 0.012
#> GSM11735     3  0.0727     0.8714 0.004 0.000 0.980 0.012 0.004
#> GSM11733     3  0.4302     0.7920 0.016 0.016 0.800 0.136 0.032
#> GSM11863     2  0.4399     0.7294 0.028 0.800 0.016 0.128 0.028
#> GSM11710     4  0.4318     0.5194 0.008 0.000 0.296 0.688 0.008
#> GSM11712     2  0.6343     0.4939 0.124 0.596 0.016 0.256 0.008
#> GSM11732     3  0.2894     0.8027 0.008 0.124 0.860 0.000 0.008
#> GSM11844     3  0.2536     0.8033 0.004 0.128 0.868 0.000 0.000
#> GSM11842     2  0.5605     0.5935 0.084 0.672 0.012 0.224 0.008
#> GSM11860     2  0.6131     0.3318 0.384 0.528 0.012 0.064 0.012
#> GSM11686     4  0.5629     0.5624 0.076 0.000 0.148 0.708 0.068
#> GSM11688     4  0.4982     0.5146 0.032 0.000 0.228 0.708 0.032
#> GSM11846     1  0.5132     0.5185 0.764 0.072 0.108 0.044 0.012
#> GSM11680     3  0.5686     0.6928 0.120 0.000 0.688 0.032 0.160
#> GSM11698     3  0.3495     0.8275 0.024 0.000 0.844 0.024 0.108
#> GSM11840     4  0.7537     0.3077 0.024 0.256 0.256 0.448 0.016
#> GSM11847     4  0.6224     0.5546 0.016 0.116 0.164 0.668 0.036
#> GSM11685     4  0.2434     0.6444 0.008 0.000 0.036 0.908 0.048
#> GSM11699     4  0.5078     0.5906 0.052 0.000 0.028 0.716 0.204
#> GSM27950     3  0.3107     0.8581 0.012 0.000 0.868 0.088 0.032
#> GSM27946     4  0.4337     0.6022 0.204 0.000 0.000 0.744 0.052
#> GSM11709     1  0.4986     0.5437 0.716 0.004 0.104 0.000 0.176
#> GSM11720     1  0.4692     0.4009 0.688 0.276 0.012 0.000 0.024
#> GSM11726     1  0.7214     0.2508 0.468 0.348 0.100 0.000 0.084
#> GSM11837     2  0.0162     0.7979 0.000 0.996 0.000 0.000 0.004
#> GSM11725     2  0.2563     0.7522 0.120 0.872 0.000 0.000 0.008
#> GSM11864     2  0.3885     0.6251 0.268 0.724 0.000 0.000 0.008
#> GSM11687     1  0.3132     0.5563 0.820 0.000 0.008 0.000 0.172
#> GSM11693     1  0.2741     0.5633 0.860 0.004 0.004 0.000 0.132
#> GSM11727     2  0.3988     0.6509 0.036 0.768 0.000 0.000 0.196
#> GSM11838     2  0.1205     0.7932 0.004 0.956 0.000 0.000 0.040
#> GSM11681     1  0.5304     0.2043 0.560 0.000 0.000 0.056 0.384
#> GSM11689     1  0.3491     0.5208 0.768 0.000 0.000 0.004 0.228
#> GSM11704     1  0.3906     0.4788 0.704 0.004 0.000 0.000 0.292
#> GSM11703     1  0.3774     0.4310 0.704 0.000 0.000 0.000 0.296
#> GSM11705     1  0.5308     0.3485 0.532 0.000 0.052 0.000 0.416
#> GSM11722     2  0.5341     0.2992 0.060 0.564 0.000 0.000 0.376
#> GSM11730     5  0.5458     0.5035 0.140 0.140 0.000 0.020 0.700
#> GSM11713     5  0.3555     0.5671 0.124 0.000 0.000 0.052 0.824
#> GSM11728     5  0.2983     0.5969 0.076 0.000 0.000 0.056 0.868
#> GSM27947     1  0.2935     0.5338 0.860 0.000 0.004 0.016 0.120
#> GSM27951     1  0.4003     0.4672 0.704 0.000 0.000 0.008 0.288
#> GSM11707     3  0.1251     0.8636 0.008 0.000 0.956 0.000 0.036
#> GSM11716     2  0.5427     0.2863 0.044 0.544 0.404 0.000 0.008
#> GSM11850     3  0.1701     0.8661 0.012 0.016 0.944 0.000 0.028
#> GSM11851     3  0.6868     0.3426 0.196 0.008 0.516 0.268 0.012
#> GSM11721     4  0.2897     0.6540 0.000 0.072 0.020 0.884 0.024
#> GSM11852     4  0.3110     0.6572 0.044 0.000 0.020 0.876 0.060
#> GSM11694     3  0.1106     0.8692 0.024 0.000 0.964 0.000 0.012
#> GSM11695     3  0.1012     0.8685 0.020 0.000 0.968 0.000 0.012
#> GSM11734     2  0.0162     0.7983 0.000 0.996 0.000 0.004 0.000
#> GSM11861     4  0.4124     0.6268 0.140 0.052 0.000 0.796 0.012
#> GSM11843     2  0.3734     0.7021 0.184 0.792 0.000 0.016 0.008
#> GSM11862     4  0.4084     0.6437 0.092 0.056 0.008 0.824 0.020
#> GSM11697     3  0.4203     0.7622 0.092 0.000 0.780 0.000 0.128
#> GSM11714     3  0.1893     0.8681 0.000 0.000 0.928 0.048 0.024
#> GSM11723     2  0.1430     0.7936 0.004 0.944 0.000 0.000 0.052
#> GSM11845     2  0.1399     0.7985 0.020 0.952 0.000 0.000 0.028
#> GSM11683     4  0.5971     0.5055 0.068 0.000 0.088 0.676 0.168
#> GSM11691     5  0.4962    -0.0733 0.432 0.000 0.016 0.008 0.544
#> GSM27949     3  0.0579     0.8694 0.008 0.000 0.984 0.000 0.008
#> GSM27945     1  0.6107     0.4779 0.700 0.064 0.148 0.048 0.040
#> GSM11706     3  0.2407     0.8528 0.004 0.000 0.896 0.088 0.012
#> GSM11853     1  0.7217     0.1891 0.480 0.056 0.360 0.088 0.016
#> GSM11729     2  0.0000     0.7979 0.000 1.000 0.000 0.000 0.000
#> GSM11746     2  0.1608     0.7810 0.072 0.928 0.000 0.000 0.000
#> GSM11711     1  0.7027    -0.0137 0.384 0.000 0.364 0.240 0.012
#> GSM11854     4  0.6859     0.3656 0.216 0.008 0.240 0.524 0.012
#> GSM11731     2  0.0324     0.7985 0.004 0.992 0.000 0.004 0.000
#> GSM11839     2  0.0740     0.7992 0.004 0.980 0.000 0.008 0.008
#> GSM11836     2  0.1116     0.7988 0.004 0.964 0.000 0.028 0.004
#> GSM11849     4  0.5112     0.0150 0.036 0.000 0.000 0.496 0.468
#> GSM11682     4  0.5092     0.4904 0.092 0.000 0.008 0.708 0.192
#> GSM11690     4  0.4170     0.5503 0.048 0.000 0.000 0.760 0.192
#> GSM11692     4  0.4573     0.5641 0.004 0.044 0.004 0.736 0.212
#> GSM11841     2  0.5521     0.5352 0.004 0.656 0.000 0.216 0.124
#> GSM11901     4  0.6505     0.3262 0.008 0.300 0.000 0.516 0.176
#> GSM11715     2  0.2011     0.7749 0.004 0.908 0.000 0.000 0.088
#> GSM11724     2  0.3491     0.6609 0.004 0.768 0.000 0.000 0.228
#> GSM11684     5  0.4251     0.3688 0.012 0.000 0.000 0.316 0.672
#> GSM11696     5  0.4808     0.2722 0.032 0.000 0.000 0.348 0.620
#> GSM27952     4  0.2786     0.6315 0.020 0.000 0.012 0.884 0.084
#> GSM27948     4  0.2946     0.6412 0.044 0.000 0.000 0.868 0.088

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM11708     3  0.0806    0.85219 0.000 0.000 0.972 0.000 0.008 0.020
#> GSM11735     3  0.0777    0.85239 0.000 0.000 0.972 0.000 0.004 0.024
#> GSM11733     3  0.4227    0.72618 0.000 0.000 0.764 0.028 0.060 0.148
#> GSM11863     2  0.5974    0.52361 0.000 0.628 0.012 0.088 0.200 0.072
#> GSM11710     6  0.4763    0.49199 0.000 0.000 0.172 0.004 0.136 0.688
#> GSM11712     2  0.7119    0.00597 0.000 0.360 0.004 0.060 0.280 0.296
#> GSM11732     3  0.2431    0.78501 0.000 0.132 0.860 0.000 0.008 0.000
#> GSM11844     3  0.2655    0.78061 0.000 0.140 0.848 0.000 0.008 0.004
#> GSM11842     2  0.6851    0.17997 0.000 0.432 0.000 0.060 0.256 0.252
#> GSM11860     5  0.4585    0.36187 0.028 0.204 0.000 0.012 0.724 0.032
#> GSM11686     6  0.5762    0.51137 0.164 0.000 0.156 0.036 0.008 0.636
#> GSM11688     6  0.3593    0.56719 0.064 0.000 0.132 0.004 0.000 0.800
#> GSM11846     5  0.4799    0.22617 0.248 0.004 0.032 0.000 0.680 0.036
#> GSM11680     3  0.6708    0.57352 0.096 0.000 0.612 0.076 0.104 0.112
#> GSM11698     3  0.4154    0.78212 0.012 0.000 0.800 0.064 0.084 0.040
#> GSM11840     6  0.7727    0.30726 0.000 0.172 0.108 0.072 0.168 0.480
#> GSM11847     6  0.7607    0.40132 0.000 0.096 0.120 0.120 0.152 0.512
#> GSM11685     6  0.2713    0.59523 0.016 0.000 0.076 0.024 0.004 0.880
#> GSM11699     4  0.6340    0.04462 0.004 0.000 0.012 0.452 0.240 0.292
#> GSM27950     3  0.2292    0.83059 0.004 0.000 0.884 0.004 0.004 0.104
#> GSM27946     6  0.6433    0.39835 0.140 0.000 0.000 0.080 0.240 0.540
#> GSM11709     1  0.5561    0.46925 0.544 0.000 0.060 0.040 0.356 0.000
#> GSM11720     5  0.5120    0.18220 0.236 0.080 0.020 0.004 0.660 0.000
#> GSM11726     2  0.7940   -0.20622 0.276 0.348 0.080 0.052 0.244 0.000
#> GSM11837     2  0.0405    0.72580 0.000 0.988 0.000 0.004 0.008 0.000
#> GSM11725     2  0.2128    0.70465 0.032 0.908 0.000 0.004 0.056 0.000
#> GSM11864     2  0.4253    0.41901 0.008 0.608 0.000 0.012 0.372 0.000
#> GSM11687     1  0.4411    0.55120 0.628 0.000 0.012 0.020 0.340 0.000
#> GSM11693     1  0.4736    0.44150 0.532 0.000 0.008 0.024 0.432 0.004
#> GSM11727     2  0.3718    0.61086 0.052 0.780 0.000 0.164 0.004 0.000
#> GSM11838     2  0.0806    0.72243 0.008 0.972 0.000 0.020 0.000 0.000
#> GSM11681     1  0.3396    0.44376 0.828 0.000 0.000 0.060 0.012 0.100
#> GSM11689     1  0.3692    0.60914 0.736 0.000 0.000 0.012 0.244 0.008
#> GSM11704     1  0.3671    0.62109 0.784 0.000 0.000 0.040 0.168 0.008
#> GSM11703     5  0.6439   -0.28761 0.268 0.000 0.000 0.340 0.376 0.016
#> GSM11705     1  0.6540    0.42862 0.444 0.000 0.032 0.276 0.248 0.000
#> GSM11722     2  0.5624    0.27379 0.124 0.544 0.000 0.320 0.012 0.000
#> GSM11730     4  0.4419    0.44262 0.220 0.072 0.000 0.704 0.004 0.000
#> GSM11713     4  0.4113    0.40209 0.308 0.000 0.000 0.668 0.008 0.016
#> GSM11728     4  0.3898    0.49080 0.216 0.008 0.000 0.748 0.004 0.024
#> GSM27947     5  0.5782   -0.04597 0.308 0.000 0.000 0.112 0.552 0.028
#> GSM27951     1  0.3266    0.59934 0.824 0.000 0.000 0.036 0.132 0.008
#> GSM11707     3  0.1148    0.85235 0.016 0.000 0.960 0.000 0.020 0.004
#> GSM11716     2  0.5809    0.08810 0.012 0.464 0.428 0.016 0.080 0.000
#> GSM11850     3  0.1666    0.84826 0.008 0.020 0.936 0.000 0.036 0.000
#> GSM11851     5  0.5999    0.25330 0.000 0.000 0.320 0.004 0.460 0.216
#> GSM11721     6  0.3324    0.58394 0.000 0.024 0.000 0.048 0.088 0.840
#> GSM11852     6  0.3756    0.57527 0.004 0.000 0.000 0.076 0.132 0.788
#> GSM11694     3  0.2404    0.83176 0.008 0.000 0.880 0.004 0.104 0.004
#> GSM11695     3  0.2349    0.83202 0.020 0.000 0.892 0.000 0.080 0.008
#> GSM11734     2  0.0146    0.72559 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM11861     6  0.4935    0.47392 0.012 0.020 0.000 0.032 0.292 0.644
#> GSM11843     2  0.3984    0.49168 0.000 0.648 0.000 0.016 0.336 0.000
#> GSM11862     6  0.5110    0.47886 0.004 0.032 0.000 0.048 0.272 0.644
#> GSM11697     3  0.5271    0.67872 0.044 0.000 0.708 0.096 0.136 0.016
#> GSM11714     3  0.1477    0.84659 0.000 0.000 0.940 0.004 0.008 0.048
#> GSM11723     2  0.0603    0.72546 0.000 0.980 0.000 0.016 0.004 0.000
#> GSM11845     2  0.4486    0.60372 0.004 0.720 0.000 0.152 0.124 0.000
#> GSM11683     6  0.6591    0.41298 0.188 0.000 0.168 0.080 0.008 0.556
#> GSM11691     1  0.7635    0.09155 0.372 0.000 0.052 0.344 0.164 0.068
#> GSM27949     3  0.1225    0.85113 0.012 0.000 0.952 0.000 0.036 0.000
#> GSM27945     5  0.5295    0.27097 0.160 0.004 0.028 0.084 0.704 0.020
#> GSM11706     3  0.3656    0.77032 0.012 0.000 0.808 0.000 0.072 0.108
#> GSM11853     5  0.4519    0.43566 0.052 0.012 0.120 0.000 0.768 0.048
#> GSM11729     2  0.0405    0.72556 0.000 0.988 0.000 0.004 0.008 0.000
#> GSM11746     2  0.0837    0.72543 0.004 0.972 0.000 0.004 0.020 0.000
#> GSM11711     5  0.6048    0.40998 0.016 0.000 0.248 0.004 0.540 0.192
#> GSM11854     5  0.5547    0.17230 0.000 0.000 0.148 0.000 0.508 0.344
#> GSM11731     2  0.0291    0.72512 0.000 0.992 0.000 0.004 0.004 0.000
#> GSM11839     2  0.0622    0.72610 0.000 0.980 0.000 0.008 0.012 0.000
#> GSM11836     2  0.1036    0.71995 0.004 0.964 0.000 0.008 0.000 0.024
#> GSM11849     6  0.5499    0.12082 0.072 0.000 0.000 0.380 0.024 0.524
#> GSM11682     6  0.4963    0.46482 0.264 0.000 0.004 0.076 0.008 0.648
#> GSM11690     6  0.4763    0.43994 0.072 0.000 0.000 0.216 0.020 0.692
#> GSM11692     6  0.5720    0.01873 0.000 0.020 0.000 0.440 0.096 0.444
#> GSM11841     2  0.6861    0.23853 0.000 0.488 0.000 0.244 0.112 0.156
#> GSM11901     4  0.7278    0.05422 0.000 0.244 0.004 0.384 0.088 0.280
#> GSM11715     2  0.1349    0.71294 0.000 0.940 0.000 0.056 0.004 0.000
#> GSM11724     2  0.3405    0.54574 0.000 0.724 0.000 0.272 0.004 0.000
#> GSM11684     4  0.3470    0.55059 0.028 0.000 0.000 0.820 0.028 0.124
#> GSM11696     4  0.3603    0.53084 0.016 0.000 0.000 0.804 0.040 0.140
#> GSM27952     6  0.3509    0.57945 0.128 0.000 0.024 0.032 0.000 0.816
#> GSM27948     6  0.3891    0.53770 0.004 0.000 0.000 0.164 0.064 0.768

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-NMF-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>          n cell.line(p) agent(p)  time(p) k
#> ATC:NMF 78     5.09e-02   0.0193 1.01e-03 2
#> ATC:NMF 78     1.54e-05   0.3815 6.81e-05 3
#> ATC:NMF 73     3.72e-08   0.0777 6.42e-07 4
#> ATC:NMF 60     1.07e-05   0.1530 5.19e-08 5
#> ATC:NMF 44     5.60e-05   0.2050 9.87e-09 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.

Session info

sessionInfo()
#> R version 3.6.0 (2019-04-26)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: CentOS Linux 7 (Core)
#> 
#> Matrix products: default
#> BLAS:   /usr/lib64/libblas.so.3.4.2
#> LAPACK: /usr/lib64/liblapack.so.3.4.2
#> 
#> locale:
#>  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8       
#>  [4] LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
#>  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
#> [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] grid      stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] genefilter_1.66.0    ComplexHeatmap_2.3.1 markdown_1.1         knitr_1.26          
#> [5] GetoptLong_0.1.7     cola_1.3.2          
#> 
#> loaded via a namespace (and not attached):
#>  [1] circlize_0.4.8       shape_1.4.4          xfun_0.11            slam_0.1-46         
#>  [5] lattice_0.20-38      splines_3.6.0        colorspace_1.4-1     vctrs_0.2.0         
#>  [9] stats4_3.6.0         blob_1.2.0           XML_3.98-1.20        survival_2.44-1.1   
#> [13] rlang_0.4.2          pillar_1.4.2         DBI_1.0.0            BiocGenerics_0.30.0 
#> [17] bit64_0.9-7          RColorBrewer_1.1-2   matrixStats_0.55.0   stringr_1.4.0       
#> [21] GlobalOptions_0.1.1  evaluate_0.14        memoise_1.1.0        Biobase_2.44.0      
#> [25] IRanges_2.18.3       parallel_3.6.0       AnnotationDbi_1.46.1 highr_0.8           
#> [29] Rcpp_1.0.3           xtable_1.8-4         backports_1.1.5      S4Vectors_0.22.1    
#> [33] annotate_1.62.0      skmeans_0.2-11       bit_1.1-14           microbenchmark_1.4-7
#> [37] brew_1.0-6           impute_1.58.0        rjson_0.2.20         png_0.1-7           
#> [41] digest_0.6.23        stringi_1.4.3        polyclip_1.10-0      clue_0.3-57         
#> [45] tools_3.6.0          bitops_1.0-6         magrittr_1.5         eulerr_6.0.0        
#> [49] RCurl_1.95-4.12      RSQLite_2.1.4        tibble_2.1.3         cluster_2.1.0       
#> [53] crayon_1.3.4         pkgconfig_2.0.3      zeallot_0.1.0        Matrix_1.2-17       
#> [57] xml2_1.2.2           httr_1.4.1           R6_2.4.1             mclust_5.4.5        
#> [61] compiler_3.6.0