cola Report for GDS4549

Date: 2019-12-25 21:41:08 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 27425 rows and 116 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] 27425   116

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 Optional k
SD:skmeans 2 1.000 0.976 0.990 **
MAD:skmeans 2 1.000 0.976 0.990 **
ATC:kmeans 2 1.000 0.995 0.998 **
ATC:mclust 2 1.000 0.988 0.995 **
ATC:NMF 2 1.000 0.963 0.985 **
ATC:pam 4 0.979 0.947 0.977 ** 2
CV:skmeans 2 0.947 0.947 0.979 *
CV:NMF 2 0.945 0.948 0.976 *
CV:mclust 2 0.945 0.934 0.973 *
ATC:skmeans 4 0.918 0.889 0.939 * 2
SD:NMF 2 0.912 0.940 0.974 *
SD:kmeans 2 0.861 0.930 0.967
MAD:NMF 2 0.844 0.919 0.965
MAD:kmeans 2 0.838 0.910 0.951
MAD:mclust 6 0.832 0.787 0.894
CV:kmeans 2 0.821 0.908 0.927
SD:mclust 2 0.702 0.930 0.926
SD:pam 2 0.615 0.873 0.935
MAD:hclust 2 0.576 0.824 0.915
CV:hclust 4 0.544 0.779 0.865
CV:pam 4 0.538 0.681 0.853
MAD:pam 2 0.528 0.741 0.895
SD:hclust 4 0.473 0.703 0.789
ATC:hclust 2 0.354 0.697 0.867

**: 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.912           0.940       0.974          0.501 0.498   0.498
#> CV:NMF      2 0.945           0.948       0.976          0.501 0.499   0.499
#> MAD:NMF     2 0.844           0.919       0.965          0.499 0.499   0.499
#> ATC:NMF     2 1.000           0.963       0.985          0.504 0.496   0.496
#> SD:skmeans  2 1.000           0.976       0.990          0.504 0.496   0.496
#> CV:skmeans  2 0.947           0.947       0.979          0.505 0.496   0.496
#> MAD:skmeans 2 1.000           0.976       0.990          0.504 0.496   0.496
#> ATC:skmeans 2 1.000           0.998       0.999          0.504 0.496   0.496
#> SD:mclust   2 0.702           0.930       0.926          0.465 0.521   0.521
#> CV:mclust   2 0.945           0.934       0.973          0.124 0.886   0.886
#> MAD:mclust  2 0.466           0.800       0.867          0.460 0.529   0.529
#> ATC:mclust  2 1.000           0.988       0.995          0.502 0.498   0.498
#> SD:kmeans   2 0.861           0.930       0.967          0.497 0.497   0.497
#> CV:kmeans   2 0.821           0.908       0.927          0.465 0.498   0.498
#> MAD:kmeans  2 0.838           0.910       0.951          0.487 0.517   0.517
#> ATC:kmeans  2 1.000           0.995       0.998          0.504 0.496   0.496
#> SD:pam      2 0.615           0.873       0.935          0.495 0.503   0.503
#> CV:pam      2 0.510           0.627       0.843          0.490 0.503   0.503
#> MAD:pam     2 0.528           0.741       0.895          0.497 0.497   0.497
#> ATC:pam     2 1.000           0.979       0.992          0.501 0.499   0.499
#> SD:hclust   2 0.208           0.725       0.810          0.417 0.544   0.544
#> CV:hclust   2 0.537           0.904       0.903          0.148 0.933   0.933
#> MAD:hclust  2 0.576           0.824       0.915          0.454 0.544   0.544
#> ATC:hclust  2 0.354           0.697       0.867          0.448 0.505   0.505
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.670           0.801       0.910          0.305 0.767   0.566
#> CV:NMF      3 0.684           0.822       0.906          0.304 0.769   0.569
#> MAD:NMF     3 0.677           0.775       0.902          0.307 0.752   0.547
#> ATC:NMF     3 0.541           0.706       0.818          0.269 0.867   0.736
#> SD:skmeans  3 0.750           0.863       0.914          0.306 0.748   0.534
#> CV:skmeans  3 0.720           0.841       0.905          0.297 0.755   0.545
#> MAD:skmeans 3 0.754           0.855       0.920          0.307 0.728   0.505
#> ATC:skmeans 3 0.831           0.905       0.945          0.217 0.894   0.788
#> SD:mclust   3 0.416           0.573       0.723          0.320 0.766   0.579
#> CV:mclust   3 0.207           0.593       0.808          2.440 0.637   0.607
#> MAD:mclust  3 0.358           0.511       0.720          0.293 0.795   0.629
#> ATC:mclust  3 0.766           0.799       0.895          0.171 0.965   0.930
#> SD:kmeans   3 0.575           0.600       0.829          0.320 0.732   0.511
#> CV:kmeans   3 0.517           0.598       0.733          0.385 0.718   0.491
#> MAD:kmeans  3 0.592           0.728       0.843          0.348 0.760   0.559
#> ATC:kmeans  3 0.720           0.834       0.910          0.319 0.741   0.523
#> SD:pam      3 0.496           0.413       0.602          0.323 0.777   0.586
#> CV:pam      3 0.386           0.649       0.808          0.145 0.873   0.770
#> MAD:pam     3 0.445           0.562       0.771          0.326 0.737   0.521
#> ATC:pam     3 0.873           0.932       0.964          0.305 0.770   0.571
#> SD:hclust   3 0.354           0.457       0.754          0.418 0.731   0.546
#> CV:hclust   3 0.438           0.651       0.851          2.369 0.531   0.497
#> MAD:hclust  3 0.414           0.605       0.767          0.375 0.770   0.586
#> ATC:hclust  3 0.511           0.676       0.840          0.418 0.635   0.414
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.745           0.814       0.910         0.1123 0.852   0.613
#> CV:NMF      4 0.607           0.579       0.794         0.1012 0.802   0.519
#> MAD:NMF     4 0.690           0.752       0.873         0.1163 0.859   0.628
#> ATC:NMF     4 0.642           0.710       0.831         0.0992 0.843   0.618
#> SD:skmeans  4 0.698           0.745       0.819         0.1246 0.851   0.592
#> CV:skmeans  4 0.589           0.596       0.778         0.1233 0.900   0.720
#> MAD:skmeans 4 0.749           0.851       0.894         0.1309 0.845   0.578
#> ATC:skmeans 4 0.918           0.889       0.939         0.1130 0.922   0.805
#> SD:mclust   4 0.629           0.692       0.816         0.1475 0.824   0.574
#> CV:mclust   4 0.423           0.586       0.803         0.4388 0.669   0.482
#> MAD:mclust  4 0.394           0.424       0.680         0.1696 0.766   0.477
#> ATC:mclust  4 0.571           0.421       0.744         0.1791 0.866   0.718
#> SD:kmeans   4 0.552           0.607       0.724         0.1207 0.830   0.550
#> CV:kmeans   4 0.622           0.728       0.844         0.0947 0.933   0.809
#> MAD:kmeans  4 0.576           0.621       0.785         0.1268 0.862   0.616
#> ATC:kmeans  4 0.747           0.856       0.899         0.1227 0.795   0.475
#> SD:pam      4 0.639           0.607       0.788         0.1343 0.746   0.403
#> CV:pam      4 0.538           0.681       0.853         0.2045 0.780   0.566
#> MAD:pam     4 0.685           0.639       0.816         0.1227 0.854   0.617
#> ATC:pam     4 0.979           0.947       0.977         0.1105 0.911   0.749
#> SD:hclust   4 0.473           0.703       0.789         0.1561 0.777   0.505
#> CV:hclust   4 0.544           0.779       0.865         0.3603 0.720   0.469
#> MAD:hclust  4 0.490           0.598       0.770         0.1080 0.879   0.684
#> ATC:hclust  4 0.624           0.669       0.810         0.1490 0.838   0.587
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.609           0.587       0.769         0.0671 0.909   0.701
#> CV:NMF      5 0.672           0.608       0.794         0.0559 0.877   0.621
#> MAD:NMF     5 0.593           0.599       0.780         0.0746 0.877   0.601
#> ATC:NMF     5 0.561           0.609       0.757         0.0747 0.903   0.690
#> SD:skmeans  5 0.725           0.722       0.834         0.0612 0.906   0.652
#> CV:skmeans  5 0.614           0.603       0.747         0.0606 0.929   0.756
#> MAD:skmeans 5 0.777           0.750       0.871         0.0565 0.917   0.694
#> ATC:skmeans 5 0.790           0.667       0.833         0.0799 0.989   0.966
#> SD:mclust   5 0.712           0.582       0.809         0.1003 0.860   0.561
#> CV:mclust   5 0.615           0.746       0.812         0.1817 0.936   0.822
#> MAD:mclust  5 0.693           0.720       0.844         0.0870 0.858   0.571
#> ATC:mclust  5 0.593           0.436       0.681         0.0813 0.814   0.545
#> SD:kmeans   5 0.585           0.460       0.633         0.0673 0.903   0.648
#> CV:kmeans   5 0.566           0.514       0.712         0.0746 0.955   0.859
#> MAD:kmeans  5 0.642           0.587       0.739         0.0653 0.862   0.528
#> ATC:kmeans  5 0.724           0.588       0.760         0.0595 0.946   0.793
#> SD:pam      5 0.621           0.586       0.767         0.0308 0.917   0.703
#> CV:pam      5 0.575           0.621       0.807         0.1106 0.897   0.698
#> MAD:pam     5 0.665           0.679       0.818         0.0658 0.857   0.544
#> ATC:pam     5 0.878           0.843       0.929         0.0725 0.951   0.825
#> SD:hclust   5 0.492           0.576       0.719         0.0594 0.959   0.870
#> CV:hclust   5 0.574           0.732       0.787         0.0923 0.932   0.786
#> MAD:hclust  5 0.520           0.624       0.727         0.0617 0.921   0.753
#> ATC:hclust  5 0.712           0.645       0.819         0.0551 0.942   0.789
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.618           0.492       0.712         0.0427 0.920   0.688
#> CV:NMF      6 0.623           0.532       0.727         0.0482 0.909   0.670
#> MAD:NMF     6 0.594           0.448       0.607         0.0415 0.951   0.791
#> ATC:NMF     6 0.609           0.567       0.751         0.0523 0.898   0.630
#> SD:skmeans  6 0.755           0.703       0.803         0.0378 0.932   0.696
#> CV:skmeans  6 0.650           0.522       0.709         0.0417 0.907   0.645
#> MAD:skmeans 6 0.886           0.801       0.892         0.0370 0.931   0.703
#> ATC:skmeans 6 0.747           0.476       0.763         0.0540 0.908   0.716
#> SD:mclust   6 0.843           0.775       0.904         0.0472 0.897   0.580
#> CV:mclust   6 0.811           0.852       0.916         0.0962 0.836   0.518
#> MAD:mclust  6 0.832           0.787       0.894         0.0701 0.884   0.560
#> ATC:mclust  6 0.615           0.611       0.740         0.0544 0.833   0.493
#> SD:kmeans   6 0.664           0.545       0.683         0.0439 0.867   0.471
#> CV:kmeans   6 0.672           0.568       0.712         0.0620 0.839   0.495
#> MAD:kmeans  6 0.692           0.583       0.730         0.0457 0.929   0.672
#> ATC:kmeans  6 0.737           0.717       0.789         0.0361 0.920   0.679
#> SD:pam      6 0.712           0.513       0.770         0.0551 0.837   0.466
#> CV:pam      6 0.604           0.567       0.756         0.0691 0.909   0.674
#> MAD:pam     6 0.736           0.681       0.824         0.0327 0.956   0.800
#> ATC:pam     6 0.836           0.718       0.865         0.0340 0.970   0.873
#> SD:hclust   6 0.498           0.600       0.680         0.0589 0.958   0.855
#> CV:hclust   6 0.595           0.683       0.727         0.0576 0.955   0.826
#> MAD:hclust  6 0.530           0.583       0.639         0.0617 0.950   0.809
#> ATC:hclust  6 0.760           0.619       0.768         0.0340 0.903   0.636

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 disease.state(p) k
#> SD:NMF      113          0.02720 2
#> CV:NMF      115          0.05801 2
#> MAD:NMF     114          0.04030 2
#> ATC:NMF     115          0.00706 2
#> SD:skmeans  114          0.02080 2
#> CV:skmeans  113          0.02024 2
#> MAD:skmeans 115          0.01478 2
#> ATC:skmeans 116          0.00835 2
#> SD:mclust   115          0.06107 2
#> CV:mclust   113          0.06713 2
#> MAD:mclust  113          0.08641 2
#> ATC:mclust  115          0.02352 2
#> SD:kmeans   115          0.02576 2
#> CV:kmeans   112          0.07133 2
#> MAD:kmeans  114          0.05645 2
#> ATC:kmeans  116          0.00835 2
#> SD:pam      114          0.05460 2
#> CV:pam       82          0.00815 2
#> MAD:pam     101          0.14111 2
#> ATC:pam     114          0.00782 2
#> SD:hclust   102          0.16156 2
#> CV:hclust   116          0.01242 2
#> MAD:hclust  110          0.15104 2
#> ATC:hclust   97          0.01505 2
test_to_known_factors(res_list, k = 3)
#>               n disease.state(p) k
#> SD:NMF      107          0.02848 3
#> CV:NMF      110          0.00673 3
#> MAD:NMF     101          0.04363 3
#> ATC:NMF     104          0.15393 3
#> SD:skmeans  112          0.10850 3
#> CV:skmeans  109          0.01386 3
#> MAD:skmeans 108          0.05864 3
#> ATC:skmeans 112          0.00141 3
#> SD:mclust    61          0.44765 3
#> CV:mclust   100          0.00019 3
#> MAD:mclust   65          0.54267 3
#> ATC:mclust  100          0.05748 3
#> SD:kmeans    84          0.08498 3
#> CV:kmeans    85          0.00212 3
#> MAD:kmeans  111          0.03210 3
#> ATC:kmeans  109          0.03614 3
#> SD:pam       61          0.14258 3
#> CV:pam       93          0.00180 3
#> MAD:pam      88          0.00557 3
#> ATC:pam     115          0.01264 3
#> SD:hclust    78          0.19843 3
#> CV:hclust    86          0.01132 3
#> MAD:hclust   80          0.04549 3
#> ATC:hclust   91          0.22009 3
test_to_known_factors(res_list, k = 4)
#>               n disease.state(p) k
#> SD:NMF      107         3.38e-01 4
#> CV:NMF       83         2.51e-01 4
#> MAD:NMF     106         3.87e-01 4
#> ATC:NMF     102         4.07e-01 4
#> SD:skmeans  105         4.11e-02 4
#> CV:skmeans   87         1.60e-04 4
#> MAD:skmeans 112         8.91e-03 4
#> ATC:skmeans 111         2.04e-02 4
#> SD:mclust   102         1.40e-01 4
#> CV:mclust    77         2.82e-08 4
#> MAD:mclust   46         1.37e-01 4
#> ATC:mclust   77         1.17e-01 4
#> SD:kmeans    82         1.56e-03 4
#> CV:kmeans   110         6.10e-05 4
#> MAD:kmeans   92         1.35e-03 4
#> ATC:kmeans  114         5.67e-02 4
#> SD:pam       87         6.39e-02 4
#> CV:pam       95         4.25e-07 4
#> MAD:pam     102         8.82e-03 4
#> ATC:pam     114         3.16e-02 4
#> SD:hclust   110         2.16e-03 4
#> CV:hclust   104         1.03e-04 4
#> MAD:hclust   82         1.55e-03 4
#> ATC:hclust   90         3.44e-01 4
test_to_known_factors(res_list, k = 5)
#>               n disease.state(p) k
#> SD:NMF       82         1.36e-01 5
#> CV:NMF       81         1.63e-03 5
#> MAD:NMF      87         2.18e-01 5
#> ATC:NMF      90         1.15e-01 5
#> SD:skmeans   97         8.63e-02 5
#> CV:skmeans   87         4.17e-07 5
#> MAD:skmeans  99         1.01e-01 5
#> ATC:skmeans  93         2.05e-01 5
#> SD:mclust    69         1.72e-01 5
#> CV:mclust   110         2.31e-10 5
#> MAD:mclust  107         9.34e-02 5
#> ATC:mclust   59         1.12e-01 5
#> SD:kmeans    65         2.34e-05 5
#> CV:kmeans    91         2.40e-06 5
#> MAD:kmeans   78         4.51e-04 5
#> ATC:kmeans   82         1.07e-01 5
#> SD:pam       87         4.10e-03 5
#> CV:pam       92         4.46e-08 5
#> MAD:pam      97         2.30e-05 5
#> ATC:pam     109         6.15e-02 5
#> SD:hclust    78         1.06e-02 5
#> CV:hclust   104         6.66e-06 5
#> MAD:hclust   88         1.89e-03 5
#> ATC:hclust   73         4.13e-01 5
test_to_known_factors(res_list, k = 6)
#>               n disease.state(p) k
#> SD:NMF       68         1.17e-02 6
#> CV:NMF       69         3.11e-05 6
#> MAD:NMF      50         3.27e-01 6
#> ATC:NMF      85         2.30e-02 6
#> SD:skmeans   95         7.15e-03 6
#> CV:skmeans   80         1.89e-07 6
#> MAD:skmeans 108         5.83e-03 6
#> ATC:skmeans  58         1.51e-01 6
#> SD:mclust    99         8.71e-04 6
#> CV:mclust   113         4.66e-08 6
#> MAD:mclust  105         4.44e-04 6
#> ATC:mclust   98         4.64e-02 6
#> SD:kmeans    68         2.71e-05 6
#> CV:kmeans    81         2.82e-06 6
#> MAD:kmeans   78         1.52e-04 6
#> ATC:kmeans  103         6.00e-02 6
#> SD:pam       69         1.23e-04 6
#> CV:pam       83         2.80e-08 6
#> MAD:pam      99         2.37e-05 6
#> ATC:pam      96         6.75e-03 6
#> SD:hclust    88         5.68e-03 6
#> CV:hclust   103         8.91e-08 6
#> MAD:hclust   83         7.13e-05 6
#> ATC:hclust   83         3.16e-01 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 27425 rows and 116 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 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 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.208           0.725       0.810         0.4171 0.544   0.544
#> 3 3 0.354           0.457       0.754         0.4177 0.731   0.546
#> 4 4 0.473           0.703       0.789         0.1561 0.777   0.505
#> 5 5 0.492           0.576       0.719         0.0594 0.959   0.870
#> 6 6 0.498           0.600       0.680         0.0589 0.958   0.855

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
#> GSM613638     2  0.9552     0.4942 0.376 0.624
#> GSM613639     1  0.9866     0.2376 0.568 0.432
#> GSM613640     2  0.9954     0.2429 0.460 0.540
#> GSM613641     1  0.4690     0.9077 0.900 0.100
#> GSM613642     2  0.5519     0.7822 0.128 0.872
#> GSM613643     2  0.9998     0.1090 0.492 0.508
#> GSM613644     2  0.9993     0.1454 0.484 0.516
#> GSM613645     1  0.8386     0.6848 0.732 0.268
#> GSM613646     2  0.8499     0.6756 0.276 0.724
#> GSM613647     2  0.8267     0.6676 0.260 0.740
#> GSM613648     2  0.7453     0.7172 0.212 0.788
#> GSM613649     2  0.0376     0.7822 0.004 0.996
#> GSM613650     2  0.9775     0.4415 0.412 0.588
#> GSM613651     1  0.9988     0.0191 0.520 0.480
#> GSM613652     1  0.4690     0.9077 0.900 0.100
#> GSM613653     2  0.9661     0.4937 0.392 0.608
#> GSM613654     1  0.4690     0.9077 0.900 0.100
#> GSM613655     1  0.4690     0.9077 0.900 0.100
#> GSM613656     1  0.4690     0.9077 0.900 0.100
#> GSM613657     2  0.0376     0.7822 0.004 0.996
#> GSM613658     1  0.4690     0.9077 0.900 0.100
#> GSM613659     2  0.8016     0.7108 0.244 0.756
#> GSM613660     2  0.2603     0.7949 0.044 0.956
#> GSM613661     1  0.4690     0.9077 0.900 0.100
#> GSM613662     2  0.2778     0.7947 0.048 0.952
#> GSM613663     1  0.4690     0.9077 0.900 0.100
#> GSM613664     2  0.2948     0.7952 0.052 0.948
#> GSM613665     2  0.2778     0.7947 0.048 0.952
#> GSM613666     1  0.4690     0.9077 0.900 0.100
#> GSM613667     1  0.8386     0.6848 0.732 0.268
#> GSM613668     1  0.4690     0.9077 0.900 0.100
#> GSM613669     1  0.4690     0.9077 0.900 0.100
#> GSM613670     2  0.2778     0.7947 0.048 0.952
#> GSM613671     1  0.4690     0.9077 0.900 0.100
#> GSM613672     1  0.4690     0.9077 0.900 0.100
#> GSM613673     1  0.5059     0.9014 0.888 0.112
#> GSM613674     2  0.2778     0.7947 0.048 0.952
#> GSM613675     2  0.3584     0.7931 0.068 0.932
#> GSM613676     2  0.2778     0.7947 0.048 0.952
#> GSM613677     2  0.7674     0.7369 0.224 0.776
#> GSM613678     2  0.8327     0.7012 0.264 0.736
#> GSM613679     2  0.2778     0.7947 0.048 0.952
#> GSM613680     1  0.4690     0.9077 0.900 0.100
#> GSM613681     1  0.4815     0.9060 0.896 0.104
#> GSM613682     1  0.6712     0.8391 0.824 0.176
#> GSM613683     1  0.4690     0.9077 0.900 0.100
#> GSM613684     2  0.2603     0.7946 0.044 0.956
#> GSM613685     2  0.2778     0.7947 0.048 0.952
#> GSM613686     1  0.7602     0.7782 0.780 0.220
#> GSM613687     1  0.4815     0.9060 0.896 0.104
#> GSM613688     2  0.2778     0.7957 0.048 0.952
#> GSM613689     2  0.7745     0.7073 0.228 0.772
#> GSM613690     2  0.5946     0.7623 0.144 0.856
#> GSM613691     2  0.6343     0.7661 0.160 0.840
#> GSM613692     1  0.9393     0.5060 0.644 0.356
#> GSM613693     2  0.2603     0.7946 0.044 0.956
#> GSM613694     2  0.7883     0.7001 0.236 0.764
#> GSM613695     2  0.8081     0.6814 0.248 0.752
#> GSM613696     2  0.7602     0.7325 0.220 0.780
#> GSM613697     1  0.9988     0.0191 0.520 0.480
#> GSM613698     2  0.9170     0.5815 0.332 0.668
#> GSM613699     2  0.7745     0.7073 0.228 0.772
#> GSM613700     2  0.2778     0.7947 0.048 0.952
#> GSM613701     2  0.9608     0.5048 0.384 0.616
#> GSM613702     2  0.9552     0.5224 0.376 0.624
#> GSM613703     1  0.4939     0.9038 0.892 0.108
#> GSM613704     2  0.2778     0.7947 0.048 0.952
#> GSM613705     2  0.9522     0.5001 0.372 0.628
#> GSM613706     2  0.9608     0.5048 0.384 0.616
#> GSM613707     2  0.2778     0.7947 0.048 0.952
#> GSM613708     1  0.7299     0.8171 0.796 0.204
#> GSM613709     1  0.4690     0.9077 0.900 0.100
#> GSM613710     2  0.2603     0.7949 0.044 0.956
#> GSM613711     2  0.0376     0.7822 0.004 0.996
#> GSM613712     2  0.9686     0.4092 0.396 0.604
#> GSM613713     2  0.2603     0.7946 0.044 0.956
#> GSM613714     2  0.8081     0.6814 0.248 0.752
#> GSM613715     2  0.5629     0.7669 0.132 0.868
#> GSM613716     2  0.7376     0.7217 0.208 0.792
#> GSM613717     2  0.0376     0.7822 0.004 0.996
#> GSM613718     2  0.0376     0.7822 0.004 0.996
#> GSM613719     2  0.9661     0.4937 0.392 0.608
#> GSM613720     2  0.2423     0.7928 0.040 0.960
#> GSM613721     2  0.4298     0.7921 0.088 0.912
#> GSM613722     2  0.3584     0.7947 0.068 0.932
#> GSM613723     1  0.4690     0.9077 0.900 0.100
#> GSM613724     1  0.4690     0.9077 0.900 0.100
#> GSM613725     2  0.2778     0.7947 0.048 0.952
#> GSM613726     1  0.9393     0.4625 0.644 0.356
#> GSM613727     1  0.4690     0.9077 0.900 0.100
#> GSM613728     2  0.7056     0.7541 0.192 0.808
#> GSM613729     1  0.4939     0.9038 0.892 0.108
#> GSM613730     2  0.7883     0.7244 0.236 0.764
#> GSM613731     2  0.9998     0.1090 0.492 0.508
#> GSM613732     2  0.0376     0.7822 0.004 0.996
#> GSM613733     2  0.0376     0.7822 0.004 0.996
#> GSM613734     1  0.4690     0.9077 0.900 0.100
#> GSM613735     1  0.4690     0.9077 0.900 0.100
#> GSM613736     2  0.0376     0.7831 0.004 0.996
#> GSM613737     2  0.8499     0.6486 0.276 0.724
#> GSM613738     1  0.5946     0.8783 0.856 0.144
#> GSM613739     1  0.5946     0.8783 0.856 0.144
#> GSM613740     2  0.0376     0.7822 0.004 0.996
#> GSM613741     2  0.9661     0.4937 0.392 0.608
#> GSM613742     1  0.5946     0.8783 0.856 0.144
#> GSM613743     2  0.0376     0.7831 0.004 0.996
#> GSM613744     2  0.0376     0.7822 0.004 0.996
#> GSM613745     2  0.8499     0.6756 0.276 0.724
#> GSM613746     2  0.2778     0.7947 0.048 0.952
#> GSM613747     1  0.4690     0.9077 0.900 0.100
#> GSM613748     2  0.7883     0.7244 0.236 0.764
#> GSM613749     2  0.9608     0.5061 0.384 0.616
#> GSM613750     2  0.4690     0.6926 0.100 0.900
#> GSM613751     2  0.4690     0.6926 0.100 0.900
#> GSM613752     2  0.4690     0.6926 0.100 0.900
#> GSM613753     2  0.4690     0.6926 0.100 0.900

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM613638     3  0.9776     0.4080 0.380 0.232 0.388
#> GSM613639     1  0.8571     0.1877 0.588 0.140 0.272
#> GSM613640     1  0.9354    -0.1840 0.472 0.176 0.352
#> GSM613641     1  0.0237     0.7750 0.996 0.004 0.000
#> GSM613642     2  0.6306     0.4576 0.052 0.748 0.200
#> GSM613643     1  0.9207    -0.0757 0.508 0.172 0.320
#> GSM613644     1  0.9118    -0.1027 0.496 0.152 0.352
#> GSM613645     1  0.6000     0.5709 0.760 0.040 0.200
#> GSM613646     2  0.9589    -0.3096 0.200 0.424 0.376
#> GSM613647     3  0.9007     0.6297 0.268 0.180 0.552
#> GSM613648     3  0.9578     0.5887 0.248 0.272 0.480
#> GSM613649     2  0.5254     0.5137 0.000 0.736 0.264
#> GSM613650     1  0.9916    -0.3856 0.396 0.288 0.316
#> GSM613651     1  0.8346     0.0405 0.548 0.092 0.360
#> GSM613652     1  0.0000     0.7746 1.000 0.000 0.000
#> GSM613653     1  0.9950    -0.4184 0.372 0.288 0.340
#> GSM613654     1  0.0000     0.7746 1.000 0.000 0.000
#> GSM613655     1  0.0000     0.7746 1.000 0.000 0.000
#> GSM613656     1  0.0000     0.7746 1.000 0.000 0.000
#> GSM613657     2  0.5138     0.5198 0.000 0.748 0.252
#> GSM613658     1  0.0237     0.7750 0.996 0.004 0.000
#> GSM613659     2  0.9243    -0.1696 0.168 0.492 0.340
#> GSM613660     2  0.0237     0.6604 0.000 0.996 0.004
#> GSM613661     1  0.0475     0.7747 0.992 0.004 0.004
#> GSM613662     2  0.0424     0.6587 0.000 0.992 0.008
#> GSM613663     1  0.0237     0.7747 0.996 0.000 0.004
#> GSM613664     2  0.0892     0.6589 0.000 0.980 0.020
#> GSM613665     2  0.0592     0.6606 0.000 0.988 0.012
#> GSM613666     1  0.0237     0.7750 0.996 0.004 0.000
#> GSM613667     1  0.5660     0.5807 0.772 0.028 0.200
#> GSM613668     1  0.0000     0.7746 1.000 0.000 0.000
#> GSM613669     1  0.0237     0.7750 0.996 0.004 0.000
#> GSM613670     2  0.0424     0.6587 0.000 0.992 0.008
#> GSM613671     1  0.0237     0.7750 0.996 0.004 0.000
#> GSM613672     1  0.0237     0.7747 0.996 0.000 0.004
#> GSM613673     1  0.1315     0.7693 0.972 0.008 0.020
#> GSM613674     2  0.0000     0.6595 0.000 1.000 0.000
#> GSM613675     2  0.1315     0.6527 0.020 0.972 0.008
#> GSM613676     2  0.0592     0.6606 0.000 0.988 0.012
#> GSM613677     2  0.9046    -0.1201 0.152 0.516 0.332
#> GSM613678     2  0.9207    -0.1383 0.172 0.508 0.320
#> GSM613679     2  0.0237     0.6605 0.000 0.996 0.004
#> GSM613680     1  0.0237     0.7747 0.996 0.000 0.004
#> GSM613681     1  0.0983     0.7711 0.980 0.016 0.004
#> GSM613682     1  0.2860     0.7187 0.912 0.084 0.004
#> GSM613683     1  0.0237     0.7747 0.996 0.000 0.004
#> GSM613684     2  0.0892     0.6600 0.000 0.980 0.020
#> GSM613685     2  0.0000     0.6595 0.000 1.000 0.000
#> GSM613686     1  0.5053     0.6113 0.812 0.164 0.024
#> GSM613687     1  0.0983     0.7711 0.980 0.016 0.004
#> GSM613688     2  0.1031     0.6588 0.000 0.976 0.024
#> GSM613689     3  0.9122     0.5623 0.184 0.280 0.536
#> GSM613690     3  0.8858     0.4494 0.136 0.332 0.532
#> GSM613691     2  0.7984     0.2517 0.132 0.652 0.216
#> GSM613692     1  0.7263     0.4149 0.692 0.084 0.224
#> GSM613693     2  0.0747     0.6606 0.000 0.984 0.016
#> GSM613694     3  0.9061     0.5762 0.188 0.264 0.548
#> GSM613695     3  0.9045     0.6304 0.256 0.192 0.552
#> GSM613696     2  0.9098    -0.1500 0.148 0.492 0.360
#> GSM613697     1  0.8346     0.0405 0.548 0.092 0.360
#> GSM613698     3  0.9273     0.4957 0.364 0.164 0.472
#> GSM613699     3  0.9122     0.5623 0.184 0.280 0.536
#> GSM613700     2  0.0000     0.6595 0.000 1.000 0.000
#> GSM613701     2  0.9941    -0.3529 0.340 0.376 0.284
#> GSM613702     2  0.9961    -0.3615 0.332 0.372 0.296
#> GSM613703     1  0.1636     0.7654 0.964 0.020 0.016
#> GSM613704     2  0.0237     0.6578 0.000 0.996 0.004
#> GSM613705     3  0.9669     0.4125 0.380 0.212 0.408
#> GSM613706     2  0.9941    -0.3529 0.340 0.376 0.284
#> GSM613707     2  0.0747     0.6599 0.000 0.984 0.016
#> GSM613708     1  0.4609     0.6677 0.856 0.092 0.052
#> GSM613709     1  0.0237     0.7750 0.996 0.004 0.000
#> GSM613710     2  0.0237     0.6604 0.000 0.996 0.004
#> GSM613711     2  0.5016     0.5304 0.000 0.760 0.240
#> GSM613712     3  0.9221     0.3932 0.404 0.152 0.444
#> GSM613713     2  0.0237     0.6604 0.000 0.996 0.004
#> GSM613714     3  0.9055     0.6292 0.252 0.196 0.552
#> GSM613715     3  0.8841     0.4346 0.132 0.340 0.528
#> GSM613716     3  0.9783     0.5526 0.256 0.312 0.432
#> GSM613717     2  0.5058     0.5269 0.000 0.756 0.244
#> GSM613718     2  0.5178     0.5156 0.000 0.744 0.256
#> GSM613719     1  0.9950    -0.4184 0.372 0.288 0.340
#> GSM613720     2  0.3116     0.6167 0.000 0.892 0.108
#> GSM613721     2  0.5047     0.5376 0.036 0.824 0.140
#> GSM613722     2  0.3112     0.6002 0.004 0.900 0.096
#> GSM613723     1  0.0000     0.7746 1.000 0.000 0.000
#> GSM613724     1  0.0475     0.7747 0.992 0.004 0.004
#> GSM613725     2  0.0000     0.6595 0.000 1.000 0.000
#> GSM613726     1  0.7548     0.4164 0.684 0.112 0.204
#> GSM613727     1  0.0000     0.7746 1.000 0.000 0.000
#> GSM613728     2  0.7666     0.2696 0.148 0.684 0.168
#> GSM613729     1  0.1636     0.7654 0.964 0.020 0.016
#> GSM613730     2  0.8995    -0.0836 0.152 0.528 0.320
#> GSM613731     1  0.9207    -0.0757 0.508 0.172 0.320
#> GSM613732     2  0.5138     0.5198 0.000 0.748 0.252
#> GSM613733     2  0.4750     0.5442 0.000 0.784 0.216
#> GSM613734     1  0.0000     0.7746 1.000 0.000 0.000
#> GSM613735     1  0.0000     0.7746 1.000 0.000 0.000
#> GSM613736     2  0.4931     0.5373 0.000 0.768 0.232
#> GSM613737     3  0.9066     0.6282 0.284 0.176 0.540
#> GSM613738     1  0.2165     0.7458 0.936 0.000 0.064
#> GSM613739     1  0.2165     0.7458 0.936 0.000 0.064
#> GSM613740     2  0.5098     0.5299 0.000 0.752 0.248
#> GSM613741     1  0.9950    -0.4184 0.372 0.288 0.340
#> GSM613742     1  0.2165     0.7458 0.936 0.000 0.064
#> GSM613743     2  0.4931     0.5373 0.000 0.768 0.232
#> GSM613744     2  0.5216     0.5183 0.000 0.740 0.260
#> GSM613745     2  0.9589    -0.3096 0.200 0.424 0.376
#> GSM613746     2  0.0237     0.6578 0.000 0.996 0.004
#> GSM613747     1  0.0000     0.7746 1.000 0.000 0.000
#> GSM613748     2  0.9108    -0.1023 0.164 0.520 0.316
#> GSM613749     2  0.9972    -0.3673 0.336 0.364 0.300
#> GSM613750     3  0.4504     0.2279 0.000 0.196 0.804
#> GSM613751     3  0.4504     0.2279 0.000 0.196 0.804
#> GSM613752     3  0.4504     0.2279 0.000 0.196 0.804
#> GSM613753     3  0.4504     0.2279 0.000 0.196 0.804

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM613638     3  0.6012     0.6915 0.232 0.056 0.692 0.020
#> GSM613639     3  0.5229     0.3597 0.428 0.008 0.564 0.000
#> GSM613640     3  0.4980     0.6030 0.304 0.016 0.680 0.000
#> GSM613641     1  0.0895     0.8952 0.976 0.000 0.020 0.004
#> GSM613642     2  0.5754     0.3997 0.004 0.572 0.400 0.024
#> GSM613643     3  0.5057     0.5535 0.340 0.012 0.648 0.000
#> GSM613644     3  0.4897     0.5611 0.332 0.008 0.660 0.000
#> GSM613645     1  0.4343     0.5841 0.732 0.000 0.264 0.004
#> GSM613646     3  0.3731     0.6627 0.036 0.120 0.844 0.000
#> GSM613647     3  0.4992     0.6606 0.100 0.008 0.788 0.104
#> GSM613648     3  0.6528     0.6288 0.088 0.080 0.716 0.116
#> GSM613649     2  0.7031     0.5786 0.000 0.520 0.348 0.132
#> GSM613650     3  0.4644     0.6824 0.208 0.024 0.764 0.004
#> GSM613651     3  0.5220     0.5219 0.352 0.000 0.632 0.016
#> GSM613652     1  0.0804     0.8936 0.980 0.000 0.008 0.012
#> GSM613653     3  0.4406     0.6928 0.184 0.024 0.788 0.004
#> GSM613654     1  0.0804     0.8936 0.980 0.000 0.008 0.012
#> GSM613655     1  0.0469     0.8932 0.988 0.000 0.000 0.012
#> GSM613656     1  0.0804     0.8936 0.980 0.000 0.008 0.012
#> GSM613657     2  0.6993     0.5924 0.000 0.532 0.336 0.132
#> GSM613658     1  0.0804     0.8959 0.980 0.000 0.008 0.012
#> GSM613659     3  0.4446     0.6137 0.028 0.196 0.776 0.000
#> GSM613660     2  0.2593     0.7668 0.000 0.904 0.080 0.016
#> GSM613661     1  0.0817     0.8946 0.976 0.000 0.024 0.000
#> GSM613662     2  0.3390     0.7468 0.000 0.852 0.132 0.016
#> GSM613663     1  0.0188     0.8962 0.996 0.000 0.004 0.000
#> GSM613664     2  0.3249     0.7558 0.000 0.852 0.140 0.008
#> GSM613665     2  0.2741     0.7706 0.000 0.892 0.096 0.012
#> GSM613666     1  0.0895     0.8952 0.976 0.000 0.020 0.004
#> GSM613667     1  0.4103     0.5973 0.744 0.000 0.256 0.000
#> GSM613668     1  0.0469     0.8932 0.988 0.000 0.000 0.012
#> GSM613669     1  0.0895     0.8952 0.976 0.000 0.020 0.004
#> GSM613670     2  0.3390     0.7468 0.000 0.852 0.132 0.016
#> GSM613671     1  0.0895     0.8952 0.976 0.000 0.020 0.004
#> GSM613672     1  0.0188     0.8962 0.996 0.000 0.004 0.000
#> GSM613673     1  0.1042     0.8928 0.972 0.008 0.020 0.000
#> GSM613674     2  0.0657     0.7429 0.000 0.984 0.004 0.012
#> GSM613675     2  0.4276     0.7470 0.004 0.788 0.192 0.016
#> GSM613676     2  0.2741     0.7706 0.000 0.892 0.096 0.012
#> GSM613677     3  0.5849     0.5070 0.020 0.276 0.672 0.032
#> GSM613678     3  0.4979     0.5929 0.032 0.224 0.740 0.004
#> GSM613679     2  0.1452     0.7584 0.000 0.956 0.036 0.008
#> GSM613680     1  0.0188     0.8962 0.996 0.000 0.004 0.000
#> GSM613681     1  0.1004     0.8932 0.972 0.000 0.024 0.004
#> GSM613682     1  0.3354     0.8092 0.872 0.044 0.084 0.000
#> GSM613683     1  0.0188     0.8962 0.996 0.000 0.004 0.000
#> GSM613684     2  0.2741     0.7695 0.000 0.892 0.096 0.012
#> GSM613685     2  0.0657     0.7429 0.000 0.984 0.004 0.012
#> GSM613686     1  0.5321     0.6719 0.756 0.096 0.144 0.004
#> GSM613687     1  0.1004     0.8932 0.972 0.000 0.024 0.004
#> GSM613688     2  0.3032     0.7700 0.000 0.868 0.124 0.008
#> GSM613689     3  0.4958     0.6378 0.032 0.056 0.804 0.108
#> GSM613690     3  0.6235     0.5616 0.032 0.124 0.720 0.124
#> GSM613691     3  0.5786     0.1409 0.028 0.380 0.588 0.004
#> GSM613692     1  0.5294    -0.1199 0.508 0.000 0.484 0.008
#> GSM613693     2  0.3108     0.7715 0.000 0.872 0.112 0.016
#> GSM613694     3  0.4808     0.6425 0.036 0.044 0.812 0.108
#> GSM613695     3  0.5054     0.6571 0.092 0.012 0.788 0.108
#> GSM613696     3  0.4939     0.5676 0.040 0.220 0.740 0.000
#> GSM613697     3  0.5220     0.5219 0.352 0.000 0.632 0.016
#> GSM613698     3  0.5673     0.6810 0.200 0.008 0.720 0.072
#> GSM613699     3  0.4958     0.6378 0.032 0.056 0.804 0.108
#> GSM613700     2  0.1488     0.7553 0.000 0.956 0.032 0.012
#> GSM613701     3  0.7120     0.6151 0.208 0.204 0.584 0.004
#> GSM613702     3  0.6964     0.6270 0.200 0.192 0.604 0.004
#> GSM613703     1  0.1902     0.8770 0.932 0.000 0.064 0.004
#> GSM613704     2  0.3335     0.7476 0.000 0.856 0.128 0.016
#> GSM613705     3  0.5763     0.6956 0.200 0.052 0.724 0.024
#> GSM613706     3  0.7058     0.6194 0.208 0.196 0.592 0.004
#> GSM613707     2  0.1584     0.7562 0.000 0.952 0.036 0.012
#> GSM613708     1  0.4456     0.5767 0.716 0.004 0.280 0.000
#> GSM613709     1  0.0895     0.8952 0.976 0.000 0.020 0.004
#> GSM613710     2  0.2593     0.7668 0.000 0.904 0.080 0.016
#> GSM613711     2  0.6835     0.6252 0.000 0.560 0.316 0.124
#> GSM613712     3  0.5187     0.6826 0.212 0.008 0.740 0.040
#> GSM613713     2  0.2546     0.7712 0.000 0.900 0.092 0.008
#> GSM613714     3  0.4992     0.6564 0.088 0.012 0.792 0.108
#> GSM613715     3  0.6243     0.5468 0.028 0.132 0.716 0.124
#> GSM613716     3  0.6834     0.6290 0.096 0.112 0.696 0.096
#> GSM613717     2  0.6894     0.6167 0.000 0.552 0.320 0.128
#> GSM613718     2  0.6993     0.5935 0.000 0.532 0.336 0.132
#> GSM613719     3  0.4406     0.6928 0.184 0.024 0.788 0.004
#> GSM613720     2  0.5272     0.7297 0.000 0.744 0.172 0.084
#> GSM613721     2  0.4820     0.5569 0.000 0.692 0.296 0.012
#> GSM613722     2  0.3539     0.7019 0.000 0.820 0.176 0.004
#> GSM613723     1  0.0804     0.8936 0.980 0.000 0.008 0.012
#> GSM613724     1  0.0817     0.8946 0.976 0.000 0.024 0.000
#> GSM613725     2  0.1488     0.7553 0.000 0.956 0.032 0.012
#> GSM613726     1  0.5203     0.0994 0.576 0.008 0.416 0.000
#> GSM613727     1  0.0469     0.8932 0.988 0.000 0.000 0.012
#> GSM613728     3  0.5754     0.1207 0.016 0.428 0.548 0.008
#> GSM613729     1  0.1902     0.8770 0.932 0.000 0.064 0.004
#> GSM613730     3  0.4927     0.5398 0.016 0.268 0.712 0.004
#> GSM613731     3  0.5057     0.5535 0.340 0.012 0.648 0.000
#> GSM613732     2  0.6993     0.5924 0.000 0.532 0.336 0.132
#> GSM613733     2  0.6538     0.6521 0.000 0.600 0.292 0.108
#> GSM613734     1  0.0804     0.8936 0.980 0.000 0.008 0.012
#> GSM613735     1  0.0804     0.8936 0.980 0.000 0.008 0.012
#> GSM613736     2  0.6627     0.6404 0.000 0.588 0.300 0.112
#> GSM613737     3  0.5274     0.6571 0.120 0.008 0.768 0.104
#> GSM613738     1  0.3257     0.7786 0.844 0.000 0.152 0.004
#> GSM613739     1  0.3257     0.7786 0.844 0.000 0.152 0.004
#> GSM613740     2  0.6852     0.6205 0.000 0.556 0.320 0.124
#> GSM613741     3  0.4406     0.6928 0.184 0.024 0.788 0.004
#> GSM613742     1  0.3257     0.7786 0.844 0.000 0.152 0.004
#> GSM613743     2  0.6765     0.6350 0.000 0.576 0.300 0.124
#> GSM613744     2  0.7019     0.5850 0.000 0.524 0.344 0.132
#> GSM613745     3  0.3731     0.6627 0.036 0.120 0.844 0.000
#> GSM613746     2  0.3616     0.7602 0.000 0.852 0.112 0.036
#> GSM613747     1  0.0804     0.8936 0.980 0.000 0.008 0.012
#> GSM613748     3  0.5142     0.5553 0.028 0.256 0.712 0.004
#> GSM613749     3  0.6928     0.6307 0.204 0.184 0.608 0.004
#> GSM613750     4  0.1661     1.0000 0.000 0.004 0.052 0.944
#> GSM613751     4  0.1661     1.0000 0.000 0.004 0.052 0.944
#> GSM613752     4  0.1661     1.0000 0.000 0.004 0.052 0.944
#> GSM613753     4  0.1661     1.0000 0.000 0.004 0.052 0.944

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     4  0.5860     0.6574 0.208 0.064 0.028 0.680 0.020
#> GSM613639     4  0.4819     0.3867 0.404 0.008 0.012 0.576 0.000
#> GSM613640     4  0.4516     0.6118 0.276 0.016 0.012 0.696 0.000
#> GSM613641     1  0.1168     0.8925 0.960 0.000 0.008 0.032 0.000
#> GSM613642     2  0.6324     0.0385 0.004 0.544 0.092 0.340 0.020
#> GSM613643     4  0.4502     0.5653 0.312 0.012 0.008 0.668 0.000
#> GSM613644     4  0.4483     0.5719 0.308 0.008 0.012 0.672 0.000
#> GSM613645     1  0.3885     0.5758 0.724 0.000 0.008 0.268 0.000
#> GSM613646     4  0.4462     0.6181 0.028 0.088 0.092 0.792 0.000
#> GSM613647     4  0.3671     0.6423 0.060 0.000 0.024 0.844 0.072
#> GSM613648     4  0.5142     0.5867 0.048 0.068 0.028 0.776 0.080
#> GSM613649     2  0.7930     0.3955 0.000 0.392 0.180 0.324 0.104
#> GSM613650     4  0.4837     0.6469 0.176 0.004 0.092 0.728 0.000
#> GSM613651     4  0.5036     0.5583 0.304 0.000 0.040 0.648 0.008
#> GSM613652     1  0.1630     0.8845 0.944 0.000 0.004 0.036 0.016
#> GSM613653     4  0.4612     0.6557 0.152 0.004 0.092 0.752 0.000
#> GSM613654     1  0.1630     0.8845 0.944 0.000 0.004 0.036 0.016
#> GSM613655     1  0.0854     0.8905 0.976 0.000 0.008 0.004 0.012
#> GSM613656     1  0.1630     0.8845 0.944 0.000 0.004 0.036 0.016
#> GSM613657     2  0.7933     0.4021 0.000 0.400 0.184 0.312 0.104
#> GSM613658     1  0.1299     0.8937 0.960 0.000 0.012 0.020 0.008
#> GSM613659     4  0.5257     0.5713 0.020 0.160 0.104 0.716 0.000
#> GSM613660     2  0.2227     0.3370 0.000 0.916 0.032 0.048 0.004
#> GSM613661     1  0.0703     0.8950 0.976 0.000 0.000 0.024 0.000
#> GSM613662     3  0.4925     0.6585 0.000 0.324 0.632 0.044 0.000
#> GSM613663     1  0.0162     0.8950 0.996 0.000 0.000 0.004 0.000
#> GSM613664     2  0.5386    -0.2925 0.000 0.544 0.396 0.060 0.000
#> GSM613665     2  0.4742     0.1712 0.000 0.716 0.220 0.060 0.004
#> GSM613666     1  0.1168     0.8925 0.960 0.000 0.008 0.032 0.000
#> GSM613667     1  0.3662     0.5970 0.744 0.000 0.004 0.252 0.000
#> GSM613668     1  0.0854     0.8905 0.976 0.000 0.008 0.004 0.012
#> GSM613669     1  0.1168     0.8925 0.960 0.000 0.008 0.032 0.000
#> GSM613670     3  0.4925     0.6585 0.000 0.324 0.632 0.044 0.000
#> GSM613671     1  0.1168     0.8925 0.960 0.000 0.008 0.032 0.000
#> GSM613672     1  0.0162     0.8950 0.996 0.000 0.000 0.004 0.000
#> GSM613673     1  0.0898     0.8943 0.972 0.008 0.000 0.020 0.000
#> GSM613674     2  0.2561     0.1985 0.000 0.856 0.144 0.000 0.000
#> GSM613675     3  0.6035     0.5582 0.004 0.316 0.556 0.124 0.000
#> GSM613676     2  0.4742     0.1712 0.000 0.716 0.220 0.060 0.004
#> GSM613677     4  0.6510     0.4724 0.012 0.224 0.124 0.612 0.028
#> GSM613678     4  0.5689     0.5346 0.024 0.184 0.116 0.676 0.000
#> GSM613679     2  0.3194     0.2181 0.000 0.832 0.148 0.020 0.000
#> GSM613680     1  0.0162     0.8950 0.996 0.000 0.000 0.004 0.000
#> GSM613681     1  0.1041     0.8935 0.964 0.000 0.004 0.032 0.000
#> GSM613682     1  0.3331     0.8179 0.864 0.032 0.032 0.072 0.000
#> GSM613683     1  0.0162     0.8950 0.996 0.000 0.000 0.004 0.000
#> GSM613684     2  0.4908     0.0287 0.000 0.636 0.320 0.044 0.000
#> GSM613685     2  0.2561     0.1985 0.000 0.856 0.144 0.000 0.000
#> GSM613686     1  0.5225     0.6786 0.740 0.072 0.056 0.132 0.000
#> GSM613687     1  0.1041     0.8935 0.964 0.000 0.004 0.032 0.000
#> GSM613688     2  0.5274    -0.1383 0.000 0.572 0.372 0.056 0.000
#> GSM613689     4  0.4458     0.5917 0.012 0.052 0.048 0.812 0.076
#> GSM613690     4  0.5428     0.5069 0.008 0.064 0.092 0.744 0.092
#> GSM613691     4  0.6591     0.2423 0.020 0.172 0.260 0.548 0.000
#> GSM613692     4  0.5254     0.1774 0.460 0.000 0.036 0.500 0.004
#> GSM613693     2  0.5309     0.1127 0.000 0.604 0.336 0.056 0.004
#> GSM613694     4  0.4268     0.6037 0.016 0.036 0.048 0.824 0.076
#> GSM613695     4  0.3755     0.6362 0.052 0.004 0.024 0.844 0.076
#> GSM613696     4  0.5612     0.5450 0.032 0.120 0.152 0.696 0.000
#> GSM613697     4  0.5036     0.5583 0.304 0.000 0.040 0.648 0.008
#> GSM613698     4  0.4962     0.6614 0.156 0.000 0.048 0.748 0.048
#> GSM613699     4  0.4458     0.5917 0.012 0.052 0.048 0.812 0.076
#> GSM613700     2  0.0451     0.3047 0.000 0.988 0.004 0.008 0.000
#> GSM613701     4  0.6983     0.5073 0.200 0.188 0.056 0.556 0.000
#> GSM613702     4  0.6816     0.5239 0.192 0.172 0.056 0.580 0.000
#> GSM613703     1  0.2124     0.8754 0.916 0.000 0.028 0.056 0.000
#> GSM613704     3  0.4857     0.6563 0.000 0.324 0.636 0.040 0.000
#> GSM613705     4  0.5854     0.6631 0.172 0.068 0.040 0.700 0.020
#> GSM613706     4  0.6869     0.5158 0.200 0.180 0.052 0.568 0.000
#> GSM613707     2  0.4339     0.0189 0.000 0.684 0.296 0.020 0.000
#> GSM613708     1  0.4296     0.5512 0.692 0.008 0.008 0.292 0.000
#> GSM613709     1  0.1168     0.8925 0.960 0.000 0.008 0.032 0.000
#> GSM613710     2  0.2227     0.3370 0.000 0.916 0.032 0.048 0.004
#> GSM613711     2  0.7802     0.4137 0.000 0.432 0.180 0.292 0.096
#> GSM613712     4  0.4906     0.6627 0.172 0.004 0.044 0.748 0.032
#> GSM613713     2  0.4452     0.2057 0.000 0.696 0.272 0.032 0.000
#> GSM613714     4  0.3685     0.6341 0.048 0.004 0.024 0.848 0.076
#> GSM613715     4  0.5598     0.4915 0.008 0.072 0.096 0.732 0.092
#> GSM613716     4  0.5991     0.5874 0.060 0.052 0.096 0.724 0.068
#> GSM613717     2  0.7848     0.4121 0.000 0.424 0.180 0.296 0.100
#> GSM613718     2  0.7933     0.4015 0.000 0.400 0.184 0.312 0.104
#> GSM613719     4  0.4612     0.6557 0.152 0.004 0.092 0.752 0.000
#> GSM613720     3  0.4608     0.4112 0.000 0.076 0.784 0.104 0.036
#> GSM613721     3  0.6696     0.2440 0.000 0.372 0.388 0.240 0.000
#> GSM613722     2  0.3980     0.1696 0.000 0.796 0.076 0.128 0.000
#> GSM613723     1  0.1630     0.8845 0.944 0.000 0.004 0.036 0.016
#> GSM613724     1  0.0703     0.8950 0.976 0.000 0.000 0.024 0.000
#> GSM613725     2  0.0451     0.3047 0.000 0.988 0.004 0.008 0.000
#> GSM613726     1  0.4481     0.0867 0.576 0.008 0.000 0.416 0.000
#> GSM613727     1  0.0854     0.8905 0.976 0.000 0.008 0.004 0.012
#> GSM613728     4  0.6803     0.1787 0.016 0.296 0.196 0.492 0.000
#> GSM613729     1  0.2124     0.8754 0.916 0.000 0.028 0.056 0.000
#> GSM613730     4  0.5561     0.4968 0.016 0.244 0.084 0.656 0.000
#> GSM613731     4  0.4502     0.5653 0.312 0.012 0.008 0.668 0.000
#> GSM613732     2  0.7933     0.4021 0.000 0.400 0.184 0.312 0.104
#> GSM613733     2  0.7451     0.4109 0.000 0.492 0.164 0.264 0.080
#> GSM613734     1  0.1630     0.8845 0.944 0.000 0.004 0.036 0.016
#> GSM613735     1  0.1630     0.8845 0.944 0.000 0.004 0.036 0.016
#> GSM613736     2  0.7497     0.4135 0.000 0.480 0.156 0.280 0.084
#> GSM613737     4  0.4227     0.6378 0.080 0.000 0.036 0.812 0.072
#> GSM613738     1  0.3716     0.7486 0.800 0.000 0.020 0.172 0.008
#> GSM613739     1  0.3716     0.7486 0.800 0.000 0.020 0.172 0.008
#> GSM613740     2  0.7753     0.4162 0.000 0.436 0.168 0.300 0.096
#> GSM613741     4  0.4612     0.6557 0.152 0.004 0.092 0.752 0.000
#> GSM613742     1  0.3716     0.7486 0.800 0.000 0.020 0.172 0.008
#> GSM613743     2  0.7674     0.4177 0.000 0.460 0.164 0.280 0.096
#> GSM613744     2  0.7944     0.3978 0.000 0.392 0.184 0.320 0.104
#> GSM613745     4  0.4462     0.6181 0.028 0.088 0.092 0.792 0.000
#> GSM613746     3  0.2077     0.5221 0.000 0.084 0.908 0.008 0.000
#> GSM613747     1  0.1630     0.8845 0.944 0.000 0.004 0.036 0.016
#> GSM613748     4  0.5710     0.5116 0.024 0.232 0.088 0.656 0.000
#> GSM613749     4  0.6781     0.5285 0.196 0.164 0.056 0.584 0.000
#> GSM613750     5  0.0510     1.0000 0.000 0.000 0.000 0.016 0.984
#> GSM613751     5  0.0510     1.0000 0.000 0.000 0.000 0.016 0.984
#> GSM613752     5  0.0510     1.0000 0.000 0.000 0.000 0.016 0.984
#> GSM613753     5  0.0510     1.0000 0.000 0.000 0.000 0.016 0.984

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     4  0.5532     0.6297 0.140 0.024 0.108 0.688 0.000 0.040
#> GSM613639     4  0.5471     0.4101 0.300 0.008 0.032 0.608 0.004 0.048
#> GSM613640     4  0.4610     0.5864 0.200 0.012 0.036 0.728 0.004 0.020
#> GSM613641     1  0.2856     0.7761 0.856 0.000 0.000 0.068 0.000 0.076
#> GSM613642     2  0.7034     0.2015 0.004 0.348 0.280 0.328 0.008 0.032
#> GSM613643     4  0.4541     0.5466 0.236 0.012 0.036 0.704 0.000 0.012
#> GSM613644     4  0.4907     0.5495 0.232 0.012 0.032 0.692 0.004 0.028
#> GSM613645     1  0.4766     0.5167 0.656 0.008 0.000 0.276 0.004 0.056
#> GSM613646     4  0.4661     0.6079 0.008 0.064 0.132 0.756 0.004 0.036
#> GSM613647     4  0.4741     0.5391 0.016 0.000 0.252 0.672 0.000 0.060
#> GSM613648     4  0.5248     0.4534 0.012 0.020 0.324 0.600 0.000 0.044
#> GSM613649     3  0.2113     0.9276 0.000 0.008 0.896 0.092 0.000 0.004
#> GSM613650     4  0.4224     0.6205 0.076 0.004 0.048 0.796 0.004 0.072
#> GSM613651     4  0.5399     0.5386 0.192 0.000 0.040 0.656 0.000 0.112
#> GSM613652     1  0.4358     0.7074 0.712 0.000 0.000 0.092 0.000 0.196
#> GSM613653     4  0.4002     0.6272 0.060 0.008 0.048 0.816 0.004 0.064
#> GSM613654     1  0.4358     0.7074 0.712 0.000 0.000 0.092 0.000 0.196
#> GSM613655     1  0.2553     0.7604 0.848 0.000 0.000 0.008 0.000 0.144
#> GSM613656     1  0.4358     0.7074 0.712 0.000 0.000 0.092 0.000 0.196
#> GSM613657     3  0.1897     0.9359 0.000 0.004 0.908 0.084 0.000 0.004
#> GSM613658     1  0.2979     0.7791 0.840 0.000 0.000 0.044 0.000 0.116
#> GSM613659     4  0.5242     0.5794 0.004 0.136 0.120 0.700 0.004 0.036
#> GSM613660     2  0.4621     0.4254 0.000 0.528 0.444 0.012 0.008 0.008
#> GSM613661     1  0.2542     0.7855 0.876 0.000 0.000 0.044 0.000 0.080
#> GSM613662     2  0.6359    -0.0973 0.000 0.548 0.136 0.076 0.000 0.240
#> GSM613663     1  0.1168     0.7887 0.956 0.000 0.000 0.016 0.000 0.028
#> GSM613664     2  0.6020     0.3721 0.000 0.616 0.188 0.072 0.004 0.120
#> GSM613665     2  0.5162     0.5524 0.000 0.600 0.320 0.052 0.000 0.028
#> GSM613666     1  0.2856     0.7761 0.856 0.000 0.000 0.068 0.000 0.076
#> GSM613667     1  0.4642     0.5414 0.680 0.008 0.000 0.252 0.004 0.056
#> GSM613668     1  0.2553     0.7604 0.848 0.000 0.000 0.008 0.000 0.144
#> GSM613669     1  0.2688     0.7778 0.868 0.000 0.000 0.068 0.000 0.064
#> GSM613670     2  0.6359    -0.0973 0.000 0.548 0.136 0.076 0.000 0.240
#> GSM613671     1  0.2856     0.7761 0.856 0.000 0.000 0.068 0.000 0.076
#> GSM613672     1  0.1391     0.7899 0.944 0.000 0.000 0.016 0.000 0.040
#> GSM613673     1  0.1906     0.7919 0.924 0.008 0.000 0.032 0.000 0.036
#> GSM613674     2  0.3840     0.5528 0.000 0.740 0.228 0.000 0.008 0.024
#> GSM613675     2  0.6833    -0.0254 0.000 0.516 0.160 0.160 0.000 0.164
#> GSM613676     2  0.5162     0.5524 0.000 0.600 0.320 0.052 0.000 0.028
#> GSM613677     4  0.6043     0.4992 0.004 0.168 0.172 0.604 0.000 0.052
#> GSM613678     4  0.5345     0.5463 0.008 0.172 0.080 0.692 0.004 0.044
#> GSM613679     2  0.4164     0.5788 0.000 0.688 0.280 0.016 0.000 0.016
#> GSM613680     1  0.1480     0.7904 0.940 0.000 0.000 0.020 0.000 0.040
#> GSM613681     1  0.2389     0.7835 0.888 0.000 0.000 0.052 0.000 0.060
#> GSM613682     1  0.3648     0.7364 0.808 0.024 0.000 0.128 0.000 0.040
#> GSM613683     1  0.1480     0.7907 0.940 0.000 0.000 0.020 0.000 0.040
#> GSM613684     2  0.5085     0.4614 0.000 0.680 0.192 0.012 0.008 0.108
#> GSM613685     2  0.3840     0.5528 0.000 0.740 0.228 0.000 0.008 0.024
#> GSM613686     1  0.5924     0.5763 0.628 0.064 0.004 0.204 0.004 0.096
#> GSM613687     1  0.2389     0.7811 0.888 0.000 0.000 0.052 0.000 0.060
#> GSM613688     2  0.5546     0.4196 0.000 0.628 0.232 0.028 0.004 0.108
#> GSM613689     4  0.5149     0.4575 0.000 0.012 0.336 0.588 0.004 0.060
#> GSM613690     4  0.4947     0.3364 0.004 0.012 0.424 0.528 0.000 0.032
#> GSM613691     4  0.6809     0.3066 0.004 0.200 0.176 0.520 0.000 0.100
#> GSM613692     4  0.6016     0.2281 0.320 0.000 0.032 0.520 0.000 0.128
#> GSM613693     2  0.6148     0.4698 0.000 0.480 0.336 0.024 0.000 0.160
#> GSM613694     4  0.5076     0.4729 0.000 0.012 0.324 0.596 0.000 0.068
#> GSM613695     4  0.4643     0.5302 0.012 0.000 0.260 0.672 0.000 0.056
#> GSM613696     4  0.5619     0.5558 0.012 0.100 0.148 0.676 0.000 0.064
#> GSM613697     4  0.5399     0.5386 0.192 0.000 0.040 0.656 0.000 0.112
#> GSM613698     4  0.5195     0.5996 0.072 0.004 0.148 0.704 0.000 0.072
#> GSM613699     4  0.5149     0.4575 0.000 0.012 0.336 0.588 0.004 0.060
#> GSM613700     2  0.4300     0.5448 0.000 0.636 0.340 0.008 0.008 0.008
#> GSM613701     4  0.6253     0.5117 0.168 0.160 0.032 0.612 0.008 0.020
#> GSM613702     4  0.6272     0.5211 0.160 0.152 0.024 0.620 0.008 0.036
#> GSM613703     1  0.4301     0.7234 0.748 0.004 0.000 0.100 0.004 0.144
#> GSM613704     2  0.6377    -0.1013 0.000 0.544 0.136 0.076 0.000 0.244
#> GSM613705     4  0.5644     0.6197 0.108 0.036 0.100 0.696 0.000 0.060
#> GSM613706     4  0.6162     0.5215 0.168 0.152 0.032 0.620 0.004 0.024
#> GSM613707     2  0.4367     0.4777 0.000 0.752 0.148 0.008 0.008 0.084
#> GSM613708     1  0.5502     0.4204 0.568 0.004 0.028 0.336 0.000 0.064
#> GSM613709     1  0.2688     0.7778 0.868 0.000 0.000 0.068 0.000 0.064
#> GSM613710     2  0.4621     0.4254 0.000 0.528 0.444 0.012 0.008 0.008
#> GSM613711     3  0.1983     0.9324 0.000 0.020 0.908 0.072 0.000 0.000
#> GSM613712     4  0.5356     0.6077 0.104 0.000 0.124 0.688 0.000 0.084
#> GSM613713     2  0.5826     0.4753 0.000 0.492 0.376 0.008 0.008 0.116
#> GSM613714     4  0.4664     0.5281 0.012 0.000 0.264 0.668 0.000 0.056
#> GSM613715     4  0.5101     0.3004 0.004 0.016 0.436 0.508 0.000 0.036
#> GSM613716     4  0.5944     0.4839 0.012 0.064 0.264 0.596 0.000 0.064
#> GSM613717     3  0.1802     0.9365 0.000 0.012 0.916 0.072 0.000 0.000
#> GSM613718     3  0.1806     0.9358 0.000 0.004 0.908 0.088 0.000 0.000
#> GSM613719     4  0.4002     0.6272 0.060 0.008 0.048 0.816 0.004 0.064
#> GSM613720     6  0.6727     0.7298 0.000 0.300 0.224 0.048 0.000 0.428
#> GSM613721     2  0.7204     0.1070 0.000 0.468 0.148 0.200 0.004 0.180
#> GSM613722     2  0.5989     0.5064 0.000 0.568 0.272 0.124 0.008 0.028
#> GSM613723     1  0.4358     0.7074 0.712 0.000 0.000 0.092 0.000 0.196
#> GSM613724     1  0.2376     0.7878 0.888 0.000 0.000 0.044 0.000 0.068
#> GSM613725     2  0.4300     0.5448 0.000 0.636 0.340 0.008 0.008 0.008
#> GSM613726     1  0.5059     0.0936 0.528 0.008 0.016 0.420 0.000 0.028
#> GSM613727     1  0.2473     0.7620 0.856 0.000 0.000 0.008 0.000 0.136
#> GSM613728     4  0.6817     0.2604 0.004 0.288 0.172 0.468 0.000 0.068
#> GSM613729     1  0.4301     0.7234 0.748 0.004 0.000 0.100 0.004 0.144
#> GSM613730     4  0.5873     0.5100 0.004 0.184 0.148 0.624 0.004 0.036
#> GSM613731     4  0.4541     0.5466 0.236 0.012 0.036 0.704 0.000 0.012
#> GSM613732     3  0.1897     0.9359 0.000 0.004 0.908 0.084 0.000 0.004
#> GSM613733     3  0.2822     0.8737 0.000 0.068 0.868 0.056 0.008 0.000
#> GSM613734     1  0.4358     0.7074 0.712 0.000 0.000 0.092 0.000 0.196
#> GSM613735     1  0.3967     0.7293 0.760 0.000 0.000 0.092 0.000 0.148
#> GSM613736     3  0.3649     0.8417 0.000 0.112 0.800 0.084 0.000 0.004
#> GSM613737     4  0.5259     0.5216 0.024 0.000 0.256 0.632 0.000 0.088
#> GSM613738     1  0.5461     0.5885 0.592 0.000 0.004 0.208 0.000 0.196
#> GSM613739     1  0.5461     0.5885 0.592 0.000 0.004 0.208 0.000 0.196
#> GSM613740     3  0.2493     0.9276 0.000 0.036 0.884 0.076 0.000 0.004
#> GSM613741     4  0.4002     0.6272 0.060 0.008 0.048 0.816 0.004 0.064
#> GSM613742     1  0.5461     0.5885 0.592 0.000 0.004 0.208 0.000 0.196
#> GSM613743     3  0.2803     0.9094 0.000 0.048 0.864 0.084 0.000 0.004
#> GSM613744     3  0.2062     0.9311 0.000 0.008 0.900 0.088 0.000 0.004
#> GSM613745     4  0.4661     0.6079 0.008 0.064 0.132 0.756 0.004 0.036
#> GSM613746     6  0.5611     0.7280 0.000 0.308 0.152 0.004 0.000 0.536
#> GSM613747     1  0.4358     0.7074 0.712 0.000 0.000 0.092 0.000 0.196
#> GSM613748     4  0.5966     0.5217 0.012 0.164 0.148 0.636 0.008 0.032
#> GSM613749     4  0.5990     0.5281 0.164 0.152 0.020 0.632 0.004 0.028
#> GSM613750     5  0.0458     1.0000 0.000 0.000 0.016 0.000 0.984 0.000
#> GSM613751     5  0.0458     1.0000 0.000 0.000 0.016 0.000 0.984 0.000
#> GSM613752     5  0.0458     1.0000 0.000 0.000 0.016 0.000 0.984 0.000
#> GSM613753     5  0.0458     1.0000 0.000 0.000 0.016 0.000 0.984 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 disease.state(p) k
#> SD:hclust 102          0.16156 2
#> SD:hclust  78          0.19843 3
#> SD:hclust 110          0.00216 4
#> SD:hclust  78          0.01058 5
#> SD:hclust  88          0.00568 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 27425 rows and 116 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.861           0.930       0.967         0.4971 0.497   0.497
#> 3 3 0.575           0.600       0.829         0.3199 0.732   0.511
#> 4 4 0.552           0.607       0.724         0.1207 0.830   0.550
#> 5 5 0.585           0.460       0.633         0.0673 0.903   0.648
#> 6 6 0.664           0.545       0.683         0.0439 0.867   0.471

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
#> GSM613638     2  0.8608      0.580 0.284 0.716
#> GSM613639     1  0.0376      0.951 0.996 0.004
#> GSM613640     2  0.1843      0.954 0.028 0.972
#> GSM613641     1  0.0376      0.951 0.996 0.004
#> GSM613642     2  0.0000      0.980 0.000 1.000
#> GSM613643     1  0.0376      0.951 0.996 0.004
#> GSM613644     1  0.0376      0.951 0.996 0.004
#> GSM613645     1  0.0376      0.951 0.996 0.004
#> GSM613646     1  0.8909      0.614 0.692 0.308
#> GSM613647     1  0.8713      0.644 0.708 0.292
#> GSM613648     2  0.0000      0.980 0.000 1.000
#> GSM613649     2  0.0000      0.980 0.000 1.000
#> GSM613650     1  0.0672      0.948 0.992 0.008
#> GSM613651     1  0.0672      0.948 0.992 0.008
#> GSM613652     1  0.0376      0.951 0.996 0.004
#> GSM613653     1  0.7745      0.737 0.772 0.228
#> GSM613654     1  0.0376      0.951 0.996 0.004
#> GSM613655     1  0.0376      0.951 0.996 0.004
#> GSM613656     1  0.0376      0.951 0.996 0.004
#> GSM613657     2  0.0000      0.980 0.000 1.000
#> GSM613658     1  0.0376      0.951 0.996 0.004
#> GSM613659     2  0.0000      0.980 0.000 1.000
#> GSM613660     2  0.0000      0.980 0.000 1.000
#> GSM613661     1  0.0376      0.951 0.996 0.004
#> GSM613662     2  0.0000      0.980 0.000 1.000
#> GSM613663     1  0.0376      0.951 0.996 0.004
#> GSM613664     2  0.0000      0.980 0.000 1.000
#> GSM613665     2  0.0000      0.980 0.000 1.000
#> GSM613666     1  0.0376      0.951 0.996 0.004
#> GSM613667     1  0.0376      0.951 0.996 0.004
#> GSM613668     1  0.0376      0.951 0.996 0.004
#> GSM613669     1  0.0376      0.951 0.996 0.004
#> GSM613670     2  0.0000      0.980 0.000 1.000
#> GSM613671     1  0.0376      0.951 0.996 0.004
#> GSM613672     1  0.0376      0.951 0.996 0.004
#> GSM613673     1  0.0376      0.951 0.996 0.004
#> GSM613674     2  0.0000      0.980 0.000 1.000
#> GSM613675     2  0.0000      0.980 0.000 1.000
#> GSM613676     2  0.0000      0.980 0.000 1.000
#> GSM613677     2  0.0000      0.980 0.000 1.000
#> GSM613678     1  0.7139      0.778 0.804 0.196
#> GSM613679     2  0.0000      0.980 0.000 1.000
#> GSM613680     1  0.0376      0.951 0.996 0.004
#> GSM613681     1  0.0376      0.951 0.996 0.004
#> GSM613682     1  0.0376      0.951 0.996 0.004
#> GSM613683     1  0.0376      0.951 0.996 0.004
#> GSM613684     2  0.0000      0.980 0.000 1.000
#> GSM613685     2  0.0000      0.980 0.000 1.000
#> GSM613686     1  0.0376      0.951 0.996 0.004
#> GSM613687     1  0.0376      0.951 0.996 0.004
#> GSM613688     2  0.0000      0.980 0.000 1.000
#> GSM613689     2  0.0000      0.980 0.000 1.000
#> GSM613690     2  0.0000      0.980 0.000 1.000
#> GSM613691     2  0.0000      0.980 0.000 1.000
#> GSM613692     1  0.0376      0.951 0.996 0.004
#> GSM613693     2  0.0000      0.980 0.000 1.000
#> GSM613694     1  0.8443      0.675 0.728 0.272
#> GSM613695     2  0.0000      0.980 0.000 1.000
#> GSM613696     2  0.0000      0.980 0.000 1.000
#> GSM613697     1  0.0672      0.948 0.992 0.008
#> GSM613698     1  0.8909      0.613 0.692 0.308
#> GSM613699     2  0.2948      0.929 0.052 0.948
#> GSM613700     2  0.0000      0.980 0.000 1.000
#> GSM613701     2  0.0672      0.973 0.008 0.992
#> GSM613702     2  0.0000      0.980 0.000 1.000
#> GSM613703     1  0.0376      0.951 0.996 0.004
#> GSM613704     2  0.0000      0.980 0.000 1.000
#> GSM613705     2  0.4815      0.870 0.104 0.896
#> GSM613706     1  0.8443      0.675 0.728 0.272
#> GSM613707     2  0.0000      0.980 0.000 1.000
#> GSM613708     1  0.0376      0.951 0.996 0.004
#> GSM613709     1  0.0376      0.951 0.996 0.004
#> GSM613710     2  0.0000      0.980 0.000 1.000
#> GSM613711     2  0.0000      0.980 0.000 1.000
#> GSM613712     2  0.7950      0.665 0.240 0.760
#> GSM613713     2  0.0000      0.980 0.000 1.000
#> GSM613714     2  0.0000      0.980 0.000 1.000
#> GSM613715     2  0.0000      0.980 0.000 1.000
#> GSM613716     2  0.0000      0.980 0.000 1.000
#> GSM613717     2  0.0000      0.980 0.000 1.000
#> GSM613718     2  0.0000      0.980 0.000 1.000
#> GSM613719     1  0.6801      0.794 0.820 0.180
#> GSM613720     2  0.0000      0.980 0.000 1.000
#> GSM613721     2  0.0000      0.980 0.000 1.000
#> GSM613722     2  0.0000      0.980 0.000 1.000
#> GSM613723     1  0.0376      0.951 0.996 0.004
#> GSM613724     1  0.0376      0.951 0.996 0.004
#> GSM613725     2  0.0000      0.980 0.000 1.000
#> GSM613726     1  0.0376      0.951 0.996 0.004
#> GSM613727     1  0.0376      0.951 0.996 0.004
#> GSM613728     2  0.0000      0.980 0.000 1.000
#> GSM613729     1  0.0376      0.951 0.996 0.004
#> GSM613730     2  0.0000      0.980 0.000 1.000
#> GSM613731     1  0.0376      0.951 0.996 0.004
#> GSM613732     2  0.0000      0.980 0.000 1.000
#> GSM613733     2  0.0000      0.980 0.000 1.000
#> GSM613734     1  0.0376      0.951 0.996 0.004
#> GSM613735     1  0.0376      0.951 0.996 0.004
#> GSM613736     2  0.0000      0.980 0.000 1.000
#> GSM613737     1  0.8608      0.655 0.716 0.284
#> GSM613738     1  0.0376      0.951 0.996 0.004
#> GSM613739     1  0.0376      0.951 0.996 0.004
#> GSM613740     2  0.0000      0.980 0.000 1.000
#> GSM613741     1  0.7745      0.737 0.772 0.228
#> GSM613742     1  0.0376      0.951 0.996 0.004
#> GSM613743     2  0.0000      0.980 0.000 1.000
#> GSM613744     2  0.0000      0.980 0.000 1.000
#> GSM613745     2  0.9580      0.322 0.380 0.620
#> GSM613746     2  0.0000      0.980 0.000 1.000
#> GSM613747     1  0.0376      0.951 0.996 0.004
#> GSM613748     2  0.0000      0.980 0.000 1.000
#> GSM613749     1  0.0376      0.951 0.996 0.004
#> GSM613750     2  0.0376      0.976 0.004 0.996
#> GSM613751     2  0.0376      0.976 0.004 0.996
#> GSM613752     2  0.0376      0.976 0.004 0.996
#> GSM613753     2  0.0376      0.976 0.004 0.996

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM613638     3  0.3276     0.7385 0.024 0.068 0.908
#> GSM613639     1  0.5905     0.4872 0.648 0.000 0.352
#> GSM613640     3  0.3445     0.7331 0.016 0.088 0.896
#> GSM613641     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613642     2  0.4233     0.5531 0.004 0.836 0.160
#> GSM613643     1  0.6252     0.3334 0.556 0.000 0.444
#> GSM613644     3  0.6302    -0.1457 0.480 0.000 0.520
#> GSM613645     1  0.5810     0.5160 0.664 0.000 0.336
#> GSM613646     3  0.7252     0.5855 0.100 0.196 0.704
#> GSM613647     3  0.2947     0.7246 0.060 0.020 0.920
#> GSM613648     3  0.5591     0.4704 0.000 0.304 0.696
#> GSM613649     3  0.6235     0.1586 0.000 0.436 0.564
#> GSM613650     3  0.4842     0.5802 0.224 0.000 0.776
#> GSM613651     3  0.2711     0.7047 0.088 0.000 0.912
#> GSM613652     1  0.2625     0.8709 0.916 0.000 0.084
#> GSM613653     3  0.7542     0.5713 0.120 0.192 0.688
#> GSM613654     1  0.2625     0.8709 0.916 0.000 0.084
#> GSM613655     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613656     1  0.2625     0.8709 0.916 0.000 0.084
#> GSM613657     2  0.6274     0.1041 0.000 0.544 0.456
#> GSM613658     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613659     2  0.6282     0.2510 0.004 0.612 0.384
#> GSM613660     2  0.0475     0.6763 0.004 0.992 0.004
#> GSM613661     1  0.4121     0.7660 0.832 0.000 0.168
#> GSM613662     2  0.0475     0.6787 0.004 0.992 0.004
#> GSM613663     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613664     2  0.0475     0.6787 0.004 0.992 0.004
#> GSM613665     2  0.0475     0.6787 0.004 0.992 0.004
#> GSM613666     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613667     1  0.5810     0.5160 0.664 0.000 0.336
#> GSM613668     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613669     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613670     2  0.6696     0.2991 0.020 0.632 0.348
#> GSM613671     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613672     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613673     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613674     2  0.0237     0.6780 0.004 0.996 0.000
#> GSM613675     2  0.0475     0.6787 0.004 0.992 0.004
#> GSM613676     2  0.0237     0.6780 0.004 0.996 0.000
#> GSM613677     3  0.5138     0.5923 0.000 0.252 0.748
#> GSM613678     2  0.8784     0.0868 0.116 0.496 0.388
#> GSM613679     2  0.0475     0.6787 0.004 0.992 0.004
#> GSM613680     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613681     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613682     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613683     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613684     2  0.0237     0.6780 0.004 0.996 0.000
#> GSM613685     2  0.0237     0.6780 0.004 0.996 0.000
#> GSM613686     1  0.3038     0.8325 0.896 0.000 0.104
#> GSM613687     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613688     2  0.0475     0.6787 0.004 0.992 0.004
#> GSM613689     3  0.5678     0.4658 0.000 0.316 0.684
#> GSM613690     3  0.3816     0.6919 0.000 0.148 0.852
#> GSM613691     2  0.5623     0.4073 0.004 0.716 0.280
#> GSM613692     1  0.2796     0.8667 0.908 0.000 0.092
#> GSM613693     2  0.0592     0.6758 0.000 0.988 0.012
#> GSM613694     3  0.3155     0.7363 0.040 0.044 0.916
#> GSM613695     3  0.2448     0.7321 0.000 0.076 0.924
#> GSM613696     3  0.4121     0.6768 0.000 0.168 0.832
#> GSM613697     3  0.2711     0.7047 0.088 0.000 0.912
#> GSM613698     3  0.3155     0.7363 0.040 0.044 0.916
#> GSM613699     3  0.3116     0.7226 0.000 0.108 0.892
#> GSM613700     2  0.0475     0.6787 0.004 0.992 0.004
#> GSM613701     2  0.6081     0.3209 0.004 0.652 0.344
#> GSM613702     2  0.6617     0.2337 0.012 0.600 0.388
#> GSM613703     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613704     2  0.0475     0.6787 0.004 0.992 0.004
#> GSM613705     3  0.2947     0.7382 0.020 0.060 0.920
#> GSM613706     3  0.9335     0.1159 0.168 0.376 0.456
#> GSM613707     2  0.0237     0.6780 0.004 0.996 0.000
#> GSM613708     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613709     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613710     2  0.0661     0.6749 0.004 0.988 0.008
#> GSM613711     2  0.6244     0.1416 0.000 0.560 0.440
#> GSM613712     3  0.3083     0.7383 0.024 0.060 0.916
#> GSM613713     2  0.0747     0.6710 0.000 0.984 0.016
#> GSM613714     3  0.3267     0.7213 0.000 0.116 0.884
#> GSM613715     3  0.4178     0.6730 0.000 0.172 0.828
#> GSM613716     3  0.3752     0.7047 0.000 0.144 0.856
#> GSM613717     2  0.6244     0.1416 0.000 0.560 0.440
#> GSM613718     2  0.6280     0.0942 0.000 0.540 0.460
#> GSM613719     3  0.3155     0.7363 0.040 0.044 0.916
#> GSM613720     2  0.6168     0.1855 0.000 0.588 0.412
#> GSM613721     2  0.5956     0.3516 0.004 0.672 0.324
#> GSM613722     2  0.0475     0.6787 0.004 0.992 0.004
#> GSM613723     1  0.2625     0.8709 0.916 0.000 0.084
#> GSM613724     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613725     2  0.0237     0.6780 0.004 0.996 0.000
#> GSM613726     1  0.5810     0.5160 0.664 0.000 0.336
#> GSM613727     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613728     2  0.0475     0.6787 0.004 0.992 0.004
#> GSM613729     1  0.0000     0.9031 1.000 0.000 0.000
#> GSM613730     2  0.6468     0.1332 0.004 0.552 0.444
#> GSM613731     1  0.6079     0.4139 0.612 0.000 0.388
#> GSM613732     2  0.6280     0.0942 0.000 0.540 0.460
#> GSM613733     2  0.6180     0.1862 0.000 0.584 0.416
#> GSM613734     1  0.1031     0.8951 0.976 0.000 0.024
#> GSM613735     1  0.2537     0.8727 0.920 0.000 0.080
#> GSM613736     2  0.6244     0.1416 0.000 0.560 0.440
#> GSM613737     3  0.3042     0.7359 0.040 0.040 0.920
#> GSM613738     1  0.2796     0.8667 0.908 0.000 0.092
#> GSM613739     1  0.2796     0.8667 0.908 0.000 0.092
#> GSM613740     2  0.6280     0.0942 0.000 0.540 0.460
#> GSM613741     3  0.7542     0.5713 0.120 0.192 0.688
#> GSM613742     1  0.2959     0.8609 0.900 0.000 0.100
#> GSM613743     2  0.6244     0.1416 0.000 0.560 0.440
#> GSM613744     2  0.6280     0.0942 0.000 0.540 0.460
#> GSM613745     3  0.5987     0.6212 0.036 0.208 0.756
#> GSM613746     2  0.0475     0.6787 0.004 0.992 0.004
#> GSM613747     1  0.1031     0.8951 0.976 0.000 0.024
#> GSM613748     2  0.6779     0.1223 0.012 0.544 0.444
#> GSM613749     2  0.9806    -0.0067 0.244 0.408 0.348
#> GSM613750     3  0.6180     0.0755 0.000 0.416 0.584
#> GSM613751     3  0.6291    -0.0545 0.000 0.468 0.532
#> GSM613752     3  0.6291    -0.0545 0.000 0.468 0.532
#> GSM613753     3  0.2261     0.6884 0.000 0.068 0.932

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM613638     4  0.4543     0.5067 0.000 0.000 0.324 0.676
#> GSM613639     1  0.5558     0.1488 0.528 0.012 0.004 0.456
#> GSM613640     4  0.5988     0.5719 0.040 0.032 0.232 0.696
#> GSM613641     1  0.0524     0.8044 0.988 0.004 0.000 0.008
#> GSM613642     2  0.6110     0.6164 0.000 0.680 0.144 0.176
#> GSM613643     4  0.5792     0.3940 0.296 0.000 0.056 0.648
#> GSM613644     4  0.5463     0.4828 0.256 0.000 0.052 0.692
#> GSM613645     1  0.5670     0.2651 0.572 0.020 0.004 0.404
#> GSM613646     4  0.6279     0.5848 0.048 0.136 0.092 0.724
#> GSM613647     4  0.4761     0.4895 0.004 0.000 0.332 0.664
#> GSM613648     3  0.5723     0.5303 0.000 0.072 0.684 0.244
#> GSM613649     3  0.6397     0.6800 0.000 0.184 0.652 0.164
#> GSM613650     4  0.4483     0.5849 0.088 0.000 0.104 0.808
#> GSM613651     4  0.4820     0.4637 0.012 0.000 0.296 0.692
#> GSM613652     1  0.5968     0.6770 0.672 0.000 0.092 0.236
#> GSM613653     4  0.6296     0.5842 0.052 0.136 0.088 0.724
#> GSM613654     1  0.5998     0.6739 0.668 0.000 0.092 0.240
#> GSM613655     1  0.1888     0.7998 0.940 0.000 0.044 0.016
#> GSM613656     1  0.5968     0.6770 0.672 0.000 0.092 0.236
#> GSM613657     3  0.5090     0.7630 0.000 0.228 0.728 0.044
#> GSM613658     1  0.1985     0.8006 0.940 0.004 0.040 0.016
#> GSM613659     4  0.5511     0.0305 0.000 0.484 0.016 0.500
#> GSM613660     2  0.4017     0.7803 0.000 0.828 0.128 0.044
#> GSM613661     1  0.4809     0.4775 0.684 0.004 0.004 0.308
#> GSM613662     2  0.3529     0.7359 0.000 0.836 0.012 0.152
#> GSM613663     1  0.0895     0.8021 0.976 0.000 0.004 0.020
#> GSM613664     2  0.2737     0.7581 0.000 0.888 0.008 0.104
#> GSM613665     2  0.3108     0.7965 0.000 0.872 0.112 0.016
#> GSM613666     1  0.0524     0.8044 0.988 0.004 0.000 0.008
#> GSM613667     1  0.5334     0.2945 0.588 0.008 0.004 0.400
#> GSM613668     1  0.0921     0.8047 0.972 0.000 0.028 0.000
#> GSM613669     1  0.0524     0.8044 0.988 0.004 0.000 0.008
#> GSM613670     2  0.4980     0.5039 0.000 0.680 0.016 0.304
#> GSM613671     1  0.0524     0.8044 0.988 0.004 0.000 0.008
#> GSM613672     1  0.0921     0.8047 0.972 0.000 0.028 0.000
#> GSM613673     1  0.0817     0.8023 0.976 0.000 0.000 0.024
#> GSM613674     2  0.2589     0.7900 0.000 0.884 0.116 0.000
#> GSM613675     2  0.2805     0.7724 0.000 0.888 0.012 0.100
#> GSM613676     2  0.3280     0.7926 0.000 0.860 0.124 0.016
#> GSM613677     4  0.7483     0.3080 0.000 0.184 0.360 0.456
#> GSM613678     4  0.7019     0.3084 0.108 0.332 0.008 0.552
#> GSM613679     2  0.3048     0.7968 0.000 0.876 0.108 0.016
#> GSM613680     1  0.0336     0.8052 0.992 0.000 0.008 0.000
#> GSM613681     1  0.0779     0.8029 0.980 0.004 0.000 0.016
#> GSM613682     1  0.0707     0.8030 0.980 0.000 0.000 0.020
#> GSM613683     1  0.1888     0.7995 0.940 0.000 0.044 0.016
#> GSM613684     2  0.2530     0.7924 0.000 0.888 0.112 0.000
#> GSM613685     2  0.2589     0.7900 0.000 0.884 0.116 0.000
#> GSM613686     1  0.5305     0.4359 0.648 0.016 0.004 0.332
#> GSM613687     1  0.0817     0.8019 0.976 0.000 0.000 0.024
#> GSM613688     2  0.2111     0.7860 0.000 0.932 0.024 0.044
#> GSM613689     3  0.5008     0.5219 0.000 0.040 0.732 0.228
#> GSM613690     3  0.4936     0.3809 0.000 0.012 0.672 0.316
#> GSM613691     2  0.5141     0.5498 0.000 0.700 0.032 0.268
#> GSM613692     1  0.6259     0.6241 0.616 0.000 0.084 0.300
#> GSM613693     2  0.4274     0.7520 0.000 0.820 0.108 0.072
#> GSM613694     4  0.4406     0.5270 0.000 0.000 0.300 0.700
#> GSM613695     3  0.4916     0.0191 0.000 0.000 0.576 0.424
#> GSM613696     4  0.6668     0.3397 0.000 0.092 0.380 0.528
#> GSM613697     4  0.4891     0.4491 0.012 0.000 0.308 0.680
#> GSM613698     4  0.4872     0.4545 0.000 0.004 0.356 0.640
#> GSM613699     4  0.5132     0.3270 0.000 0.004 0.448 0.548
#> GSM613700     2  0.3634     0.7949 0.000 0.856 0.096 0.048
#> GSM613701     2  0.5650     0.1127 0.000 0.544 0.024 0.432
#> GSM613702     4  0.5570     0.1140 0.000 0.440 0.020 0.540
#> GSM613703     1  0.3350     0.7350 0.864 0.016 0.004 0.116
#> GSM613704     2  0.2546     0.7748 0.000 0.900 0.008 0.092
#> GSM613705     4  0.4624     0.4888 0.000 0.000 0.340 0.660
#> GSM613706     4  0.7508     0.5650 0.120 0.164 0.080 0.636
#> GSM613707     2  0.2589     0.7900 0.000 0.884 0.116 0.000
#> GSM613708     1  0.1209     0.7969 0.964 0.000 0.004 0.032
#> GSM613709     1  0.0524     0.8044 0.988 0.004 0.000 0.008
#> GSM613710     2  0.4224     0.7653 0.000 0.812 0.144 0.044
#> GSM613711     3  0.5219     0.7526 0.000 0.244 0.712 0.044
#> GSM613712     4  0.4830     0.4174 0.000 0.000 0.392 0.608
#> GSM613713     2  0.5130     0.3746 0.000 0.652 0.332 0.016
#> GSM613714     3  0.4761     0.3197 0.000 0.004 0.664 0.332
#> GSM613715     3  0.5297     0.4186 0.000 0.032 0.676 0.292
#> GSM613716     4  0.7130     0.2156 0.000 0.132 0.396 0.472
#> GSM613717     3  0.5156     0.7581 0.000 0.236 0.720 0.044
#> GSM613718     3  0.5056     0.7647 0.000 0.224 0.732 0.044
#> GSM613719     4  0.3494     0.5729 0.000 0.004 0.172 0.824
#> GSM613720     3  0.6969     0.4321 0.000 0.436 0.452 0.112
#> GSM613721     2  0.4898     0.5556 0.000 0.716 0.024 0.260
#> GSM613722     2  0.3734     0.7911 0.000 0.848 0.108 0.044
#> GSM613723     1  0.5998     0.6739 0.668 0.000 0.092 0.240
#> GSM613724     1  0.1798     0.8003 0.944 0.000 0.040 0.016
#> GSM613725     2  0.3962     0.7834 0.000 0.832 0.124 0.044
#> GSM613726     1  0.6049     0.2342 0.564 0.008 0.032 0.396
#> GSM613727     1  0.1209     0.8047 0.964 0.004 0.032 0.000
#> GSM613728     2  0.2796     0.7845 0.000 0.892 0.016 0.092
#> GSM613729     1  0.0967     0.8021 0.976 0.004 0.004 0.016
#> GSM613730     4  0.6352     0.3391 0.012 0.356 0.048 0.584
#> GSM613731     4  0.6368     0.2194 0.400 0.004 0.056 0.540
#> GSM613732     3  0.5213     0.7638 0.000 0.224 0.724 0.052
#> GSM613733     3  0.6078     0.6244 0.000 0.312 0.620 0.068
#> GSM613734     1  0.5003     0.7323 0.768 0.000 0.084 0.148
#> GSM613735     1  0.5968     0.6770 0.672 0.000 0.092 0.236
#> GSM613736     3  0.5188     0.7569 0.000 0.240 0.716 0.044
#> GSM613737     4  0.4746     0.4506 0.000 0.000 0.368 0.632
#> GSM613738     1  0.6217     0.6318 0.624 0.000 0.084 0.292
#> GSM613739     1  0.6307     0.6283 0.620 0.000 0.092 0.288
#> GSM613740     3  0.5056     0.7647 0.000 0.224 0.732 0.044
#> GSM613741     4  0.6390     0.5813 0.052 0.144 0.088 0.716
#> GSM613742     1  0.6338     0.6015 0.600 0.000 0.084 0.316
#> GSM613743     3  0.5156     0.7581 0.000 0.236 0.720 0.044
#> GSM613744     3  0.5056     0.7647 0.000 0.224 0.732 0.044
#> GSM613745     4  0.6609     0.5739 0.048 0.160 0.096 0.696
#> GSM613746     2  0.2845     0.7727 0.000 0.896 0.028 0.076
#> GSM613747     1  0.5003     0.7323 0.768 0.000 0.084 0.148
#> GSM613748     4  0.6617     0.4286 0.016 0.300 0.072 0.612
#> GSM613749     4  0.7190     0.3371 0.192 0.260 0.000 0.548
#> GSM613750     3  0.3910     0.7212 0.000 0.156 0.820 0.024
#> GSM613751     3  0.3900     0.7247 0.000 0.164 0.816 0.020
#> GSM613752     3  0.3991     0.7245 0.000 0.172 0.808 0.020
#> GSM613753     3  0.3810     0.4907 0.000 0.008 0.804 0.188

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     4  0.4667     0.6159 0.020 0.008 0.104 0.784 0.084
#> GSM613639     1  0.5904     0.2351 0.532 0.008 0.000 0.376 0.084
#> GSM613640     4  0.4205     0.6179 0.036 0.060 0.048 0.832 0.024
#> GSM613641     1  0.4557     0.3791 0.516 0.008 0.000 0.000 0.476
#> GSM613642     2  0.6392     0.4608 0.088 0.548 0.036 0.328 0.000
#> GSM613643     4  0.5039     0.5817 0.184 0.000 0.000 0.700 0.116
#> GSM613644     4  0.5222     0.6017 0.196 0.000 0.000 0.680 0.124
#> GSM613645     1  0.6003     0.3761 0.572 0.008 0.000 0.308 0.112
#> GSM613646     4  0.6609     0.5077 0.188 0.160 0.024 0.612 0.016
#> GSM613647     4  0.4896     0.6044 0.004 0.004 0.096 0.736 0.160
#> GSM613648     3  0.4763     0.4126 0.004 0.020 0.616 0.360 0.000
#> GSM613649     3  0.3849     0.6180 0.000 0.016 0.752 0.232 0.000
#> GSM613650     4  0.5756     0.6341 0.140 0.012 0.024 0.700 0.124
#> GSM613651     4  0.5697     0.4968 0.008 0.000 0.072 0.568 0.352
#> GSM613652     5  0.0703     0.5915 0.000 0.000 0.000 0.024 0.976
#> GSM613653     4  0.6682     0.4957 0.180 0.176 0.020 0.604 0.020
#> GSM613654     5  0.0794     0.5911 0.000 0.000 0.000 0.028 0.972
#> GSM613655     5  0.4440    -0.2882 0.468 0.004 0.000 0.000 0.528
#> GSM613656     5  0.0703     0.5915 0.000 0.000 0.000 0.024 0.976
#> GSM613657     3  0.1041     0.7831 0.000 0.004 0.964 0.032 0.000
#> GSM613658     5  0.4555    -0.3049 0.472 0.008 0.000 0.000 0.520
#> GSM613659     2  0.6328     0.0718 0.156 0.516 0.004 0.324 0.000
#> GSM613660     2  0.6794     0.6306 0.108 0.592 0.212 0.088 0.000
#> GSM613661     1  0.5788     0.3848 0.580 0.000 0.000 0.300 0.120
#> GSM613662     2  0.3787     0.6305 0.048 0.836 0.028 0.088 0.000
#> GSM613663     1  0.4278     0.4171 0.548 0.000 0.000 0.000 0.452
#> GSM613664     2  0.3005     0.6535 0.052 0.888 0.016 0.036 0.008
#> GSM613665     2  0.6292     0.6520 0.076 0.632 0.216 0.076 0.000
#> GSM613666     1  0.4557     0.3791 0.516 0.008 0.000 0.000 0.476
#> GSM613667     1  0.5971     0.3803 0.580 0.008 0.000 0.300 0.112
#> GSM613668     5  0.4449    -0.3359 0.484 0.004 0.000 0.000 0.512
#> GSM613669     1  0.4557     0.3791 0.516 0.008 0.000 0.000 0.476
#> GSM613670     2  0.4732     0.5318 0.108 0.744 0.004 0.144 0.000
#> GSM613671     1  0.4557     0.3791 0.516 0.008 0.000 0.000 0.476
#> GSM613672     5  0.4305    -0.3403 0.488 0.000 0.000 0.000 0.512
#> GSM613673     1  0.4861     0.4282 0.548 0.000 0.000 0.024 0.428
#> GSM613674     2  0.6292     0.6427 0.124 0.640 0.196 0.032 0.008
#> GSM613675     2  0.4028     0.6384 0.044 0.824 0.044 0.088 0.000
#> GSM613676     2  0.6370     0.6448 0.076 0.620 0.228 0.076 0.000
#> GSM613677     4  0.5724     0.4612 0.024 0.108 0.200 0.668 0.000
#> GSM613678     4  0.6681     0.2310 0.248 0.328 0.000 0.424 0.000
#> GSM613679     2  0.6026     0.6529 0.096 0.660 0.192 0.052 0.000
#> GSM613680     1  0.4449     0.3596 0.512 0.004 0.000 0.000 0.484
#> GSM613681     1  0.4700     0.3865 0.516 0.008 0.000 0.004 0.472
#> GSM613682     1  0.4528     0.4264 0.548 0.000 0.000 0.008 0.444
#> GSM613683     5  0.4294    -0.2829 0.468 0.000 0.000 0.000 0.532
#> GSM613684     2  0.4797     0.6568 0.080 0.736 0.176 0.000 0.008
#> GSM613685     2  0.6292     0.6427 0.124 0.640 0.196 0.032 0.008
#> GSM613686     1  0.5494     0.4093 0.668 0.004 0.000 0.172 0.156
#> GSM613687     1  0.4528     0.4264 0.548 0.000 0.000 0.008 0.444
#> GSM613688     2  0.2155     0.6682 0.036 0.928 0.012 0.016 0.008
#> GSM613689     3  0.5021     0.3823 0.024 0.008 0.588 0.380 0.000
#> GSM613690     3  0.4553     0.3858 0.008 0.004 0.604 0.384 0.000
#> GSM613691     2  0.5279     0.5397 0.108 0.724 0.028 0.140 0.000
#> GSM613692     5  0.1892     0.5627 0.004 0.000 0.000 0.080 0.916
#> GSM613693     2  0.6438     0.6099 0.068 0.648 0.180 0.096 0.008
#> GSM613694     4  0.4312     0.6133 0.000 0.000 0.104 0.772 0.124
#> GSM613695     4  0.4886     0.1240 0.004 0.004 0.420 0.560 0.012
#> GSM613696     4  0.6375     0.5269 0.064 0.120 0.148 0.660 0.008
#> GSM613697     4  0.5760     0.4721 0.008 0.000 0.072 0.544 0.376
#> GSM613698     4  0.5540     0.5604 0.008 0.000 0.120 0.664 0.208
#> GSM613699     4  0.4167     0.4948 0.000 0.000 0.252 0.724 0.024
#> GSM613700     2  0.6698     0.6373 0.104 0.604 0.204 0.088 0.000
#> GSM613701     2  0.6132     0.2451 0.124 0.524 0.004 0.348 0.000
#> GSM613702     4  0.6218     0.1731 0.148 0.364 0.000 0.488 0.000
#> GSM613703     1  0.5014     0.4207 0.628 0.008 0.000 0.032 0.332
#> GSM613704     2  0.4083     0.6358 0.044 0.820 0.044 0.092 0.000
#> GSM613705     4  0.4746     0.6085 0.020 0.004 0.116 0.772 0.088
#> GSM613706     4  0.4300     0.5985 0.088 0.108 0.000 0.792 0.012
#> GSM613707     2  0.6292     0.6427 0.124 0.640 0.196 0.032 0.008
#> GSM613708     1  0.4713     0.4277 0.544 0.000 0.000 0.016 0.440
#> GSM613709     1  0.4557     0.3791 0.516 0.008 0.000 0.000 0.476
#> GSM613710     2  0.6844     0.6175 0.108 0.580 0.228 0.084 0.000
#> GSM613711     3  0.1153     0.7802 0.004 0.008 0.964 0.024 0.000
#> GSM613712     4  0.5227     0.5567 0.004 0.000 0.168 0.696 0.132
#> GSM613713     3  0.6424    -0.1933 0.120 0.384 0.484 0.004 0.008
#> GSM613714     4  0.4596    -0.1453 0.004 0.004 0.496 0.496 0.000
#> GSM613715     3  0.5013     0.4183 0.008 0.028 0.612 0.352 0.000
#> GSM613716     4  0.7769     0.2270 0.084 0.340 0.180 0.396 0.000
#> GSM613717     3  0.1243     0.7810 0.004 0.008 0.960 0.028 0.000
#> GSM613718     3  0.1041     0.7831 0.000 0.004 0.964 0.032 0.000
#> GSM613719     4  0.6141     0.6364 0.132 0.012 0.052 0.684 0.120
#> GSM613720     2  0.7431    -0.0081 0.060 0.404 0.376 0.160 0.000
#> GSM613721     2  0.5258     0.5558 0.116 0.732 0.016 0.128 0.008
#> GSM613722     2  0.6698     0.6373 0.104 0.604 0.204 0.088 0.000
#> GSM613723     5  0.0794     0.5911 0.000 0.000 0.000 0.028 0.972
#> GSM613724     5  0.4440    -0.2882 0.468 0.004 0.000 0.000 0.528
#> GSM613725     2  0.6810     0.6314 0.112 0.592 0.208 0.088 0.000
#> GSM613726     1  0.5762     0.3323 0.548 0.000 0.000 0.352 0.100
#> GSM613727     5  0.4561    -0.3541 0.488 0.008 0.000 0.000 0.504
#> GSM613728     2  0.4191     0.6620 0.036 0.808 0.044 0.112 0.000
#> GSM613729     1  0.4989     0.4040 0.520 0.008 0.000 0.016 0.456
#> GSM613730     4  0.5920     0.4121 0.148 0.272 0.000 0.580 0.000
#> GSM613731     4  0.4990     0.3739 0.324 0.000 0.000 0.628 0.048
#> GSM613732     3  0.1041     0.7831 0.000 0.004 0.964 0.032 0.000
#> GSM613733     3  0.4534     0.6066 0.064 0.072 0.796 0.068 0.000
#> GSM613734     5  0.1851     0.5294 0.088 0.000 0.000 0.000 0.912
#> GSM613735     5  0.0703     0.5915 0.000 0.000 0.000 0.024 0.976
#> GSM613736     3  0.1908     0.7697 0.016 0.024 0.936 0.024 0.000
#> GSM613737     4  0.5426     0.5615 0.004 0.000 0.132 0.672 0.192
#> GSM613738     5  0.1892     0.5627 0.004 0.000 0.000 0.080 0.916
#> GSM613739     5  0.1892     0.5627 0.004 0.000 0.000 0.080 0.916
#> GSM613740     3  0.1026     0.7824 0.004 0.004 0.968 0.024 0.000
#> GSM613741     4  0.6712     0.4912 0.180 0.180 0.020 0.600 0.020
#> GSM613742     5  0.2179     0.5389 0.004 0.000 0.000 0.100 0.896
#> GSM613743     3  0.1153     0.7802 0.004 0.008 0.964 0.024 0.000
#> GSM613744     3  0.1041     0.7831 0.000 0.004 0.964 0.032 0.000
#> GSM613745     4  0.6859     0.4437 0.156 0.232 0.024 0.572 0.016
#> GSM613746     2  0.5082     0.6146 0.068 0.768 0.060 0.096 0.008
#> GSM613747     5  0.1851     0.5294 0.088 0.000 0.000 0.000 0.912
#> GSM613748     4  0.4610     0.5614 0.112 0.128 0.004 0.756 0.000
#> GSM613749     1  0.6133    -0.1197 0.496 0.136 0.000 0.368 0.000
#> GSM613750     3  0.4062     0.7031 0.152 0.000 0.796 0.036 0.016
#> GSM613751     3  0.3632     0.7055 0.152 0.000 0.816 0.016 0.016
#> GSM613752     3  0.3632     0.7055 0.152 0.000 0.816 0.016 0.016
#> GSM613753     3  0.5788     0.6110 0.156 0.004 0.672 0.152 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
#> GSM613638     4  0.5542     0.5130 0.000 0.032 0.092 0.688 0.152 0.036
#> GSM613639     4  0.5729     0.2928 0.340 0.000 0.000 0.544 0.048 0.068
#> GSM613640     4  0.4449     0.5269 0.000 0.088 0.048 0.776 0.080 0.008
#> GSM613641     1  0.1096     0.8793 0.964 0.000 0.008 0.004 0.004 0.020
#> GSM613642     2  0.5085     0.4431 0.000 0.688 0.052 0.204 0.052 0.004
#> GSM613643     4  0.3847     0.5470 0.092 0.004 0.004 0.800 0.096 0.004
#> GSM613644     4  0.3865     0.5366 0.072 0.000 0.000 0.808 0.080 0.040
#> GSM613645     4  0.5777     0.1889 0.392 0.000 0.000 0.496 0.044 0.068
#> GSM613646     4  0.5431     0.1296 0.004 0.000 0.016 0.512 0.064 0.404
#> GSM613647     4  0.6071     0.4339 0.000 0.000 0.092 0.544 0.300 0.064
#> GSM613648     3  0.5761     0.4919 0.000 0.004 0.628 0.220 0.080 0.068
#> GSM613649     3  0.5720     0.6043 0.000 0.052 0.684 0.148 0.048 0.068
#> GSM613650     4  0.5655     0.4651 0.004 0.000 0.024 0.624 0.160 0.188
#> GSM613651     5  0.6047    -0.2083 0.000 0.000 0.076 0.380 0.484 0.060
#> GSM613652     5  0.3309     0.8055 0.280 0.000 0.000 0.000 0.720 0.000
#> GSM613653     6  0.5534    -0.0315 0.004 0.000 0.016 0.416 0.072 0.492
#> GSM613654     5  0.3405     0.8079 0.272 0.000 0.000 0.004 0.724 0.000
#> GSM613655     1  0.1820     0.8553 0.924 0.000 0.012 0.000 0.056 0.008
#> GSM613656     5  0.3309     0.8055 0.280 0.000 0.000 0.000 0.720 0.000
#> GSM613657     3  0.2402     0.7197 0.000 0.140 0.856 0.004 0.000 0.000
#> GSM613658     1  0.1476     0.8700 0.948 0.000 0.008 0.004 0.028 0.012
#> GSM613659     6  0.5203     0.3260 0.000 0.104 0.000 0.348 0.000 0.548
#> GSM613660     2  0.1320     0.7145 0.000 0.948 0.016 0.036 0.000 0.000
#> GSM613661     1  0.5119    -0.0141 0.480 0.000 0.000 0.456 0.052 0.012
#> GSM613662     6  0.4495     0.4364 0.000 0.340 0.016 0.020 0.000 0.624
#> GSM613663     1  0.1553     0.8709 0.944 0.000 0.004 0.032 0.012 0.008
#> GSM613664     6  0.4546     0.0662 0.000 0.444 0.000 0.008 0.020 0.528
#> GSM613665     2  0.2956     0.6889 0.000 0.856 0.028 0.016 0.000 0.100
#> GSM613666     1  0.1096     0.8793 0.964 0.000 0.008 0.004 0.004 0.020
#> GSM613667     4  0.5782     0.1790 0.396 0.000 0.000 0.492 0.044 0.068
#> GSM613668     1  0.1226     0.8691 0.952 0.000 0.004 0.000 0.040 0.004
#> GSM613669     1  0.1096     0.8793 0.964 0.000 0.008 0.004 0.004 0.020
#> GSM613670     6  0.4158     0.5075 0.000 0.244 0.000 0.052 0.000 0.704
#> GSM613671     1  0.1096     0.8793 0.964 0.000 0.008 0.004 0.004 0.020
#> GSM613672     1  0.1734     0.8656 0.932 0.000 0.004 0.008 0.048 0.008
#> GSM613673     1  0.2382     0.8472 0.896 0.000 0.004 0.072 0.020 0.008
#> GSM613674     2  0.3233     0.6666 0.000 0.828 0.000 0.016 0.024 0.132
#> GSM613675     6  0.4583     0.4257 0.000 0.344 0.016 0.024 0.000 0.616
#> GSM613676     2  0.2973     0.6946 0.000 0.860 0.040 0.016 0.000 0.084
#> GSM613677     4  0.6806     0.3818 0.000 0.084 0.200 0.576 0.076 0.064
#> GSM613678     4  0.6426     0.2019 0.056 0.060 0.000 0.544 0.040 0.300
#> GSM613679     2  0.1686     0.7113 0.000 0.932 0.004 0.004 0.008 0.052
#> GSM613680     1  0.1080     0.8741 0.960 0.000 0.004 0.000 0.032 0.004
#> GSM613681     1  0.0405     0.8819 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM613682     1  0.1836     0.8637 0.928 0.000 0.004 0.048 0.012 0.008
#> GSM613683     1  0.1732     0.8483 0.920 0.000 0.004 0.000 0.072 0.004
#> GSM613684     2  0.4839     0.4465 0.000 0.640 0.012 0.016 0.028 0.304
#> GSM613685     2  0.3233     0.6666 0.000 0.828 0.000 0.016 0.024 0.132
#> GSM613686     1  0.4696     0.5806 0.704 0.000 0.000 0.212 0.048 0.036
#> GSM613687     1  0.1836     0.8637 0.928 0.000 0.004 0.048 0.012 0.008
#> GSM613688     2  0.4928    -0.0260 0.000 0.480 0.008 0.008 0.028 0.476
#> GSM613689     3  0.6654     0.3878 0.000 0.048 0.540 0.280 0.076 0.056
#> GSM613690     3  0.5889     0.4376 0.000 0.000 0.592 0.248 0.100 0.060
#> GSM613691     6  0.3886     0.5543 0.000 0.164 0.008 0.056 0.000 0.772
#> GSM613692     5  0.3642     0.8053 0.236 0.000 0.000 0.008 0.744 0.012
#> GSM613693     6  0.4900     0.4118 0.000 0.260 0.076 0.000 0.012 0.652
#> GSM613694     4  0.6105     0.4759 0.000 0.000 0.084 0.588 0.220 0.108
#> GSM613695     3  0.6510     0.1245 0.000 0.000 0.432 0.376 0.132 0.060
#> GSM613696     6  0.6948    -0.1460 0.000 0.000 0.152 0.304 0.104 0.440
#> GSM613697     5  0.5962    -0.1091 0.000 0.000 0.076 0.336 0.528 0.060
#> GSM613698     4  0.6828     0.3470 0.000 0.000 0.116 0.436 0.336 0.112
#> GSM613699     4  0.6667     0.3319 0.000 0.000 0.216 0.528 0.128 0.128
#> GSM613700     2  0.1320     0.7140 0.000 0.948 0.016 0.036 0.000 0.000
#> GSM613701     2  0.5245     0.0211 0.004 0.480 0.000 0.444 0.004 0.068
#> GSM613702     4  0.5729     0.3118 0.000 0.252 0.012 0.588 0.008 0.140
#> GSM613703     1  0.4169     0.7261 0.788 0.000 0.008 0.120 0.044 0.040
#> GSM613704     6  0.4345     0.4215 0.000 0.344 0.016 0.012 0.000 0.628
#> GSM613705     4  0.5918     0.4903 0.000 0.032 0.116 0.656 0.152 0.044
#> GSM613706     4  0.4206     0.5068 0.008 0.152 0.028 0.772 0.040 0.000
#> GSM613707     2  0.3233     0.6666 0.000 0.828 0.000 0.016 0.024 0.132
#> GSM613708     1  0.2620     0.8155 0.868 0.000 0.000 0.108 0.012 0.012
#> GSM613709     1  0.1096     0.8793 0.964 0.000 0.008 0.004 0.004 0.020
#> GSM613710     2  0.1644     0.7075 0.000 0.932 0.028 0.040 0.000 0.000
#> GSM613711     3  0.2442     0.7173 0.000 0.144 0.852 0.004 0.000 0.000
#> GSM613712     4  0.6876     0.3607 0.000 0.000 0.148 0.464 0.284 0.104
#> GSM613713     2  0.5688     0.4768 0.000 0.632 0.220 0.016 0.024 0.108
#> GSM613714     3  0.6244     0.2683 0.000 0.000 0.496 0.340 0.104 0.060
#> GSM613715     3  0.5530     0.5048 0.000 0.000 0.644 0.212 0.076 0.068
#> GSM613716     6  0.5194     0.3861 0.000 0.000 0.124 0.136 0.048 0.692
#> GSM613717     3  0.3196     0.7142 0.000 0.156 0.816 0.020 0.000 0.008
#> GSM613718     3  0.2431     0.7229 0.000 0.132 0.860 0.008 0.000 0.000
#> GSM613719     4  0.6404     0.4332 0.000 0.000 0.052 0.524 0.188 0.236
#> GSM613720     6  0.5396     0.4673 0.000 0.100 0.180 0.032 0.012 0.676
#> GSM613721     6  0.3513     0.5389 0.000 0.176 0.004 0.020 0.008 0.792
#> GSM613722     2  0.1464     0.7125 0.000 0.944 0.016 0.036 0.000 0.004
#> GSM613723     5  0.3405     0.8079 0.272 0.000 0.000 0.004 0.724 0.000
#> GSM613724     1  0.1429     0.8608 0.940 0.000 0.004 0.000 0.052 0.004
#> GSM613725     2  0.1124     0.7148 0.000 0.956 0.008 0.036 0.000 0.000
#> GSM613726     4  0.5216     0.2320 0.376 0.000 0.004 0.556 0.040 0.024
#> GSM613727     1  0.1672     0.8729 0.940 0.000 0.012 0.004 0.028 0.016
#> GSM613728     2  0.4708     0.2367 0.000 0.612 0.016 0.032 0.000 0.340
#> GSM613729     1  0.1406     0.8766 0.952 0.000 0.008 0.016 0.004 0.020
#> GSM613730     4  0.5959     0.3472 0.000 0.140 0.012 0.620 0.040 0.188
#> GSM613731     4  0.4101     0.5130 0.192 0.004 0.004 0.752 0.044 0.004
#> GSM613732     3  0.2431     0.7229 0.000 0.132 0.860 0.008 0.000 0.000
#> GSM613733     3  0.3993     0.4188 0.000 0.400 0.592 0.008 0.000 0.000
#> GSM613734     5  0.3634     0.7056 0.356 0.000 0.000 0.000 0.644 0.000
#> GSM613735     5  0.3330     0.8018 0.284 0.000 0.000 0.000 0.716 0.000
#> GSM613736     3  0.2809     0.7048 0.000 0.168 0.824 0.004 0.004 0.000
#> GSM613737     4  0.6833     0.3600 0.000 0.000 0.128 0.456 0.308 0.108
#> GSM613738     5  0.3642     0.8053 0.236 0.000 0.000 0.008 0.744 0.012
#> GSM613739     5  0.3642     0.8059 0.236 0.000 0.000 0.008 0.744 0.012
#> GSM613740     3  0.2389     0.7226 0.000 0.128 0.864 0.008 0.000 0.000
#> GSM613741     6  0.5516     0.0133 0.004 0.000 0.016 0.400 0.072 0.508
#> GSM613742     5  0.3693     0.7926 0.216 0.000 0.000 0.016 0.756 0.012
#> GSM613743     3  0.2442     0.7173 0.000 0.144 0.852 0.004 0.000 0.000
#> GSM613744     3  0.2431     0.7229 0.000 0.132 0.860 0.008 0.000 0.000
#> GSM613745     4  0.5464     0.0307 0.004 0.000 0.016 0.472 0.064 0.444
#> GSM613746     6  0.3780     0.4883 0.000 0.248 0.020 0.000 0.004 0.728
#> GSM613747     5  0.3634     0.7056 0.356 0.000 0.000 0.000 0.644 0.000
#> GSM613748     4  0.4780     0.4714 0.000 0.164 0.024 0.732 0.016 0.064
#> GSM613749     4  0.6730     0.3734 0.264 0.044 0.000 0.536 0.044 0.112
#> GSM613750     3  0.4961     0.6166 0.000 0.052 0.756 0.048 0.064 0.080
#> GSM613751     3  0.5197     0.6134 0.000 0.064 0.740 0.052 0.068 0.076
#> GSM613752     3  0.5133     0.6131 0.000 0.064 0.744 0.048 0.064 0.080
#> GSM613753     3  0.4794     0.6115 0.000 0.008 0.752 0.076 0.084 0.080

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 disease.state(p) k
#> SD:kmeans 115         2.58e-02 2
#> SD:kmeans  84         8.50e-02 3
#> SD:kmeans  82         1.56e-03 4
#> SD:kmeans  65         2.34e-05 5
#> SD:kmeans  68         2.71e-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 27425 rows and 116 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 1.000           0.976       0.990         0.5045 0.496   0.496
#> 3 3 0.750           0.863       0.914         0.3062 0.748   0.534
#> 4 4 0.698           0.745       0.819         0.1246 0.851   0.592
#> 5 5 0.725           0.722       0.834         0.0612 0.906   0.652
#> 6 6 0.755           0.703       0.803         0.0378 0.932   0.696

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
#> GSM613638     2  0.9635      0.384 0.388 0.612
#> GSM613639     1  0.0000      0.996 1.000 0.000
#> GSM613640     2  0.0672      0.978 0.008 0.992
#> GSM613641     1  0.0000      0.996 1.000 0.000
#> GSM613642     2  0.0000      0.984 0.000 1.000
#> GSM613643     1  0.0000      0.996 1.000 0.000
#> GSM613644     1  0.0000      0.996 1.000 0.000
#> GSM613645     1  0.0000      0.996 1.000 0.000
#> GSM613646     1  0.0376      0.992 0.996 0.004
#> GSM613647     1  0.0376      0.992 0.996 0.004
#> GSM613648     2  0.0000      0.984 0.000 1.000
#> GSM613649     2  0.0000      0.984 0.000 1.000
#> GSM613650     1  0.0000      0.996 1.000 0.000
#> GSM613651     1  0.0000      0.996 1.000 0.000
#> GSM613652     1  0.0000      0.996 1.000 0.000
#> GSM613653     1  0.0376      0.992 0.996 0.004
#> GSM613654     1  0.0000      0.996 1.000 0.000
#> GSM613655     1  0.0000      0.996 1.000 0.000
#> GSM613656     1  0.0000      0.996 1.000 0.000
#> GSM613657     2  0.0000      0.984 0.000 1.000
#> GSM613658     1  0.0000      0.996 1.000 0.000
#> GSM613659     2  0.0000      0.984 0.000 1.000
#> GSM613660     2  0.0000      0.984 0.000 1.000
#> GSM613661     1  0.0000      0.996 1.000 0.000
#> GSM613662     2  0.0000      0.984 0.000 1.000
#> GSM613663     1  0.0000      0.996 1.000 0.000
#> GSM613664     2  0.0000      0.984 0.000 1.000
#> GSM613665     2  0.0000      0.984 0.000 1.000
#> GSM613666     1  0.0000      0.996 1.000 0.000
#> GSM613667     1  0.0000      0.996 1.000 0.000
#> GSM613668     1  0.0000      0.996 1.000 0.000
#> GSM613669     1  0.0000      0.996 1.000 0.000
#> GSM613670     2  0.0376      0.981 0.004 0.996
#> GSM613671     1  0.0000      0.996 1.000 0.000
#> GSM613672     1  0.0000      0.996 1.000 0.000
#> GSM613673     1  0.0000      0.996 1.000 0.000
#> GSM613674     2  0.0000      0.984 0.000 1.000
#> GSM613675     2  0.0000      0.984 0.000 1.000
#> GSM613676     2  0.0000      0.984 0.000 1.000
#> GSM613677     2  0.0000      0.984 0.000 1.000
#> GSM613678     1  0.0000      0.996 1.000 0.000
#> GSM613679     2  0.0000      0.984 0.000 1.000
#> GSM613680     1  0.0000      0.996 1.000 0.000
#> GSM613681     1  0.0000      0.996 1.000 0.000
#> GSM613682     1  0.0000      0.996 1.000 0.000
#> GSM613683     1  0.0000      0.996 1.000 0.000
#> GSM613684     2  0.0000      0.984 0.000 1.000
#> GSM613685     2  0.0000      0.984 0.000 1.000
#> GSM613686     1  0.0000      0.996 1.000 0.000
#> GSM613687     1  0.0000      0.996 1.000 0.000
#> GSM613688     2  0.0000      0.984 0.000 1.000
#> GSM613689     2  0.0000      0.984 0.000 1.000
#> GSM613690     2  0.0000      0.984 0.000 1.000
#> GSM613691     2  0.0000      0.984 0.000 1.000
#> GSM613692     1  0.0000      0.996 1.000 0.000
#> GSM613693     2  0.0000      0.984 0.000 1.000
#> GSM613694     1  0.0000      0.996 1.000 0.000
#> GSM613695     2  0.0000      0.984 0.000 1.000
#> GSM613696     2  0.0000      0.984 0.000 1.000
#> GSM613697     1  0.0000      0.996 1.000 0.000
#> GSM613698     1  0.0000      0.996 1.000 0.000
#> GSM613699     2  0.2043      0.955 0.032 0.968
#> GSM613700     2  0.0000      0.984 0.000 1.000
#> GSM613701     2  0.0000      0.984 0.000 1.000
#> GSM613702     2  0.0000      0.984 0.000 1.000
#> GSM613703     1  0.0000      0.996 1.000 0.000
#> GSM613704     2  0.0000      0.984 0.000 1.000
#> GSM613705     2  0.5737      0.838 0.136 0.864
#> GSM613706     1  0.0000      0.996 1.000 0.000
#> GSM613707     2  0.0000      0.984 0.000 1.000
#> GSM613708     1  0.0000      0.996 1.000 0.000
#> GSM613709     1  0.0000      0.996 1.000 0.000
#> GSM613710     2  0.0000      0.984 0.000 1.000
#> GSM613711     2  0.0000      0.984 0.000 1.000
#> GSM613712     2  0.9248      0.498 0.340 0.660
#> GSM613713     2  0.0000      0.984 0.000 1.000
#> GSM613714     2  0.0000      0.984 0.000 1.000
#> GSM613715     2  0.0000      0.984 0.000 1.000
#> GSM613716     2  0.0000      0.984 0.000 1.000
#> GSM613717     2  0.0000      0.984 0.000 1.000
#> GSM613718     2  0.0000      0.984 0.000 1.000
#> GSM613719     1  0.0000      0.996 1.000 0.000
#> GSM613720     2  0.0000      0.984 0.000 1.000
#> GSM613721     2  0.0000      0.984 0.000 1.000
#> GSM613722     2  0.0000      0.984 0.000 1.000
#> GSM613723     1  0.0000      0.996 1.000 0.000
#> GSM613724     1  0.0000      0.996 1.000 0.000
#> GSM613725     2  0.0000      0.984 0.000 1.000
#> GSM613726     1  0.0000      0.996 1.000 0.000
#> GSM613727     1  0.0000      0.996 1.000 0.000
#> GSM613728     2  0.0000      0.984 0.000 1.000
#> GSM613729     1  0.0000      0.996 1.000 0.000
#> GSM613730     2  0.0000      0.984 0.000 1.000
#> GSM613731     1  0.0000      0.996 1.000 0.000
#> GSM613732     2  0.0000      0.984 0.000 1.000
#> GSM613733     2  0.0000      0.984 0.000 1.000
#> GSM613734     1  0.0000      0.996 1.000 0.000
#> GSM613735     1  0.0000      0.996 1.000 0.000
#> GSM613736     2  0.0000      0.984 0.000 1.000
#> GSM613737     1  0.0000      0.996 1.000 0.000
#> GSM613738     1  0.0000      0.996 1.000 0.000
#> GSM613739     1  0.0000      0.996 1.000 0.000
#> GSM613740     2  0.0000      0.984 0.000 1.000
#> GSM613741     1  0.0376      0.992 0.996 0.004
#> GSM613742     1  0.0000      0.996 1.000 0.000
#> GSM613743     2  0.0000      0.984 0.000 1.000
#> GSM613744     2  0.0000      0.984 0.000 1.000
#> GSM613745     1  0.7674      0.707 0.776 0.224
#> GSM613746     2  0.0000      0.984 0.000 1.000
#> GSM613747     1  0.0000      0.996 1.000 0.000
#> GSM613748     2  0.0000      0.984 0.000 1.000
#> GSM613749     1  0.0000      0.996 1.000 0.000
#> GSM613750     2  0.0000      0.984 0.000 1.000
#> GSM613751     2  0.0000      0.984 0.000 1.000
#> GSM613752     2  0.0000      0.984 0.000 1.000
#> GSM613753     2  0.0000      0.984 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
#> GSM613638     3  0.4291      0.769 0.180 0.000 0.820
#> GSM613639     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613640     3  0.0747      0.881 0.016 0.000 0.984
#> GSM613641     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613642     2  0.4654      0.853 0.000 0.792 0.208
#> GSM613643     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613644     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613645     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613646     1  0.7484      0.176 0.504 0.460 0.036
#> GSM613647     3  0.3482      0.810 0.128 0.000 0.872
#> GSM613648     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613649     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613650     1  0.0747      0.952 0.984 0.000 0.016
#> GSM613651     3  0.5810      0.549 0.336 0.000 0.664
#> GSM613652     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613653     1  0.6769      0.402 0.592 0.392 0.016
#> GSM613654     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613655     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613656     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613657     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613658     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613659     2  0.0000      0.845 0.000 1.000 0.000
#> GSM613660     2  0.4399      0.869 0.000 0.812 0.188
#> GSM613661     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613662     2  0.0000      0.845 0.000 1.000 0.000
#> GSM613663     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613664     2  0.0000      0.845 0.000 1.000 0.000
#> GSM613665     2  0.4399      0.869 0.000 0.812 0.188
#> GSM613666     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613667     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613668     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613669     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613670     2  0.0000      0.845 0.000 1.000 0.000
#> GSM613671     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613672     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613673     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613674     2  0.4399      0.869 0.000 0.812 0.188
#> GSM613675     2  0.0000      0.845 0.000 1.000 0.000
#> GSM613676     2  0.4399      0.869 0.000 0.812 0.188
#> GSM613677     3  0.3340      0.790 0.000 0.120 0.880
#> GSM613678     2  0.1031      0.827 0.024 0.976 0.000
#> GSM613679     2  0.4399      0.869 0.000 0.812 0.188
#> GSM613680     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613681     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613682     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613683     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613684     2  0.4399      0.869 0.000 0.812 0.188
#> GSM613685     2  0.4399      0.869 0.000 0.812 0.188
#> GSM613686     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613687     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613688     2  0.4178      0.871 0.000 0.828 0.172
#> GSM613689     3  0.0000      0.885 0.000 0.000 1.000
#> GSM613690     3  0.0000      0.885 0.000 0.000 1.000
#> GSM613691     2  0.0000      0.845 0.000 1.000 0.000
#> GSM613692     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613693     2  0.4399      0.869 0.000 0.812 0.188
#> GSM613694     3  0.4504      0.755 0.196 0.000 0.804
#> GSM613695     3  0.0000      0.885 0.000 0.000 1.000
#> GSM613696     3  0.4842      0.753 0.000 0.224 0.776
#> GSM613697     3  0.4750      0.736 0.216 0.000 0.784
#> GSM613698     3  0.5497      0.782 0.064 0.124 0.812
#> GSM613699     3  0.0747      0.880 0.016 0.000 0.984
#> GSM613700     2  0.4399      0.869 0.000 0.812 0.188
#> GSM613701     2  0.4121      0.870 0.000 0.832 0.168
#> GSM613702     2  0.1860      0.857 0.000 0.948 0.052
#> GSM613703     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613704     2  0.0000      0.845 0.000 1.000 0.000
#> GSM613705     3  0.0000      0.885 0.000 0.000 1.000
#> GSM613706     1  0.4413      0.813 0.852 0.124 0.024
#> GSM613707     2  0.4399      0.869 0.000 0.812 0.188
#> GSM613708     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613709     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613710     2  0.4654      0.853 0.000 0.792 0.208
#> GSM613711     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613712     3  0.4235      0.773 0.176 0.000 0.824
#> GSM613713     2  0.5363      0.772 0.000 0.724 0.276
#> GSM613714     3  0.0000      0.885 0.000 0.000 1.000
#> GSM613715     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613716     3  0.5327      0.708 0.000 0.272 0.728
#> GSM613717     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613718     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613719     3  0.8694      0.545 0.268 0.152 0.580
#> GSM613720     3  0.6008      0.539 0.000 0.372 0.628
#> GSM613721     2  0.0000      0.845 0.000 1.000 0.000
#> GSM613722     2  0.4452      0.867 0.000 0.808 0.192
#> GSM613723     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613724     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613725     2  0.4399      0.869 0.000 0.812 0.188
#> GSM613726     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613727     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613728     2  0.2165      0.859 0.000 0.936 0.064
#> GSM613729     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613730     2  0.0000      0.845 0.000 1.000 0.000
#> GSM613731     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613732     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613733     3  0.1411      0.879 0.000 0.036 0.964
#> GSM613734     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613735     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613736     3  0.1163      0.886 0.000 0.028 0.972
#> GSM613737     3  0.4399      0.761 0.188 0.000 0.812
#> GSM613738     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613739     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613740     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613741     1  0.6783      0.393 0.588 0.396 0.016
#> GSM613742     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613743     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613744     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613745     2  0.7187      0.539 0.232 0.692 0.076
#> GSM613746     2  0.0000      0.845 0.000 1.000 0.000
#> GSM613747     1  0.0000      0.967 1.000 0.000 0.000
#> GSM613748     2  0.4399      0.868 0.000 0.812 0.188
#> GSM613749     2  0.6280      0.145 0.460 0.540 0.000
#> GSM613750     3  0.0892      0.887 0.000 0.020 0.980
#> GSM613751     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613752     3  0.1031      0.888 0.000 0.024 0.976
#> GSM613753     3  0.0000      0.885 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
#> GSM613638     3  0.5511      0.323 0.016 0.000 0.500 0.484
#> GSM613639     1  0.0524      0.951 0.988 0.008 0.000 0.004
#> GSM613640     3  0.7851      0.365 0.144 0.024 0.480 0.352
#> GSM613641     1  0.0000      0.959 1.000 0.000 0.000 0.000
#> GSM613642     2  0.4584      0.751 0.000 0.696 0.300 0.004
#> GSM613643     1  0.3649      0.656 0.796 0.000 0.000 0.204
#> GSM613644     1  0.3791      0.658 0.796 0.004 0.000 0.200
#> GSM613645     1  0.0657      0.947 0.984 0.012 0.000 0.004
#> GSM613646     4  0.8531      0.387 0.196 0.296 0.048 0.460
#> GSM613647     4  0.2647      0.571 0.000 0.000 0.120 0.880
#> GSM613648     3  0.1557      0.823 0.000 0.000 0.944 0.056
#> GSM613649     3  0.1118      0.826 0.000 0.000 0.964 0.036
#> GSM613650     4  0.5182      0.634 0.356 0.008 0.004 0.632
#> GSM613651     4  0.3107      0.611 0.036 0.000 0.080 0.884
#> GSM613652     4  0.4624      0.658 0.340 0.000 0.000 0.660
#> GSM613653     4  0.8026      0.426 0.180 0.288 0.028 0.504
#> GSM613654     4  0.4624      0.658 0.340 0.000 0.000 0.660
#> GSM613655     1  0.0336      0.958 0.992 0.000 0.000 0.008
#> GSM613656     4  0.4624      0.658 0.340 0.000 0.000 0.660
#> GSM613657     3  0.0000      0.826 0.000 0.000 1.000 0.000
#> GSM613658     1  0.0336      0.958 0.992 0.000 0.000 0.008
#> GSM613659     2  0.2281      0.710 0.000 0.904 0.000 0.096
#> GSM613660     2  0.4428      0.775 0.000 0.720 0.276 0.004
#> GSM613661     1  0.0000      0.959 1.000 0.000 0.000 0.000
#> GSM613662     2  0.2741      0.719 0.000 0.892 0.012 0.096
#> GSM613663     1  0.0188      0.959 0.996 0.000 0.000 0.004
#> GSM613664     2  0.2101      0.733 0.000 0.928 0.012 0.060
#> GSM613665     2  0.4313      0.786 0.000 0.736 0.260 0.004
#> GSM613666     1  0.0000      0.959 1.000 0.000 0.000 0.000
#> GSM613667     1  0.0524      0.951 0.988 0.008 0.000 0.004
#> GSM613668     1  0.0336      0.958 0.992 0.000 0.000 0.008
#> GSM613669     1  0.0000      0.959 1.000 0.000 0.000 0.000
#> GSM613670     2  0.2345      0.708 0.000 0.900 0.000 0.100
#> GSM613671     1  0.0000      0.959 1.000 0.000 0.000 0.000
#> GSM613672     1  0.0469      0.956 0.988 0.000 0.000 0.012
#> GSM613673     1  0.0336      0.958 0.992 0.000 0.000 0.008
#> GSM613674     2  0.4103      0.788 0.000 0.744 0.256 0.000
#> GSM613675     2  0.2861      0.722 0.000 0.888 0.016 0.096
#> GSM613676     2  0.4428      0.775 0.000 0.720 0.276 0.004
#> GSM613677     3  0.2714      0.717 0.000 0.112 0.884 0.004
#> GSM613678     2  0.6743      0.122 0.392 0.512 0.000 0.096
#> GSM613679     2  0.4283      0.787 0.000 0.740 0.256 0.004
#> GSM613680     1  0.0336      0.958 0.992 0.000 0.000 0.008
#> GSM613681     1  0.0000      0.959 1.000 0.000 0.000 0.000
#> GSM613682     1  0.0336      0.958 0.992 0.000 0.000 0.008
#> GSM613683     1  0.0469      0.956 0.988 0.000 0.000 0.012
#> GSM613684     2  0.4103      0.788 0.000 0.744 0.256 0.000
#> GSM613685     2  0.4103      0.788 0.000 0.744 0.256 0.000
#> GSM613686     1  0.0188      0.957 0.996 0.000 0.000 0.004
#> GSM613687     1  0.0188      0.959 0.996 0.000 0.000 0.004
#> GSM613688     2  0.3975      0.790 0.000 0.760 0.240 0.000
#> GSM613689     3  0.1004      0.826 0.000 0.004 0.972 0.024
#> GSM613690     3  0.3024      0.781 0.000 0.000 0.852 0.148
#> GSM613691     2  0.3205      0.707 0.000 0.872 0.024 0.104
#> GSM613692     4  0.4624      0.658 0.340 0.000 0.000 0.660
#> GSM613693     2  0.6611      0.430 0.000 0.460 0.460 0.080
#> GSM613694     4  0.3047      0.582 0.012 0.000 0.116 0.872
#> GSM613695     3  0.3975      0.710 0.000 0.000 0.760 0.240
#> GSM613696     3  0.5833      0.596 0.000 0.212 0.692 0.096
#> GSM613697     4  0.2924      0.592 0.016 0.000 0.100 0.884
#> GSM613698     4  0.2647      0.568 0.000 0.000 0.120 0.880
#> GSM613699     3  0.4188      0.703 0.000 0.004 0.752 0.244
#> GSM613700     2  0.4313      0.786 0.000 0.736 0.260 0.004
#> GSM613701     2  0.4715      0.786 0.016 0.740 0.240 0.004
#> GSM613702     2  0.2928      0.775 0.000 0.880 0.108 0.012
#> GSM613703     1  0.0524      0.951 0.988 0.004 0.000 0.008
#> GSM613704     2  0.2861      0.722 0.000 0.888 0.016 0.096
#> GSM613705     3  0.4972      0.411 0.000 0.000 0.544 0.456
#> GSM613706     1  0.6035      0.519 0.692 0.108 0.004 0.196
#> GSM613707     2  0.4103      0.788 0.000 0.744 0.256 0.000
#> GSM613708     1  0.0336      0.958 0.992 0.000 0.000 0.008
#> GSM613709     1  0.0000      0.959 1.000 0.000 0.000 0.000
#> GSM613710     2  0.4584      0.751 0.000 0.696 0.300 0.004
#> GSM613711     3  0.0921      0.811 0.000 0.028 0.972 0.000
#> GSM613712     4  0.4252      0.362 0.004 0.000 0.252 0.744
#> GSM613713     3  0.4122      0.511 0.000 0.236 0.760 0.004
#> GSM613714     3  0.3764      0.729 0.000 0.000 0.784 0.216
#> GSM613715     3  0.1557      0.823 0.000 0.000 0.944 0.056
#> GSM613716     3  0.6269      0.528 0.000 0.272 0.632 0.096
#> GSM613717     3  0.0921      0.811 0.000 0.028 0.972 0.000
#> GSM613718     3  0.0000      0.826 0.000 0.000 1.000 0.000
#> GSM613719     4  0.4917      0.586 0.024 0.176 0.024 0.776
#> GSM613720     3  0.5798      0.584 0.000 0.208 0.696 0.096
#> GSM613721     2  0.3550      0.705 0.000 0.860 0.044 0.096
#> GSM613722     2  0.4428      0.775 0.000 0.720 0.276 0.004
#> GSM613723     4  0.4624      0.658 0.340 0.000 0.000 0.660
#> GSM613724     1  0.0336      0.958 0.992 0.000 0.000 0.008
#> GSM613725     2  0.4401      0.777 0.000 0.724 0.272 0.004
#> GSM613726     1  0.0000      0.959 1.000 0.000 0.000 0.000
#> GSM613727     1  0.0336      0.958 0.992 0.000 0.000 0.008
#> GSM613728     2  0.3161      0.778 0.000 0.864 0.124 0.012
#> GSM613729     1  0.0000      0.959 1.000 0.000 0.000 0.000
#> GSM613730     2  0.2255      0.729 0.000 0.920 0.012 0.068
#> GSM613731     1  0.0921      0.943 0.972 0.000 0.000 0.028
#> GSM613732     3  0.0000      0.826 0.000 0.000 1.000 0.000
#> GSM613733     3  0.1824      0.781 0.000 0.060 0.936 0.004
#> GSM613734     4  0.4967      0.470 0.452 0.000 0.000 0.548
#> GSM613735     4  0.4643      0.654 0.344 0.000 0.000 0.656
#> GSM613736     3  0.1118      0.808 0.000 0.036 0.964 0.000
#> GSM613737     4  0.2999      0.562 0.004 0.000 0.132 0.864
#> GSM613738     4  0.4624      0.658 0.340 0.000 0.000 0.660
#> GSM613739     4  0.4624      0.658 0.340 0.000 0.000 0.660
#> GSM613740     3  0.0000      0.826 0.000 0.000 1.000 0.000
#> GSM613741     4  0.8026      0.426 0.180 0.288 0.028 0.504
#> GSM613742     4  0.4624      0.658 0.340 0.000 0.000 0.660
#> GSM613743     3  0.0921      0.811 0.000 0.028 0.972 0.000
#> GSM613744     3  0.0000      0.826 0.000 0.000 1.000 0.000
#> GSM613745     4  0.8256      0.356 0.088 0.320 0.092 0.500
#> GSM613746     2  0.3307      0.710 0.000 0.868 0.028 0.104
#> GSM613747     4  0.4941      0.515 0.436 0.000 0.000 0.564
#> GSM613748     2  0.4442      0.779 0.004 0.752 0.236 0.008
#> GSM613749     1  0.1677      0.904 0.948 0.040 0.000 0.012
#> GSM613750     3  0.1474      0.824 0.000 0.000 0.948 0.052
#> GSM613751     3  0.0000      0.826 0.000 0.000 1.000 0.000
#> GSM613752     3  0.0000      0.826 0.000 0.000 1.000 0.000
#> GSM613753     3  0.3764      0.730 0.000 0.000 0.784 0.216

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     5  0.7502     0.2388 0.000 0.144 0.260 0.100 0.496
#> GSM613639     1  0.1544     0.8950 0.932 0.000 0.000 0.068 0.000
#> GSM613640     2  0.8733     0.0477 0.028 0.340 0.264 0.104 0.264
#> GSM613641     1  0.0000     0.9384 1.000 0.000 0.000 0.000 0.000
#> GSM613642     2  0.3106     0.7493 0.000 0.844 0.132 0.024 0.000
#> GSM613643     1  0.6564     0.3428 0.588 0.056 0.000 0.104 0.252
#> GSM613644     1  0.7466     0.0308 0.464 0.068 0.004 0.140 0.324
#> GSM613645     1  0.1768     0.8880 0.924 0.004 0.000 0.072 0.000
#> GSM613646     4  0.3258     0.6382 0.028 0.016 0.016 0.876 0.064
#> GSM613647     5  0.2721     0.6592 0.000 0.036 0.016 0.052 0.896
#> GSM613648     3  0.0566     0.9182 0.000 0.004 0.984 0.000 0.012
#> GSM613649     3  0.0162     0.9217 0.000 0.004 0.996 0.000 0.000
#> GSM613650     5  0.6269     0.5385 0.188 0.000 0.000 0.284 0.528
#> GSM613651     5  0.0324     0.6936 0.004 0.004 0.000 0.000 0.992
#> GSM613652     5  0.3395     0.7577 0.236 0.000 0.000 0.000 0.764
#> GSM613653     4  0.2707     0.6263 0.024 0.000 0.000 0.876 0.100
#> GSM613654     5  0.3395     0.7577 0.236 0.000 0.000 0.000 0.764
#> GSM613655     1  0.0290     0.9386 0.992 0.000 0.000 0.000 0.008
#> GSM613656     5  0.3395     0.7577 0.236 0.000 0.000 0.000 0.764
#> GSM613657     3  0.0290     0.9229 0.000 0.008 0.992 0.000 0.000
#> GSM613658     1  0.0162     0.9387 0.996 0.000 0.000 0.000 0.004
#> GSM613659     4  0.4171     0.4677 0.000 0.396 0.000 0.604 0.000
#> GSM613660     2  0.2852     0.7410 0.000 0.828 0.172 0.000 0.000
#> GSM613661     1  0.0162     0.9371 0.996 0.000 0.000 0.004 0.000
#> GSM613662     4  0.4649     0.4578 0.000 0.404 0.016 0.580 0.000
#> GSM613663     1  0.0162     0.9387 0.996 0.000 0.000 0.000 0.004
#> GSM613664     2  0.4235    -0.1039 0.000 0.576 0.000 0.424 0.000
#> GSM613665     2  0.3656     0.7379 0.000 0.800 0.168 0.032 0.000
#> GSM613666     1  0.0000     0.9384 1.000 0.000 0.000 0.000 0.000
#> GSM613667     1  0.1768     0.8880 0.924 0.004 0.000 0.072 0.000
#> GSM613668     1  0.0290     0.9386 0.992 0.000 0.000 0.000 0.008
#> GSM613669     1  0.0000     0.9384 1.000 0.000 0.000 0.000 0.000
#> GSM613670     4  0.4101     0.4995 0.000 0.372 0.000 0.628 0.000
#> GSM613671     1  0.0162     0.9371 0.996 0.000 0.000 0.004 0.000
#> GSM613672     1  0.0290     0.9386 0.992 0.000 0.000 0.000 0.008
#> GSM613673     1  0.0290     0.9386 0.992 0.000 0.000 0.000 0.008
#> GSM613674     2  0.3849     0.7297 0.000 0.808 0.112 0.080 0.000
#> GSM613675     4  0.4674     0.4371 0.000 0.416 0.016 0.568 0.000
#> GSM613676     2  0.3929     0.7179 0.000 0.764 0.208 0.028 0.000
#> GSM613677     3  0.4914     0.5507 0.000 0.204 0.704 0.092 0.000
#> GSM613678     4  0.6545     0.3086 0.284 0.240 0.000 0.476 0.000
#> GSM613679     2  0.3389     0.7454 0.000 0.836 0.116 0.048 0.000
#> GSM613680     1  0.0290     0.9386 0.992 0.000 0.000 0.000 0.008
#> GSM613681     1  0.0000     0.9384 1.000 0.000 0.000 0.000 0.000
#> GSM613682     1  0.0290     0.9386 0.992 0.000 0.000 0.000 0.008
#> GSM613683     1  0.0290     0.9386 0.992 0.000 0.000 0.000 0.008
#> GSM613684     2  0.5086     0.6208 0.000 0.700 0.156 0.144 0.000
#> GSM613685     2  0.3849     0.7297 0.000 0.808 0.112 0.080 0.000
#> GSM613686     1  0.0794     0.9224 0.972 0.000 0.000 0.028 0.000
#> GSM613687     1  0.0290     0.9386 0.992 0.000 0.000 0.000 0.008
#> GSM613688     2  0.4541     0.6105 0.000 0.744 0.084 0.172 0.000
#> GSM613689     3  0.1800     0.8981 0.000 0.048 0.932 0.000 0.020
#> GSM613690     3  0.1357     0.8948 0.000 0.004 0.948 0.000 0.048
#> GSM613691     4  0.3550     0.6482 0.000 0.184 0.020 0.796 0.000
#> GSM613692     5  0.3395     0.7577 0.236 0.000 0.000 0.000 0.764
#> GSM613693     4  0.6499     0.2909 0.000 0.192 0.368 0.440 0.000
#> GSM613694     5  0.3024     0.6657 0.008 0.012 0.064 0.032 0.884
#> GSM613695     3  0.3319     0.7920 0.000 0.020 0.820 0.000 0.160
#> GSM613696     4  0.6010     0.4660 0.000 0.096 0.304 0.584 0.016
#> GSM613697     5  0.0451     0.6960 0.008 0.004 0.000 0.000 0.988
#> GSM613698     5  0.1471     0.6894 0.000 0.004 0.020 0.024 0.952
#> GSM613699     3  0.4196     0.7486 0.000 0.016 0.768 0.024 0.192
#> GSM613700     2  0.2377     0.7536 0.000 0.872 0.128 0.000 0.000
#> GSM613701     2  0.1026     0.7053 0.000 0.968 0.024 0.004 0.004
#> GSM613702     2  0.2351     0.6661 0.000 0.896 0.016 0.088 0.000
#> GSM613703     1  0.1410     0.9018 0.940 0.000 0.000 0.060 0.000
#> GSM613704     4  0.4640     0.4648 0.000 0.400 0.016 0.584 0.000
#> GSM613705     5  0.7634     0.0785 0.000 0.140 0.312 0.100 0.448
#> GSM613706     2  0.7704     0.2319 0.220 0.500 0.004 0.104 0.172
#> GSM613707     2  0.3906     0.7269 0.000 0.804 0.112 0.084 0.000
#> GSM613708     1  0.0290     0.9386 0.992 0.000 0.000 0.000 0.008
#> GSM613709     1  0.0000     0.9384 1.000 0.000 0.000 0.000 0.000
#> GSM613710     2  0.3476     0.7327 0.000 0.804 0.176 0.020 0.000
#> GSM613711     3  0.0290     0.9229 0.000 0.008 0.992 0.000 0.000
#> GSM613712     5  0.1717     0.6775 0.000 0.008 0.052 0.004 0.936
#> GSM613713     3  0.4485     0.4923 0.000 0.292 0.680 0.028 0.000
#> GSM613714     3  0.2660     0.8356 0.000 0.008 0.864 0.000 0.128
#> GSM613715     3  0.0671     0.9163 0.000 0.004 0.980 0.000 0.016
#> GSM613716     4  0.4413     0.5851 0.000 0.044 0.232 0.724 0.000
#> GSM613717     3  0.0290     0.9229 0.000 0.008 0.992 0.000 0.000
#> GSM613718     3  0.0162     0.9235 0.000 0.004 0.996 0.000 0.000
#> GSM613719     5  0.4533     0.2637 0.008 0.000 0.000 0.448 0.544
#> GSM613720     4  0.5084     0.5030 0.000 0.052 0.332 0.616 0.000
#> GSM613721     4  0.3305     0.6304 0.000 0.224 0.000 0.776 0.000
#> GSM613722     2  0.2424     0.7533 0.000 0.868 0.132 0.000 0.000
#> GSM613723     5  0.3395     0.7577 0.236 0.000 0.000 0.000 0.764
#> GSM613724     1  0.0290     0.9386 0.992 0.000 0.000 0.000 0.008
#> GSM613725     2  0.2377     0.7536 0.000 0.872 0.128 0.000 0.000
#> GSM613726     1  0.0693     0.9331 0.980 0.012 0.000 0.000 0.008
#> GSM613727     1  0.0290     0.9386 0.992 0.000 0.000 0.000 0.008
#> GSM613728     2  0.4152     0.6165 0.000 0.772 0.060 0.168 0.000
#> GSM613729     1  0.0290     0.9358 0.992 0.000 0.000 0.008 0.000
#> GSM613730     2  0.4171     0.3051 0.000 0.604 0.000 0.396 0.000
#> GSM613731     1  0.4519     0.7408 0.792 0.056 0.000 0.104 0.048
#> GSM613732     3  0.0162     0.9235 0.000 0.004 0.996 0.000 0.000
#> GSM613733     3  0.1341     0.8901 0.000 0.056 0.944 0.000 0.000
#> GSM613734     5  0.4088     0.5834 0.368 0.000 0.000 0.000 0.632
#> GSM613735     5  0.3424     0.7540 0.240 0.000 0.000 0.000 0.760
#> GSM613736     3  0.0963     0.9091 0.000 0.036 0.964 0.000 0.000
#> GSM613737     5  0.1990     0.6701 0.000 0.004 0.068 0.008 0.920
#> GSM613738     5  0.3395     0.7577 0.236 0.000 0.000 0.000 0.764
#> GSM613739     5  0.3395     0.7577 0.236 0.000 0.000 0.000 0.764
#> GSM613740     3  0.0290     0.9229 0.000 0.008 0.992 0.000 0.000
#> GSM613741     4  0.2653     0.6288 0.024 0.000 0.000 0.880 0.096
#> GSM613742     5  0.3395     0.7577 0.236 0.000 0.000 0.000 0.764
#> GSM613743     3  0.0290     0.9229 0.000 0.008 0.992 0.000 0.000
#> GSM613744     3  0.0162     0.9235 0.000 0.004 0.996 0.000 0.000
#> GSM613745     4  0.3145     0.6383 0.008 0.016 0.024 0.876 0.076
#> GSM613746     4  0.3596     0.6433 0.000 0.200 0.016 0.784 0.000
#> GSM613747     5  0.4219     0.4896 0.416 0.000 0.000 0.000 0.584
#> GSM613748     2  0.4622     0.5947 0.000 0.764 0.088 0.136 0.012
#> GSM613749     1  0.2370     0.8725 0.904 0.040 0.000 0.056 0.000
#> GSM613750     3  0.0566     0.9209 0.000 0.004 0.984 0.000 0.012
#> GSM613751     3  0.0162     0.9235 0.000 0.004 0.996 0.000 0.000
#> GSM613752     3  0.0162     0.9235 0.000 0.004 0.996 0.000 0.000
#> GSM613753     3  0.2124     0.8588 0.000 0.004 0.900 0.000 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
#> GSM613638     4  0.3526      0.688 0.000 0.004 0.028 0.792 0.172 0.004
#> GSM613639     1  0.2679      0.852 0.876 0.004 0.000 0.024 0.008 0.088
#> GSM613640     4  0.3034      0.687 0.000 0.032 0.048 0.864 0.056 0.000
#> GSM613641     1  0.0000      0.948 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613642     2  0.4569      0.604 0.000 0.700 0.096 0.200 0.000 0.004
#> GSM613643     4  0.5202      0.566 0.196 0.000 0.000 0.616 0.188 0.000
#> GSM613644     4  0.5172      0.583 0.148 0.000 0.000 0.644 0.200 0.008
#> GSM613645     1  0.2594      0.860 0.880 0.004 0.000 0.028 0.004 0.084
#> GSM613646     6  0.2136      0.566 0.012 0.000 0.000 0.064 0.016 0.908
#> GSM613647     5  0.4425      0.219 0.000 0.004 0.020 0.364 0.608 0.004
#> GSM613648     3  0.0767      0.900 0.000 0.004 0.976 0.012 0.008 0.000
#> GSM613649     3  0.0520      0.905 0.000 0.008 0.984 0.008 0.000 0.000
#> GSM613650     6  0.6194      0.221 0.092 0.004 0.000 0.068 0.284 0.552
#> GSM613651     5  0.1299      0.749 0.000 0.004 0.004 0.036 0.952 0.004
#> GSM613652     5  0.2219      0.839 0.136 0.000 0.000 0.000 0.864 0.000
#> GSM613653     6  0.2849      0.556 0.028 0.004 0.000 0.068 0.024 0.876
#> GSM613654     5  0.2219      0.839 0.136 0.000 0.000 0.000 0.864 0.000
#> GSM613655     1  0.1082      0.944 0.956 0.000 0.000 0.004 0.040 0.000
#> GSM613656     5  0.2219      0.839 0.136 0.000 0.000 0.000 0.864 0.000
#> GSM613657     3  0.0692      0.907 0.000 0.020 0.976 0.004 0.000 0.000
#> GSM613658     1  0.0713      0.948 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM613659     2  0.4768      0.163 0.000 0.532 0.000 0.052 0.000 0.416
#> GSM613660     2  0.4782      0.615 0.000 0.700 0.120 0.168 0.000 0.012
#> GSM613661     1  0.0291      0.945 0.992 0.004 0.000 0.004 0.000 0.000
#> GSM613662     2  0.4723      0.190 0.000 0.548 0.004 0.040 0.000 0.408
#> GSM613663     1  0.0508      0.949 0.984 0.000 0.000 0.004 0.012 0.000
#> GSM613664     2  0.3420      0.461 0.000 0.748 0.000 0.012 0.000 0.240
#> GSM613665     2  0.2462      0.677 0.000 0.876 0.096 0.028 0.000 0.000
#> GSM613666     1  0.0260      0.949 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM613667     1  0.2432      0.871 0.892 0.004 0.000 0.028 0.004 0.072
#> GSM613668     1  0.1082      0.944 0.956 0.000 0.000 0.004 0.040 0.000
#> GSM613669     1  0.0000      0.948 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613670     2  0.4726      0.154 0.000 0.528 0.000 0.048 0.000 0.424
#> GSM613671     1  0.0146      0.947 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM613672     1  0.1152      0.942 0.952 0.000 0.000 0.004 0.044 0.000
#> GSM613673     1  0.1082      0.944 0.956 0.000 0.000 0.004 0.040 0.000
#> GSM613674     2  0.1674      0.676 0.000 0.924 0.068 0.004 0.000 0.004
#> GSM613675     2  0.4716      0.197 0.000 0.552 0.004 0.040 0.000 0.404
#> GSM613676     2  0.2709      0.663 0.000 0.848 0.132 0.020 0.000 0.000
#> GSM613677     3  0.4986      0.193 0.000 0.036 0.540 0.408 0.004 0.012
#> GSM613678     6  0.7030      0.124 0.316 0.308 0.000 0.060 0.000 0.316
#> GSM613679     2  0.2006      0.678 0.000 0.904 0.080 0.016 0.000 0.000
#> GSM613680     1  0.1082      0.944 0.956 0.000 0.000 0.004 0.040 0.000
#> GSM613681     1  0.0000      0.948 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613682     1  0.1082      0.944 0.956 0.000 0.000 0.004 0.040 0.000
#> GSM613683     1  0.1219      0.939 0.948 0.000 0.000 0.004 0.048 0.000
#> GSM613684     2  0.3214      0.637 0.000 0.840 0.084 0.008 0.000 0.068
#> GSM613685     2  0.1674      0.676 0.000 0.924 0.068 0.004 0.000 0.004
#> GSM613686     1  0.1723      0.904 0.932 0.004 0.000 0.012 0.004 0.048
#> GSM613687     1  0.0777      0.948 0.972 0.000 0.000 0.004 0.024 0.000
#> GSM613688     2  0.2547      0.630 0.000 0.880 0.036 0.004 0.000 0.080
#> GSM613689     3  0.2081      0.888 0.000 0.036 0.916 0.036 0.012 0.000
#> GSM613690     3  0.1313      0.881 0.000 0.004 0.952 0.016 0.028 0.000
#> GSM613691     6  0.4350      0.404 0.000 0.280 0.008 0.036 0.000 0.676
#> GSM613692     5  0.2219      0.839 0.136 0.000 0.000 0.000 0.864 0.000
#> GSM613693     2  0.6297      0.016 0.000 0.428 0.264 0.012 0.000 0.296
#> GSM613694     5  0.5064      0.563 0.004 0.012 0.036 0.068 0.720 0.160
#> GSM613695     3  0.2968      0.818 0.000 0.008 0.864 0.064 0.060 0.004
#> GSM613696     6  0.6544      0.394 0.000 0.200 0.268 0.008 0.032 0.492
#> GSM613697     5  0.1371      0.749 0.000 0.004 0.004 0.040 0.948 0.004
#> GSM613698     5  0.2298      0.745 0.000 0.008 0.024 0.032 0.912 0.024
#> GSM613699     3  0.5493      0.608 0.000 0.012 0.688 0.056 0.132 0.112
#> GSM613700     2  0.4498      0.622 0.000 0.720 0.080 0.188 0.000 0.012
#> GSM613701     2  0.3767      0.539 0.000 0.708 0.004 0.276 0.000 0.012
#> GSM613702     2  0.4392      0.478 0.000 0.628 0.000 0.332 0.000 0.040
#> GSM613703     1  0.2200      0.877 0.900 0.004 0.000 0.012 0.004 0.080
#> GSM613704     2  0.4723      0.190 0.000 0.548 0.004 0.040 0.000 0.408
#> GSM613705     4  0.3868      0.679 0.000 0.004 0.060 0.780 0.152 0.004
#> GSM613706     4  0.3658      0.683 0.012 0.088 0.000 0.824 0.064 0.012
#> GSM613707     2  0.1643      0.674 0.000 0.924 0.068 0.000 0.000 0.008
#> GSM613708     1  0.0458      0.949 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM613709     1  0.0000      0.948 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613710     2  0.4901      0.604 0.000 0.688 0.136 0.164 0.000 0.012
#> GSM613711     3  0.0632      0.905 0.000 0.024 0.976 0.000 0.000 0.000
#> GSM613712     5  0.2290      0.726 0.000 0.004 0.044 0.044 0.904 0.004
#> GSM613713     3  0.4098      0.187 0.000 0.444 0.548 0.004 0.000 0.004
#> GSM613714     3  0.2145      0.867 0.000 0.008 0.912 0.056 0.020 0.004
#> GSM613715     3  0.0717      0.897 0.000 0.000 0.976 0.016 0.008 0.000
#> GSM613716     6  0.5755      0.443 0.000 0.108 0.292 0.032 0.000 0.568
#> GSM613717     3  0.0632      0.905 0.000 0.024 0.976 0.000 0.000 0.000
#> GSM613718     3  0.0692      0.907 0.000 0.020 0.976 0.004 0.000 0.000
#> GSM613719     6  0.5457      0.295 0.020 0.008 0.004 0.068 0.284 0.616
#> GSM613720     6  0.6212      0.361 0.000 0.164 0.324 0.028 0.000 0.484
#> GSM613721     6  0.3707      0.412 0.000 0.312 0.000 0.008 0.000 0.680
#> GSM613722     2  0.4516      0.623 0.000 0.724 0.092 0.172 0.000 0.012
#> GSM613723     5  0.2219      0.839 0.136 0.000 0.000 0.000 0.864 0.000
#> GSM613724     1  0.1285      0.937 0.944 0.000 0.000 0.004 0.052 0.000
#> GSM613725     2  0.4454      0.624 0.000 0.728 0.084 0.176 0.000 0.012
#> GSM613726     1  0.1485      0.936 0.944 0.000 0.000 0.028 0.024 0.004
#> GSM613727     1  0.1082      0.944 0.956 0.000 0.000 0.004 0.040 0.000
#> GSM613728     2  0.3700      0.604 0.000 0.800 0.008 0.076 0.000 0.116
#> GSM613729     1  0.0520      0.943 0.984 0.000 0.000 0.008 0.000 0.008
#> GSM613730     4  0.5627      0.307 0.000 0.156 0.004 0.568 0.004 0.268
#> GSM613731     4  0.4766      0.520 0.316 0.000 0.000 0.612 0.072 0.000
#> GSM613732     3  0.0692      0.907 0.000 0.020 0.976 0.004 0.000 0.000
#> GSM613733     3  0.1970      0.850 0.000 0.092 0.900 0.008 0.000 0.000
#> GSM613734     5  0.3189      0.723 0.236 0.000 0.000 0.004 0.760 0.000
#> GSM613735     5  0.2219      0.839 0.136 0.000 0.000 0.000 0.864 0.000
#> GSM613736     3  0.1152      0.895 0.000 0.044 0.952 0.004 0.000 0.000
#> GSM613737     5  0.2732      0.718 0.000 0.008 0.032 0.048 0.888 0.024
#> GSM613738     5  0.2219      0.839 0.136 0.000 0.000 0.000 0.864 0.000
#> GSM613739     5  0.2178      0.838 0.132 0.000 0.000 0.000 0.868 0.000
#> GSM613740     3  0.0547      0.906 0.000 0.020 0.980 0.000 0.000 0.000
#> GSM613741     6  0.2463      0.563 0.020 0.000 0.000 0.068 0.020 0.892
#> GSM613742     5  0.2219      0.839 0.136 0.000 0.000 0.000 0.864 0.000
#> GSM613743     3  0.0858      0.904 0.000 0.028 0.968 0.004 0.000 0.000
#> GSM613744     3  0.0603      0.907 0.000 0.016 0.980 0.004 0.000 0.000
#> GSM613745     6  0.2325      0.568 0.008 0.004 0.000 0.068 0.020 0.900
#> GSM613746     6  0.4467      0.263 0.000 0.376 0.004 0.028 0.000 0.592
#> GSM613747     5  0.3508      0.644 0.292 0.000 0.000 0.004 0.704 0.000
#> GSM613748     4  0.3172      0.607 0.000 0.152 0.012 0.820 0.000 0.016
#> GSM613749     1  0.2908      0.863 0.872 0.016 0.000 0.064 0.004 0.044
#> GSM613750     3  0.0767      0.905 0.000 0.008 0.976 0.012 0.004 0.000
#> GSM613751     3  0.0717      0.906 0.000 0.016 0.976 0.008 0.000 0.000
#> GSM613752     3  0.0717      0.906 0.000 0.016 0.976 0.008 0.000 0.000
#> GSM613753     3  0.1977      0.861 0.000 0.008 0.920 0.032 0.040 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-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 disease.state(p) k
#> SD:skmeans 114          0.02080 2
#> SD:skmeans 112          0.10850 3
#> SD:skmeans 105          0.04110 4
#> SD:skmeans  97          0.08634 5
#> SD:skmeans  95          0.00715 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 27425 rows and 116 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 0.615           0.873       0.935         0.4950 0.503   0.503
#> 3 3 0.496           0.413       0.602         0.3226 0.777   0.586
#> 4 4 0.639           0.607       0.788         0.1343 0.746   0.403
#> 5 5 0.621           0.586       0.767         0.0308 0.917   0.703
#> 6 6 0.712           0.513       0.770         0.0551 0.837   0.466

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
#> GSM613638     1  0.6438     0.8180 0.836 0.164
#> GSM613639     1  0.0000     0.9304 1.000 0.000
#> GSM613640     1  0.3879     0.8919 0.924 0.076
#> GSM613641     1  0.0000     0.9304 1.000 0.000
#> GSM613642     2  0.6801     0.7947 0.180 0.820
#> GSM613643     1  0.0000     0.9304 1.000 0.000
#> GSM613644     1  0.0000     0.9304 1.000 0.000
#> GSM613645     1  0.0000     0.9304 1.000 0.000
#> GSM613646     1  0.2948     0.9046 0.948 0.052
#> GSM613647     1  0.8144     0.7089 0.748 0.252
#> GSM613648     2  0.1414     0.9200 0.020 0.980
#> GSM613649     2  0.0000     0.9245 0.000 1.000
#> GSM613650     1  0.4298     0.8812 0.912 0.088
#> GSM613651     1  0.6623     0.8103 0.828 0.172
#> GSM613652     1  0.0000     0.9304 1.000 0.000
#> GSM613653     1  0.8608     0.6566 0.716 0.284
#> GSM613654     1  0.0000     0.9304 1.000 0.000
#> GSM613655     1  0.0000     0.9304 1.000 0.000
#> GSM613656     1  0.0000     0.9304 1.000 0.000
#> GSM613657     2  0.0000     0.9245 0.000 1.000
#> GSM613658     1  0.0000     0.9304 1.000 0.000
#> GSM613659     1  0.5629     0.8511 0.868 0.132
#> GSM613660     2  0.3431     0.8980 0.064 0.936
#> GSM613661     1  0.0000     0.9304 1.000 0.000
#> GSM613662     2  0.7139     0.7958 0.196 0.804
#> GSM613663     1  0.0000     0.9304 1.000 0.000
#> GSM613664     1  0.9988     0.0141 0.520 0.480
#> GSM613665     2  0.0000     0.9245 0.000 1.000
#> GSM613666     1  0.0000     0.9304 1.000 0.000
#> GSM613667     1  0.0000     0.9304 1.000 0.000
#> GSM613668     1  0.0000     0.9304 1.000 0.000
#> GSM613669     1  0.0000     0.9304 1.000 0.000
#> GSM613670     1  0.8861     0.6004 0.696 0.304
#> GSM613671     1  0.0000     0.9304 1.000 0.000
#> GSM613672     1  0.0000     0.9304 1.000 0.000
#> GSM613673     1  0.0000     0.9304 1.000 0.000
#> GSM613674     2  0.4562     0.8777 0.096 0.904
#> GSM613675     2  0.1633     0.9198 0.024 0.976
#> GSM613676     2  0.0000     0.9245 0.000 1.000
#> GSM613677     2  0.5737     0.8436 0.136 0.864
#> GSM613678     1  0.0376     0.9286 0.996 0.004
#> GSM613679     2  0.6531     0.8142 0.168 0.832
#> GSM613680     1  0.0000     0.9304 1.000 0.000
#> GSM613681     1  0.0000     0.9304 1.000 0.000
#> GSM613682     1  0.0000     0.9304 1.000 0.000
#> GSM613683     1  0.0000     0.9304 1.000 0.000
#> GSM613684     2  0.0376     0.9238 0.004 0.996
#> GSM613685     2  0.6343     0.8218 0.160 0.840
#> GSM613686     1  0.0000     0.9304 1.000 0.000
#> GSM613687     1  0.0000     0.9304 1.000 0.000
#> GSM613688     2  0.8327     0.6924 0.264 0.736
#> GSM613689     2  0.3584     0.8991 0.068 0.932
#> GSM613690     2  0.4022     0.8919 0.080 0.920
#> GSM613691     2  0.0000     0.9245 0.000 1.000
#> GSM613692     1  0.6438     0.8180 0.836 0.164
#> GSM613693     2  0.0000     0.9245 0.000 1.000
#> GSM613694     1  0.1414     0.9204 0.980 0.020
#> GSM613695     2  0.3879     0.8947 0.076 0.924
#> GSM613696     2  0.4815     0.8736 0.104 0.896
#> GSM613697     1  0.6623     0.8103 0.828 0.172
#> GSM613698     2  0.8016     0.7037 0.244 0.756
#> GSM613699     2  0.8081     0.6959 0.248 0.752
#> GSM613700     2  0.6801     0.8046 0.180 0.820
#> GSM613701     1  0.0938     0.9249 0.988 0.012
#> GSM613702     1  0.7056     0.7426 0.808 0.192
#> GSM613703     1  0.0000     0.9304 1.000 0.000
#> GSM613704     2  0.0938     0.9222 0.012 0.988
#> GSM613705     1  0.5737     0.8420 0.864 0.136
#> GSM613706     1  0.0000     0.9304 1.000 0.000
#> GSM613707     2  0.4022     0.8876 0.080 0.920
#> GSM613708     1  0.0000     0.9304 1.000 0.000
#> GSM613709     1  0.0000     0.9304 1.000 0.000
#> GSM613710     2  0.0000     0.9245 0.000 1.000
#> GSM613711     2  0.0000     0.9245 0.000 1.000
#> GSM613712     1  0.9833     0.3244 0.576 0.424
#> GSM613713     2  0.0000     0.9245 0.000 1.000
#> GSM613714     2  0.2778     0.9098 0.048 0.952
#> GSM613715     2  0.1184     0.9212 0.016 0.984
#> GSM613716     2  0.0000     0.9245 0.000 1.000
#> GSM613717     2  0.0000     0.9245 0.000 1.000
#> GSM613718     2  0.0000     0.9245 0.000 1.000
#> GSM613719     1  0.6801     0.8017 0.820 0.180
#> GSM613720     2  0.0000     0.9245 0.000 1.000
#> GSM613721     2  0.5294     0.8591 0.120 0.880
#> GSM613722     2  0.8267     0.7219 0.260 0.740
#> GSM613723     1  0.0000     0.9304 1.000 0.000
#> GSM613724     1  0.0000     0.9304 1.000 0.000
#> GSM613725     2  0.6531     0.8140 0.168 0.832
#> GSM613726     1  0.0000     0.9304 1.000 0.000
#> GSM613727     1  0.0000     0.9304 1.000 0.000
#> GSM613728     2  0.4298     0.8853 0.088 0.912
#> GSM613729     1  0.0000     0.9304 1.000 0.000
#> GSM613730     1  0.5178     0.8445 0.884 0.116
#> GSM613731     1  0.0000     0.9304 1.000 0.000
#> GSM613732     2  0.0000     0.9245 0.000 1.000
#> GSM613733     2  0.0000     0.9245 0.000 1.000
#> GSM613734     1  0.0000     0.9304 1.000 0.000
#> GSM613735     1  0.0000     0.9304 1.000 0.000
#> GSM613736     2  0.0000     0.9245 0.000 1.000
#> GSM613737     2  0.8661     0.6151 0.288 0.712
#> GSM613738     1  0.4298     0.8811 0.912 0.088
#> GSM613739     1  0.6438     0.8180 0.836 0.164
#> GSM613740     2  0.0000     0.9245 0.000 1.000
#> GSM613741     1  0.4431     0.8791 0.908 0.092
#> GSM613742     1  0.5629     0.8481 0.868 0.132
#> GSM613743     2  0.0000     0.9245 0.000 1.000
#> GSM613744     2  0.0000     0.9245 0.000 1.000
#> GSM613745     1  0.4161     0.8832 0.916 0.084
#> GSM613746     2  0.0000     0.9245 0.000 1.000
#> GSM613747     1  0.0000     0.9304 1.000 0.000
#> GSM613748     1  0.4431     0.8674 0.908 0.092
#> GSM613749     1  0.0000     0.9304 1.000 0.000
#> GSM613750     2  0.0000     0.9245 0.000 1.000
#> GSM613751     2  0.0000     0.9245 0.000 1.000
#> GSM613752     2  0.0000     0.9245 0.000 1.000
#> GSM613753     2  0.3274     0.9037 0.060 0.940

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM613638     1  0.9380     0.3511 0.512 0.256 0.232
#> GSM613639     1  0.5988     0.0791 0.632 0.368 0.000
#> GSM613640     1  0.9604     0.3432 0.476 0.256 0.268
#> GSM613641     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613642     1  0.9926    -0.3699 0.376 0.348 0.276
#> GSM613643     1  0.5138     0.3143 0.748 0.252 0.000
#> GSM613644     1  0.5803     0.3339 0.736 0.248 0.016
#> GSM613645     1  0.5621     0.2385 0.692 0.308 0.000
#> GSM613646     1  0.5529     0.3490 0.704 0.296 0.000
#> GSM613647     1  0.5882     0.1937 0.652 0.000 0.348
#> GSM613648     3  0.3412     0.6475 0.124 0.000 0.876
#> GSM613649     3  0.0000     0.7046 0.000 0.000 1.000
#> GSM613650     1  0.5650     0.2321 0.688 0.312 0.000
#> GSM613651     1  0.6275     0.1991 0.644 0.008 0.348
#> GSM613652     1  0.6180    -0.2216 0.584 0.416 0.000
#> GSM613653     3  0.9664    -0.1749 0.296 0.244 0.460
#> GSM613654     1  0.6180    -0.2216 0.584 0.416 0.000
#> GSM613655     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613656     1  0.6180    -0.2216 0.584 0.416 0.000
#> GSM613657     3  0.0000     0.7046 0.000 0.000 1.000
#> GSM613658     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613659     2  0.6180    -0.2336 0.416 0.584 0.000
#> GSM613660     3  0.7867     0.6861 0.068 0.348 0.584
#> GSM613661     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613662     3  0.6192     0.6551 0.000 0.420 0.580
#> GSM613663     2  0.6111     0.5753 0.396 0.604 0.000
#> GSM613664     2  0.6565    -0.4596 0.008 0.576 0.416
#> GSM613665     3  0.5882     0.7047 0.000 0.348 0.652
#> GSM613666     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613667     1  0.5785     0.1930 0.668 0.332 0.000
#> GSM613668     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613669     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613670     2  0.8760    -0.1495 0.240 0.584 0.176
#> GSM613671     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613672     2  0.5905     0.6670 0.352 0.648 0.000
#> GSM613673     1  0.5948     0.1262 0.640 0.360 0.000
#> GSM613674     3  0.5882     0.7047 0.000 0.348 0.652
#> GSM613675     3  0.7992     0.6886 0.080 0.328 0.592
#> GSM613676     3  0.5882     0.7047 0.000 0.348 0.652
#> GSM613677     3  0.3686     0.6309 0.140 0.000 0.860
#> GSM613678     1  0.5529     0.3490 0.704 0.296 0.000
#> GSM613679     3  0.5882     0.7047 0.000 0.348 0.652
#> GSM613680     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613681     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613682     1  0.5926     0.1536 0.644 0.356 0.000
#> GSM613683     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613684     3  0.5882     0.7047 0.000 0.348 0.652
#> GSM613685     3  0.5882     0.7047 0.000 0.348 0.652
#> GSM613686     1  0.6008     0.1798 0.628 0.372 0.000
#> GSM613687     2  0.5905     0.6668 0.352 0.648 0.000
#> GSM613688     2  0.8984    -0.4901 0.136 0.496 0.368
#> GSM613689     3  0.5977     0.4789 0.252 0.020 0.728
#> GSM613690     3  0.5016     0.4943 0.240 0.000 0.760
#> GSM613691     3  0.6506     0.7170 0.044 0.236 0.720
#> GSM613692     1  0.9336    -0.0318 0.420 0.416 0.164
#> GSM613693     3  0.5760     0.7078 0.000 0.328 0.672
#> GSM613694     1  0.5465     0.3490 0.712 0.288 0.000
#> GSM613695     3  0.6280     0.1419 0.460 0.000 0.540
#> GSM613696     3  0.9806     0.5385 0.244 0.348 0.408
#> GSM613697     1  0.5882     0.1937 0.652 0.000 0.348
#> GSM613698     1  0.5882     0.1937 0.652 0.000 0.348
#> GSM613699     3  0.9914     0.3862 0.348 0.272 0.380
#> GSM613700     3  0.8091     0.6803 0.080 0.348 0.572
#> GSM613701     2  0.6192    -0.2355 0.420 0.580 0.000
#> GSM613702     1  0.6224     0.3397 0.688 0.296 0.016
#> GSM613703     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613704     3  0.5882     0.7047 0.000 0.348 0.652
#> GSM613705     3  0.8976    -0.1285 0.416 0.128 0.456
#> GSM613706     1  0.5529     0.3490 0.704 0.296 0.000
#> GSM613707     3  0.5882     0.7047 0.000 0.348 0.652
#> GSM613708     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613709     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613710     3  0.7787     0.6876 0.064 0.348 0.588
#> GSM613711     3  0.0000     0.7046 0.000 0.000 1.000
#> GSM613712     1  0.5882     0.1937 0.652 0.000 0.348
#> GSM613713     3  0.5882     0.7047 0.000 0.348 0.652
#> GSM613714     3  0.5678     0.4070 0.316 0.000 0.684
#> GSM613715     3  0.2625     0.6716 0.084 0.000 0.916
#> GSM613716     3  0.1529     0.6904 0.040 0.000 0.960
#> GSM613717     3  0.0000     0.7046 0.000 0.000 1.000
#> GSM613718     3  0.0000     0.7046 0.000 0.000 1.000
#> GSM613719     1  0.6566     0.2036 0.636 0.016 0.348
#> GSM613720     3  0.0000     0.7046 0.000 0.000 1.000
#> GSM613721     3  0.9723     0.5514 0.228 0.348 0.424
#> GSM613722     3  0.9379     0.6070 0.180 0.348 0.472
#> GSM613723     1  0.6180    -0.2216 0.584 0.416 0.000
#> GSM613724     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613725     3  0.5882     0.7047 0.000 0.348 0.652
#> GSM613726     1  0.5397     0.3203 0.720 0.280 0.000
#> GSM613727     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613728     3  0.8091     0.6803 0.080 0.348 0.572
#> GSM613729     2  0.5882     0.6735 0.348 0.652 0.000
#> GSM613730     1  0.6432     0.2841 0.568 0.428 0.004
#> GSM613731     1  0.5138     0.3143 0.748 0.252 0.000
#> GSM613732     3  0.0747     0.7010 0.016 0.000 0.984
#> GSM613733     3  0.0000     0.7046 0.000 0.000 1.000
#> GSM613734     1  0.6180    -0.2216 0.584 0.416 0.000
#> GSM613735     1  0.6180    -0.2216 0.584 0.416 0.000
#> GSM613736     3  0.7230     0.7041 0.040 0.344 0.616
#> GSM613737     1  0.5882     0.1937 0.652 0.000 0.348
#> GSM613738     1  0.6398    -0.2169 0.580 0.416 0.004
#> GSM613739     1  0.8657     0.1756 0.592 0.244 0.164
#> GSM613740     3  0.0747     0.7010 0.016 0.000 0.984
#> GSM613741     1  0.8295     0.2974 0.548 0.364 0.088
#> GSM613742     1  0.5042     0.2678 0.836 0.104 0.060
#> GSM613743     3  0.0747     0.7010 0.016 0.000 0.984
#> GSM613744     3  0.0747     0.7010 0.016 0.000 0.984
#> GSM613745     1  0.6016     0.3489 0.724 0.256 0.020
#> GSM613746     3  0.5760     0.7078 0.000 0.328 0.672
#> GSM613747     1  0.6180    -0.2216 0.584 0.416 0.000
#> GSM613748     1  0.6596     0.3596 0.704 0.256 0.040
#> GSM613749     1  0.5254     0.3357 0.736 0.264 0.000
#> GSM613750     3  0.1289     0.6945 0.032 0.000 0.968
#> GSM613751     3  0.0000     0.7046 0.000 0.000 1.000
#> GSM613752     3  0.0747     0.7010 0.016 0.000 0.984
#> GSM613753     3  0.6291     0.1403 0.468 0.000 0.532

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM613638     4  0.6347     0.2021 0.068 0.000 0.384 0.548
#> GSM613639     1  0.4222     0.0900 0.728 0.000 0.000 0.272
#> GSM613640     4  0.6985     0.3857 0.140 0.000 0.312 0.548
#> GSM613641     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613642     2  0.4446     0.7467 0.000 0.776 0.028 0.196
#> GSM613643     4  0.4967     0.5811 0.452 0.000 0.000 0.548
#> GSM613644     4  0.4967     0.5811 0.452 0.000 0.000 0.548
#> GSM613645     4  0.4985     0.5668 0.468 0.000 0.000 0.532
#> GSM613646     1  0.7351    -0.5299 0.452 0.072 0.032 0.444
#> GSM613647     4  0.2760     0.4157 0.000 0.000 0.128 0.872
#> GSM613648     3  0.1929     0.8507 0.000 0.036 0.940 0.024
#> GSM613649     3  0.1637     0.8534 0.000 0.060 0.940 0.000
#> GSM613650     1  0.5292    -0.5282 0.512 0.000 0.008 0.480
#> GSM613651     4  0.3539     0.2710 0.004 0.000 0.176 0.820
#> GSM613652     1  0.4967     0.4377 0.548 0.000 0.000 0.452
#> GSM613653     3  0.6573     0.6192 0.048 0.080 0.692 0.180
#> GSM613654     1  0.4967     0.4377 0.548 0.000 0.000 0.452
#> GSM613655     1  0.1389     0.6462 0.952 0.000 0.000 0.048
#> GSM613656     1  0.4967     0.4377 0.548 0.000 0.000 0.452
#> GSM613657     3  0.1022     0.8692 0.000 0.032 0.968 0.000
#> GSM613658     1  0.0592     0.6637 0.984 0.000 0.000 0.016
#> GSM613659     2  0.4199     0.7696 0.000 0.804 0.032 0.164
#> GSM613660     2  0.2943     0.8619 0.000 0.892 0.076 0.032
#> GSM613661     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613662     2  0.1022     0.8548 0.000 0.968 0.032 0.000
#> GSM613663     1  0.2408     0.5218 0.896 0.000 0.000 0.104
#> GSM613664     2  0.0000     0.8629 0.000 1.000 0.000 0.000
#> GSM613665     2  0.3837     0.7604 0.000 0.776 0.224 0.000
#> GSM613666     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613667     4  0.4998     0.5418 0.488 0.000 0.000 0.512
#> GSM613668     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613669     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613670     2  0.1022     0.8548 0.000 0.968 0.032 0.000
#> GSM613671     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613672     1  0.0188     0.6665 0.996 0.000 0.000 0.004
#> GSM613673     1  0.4992    -0.5118 0.524 0.000 0.000 0.476
#> GSM613674     2  0.1867     0.8660 0.000 0.928 0.072 0.000
#> GSM613675     2  0.1022     0.8548 0.000 0.968 0.032 0.000
#> GSM613676     2  0.3942     0.7533 0.000 0.764 0.236 0.000
#> GSM613677     3  0.3245     0.8476 0.000 0.100 0.872 0.028
#> GSM613678     4  0.6709     0.5147 0.452 0.088 0.000 0.460
#> GSM613679     2  0.1867     0.8660 0.000 0.928 0.072 0.000
#> GSM613680     1  0.0188     0.6667 0.996 0.000 0.000 0.004
#> GSM613681     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613682     4  0.4998     0.5418 0.488 0.000 0.000 0.512
#> GSM613683     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613684     2  0.2281     0.8626 0.000 0.904 0.096 0.000
#> GSM613685     2  0.1867     0.8660 0.000 0.928 0.072 0.000
#> GSM613686     4  0.4998     0.5418 0.488 0.000 0.000 0.512
#> GSM613687     1  0.0188     0.6663 0.996 0.000 0.000 0.004
#> GSM613688     2  0.1792     0.8532 0.000 0.932 0.068 0.000
#> GSM613689     3  0.2760     0.7950 0.000 0.000 0.872 0.128
#> GSM613690     3  0.0657     0.8624 0.000 0.004 0.984 0.012
#> GSM613691     2  0.4372     0.6631 0.000 0.728 0.268 0.004
#> GSM613692     1  0.4967     0.4377 0.548 0.000 0.000 0.452
#> GSM613693     2  0.2530     0.8569 0.000 0.888 0.112 0.000
#> GSM613694     4  0.4967     0.5811 0.452 0.000 0.000 0.548
#> GSM613695     3  0.4713     0.4687 0.000 0.000 0.640 0.360
#> GSM613696     2  0.3948     0.8044 0.000 0.840 0.064 0.096
#> GSM613697     4  0.4477     0.0822 0.000 0.000 0.312 0.688
#> GSM613698     4  0.5313    -0.0519 0.000 0.016 0.376 0.608
#> GSM613699     2  0.7505     0.3365 0.000 0.476 0.324 0.200
#> GSM613700     2  0.2943     0.8619 0.000 0.892 0.076 0.032
#> GSM613701     2  0.4053     0.7105 0.004 0.768 0.000 0.228
#> GSM613702     4  0.6788     0.5357 0.452 0.036 0.032 0.480
#> GSM613703     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613704     2  0.0000     0.8629 0.000 1.000 0.000 0.000
#> GSM613705     4  0.4998    -0.1333 0.000 0.000 0.488 0.512
#> GSM613706     4  0.4967     0.5811 0.452 0.000 0.000 0.548
#> GSM613707     2  0.1716     0.8674 0.000 0.936 0.064 0.000
#> GSM613708     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613709     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613710     2  0.4535     0.7395 0.000 0.744 0.240 0.016
#> GSM613711     3  0.2530     0.8307 0.000 0.112 0.888 0.000
#> GSM613712     3  0.4781     0.4977 0.000 0.004 0.660 0.336
#> GSM613713     2  0.3074     0.8476 0.000 0.848 0.152 0.000
#> GSM613714     3  0.4730     0.4596 0.000 0.000 0.636 0.364
#> GSM613715     3  0.2053     0.8283 0.000 0.072 0.924 0.004
#> GSM613716     3  0.4072     0.6685 0.000 0.252 0.748 0.000
#> GSM613717     3  0.1389     0.8661 0.000 0.048 0.952 0.000
#> GSM613718     3  0.1022     0.8692 0.000 0.032 0.968 0.000
#> GSM613719     3  0.5716     0.5813 0.000 0.068 0.680 0.252
#> GSM613720     3  0.2868     0.8117 0.000 0.136 0.864 0.000
#> GSM613721     2  0.2867     0.8423 0.000 0.884 0.104 0.012
#> GSM613722     2  0.2281     0.8617 0.000 0.904 0.096 0.000
#> GSM613723     1  0.4967     0.4377 0.548 0.000 0.000 0.452
#> GSM613724     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613725     2  0.2647     0.8586 0.000 0.880 0.120 0.000
#> GSM613726     4  0.4967     0.5811 0.452 0.000 0.000 0.548
#> GSM613727     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613728     2  0.0469     0.8610 0.000 0.988 0.012 0.000
#> GSM613729     1  0.0000     0.6702 1.000 0.000 0.000 0.000
#> GSM613730     4  0.7648     0.5004 0.368 0.164 0.008 0.460
#> GSM613731     4  0.4967     0.5811 0.452 0.000 0.000 0.548
#> GSM613732     3  0.1022     0.8692 0.000 0.032 0.968 0.000
#> GSM613733     3  0.2760     0.8194 0.000 0.128 0.872 0.000
#> GSM613734     1  0.4967     0.4377 0.548 0.000 0.000 0.452
#> GSM613735     1  0.4967     0.4377 0.548 0.000 0.000 0.452
#> GSM613736     2  0.4819     0.6577 0.000 0.652 0.344 0.004
#> GSM613737     4  0.1302     0.4049 0.000 0.000 0.044 0.956
#> GSM613738     1  0.4967     0.4377 0.548 0.000 0.000 0.452
#> GSM613739     4  0.3942     0.0357 0.236 0.000 0.000 0.764
#> GSM613740     3  0.1022     0.8692 0.000 0.032 0.968 0.000
#> GSM613741     4  0.8715     0.4428 0.300 0.244 0.044 0.412
#> GSM613742     4  0.1118     0.3632 0.036 0.000 0.000 0.964
#> GSM613743     3  0.1022     0.8692 0.000 0.032 0.968 0.000
#> GSM613744     3  0.1022     0.8692 0.000 0.032 0.968 0.000
#> GSM613745     1  0.7496    -0.5132 0.460 0.084 0.032 0.424
#> GSM613746     2  0.1389     0.8553 0.000 0.952 0.048 0.000
#> GSM613747     1  0.4967     0.4377 0.548 0.000 0.000 0.452
#> GSM613748     4  0.4967     0.5811 0.452 0.000 0.000 0.548
#> GSM613749     4  0.4981     0.5713 0.464 0.000 0.000 0.536
#> GSM613750     3  0.1022     0.8692 0.000 0.032 0.968 0.000
#> GSM613751     3  0.1637     0.8642 0.000 0.060 0.940 0.000
#> GSM613752     3  0.1211     0.8673 0.000 0.040 0.960 0.000
#> GSM613753     3  0.0000     0.8635 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
#> GSM613638     4  0.5368     0.2082 0.000 0.000 0.332 0.596 0.072
#> GSM613639     4  0.5159     0.1263 0.284 0.000 0.000 0.644 0.072
#> GSM613640     4  0.4873     0.4307 0.000 0.000 0.244 0.688 0.068
#> GSM613641     1  0.4278     0.6698 0.548 0.000 0.000 0.452 0.000
#> GSM613642     2  0.4015     0.6925 0.000 0.768 0.012 0.204 0.016
#> GSM613643     4  0.1544     0.6759 0.000 0.000 0.000 0.932 0.068
#> GSM613644     4  0.1544     0.6759 0.000 0.000 0.000 0.932 0.068
#> GSM613645     4  0.1845     0.6382 0.016 0.000 0.000 0.928 0.056
#> GSM613646     4  0.4069     0.5485 0.000 0.096 0.000 0.792 0.112
#> GSM613647     4  0.6752     0.3730 0.296 0.000 0.088 0.548 0.068
#> GSM613648     3  0.3001     0.6647 0.000 0.052 0.884 0.032 0.032
#> GSM613649     3  0.0566     0.6778 0.000 0.012 0.984 0.000 0.004
#> GSM613650     4  0.3340     0.6057 0.076 0.000 0.016 0.860 0.048
#> GSM613651     4  0.6182     0.2503 0.440 0.000 0.104 0.448 0.008
#> GSM613652     1  0.0000     0.4985 1.000 0.000 0.000 0.000 0.000
#> GSM613653     3  0.8604     0.3478 0.100 0.176 0.492 0.116 0.116
#> GSM613654     1  0.0000     0.4985 1.000 0.000 0.000 0.000 0.000
#> GSM613655     1  0.4219     0.6597 0.584 0.000 0.000 0.416 0.000
#> GSM613656     1  0.0000     0.4985 1.000 0.000 0.000 0.000 0.000
#> GSM613657     3  0.0000     0.6800 0.000 0.000 1.000 0.000 0.000
#> GSM613658     1  0.4256     0.6692 0.564 0.000 0.000 0.436 0.000
#> GSM613659     2  0.3966     0.7296 0.000 0.796 0.000 0.132 0.072
#> GSM613660     2  0.5884     0.5855 0.000 0.620 0.268 0.020 0.092
#> GSM613661     1  0.4415     0.6694 0.552 0.000 0.000 0.444 0.004
#> GSM613662     2  0.0609     0.7971 0.000 0.980 0.000 0.000 0.020
#> GSM613663     4  0.4268    -0.4920 0.444 0.000 0.000 0.556 0.000
#> GSM613664     2  0.1952     0.7985 0.000 0.912 0.004 0.000 0.084
#> GSM613665     2  0.4418     0.5952 0.000 0.652 0.332 0.000 0.016
#> GSM613666     1  0.4278     0.6698 0.548 0.000 0.000 0.452 0.000
#> GSM613667     4  0.1195     0.6405 0.028 0.000 0.000 0.960 0.012
#> GSM613668     1  0.4278     0.6698 0.548 0.000 0.000 0.452 0.000
#> GSM613669     1  0.4273     0.6714 0.552 0.000 0.000 0.448 0.000
#> GSM613670     2  0.2020     0.7693 0.000 0.900 0.000 0.000 0.100
#> GSM613671     1  0.4278     0.6698 0.548 0.000 0.000 0.452 0.000
#> GSM613672     1  0.4283     0.6654 0.544 0.000 0.000 0.456 0.000
#> GSM613673     4  0.1671     0.5935 0.076 0.000 0.000 0.924 0.000
#> GSM613674     2  0.2124     0.7966 0.000 0.900 0.004 0.000 0.096
#> GSM613675     2  0.0609     0.7971 0.000 0.980 0.000 0.000 0.020
#> GSM613676     2  0.4288     0.6094 0.000 0.664 0.324 0.000 0.012
#> GSM613677     3  0.5896     0.5302 0.000 0.148 0.688 0.092 0.072
#> GSM613678     4  0.2068     0.6168 0.000 0.092 0.000 0.904 0.004
#> GSM613679     2  0.2597     0.7985 0.000 0.884 0.024 0.000 0.092
#> GSM613680     1  0.4283     0.6658 0.544 0.000 0.000 0.456 0.000
#> GSM613681     1  0.4278     0.6698 0.548 0.000 0.000 0.452 0.000
#> GSM613682     4  0.1043     0.6322 0.040 0.000 0.000 0.960 0.000
#> GSM613683     1  0.4273     0.6714 0.552 0.000 0.000 0.448 0.000
#> GSM613684     2  0.2654     0.7967 0.000 0.884 0.032 0.000 0.084
#> GSM613685     2  0.2124     0.7966 0.000 0.900 0.004 0.000 0.096
#> GSM613686     4  0.1568     0.6324 0.036 0.000 0.000 0.944 0.020
#> GSM613687     1  0.4283     0.6651 0.544 0.000 0.000 0.456 0.000
#> GSM613688     2  0.3154     0.7967 0.000 0.860 0.024 0.012 0.104
#> GSM613689     3  0.3278     0.5868 0.000 0.000 0.824 0.156 0.020
#> GSM613690     3  0.3270     0.6416 0.000 0.036 0.864 0.080 0.020
#> GSM613691     2  0.4998     0.6537 0.000 0.716 0.172 0.004 0.108
#> GSM613692     1  0.0000     0.4985 1.000 0.000 0.000 0.000 0.000
#> GSM613693     2  0.3942     0.6777 0.000 0.728 0.260 0.000 0.012
#> GSM613694     4  0.0898     0.6621 0.000 0.000 0.008 0.972 0.020
#> GSM613695     3  0.5752     0.2282 0.000 0.000 0.500 0.412 0.088
#> GSM613696     2  0.3664     0.7465 0.000 0.840 0.024 0.096 0.040
#> GSM613697     4  0.7115     0.1579 0.368 0.000 0.200 0.408 0.024
#> GSM613698     1  0.8113    -0.3435 0.360 0.036 0.216 0.352 0.036
#> GSM613699     2  0.6551     0.4818 0.000 0.564 0.204 0.212 0.020
#> GSM613700     2  0.5880     0.6017 0.000 0.632 0.252 0.024 0.092
#> GSM613701     2  0.3877     0.6810 0.000 0.764 0.000 0.212 0.024
#> GSM613702     4  0.2616     0.6705 0.000 0.036 0.000 0.888 0.076
#> GSM613703     1  0.4803     0.6527 0.536 0.000 0.000 0.444 0.020
#> GSM613704     2  0.0671     0.7986 0.000 0.980 0.004 0.000 0.016
#> GSM613705     4  0.5499     0.0135 0.000 0.000 0.400 0.532 0.068
#> GSM613706     4  0.1544     0.6759 0.000 0.000 0.000 0.932 0.068
#> GSM613707     2  0.2351     0.7974 0.000 0.896 0.016 0.000 0.088
#> GSM613708     1  0.4273     0.6714 0.552 0.000 0.000 0.448 0.000
#> GSM613709     1  0.4273     0.6714 0.552 0.000 0.000 0.448 0.000
#> GSM613710     2  0.5887     0.5232 0.000 0.580 0.320 0.012 0.088
#> GSM613711     3  0.1106     0.6626 0.000 0.024 0.964 0.000 0.012
#> GSM613712     3  0.6354     0.2251 0.024 0.004 0.492 0.404 0.076
#> GSM613713     2  0.4049     0.7630 0.000 0.792 0.124 0.000 0.084
#> GSM613714     3  0.4734     0.5297 0.000 0.000 0.724 0.188 0.088
#> GSM613715     3  0.2361     0.6433 0.000 0.096 0.892 0.000 0.012
#> GSM613716     3  0.5804     0.3855 0.000 0.304 0.576 0.000 0.120
#> GSM613717     3  0.0162     0.6798 0.000 0.000 0.996 0.000 0.004
#> GSM613718     3  0.0000     0.6800 0.000 0.000 1.000 0.000 0.000
#> GSM613719     3  0.8185     0.3641 0.060 0.080 0.496 0.244 0.120
#> GSM613720     3  0.3224     0.5932 0.000 0.160 0.824 0.000 0.016
#> GSM613721     2  0.2795     0.7691 0.000 0.872 0.028 0.000 0.100
#> GSM613722     2  0.3151     0.7712 0.000 0.836 0.144 0.000 0.020
#> GSM613723     1  0.0000     0.4985 1.000 0.000 0.000 0.000 0.000
#> GSM613724     1  0.4273     0.6714 0.552 0.000 0.000 0.448 0.000
#> GSM613725     2  0.4748     0.7459 0.000 0.728 0.172 0.000 0.100
#> GSM613726     4  0.1608     0.6759 0.000 0.000 0.000 0.928 0.072
#> GSM613727     1  0.4273     0.6714 0.552 0.000 0.000 0.448 0.000
#> GSM613728     2  0.1774     0.7949 0.000 0.932 0.052 0.000 0.016
#> GSM613729     1  0.4420     0.6689 0.548 0.000 0.000 0.448 0.004
#> GSM613730     4  0.4795     0.6098 0.000 0.100 0.008 0.744 0.148
#> GSM613731     4  0.1544     0.6759 0.000 0.000 0.000 0.932 0.068
#> GSM613732     3  0.0000     0.6800 0.000 0.000 1.000 0.000 0.000
#> GSM613733     3  0.1661     0.6571 0.000 0.036 0.940 0.000 0.024
#> GSM613734     1  0.0000     0.4985 1.000 0.000 0.000 0.000 0.000
#> GSM613735     1  0.0000     0.4985 1.000 0.000 0.000 0.000 0.000
#> GSM613736     3  0.4648    -0.3413 0.000 0.464 0.524 0.000 0.012
#> GSM613737     4  0.5793     0.3271 0.412 0.000 0.044 0.520 0.024
#> GSM613738     1  0.0000     0.4985 1.000 0.000 0.000 0.000 0.000
#> GSM613739     1  0.3816    -0.0217 0.696 0.000 0.000 0.304 0.000
#> GSM613740     3  0.0000     0.6800 0.000 0.000 1.000 0.000 0.000
#> GSM613741     4  0.5952     0.4563 0.004 0.264 0.008 0.612 0.112
#> GSM613742     4  0.4306     0.3293 0.492 0.000 0.000 0.508 0.000
#> GSM613743     3  0.0000     0.6800 0.000 0.000 1.000 0.000 0.000
#> GSM613744     3  0.0000     0.6800 0.000 0.000 1.000 0.000 0.000
#> GSM613745     4  0.4455     0.5421 0.012 0.096 0.000 0.780 0.112
#> GSM613746     2  0.0671     0.7974 0.000 0.980 0.004 0.000 0.016
#> GSM613747     1  0.0000     0.4985 1.000 0.000 0.000 0.000 0.000
#> GSM613748     4  0.1830     0.6749 0.000 0.000 0.008 0.924 0.068
#> GSM613749     4  0.1018     0.6486 0.016 0.000 0.000 0.968 0.016
#> GSM613750     5  0.3730     0.9635 0.000 0.000 0.288 0.000 0.712
#> GSM613751     5  0.4425     0.9292 0.000 0.040 0.244 0.000 0.716
#> GSM613752     5  0.3861     0.9646 0.000 0.004 0.284 0.000 0.712
#> GSM613753     5  0.3636     0.9590 0.000 0.000 0.272 0.000 0.728

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     4  0.0146     0.7313 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM613639     4  0.4052     0.3684 0.260 0.000 0.000 0.708 0.020 0.012
#> GSM613640     4  0.0000     0.7326 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613641     1  0.0547     0.6356 0.980 0.000 0.000 0.000 0.000 0.020
#> GSM613642     2  0.2664     0.6670 0.000 0.816 0.000 0.184 0.000 0.000
#> GSM613643     4  0.0000     0.7326 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613644     4  0.0000     0.7326 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613645     1  0.4941     0.1920 0.492 0.000 0.000 0.444 0.064 0.000
#> GSM613646     1  0.5078     0.0736 0.488 0.000 0.000 0.056 0.448 0.008
#> GSM613647     4  0.0000     0.7326 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613648     3  0.3960     0.6115 0.000 0.000 0.760 0.180 0.052 0.008
#> GSM613649     3  0.0458     0.7666 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM613650     1  0.6336    -0.0167 0.412 0.000 0.000 0.296 0.280 0.012
#> GSM613651     5  0.4466     0.2480 0.000 0.000 0.020 0.476 0.500 0.004
#> GSM613652     1  0.3868     0.1773 0.508 0.000 0.000 0.000 0.492 0.000
#> GSM613653     5  0.7155    -0.0136 0.100 0.288 0.140 0.004 0.460 0.008
#> GSM613654     1  0.3868     0.1773 0.508 0.000 0.000 0.000 0.492 0.000
#> GSM613655     1  0.1267     0.6060 0.940 0.000 0.000 0.000 0.060 0.000
#> GSM613656     1  0.3868     0.1773 0.508 0.000 0.000 0.000 0.492 0.000
#> GSM613657     3  0.0000     0.7673 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613658     1  0.0363     0.6341 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM613659     2  0.4004     0.7164 0.000 0.780 0.000 0.108 0.100 0.012
#> GSM613660     4  0.6810     0.1318 0.000 0.068 0.328 0.492 0.056 0.056
#> GSM613661     1  0.0436     0.6353 0.988 0.000 0.000 0.004 0.004 0.004
#> GSM613662     2  0.3588     0.7600 0.000 0.788 0.000 0.000 0.152 0.060
#> GSM613663     1  0.1918     0.5888 0.904 0.000 0.000 0.088 0.000 0.008
#> GSM613664     2  0.0520     0.7738 0.000 0.984 0.000 0.000 0.008 0.008
#> GSM613665     3  0.5865    -0.0399 0.000 0.420 0.464 0.000 0.056 0.060
#> GSM613666     1  0.0547     0.6356 0.980 0.000 0.000 0.000 0.000 0.020
#> GSM613667     1  0.4653     0.1813 0.488 0.000 0.000 0.480 0.020 0.012
#> GSM613668     1  0.0260     0.6364 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM613669     1  0.0508     0.6365 0.984 0.000 0.000 0.000 0.004 0.012
#> GSM613670     2  0.3745     0.7357 0.000 0.732 0.000 0.000 0.240 0.028
#> GSM613671     1  0.0363     0.6366 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM613672     1  0.0405     0.6364 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM613673     1  0.4072     0.2423 0.544 0.000 0.000 0.448 0.000 0.008
#> GSM613674     2  0.0146     0.7704 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM613675     2  0.3513     0.7631 0.000 0.796 0.000 0.000 0.144 0.060
#> GSM613676     3  0.5643     0.0698 0.000 0.396 0.504 0.000 0.056 0.044
#> GSM613677     4  0.5898     0.3565 0.000 0.072 0.312 0.552 0.064 0.000
#> GSM613678     1  0.5541     0.1700 0.484 0.080 0.000 0.420 0.012 0.004
#> GSM613679     2  0.2732     0.7620 0.000 0.880 0.020 0.000 0.056 0.044
#> GSM613680     1  0.0405     0.6365 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM613681     1  0.0363     0.6366 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM613682     1  0.4095     0.2054 0.512 0.000 0.000 0.480 0.000 0.008
#> GSM613683     1  0.0146     0.6357 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM613684     2  0.0632     0.7682 0.000 0.976 0.024 0.000 0.000 0.000
#> GSM613685     2  0.0405     0.7715 0.000 0.988 0.000 0.000 0.008 0.004
#> GSM613686     1  0.5089     0.2078 0.496 0.000 0.000 0.444 0.044 0.016
#> GSM613687     1  0.0405     0.6363 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM613688     2  0.1321     0.7668 0.000 0.952 0.020 0.004 0.024 0.000
#> GSM613689     3  0.4158     0.4879 0.000 0.000 0.704 0.052 0.244 0.000
#> GSM613690     3  0.5327     0.3170 0.000 0.000 0.588 0.164 0.248 0.000
#> GSM613691     2  0.6239     0.4573 0.000 0.500 0.292 0.004 0.184 0.020
#> GSM613692     1  0.3868     0.1773 0.508 0.000 0.000 0.000 0.492 0.000
#> GSM613693     2  0.5910     0.0712 0.000 0.448 0.432 0.000 0.068 0.052
#> GSM613694     1  0.6045     0.0900 0.488 0.000 0.000 0.260 0.244 0.008
#> GSM613695     4  0.5055     0.3465 0.000 0.000 0.132 0.624 0.244 0.000
#> GSM613696     2  0.5477     0.4229 0.000 0.560 0.008 0.100 0.328 0.004
#> GSM613697     5  0.4176     0.4886 0.000 0.000 0.068 0.212 0.720 0.000
#> GSM613698     5  0.3857     0.4859 0.000 0.000 0.072 0.148 0.776 0.004
#> GSM613699     2  0.7590    -0.0464 0.000 0.348 0.208 0.200 0.244 0.000
#> GSM613700     4  0.6936     0.1139 0.000 0.080 0.328 0.480 0.056 0.056
#> GSM613701     2  0.4230     0.5953 0.004 0.728 0.000 0.200 0.068 0.000
#> GSM613702     4  0.1196     0.7077 0.000 0.000 0.000 0.952 0.040 0.008
#> GSM613703     1  0.1745     0.6140 0.924 0.000 0.000 0.000 0.056 0.020
#> GSM613704     2  0.3588     0.7600 0.000 0.788 0.000 0.000 0.152 0.060
#> GSM613705     4  0.0713     0.7196 0.000 0.000 0.028 0.972 0.000 0.000
#> GSM613706     4  0.0000     0.7326 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613707     2  0.0260     0.7709 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM613708     1  0.0363     0.6360 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM613709     1  0.0508     0.6365 0.984 0.000 0.000 0.000 0.004 0.012
#> GSM613710     3  0.6765     0.0812 0.000 0.064 0.432 0.400 0.056 0.048
#> GSM613711     3  0.1493     0.7459 0.000 0.004 0.936 0.000 0.056 0.004
#> GSM613712     4  0.5240     0.2894 0.000 0.000 0.136 0.588 0.276 0.000
#> GSM613713     2  0.1444     0.7531 0.000 0.928 0.072 0.000 0.000 0.000
#> GSM613714     4  0.4508     0.2580 0.000 0.000 0.396 0.568 0.036 0.000
#> GSM613715     3  0.2118     0.7058 0.000 0.000 0.888 0.008 0.104 0.000
#> GSM613716     5  0.7148    -0.0201 0.000 0.224 0.296 0.052 0.412 0.016
#> GSM613717     3  0.0146     0.7675 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM613718     3  0.0000     0.7673 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613719     5  0.4435     0.3802 0.032 0.000 0.136 0.060 0.764 0.008
#> GSM613720     3  0.4025     0.6773 0.000 0.060 0.796 0.000 0.096 0.048
#> GSM613721     2  0.3309     0.7449 0.000 0.800 0.024 0.000 0.172 0.004
#> GSM613722     2  0.3037     0.7297 0.000 0.820 0.160 0.000 0.004 0.016
#> GSM613723     1  0.3868     0.1773 0.508 0.000 0.000 0.000 0.492 0.000
#> GSM613724     1  0.0146     0.6357 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM613725     2  0.4651     0.3977 0.000 0.636 0.304 0.000 0.056 0.004
#> GSM613726     4  0.0508     0.7217 0.000 0.000 0.000 0.984 0.012 0.004
#> GSM613727     1  0.0508     0.6365 0.984 0.000 0.000 0.000 0.004 0.012
#> GSM613728     2  0.4792     0.7343 0.000 0.728 0.064 0.000 0.148 0.060
#> GSM613729     1  0.0622     0.6361 0.980 0.000 0.000 0.000 0.008 0.012
#> GSM613730     4  0.2653     0.6128 0.000 0.000 0.000 0.844 0.144 0.012
#> GSM613731     4  0.0000     0.7326 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613732     3  0.0000     0.7673 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613733     3  0.2002     0.7413 0.000 0.020 0.916 0.000 0.056 0.008
#> GSM613734     1  0.3868     0.1773 0.508 0.000 0.000 0.000 0.492 0.000
#> GSM613735     1  0.3868     0.1773 0.508 0.000 0.000 0.000 0.492 0.000
#> GSM613736     3  0.3214     0.6782 0.000 0.080 0.836 0.080 0.004 0.000
#> GSM613737     5  0.3405     0.4687 0.000 0.000 0.004 0.272 0.724 0.000
#> GSM613738     1  0.3868     0.1773 0.508 0.000 0.000 0.000 0.492 0.000
#> GSM613739     5  0.5818     0.2580 0.228 0.000 0.000 0.280 0.492 0.000
#> GSM613740     3  0.0363     0.7642 0.000 0.000 0.988 0.000 0.012 0.000
#> GSM613741     5  0.6874     0.1454 0.324 0.152 0.004 0.056 0.456 0.008
#> GSM613742     5  0.4609     0.3130 0.024 0.000 0.000 0.436 0.532 0.008
#> GSM613743     3  0.0000     0.7673 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613744     3  0.0713     0.7549 0.000 0.000 0.972 0.000 0.028 0.000
#> GSM613745     1  0.5081     0.0611 0.480 0.000 0.000 0.056 0.456 0.008
#> GSM613746     2  0.2997     0.7697 0.000 0.844 0.000 0.000 0.096 0.060
#> GSM613747     1  0.3867     0.1811 0.512 0.000 0.000 0.000 0.488 0.000
#> GSM613748     4  0.0000     0.7326 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613749     1  0.4653     0.1813 0.488 0.000 0.000 0.480 0.020 0.012
#> GSM613750     6  0.1714     0.9772 0.000 0.000 0.092 0.000 0.000 0.908
#> GSM613751     6  0.1349     0.9461 0.000 0.004 0.056 0.000 0.000 0.940
#> GSM613752     6  0.1663     0.9775 0.000 0.000 0.088 0.000 0.000 0.912
#> GSM613753     6  0.1806     0.9765 0.000 0.000 0.088 0.000 0.004 0.908

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 disease.state(p) k
#> SD:pam 114         0.054603 2
#> SD:pam  61         0.142578 3
#> SD:pam  87         0.063930 4
#> SD:pam  87         0.004098 5
#> SD:pam  69         0.000123 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 27425 rows and 116 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 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-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.702           0.930       0.926         0.4646 0.521   0.521
#> 3 3 0.416           0.573       0.723         0.3204 0.766   0.579
#> 4 4 0.629           0.692       0.816         0.1475 0.824   0.574
#> 5 5 0.712           0.582       0.809         0.1003 0.860   0.561
#> 6 6 0.843           0.775       0.904         0.0472 0.897   0.580

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
#> GSM613638     2  0.7376      0.834 0.208 0.792
#> GSM613639     1  0.4022      0.982 0.920 0.080
#> GSM613640     2  0.5059      0.892 0.112 0.888
#> GSM613641     1  0.4022      0.982 0.920 0.080
#> GSM613642     2  0.4815      0.897 0.104 0.896
#> GSM613643     1  0.2778      0.973 0.952 0.048
#> GSM613644     1  0.2603      0.971 0.956 0.044
#> GSM613645     1  0.4022      0.982 0.920 0.080
#> GSM613646     2  0.5408      0.883 0.124 0.876
#> GSM613647     2  0.6048      0.891 0.148 0.852
#> GSM613648     2  0.3431      0.918 0.064 0.936
#> GSM613649     2  0.3114      0.922 0.056 0.944
#> GSM613650     1  0.3431      0.959 0.936 0.064
#> GSM613651     1  0.4298      0.935 0.912 0.088
#> GSM613652     1  0.2603      0.971 0.956 0.044
#> GSM613653     2  0.6973      0.814 0.188 0.812
#> GSM613654     1  0.2603      0.971 0.956 0.044
#> GSM613655     1  0.4022      0.982 0.920 0.080
#> GSM613656     1  0.2603      0.971 0.956 0.044
#> GSM613657     2  0.3274      0.912 0.060 0.940
#> GSM613658     1  0.3114      0.975 0.944 0.056
#> GSM613659     2  0.5059      0.892 0.112 0.888
#> GSM613660     2  0.1184      0.929 0.016 0.984
#> GSM613661     1  0.4022      0.982 0.920 0.080
#> GSM613662     2  0.1414      0.928 0.020 0.980
#> GSM613663     1  0.4022      0.982 0.920 0.080
#> GSM613664     2  0.0672      0.930 0.008 0.992
#> GSM613665     2  0.0672      0.930 0.008 0.992
#> GSM613666     1  0.4022      0.982 0.920 0.080
#> GSM613667     1  0.4022      0.982 0.920 0.080
#> GSM613668     1  0.4022      0.982 0.920 0.080
#> GSM613669     1  0.4022      0.982 0.920 0.080
#> GSM613670     2  0.2423      0.928 0.040 0.960
#> GSM613671     1  0.4022      0.982 0.920 0.080
#> GSM613672     1  0.4022      0.982 0.920 0.080
#> GSM613673     1  0.4022      0.982 0.920 0.080
#> GSM613674     2  0.0672      0.926 0.008 0.992
#> GSM613675     2  0.1414      0.928 0.020 0.980
#> GSM613676     2  0.0000      0.929 0.000 1.000
#> GSM613677     2  0.1633      0.929 0.024 0.976
#> GSM613678     2  0.6623      0.835 0.172 0.828
#> GSM613679     2  0.1184      0.929 0.016 0.984
#> GSM613680     1  0.4022      0.982 0.920 0.080
#> GSM613681     1  0.4022      0.982 0.920 0.080
#> GSM613682     1  0.4022      0.982 0.920 0.080
#> GSM613683     1  0.4022      0.982 0.920 0.080
#> GSM613684     2  0.0672      0.930 0.008 0.992
#> GSM613685     2  0.0672      0.926 0.008 0.992
#> GSM613686     1  0.4022      0.982 0.920 0.080
#> GSM613687     1  0.4022      0.982 0.920 0.080
#> GSM613688     2  0.1184      0.929 0.016 0.984
#> GSM613689     2  0.2778      0.926 0.048 0.952
#> GSM613690     2  0.2603      0.925 0.044 0.956
#> GSM613691     2  0.0672      0.930 0.008 0.992
#> GSM613692     1  0.2603      0.971 0.956 0.044
#> GSM613693     2  0.0672      0.930 0.008 0.992
#> GSM613694     2  0.7139      0.848 0.196 0.804
#> GSM613695     2  0.6048      0.891 0.148 0.852
#> GSM613696     2  0.5408      0.893 0.124 0.876
#> GSM613697     1  0.3274      0.962 0.940 0.060
#> GSM613698     2  0.6048      0.891 0.148 0.852
#> GSM613699     2  0.6048      0.891 0.148 0.852
#> GSM613700     2  0.1184      0.929 0.016 0.984
#> GSM613701     2  0.5059      0.892 0.112 0.888
#> GSM613702     2  0.5059      0.892 0.112 0.888
#> GSM613703     1  0.4022      0.982 0.920 0.080
#> GSM613704     2  0.1414      0.928 0.020 0.980
#> GSM613705     2  0.6048      0.891 0.148 0.852
#> GSM613706     2  0.5408      0.883 0.124 0.876
#> GSM613707     2  0.0376      0.928 0.004 0.996
#> GSM613708     1  0.4022      0.982 0.920 0.080
#> GSM613709     1  0.4022      0.982 0.920 0.080
#> GSM613710     2  0.1184      0.929 0.016 0.984
#> GSM613711     2  0.3274      0.912 0.060 0.940
#> GSM613712     2  0.6343      0.883 0.160 0.840
#> GSM613713     2  0.0672      0.930 0.008 0.992
#> GSM613714     2  0.3584      0.925 0.068 0.932
#> GSM613715     2  0.2603      0.925 0.044 0.956
#> GSM613716     2  0.2603      0.925 0.044 0.956
#> GSM613717     2  0.0938      0.925 0.012 0.988
#> GSM613718     2  0.3274      0.912 0.060 0.940
#> GSM613719     2  0.9896      0.354 0.440 0.560
#> GSM613720     2  0.2603      0.925 0.044 0.956
#> GSM613721     2  0.4939      0.895 0.108 0.892
#> GSM613722     2  0.0672      0.930 0.008 0.992
#> GSM613723     1  0.2603      0.971 0.956 0.044
#> GSM613724     1  0.2603      0.971 0.956 0.044
#> GSM613725     2  0.1184      0.929 0.016 0.984
#> GSM613726     1  0.4022      0.982 0.920 0.080
#> GSM613727     1  0.4022      0.982 0.920 0.080
#> GSM613728     2  0.0672      0.930 0.008 0.992
#> GSM613729     1  0.4022      0.982 0.920 0.080
#> GSM613730     2  0.5059      0.892 0.112 0.888
#> GSM613731     1  0.4022      0.982 0.920 0.080
#> GSM613732     2  0.3274      0.912 0.060 0.940
#> GSM613733     2  0.0672      0.930 0.008 0.992
#> GSM613734     1  0.2603      0.971 0.956 0.044
#> GSM613735     1  0.2603      0.971 0.956 0.044
#> GSM613736     2  0.2603      0.925 0.044 0.956
#> GSM613737     2  0.7056      0.853 0.192 0.808
#> GSM613738     1  0.2603      0.971 0.956 0.044
#> GSM613739     1  0.2603      0.971 0.956 0.044
#> GSM613740     2  0.3274      0.912 0.060 0.940
#> GSM613741     2  0.6623      0.834 0.172 0.828
#> GSM613742     1  0.2603      0.971 0.956 0.044
#> GSM613743     2  0.3274      0.912 0.060 0.940
#> GSM613744     2  0.3274      0.912 0.060 0.940
#> GSM613745     2  0.5059      0.892 0.112 0.888
#> GSM613746     2  0.1414      0.928 0.020 0.980
#> GSM613747     1  0.2603      0.971 0.956 0.044
#> GSM613748     2  0.5059      0.892 0.112 0.888
#> GSM613749     1  0.4431      0.973 0.908 0.092
#> GSM613750     2  0.2236      0.923 0.036 0.964
#> GSM613751     2  0.3274      0.912 0.060 0.940
#> GSM613752     2  0.3114      0.922 0.056 0.944
#> GSM613753     2  0.2603      0.925 0.044 0.956

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM613638     3  0.0592     0.4642 0.012 0.000 0.988
#> GSM613639     1  0.5327     0.6742 0.728 0.000 0.272
#> GSM613640     3  0.5633     0.3618 0.208 0.024 0.768
#> GSM613641     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613642     2  0.6518     0.5738 0.004 0.512 0.484
#> GSM613643     1  0.6095     0.4565 0.608 0.000 0.392
#> GSM613644     3  0.6225     0.1008 0.432 0.000 0.568
#> GSM613645     1  0.4346     0.7787 0.816 0.000 0.184
#> GSM613646     3  0.7083     0.2293 0.380 0.028 0.592
#> GSM613647     3  0.0747     0.4645 0.016 0.000 0.984
#> GSM613648     3  0.5480     0.3053 0.004 0.264 0.732
#> GSM613649     3  0.6008     0.2877 0.004 0.332 0.664
#> GSM613650     3  0.6302    -0.0769 0.480 0.000 0.520
#> GSM613651     3  0.4796     0.3879 0.220 0.000 0.780
#> GSM613652     1  0.3482     0.8692 0.872 0.128 0.000
#> GSM613653     3  0.6896     0.2018 0.392 0.020 0.588
#> GSM613654     1  0.3482     0.8692 0.872 0.128 0.000
#> GSM613655     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613656     1  0.3482     0.8692 0.872 0.128 0.000
#> GSM613657     3  0.6225     0.2965 0.000 0.432 0.568
#> GSM613658     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613659     3  0.6410    -0.3590 0.004 0.420 0.576
#> GSM613660     2  0.5465     0.8973 0.000 0.712 0.288
#> GSM613661     1  0.4062     0.7975 0.836 0.000 0.164
#> GSM613662     2  0.5785     0.9000 0.004 0.696 0.300
#> GSM613663     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613664     2  0.5785     0.9000 0.004 0.696 0.300
#> GSM613665     2  0.5929     0.8989 0.004 0.676 0.320
#> GSM613666     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613667     1  0.4235     0.7859 0.824 0.000 0.176
#> GSM613668     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613669     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613670     2  0.6520     0.4971 0.004 0.508 0.488
#> GSM613671     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613672     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613673     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613674     2  0.5465     0.8973 0.000 0.712 0.288
#> GSM613675     2  0.5785     0.9000 0.004 0.696 0.300
#> GSM613676     2  0.5929     0.8989 0.004 0.676 0.320
#> GSM613677     3  0.5785     0.2446 0.004 0.300 0.696
#> GSM613678     3  0.7099    -0.2561 0.028 0.384 0.588
#> GSM613679     2  0.5465     0.8973 0.000 0.712 0.288
#> GSM613680     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613681     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613682     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613683     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613684     2  0.5929     0.8989 0.004 0.676 0.320
#> GSM613685     2  0.5465     0.8973 0.000 0.712 0.288
#> GSM613686     1  0.4178     0.7900 0.828 0.000 0.172
#> GSM613687     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613688     2  0.5929     0.8989 0.004 0.676 0.320
#> GSM613689     3  0.4629     0.3742 0.004 0.188 0.808
#> GSM613690     3  0.4409     0.3860 0.004 0.172 0.824
#> GSM613691     2  0.5815     0.8969 0.004 0.692 0.304
#> GSM613692     1  0.3482     0.7961 0.872 0.000 0.128
#> GSM613693     2  0.6126     0.8365 0.004 0.644 0.352
#> GSM613694     3  0.4931     0.3715 0.232 0.000 0.768
#> GSM613695     3  0.0661     0.4614 0.004 0.008 0.988
#> GSM613696     3  0.1129     0.4566 0.004 0.020 0.976
#> GSM613697     3  0.3116     0.4409 0.108 0.000 0.892
#> GSM613698     3  0.1129     0.4596 0.004 0.020 0.976
#> GSM613699     3  0.0237     0.4634 0.004 0.000 0.996
#> GSM613700     2  0.5465     0.8973 0.000 0.712 0.288
#> GSM613701     3  0.6410    -0.3486 0.004 0.420 0.576
#> GSM613702     3  0.6509    -0.4836 0.004 0.472 0.524
#> GSM613703     1  0.3193     0.8289 0.896 0.004 0.100
#> GSM613704     2  0.5785     0.9000 0.004 0.696 0.300
#> GSM613705     3  0.0475     0.4628 0.004 0.004 0.992
#> GSM613706     3  0.6330     0.2070 0.396 0.004 0.600
#> GSM613707     2  0.5529     0.9011 0.000 0.704 0.296
#> GSM613708     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613709     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613710     2  0.5465     0.8973 0.000 0.712 0.288
#> GSM613711     3  0.6215     0.2985 0.000 0.428 0.572
#> GSM613712     3  0.0237     0.4634 0.004 0.000 0.996
#> GSM613713     3  0.6330    -0.0492 0.004 0.396 0.600
#> GSM613714     3  0.5404     0.3179 0.004 0.256 0.740
#> GSM613715     3  0.5480     0.3053 0.004 0.264 0.732
#> GSM613716     3  0.5158     0.3557 0.004 0.232 0.764
#> GSM613717     3  0.6215     0.2985 0.000 0.428 0.572
#> GSM613718     3  0.6215     0.2985 0.000 0.428 0.572
#> GSM613719     3  0.5503     0.3798 0.208 0.020 0.772
#> GSM613720     3  0.5873     0.2638 0.004 0.312 0.684
#> GSM613721     3  0.6495    -0.4001 0.004 0.460 0.536
#> GSM613722     2  0.5560     0.9021 0.000 0.700 0.300
#> GSM613723     1  0.3482     0.8692 0.872 0.128 0.000
#> GSM613724     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613725     2  0.5465     0.8973 0.000 0.712 0.288
#> GSM613726     1  0.4346     0.7787 0.816 0.000 0.184
#> GSM613727     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613728     2  0.5929     0.8989 0.004 0.676 0.320
#> GSM613729     1  0.0000     0.9043 1.000 0.000 0.000
#> GSM613730     2  0.6521     0.5390 0.004 0.500 0.496
#> GSM613731     1  0.6095     0.4565 0.608 0.000 0.392
#> GSM613732     3  0.6215     0.2985 0.000 0.428 0.572
#> GSM613733     3  0.6126     0.1325 0.004 0.352 0.644
#> GSM613734     1  0.3482     0.8692 0.872 0.128 0.000
#> GSM613735     1  0.3482     0.8692 0.872 0.128 0.000
#> GSM613736     3  0.5690     0.2681 0.004 0.288 0.708
#> GSM613737     3  0.0237     0.4634 0.004 0.000 0.996
#> GSM613738     1  0.3482     0.7961 0.872 0.000 0.128
#> GSM613739     1  0.3482     0.8692 0.872 0.128 0.000
#> GSM613740     3  0.6215     0.2985 0.000 0.428 0.572
#> GSM613741     3  0.6896     0.2018 0.392 0.020 0.588
#> GSM613742     1  0.3619     0.7914 0.864 0.000 0.136
#> GSM613743     3  0.6215     0.2985 0.000 0.428 0.572
#> GSM613744     3  0.6215     0.2985 0.000 0.428 0.572
#> GSM613745     3  0.5889     0.3473 0.096 0.108 0.796
#> GSM613746     2  0.5785     0.9000 0.004 0.696 0.300
#> GSM613747     1  0.3482     0.8692 0.872 0.128 0.000
#> GSM613748     3  0.6298    -0.2795 0.004 0.388 0.608
#> GSM613749     3  0.7912     0.1499 0.404 0.060 0.536
#> GSM613750     3  0.5480     0.3053 0.004 0.264 0.732
#> GSM613751     3  0.6192     0.3060 0.000 0.420 0.580
#> GSM613752     3  0.5529     0.2727 0.000 0.296 0.704
#> GSM613753     3  0.0829     0.4603 0.004 0.012 0.984

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM613638     3  0.7313    0.45739 0.188 0.084 0.644 0.084
#> GSM613639     1  0.5555    0.72606 0.740 0.004 0.140 0.116
#> GSM613640     3  0.9076    0.05572 0.216 0.276 0.424 0.084
#> GSM613641     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613642     2  0.6286    0.57518 0.012 0.668 0.236 0.084
#> GSM613643     1  0.5053    0.75253 0.772 0.004 0.148 0.076
#> GSM613644     1  0.5276    0.73493 0.756 0.004 0.156 0.084
#> GSM613645     1  0.4163    0.80698 0.828 0.000 0.076 0.096
#> GSM613646     1  0.6838    0.54807 0.612 0.004 0.152 0.232
#> GSM613647     3  0.5409    0.52792 0.168 0.004 0.744 0.084
#> GSM613648     3  0.3730    0.70770 0.004 0.144 0.836 0.016
#> GSM613649     3  0.3289    0.70695 0.004 0.140 0.852 0.004
#> GSM613650     1  0.5339    0.73441 0.752 0.004 0.156 0.088
#> GSM613651     3  0.6791    0.16535 0.392 0.000 0.508 0.100
#> GSM613652     1  0.1114    0.89272 0.972 0.004 0.008 0.016
#> GSM613653     4  0.4144    0.68512 0.028 0.004 0.152 0.816
#> GSM613654     1  0.1114    0.89272 0.972 0.004 0.008 0.016
#> GSM613655     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613656     1  0.1114    0.89272 0.972 0.004 0.008 0.016
#> GSM613657     3  0.3024    0.70083 0.000 0.148 0.852 0.000
#> GSM613658     1  0.0188    0.89747 0.996 0.000 0.000 0.004
#> GSM613659     4  0.5110    0.65775 0.008 0.056 0.172 0.764
#> GSM613660     2  0.0188    0.81226 0.000 0.996 0.004 0.000
#> GSM613661     1  0.3398    0.83636 0.872 0.000 0.060 0.068
#> GSM613662     4  0.2457    0.75933 0.004 0.076 0.008 0.912
#> GSM613663     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613664     4  0.2412    0.76000 0.008 0.084 0.000 0.908
#> GSM613665     2  0.1617    0.80213 0.008 0.956 0.012 0.024
#> GSM613666     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613667     1  0.3164    0.84217 0.884 0.000 0.064 0.052
#> GSM613668     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613669     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613670     4  0.2125    0.76023 0.004 0.076 0.000 0.920
#> GSM613671     1  0.0188    0.89718 0.996 0.000 0.000 0.004
#> GSM613672     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613673     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613674     2  0.0188    0.81226 0.000 0.996 0.004 0.000
#> GSM613675     4  0.2473    0.76056 0.000 0.080 0.012 0.908
#> GSM613676     2  0.3651    0.73575 0.008 0.844 0.136 0.012
#> GSM613677     3  0.4087    0.68663 0.008 0.080 0.844 0.068
#> GSM613678     1  0.6407    0.62747 0.664 0.004 0.148 0.184
#> GSM613679     2  0.0188    0.81226 0.000 0.996 0.004 0.000
#> GSM613680     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613681     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613682     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613683     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613684     2  0.5803    0.38323 0.008 0.632 0.328 0.032
#> GSM613685     2  0.0188    0.81226 0.000 0.996 0.004 0.000
#> GSM613686     1  0.2926    0.84977 0.896 0.000 0.056 0.048
#> GSM613687     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613688     2  0.6056    0.51908 0.012 0.676 0.064 0.248
#> GSM613689     3  0.6525    0.43533 0.008 0.384 0.548 0.060
#> GSM613690     3  0.2039    0.69680 0.008 0.036 0.940 0.016
#> GSM613691     4  0.2402    0.76174 0.000 0.076 0.012 0.912
#> GSM613692     1  0.1042    0.89330 0.972 0.000 0.008 0.020
#> GSM613693     3  0.7923    0.21414 0.008 0.216 0.436 0.340
#> GSM613694     3  0.6946    0.02607 0.436 0.008 0.472 0.084
#> GSM613695     3  0.2597    0.65447 0.008 0.004 0.904 0.084
#> GSM613696     3  0.4034    0.57570 0.008 0.004 0.796 0.192
#> GSM613697     3  0.6393    0.37722 0.284 0.000 0.616 0.100
#> GSM613698     3  0.4153    0.56224 0.008 0.004 0.784 0.204
#> GSM613699     3  0.2960    0.65101 0.020 0.004 0.892 0.084
#> GSM613700     2  0.0188    0.81226 0.000 0.996 0.004 0.000
#> GSM613701     2  0.5779    0.61487 0.016 0.736 0.156 0.092
#> GSM613702     2  0.5747    0.61612 0.016 0.740 0.148 0.096
#> GSM613703     1  0.4905    0.34681 0.632 0.004 0.000 0.364
#> GSM613704     4  0.2342    0.75844 0.000 0.080 0.008 0.912
#> GSM613705     3  0.5369    0.58721 0.016 0.132 0.768 0.084
#> GSM613706     1  0.8827    0.15540 0.440 0.320 0.156 0.084
#> GSM613707     2  0.0188    0.81226 0.000 0.996 0.004 0.000
#> GSM613708     1  0.0188    0.89747 0.996 0.000 0.000 0.004
#> GSM613709     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613710     2  0.0188    0.81226 0.000 0.996 0.004 0.000
#> GSM613711     3  0.3074    0.69841 0.000 0.152 0.848 0.000
#> GSM613712     3  0.2795    0.65228 0.012 0.004 0.896 0.088
#> GSM613713     3  0.5012    0.57866 0.008 0.320 0.668 0.004
#> GSM613714     3  0.5401    0.62719 0.008 0.260 0.700 0.032
#> GSM613715     3  0.3873    0.70807 0.008 0.144 0.832 0.016
#> GSM613716     3  0.5591   -0.00677 0.008 0.008 0.500 0.484
#> GSM613717     3  0.3123    0.69966 0.000 0.156 0.844 0.000
#> GSM613718     3  0.3024    0.70083 0.000 0.148 0.852 0.000
#> GSM613719     3  0.6917   -0.08480 0.092 0.004 0.468 0.436
#> GSM613720     4  0.7710   -0.14300 0.008 0.168 0.404 0.420
#> GSM613721     4  0.3607    0.70736 0.008 0.016 0.124 0.852
#> GSM613722     2  0.0712    0.81013 0.004 0.984 0.004 0.008
#> GSM613723     1  0.1114    0.89272 0.972 0.004 0.008 0.016
#> GSM613724     1  0.0188    0.89747 0.996 0.000 0.000 0.004
#> GSM613725     2  0.0188    0.81226 0.000 0.996 0.004 0.000
#> GSM613726     1  0.4155    0.80049 0.828 0.000 0.100 0.072
#> GSM613727     1  0.0000    0.89791 1.000 0.000 0.000 0.000
#> GSM613728     2  0.3006    0.76231 0.008 0.888 0.012 0.092
#> GSM613729     1  0.0188    0.89718 0.996 0.000 0.000 0.004
#> GSM613730     2  0.6792    0.55259 0.012 0.644 0.180 0.164
#> GSM613731     1  0.5136    0.74494 0.768 0.004 0.144 0.084
#> GSM613732     3  0.2973    0.70284 0.000 0.144 0.856 0.000
#> GSM613733     2  0.4571    0.58143 0.008 0.736 0.252 0.004
#> GSM613734     1  0.1114    0.89272 0.972 0.004 0.008 0.016
#> GSM613735     1  0.1082    0.89275 0.972 0.004 0.004 0.020
#> GSM613736     3  0.4092    0.69434 0.008 0.184 0.800 0.008
#> GSM613737     3  0.2597    0.65447 0.008 0.004 0.904 0.084
#> GSM613738     1  0.1042    0.89330 0.972 0.000 0.008 0.020
#> GSM613739     1  0.1114    0.89272 0.972 0.004 0.008 0.016
#> GSM613740     3  0.2973    0.70284 0.000 0.144 0.856 0.000
#> GSM613741     4  0.3780    0.69459 0.016 0.004 0.148 0.832
#> GSM613742     1  0.3156    0.85529 0.884 0.000 0.048 0.068
#> GSM613743     3  0.3074    0.70189 0.000 0.152 0.848 0.000
#> GSM613744     3  0.2973    0.70284 0.000 0.144 0.856 0.000
#> GSM613745     4  0.6443    0.03289 0.056 0.004 0.468 0.472
#> GSM613746     4  0.2473    0.76056 0.000 0.080 0.012 0.908
#> GSM613747     1  0.1114    0.89272 0.972 0.004 0.008 0.016
#> GSM613748     2  0.6923    0.56702 0.064 0.672 0.180 0.084
#> GSM613749     1  0.5136    0.74494 0.768 0.004 0.144 0.084
#> GSM613750     3  0.3873    0.70807 0.008 0.144 0.832 0.016
#> GSM613751     3  0.2921    0.70423 0.000 0.140 0.860 0.000
#> GSM613752     3  0.2973    0.70284 0.000 0.144 0.856 0.000
#> GSM613753     3  0.1516    0.68838 0.008 0.016 0.960 0.016

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     3  0.4944     0.4141 0.012 0.000 0.560 0.012 0.416
#> GSM613639     1  0.4436     0.4356 0.596 0.000 0.000 0.008 0.396
#> GSM613640     5  0.6697    -0.1963 0.000 0.240 0.376 0.000 0.384
#> GSM613641     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613642     2  0.5058     0.4551 0.000 0.576 0.040 0.000 0.384
#> GSM613643     1  0.4659     0.2596 0.500 0.000 0.000 0.012 0.488
#> GSM613644     5  0.5115     0.3082 0.224 0.000 0.068 0.012 0.696
#> GSM613645     1  0.4074     0.4771 0.636 0.000 0.000 0.000 0.364
#> GSM613646     4  0.6518     0.2676 0.192 0.000 0.000 0.412 0.396
#> GSM613647     5  0.4270     0.1276 0.012 0.000 0.320 0.000 0.668
#> GSM613648     3  0.0703     0.8108 0.000 0.000 0.976 0.000 0.024
#> GSM613649     3  0.0404     0.8090 0.000 0.000 0.988 0.000 0.012
#> GSM613650     5  0.4347     0.2288 0.264 0.000 0.012 0.012 0.712
#> GSM613651     5  0.0404     0.3832 0.000 0.000 0.012 0.000 0.988
#> GSM613652     5  0.4734     0.4661 0.372 0.000 0.000 0.024 0.604
#> GSM613653     4  0.4138     0.5268 0.000 0.000 0.000 0.616 0.384
#> GSM613654     5  0.4734     0.4661 0.372 0.000 0.000 0.024 0.604
#> GSM613655     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613656     5  0.4734     0.4661 0.372 0.000 0.000 0.024 0.604
#> GSM613657     3  0.0000     0.8087 0.000 0.000 1.000 0.000 0.000
#> GSM613658     1  0.0807     0.7800 0.976 0.000 0.000 0.012 0.012
#> GSM613659     4  0.4871     0.5174 0.012 0.000 0.012 0.592 0.384
#> GSM613660     2  0.0000     0.7507 0.000 1.000 0.000 0.000 0.000
#> GSM613661     1  0.4030     0.4979 0.648 0.000 0.000 0.000 0.352
#> GSM613662     4  0.1106     0.7133 0.000 0.012 0.000 0.964 0.024
#> GSM613663     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613664     4  0.1106     0.7133 0.000 0.012 0.000 0.964 0.024
#> GSM613665     2  0.0693     0.7429 0.000 0.980 0.012 0.008 0.000
#> GSM613666     1  0.0404     0.7865 0.988 0.000 0.000 0.000 0.012
#> GSM613667     1  0.3534     0.5848 0.744 0.000 0.000 0.000 0.256
#> GSM613668     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613669     1  0.0404     0.7865 0.988 0.000 0.000 0.000 0.012
#> GSM613670     4  0.1106     0.7133 0.000 0.012 0.000 0.964 0.024
#> GSM613671     1  0.0404     0.7865 0.988 0.000 0.000 0.000 0.012
#> GSM613672     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613673     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613674     2  0.0000     0.7507 0.000 1.000 0.000 0.000 0.000
#> GSM613675     4  0.1106     0.7133 0.000 0.012 0.000 0.964 0.024
#> GSM613676     2  0.1965     0.7225 0.000 0.924 0.052 0.000 0.024
#> GSM613677     3  0.4323     0.5385 0.000 0.000 0.656 0.012 0.332
#> GSM613678     1  0.5086     0.3995 0.564 0.000 0.000 0.040 0.396
#> GSM613679     2  0.0000     0.7507 0.000 1.000 0.000 0.000 0.000
#> GSM613680     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613681     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613682     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613683     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613684     2  0.5714     0.4261 0.000 0.636 0.072 0.268 0.024
#> GSM613685     2  0.0000     0.7507 0.000 1.000 0.000 0.000 0.000
#> GSM613686     1  0.2773     0.6676 0.836 0.000 0.000 0.000 0.164
#> GSM613687     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613688     4  0.5797     0.1633 0.000 0.352 0.012 0.564 0.072
#> GSM613689     3  0.3318     0.6972 0.000 0.012 0.808 0.000 0.180
#> GSM613690     3  0.0880     0.8093 0.000 0.000 0.968 0.000 0.032
#> GSM613691     4  0.1106     0.7133 0.000 0.012 0.000 0.964 0.024
#> GSM613692     5  0.4138     0.4463 0.384 0.000 0.000 0.000 0.616
#> GSM613693     4  0.1741     0.6999 0.000 0.000 0.040 0.936 0.024
#> GSM613694     5  0.4976    -0.1879 0.012 0.000 0.436 0.012 0.540
#> GSM613695     3  0.4138     0.4832 0.000 0.000 0.616 0.000 0.384
#> GSM613696     3  0.5518     0.4066 0.000 0.000 0.544 0.072 0.384
#> GSM613697     5  0.0404     0.3832 0.000 0.000 0.012 0.000 0.988
#> GSM613698     5  0.4135     0.0704 0.000 0.000 0.340 0.004 0.656
#> GSM613699     3  0.4505     0.4739 0.000 0.000 0.604 0.012 0.384
#> GSM613700     2  0.0000     0.7507 0.000 1.000 0.000 0.000 0.000
#> GSM613701     2  0.4505     0.4770 0.012 0.604 0.000 0.000 0.384
#> GSM613702     2  0.4505     0.4770 0.012 0.604 0.000 0.000 0.384
#> GSM613703     1  0.3940     0.5086 0.756 0.000 0.000 0.220 0.024
#> GSM613704     4  0.1106     0.7133 0.000 0.012 0.000 0.964 0.024
#> GSM613705     3  0.4936     0.4267 0.000 0.012 0.564 0.012 0.412
#> GSM613706     2  0.6189     0.3372 0.140 0.476 0.000 0.000 0.384
#> GSM613707     2  0.0000     0.7507 0.000 1.000 0.000 0.000 0.000
#> GSM613708     1  0.0566     0.7852 0.984 0.000 0.000 0.004 0.012
#> GSM613709     1  0.0404     0.7865 0.988 0.000 0.000 0.000 0.012
#> GSM613710     2  0.0000     0.7507 0.000 1.000 0.000 0.000 0.000
#> GSM613711     3  0.0000     0.8087 0.000 0.000 1.000 0.000 0.000
#> GSM613712     3  0.4219     0.4471 0.000 0.000 0.584 0.000 0.416
#> GSM613713     3  0.4692     0.5768 0.000 0.276 0.688 0.012 0.024
#> GSM613714     3  0.1364     0.8041 0.000 0.012 0.952 0.000 0.036
#> GSM613715     3  0.0963     0.8079 0.000 0.000 0.964 0.000 0.036
#> GSM613716     3  0.5977     0.3875 0.000 0.000 0.540 0.332 0.128
#> GSM613717     3  0.0290     0.8110 0.000 0.000 0.992 0.000 0.008
#> GSM613718     3  0.0000     0.8087 0.000 0.000 1.000 0.000 0.000
#> GSM613719     5  0.4254     0.2743 0.000 0.000 0.220 0.040 0.740
#> GSM613720     4  0.5109    -0.0385 0.000 0.000 0.460 0.504 0.036
#> GSM613721     4  0.3003     0.6613 0.000 0.000 0.000 0.812 0.188
#> GSM613722     2  0.0000     0.7507 0.000 1.000 0.000 0.000 0.000
#> GSM613723     5  0.4734     0.4661 0.372 0.000 0.000 0.024 0.604
#> GSM613724     1  0.0404     0.7820 0.988 0.000 0.000 0.012 0.000
#> GSM613725     2  0.0000     0.7507 0.000 1.000 0.000 0.000 0.000
#> GSM613726     1  0.4074     0.4732 0.636 0.000 0.000 0.000 0.364
#> GSM613727     1  0.0000     0.7898 1.000 0.000 0.000 0.000 0.000
#> GSM613728     2  0.4015     0.6043 0.000 0.768 0.012 0.204 0.016
#> GSM613729     1  0.0404     0.7865 0.988 0.000 0.000 0.000 0.012
#> GSM613730     2  0.6750     0.4555 0.012 0.556 0.012 0.192 0.228
#> GSM613731     1  0.4138     0.4469 0.616 0.000 0.000 0.000 0.384
#> GSM613732     3  0.0000     0.8087 0.000 0.000 1.000 0.000 0.000
#> GSM613733     2  0.4897     0.1327 0.000 0.516 0.460 0.000 0.024
#> GSM613734     5  0.5028     0.4237 0.400 0.000 0.000 0.036 0.564
#> GSM613735     5  0.4696     0.4661 0.360 0.000 0.000 0.024 0.616
#> GSM613736     3  0.0510     0.8119 0.000 0.000 0.984 0.000 0.016
#> GSM613737     5  0.4242    -0.1552 0.000 0.000 0.428 0.000 0.572
#> GSM613738     5  0.4074     0.4649 0.364 0.000 0.000 0.000 0.636
#> GSM613739     5  0.4696     0.4661 0.360 0.000 0.000 0.024 0.616
#> GSM613740     3  0.0000     0.8087 0.000 0.000 1.000 0.000 0.000
#> GSM613741     4  0.4138     0.5268 0.000 0.000 0.000 0.616 0.384
#> GSM613742     5  0.1043     0.4082 0.040 0.000 0.000 0.000 0.960
#> GSM613743     3  0.0000     0.8087 0.000 0.000 1.000 0.000 0.000
#> GSM613744     3  0.0000     0.8087 0.000 0.000 1.000 0.000 0.000
#> GSM613745     4  0.4321     0.5160 0.000 0.000 0.004 0.600 0.396
#> GSM613746     4  0.0703     0.7119 0.000 0.000 0.000 0.976 0.024
#> GSM613747     5  0.4969     0.4580 0.376 0.000 0.000 0.036 0.588
#> GSM613748     2  0.5068     0.4602 0.032 0.580 0.004 0.000 0.384
#> GSM613749     1  0.4138     0.4469 0.616 0.000 0.000 0.000 0.384
#> GSM613750     3  0.0703     0.8108 0.000 0.000 0.976 0.000 0.024
#> GSM613751     3  0.0000     0.8087 0.000 0.000 1.000 0.000 0.000
#> GSM613752     3  0.0510     0.8119 0.000 0.000 0.984 0.000 0.016
#> GSM613753     3  0.0703     0.8108 0.000 0.000 0.976 0.000 0.024

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613639     1  0.4774     0.4639 0.600 0.000 0.000 0.332 0.068 0.000
#> GSM613640     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613641     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613642     4  0.3857     0.0305 0.000 0.468 0.000 0.532 0.000 0.000
#> GSM613643     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613644     4  0.1007     0.8596 0.000 0.000 0.000 0.956 0.044 0.000
#> GSM613645     1  0.3626     0.7240 0.788 0.000 0.000 0.144 0.068 0.000
#> GSM613646     4  0.1387     0.8464 0.000 0.000 0.000 0.932 0.068 0.000
#> GSM613647     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613648     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613649     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613650     4  0.1387     0.8464 0.000 0.000 0.000 0.932 0.068 0.000
#> GSM613651     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613652     5  0.1387     0.9664 0.068 0.000 0.000 0.000 0.932 0.000
#> GSM613653     6  0.4823     0.3954 0.000 0.000 0.000 0.348 0.068 0.584
#> GSM613654     5  0.1387     0.9664 0.068 0.000 0.000 0.000 0.932 0.000
#> GSM613655     1  0.0713     0.8613 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM613656     5  0.1387     0.9664 0.068 0.000 0.000 0.000 0.932 0.000
#> GSM613657     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613658     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613659     6  0.4118     0.4317 0.000 0.000 0.000 0.352 0.020 0.628
#> GSM613660     2  0.0000     0.8169 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613661     1  0.4507     0.5786 0.664 0.000 0.000 0.268 0.068 0.000
#> GSM613662     6  0.0000     0.7846 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM613663     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613664     6  0.0000     0.7846 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM613665     2  0.0000     0.8169 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613666     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613667     1  0.3206     0.7614 0.828 0.000 0.000 0.104 0.068 0.000
#> GSM613668     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613669     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613670     6  0.0000     0.7846 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM613671     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613672     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613673     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613674     2  0.0000     0.8169 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613675     6  0.0000     0.7846 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM613676     2  0.0632     0.8032 0.000 0.976 0.024 0.000 0.000 0.000
#> GSM613677     4  0.0632     0.8657 0.000 0.000 0.024 0.976 0.000 0.000
#> GSM613678     1  0.5183     0.2563 0.516 0.000 0.000 0.408 0.068 0.008
#> GSM613679     2  0.0000     0.8169 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613680     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613681     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613682     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613683     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613684     2  0.4310     0.2543 0.000 0.580 0.024 0.000 0.000 0.396
#> GSM613685     2  0.0000     0.8169 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613686     1  0.1387     0.8383 0.932 0.000 0.000 0.000 0.068 0.000
#> GSM613687     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613688     6  0.3630     0.5403 0.000 0.212 0.000 0.032 0.000 0.756
#> GSM613689     3  0.3515     0.5014 0.000 0.000 0.676 0.324 0.000 0.000
#> GSM613690     3  0.0146     0.9560 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM613691     6  0.0000     0.7846 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM613692     4  0.3470     0.6510 0.200 0.000 0.000 0.772 0.028 0.000
#> GSM613693     6  0.0146     0.7826 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM613694     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613695     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613696     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613697     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613698     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613699     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613700     2  0.0000     0.8169 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613701     2  0.3756     0.3174 0.000 0.600 0.000 0.400 0.000 0.000
#> GSM613702     2  0.3756     0.3174 0.000 0.600 0.000 0.400 0.000 0.000
#> GSM613703     1  0.1387     0.8383 0.932 0.000 0.000 0.000 0.068 0.000
#> GSM613704     6  0.0000     0.7846 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM613705     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613706     4  0.2454     0.7331 0.000 0.160 0.000 0.840 0.000 0.000
#> GSM613707     2  0.0000     0.8169 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613708     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613709     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613710     2  0.0000     0.8169 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613711     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613712     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613713     3  0.3266     0.6328 0.000 0.272 0.728 0.000 0.000 0.000
#> GSM613714     4  0.3515     0.4615 0.000 0.000 0.324 0.676 0.000 0.000
#> GSM613715     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613716     4  0.3765     0.2369 0.000 0.000 0.000 0.596 0.000 0.404
#> GSM613717     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613718     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613719     4  0.1387     0.8464 0.000 0.000 0.000 0.932 0.068 0.000
#> GSM613720     6  0.3828     0.1367 0.000 0.000 0.440 0.000 0.000 0.560
#> GSM613721     6  0.3453     0.6778 0.000 0.000 0.000 0.132 0.064 0.804
#> GSM613722     2  0.0000     0.8169 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613723     5  0.1387     0.9664 0.068 0.000 0.000 0.000 0.932 0.000
#> GSM613724     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613725     2  0.0000     0.8169 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613726     1  0.4738     0.4608 0.600 0.000 0.000 0.336 0.064 0.000
#> GSM613727     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613728     2  0.2854     0.6472 0.000 0.792 0.000 0.000 0.000 0.208
#> GSM613729     1  0.0000     0.8807 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613730     2  0.5887     0.1143 0.000 0.408 0.000 0.392 0.000 0.200
#> GSM613731     4  0.3727     0.2593 0.388 0.000 0.000 0.612 0.000 0.000
#> GSM613732     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613733     2  0.3747     0.3217 0.000 0.604 0.396 0.000 0.000 0.000
#> GSM613734     5  0.1387     0.9664 0.068 0.000 0.000 0.000 0.932 0.000
#> GSM613735     5  0.1387     0.9664 0.068 0.000 0.000 0.000 0.932 0.000
#> GSM613736     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613737     4  0.0000     0.8782 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613738     5  0.4024     0.7186 0.264 0.000 0.000 0.036 0.700 0.000
#> GSM613739     5  0.1387     0.9664 0.068 0.000 0.000 0.000 0.932 0.000
#> GSM613740     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613741     6  0.4760     0.4363 0.000 0.000 0.000 0.328 0.068 0.604
#> GSM613742     4  0.1387     0.8299 0.068 0.000 0.000 0.932 0.000 0.000
#> GSM613743     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613744     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613745     4  0.1387     0.8464 0.000 0.000 0.000 0.932 0.068 0.000
#> GSM613746     6  0.0000     0.7846 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM613747     5  0.1387     0.9664 0.068 0.000 0.000 0.000 0.932 0.000
#> GSM613748     4  0.2941     0.6472 0.000 0.220 0.000 0.780 0.000 0.000
#> GSM613749     1  0.4774     0.4639 0.600 0.000 0.000 0.332 0.068 0.000
#> GSM613750     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613751     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613752     3  0.0000     0.9594 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613753     3  0.0547     0.9402 0.000 0.000 0.980 0.020 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-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 disease.state(p) k
#> SD:mclust 115         0.061075 2
#> SD:mclust  61         0.447646 3
#> SD:mclust 102         0.140369 4
#> SD:mclust  69         0.172469 5
#> SD:mclust  99         0.000871 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 27425 rows and 116 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 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-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.912           0.940       0.974         0.5012 0.498   0.498
#> 3 3 0.670           0.801       0.910         0.3049 0.767   0.566
#> 4 4 0.745           0.814       0.910         0.1123 0.852   0.613
#> 5 5 0.609           0.587       0.769         0.0671 0.909   0.701
#> 6 6 0.618           0.492       0.712         0.0427 0.920   0.688

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
#> GSM613638     2  0.8081      0.684 0.248 0.752
#> GSM613639     1  0.0000      0.979 1.000 0.000
#> GSM613640     2  0.7139      0.764 0.196 0.804
#> GSM613641     1  0.0000      0.979 1.000 0.000
#> GSM613642     2  0.0000      0.967 0.000 1.000
#> GSM613643     1  0.0000      0.979 1.000 0.000
#> GSM613644     1  0.0000      0.979 1.000 0.000
#> GSM613645     1  0.0000      0.979 1.000 0.000
#> GSM613646     1  0.5178      0.862 0.884 0.116
#> GSM613647     1  0.8267      0.641 0.740 0.260
#> GSM613648     2  0.0000      0.967 0.000 1.000
#> GSM613649     2  0.0000      0.967 0.000 1.000
#> GSM613650     1  0.0000      0.979 1.000 0.000
#> GSM613651     1  0.0000      0.979 1.000 0.000
#> GSM613652     1  0.0000      0.979 1.000 0.000
#> GSM613653     1  0.2423      0.945 0.960 0.040
#> GSM613654     1  0.0000      0.979 1.000 0.000
#> GSM613655     1  0.0000      0.979 1.000 0.000
#> GSM613656     1  0.0000      0.979 1.000 0.000
#> GSM613657     2  0.0000      0.967 0.000 1.000
#> GSM613658     1  0.0000      0.979 1.000 0.000
#> GSM613659     2  0.0000      0.967 0.000 1.000
#> GSM613660     2  0.0000      0.967 0.000 1.000
#> GSM613661     1  0.0000      0.979 1.000 0.000
#> GSM613662     2  0.0000      0.967 0.000 1.000
#> GSM613663     1  0.0000      0.979 1.000 0.000
#> GSM613664     2  0.0000      0.967 0.000 1.000
#> GSM613665     2  0.0000      0.967 0.000 1.000
#> GSM613666     1  0.0000      0.979 1.000 0.000
#> GSM613667     1  0.0000      0.979 1.000 0.000
#> GSM613668     1  0.0000      0.979 1.000 0.000
#> GSM613669     1  0.0000      0.979 1.000 0.000
#> GSM613670     2  0.2236      0.938 0.036 0.964
#> GSM613671     1  0.0000      0.979 1.000 0.000
#> GSM613672     1  0.0000      0.979 1.000 0.000
#> GSM613673     1  0.0000      0.979 1.000 0.000
#> GSM613674     2  0.0000      0.967 0.000 1.000
#> GSM613675     2  0.0000      0.967 0.000 1.000
#> GSM613676     2  0.0000      0.967 0.000 1.000
#> GSM613677     2  0.0000      0.967 0.000 1.000
#> GSM613678     1  0.0672      0.973 0.992 0.008
#> GSM613679     2  0.0000      0.967 0.000 1.000
#> GSM613680     1  0.0000      0.979 1.000 0.000
#> GSM613681     1  0.0000      0.979 1.000 0.000
#> GSM613682     1  0.0000      0.979 1.000 0.000
#> GSM613683     1  0.0000      0.979 1.000 0.000
#> GSM613684     2  0.0000      0.967 0.000 1.000
#> GSM613685     2  0.0000      0.967 0.000 1.000
#> GSM613686     1  0.0000      0.979 1.000 0.000
#> GSM613687     1  0.0000      0.979 1.000 0.000
#> GSM613688     2  0.0000      0.967 0.000 1.000
#> GSM613689     2  0.0000      0.967 0.000 1.000
#> GSM613690     2  0.0000      0.967 0.000 1.000
#> GSM613691     2  0.0000      0.967 0.000 1.000
#> GSM613692     1  0.0000      0.979 1.000 0.000
#> GSM613693     2  0.0000      0.967 0.000 1.000
#> GSM613694     1  0.5519      0.847 0.872 0.128
#> GSM613695     2  0.0000      0.967 0.000 1.000
#> GSM613696     2  0.1414      0.952 0.020 0.980
#> GSM613697     1  0.0000      0.979 1.000 0.000
#> GSM613698     2  0.9775      0.323 0.412 0.588
#> GSM613699     2  0.6887      0.778 0.184 0.816
#> GSM613700     2  0.0000      0.967 0.000 1.000
#> GSM613701     2  0.2043      0.941 0.032 0.968
#> GSM613702     2  0.0672      0.961 0.008 0.992
#> GSM613703     1  0.0000      0.979 1.000 0.000
#> GSM613704     2  0.0000      0.967 0.000 1.000
#> GSM613705     2  0.7528      0.734 0.216 0.784
#> GSM613706     1  0.1414      0.963 0.980 0.020
#> GSM613707     2  0.0000      0.967 0.000 1.000
#> GSM613708     1  0.0000      0.979 1.000 0.000
#> GSM613709     1  0.0000      0.979 1.000 0.000
#> GSM613710     2  0.0000      0.967 0.000 1.000
#> GSM613711     2  0.0000      0.967 0.000 1.000
#> GSM613712     2  0.7745      0.716 0.228 0.772
#> GSM613713     2  0.0000      0.967 0.000 1.000
#> GSM613714     2  0.0000      0.967 0.000 1.000
#> GSM613715     2  0.0000      0.967 0.000 1.000
#> GSM613716     2  0.0000      0.967 0.000 1.000
#> GSM613717     2  0.0000      0.967 0.000 1.000
#> GSM613718     2  0.0000      0.967 0.000 1.000
#> GSM613719     1  0.1633      0.960 0.976 0.024
#> GSM613720     2  0.0000      0.967 0.000 1.000
#> GSM613721     2  0.0000      0.967 0.000 1.000
#> GSM613722     2  0.0000      0.967 0.000 1.000
#> GSM613723     1  0.0000      0.979 1.000 0.000
#> GSM613724     1  0.0000      0.979 1.000 0.000
#> GSM613725     2  0.0000      0.967 0.000 1.000
#> GSM613726     1  0.0000      0.979 1.000 0.000
#> GSM613727     1  0.0000      0.979 1.000 0.000
#> GSM613728     2  0.0000      0.967 0.000 1.000
#> GSM613729     1  0.0000      0.979 1.000 0.000
#> GSM613730     2  0.0000      0.967 0.000 1.000
#> GSM613731     1  0.0000      0.979 1.000 0.000
#> GSM613732     2  0.0000      0.967 0.000 1.000
#> GSM613733     2  0.0000      0.967 0.000 1.000
#> GSM613734     1  0.0000      0.979 1.000 0.000
#> GSM613735     1  0.0000      0.979 1.000 0.000
#> GSM613736     2  0.0000      0.967 0.000 1.000
#> GSM613737     1  0.9795      0.261 0.584 0.416
#> GSM613738     1  0.0000      0.979 1.000 0.000
#> GSM613739     1  0.0000      0.979 1.000 0.000
#> GSM613740     2  0.0000      0.967 0.000 1.000
#> GSM613741     1  0.2948      0.933 0.948 0.052
#> GSM613742     1  0.0000      0.979 1.000 0.000
#> GSM613743     2  0.0000      0.967 0.000 1.000
#> GSM613744     2  0.0000      0.967 0.000 1.000
#> GSM613745     2  0.9358      0.481 0.352 0.648
#> GSM613746     2  0.0000      0.967 0.000 1.000
#> GSM613747     1  0.0000      0.979 1.000 0.000
#> GSM613748     2  0.0000      0.967 0.000 1.000
#> GSM613749     1  0.0000      0.979 1.000 0.000
#> GSM613750     2  0.0000      0.967 0.000 1.000
#> GSM613751     2  0.0000      0.967 0.000 1.000
#> GSM613752     2  0.0000      0.967 0.000 1.000
#> GSM613753     2  0.0000      0.967 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
#> GSM613638     3  0.4796     0.7092 0.220 0.000 0.780
#> GSM613639     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613640     3  0.3752     0.7676 0.144 0.000 0.856
#> GSM613641     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613642     3  0.6295    -0.1593 0.000 0.472 0.528
#> GSM613643     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613644     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613645     1  0.4002     0.8098 0.840 0.160 0.000
#> GSM613646     1  0.5581     0.7579 0.788 0.176 0.036
#> GSM613647     3  0.5560     0.6077 0.300 0.000 0.700
#> GSM613648     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613649     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613650     1  0.1031     0.9309 0.976 0.000 0.024
#> GSM613651     3  0.6252     0.2992 0.444 0.000 0.556
#> GSM613652     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613653     1  0.3850     0.8633 0.884 0.088 0.028
#> GSM613654     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613655     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613656     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613657     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613658     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613659     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM613660     3  0.6192     0.0442 0.000 0.420 0.580
#> GSM613661     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613662     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM613663     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613664     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM613665     2  0.4399     0.8147 0.000 0.812 0.188
#> GSM613666     1  0.0592     0.9419 0.988 0.012 0.000
#> GSM613667     1  0.0424     0.9446 0.992 0.008 0.000
#> GSM613668     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613669     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613670     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM613671     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613672     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613673     1  0.0237     0.9468 0.996 0.004 0.000
#> GSM613674     2  0.3412     0.8526 0.000 0.876 0.124
#> GSM613675     2  0.0237     0.8806 0.000 0.996 0.004
#> GSM613676     3  0.6180     0.0698 0.000 0.416 0.584
#> GSM613677     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613678     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM613679     2  0.4235     0.8242 0.000 0.824 0.176
#> GSM613680     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613681     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613682     1  0.5327     0.6136 0.728 0.272 0.000
#> GSM613683     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613684     2  0.5706     0.6449 0.000 0.680 0.320
#> GSM613685     2  0.4062     0.8315 0.000 0.836 0.164
#> GSM613686     2  0.4796     0.7016 0.220 0.780 0.000
#> GSM613687     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613688     2  0.2165     0.8728 0.000 0.936 0.064
#> GSM613689     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613690     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613691     2  0.0892     0.8769 0.000 0.980 0.020
#> GSM613692     1  0.0237     0.9465 0.996 0.000 0.004
#> GSM613693     3  0.2711     0.7816 0.000 0.088 0.912
#> GSM613694     3  0.6154     0.3959 0.408 0.000 0.592
#> GSM613695     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613696     3  0.4033     0.7690 0.136 0.008 0.856
#> GSM613697     3  0.6140     0.4046 0.404 0.000 0.596
#> GSM613698     3  0.5138     0.6784 0.252 0.000 0.748
#> GSM613699     3  0.3816     0.7633 0.148 0.000 0.852
#> GSM613700     2  0.4452     0.8124 0.000 0.808 0.192
#> GSM613701     2  0.4128     0.8002 0.132 0.856 0.012
#> GSM613702     2  0.0237     0.8801 0.004 0.996 0.000
#> GSM613703     1  0.4796     0.7325 0.780 0.220 0.000
#> GSM613704     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM613705     3  0.4121     0.7491 0.168 0.000 0.832
#> GSM613706     1  0.4931     0.6810 0.768 0.232 0.000
#> GSM613707     2  0.3340     0.8545 0.000 0.880 0.120
#> GSM613708     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613709     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613710     3  0.4974     0.5454 0.000 0.236 0.764
#> GSM613711     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613712     3  0.4504     0.7279 0.196 0.000 0.804
#> GSM613713     3  0.0424     0.8320 0.000 0.008 0.992
#> GSM613714     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613715     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613716     3  0.3482     0.7626 0.000 0.128 0.872
#> GSM613717     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613718     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613719     1  0.6299    -0.0665 0.524 0.000 0.476
#> GSM613720     3  0.0747     0.8294 0.000 0.016 0.984
#> GSM613721     2  0.0424     0.8799 0.000 0.992 0.008
#> GSM613722     2  0.4796     0.7864 0.000 0.780 0.220
#> GSM613723     1  0.0237     0.9465 0.996 0.000 0.004
#> GSM613724     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613725     2  0.5760     0.6385 0.000 0.672 0.328
#> GSM613726     1  0.0237     0.9468 0.996 0.004 0.000
#> GSM613727     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613728     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM613729     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613730     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM613731     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613732     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613733     3  0.0237     0.8345 0.000 0.004 0.996
#> GSM613734     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613735     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613736     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613737     3  0.5254     0.6621 0.264 0.000 0.736
#> GSM613738     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613739     1  0.0237     0.9465 0.996 0.000 0.004
#> GSM613740     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613741     1  0.6737     0.4060 0.600 0.384 0.016
#> GSM613742     1  0.1163     0.9271 0.972 0.000 0.028
#> GSM613743     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613744     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613745     3  0.8627     0.2723 0.104 0.392 0.504
#> GSM613746     2  0.1529     0.8680 0.000 0.960 0.040
#> GSM613747     1  0.0000     0.9489 1.000 0.000 0.000
#> GSM613748     2  0.6975     0.5496 0.028 0.616 0.356
#> GSM613749     2  0.3752     0.7879 0.144 0.856 0.000
#> GSM613750     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613751     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613752     3  0.0000     0.8369 0.000 0.000 1.000
#> GSM613753     3  0.0000     0.8369 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
#> GSM613638     3  0.7082      0.440 0.308 0.152 0.540 0.000
#> GSM613639     1  0.4746      0.480 0.632 0.000 0.000 0.368
#> GSM613640     2  0.7773      0.226 0.288 0.432 0.280 0.000
#> GSM613641     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613642     2  0.2281      0.839 0.000 0.904 0.096 0.000
#> GSM613643     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613644     1  0.0188      0.934 0.996 0.000 0.004 0.000
#> GSM613645     1  0.4353      0.687 0.756 0.012 0.000 0.232
#> GSM613646     4  0.0524      0.915 0.004 0.000 0.008 0.988
#> GSM613647     3  0.1716      0.841 0.064 0.000 0.936 0.000
#> GSM613648     3  0.0000      0.860 0.000 0.000 1.000 0.000
#> GSM613649     3  0.0707      0.854 0.000 0.000 0.980 0.020
#> GSM613650     1  0.4040      0.640 0.752 0.000 0.248 0.000
#> GSM613651     3  0.4122      0.702 0.236 0.000 0.760 0.004
#> GSM613652     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613653     4  0.0336      0.916 0.000 0.000 0.008 0.992
#> GSM613654     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613655     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613656     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613657     3  0.0469      0.858 0.000 0.012 0.988 0.000
#> GSM613658     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613659     4  0.1211      0.901 0.000 0.040 0.000 0.960
#> GSM613660     2  0.1474      0.861 0.000 0.948 0.052 0.000
#> GSM613661     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613662     4  0.0707      0.911 0.000 0.020 0.000 0.980
#> GSM613663     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613664     4  0.3975      0.686 0.000 0.240 0.000 0.760
#> GSM613665     2  0.0707      0.872 0.000 0.980 0.020 0.000
#> GSM613666     1  0.4535      0.627 0.704 0.004 0.000 0.292
#> GSM613667     1  0.0188      0.934 0.996 0.004 0.000 0.000
#> GSM613668     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613669     1  0.0336      0.932 0.992 0.000 0.000 0.008
#> GSM613670     4  0.0707      0.911 0.000 0.020 0.000 0.980
#> GSM613671     1  0.3764      0.740 0.784 0.000 0.000 0.216
#> GSM613672     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613673     1  0.0707      0.924 0.980 0.020 0.000 0.000
#> GSM613674     2  0.0336      0.872 0.000 0.992 0.000 0.008
#> GSM613675     4  0.0188      0.916 0.000 0.000 0.004 0.996
#> GSM613676     2  0.2921      0.801 0.000 0.860 0.140 0.000
#> GSM613677     3  0.0188      0.860 0.000 0.004 0.996 0.000
#> GSM613678     4  0.3801      0.702 0.000 0.220 0.000 0.780
#> GSM613679     2  0.0524      0.873 0.000 0.988 0.004 0.008
#> GSM613680     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613681     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613682     1  0.3142      0.814 0.860 0.132 0.000 0.008
#> GSM613683     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613684     2  0.2002      0.859 0.000 0.936 0.020 0.044
#> GSM613685     2  0.0376      0.873 0.000 0.992 0.004 0.004
#> GSM613686     1  0.6327      0.576 0.652 0.132 0.000 0.216
#> GSM613687     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613688     2  0.3751      0.697 0.000 0.800 0.004 0.196
#> GSM613689     3  0.4304      0.570 0.000 0.284 0.716 0.000
#> GSM613690     3  0.0336      0.858 0.000 0.000 0.992 0.008
#> GSM613691     4  0.0188      0.916 0.000 0.000 0.004 0.996
#> GSM613692     1  0.3790      0.766 0.820 0.000 0.164 0.016
#> GSM613693     4  0.5873      0.148 0.000 0.036 0.416 0.548
#> GSM613694     3  0.4985      0.205 0.468 0.000 0.532 0.000
#> GSM613695     3  0.0000      0.860 0.000 0.000 1.000 0.000
#> GSM613696     3  0.5613      0.703 0.120 0.000 0.724 0.156
#> GSM613697     3  0.3024      0.788 0.148 0.000 0.852 0.000
#> GSM613698     3  0.3693      0.806 0.072 0.000 0.856 0.072
#> GSM613699     3  0.3498      0.777 0.160 0.000 0.832 0.008
#> GSM613700     2  0.0000      0.873 0.000 1.000 0.000 0.000
#> GSM613701     2  0.0188      0.873 0.000 0.996 0.000 0.004
#> GSM613702     2  0.0188      0.873 0.000 0.996 0.000 0.004
#> GSM613703     4  0.1209      0.895 0.032 0.004 0.000 0.964
#> GSM613704     4  0.0707      0.911 0.000 0.020 0.000 0.980
#> GSM613705     3  0.4057      0.776 0.152 0.032 0.816 0.000
#> GSM613706     2  0.3625      0.741 0.160 0.828 0.012 0.000
#> GSM613707     2  0.0336      0.872 0.000 0.992 0.000 0.008
#> GSM613708     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613709     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613710     2  0.2149      0.842 0.000 0.912 0.088 0.000
#> GSM613711     3  0.1022      0.852 0.000 0.032 0.968 0.000
#> GSM613712     3  0.3099      0.814 0.104 0.000 0.876 0.020
#> GSM613713     3  0.5060      0.278 0.000 0.412 0.584 0.004
#> GSM613714     3  0.0817      0.855 0.000 0.024 0.976 0.000
#> GSM613715     3  0.0469      0.857 0.000 0.000 0.988 0.012
#> GSM613716     3  0.4661      0.492 0.000 0.000 0.652 0.348
#> GSM613717     3  0.0592      0.858 0.000 0.016 0.984 0.000
#> GSM613718     3  0.0188      0.860 0.000 0.004 0.996 0.000
#> GSM613719     3  0.6187      0.646 0.144 0.000 0.672 0.184
#> GSM613720     3  0.4804      0.410 0.000 0.000 0.616 0.384
#> GSM613721     4  0.0376      0.916 0.000 0.004 0.004 0.992
#> GSM613722     2  0.0188      0.873 0.000 0.996 0.004 0.000
#> GSM613723     1  0.0188      0.934 0.996 0.000 0.004 0.000
#> GSM613724     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613725     2  0.0469      0.873 0.000 0.988 0.012 0.000
#> GSM613726     1  0.0336      0.932 0.992 0.008 0.000 0.000
#> GSM613727     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613728     2  0.1118      0.861 0.000 0.964 0.000 0.036
#> GSM613729     1  0.0592      0.927 0.984 0.000 0.000 0.016
#> GSM613730     2  0.4535      0.549 0.000 0.704 0.004 0.292
#> GSM613731     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613732     3  0.0524      0.860 0.000 0.008 0.988 0.004
#> GSM613733     2  0.4746      0.443 0.000 0.632 0.368 0.000
#> GSM613734     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613735     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613736     3  0.2921      0.774 0.000 0.140 0.860 0.000
#> GSM613737     3  0.2342      0.831 0.080 0.000 0.912 0.008
#> GSM613738     1  0.1042      0.920 0.972 0.000 0.020 0.008
#> GSM613739     1  0.1557      0.895 0.944 0.000 0.056 0.000
#> GSM613740     3  0.0188      0.859 0.000 0.000 0.996 0.004
#> GSM613741     4  0.0336      0.916 0.000 0.000 0.008 0.992
#> GSM613742     1  0.4468      0.659 0.752 0.000 0.232 0.016
#> GSM613743     3  0.0707      0.856 0.000 0.020 0.980 0.000
#> GSM613744     3  0.0188      0.860 0.000 0.004 0.996 0.000
#> GSM613745     4  0.0921      0.901 0.000 0.000 0.028 0.972
#> GSM613746     4  0.0336      0.916 0.000 0.000 0.008 0.992
#> GSM613747     1  0.0000      0.936 1.000 0.000 0.000 0.000
#> GSM613748     2  0.2596      0.834 0.068 0.908 0.024 0.000
#> GSM613749     2  0.4491      0.719 0.140 0.800 0.000 0.060
#> GSM613750     3  0.0000      0.860 0.000 0.000 1.000 0.000
#> GSM613751     3  0.0188      0.860 0.000 0.004 0.996 0.000
#> GSM613752     3  0.0188      0.860 0.000 0.004 0.996 0.000
#> GSM613753     3  0.0000      0.860 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
#> GSM613638     5  0.6004     0.4310 0.256 0.168 0.000 0.000 0.576
#> GSM613639     4  0.3370     0.5604 0.144 0.004 0.016 0.832 0.004
#> GSM613640     5  0.7674     0.1949 0.028 0.316 0.100 0.072 0.484
#> GSM613641     1  0.1041     0.8672 0.964 0.004 0.000 0.032 0.000
#> GSM613642     2  0.3774     0.6100 0.000 0.804 0.008 0.028 0.160
#> GSM613643     1  0.5976     0.6323 0.676 0.056 0.004 0.080 0.184
#> GSM613644     5  0.8183     0.2346 0.140 0.012 0.128 0.300 0.420
#> GSM613645     4  0.3887     0.5415 0.148 0.040 0.008 0.804 0.000
#> GSM613646     4  0.5732     0.3318 0.072 0.000 0.428 0.496 0.004
#> GSM613647     5  0.3285     0.7197 0.048 0.004 0.076 0.008 0.864
#> GSM613648     5  0.3081     0.7035 0.000 0.000 0.156 0.012 0.832
#> GSM613649     5  0.2230     0.7206 0.000 0.000 0.116 0.000 0.884
#> GSM613650     1  0.4552     0.6862 0.760 0.000 0.040 0.024 0.176
#> GSM613651     5  0.4404     0.5582 0.252 0.000 0.036 0.000 0.712
#> GSM613652     1  0.0162     0.8684 0.996 0.000 0.004 0.000 0.000
#> GSM613653     4  0.4928     0.3677 0.012 0.000 0.408 0.568 0.012
#> GSM613654     1  0.0162     0.8684 0.996 0.000 0.004 0.000 0.000
#> GSM613655     1  0.0000     0.8688 1.000 0.000 0.000 0.000 0.000
#> GSM613656     1  0.0162     0.8684 0.996 0.000 0.004 0.000 0.000
#> GSM613657     5  0.1579     0.7274 0.000 0.032 0.024 0.000 0.944
#> GSM613658     1  0.0609     0.8693 0.980 0.000 0.000 0.020 0.000
#> GSM613659     4  0.2674     0.5914 0.000 0.012 0.120 0.868 0.000
#> GSM613660     2  0.2660     0.6290 0.000 0.864 0.000 0.008 0.128
#> GSM613661     1  0.4430     0.3238 0.540 0.004 0.000 0.456 0.000
#> GSM613662     4  0.2561     0.5998 0.000 0.000 0.144 0.856 0.000
#> GSM613663     1  0.1831     0.8538 0.920 0.004 0.000 0.076 0.000
#> GSM613664     2  0.6641    -0.1638 0.000 0.408 0.368 0.224 0.000
#> GSM613665     2  0.3112     0.6363 0.000 0.856 0.000 0.100 0.044
#> GSM613666     1  0.3966     0.7215 0.756 0.008 0.012 0.224 0.000
#> GSM613667     4  0.5344     0.1581 0.372 0.032 0.016 0.580 0.000
#> GSM613668     1  0.0290     0.8695 0.992 0.008 0.000 0.000 0.000
#> GSM613669     1  0.3715     0.7029 0.736 0.004 0.000 0.260 0.000
#> GSM613670     4  0.2020     0.6104 0.000 0.000 0.100 0.900 0.000
#> GSM613671     1  0.4434     0.2955 0.536 0.004 0.000 0.460 0.000
#> GSM613672     1  0.1205     0.8664 0.956 0.004 0.000 0.040 0.000
#> GSM613673     1  0.1211     0.8662 0.960 0.016 0.000 0.024 0.000
#> GSM613674     2  0.4625     0.3803 0.000 0.652 0.324 0.020 0.004
#> GSM613675     4  0.3031     0.6005 0.000 0.004 0.128 0.852 0.016
#> GSM613676     2  0.4404     0.5120 0.000 0.704 0.000 0.032 0.264
#> GSM613677     5  0.2910     0.7114 0.000 0.060 0.044 0.012 0.884
#> GSM613678     4  0.2824     0.5614 0.000 0.096 0.032 0.872 0.000
#> GSM613679     2  0.1670     0.6328 0.000 0.936 0.052 0.012 0.000
#> GSM613680     1  0.0992     0.8679 0.968 0.008 0.000 0.024 0.000
#> GSM613681     1  0.2249     0.8455 0.896 0.008 0.000 0.096 0.000
#> GSM613682     1  0.3740     0.7294 0.784 0.196 0.008 0.012 0.000
#> GSM613683     1  0.0162     0.8696 0.996 0.000 0.000 0.004 0.000
#> GSM613684     2  0.5408     0.1353 0.000 0.516 0.440 0.020 0.024
#> GSM613685     2  0.4518     0.3907 0.000 0.660 0.320 0.016 0.004
#> GSM613686     4  0.4580     0.4967 0.200 0.052 0.008 0.740 0.000
#> GSM613687     1  0.1408     0.8642 0.948 0.008 0.000 0.044 0.000
#> GSM613688     2  0.5789     0.2141 0.000 0.552 0.356 0.088 0.004
#> GSM613689     5  0.5799     0.3182 0.000 0.324 0.112 0.000 0.564
#> GSM613690     5  0.0963     0.7282 0.000 0.000 0.036 0.000 0.964
#> GSM613691     4  0.4225     0.4305 0.000 0.000 0.364 0.632 0.004
#> GSM613692     1  0.3888     0.7492 0.800 0.000 0.136 0.000 0.064
#> GSM613693     3  0.5422     0.5174 0.000 0.100 0.728 0.116 0.056
#> GSM613694     1  0.3912     0.7576 0.828 0.028 0.092 0.000 0.052
#> GSM613695     5  0.2555     0.7273 0.016 0.008 0.072 0.004 0.900
#> GSM613696     3  0.5919     0.4545 0.092 0.040 0.692 0.012 0.164
#> GSM613697     5  0.3891     0.6427 0.172 0.000 0.028 0.008 0.792
#> GSM613698     5  0.5602     0.4538 0.060 0.000 0.316 0.016 0.608
#> GSM613699     5  0.7101     0.3953 0.248 0.040 0.204 0.000 0.508
#> GSM613700     2  0.1300     0.6478 0.000 0.956 0.000 0.028 0.016
#> GSM613701     2  0.1901     0.6331 0.012 0.928 0.056 0.004 0.000
#> GSM613702     2  0.4217     0.5212 0.000 0.704 0.012 0.280 0.004
#> GSM613703     4  0.3124     0.6043 0.016 0.004 0.136 0.844 0.000
#> GSM613704     4  0.4227     0.4934 0.000 0.016 0.292 0.692 0.000
#> GSM613705     5  0.4099     0.6970 0.060 0.076 0.028 0.008 0.828
#> GSM613706     2  0.5184     0.5288 0.164 0.736 0.004 0.056 0.040
#> GSM613707     2  0.4735     0.3417 0.000 0.624 0.352 0.020 0.004
#> GSM613708     1  0.2230     0.8387 0.884 0.000 0.000 0.116 0.000
#> GSM613709     1  0.2439     0.8334 0.876 0.004 0.000 0.120 0.000
#> GSM613710     2  0.2741     0.6269 0.000 0.860 0.004 0.004 0.132
#> GSM613711     5  0.2376     0.7212 0.000 0.044 0.052 0.000 0.904
#> GSM613712     5  0.4676     0.6188 0.140 0.000 0.120 0.000 0.740
#> GSM613713     3  0.5557    -0.1766 0.000 0.460 0.472 0.000 0.068
#> GSM613714     5  0.2992     0.7180 0.000 0.064 0.068 0.000 0.868
#> GSM613715     5  0.1792     0.7235 0.000 0.000 0.084 0.000 0.916
#> GSM613716     5  0.5858     0.0733 0.000 0.000 0.452 0.096 0.452
#> GSM613717     5  0.3119     0.7137 0.000 0.068 0.072 0.000 0.860
#> GSM613718     5  0.0703     0.7300 0.000 0.000 0.024 0.000 0.976
#> GSM613719     5  0.7417     0.0400 0.124 0.000 0.384 0.080 0.412
#> GSM613720     3  0.6203     0.0699 0.000 0.000 0.464 0.140 0.396
#> GSM613721     3  0.5116     0.4420 0.000 0.120 0.692 0.188 0.000
#> GSM613722     2  0.2316     0.6508 0.000 0.916 0.012 0.036 0.036
#> GSM613723     1  0.0162     0.8684 0.996 0.000 0.004 0.000 0.000
#> GSM613724     1  0.0703     0.8692 0.976 0.000 0.000 0.024 0.000
#> GSM613725     2  0.1502     0.6310 0.000 0.940 0.056 0.000 0.004
#> GSM613726     1  0.4159     0.7629 0.776 0.068 0.000 0.156 0.000
#> GSM613727     1  0.0671     0.8692 0.980 0.004 0.000 0.016 0.000
#> GSM613728     2  0.3741     0.5476 0.000 0.732 0.000 0.264 0.004
#> GSM613729     1  0.3814     0.6699 0.720 0.004 0.000 0.276 0.000
#> GSM613730     4  0.5773     0.1088 0.004 0.368 0.056 0.560 0.012
#> GSM613731     1  0.6156     0.5068 0.592 0.180 0.000 0.220 0.008
#> GSM613732     5  0.1845     0.7298 0.000 0.016 0.056 0.000 0.928
#> GSM613733     2  0.5036     0.2557 0.000 0.560 0.036 0.000 0.404
#> GSM613734     1  0.0162     0.8684 0.996 0.000 0.004 0.000 0.000
#> GSM613735     1  0.0324     0.8688 0.992 0.000 0.004 0.004 0.000
#> GSM613736     5  0.6707     0.1858 0.000 0.340 0.192 0.008 0.460
#> GSM613737     5  0.4975     0.5887 0.220 0.000 0.076 0.004 0.700
#> GSM613738     1  0.1444     0.8557 0.948 0.000 0.040 0.000 0.012
#> GSM613739     1  0.2069     0.8311 0.912 0.000 0.012 0.000 0.076
#> GSM613740     5  0.4210     0.6406 0.000 0.036 0.224 0.000 0.740
#> GSM613741     4  0.4686     0.3754 0.004 0.000 0.396 0.588 0.012
#> GSM613742     1  0.3159     0.7961 0.856 0.000 0.056 0.000 0.088
#> GSM613743     5  0.4545     0.6150 0.000 0.116 0.132 0.000 0.752
#> GSM613744     5  0.1082     0.7305 0.000 0.008 0.028 0.000 0.964
#> GSM613745     4  0.5188     0.3490 0.000 0.000 0.416 0.540 0.044
#> GSM613746     3  0.4443     0.2232 0.000 0.008 0.680 0.300 0.012
#> GSM613747     1  0.0162     0.8684 0.996 0.000 0.004 0.000 0.000
#> GSM613748     2  0.6531     0.3116 0.004 0.524 0.052 0.360 0.060
#> GSM613749     2  0.5598     0.4561 0.176 0.656 0.004 0.164 0.000
#> GSM613750     5  0.2439     0.7119 0.000 0.004 0.120 0.000 0.876
#> GSM613751     5  0.2574     0.7103 0.000 0.012 0.112 0.000 0.876
#> GSM613752     5  0.3048     0.6860 0.000 0.004 0.176 0.000 0.820
#> GSM613753     5  0.2377     0.7115 0.000 0.000 0.128 0.000 0.872

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     3  0.7042   0.132177 0.252 0.240 0.424 0.084 0.000 0.000
#> GSM613639     6  0.1666   0.580926 0.036 0.008 0.000 0.020 0.000 0.936
#> GSM613640     2  0.6849   0.338245 0.012 0.516 0.156 0.236 0.000 0.080
#> GSM613641     1  0.1858   0.804590 0.904 0.004 0.000 0.000 0.000 0.092
#> GSM613642     2  0.6261   0.467899 0.000 0.576 0.272 0.036 0.060 0.056
#> GSM613643     1  0.5006   0.701948 0.748 0.060 0.064 0.032 0.000 0.096
#> GSM613644     3  0.7325  -0.022776 0.076 0.016 0.384 0.332 0.000 0.192
#> GSM613645     6  0.5030   0.541871 0.064 0.072 0.000 0.120 0.012 0.732
#> GSM613646     4  0.6794  -0.188204 0.052 0.000 0.020 0.452 0.124 0.352
#> GSM613647     3  0.4749   0.429660 0.088 0.004 0.684 0.220 0.000 0.004
#> GSM613648     4  0.4773  -0.078639 0.000 0.048 0.376 0.572 0.000 0.004
#> GSM613649     3  0.3789   0.485771 0.000 0.040 0.760 0.196 0.004 0.000
#> GSM613650     1  0.7129  -0.008598 0.396 0.000 0.028 0.336 0.036 0.204
#> GSM613651     3  0.3053   0.477820 0.144 0.000 0.828 0.024 0.000 0.004
#> GSM613652     1  0.0713   0.815604 0.972 0.000 0.000 0.028 0.000 0.000
#> GSM613653     6  0.5824   0.417105 0.012 0.000 0.028 0.124 0.220 0.616
#> GSM613654     1  0.0713   0.815604 0.972 0.000 0.000 0.028 0.000 0.000
#> GSM613655     1  0.0146   0.820224 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM613656     1  0.0458   0.817960 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM613657     3  0.5755   0.328372 0.000 0.176 0.516 0.304 0.004 0.000
#> GSM613658     1  0.1141   0.815605 0.948 0.000 0.000 0.000 0.000 0.052
#> GSM613659     6  0.5819   0.406185 0.000 0.064 0.000 0.380 0.052 0.504
#> GSM613660     2  0.2255   0.641445 0.000 0.892 0.016 0.088 0.004 0.000
#> GSM613661     6  0.4709  -0.238496 0.480 0.012 0.004 0.016 0.000 0.488
#> GSM613662     6  0.3671   0.574753 0.000 0.024 0.000 0.068 0.092 0.816
#> GSM613663     1  0.1753   0.808360 0.912 0.004 0.000 0.000 0.000 0.084
#> GSM613664     5  0.3759   0.684513 0.000 0.216 0.000 0.008 0.752 0.024
#> GSM613665     2  0.3739   0.621268 0.000 0.832 0.016 0.044 0.044 0.064
#> GSM613666     1  0.2692   0.778860 0.840 0.000 0.000 0.000 0.012 0.148
#> GSM613667     6  0.6491   0.388859 0.260 0.080 0.000 0.120 0.004 0.536
#> GSM613668     1  0.0146   0.820224 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM613669     1  0.3563   0.568296 0.664 0.000 0.000 0.000 0.000 0.336
#> GSM613670     6  0.2860   0.576727 0.000 0.012 0.000 0.068 0.052 0.868
#> GSM613671     1  0.4089   0.490022 0.616 0.004 0.000 0.004 0.004 0.372
#> GSM613672     1  0.0767   0.820815 0.976 0.004 0.000 0.012 0.000 0.008
#> GSM613673     1  0.2316   0.797979 0.900 0.064 0.000 0.028 0.004 0.004
#> GSM613674     5  0.3547   0.603365 0.000 0.332 0.000 0.000 0.668 0.000
#> GSM613675     6  0.6978   0.379458 0.000 0.072 0.192 0.168 0.032 0.536
#> GSM613676     2  0.4679   0.601723 0.000 0.736 0.168 0.040 0.008 0.048
#> GSM613677     3  0.3167   0.544934 0.000 0.080 0.852 0.040 0.000 0.028
#> GSM613678     6  0.5699   0.344505 0.000 0.252 0.000 0.156 0.016 0.576
#> GSM613679     2  0.4211   0.405348 0.000 0.720 0.000 0.024 0.232 0.024
#> GSM613680     1  0.1036   0.819367 0.964 0.004 0.000 0.024 0.000 0.008
#> GSM613681     1  0.2362   0.788073 0.860 0.004 0.000 0.000 0.000 0.136
#> GSM613682     1  0.4103   0.671148 0.764 0.092 0.000 0.000 0.136 0.008
#> GSM613683     1  0.0000   0.819619 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613684     5  0.3345   0.689540 0.000 0.204 0.000 0.020 0.776 0.000
#> GSM613685     5  0.3782   0.564674 0.000 0.360 0.000 0.004 0.636 0.000
#> GSM613686     6  0.5264   0.492215 0.172 0.072 0.000 0.048 0.012 0.696
#> GSM613687     1  0.1542   0.817624 0.936 0.004 0.000 0.008 0.000 0.052
#> GSM613688     5  0.3905   0.660023 0.000 0.260 0.004 0.004 0.716 0.016
#> GSM613689     2  0.6386  -0.103651 0.004 0.432 0.208 0.340 0.016 0.000
#> GSM613690     3  0.1950   0.587396 0.000 0.024 0.912 0.064 0.000 0.000
#> GSM613691     6  0.4849   0.465725 0.000 0.000 0.000 0.148 0.188 0.664
#> GSM613692     1  0.5091   0.233099 0.516 0.000 0.424 0.040 0.020 0.000
#> GSM613693     5  0.2511   0.649996 0.000 0.024 0.024 0.044 0.900 0.008
#> GSM613694     1  0.4622   0.420186 0.624 0.024 0.020 0.332 0.000 0.000
#> GSM613695     3  0.4477   0.401431 0.036 0.008 0.648 0.308 0.000 0.000
#> GSM613696     5  0.4245   0.580869 0.044 0.012 0.060 0.064 0.808 0.012
#> GSM613697     3  0.2510   0.544874 0.080 0.000 0.884 0.028 0.000 0.008
#> GSM613698     3  0.5452   0.275652 0.060 0.000 0.648 0.216 0.076 0.000
#> GSM613699     4  0.7601   0.195949 0.288 0.108 0.108 0.440 0.056 0.000
#> GSM613700     2  0.0972   0.635420 0.000 0.964 0.000 0.008 0.028 0.000
#> GSM613701     2  0.3252   0.561021 0.032 0.832 0.000 0.008 0.124 0.004
#> GSM613702     2  0.5183   0.550876 0.004 0.680 0.004 0.152 0.012 0.148
#> GSM613703     6  0.3679   0.552655 0.036 0.000 0.000 0.060 0.084 0.820
#> GSM613704     6  0.4915   0.483621 0.000 0.004 0.004 0.116 0.200 0.676
#> GSM613705     3  0.5310   0.429618 0.016 0.208 0.672 0.080 0.000 0.024
#> GSM613706     2  0.3974   0.579728 0.116 0.772 0.004 0.108 0.000 0.000
#> GSM613707     5  0.3563   0.596725 0.000 0.336 0.000 0.000 0.664 0.000
#> GSM613708     1  0.2219   0.790286 0.864 0.000 0.000 0.000 0.000 0.136
#> GSM613709     1  0.2996   0.713768 0.772 0.000 0.000 0.000 0.000 0.228
#> GSM613710     2  0.2507   0.636403 0.000 0.884 0.040 0.072 0.004 0.000
#> GSM613711     3  0.6100   0.261813 0.000 0.184 0.484 0.316 0.016 0.000
#> GSM613712     3  0.2780   0.515889 0.092 0.000 0.868 0.016 0.024 0.000
#> GSM613713     5  0.3502   0.692267 0.000 0.192 0.008 0.020 0.780 0.000
#> GSM613714     4  0.6133   0.103191 0.012 0.248 0.256 0.484 0.000 0.000
#> GSM613715     3  0.2494   0.585405 0.000 0.016 0.864 0.120 0.000 0.000
#> GSM613716     4  0.7366   0.120084 0.000 0.000 0.336 0.344 0.156 0.164
#> GSM613717     4  0.6109   0.045023 0.000 0.248 0.316 0.432 0.004 0.000
#> GSM613718     3  0.4245   0.516222 0.000 0.044 0.696 0.256 0.004 0.000
#> GSM613719     4  0.8444   0.074488 0.080 0.000 0.156 0.304 0.168 0.292
#> GSM613720     5  0.7234  -0.124142 0.000 0.000 0.336 0.148 0.372 0.144
#> GSM613721     5  0.1647   0.641625 0.000 0.004 0.008 0.016 0.940 0.032
#> GSM613722     2  0.2364   0.633891 0.000 0.908 0.016 0.016 0.044 0.016
#> GSM613723     1  0.0547   0.817238 0.980 0.000 0.000 0.020 0.000 0.000
#> GSM613724     1  0.1387   0.811611 0.932 0.000 0.000 0.000 0.000 0.068
#> GSM613725     2  0.2883   0.601319 0.000 0.860 0.008 0.040 0.092 0.000
#> GSM613726     1  0.3139   0.767734 0.816 0.032 0.000 0.000 0.000 0.152
#> GSM613727     1  0.1349   0.814187 0.940 0.004 0.000 0.000 0.000 0.056
#> GSM613728     2  0.5290   0.410196 0.000 0.596 0.000 0.128 0.004 0.272
#> GSM613729     1  0.4116   0.380448 0.572 0.000 0.000 0.012 0.000 0.416
#> GSM613730     6  0.5560   0.288923 0.000 0.236 0.008 0.172 0.000 0.584
#> GSM613731     1  0.6050   0.418302 0.572 0.232 0.004 0.032 0.000 0.160
#> GSM613732     3  0.2701   0.590332 0.000 0.028 0.864 0.104 0.004 0.000
#> GSM613733     2  0.5753   0.191905 0.000 0.556 0.168 0.264 0.012 0.000
#> GSM613734     1  0.0458   0.817960 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM613735     1  0.0951   0.820755 0.968 0.000 0.004 0.008 0.000 0.020
#> GSM613736     4  0.6458   0.163226 0.000 0.256 0.076 0.528 0.140 0.000
#> GSM613737     4  0.6383   0.049952 0.272 0.012 0.240 0.468 0.008 0.000
#> GSM613738     1  0.3248   0.739796 0.828 0.000 0.116 0.052 0.004 0.000
#> GSM613739     1  0.4151   0.551715 0.684 0.000 0.276 0.040 0.000 0.000
#> GSM613740     3  0.6243   0.259716 0.000 0.092 0.492 0.348 0.068 0.000
#> GSM613741     6  0.4985   0.433597 0.000 0.000 0.004 0.112 0.240 0.644
#> GSM613742     1  0.5162   0.566078 0.672 0.000 0.204 0.088 0.036 0.000
#> GSM613743     4  0.6564  -0.000694 0.000 0.264 0.292 0.416 0.028 0.000
#> GSM613744     3  0.4385   0.520618 0.000 0.060 0.696 0.240 0.004 0.000
#> GSM613745     4  0.5989  -0.223975 0.000 0.000 0.016 0.464 0.148 0.372
#> GSM613746     5  0.4438   0.417895 0.000 0.000 0.024 0.076 0.744 0.156
#> GSM613747     1  0.0547   0.817533 0.980 0.000 0.000 0.020 0.000 0.000
#> GSM613748     2  0.4929   0.546254 0.000 0.684 0.016 0.108 0.000 0.192
#> GSM613749     2  0.6967   0.173633 0.260 0.480 0.000 0.040 0.028 0.192
#> GSM613750     3  0.3872   0.531342 0.000 0.004 0.712 0.264 0.020 0.000
#> GSM613751     3  0.4337   0.521736 0.000 0.012 0.684 0.272 0.032 0.000
#> GSM613752     3  0.4390   0.511916 0.000 0.004 0.676 0.272 0.048 0.000
#> GSM613753     3  0.3767   0.536681 0.000 0.004 0.708 0.276 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-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 disease.state(p) k
#> SD:NMF 113           0.0272 2
#> SD:NMF 107           0.0285 3
#> SD:NMF 107           0.3383 4
#> SD:NMF  82           0.1357 5
#> SD:NMF  68           0.0117 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 27425 rows and 116 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 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-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.537           0.904       0.903         0.1478 0.933   0.933
#> 3 3 0.438           0.651       0.851         2.3689 0.531   0.497
#> 4 4 0.544           0.779       0.865         0.3603 0.720   0.469
#> 5 5 0.574           0.732       0.787         0.0923 0.932   0.786
#> 6 6 0.595           0.683       0.727         0.0576 0.955   0.826

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
#> GSM613638     1  0.2948      0.914 0.948 0.052
#> GSM613639     1  0.4939      0.897 0.892 0.108
#> GSM613640     1  0.1414      0.917 0.980 0.020
#> GSM613641     1  0.5737      0.884 0.864 0.136
#> GSM613642     1  0.1633      0.916 0.976 0.024
#> GSM613643     1  0.4022      0.907 0.920 0.080
#> GSM613644     1  0.2778      0.916 0.952 0.048
#> GSM613645     1  0.1633      0.917 0.976 0.024
#> GSM613646     1  0.0938      0.917 0.988 0.012
#> GSM613647     1  0.1184      0.916 0.984 0.016
#> GSM613648     1  0.2603      0.909 0.956 0.044
#> GSM613649     1  0.3584      0.899 0.932 0.068
#> GSM613650     1  0.3114      0.914 0.944 0.056
#> GSM613651     1  0.3114      0.913 0.944 0.056
#> GSM613652     1  0.5737      0.884 0.864 0.136
#> GSM613653     1  0.2778      0.916 0.952 0.048
#> GSM613654     1  0.5737      0.884 0.864 0.136
#> GSM613655     1  0.5737      0.884 0.864 0.136
#> GSM613656     1  0.5737      0.884 0.864 0.136
#> GSM613657     1  0.3584      0.899 0.932 0.068
#> GSM613658     1  0.5737      0.884 0.864 0.136
#> GSM613659     1  0.0672      0.916 0.992 0.008
#> GSM613660     1  0.3584      0.899 0.932 0.068
#> GSM613661     1  0.5178      0.893 0.884 0.116
#> GSM613662     1  0.3431      0.901 0.936 0.064
#> GSM613663     1  0.5737      0.884 0.864 0.136
#> GSM613664     1  0.3274      0.903 0.940 0.060
#> GSM613665     1  0.3584      0.899 0.932 0.068
#> GSM613666     1  0.5737      0.884 0.864 0.136
#> GSM613667     1  0.1633      0.917 0.976 0.024
#> GSM613668     1  0.5737      0.884 0.864 0.136
#> GSM613669     1  0.5737      0.884 0.864 0.136
#> GSM613670     1  0.3584      0.899 0.932 0.068
#> GSM613671     1  0.5737      0.884 0.864 0.136
#> GSM613672     1  0.5737      0.884 0.864 0.136
#> GSM613673     1  0.5519      0.888 0.872 0.128
#> GSM613674     1  0.3584      0.899 0.932 0.068
#> GSM613675     1  0.3584      0.899 0.932 0.068
#> GSM613676     1  0.3584      0.899 0.932 0.068
#> GSM613677     1  0.2948      0.906 0.948 0.052
#> GSM613678     1  0.0672      0.916 0.992 0.008
#> GSM613679     1  0.3584      0.899 0.932 0.068
#> GSM613680     1  0.5737      0.884 0.864 0.136
#> GSM613681     1  0.5737      0.884 0.864 0.136
#> GSM613682     1  0.5737      0.884 0.864 0.136
#> GSM613683     1  0.5737      0.884 0.864 0.136
#> GSM613684     1  0.3431      0.901 0.936 0.064
#> GSM613685     1  0.3584      0.899 0.932 0.068
#> GSM613686     1  0.5408      0.890 0.876 0.124
#> GSM613687     1  0.5737      0.884 0.864 0.136
#> GSM613688     1  0.2043      0.913 0.968 0.032
#> GSM613689     1  0.2423      0.910 0.960 0.040
#> GSM613690     1  0.2043      0.912 0.968 0.032
#> GSM613691     1  0.3274      0.903 0.940 0.060
#> GSM613692     1  0.4690      0.900 0.900 0.100
#> GSM613693     1  0.3584      0.899 0.932 0.068
#> GSM613694     1  0.2603      0.915 0.956 0.044
#> GSM613695     1  0.1414      0.917 0.980 0.020
#> GSM613696     1  0.0000      0.916 1.000 0.000
#> GSM613697     1  0.3114      0.913 0.944 0.056
#> GSM613698     1  0.2423      0.917 0.960 0.040
#> GSM613699     1  0.2236      0.917 0.964 0.036
#> GSM613700     1  0.3274      0.903 0.940 0.060
#> GSM613701     1  0.2236      0.917 0.964 0.036
#> GSM613702     1  0.1414      0.914 0.980 0.020
#> GSM613703     1  0.5737      0.884 0.864 0.136
#> GSM613704     1  0.3584      0.899 0.932 0.068
#> GSM613705     1  0.3114      0.913 0.944 0.056
#> GSM613706     1  0.2236      0.917 0.964 0.036
#> GSM613707     1  0.3584      0.899 0.932 0.068
#> GSM613708     1  0.5519      0.888 0.872 0.128
#> GSM613709     1  0.5737      0.884 0.864 0.136
#> GSM613710     1  0.3584      0.899 0.932 0.068
#> GSM613711     1  0.3584      0.899 0.932 0.068
#> GSM613712     1  0.3114      0.913 0.944 0.056
#> GSM613713     1  0.3584      0.899 0.932 0.068
#> GSM613714     1  0.1184      0.915 0.984 0.016
#> GSM613715     1  0.2603      0.909 0.956 0.044
#> GSM613716     1  0.1633      0.914 0.976 0.024
#> GSM613717     1  0.3584      0.899 0.932 0.068
#> GSM613718     1  0.3584      0.899 0.932 0.068
#> GSM613719     1  0.1633      0.918 0.976 0.024
#> GSM613720     1  0.3584      0.899 0.932 0.068
#> GSM613721     1  0.1414      0.915 0.980 0.020
#> GSM613722     1  0.3274      0.903 0.940 0.060
#> GSM613723     1  0.5737      0.884 0.864 0.136
#> GSM613724     1  0.5737      0.884 0.864 0.136
#> GSM613725     1  0.3274      0.903 0.940 0.060
#> GSM613726     1  0.4022      0.907 0.920 0.080
#> GSM613727     1  0.5737      0.884 0.864 0.136
#> GSM613728     1  0.3274      0.903 0.940 0.060
#> GSM613729     1  0.5737      0.884 0.864 0.136
#> GSM613730     1  0.2778      0.908 0.952 0.048
#> GSM613731     1  0.4022      0.907 0.920 0.080
#> GSM613732     1  0.3584      0.899 0.932 0.068
#> GSM613733     1  0.3584      0.899 0.932 0.068
#> GSM613734     1  0.5737      0.884 0.864 0.136
#> GSM613735     1  0.5737      0.884 0.864 0.136
#> GSM613736     1  0.3584      0.899 0.932 0.068
#> GSM613737     1  0.3114      0.913 0.944 0.056
#> GSM613738     1  0.5737      0.884 0.864 0.136
#> GSM613739     1  0.5737      0.884 0.864 0.136
#> GSM613740     1  0.3274      0.903 0.940 0.060
#> GSM613741     1  0.1633      0.918 0.976 0.024
#> GSM613742     1  0.5737      0.884 0.864 0.136
#> GSM613743     1  0.3584      0.899 0.932 0.068
#> GSM613744     1  0.3584      0.899 0.932 0.068
#> GSM613745     1  0.0376      0.916 0.996 0.004
#> GSM613746     1  0.3584      0.899 0.932 0.068
#> GSM613747     1  0.5737      0.884 0.864 0.136
#> GSM613748     1  0.1414      0.914 0.980 0.020
#> GSM613749     1  0.2236      0.917 0.964 0.036
#> GSM613750     2  0.5737      1.000 0.136 0.864
#> GSM613751     2  0.5737      1.000 0.136 0.864
#> GSM613752     2  0.5737      1.000 0.136 0.864
#> GSM613753     2  0.5737      1.000 0.136 0.864

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM613638     2  0.6825     -0.177 0.492 0.496 0.012
#> GSM613639     1  0.5775      0.625 0.728 0.260 0.012
#> GSM613640     1  0.6819      0.235 0.512 0.476 0.012
#> GSM613641     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613642     2  0.6082      0.499 0.296 0.692 0.012
#> GSM613643     1  0.6357      0.545 0.652 0.336 0.012
#> GSM613644     1  0.6600      0.474 0.604 0.384 0.012
#> GSM613645     1  0.6632      0.458 0.596 0.392 0.012
#> GSM613646     1  0.6745      0.375 0.560 0.428 0.012
#> GSM613647     1  0.6822      0.218 0.508 0.480 0.012
#> GSM613648     2  0.2955      0.783 0.080 0.912 0.008
#> GSM613649     2  0.1129      0.825 0.020 0.976 0.004
#> GSM613650     1  0.6566      0.486 0.612 0.376 0.012
#> GSM613651     1  0.6647      0.450 0.592 0.396 0.012
#> GSM613652     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613653     1  0.6600      0.471 0.604 0.384 0.012
#> GSM613654     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613655     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613656     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613657     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613658     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613659     2  0.5360      0.637 0.220 0.768 0.012
#> GSM613660     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613661     1  0.3293      0.732 0.900 0.088 0.012
#> GSM613662     2  0.0424      0.829 0.000 0.992 0.008
#> GSM613663     1  0.0475      0.748 0.992 0.004 0.004
#> GSM613664     2  0.0661      0.829 0.004 0.988 0.008
#> GSM613665     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613666     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613667     1  0.5072      0.672 0.792 0.196 0.012
#> GSM613668     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613669     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613670     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613671     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613672     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613673     1  0.0424      0.748 0.992 0.008 0.000
#> GSM613674     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613675     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613676     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613677     2  0.1129      0.823 0.020 0.976 0.004
#> GSM613678     2  0.5315      0.643 0.216 0.772 0.012
#> GSM613679     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613680     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613681     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613682     1  0.0237      0.748 0.996 0.004 0.000
#> GSM613683     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613684     2  0.0000      0.829 0.000 1.000 0.000
#> GSM613685     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613686     1  0.1315      0.747 0.972 0.020 0.008
#> GSM613687     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613688     2  0.4293      0.713 0.164 0.832 0.004
#> GSM613689     2  0.6822     -0.146 0.480 0.508 0.012
#> GSM613690     1  0.6825      0.180 0.496 0.492 0.012
#> GSM613691     2  0.4413      0.716 0.160 0.832 0.008
#> GSM613692     1  0.4504      0.678 0.804 0.196 0.000
#> GSM613693     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613694     1  0.6566      0.487 0.612 0.376 0.012
#> GSM613695     1  0.6763      0.357 0.552 0.436 0.012
#> GSM613696     2  0.5536      0.614 0.236 0.752 0.012
#> GSM613697     1  0.6427      0.528 0.640 0.348 0.012
#> GSM613698     1  0.6647      0.451 0.592 0.396 0.012
#> GSM613699     1  0.6754      0.366 0.556 0.432 0.012
#> GSM613700     2  0.0237      0.828 0.000 0.996 0.004
#> GSM613701     2  0.6584      0.287 0.380 0.608 0.012
#> GSM613702     2  0.6282      0.437 0.324 0.664 0.012
#> GSM613703     1  0.1182      0.747 0.976 0.012 0.012
#> GSM613704     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613705     1  0.6661      0.442 0.588 0.400 0.012
#> GSM613706     2  0.6735      0.123 0.424 0.564 0.012
#> GSM613707     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613708     1  0.4755      0.684 0.808 0.184 0.008
#> GSM613709     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613710     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613711     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613712     2  0.6825     -0.159 0.488 0.500 0.012
#> GSM613713     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613714     2  0.6713      0.140 0.416 0.572 0.012
#> GSM613715     2  0.4589      0.700 0.172 0.820 0.008
#> GSM613716     2  0.5220      0.653 0.208 0.780 0.012
#> GSM613717     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613718     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613719     1  0.6688      0.422 0.580 0.408 0.012
#> GSM613720     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613721     2  0.6548      0.299 0.372 0.616 0.012
#> GSM613722     2  0.0237      0.828 0.000 0.996 0.004
#> GSM613723     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613724     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613725     2  0.0237      0.828 0.000 0.996 0.004
#> GSM613726     1  0.5919      0.611 0.712 0.276 0.012
#> GSM613727     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613728     2  0.6102      0.456 0.320 0.672 0.008
#> GSM613729     1  0.0424      0.747 0.992 0.000 0.008
#> GSM613730     2  0.6008      0.424 0.332 0.664 0.004
#> GSM613731     1  0.6357      0.545 0.652 0.336 0.012
#> GSM613732     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613733     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613734     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613735     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613736     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613737     1  0.6448      0.524 0.636 0.352 0.012
#> GSM613738     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613739     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613740     2  0.0237      0.828 0.000 0.996 0.004
#> GSM613741     1  0.6771      0.342 0.548 0.440 0.012
#> GSM613742     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613743     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613744     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613745     1  0.6816      0.245 0.516 0.472 0.012
#> GSM613746     2  0.0237      0.830 0.000 0.996 0.004
#> GSM613747     1  0.0000      0.747 1.000 0.000 0.000
#> GSM613748     2  0.6448      0.361 0.352 0.636 0.012
#> GSM613749     1  0.6771      0.321 0.548 0.440 0.012
#> GSM613750     3  0.0592      1.000 0.000 0.012 0.988
#> GSM613751     3  0.0592      1.000 0.000 0.012 0.988
#> GSM613752     3  0.0592      1.000 0.000 0.012 0.988
#> GSM613753     3  0.0592      1.000 0.000 0.012 0.988

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3 p4
#> GSM613638     3  0.4261    0.76074 0.068 0.112 0.820  0
#> GSM613639     3  0.4428    0.65315 0.276 0.004 0.720  0
#> GSM613640     3  0.2589    0.77049 0.044 0.044 0.912  0
#> GSM613641     1  0.0921    0.93761 0.972 0.000 0.028  0
#> GSM613642     3  0.4584    0.53180 0.004 0.300 0.696  0
#> GSM613643     3  0.3636    0.75162 0.172 0.008 0.820  0
#> GSM613644     3  0.2859    0.77401 0.112 0.008 0.880  0
#> GSM613645     3  0.3249    0.77182 0.140 0.008 0.852  0
#> GSM613646     3  0.2611    0.77354 0.096 0.008 0.896  0
#> GSM613647     3  0.2411    0.76814 0.040 0.040 0.920  0
#> GSM613648     3  0.5000   -0.16867 0.000 0.500 0.500  0
#> GSM613649     2  0.4222    0.68332 0.000 0.728 0.272  0
#> GSM613650     3  0.2973    0.76666 0.144 0.000 0.856  0
#> GSM613651     3  0.2675    0.77234 0.100 0.008 0.892  0
#> GSM613652     1  0.0921    0.94459 0.972 0.000 0.028  0
#> GSM613653     3  0.2868    0.76884 0.136 0.000 0.864  0
#> GSM613654     1  0.0921    0.94459 0.972 0.000 0.028  0
#> GSM613655     1  0.0469    0.94437 0.988 0.000 0.012  0
#> GSM613656     1  0.0921    0.94459 0.972 0.000 0.028  0
#> GSM613657     2  0.2469    0.86478 0.000 0.892 0.108  0
#> GSM613658     1  0.0469    0.94437 0.988 0.000 0.012  0
#> GSM613659     2  0.5288   -0.01491 0.008 0.520 0.472  0
#> GSM613660     2  0.1867    0.87147 0.000 0.928 0.072  0
#> GSM613661     1  0.3764    0.71958 0.784 0.000 0.216  0
#> GSM613662     2  0.1211    0.86830 0.000 0.960 0.040  0
#> GSM613663     1  0.1557    0.92892 0.944 0.000 0.056  0
#> GSM613664     2  0.1637    0.86172 0.000 0.940 0.060  0
#> GSM613665     2  0.0469    0.86631 0.000 0.988 0.012  0
#> GSM613666     1  0.0817    0.93756 0.976 0.000 0.024  0
#> GSM613667     1  0.4632    0.54335 0.688 0.004 0.308  0
#> GSM613668     1  0.0469    0.94437 0.988 0.000 0.012  0
#> GSM613669     1  0.0469    0.93791 0.988 0.000 0.012  0
#> GSM613670     2  0.1118    0.86882 0.000 0.964 0.036  0
#> GSM613671     1  0.0592    0.93848 0.984 0.000 0.016  0
#> GSM613672     1  0.0469    0.94437 0.988 0.000 0.012  0
#> GSM613673     1  0.0817    0.94521 0.976 0.000 0.024  0
#> GSM613674     2  0.0469    0.85690 0.000 0.988 0.012  0
#> GSM613675     2  0.1022    0.87051 0.000 0.968 0.032  0
#> GSM613676     2  0.0592    0.86810 0.000 0.984 0.016  0
#> GSM613677     2  0.3444    0.75858 0.000 0.816 0.184  0
#> GSM613678     2  0.5285    0.00393 0.008 0.524 0.468  0
#> GSM613679     2  0.0592    0.86785 0.000 0.984 0.016  0
#> GSM613680     1  0.0469    0.94437 0.988 0.000 0.012  0
#> GSM613681     1  0.0817    0.94580 0.976 0.000 0.024  0
#> GSM613682     1  0.0921    0.94469 0.972 0.000 0.028  0
#> GSM613683     1  0.0469    0.94437 0.988 0.000 0.012  0
#> GSM613684     2  0.0707    0.86002 0.000 0.980 0.020  0
#> GSM613685     2  0.0469    0.85690 0.000 0.988 0.012  0
#> GSM613686     1  0.2149    0.89535 0.912 0.000 0.088  0
#> GSM613687     1  0.0921    0.94526 0.972 0.000 0.028  0
#> GSM613688     2  0.5220    0.18554 0.008 0.568 0.424  0
#> GSM613689     3  0.4898    0.74505 0.072 0.156 0.772  0
#> GSM613690     3  0.5031    0.75321 0.092 0.140 0.768  0
#> GSM613691     2  0.4897    0.48495 0.008 0.660 0.332  0
#> GSM613692     3  0.4817    0.47095 0.388 0.000 0.612  0
#> GSM613693     2  0.0707    0.86989 0.000 0.980 0.020  0
#> GSM613694     3  0.3257    0.76462 0.152 0.004 0.844  0
#> GSM613695     3  0.3587    0.77970 0.104 0.040 0.856  0
#> GSM613696     3  0.5150    0.30851 0.008 0.396 0.596  0
#> GSM613697     3  0.3356    0.75142 0.176 0.000 0.824  0
#> GSM613698     3  0.3812    0.77545 0.140 0.028 0.832  0
#> GSM613699     3  0.3587    0.78151 0.104 0.040 0.856  0
#> GSM613700     2  0.2281    0.87008 0.000 0.904 0.096  0
#> GSM613701     3  0.5458    0.67476 0.060 0.236 0.704  0
#> GSM613702     3  0.4927    0.62742 0.024 0.264 0.712  0
#> GSM613703     1  0.2814    0.84948 0.868 0.000 0.132  0
#> GSM613704     2  0.0817    0.86935 0.000 0.976 0.024  0
#> GSM613705     3  0.2741    0.77348 0.096 0.012 0.892  0
#> GSM613706     3  0.5392    0.71844 0.072 0.204 0.724  0
#> GSM613707     2  0.0469    0.85690 0.000 0.988 0.012  0
#> GSM613708     3  0.5088    0.36421 0.424 0.004 0.572  0
#> GSM613709     1  0.0817    0.93808 0.976 0.000 0.024  0
#> GSM613710     2  0.1867    0.87147 0.000 0.928 0.072  0
#> GSM613711     2  0.2973    0.84887 0.000 0.856 0.144  0
#> GSM613712     3  0.4261    0.75789 0.068 0.112 0.820  0
#> GSM613713     2  0.0817    0.86394 0.000 0.976 0.024  0
#> GSM613714     3  0.3335    0.74515 0.020 0.120 0.860  0
#> GSM613715     3  0.5050    0.20794 0.004 0.408 0.588  0
#> GSM613716     3  0.4872    0.34758 0.004 0.356 0.640  0
#> GSM613717     2  0.3074    0.84377 0.000 0.848 0.152  0
#> GSM613718     2  0.2973    0.84887 0.000 0.856 0.144  0
#> GSM613719     3  0.2530    0.77175 0.112 0.000 0.888  0
#> GSM613720     2  0.1118    0.87035 0.000 0.964 0.036  0
#> GSM613721     3  0.4468    0.68237 0.016 0.232 0.752  0
#> GSM613722     2  0.2345    0.86904 0.000 0.900 0.100  0
#> GSM613723     1  0.0921    0.94459 0.972 0.000 0.028  0
#> GSM613724     1  0.0817    0.94466 0.976 0.000 0.024  0
#> GSM613725     2  0.2408    0.86824 0.000 0.896 0.104  0
#> GSM613726     3  0.5310    0.43429 0.412 0.012 0.576  0
#> GSM613727     1  0.0469    0.93791 0.988 0.000 0.012  0
#> GSM613728     3  0.5482    0.44005 0.024 0.368 0.608  0
#> GSM613729     1  0.1637    0.91848 0.940 0.000 0.060  0
#> GSM613730     3  0.4955    0.61453 0.024 0.268 0.708  0
#> GSM613731     3  0.3636    0.75162 0.172 0.008 0.820  0
#> GSM613732     2  0.2973    0.84887 0.000 0.856 0.144  0
#> GSM613733     2  0.2011    0.87099 0.000 0.920 0.080  0
#> GSM613734     1  0.0921    0.94459 0.972 0.000 0.028  0
#> GSM613735     1  0.0921    0.94459 0.972 0.000 0.028  0
#> GSM613736     2  0.2973    0.84887 0.000 0.856 0.144  0
#> GSM613737     3  0.3539    0.75431 0.176 0.004 0.820  0
#> GSM613738     1  0.2469    0.88493 0.892 0.000 0.108  0
#> GSM613739     1  0.2469    0.88493 0.892 0.000 0.108  0
#> GSM613740     2  0.3219    0.83713 0.000 0.836 0.164  0
#> GSM613741     3  0.3367    0.77887 0.108 0.028 0.864  0
#> GSM613742     1  0.2469    0.88493 0.892 0.000 0.108  0
#> GSM613743     2  0.2973    0.84887 0.000 0.856 0.144  0
#> GSM613744     2  0.2973    0.84887 0.000 0.856 0.144  0
#> GSM613745     3  0.3107    0.77713 0.080 0.036 0.884  0
#> GSM613746     2  0.0469    0.85690 0.000 0.988 0.012  0
#> GSM613747     1  0.0921    0.94459 0.972 0.000 0.028  0
#> GSM613748     3  0.4464    0.67971 0.024 0.208 0.768  0
#> GSM613749     3  0.6221    0.67321 0.256 0.100 0.644  0
#> GSM613750     4  0.0000    1.00000 0.000 0.000 0.000  1
#> GSM613751     4  0.0000    1.00000 0.000 0.000 0.000  1
#> GSM613752     4  0.0000    1.00000 0.000 0.000 0.000  1
#> GSM613753     4  0.0000    1.00000 0.000 0.000 0.000  1

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4 p5
#> GSM613638     4  0.4338    0.73567 0.036 0.012 0.192 0.760  0
#> GSM613639     4  0.4522    0.69184 0.192 0.004 0.060 0.744  0
#> GSM613640     4  0.3078    0.76626 0.016 0.004 0.132 0.848  0
#> GSM613641     1  0.1918    0.87744 0.928 0.000 0.036 0.036  0
#> GSM613642     4  0.5697    0.55940 0.000 0.116 0.288 0.596  0
#> GSM613643     4  0.3715    0.75912 0.108 0.004 0.064 0.824  0
#> GSM613644     4  0.3087    0.77661 0.064 0.004 0.064 0.868  0
#> GSM613645     4  0.2913    0.77325 0.080 0.004 0.040 0.876  0
#> GSM613646     4  0.2395    0.77413 0.040 0.012 0.036 0.912  0
#> GSM613647     4  0.3078    0.76539 0.016 0.004 0.132 0.848  0
#> GSM613648     3  0.5723    0.14650 0.000 0.088 0.520 0.392  0
#> GSM613649     3  0.5876    0.64826 0.000 0.204 0.604 0.192  0
#> GSM613650     4  0.2872    0.76820 0.048 0.008 0.060 0.884  0
#> GSM613651     4  0.3237    0.77522 0.048 0.000 0.104 0.848  0
#> GSM613652     1  0.2992    0.88122 0.868 0.000 0.064 0.068  0
#> GSM613653     4  0.2864    0.76956 0.044 0.008 0.064 0.884  0
#> GSM613654     1  0.2992    0.88122 0.868 0.000 0.064 0.068  0
#> GSM613655     1  0.1211    0.89660 0.960 0.000 0.016 0.024  0
#> GSM613656     1  0.2992    0.88122 0.868 0.000 0.064 0.068  0
#> GSM613657     3  0.4378    0.82615 0.000 0.248 0.716 0.036  0
#> GSM613658     1  0.1310    0.89670 0.956 0.000 0.020 0.024  0
#> GSM613659     4  0.6361   -0.04861 0.004 0.424 0.140 0.432  0
#> GSM613660     3  0.4025    0.77017 0.000 0.292 0.700 0.008  0
#> GSM613661     1  0.4342    0.68939 0.728 0.000 0.040 0.232  0
#> GSM613662     2  0.2953    0.72620 0.000 0.844 0.144 0.012  0
#> GSM613663     1  0.2300    0.88460 0.904 0.000 0.024 0.072  0
#> GSM613664     2  0.3319    0.71985 0.000 0.820 0.160 0.020  0
#> GSM613665     2  0.2966    0.70874 0.000 0.816 0.184 0.000  0
#> GSM613666     1  0.1918    0.87297 0.928 0.000 0.036 0.036  0
#> GSM613667     1  0.4565    0.56069 0.664 0.000 0.028 0.308  0
#> GSM613668     1  0.1211    0.89660 0.960 0.000 0.016 0.024  0
#> GSM613669     1  0.1106    0.88280 0.964 0.000 0.012 0.024  0
#> GSM613670     2  0.2818    0.72683 0.000 0.856 0.132 0.012  0
#> GSM613671     1  0.1750    0.87476 0.936 0.000 0.036 0.028  0
#> GSM613672     1  0.1106    0.89715 0.964 0.000 0.012 0.024  0
#> GSM613673     1  0.1484    0.89847 0.944 0.000 0.008 0.048  0
#> GSM613674     2  0.2074    0.70337 0.000 0.896 0.104 0.000  0
#> GSM613675     2  0.2843    0.72714 0.000 0.848 0.144 0.008  0
#> GSM613676     2  0.3109    0.69282 0.000 0.800 0.200 0.000  0
#> GSM613677     2  0.5699    0.53031 0.000 0.608 0.264 0.128  0
#> GSM613678     2  0.6361   -0.00774 0.004 0.428 0.140 0.428  0
#> GSM613679     2  0.2929    0.71031 0.000 0.820 0.180 0.000  0
#> GSM613680     1  0.0955    0.89763 0.968 0.000 0.004 0.028  0
#> GSM613681     1  0.1205    0.89937 0.956 0.000 0.004 0.040  0
#> GSM613682     1  0.1408    0.89880 0.948 0.000 0.008 0.044  0
#> GSM613683     1  0.1106    0.89715 0.964 0.000 0.012 0.024  0
#> GSM613684     2  0.2124    0.70719 0.000 0.900 0.096 0.004  0
#> GSM613685     2  0.2074    0.70337 0.000 0.896 0.104 0.000  0
#> GSM613686     1  0.3427    0.82633 0.844 0.004 0.056 0.096  0
#> GSM613687     1  0.1408    0.89870 0.948 0.000 0.008 0.044  0
#> GSM613688     2  0.6458    0.15614 0.004 0.464 0.160 0.372  0
#> GSM613689     4  0.4500    0.72160 0.020 0.040 0.180 0.760  0
#> GSM613690     4  0.4410    0.72727 0.028 0.032 0.168 0.772  0
#> GSM613691     2  0.6069    0.33049 0.004 0.564 0.136 0.296  0
#> GSM613692     4  0.4967    0.54372 0.280 0.000 0.060 0.660  0
#> GSM613693     2  0.3048    0.71270 0.000 0.820 0.176 0.004  0
#> GSM613694     4  0.2853    0.76730 0.072 0.000 0.052 0.876  0
#> GSM613695     4  0.2824    0.76835 0.032 0.000 0.096 0.872  0
#> GSM613696     4  0.6335    0.33045 0.004 0.284 0.176 0.536  0
#> GSM613697     4  0.2914    0.75415 0.076 0.000 0.052 0.872  0
#> GSM613698     4  0.3043    0.76900 0.056 0.000 0.080 0.864  0
#> GSM613699     4  0.3265    0.77794 0.040 0.012 0.088 0.860  0
#> GSM613700     3  0.4014    0.76810 0.000 0.256 0.728 0.016  0
#> GSM613701     4  0.5457    0.67219 0.032 0.060 0.228 0.680  0
#> GSM613702     4  0.5207    0.63523 0.008 0.064 0.264 0.664  0
#> GSM613703     1  0.3937    0.78934 0.804 0.004 0.060 0.132  0
#> GSM613704     2  0.2488    0.72623 0.000 0.872 0.124 0.004  0
#> GSM613705     4  0.3234    0.77597 0.048 0.004 0.092 0.856  0
#> GSM613706     4  0.5002    0.71354 0.036 0.044 0.192 0.728  0
#> GSM613707     2  0.2074    0.70210 0.000 0.896 0.104 0.000  0
#> GSM613708     4  0.5388    0.41564 0.360 0.004 0.056 0.580  0
#> GSM613709     1  0.1568    0.88385 0.944 0.000 0.020 0.036  0
#> GSM613710     3  0.4025    0.77017 0.000 0.292 0.700 0.008  0
#> GSM613711     3  0.4737    0.84526 0.000 0.224 0.708 0.068  0
#> GSM613712     4  0.4512    0.72993 0.040 0.012 0.204 0.744  0
#> GSM613713     2  0.4025    0.46350 0.000 0.700 0.292 0.008  0
#> GSM613714     4  0.3491    0.71450 0.000 0.004 0.228 0.768  0
#> GSM613715     4  0.5352    0.16669 0.000 0.052 0.468 0.480  0
#> GSM613716     4  0.5261    0.29660 0.000 0.048 0.424 0.528  0
#> GSM613717     3  0.4850    0.83918 0.000 0.224 0.700 0.076  0
#> GSM613718     3  0.4737    0.84526 0.000 0.224 0.708 0.068  0
#> GSM613719     4  0.2513    0.77387 0.040 0.008 0.048 0.904  0
#> GSM613720     2  0.3795    0.60559 0.000 0.780 0.192 0.028  0
#> GSM613721     4  0.4725    0.65594 0.000 0.200 0.080 0.720  0
#> GSM613722     3  0.4080    0.76723 0.000 0.252 0.728 0.020  0
#> GSM613723     1  0.2992    0.88122 0.868 0.000 0.064 0.068  0
#> GSM613724     1  0.2928    0.88174 0.872 0.000 0.064 0.064  0
#> GSM613725     3  0.4054    0.77052 0.000 0.248 0.732 0.020  0
#> GSM613726     4  0.5514    0.44433 0.364 0.008 0.056 0.572  0
#> GSM613727     1  0.1493    0.88174 0.948 0.000 0.028 0.024  0
#> GSM613728     4  0.6183    0.48213 0.008 0.272 0.148 0.572  0
#> GSM613729     1  0.2859    0.84705 0.876 0.000 0.056 0.068  0
#> GSM613730     4  0.5677    0.63178 0.008 0.156 0.180 0.656  0
#> GSM613731     4  0.3715    0.75912 0.108 0.004 0.064 0.824  0
#> GSM613732     3  0.4649    0.84582 0.000 0.220 0.716 0.064  0
#> GSM613733     3  0.3890    0.80629 0.000 0.252 0.736 0.012  0
#> GSM613734     1  0.2992    0.88122 0.868 0.000 0.064 0.068  0
#> GSM613735     1  0.2992    0.88122 0.868 0.000 0.064 0.068  0
#> GSM613736     3  0.4762    0.83947 0.000 0.236 0.700 0.064  0
#> GSM613737     4  0.3043    0.75982 0.080 0.000 0.056 0.864  0
#> GSM613738     1  0.3904    0.82081 0.792 0.000 0.052 0.156  0
#> GSM613739     1  0.3904    0.82081 0.792 0.000 0.052 0.156  0
#> GSM613740     3  0.4547    0.82980 0.000 0.192 0.736 0.072  0
#> GSM613741     4  0.3189    0.77540 0.032 0.020 0.080 0.868  0
#> GSM613742     1  0.3904    0.82081 0.792 0.000 0.052 0.156  0
#> GSM613743     3  0.4678    0.84595 0.000 0.224 0.712 0.064  0
#> GSM613744     3  0.4678    0.84595 0.000 0.224 0.712 0.064  0
#> GSM613745     4  0.2882    0.77209 0.024 0.028 0.060 0.888  0
#> GSM613746     2  0.1671    0.67742 0.000 0.924 0.076 0.000  0
#> GSM613747     1  0.2992    0.88122 0.868 0.000 0.064 0.068  0
#> GSM613748     4  0.5092    0.68474 0.008 0.092 0.192 0.708  0
#> GSM613749     4  0.6239    0.63034 0.228 0.044 0.104 0.624  0
#> GSM613750     5  0.0000    1.00000 0.000 0.000 0.000 0.000  1
#> GSM613751     5  0.0000    1.00000 0.000 0.000 0.000 0.000  1
#> GSM613752     5  0.0000    1.00000 0.000 0.000 0.000 0.000  1
#> GSM613753     5  0.0000    1.00000 0.000 0.000 0.000 0.000  1

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5 p6
#> GSM613638     4   0.481     0.7250 0.012 0.040 0.152 0.736 0.060  0
#> GSM613639     4   0.496     0.7027 0.128 0.020 0.008 0.712 0.132  0
#> GSM613640     4   0.358     0.7586 0.004 0.028 0.072 0.832 0.064  0
#> GSM613641     1   0.349     0.6791 0.784 0.004 0.000 0.028 0.184  0
#> GSM613642     4   0.623     0.5537 0.000 0.168 0.216 0.560 0.056  0
#> GSM613643     4   0.425     0.7551 0.076 0.032 0.020 0.796 0.076  0
#> GSM613644     4   0.326     0.7703 0.036 0.024 0.012 0.856 0.072  0
#> GSM613645     4   0.299     0.7641 0.044 0.016 0.000 0.860 0.080  0
#> GSM613646     4   0.251     0.7615 0.024 0.024 0.000 0.892 0.060  0
#> GSM613647     4   0.370     0.7572 0.008 0.032 0.068 0.828 0.064  0
#> GSM613648     3   0.523     0.1407 0.000 0.044 0.540 0.388 0.028  0
#> GSM613649     3   0.322     0.6784 0.000 0.020 0.792 0.188 0.000  0
#> GSM613650     4   0.335     0.7598 0.040 0.020 0.000 0.832 0.108  0
#> GSM613651     4   0.415     0.7653 0.020 0.036 0.044 0.800 0.100  0
#> GSM613652     5   0.451     0.9114 0.436 0.000 0.000 0.032 0.532  0
#> GSM613653     4   0.324     0.7602 0.036 0.020 0.000 0.840 0.104  0
#> GSM613654     5   0.451     0.9114 0.436 0.000 0.000 0.032 0.532  0
#> GSM613655     1   0.262     0.5420 0.856 0.000 0.000 0.020 0.124  0
#> GSM613656     5   0.451     0.9114 0.436 0.000 0.000 0.032 0.532  0
#> GSM613657     3   0.183     0.8342 0.000 0.028 0.928 0.036 0.008  0
#> GSM613658     1   0.262     0.5262 0.856 0.000 0.000 0.020 0.124  0
#> GSM613659     2   0.595     0.0931 0.000 0.452 0.068 0.424 0.056  0
#> GSM613660     3   0.233     0.7718 0.000 0.092 0.884 0.000 0.024  0
#> GSM613661     1   0.479     0.4440 0.692 0.016 0.000 0.204 0.088  0
#> GSM613662     2   0.403     0.7011 0.000 0.736 0.220 0.012 0.032  0
#> GSM613663     1   0.241     0.6704 0.892 0.004 0.000 0.052 0.052  0
#> GSM613664     2   0.442     0.7010 0.000 0.720 0.212 0.024 0.044  0
#> GSM613665     2   0.391     0.6622 0.000 0.660 0.328 0.004 0.008  0
#> GSM613666     1   0.344     0.6802 0.784 0.004 0.000 0.024 0.188  0
#> GSM613667     1   0.452     0.3939 0.660 0.016 0.000 0.292 0.032  0
#> GSM613668     1   0.258     0.5498 0.860 0.000 0.000 0.020 0.120  0
#> GSM613669     1   0.295     0.6848 0.824 0.004 0.000 0.012 0.160  0
#> GSM613670     2   0.407     0.7024 0.000 0.732 0.224 0.016 0.028  0
#> GSM613671     1   0.328     0.6804 0.792 0.004 0.000 0.016 0.188  0
#> GSM613672     1   0.209     0.6079 0.900 0.000 0.000 0.020 0.080  0
#> GSM613673     1   0.206     0.6522 0.908 0.000 0.000 0.036 0.056  0
#> GSM613674     2   0.389     0.6703 0.000 0.752 0.188 0.000 0.060  0
#> GSM613675     2   0.380     0.7018 0.000 0.768 0.188 0.012 0.032  0
#> GSM613676     2   0.384     0.6524 0.000 0.656 0.336 0.004 0.004  0
#> GSM613677     2   0.543     0.5688 0.000 0.616 0.248 0.116 0.020  0
#> GSM613678     2   0.595     0.1086 0.000 0.456 0.068 0.420 0.056  0
#> GSM613679     2   0.376     0.6693 0.000 0.676 0.316 0.004 0.004  0
#> GSM613680     1   0.181     0.6270 0.920 0.000 0.000 0.020 0.060  0
#> GSM613681     1   0.157     0.6728 0.940 0.004 0.000 0.028 0.028  0
#> GSM613682     1   0.200     0.6638 0.912 0.000 0.000 0.040 0.048  0
#> GSM613683     1   0.209     0.6062 0.900 0.000 0.000 0.020 0.080  0
#> GSM613684     2   0.397     0.6745 0.000 0.756 0.180 0.004 0.060  0
#> GSM613685     2   0.389     0.6703 0.000 0.752 0.188 0.000 0.060  0
#> GSM613686     1   0.433     0.6264 0.700 0.004 0.000 0.056 0.240  0
#> GSM613687     1   0.155     0.6742 0.940 0.004 0.000 0.036 0.020  0
#> GSM613688     2   0.608     0.2125 0.000 0.476 0.108 0.376 0.040  0
#> GSM613689     4   0.537     0.7157 0.020 0.060 0.156 0.700 0.064  0
#> GSM613690     4   0.534     0.7184 0.028 0.044 0.128 0.712 0.088  0
#> GSM613691     2   0.608     0.4161 0.000 0.516 0.168 0.292 0.024  0
#> GSM613692     4   0.566     0.5270 0.168 0.020 0.000 0.600 0.212  0
#> GSM613693     2   0.381     0.6750 0.000 0.684 0.304 0.008 0.004  0
#> GSM613694     4   0.364     0.7622 0.048 0.008 0.020 0.824 0.100  0
#> GSM613695     4   0.399     0.7577 0.024 0.028 0.044 0.812 0.092  0
#> GSM613696     4   0.591     0.2422 0.000 0.328 0.120 0.524 0.028  0
#> GSM613697     4   0.401     0.7495 0.044 0.036 0.000 0.784 0.136  0
#> GSM613698     4   0.420     0.7611 0.040 0.024 0.028 0.792 0.116  0
#> GSM613699     4   0.406     0.7686 0.024 0.024 0.060 0.808 0.084  0
#> GSM613700     3   0.296     0.7624 0.000 0.124 0.844 0.008 0.024  0
#> GSM613701     4   0.567     0.6647 0.012 0.056 0.192 0.656 0.084  0
#> GSM613702     4   0.575     0.6341 0.008 0.076 0.208 0.640 0.068  0
#> GSM613703     1   0.508     0.5821 0.652 0.016 0.000 0.096 0.236  0
#> GSM613704     2   0.378     0.7004 0.000 0.744 0.224 0.004 0.028  0
#> GSM613705     4   0.386     0.7651 0.016 0.040 0.036 0.820 0.088  0
#> GSM613706     4   0.519     0.7025 0.012 0.052 0.156 0.708 0.072  0
#> GSM613707     2   0.395     0.6684 0.000 0.744 0.196 0.000 0.060  0
#> GSM613708     4   0.561     0.4436 0.300 0.020 0.000 0.568 0.112  0
#> GSM613709     1   0.332     0.6843 0.804 0.004 0.000 0.028 0.164  0
#> GSM613710     3   0.233     0.7718 0.000 0.092 0.884 0.000 0.024  0
#> GSM613711     3   0.147     0.8477 0.000 0.004 0.932 0.064 0.000  0
#> GSM613712     4   0.506     0.7175 0.016 0.040 0.164 0.716 0.064  0
#> GSM613713     2   0.497     0.3599 0.000 0.512 0.432 0.008 0.048  0
#> GSM613714     4   0.438     0.7089 0.000 0.028 0.172 0.744 0.056  0
#> GSM613715     4   0.538     0.1547 0.000 0.056 0.440 0.480 0.024  0
#> GSM613716     4   0.528     0.2945 0.000 0.052 0.392 0.532 0.024  0
#> GSM613717     3   0.170     0.8431 0.000 0.008 0.920 0.072 0.000  0
#> GSM613718     3   0.147     0.8477 0.000 0.004 0.932 0.064 0.000  0
#> GSM613719     4   0.284     0.7642 0.032 0.024 0.000 0.872 0.072  0
#> GSM613720     2   0.549     0.5687 0.000 0.584 0.304 0.028 0.084  0
#> GSM613721     4   0.468     0.6582 0.000 0.176 0.044 0.724 0.056  0
#> GSM613722     3   0.304     0.7592 0.000 0.132 0.836 0.008 0.024  0
#> GSM613723     5   0.451     0.9114 0.436 0.000 0.000 0.032 0.532  0
#> GSM613724     5   0.453     0.8838 0.460 0.000 0.000 0.032 0.508  0
#> GSM613725     3   0.300     0.7619 0.000 0.128 0.840 0.008 0.024  0
#> GSM613726     4   0.626     0.4687 0.248 0.032 0.004 0.536 0.180  0
#> GSM613727     1   0.323     0.6547 0.776 0.000 0.000 0.012 0.212  0
#> GSM613728     4   0.627     0.5042 0.004 0.180 0.204 0.564 0.048  0
#> GSM613729     1   0.418     0.6464 0.720 0.008 0.000 0.044 0.228  0
#> GSM613730     4   0.579     0.6284 0.004 0.128 0.160 0.644 0.064  0
#> GSM613731     4   0.425     0.7551 0.076 0.032 0.020 0.796 0.076  0
#> GSM613732     3   0.152     0.8485 0.000 0.008 0.932 0.060 0.000  0
#> GSM613733     3   0.151     0.8160 0.000 0.032 0.944 0.012 0.012  0
#> GSM613734     5   0.451     0.9096 0.440 0.000 0.000 0.032 0.528  0
#> GSM613735     5   0.452     0.9031 0.452 0.000 0.000 0.032 0.516  0
#> GSM613736     3   0.219     0.8367 0.000 0.040 0.900 0.060 0.000  0
#> GSM613737     4   0.386     0.7551 0.044 0.016 0.016 0.808 0.116  0
#> GSM613738     5   0.552     0.7792 0.440 0.008 0.000 0.100 0.452  0
#> GSM613739     5   0.552     0.7792 0.440 0.008 0.000 0.100 0.452  0
#> GSM613740     3   0.215     0.8346 0.000 0.024 0.904 0.068 0.004  0
#> GSM613741     4   0.351     0.7602 0.028 0.032 0.004 0.828 0.108  0
#> GSM613742     5   0.552     0.7792 0.440 0.008 0.000 0.100 0.452  0
#> GSM613743     3   0.141     0.8484 0.000 0.004 0.936 0.060 0.000  0
#> GSM613744     3   0.141     0.8484 0.000 0.004 0.936 0.060 0.000  0
#> GSM613745     4   0.307     0.7527 0.016 0.040 0.008 0.864 0.072  0
#> GSM613746     2   0.423     0.6357 0.000 0.732 0.168 0.000 0.100  0
#> GSM613747     5   0.451     0.9096 0.440 0.000 0.000 0.032 0.528  0
#> GSM613748     4   0.529     0.6733 0.004 0.100 0.128 0.700 0.068  0
#> GSM613749     4   0.655     0.6153 0.148 0.044 0.056 0.600 0.152  0
#> GSM613750     6   0.000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM613751     6   0.000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM613752     6   0.000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM613753     6   0.000     1.0000 0.000 0.000 0.000 0.000 0.000  1

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 disease.state(p) k
#> CV:hclust 116         1.24e-02 2
#> CV:hclust  86         1.13e-02 3
#> CV:hclust 104         1.03e-04 4
#> CV:hclust 104         6.66e-06 5
#> CV:hclust 103         8.91e-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.


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 27425 rows and 116 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.821           0.908       0.927         0.4652 0.498   0.498
#> 3 3 0.517           0.598       0.733         0.3851 0.718   0.491
#> 4 4 0.622           0.728       0.844         0.0947 0.933   0.809
#> 5 5 0.566           0.514       0.712         0.0746 0.955   0.859
#> 6 6 0.672           0.568       0.712         0.0620 0.839   0.495

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
#> GSM613638     1   1.000     -0.146 0.508 0.492
#> GSM613639     1   0.000      0.961 1.000 0.000
#> GSM613640     2   0.506      0.927 0.112 0.888
#> GSM613641     1   0.000      0.961 1.000 0.000
#> GSM613642     2   0.402      0.956 0.080 0.920
#> GSM613643     1   0.000      0.961 1.000 0.000
#> GSM613644     1   0.184      0.937 0.972 0.028
#> GSM613645     1   0.000      0.961 1.000 0.000
#> GSM613646     1   0.936      0.386 0.648 0.352
#> GSM613647     2   0.961      0.504 0.384 0.616
#> GSM613648     2   0.402      0.956 0.080 0.920
#> GSM613649     2   0.402      0.956 0.080 0.920
#> GSM613650     1   0.000      0.961 1.000 0.000
#> GSM613651     1   0.000      0.961 1.000 0.000
#> GSM613652     1   0.000      0.961 1.000 0.000
#> GSM613653     1   0.584      0.821 0.860 0.140
#> GSM613654     1   0.000      0.961 1.000 0.000
#> GSM613655     1   0.000      0.961 1.000 0.000
#> GSM613656     1   0.000      0.961 1.000 0.000
#> GSM613657     2   0.402      0.956 0.080 0.920
#> GSM613658     1   0.000      0.961 1.000 0.000
#> GSM613659     2   0.402      0.956 0.080 0.920
#> GSM613660     2   0.402      0.956 0.080 0.920
#> GSM613661     1   0.000      0.961 1.000 0.000
#> GSM613662     2   0.402      0.956 0.080 0.920
#> GSM613663     1   0.000      0.961 1.000 0.000
#> GSM613664     2   0.402      0.956 0.080 0.920
#> GSM613665     2   0.402      0.956 0.080 0.920
#> GSM613666     1   0.000      0.961 1.000 0.000
#> GSM613667     1   0.000      0.961 1.000 0.000
#> GSM613668     1   0.000      0.961 1.000 0.000
#> GSM613669     1   0.000      0.961 1.000 0.000
#> GSM613670     2   0.402      0.956 0.080 0.920
#> GSM613671     1   0.000      0.961 1.000 0.000
#> GSM613672     1   0.000      0.961 1.000 0.000
#> GSM613673     1   0.000      0.961 1.000 0.000
#> GSM613674     2   0.402      0.956 0.080 0.920
#> GSM613675     2   0.402      0.956 0.080 0.920
#> GSM613676     2   0.402      0.956 0.080 0.920
#> GSM613677     2   0.402      0.956 0.080 0.920
#> GSM613678     1   0.563      0.833 0.868 0.132
#> GSM613679     2   0.402      0.956 0.080 0.920
#> GSM613680     1   0.000      0.961 1.000 0.000
#> GSM613681     1   0.000      0.961 1.000 0.000
#> GSM613682     1   0.000      0.961 1.000 0.000
#> GSM613683     1   0.000      0.961 1.000 0.000
#> GSM613684     2   0.402      0.956 0.080 0.920
#> GSM613685     2   0.402      0.956 0.080 0.920
#> GSM613686     1   0.000      0.961 1.000 0.000
#> GSM613687     1   0.000      0.961 1.000 0.000
#> GSM613688     2   0.402      0.956 0.080 0.920
#> GSM613689     2   0.402      0.956 0.080 0.920
#> GSM613690     2   0.402      0.956 0.080 0.920
#> GSM613691     2   0.402      0.956 0.080 0.920
#> GSM613692     1   0.000      0.961 1.000 0.000
#> GSM613693     2   0.402      0.956 0.080 0.920
#> GSM613694     1   0.595      0.816 0.856 0.144
#> GSM613695     2   0.402      0.956 0.080 0.920
#> GSM613696     2   0.402      0.956 0.080 0.920
#> GSM613697     1   0.000      0.961 1.000 0.000
#> GSM613698     2   0.992      0.331 0.448 0.552
#> GSM613699     2   0.821      0.749 0.256 0.744
#> GSM613700     2   0.402      0.956 0.080 0.920
#> GSM613701     2   0.821      0.749 0.256 0.744
#> GSM613702     2   0.402      0.956 0.080 0.920
#> GSM613703     1   0.000      0.961 1.000 0.000
#> GSM613704     2   0.402      0.956 0.080 0.920
#> GSM613705     2   0.985      0.390 0.428 0.572
#> GSM613706     1   0.456      0.872 0.904 0.096
#> GSM613707     2   0.402      0.956 0.080 0.920
#> GSM613708     1   0.000      0.961 1.000 0.000
#> GSM613709     1   0.000      0.961 1.000 0.000
#> GSM613710     2   0.402      0.956 0.080 0.920
#> GSM613711     2   0.402      0.956 0.080 0.920
#> GSM613712     2   0.952      0.531 0.372 0.628
#> GSM613713     2   0.402      0.956 0.080 0.920
#> GSM613714     2   0.402      0.956 0.080 0.920
#> GSM613715     2   0.402      0.956 0.080 0.920
#> GSM613716     2   0.402      0.956 0.080 0.920
#> GSM613717     2   0.402      0.956 0.080 0.920
#> GSM613718     2   0.402      0.956 0.080 0.920
#> GSM613719     1   0.584      0.821 0.860 0.140
#> GSM613720     2   0.402      0.956 0.080 0.920
#> GSM613721     2   0.402      0.956 0.080 0.920
#> GSM613722     2   0.402      0.956 0.080 0.920
#> GSM613723     1   0.000      0.961 1.000 0.000
#> GSM613724     1   0.000      0.961 1.000 0.000
#> GSM613725     2   0.402      0.956 0.080 0.920
#> GSM613726     1   0.000      0.961 1.000 0.000
#> GSM613727     1   0.000      0.961 1.000 0.000
#> GSM613728     2   0.402      0.956 0.080 0.920
#> GSM613729     1   0.000      0.961 1.000 0.000
#> GSM613730     2   0.402      0.956 0.080 0.920
#> GSM613731     1   0.000      0.961 1.000 0.000
#> GSM613732     2   0.402      0.956 0.080 0.920
#> GSM613733     2   0.402      0.956 0.080 0.920
#> GSM613734     1   0.000      0.961 1.000 0.000
#> GSM613735     1   0.000      0.961 1.000 0.000
#> GSM613736     2   0.402      0.956 0.080 0.920
#> GSM613737     1   0.595      0.816 0.856 0.144
#> GSM613738     1   0.000      0.961 1.000 0.000
#> GSM613739     1   0.000      0.961 1.000 0.000
#> GSM613740     2   0.402      0.956 0.080 0.920
#> GSM613741     1   0.584      0.821 0.860 0.140
#> GSM613742     1   0.000      0.961 1.000 0.000
#> GSM613743     2   0.402      0.956 0.080 0.920
#> GSM613744     2   0.402      0.956 0.080 0.920
#> GSM613745     2   0.932      0.577 0.348 0.652
#> GSM613746     2   0.402      0.956 0.080 0.920
#> GSM613747     1   0.000      0.961 1.000 0.000
#> GSM613748     2   0.402      0.956 0.080 0.920
#> GSM613749     1   0.000      0.961 1.000 0.000
#> GSM613750     2   0.000      0.882 0.000 1.000
#> GSM613751     2   0.000      0.882 0.000 1.000
#> GSM613752     2   0.000      0.882 0.000 1.000
#> GSM613753     2   0.000      0.882 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
#> GSM613638     3  0.5042     0.5884 0.060 0.104 0.836
#> GSM613639     3  0.6309     0.1015 0.496 0.000 0.504
#> GSM613640     3  0.4692     0.5491 0.012 0.168 0.820
#> GSM613641     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613642     3  0.6267     0.0219 0.000 0.452 0.548
#> GSM613643     3  0.6260     0.1978 0.448 0.000 0.552
#> GSM613644     3  0.4784     0.5854 0.200 0.004 0.796
#> GSM613645     1  0.6309    -0.1307 0.504 0.000 0.496
#> GSM613646     3  0.8464     0.5823 0.128 0.280 0.592
#> GSM613647     3  0.5085     0.5930 0.072 0.092 0.836
#> GSM613648     3  0.6180    -0.0647 0.000 0.416 0.584
#> GSM613649     2  0.6095     0.5371 0.000 0.608 0.392
#> GSM613650     3  0.6026     0.3678 0.376 0.000 0.624
#> GSM613651     3  0.4750     0.5824 0.216 0.000 0.784
#> GSM613652     1  0.1163     0.9222 0.972 0.000 0.028
#> GSM613653     3  0.8953     0.5794 0.180 0.260 0.560
#> GSM613654     1  0.1163     0.9222 0.972 0.000 0.028
#> GSM613655     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613656     1  0.1031     0.9242 0.976 0.000 0.024
#> GSM613657     2  0.5529     0.6263 0.000 0.704 0.296
#> GSM613658     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613659     2  0.6309    -0.4113 0.000 0.500 0.500
#> GSM613660     2  0.0000     0.7015 0.000 1.000 0.000
#> GSM613661     1  0.4291     0.7146 0.820 0.000 0.180
#> GSM613662     2  0.2261     0.6727 0.000 0.932 0.068
#> GSM613663     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613664     2  0.2261     0.6727 0.000 0.932 0.068
#> GSM613665     2  0.0747     0.6983 0.000 0.984 0.016
#> GSM613666     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613667     1  0.6192     0.1476 0.580 0.000 0.420
#> GSM613668     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613669     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613670     2  0.6955    -0.4112 0.016 0.496 0.488
#> GSM613671     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613672     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613673     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613674     2  0.0000     0.7015 0.000 1.000 0.000
#> GSM613675     2  0.1643     0.6886 0.000 0.956 0.044
#> GSM613676     2  0.0000     0.7015 0.000 1.000 0.000
#> GSM613677     2  0.5291     0.4044 0.000 0.732 0.268
#> GSM613678     3  0.8474     0.4869 0.092 0.404 0.504
#> GSM613679     2  0.1753     0.6858 0.000 0.952 0.048
#> GSM613680     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613681     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613682     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613683     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613684     2  0.0892     0.7023 0.000 0.980 0.020
#> GSM613685     2  0.0000     0.7015 0.000 1.000 0.000
#> GSM613686     1  0.4121     0.7333 0.832 0.000 0.168
#> GSM613687     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613688     2  0.2796     0.6463 0.000 0.908 0.092
#> GSM613689     3  0.6111     0.1401 0.000 0.396 0.604
#> GSM613690     3  0.6302    -0.2492 0.000 0.480 0.520
#> GSM613691     2  0.5363     0.2503 0.000 0.724 0.276
#> GSM613692     1  0.1163     0.9222 0.972 0.000 0.028
#> GSM613693     2  0.0000     0.7015 0.000 1.000 0.000
#> GSM613694     3  0.7676     0.6060 0.216 0.112 0.672
#> GSM613695     3  0.4702     0.4844 0.000 0.212 0.788
#> GSM613696     3  0.6305     0.3999 0.000 0.484 0.516
#> GSM613697     3  0.5905     0.3963 0.352 0.000 0.648
#> GSM613698     3  0.5060     0.5901 0.064 0.100 0.836
#> GSM613699     3  0.6470     0.5126 0.012 0.356 0.632
#> GSM613700     2  0.2625     0.6609 0.000 0.916 0.084
#> GSM613701     3  0.6950     0.4131 0.016 0.476 0.508
#> GSM613702     3  0.6680     0.4003 0.008 0.484 0.508
#> GSM613703     1  0.0424     0.9263 0.992 0.000 0.008
#> GSM613704     2  0.2261     0.6727 0.000 0.932 0.068
#> GSM613705     3  0.5067     0.5842 0.052 0.116 0.832
#> GSM613706     3  0.9231     0.5668 0.216 0.252 0.532
#> GSM613707     2  0.0000     0.7015 0.000 1.000 0.000
#> GSM613708     1  0.0592     0.9283 0.988 0.000 0.012
#> GSM613709     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613710     2  0.4555     0.6669 0.000 0.800 0.200
#> GSM613711     2  0.5560     0.6230 0.000 0.700 0.300
#> GSM613712     3  0.4994     0.5840 0.052 0.112 0.836
#> GSM613713     2  0.4842     0.6580 0.000 0.776 0.224
#> GSM613714     3  0.4291     0.5184 0.000 0.180 0.820
#> GSM613715     3  0.6204    -0.0733 0.000 0.424 0.576
#> GSM613716     3  0.5431     0.3653 0.000 0.284 0.716
#> GSM613717     2  0.5529     0.6288 0.000 0.704 0.296
#> GSM613718     2  0.5678     0.6082 0.000 0.684 0.316
#> GSM613719     3  0.6543     0.6086 0.176 0.076 0.748
#> GSM613720     2  0.5529     0.6288 0.000 0.704 0.296
#> GSM613721     3  0.6309     0.3868 0.000 0.496 0.504
#> GSM613722     2  0.2356     0.6725 0.000 0.928 0.072
#> GSM613723     1  0.1163     0.9222 0.972 0.000 0.028
#> GSM613724     1  0.0592     0.9283 0.988 0.000 0.012
#> GSM613725     2  0.1643     0.6898 0.000 0.956 0.044
#> GSM613726     1  0.6235     0.0907 0.564 0.000 0.436
#> GSM613727     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613728     2  0.2356     0.6725 0.000 0.928 0.072
#> GSM613729     1  0.0000     0.9306 1.000 0.000 0.000
#> GSM613730     3  0.6274     0.4278 0.000 0.456 0.544
#> GSM613731     3  0.6309     0.0798 0.496 0.000 0.504
#> GSM613732     2  0.5621     0.6171 0.000 0.692 0.308
#> GSM613733     2  0.4931     0.6581 0.000 0.768 0.232
#> GSM613734     1  0.0747     0.9270 0.984 0.000 0.016
#> GSM613735     1  0.1031     0.9242 0.976 0.000 0.024
#> GSM613736     2  0.5560     0.6236 0.000 0.700 0.300
#> GSM613737     3  0.5481     0.6014 0.108 0.076 0.816
#> GSM613738     1  0.1163     0.9222 0.972 0.000 0.028
#> GSM613739     1  0.1163     0.9222 0.972 0.000 0.028
#> GSM613740     2  0.5560     0.6236 0.000 0.700 0.300
#> GSM613741     3  0.8994     0.5779 0.184 0.260 0.556
#> GSM613742     1  0.1163     0.9222 0.972 0.000 0.028
#> GSM613743     2  0.5529     0.6263 0.000 0.704 0.296
#> GSM613744     2  0.5591     0.6198 0.000 0.696 0.304
#> GSM613745     3  0.8238     0.5749 0.104 0.300 0.596
#> GSM613746     2  0.0237     0.7011 0.000 0.996 0.004
#> GSM613747     1  0.0747     0.9270 0.984 0.000 0.016
#> GSM613748     3  0.6267     0.4333 0.000 0.452 0.548
#> GSM613749     3  0.9299     0.4612 0.324 0.180 0.496
#> GSM613750     2  0.6305     0.4636 0.000 0.516 0.484
#> GSM613751     2  0.6305     0.4636 0.000 0.516 0.484
#> GSM613752     2  0.6305     0.4636 0.000 0.516 0.484
#> GSM613753     3  0.6305    -0.4516 0.000 0.484 0.516

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM613638     3  0.1209      0.781 0.000 0.004 0.964 0.032
#> GSM613639     3  0.4687      0.612 0.224 0.004 0.752 0.020
#> GSM613640     3  0.1004      0.786 0.000 0.004 0.972 0.024
#> GSM613641     1  0.0657      0.891 0.984 0.000 0.012 0.004
#> GSM613642     3  0.5279      0.620 0.000 0.232 0.716 0.052
#> GSM613643     3  0.2002      0.777 0.044 0.000 0.936 0.020
#> GSM613644     3  0.0817      0.784 0.000 0.000 0.976 0.024
#> GSM613645     3  0.5076      0.581 0.260 0.004 0.712 0.024
#> GSM613646     3  0.2828      0.784 0.020 0.032 0.912 0.036
#> GSM613647     3  0.1398      0.780 0.000 0.004 0.956 0.040
#> GSM613648     3  0.5473      0.574 0.000 0.192 0.724 0.084
#> GSM613649     2  0.6831      0.261 0.000 0.480 0.420 0.100
#> GSM613650     3  0.1356      0.783 0.032 0.000 0.960 0.008
#> GSM613651     3  0.2124      0.768 0.008 0.000 0.924 0.068
#> GSM613652     1  0.4465      0.840 0.800 0.000 0.056 0.144
#> GSM613653     3  0.2531      0.784 0.020 0.032 0.924 0.024
#> GSM613654     1  0.4541      0.837 0.796 0.000 0.060 0.144
#> GSM613655     1  0.1211      0.892 0.960 0.000 0.000 0.040
#> GSM613656     1  0.3495      0.860 0.844 0.000 0.016 0.140
#> GSM613657     2  0.6262      0.574 0.000 0.660 0.208 0.132
#> GSM613658     1  0.1389      0.890 0.952 0.000 0.000 0.048
#> GSM613659     3  0.6330      0.321 0.000 0.448 0.492 0.060
#> GSM613660     2  0.0817      0.739 0.000 0.976 0.000 0.024
#> GSM613661     1  0.3725      0.726 0.812 0.000 0.180 0.008
#> GSM613662     2  0.2399      0.718 0.000 0.920 0.032 0.048
#> GSM613663     1  0.1151      0.886 0.968 0.000 0.024 0.008
#> GSM613664     2  0.2670      0.710 0.000 0.908 0.040 0.052
#> GSM613665     2  0.0336      0.742 0.000 0.992 0.008 0.000
#> GSM613666     1  0.0657      0.891 0.984 0.000 0.012 0.004
#> GSM613667     1  0.5791      0.144 0.556 0.004 0.416 0.024
#> GSM613668     1  0.0921      0.892 0.972 0.000 0.000 0.028
#> GSM613669     1  0.0657      0.891 0.984 0.000 0.012 0.004
#> GSM613670     2  0.5520      0.423 0.000 0.696 0.244 0.060
#> GSM613671     1  0.0657      0.891 0.984 0.000 0.012 0.004
#> GSM613672     1  0.0921      0.892 0.972 0.000 0.000 0.028
#> GSM613673     1  0.1151      0.886 0.968 0.000 0.024 0.008
#> GSM613674     2  0.1118      0.736 0.000 0.964 0.000 0.036
#> GSM613675     2  0.1733      0.733 0.000 0.948 0.024 0.028
#> GSM613676     2  0.0817      0.738 0.000 0.976 0.000 0.024
#> GSM613677     3  0.5982      0.170 0.000 0.436 0.524 0.040
#> GSM613678     3  0.6956      0.552 0.048 0.296 0.604 0.052
#> GSM613679     2  0.0895      0.741 0.000 0.976 0.020 0.004
#> GSM613680     1  0.0336      0.891 0.992 0.000 0.000 0.008
#> GSM613681     1  0.0657      0.891 0.984 0.000 0.012 0.004
#> GSM613682     1  0.1042      0.888 0.972 0.000 0.020 0.008
#> GSM613683     1  0.1302      0.890 0.956 0.000 0.000 0.044
#> GSM613684     2  0.1118      0.736 0.000 0.964 0.000 0.036
#> GSM613685     2  0.1118      0.736 0.000 0.964 0.000 0.036
#> GSM613686     1  0.4277      0.715 0.800 0.004 0.172 0.024
#> GSM613687     1  0.1042      0.888 0.972 0.000 0.020 0.008
#> GSM613688     2  0.3004      0.699 0.000 0.892 0.060 0.048
#> GSM613689     3  0.5332      0.622 0.000 0.184 0.736 0.080
#> GSM613690     3  0.5859      0.548 0.000 0.156 0.704 0.140
#> GSM613691     2  0.4514      0.575 0.000 0.796 0.148 0.056
#> GSM613692     1  0.4541      0.837 0.796 0.000 0.060 0.144
#> GSM613693     2  0.0469      0.739 0.000 0.988 0.000 0.012
#> GSM613694     3  0.0895      0.786 0.020 0.000 0.976 0.004
#> GSM613695     3  0.2610      0.760 0.000 0.012 0.900 0.088
#> GSM613696     3  0.4204      0.720 0.000 0.192 0.788 0.020
#> GSM613697     3  0.3441      0.731 0.024 0.000 0.856 0.120
#> GSM613698     3  0.1489      0.780 0.000 0.004 0.952 0.044
#> GSM613699     3  0.1151      0.789 0.000 0.024 0.968 0.008
#> GSM613700     2  0.2335      0.728 0.000 0.920 0.060 0.020
#> GSM613701     3  0.5038      0.603 0.000 0.296 0.684 0.020
#> GSM613702     3  0.5366      0.616 0.000 0.276 0.684 0.040
#> GSM613703     1  0.1863      0.873 0.944 0.004 0.040 0.012
#> GSM613704     2  0.1936      0.729 0.000 0.940 0.032 0.028
#> GSM613705     3  0.1109      0.783 0.000 0.004 0.968 0.028
#> GSM613706     3  0.1786      0.783 0.036 0.008 0.948 0.008
#> GSM613707     2  0.1118      0.736 0.000 0.964 0.000 0.036
#> GSM613708     1  0.2466      0.861 0.900 0.000 0.096 0.004
#> GSM613709     1  0.0469      0.891 0.988 0.000 0.012 0.000
#> GSM613710     2  0.3731      0.690 0.000 0.844 0.036 0.120
#> GSM613711     2  0.6341      0.565 0.000 0.652 0.212 0.136
#> GSM613712     3  0.1209      0.781 0.000 0.004 0.964 0.032
#> GSM613713     2  0.4227      0.675 0.000 0.820 0.060 0.120
#> GSM613714     3  0.2329      0.763 0.000 0.012 0.916 0.072
#> GSM613715     3  0.5664      0.572 0.000 0.156 0.720 0.124
#> GSM613716     3  0.4469      0.698 0.000 0.112 0.808 0.080
#> GSM613717     2  0.6167      0.578 0.000 0.668 0.208 0.124
#> GSM613718     2  0.6465      0.540 0.000 0.636 0.228 0.136
#> GSM613719     3  0.1042      0.786 0.020 0.000 0.972 0.008
#> GSM613720     2  0.6031      0.584 0.000 0.676 0.216 0.108
#> GSM613721     3  0.5678      0.573 0.000 0.316 0.640 0.044
#> GSM613722     2  0.2002      0.737 0.000 0.936 0.044 0.020
#> GSM613723     1  0.4465      0.840 0.800 0.000 0.056 0.144
#> GSM613724     1  0.3052      0.865 0.860 0.000 0.004 0.136
#> GSM613725     2  0.1936      0.744 0.000 0.940 0.032 0.028
#> GSM613726     3  0.5751      0.196 0.448 0.004 0.528 0.020
#> GSM613727     1  0.1118      0.892 0.964 0.000 0.000 0.036
#> GSM613728     2  0.2214      0.734 0.000 0.928 0.044 0.028
#> GSM613729     1  0.0657      0.891 0.984 0.000 0.012 0.004
#> GSM613730     3  0.5030      0.704 0.000 0.188 0.752 0.060
#> GSM613731     3  0.4614      0.609 0.228 0.004 0.752 0.016
#> GSM613732     2  0.6341      0.565 0.000 0.652 0.212 0.136
#> GSM613733     2  0.5923      0.607 0.000 0.696 0.176 0.128
#> GSM613734     1  0.3052      0.865 0.860 0.000 0.004 0.136
#> GSM613735     1  0.3495      0.860 0.844 0.000 0.016 0.140
#> GSM613736     2  0.6262      0.578 0.000 0.660 0.208 0.132
#> GSM613737     3  0.0817      0.786 0.000 0.000 0.976 0.024
#> GSM613738     1  0.4491      0.838 0.800 0.000 0.060 0.140
#> GSM613739     1  0.4590      0.834 0.792 0.000 0.060 0.148
#> GSM613740     2  0.6341      0.565 0.000 0.652 0.212 0.136
#> GSM613741     3  0.3296      0.778 0.024 0.048 0.892 0.036
#> GSM613742     1  0.4686      0.835 0.788 0.000 0.068 0.144
#> GSM613743     2  0.6262      0.574 0.000 0.660 0.208 0.132
#> GSM613744     2  0.6373      0.559 0.000 0.648 0.216 0.136
#> GSM613745     3  0.3617      0.777 0.020 0.048 0.876 0.056
#> GSM613746     2  0.0817      0.736 0.000 0.976 0.000 0.024
#> GSM613747     1  0.3052      0.865 0.860 0.000 0.004 0.136
#> GSM613748     3  0.3821      0.756 0.000 0.120 0.840 0.040
#> GSM613749     3  0.6667      0.536 0.276 0.060 0.632 0.032
#> GSM613750     4  0.4462      0.975 0.000 0.164 0.044 0.792
#> GSM613751     4  0.4462      0.975 0.000 0.164 0.044 0.792
#> GSM613752     4  0.4423      0.970 0.000 0.168 0.040 0.792
#> GSM613753     4  0.4410      0.934 0.000 0.128 0.064 0.808

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     4  0.2843     0.7071 0.000 0.000 0.008 0.848 0.144
#> GSM613639     4  0.4816     0.6040 0.168 0.000 0.004 0.732 0.096
#> GSM613640     4  0.1608     0.7255 0.000 0.000 0.000 0.928 0.072
#> GSM613641     1  0.0162     0.6079 0.996 0.000 0.004 0.000 0.000
#> GSM613642     4  0.5982     0.5357 0.000 0.092 0.028 0.624 0.256
#> GSM613643     4  0.2835     0.7127 0.016 0.000 0.004 0.868 0.112
#> GSM613644     4  0.2660     0.7141 0.000 0.000 0.008 0.864 0.128
#> GSM613645     4  0.5666     0.5200 0.240 0.000 0.008 0.640 0.112
#> GSM613646     4  0.3561     0.7037 0.012 0.012 0.016 0.840 0.120
#> GSM613647     4  0.2886     0.7066 0.000 0.000 0.008 0.844 0.148
#> GSM613648     4  0.7161     0.3001 0.000 0.180 0.044 0.492 0.284
#> GSM613649     2  0.7966     0.2632 0.000 0.336 0.076 0.300 0.288
#> GSM613650     4  0.2783     0.7121 0.012 0.000 0.004 0.868 0.116
#> GSM613651     4  0.2848     0.7045 0.000 0.000 0.004 0.840 0.156
#> GSM613652     1  0.5296    -0.9703 0.480 0.000 0.000 0.048 0.472
#> GSM613653     4  0.3513     0.7013 0.012 0.016 0.012 0.844 0.116
#> GSM613654     5  0.5353     0.9849 0.472 0.000 0.000 0.052 0.476
#> GSM613655     1  0.2136     0.5402 0.904 0.000 0.008 0.000 0.088
#> GSM613656     1  0.4815    -0.8322 0.524 0.000 0.000 0.020 0.456
#> GSM613657     2  0.7156     0.5307 0.000 0.528 0.104 0.096 0.272
#> GSM613658     1  0.2304     0.5213 0.892 0.000 0.008 0.000 0.100
#> GSM613659     2  0.6620     0.1334 0.000 0.536 0.020 0.280 0.164
#> GSM613660     2  0.1981     0.6523 0.000 0.920 0.016 0.000 0.064
#> GSM613661     1  0.4766     0.3396 0.708 0.000 0.000 0.220 0.072
#> GSM613662     2  0.3414     0.5832 0.000 0.844 0.020 0.020 0.116
#> GSM613663     1  0.0693     0.6035 0.980 0.000 0.000 0.008 0.012
#> GSM613664     2  0.3997     0.5564 0.000 0.800 0.020 0.028 0.152
#> GSM613665     2  0.0162     0.6484 0.000 0.996 0.000 0.000 0.004
#> GSM613666     1  0.0162     0.6079 0.996 0.000 0.004 0.000 0.000
#> GSM613667     1  0.5855     0.1595 0.552 0.000 0.004 0.348 0.096
#> GSM613668     1  0.1952     0.5460 0.912 0.000 0.004 0.000 0.084
#> GSM613669     1  0.0162     0.6079 0.996 0.000 0.004 0.000 0.000
#> GSM613670     2  0.5722     0.4091 0.000 0.672 0.020 0.144 0.164
#> GSM613671     1  0.0162     0.6079 0.996 0.000 0.004 0.000 0.000
#> GSM613672     1  0.1952     0.5460 0.912 0.000 0.004 0.000 0.084
#> GSM613673     1  0.0854     0.6045 0.976 0.000 0.004 0.008 0.012
#> GSM613674     2  0.1830     0.6412 0.000 0.932 0.028 0.000 0.040
#> GSM613675     2  0.2289     0.6180 0.000 0.904 0.012 0.004 0.080
#> GSM613676     2  0.1386     0.6502 0.000 0.952 0.016 0.000 0.032
#> GSM613677     2  0.6754    -0.0317 0.000 0.420 0.012 0.396 0.172
#> GSM613678     4  0.8294     0.3284 0.128 0.300 0.016 0.412 0.144
#> GSM613679     2  0.0955     0.6426 0.000 0.968 0.000 0.004 0.028
#> GSM613680     1  0.0865     0.5931 0.972 0.000 0.004 0.000 0.024
#> GSM613681     1  0.0000     0.6074 1.000 0.000 0.000 0.000 0.000
#> GSM613682     1  0.0854     0.6045 0.976 0.000 0.004 0.008 0.012
#> GSM613683     1  0.2179     0.5221 0.896 0.000 0.004 0.000 0.100
#> GSM613684     2  0.2209     0.6427 0.000 0.912 0.032 0.000 0.056
#> GSM613685     2  0.1830     0.6412 0.000 0.932 0.028 0.000 0.040
#> GSM613686     1  0.5177     0.3291 0.688 0.004 0.000 0.212 0.096
#> GSM613687     1  0.0693     0.6035 0.980 0.000 0.000 0.008 0.012
#> GSM613688     2  0.3675     0.5887 0.000 0.828 0.016 0.032 0.124
#> GSM613689     4  0.6919     0.3688 0.000 0.128 0.052 0.528 0.292
#> GSM613690     4  0.6706     0.4478 0.000 0.076 0.084 0.568 0.272
#> GSM613691     2  0.4774     0.5056 0.000 0.756 0.020 0.076 0.148
#> GSM613692     5  0.5296     0.9810 0.472 0.000 0.000 0.048 0.480
#> GSM613693     2  0.1571     0.6444 0.000 0.936 0.004 0.000 0.060
#> GSM613694     4  0.1357     0.7285 0.000 0.000 0.004 0.948 0.048
#> GSM613695     4  0.4665     0.6133 0.000 0.000 0.048 0.692 0.260
#> GSM613696     4  0.5359     0.4619 0.000 0.316 0.000 0.608 0.076
#> GSM613697     4  0.4375     0.5163 0.004 0.000 0.004 0.628 0.364
#> GSM613698     4  0.2886     0.7073 0.000 0.000 0.008 0.844 0.148
#> GSM613699     4  0.1717     0.7283 0.000 0.008 0.004 0.936 0.052
#> GSM613700     2  0.3277     0.6443 0.000 0.856 0.004 0.068 0.072
#> GSM613701     4  0.4778     0.6543 0.012 0.136 0.004 0.760 0.088
#> GSM613702     4  0.5356     0.6474 0.012 0.128 0.012 0.724 0.124
#> GSM613703     1  0.4612     0.3934 0.752 0.000 0.004 0.152 0.092
#> GSM613704     2  0.2507     0.6159 0.000 0.900 0.012 0.016 0.072
#> GSM613705     4  0.2536     0.7134 0.000 0.000 0.004 0.868 0.128
#> GSM613706     4  0.1892     0.7224 0.012 0.008 0.004 0.936 0.040
#> GSM613707     2  0.1981     0.6419 0.000 0.924 0.028 0.000 0.048
#> GSM613708     1  0.4170     0.3387 0.780 0.000 0.000 0.140 0.080
#> GSM613709     1  0.0162     0.6079 0.996 0.000 0.004 0.000 0.000
#> GSM613710     2  0.6287     0.5582 0.000 0.600 0.096 0.040 0.264
#> GSM613711     2  0.7492     0.5112 0.000 0.492 0.104 0.132 0.272
#> GSM613712     4  0.2843     0.7060 0.000 0.000 0.008 0.848 0.144
#> GSM613713     2  0.6585     0.5510 0.000 0.576 0.104 0.052 0.268
#> GSM613714     4  0.5200     0.5700 0.000 0.024 0.040 0.672 0.264
#> GSM613715     4  0.7229     0.3566 0.000 0.124 0.080 0.508 0.288
#> GSM613716     4  0.6559     0.5189 0.000 0.092 0.052 0.564 0.292
#> GSM613717     2  0.7284     0.5213 0.000 0.512 0.084 0.132 0.272
#> GSM613718     2  0.7637     0.4931 0.000 0.472 0.108 0.144 0.276
#> GSM613719     4  0.2517     0.7154 0.004 0.000 0.008 0.884 0.104
#> GSM613720     2  0.7406     0.5014 0.000 0.472 0.076 0.144 0.308
#> GSM613721     4  0.6061     0.5619 0.000 0.200 0.016 0.624 0.160
#> GSM613722     2  0.3081     0.6476 0.000 0.868 0.004 0.056 0.072
#> GSM613723     1  0.5296    -0.9703 0.480 0.000 0.000 0.048 0.472
#> GSM613724     1  0.4499    -0.6157 0.584 0.000 0.004 0.004 0.408
#> GSM613725     2  0.3857     0.6402 0.000 0.832 0.028 0.052 0.088
#> GSM613726     4  0.5665     0.2755 0.384 0.000 0.004 0.540 0.072
#> GSM613727     1  0.2077     0.5453 0.908 0.000 0.008 0.000 0.084
#> GSM613728     2  0.4256     0.6235 0.000 0.796 0.016 0.068 0.120
#> GSM613729     1  0.0727     0.6056 0.980 0.000 0.004 0.004 0.012
#> GSM613730     4  0.5926     0.6222 0.008 0.116 0.024 0.672 0.180
#> GSM613731     4  0.3780     0.6500 0.132 0.000 0.000 0.808 0.060
#> GSM613732     2  0.7524     0.5093 0.000 0.488 0.104 0.136 0.272
#> GSM613733     2  0.7096     0.5342 0.000 0.536 0.104 0.092 0.268
#> GSM613734     1  0.4499    -0.6157 0.584 0.000 0.004 0.004 0.408
#> GSM613735     1  0.5039    -0.8742 0.512 0.000 0.000 0.032 0.456
#> GSM613736     2  0.7526     0.5133 0.000 0.476 0.104 0.128 0.292
#> GSM613737     4  0.2124     0.7216 0.000 0.000 0.004 0.900 0.096
#> GSM613738     5  0.5352     0.9846 0.468 0.000 0.000 0.052 0.480
#> GSM613739     5  0.5353     0.9849 0.472 0.000 0.000 0.052 0.476
#> GSM613740     2  0.7473     0.5148 0.000 0.492 0.104 0.128 0.276
#> GSM613741     4  0.4034     0.6919 0.012 0.024 0.016 0.812 0.136
#> GSM613742     5  0.5405     0.9681 0.460 0.000 0.000 0.056 0.484
#> GSM613743     2  0.7459     0.5149 0.000 0.496 0.104 0.128 0.272
#> GSM613744     2  0.7524     0.5093 0.000 0.488 0.104 0.136 0.272
#> GSM613745     4  0.4231     0.6887 0.008 0.024 0.020 0.792 0.156
#> GSM613746     2  0.2407     0.6210 0.000 0.896 0.012 0.004 0.088
#> GSM613747     1  0.4499    -0.6157 0.584 0.000 0.004 0.004 0.408
#> GSM613748     4  0.3675     0.7138 0.008 0.044 0.008 0.840 0.100
#> GSM613749     4  0.6717     0.4891 0.240 0.040 0.008 0.588 0.124
#> GSM613750     3  0.0865     0.9909 0.000 0.024 0.972 0.004 0.000
#> GSM613751     3  0.1372     0.9885 0.000 0.024 0.956 0.004 0.016
#> GSM613752     3  0.0865     0.9909 0.000 0.024 0.972 0.004 0.000
#> GSM613753     3  0.1074     0.9793 0.000 0.012 0.968 0.016 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
#> GSM613638     4  0.5105     0.4742 0.000 0.000 0.432 0.488 0.080 0.000
#> GSM613639     4  0.3341     0.6773 0.088 0.000 0.060 0.836 0.016 0.000
#> GSM613640     4  0.4456     0.5026 0.000 0.000 0.448 0.524 0.028 0.000
#> GSM613641     1  0.1026     0.7784 0.968 0.000 0.012 0.004 0.008 0.008
#> GSM613642     3  0.5063     0.1882 0.000 0.048 0.704 0.172 0.072 0.004
#> GSM613643     4  0.5077     0.5005 0.000 0.000 0.404 0.516 0.080 0.000
#> GSM613644     4  0.5054     0.4887 0.000 0.000 0.420 0.504 0.076 0.000
#> GSM613645     4  0.2558     0.6113 0.156 0.000 0.000 0.840 0.004 0.000
#> GSM613646     4  0.0713     0.6843 0.000 0.000 0.028 0.972 0.000 0.000
#> GSM613647     3  0.5073    -0.4598 0.000 0.000 0.476 0.448 0.076 0.000
#> GSM613648     3  0.4784     0.4829 0.000 0.088 0.748 0.080 0.080 0.004
#> GSM613649     3  0.5915     0.4731 0.000 0.212 0.612 0.040 0.128 0.008
#> GSM613650     4  0.2623     0.6917 0.000 0.000 0.132 0.852 0.016 0.000
#> GSM613651     4  0.5387     0.4488 0.000 0.000 0.424 0.464 0.112 0.000
#> GSM613652     5  0.4435     0.9279 0.364 0.000 0.004 0.028 0.604 0.000
#> GSM613653     4  0.0692     0.6825 0.000 0.000 0.020 0.976 0.004 0.000
#> GSM613654     5  0.4490     0.9254 0.360 0.000 0.004 0.032 0.604 0.000
#> GSM613655     1  0.2149     0.6902 0.888 0.000 0.004 0.000 0.104 0.004
#> GSM613656     5  0.4033     0.9096 0.404 0.000 0.004 0.004 0.588 0.000
#> GSM613657     3  0.5529     0.4457 0.000 0.344 0.536 0.004 0.112 0.004
#> GSM613658     1  0.2326     0.7011 0.888 0.000 0.012 0.000 0.092 0.008
#> GSM613659     2  0.6208     0.5220 0.000 0.540 0.060 0.280 0.120 0.000
#> GSM613660     2  0.3666     0.5814 0.000 0.812 0.080 0.016 0.092 0.000
#> GSM613661     1  0.3827     0.5105 0.680 0.000 0.004 0.308 0.008 0.000
#> GSM613662     2  0.5124     0.6368 0.000 0.680 0.028 0.176 0.116 0.000
#> GSM613663     1  0.1049     0.7764 0.960 0.000 0.000 0.032 0.008 0.000
#> GSM613664     2  0.5245     0.6361 0.000 0.668 0.028 0.172 0.132 0.000
#> GSM613665     2  0.1353     0.6900 0.000 0.952 0.012 0.012 0.024 0.000
#> GSM613666     1  0.0551     0.7806 0.984 0.000 0.008 0.004 0.000 0.004
#> GSM613667     1  0.3966     0.3024 0.552 0.000 0.000 0.444 0.004 0.000
#> GSM613668     1  0.1663     0.7075 0.912 0.000 0.000 0.000 0.088 0.000
#> GSM613669     1  0.0912     0.7794 0.972 0.000 0.012 0.004 0.004 0.008
#> GSM613670     2  0.5843     0.5626 0.000 0.588 0.044 0.252 0.116 0.000
#> GSM613671     1  0.0912     0.7794 0.972 0.000 0.012 0.004 0.004 0.008
#> GSM613672     1  0.1663     0.7075 0.912 0.000 0.000 0.000 0.088 0.000
#> GSM613673     1  0.1151     0.7767 0.956 0.000 0.000 0.032 0.012 0.000
#> GSM613674     2  0.2113     0.6760 0.000 0.896 0.008 0.000 0.092 0.004
#> GSM613675     2  0.4081     0.6906 0.000 0.784 0.032 0.064 0.120 0.000
#> GSM613676     2  0.1341     0.6751 0.000 0.948 0.028 0.000 0.024 0.000
#> GSM613677     3  0.5719    -0.1153 0.000 0.416 0.480 0.052 0.052 0.000
#> GSM613678     4  0.5237    -0.1956 0.016 0.428 0.028 0.512 0.016 0.000
#> GSM613679     2  0.1340     0.6941 0.000 0.948 0.004 0.008 0.040 0.000
#> GSM613680     1  0.0363     0.7731 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM613681     1  0.0146     0.7793 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM613682     1  0.1049     0.7764 0.960 0.000 0.000 0.032 0.008 0.000
#> GSM613683     1  0.1714     0.7015 0.908 0.000 0.000 0.000 0.092 0.000
#> GSM613684     2  0.1946     0.6843 0.000 0.912 0.012 0.000 0.072 0.004
#> GSM613685     2  0.2113     0.6760 0.000 0.896 0.008 0.000 0.092 0.004
#> GSM613686     1  0.3615     0.5301 0.700 0.000 0.000 0.292 0.008 0.000
#> GSM613687     1  0.1049     0.7764 0.960 0.000 0.000 0.032 0.008 0.000
#> GSM613688     2  0.5117     0.6674 0.000 0.704 0.056 0.112 0.128 0.000
#> GSM613689     3  0.3768     0.4119 0.000 0.048 0.816 0.080 0.056 0.000
#> GSM613690     3  0.2734     0.3298 0.000 0.008 0.864 0.104 0.024 0.000
#> GSM613691     2  0.5841     0.5848 0.000 0.604 0.048 0.220 0.128 0.000
#> GSM613692     5  0.4523     0.9108 0.372 0.000 0.004 0.032 0.592 0.000
#> GSM613693     2  0.2883     0.6993 0.000 0.864 0.032 0.016 0.088 0.000
#> GSM613694     4  0.4344     0.5989 0.000 0.000 0.356 0.612 0.032 0.000
#> GSM613695     3  0.3307     0.2325 0.000 0.000 0.808 0.148 0.044 0.000
#> GSM613696     2  0.6417     0.0508 0.000 0.420 0.320 0.240 0.020 0.000
#> GSM613697     3  0.6289    -0.2062 0.016 0.000 0.420 0.212 0.352 0.000
#> GSM613698     3  0.5112    -0.4082 0.000 0.000 0.516 0.400 0.084 0.000
#> GSM613699     4  0.4292     0.5751 0.000 0.000 0.388 0.588 0.024 0.000
#> GSM613700     2  0.5157     0.5634 0.000 0.700 0.060 0.100 0.140 0.000
#> GSM613701     4  0.4025     0.6873 0.000 0.040 0.124 0.788 0.048 0.000
#> GSM613702     4  0.3177     0.6692 0.000 0.024 0.072 0.852 0.052 0.000
#> GSM613703     1  0.4346     0.5205 0.664 0.000 0.012 0.304 0.012 0.008
#> GSM613704     2  0.4455     0.6849 0.000 0.752 0.028 0.096 0.124 0.000
#> GSM613705     4  0.5071     0.4662 0.000 0.000 0.444 0.480 0.076 0.000
#> GSM613706     4  0.3642     0.6803 0.000 0.000 0.204 0.760 0.036 0.000
#> GSM613707     2  0.2113     0.6760 0.000 0.896 0.008 0.000 0.092 0.004
#> GSM613708     1  0.4687     0.3328 0.668 0.000 0.008 0.256 0.068 0.000
#> GSM613709     1  0.1026     0.7784 0.968 0.000 0.012 0.004 0.008 0.008
#> GSM613710     2  0.6230    -0.3357 0.000 0.408 0.408 0.016 0.164 0.004
#> GSM613711     3  0.5853     0.4476 0.000 0.344 0.520 0.012 0.116 0.008
#> GSM613712     3  0.5115    -0.4691 0.000 0.000 0.464 0.456 0.080 0.000
#> GSM613713     3  0.6278     0.3305 0.000 0.376 0.432 0.008 0.172 0.012
#> GSM613714     3  0.2686     0.3080 0.000 0.004 0.848 0.140 0.004 0.004
#> GSM613715     3  0.3553     0.3968 0.000 0.032 0.832 0.088 0.044 0.004
#> GSM613716     3  0.6047    -0.0682 0.000 0.028 0.460 0.388 0.124 0.000
#> GSM613717     3  0.5819     0.4485 0.000 0.344 0.524 0.012 0.112 0.008
#> GSM613718     3  0.5870     0.4575 0.000 0.332 0.532 0.016 0.112 0.008
#> GSM613719     4  0.2312     0.6941 0.000 0.000 0.112 0.876 0.012 0.000
#> GSM613720     3  0.6947     0.2927 0.000 0.208 0.484 0.088 0.216 0.004
#> GSM613721     4  0.4501     0.5521 0.000 0.100 0.032 0.760 0.104 0.004
#> GSM613722     2  0.5248     0.5477 0.000 0.696 0.076 0.096 0.132 0.000
#> GSM613723     5  0.4435     0.9279 0.364 0.000 0.004 0.028 0.604 0.000
#> GSM613724     5  0.3971     0.8476 0.448 0.000 0.000 0.000 0.548 0.004
#> GSM613725     2  0.5060     0.5441 0.000 0.712 0.072 0.084 0.132 0.000
#> GSM613726     4  0.4616     0.5966 0.176 0.000 0.056 0.728 0.040 0.000
#> GSM613727     1  0.2376     0.6992 0.884 0.000 0.012 0.000 0.096 0.008
#> GSM613728     2  0.6369     0.6116 0.000 0.564 0.084 0.160 0.192 0.000
#> GSM613729     1  0.1812     0.7738 0.932 0.000 0.012 0.040 0.008 0.008
#> GSM613730     4  0.4072     0.5913 0.000 0.024 0.088 0.784 0.104 0.000
#> GSM613731     4  0.4354     0.6794 0.032 0.000 0.200 0.732 0.036 0.000
#> GSM613732     3  0.5588     0.4566 0.000 0.328 0.548 0.004 0.112 0.008
#> GSM613733     3  0.5794     0.4032 0.000 0.360 0.500 0.008 0.128 0.004
#> GSM613734     5  0.3971     0.8476 0.448 0.000 0.000 0.000 0.548 0.004
#> GSM613735     5  0.4343     0.9203 0.384 0.000 0.000 0.020 0.592 0.004
#> GSM613736     3  0.5940     0.4235 0.000 0.340 0.512 0.012 0.128 0.008
#> GSM613737     4  0.4504     0.5426 0.000 0.000 0.432 0.536 0.032 0.000
#> GSM613738     5  0.4543     0.9209 0.380 0.000 0.004 0.032 0.584 0.000
#> GSM613739     5  0.4490     0.9254 0.360 0.000 0.004 0.032 0.604 0.000
#> GSM613740     3  0.5809     0.4429 0.000 0.340 0.528 0.012 0.112 0.008
#> GSM613741     4  0.1464     0.6716 0.000 0.004 0.036 0.944 0.016 0.000
#> GSM613742     5  0.4638     0.9093 0.368 0.000 0.004 0.040 0.588 0.000
#> GSM613743     3  0.5819     0.4408 0.000 0.344 0.524 0.012 0.112 0.008
#> GSM613744     3  0.5588     0.4566 0.000 0.328 0.548 0.004 0.112 0.008
#> GSM613745     4  0.2760     0.6411 0.000 0.004 0.076 0.868 0.052 0.000
#> GSM613746     2  0.4736     0.6864 0.000 0.728 0.028 0.080 0.160 0.004
#> GSM613747     5  0.3971     0.8476 0.448 0.000 0.000 0.000 0.548 0.004
#> GSM613748     4  0.4055     0.6810 0.000 0.016 0.184 0.756 0.044 0.000
#> GSM613749     4  0.3106     0.6344 0.064 0.008 0.020 0.864 0.044 0.000
#> GSM613750     6  0.0363     1.0000 0.000 0.000 0.012 0.000 0.000 0.988
#> GSM613751     6  0.0363     1.0000 0.000 0.000 0.012 0.000 0.000 0.988
#> GSM613752     6  0.0363     1.0000 0.000 0.000 0.012 0.000 0.000 0.988
#> GSM613753     6  0.0363     1.0000 0.000 0.000 0.012 0.000 0.000 0.988

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 disease.state(p) k
#> CV:kmeans 112         7.13e-02 2
#> CV:kmeans  85         2.12e-03 3
#> CV:kmeans 110         6.10e-05 4
#> CV:kmeans  91         2.40e-06 5
#> CV:kmeans  81         2.82e-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 27425 rows and 116 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.947           0.947       0.979         0.5046 0.496   0.496
#> 3 3 0.720           0.841       0.905         0.2968 0.755   0.545
#> 4 4 0.589           0.596       0.778         0.1233 0.900   0.720
#> 5 5 0.614           0.603       0.747         0.0606 0.929   0.756
#> 6 6 0.650           0.522       0.709         0.0417 0.907   0.645

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
#> GSM613638     1   0.904     0.5286 0.680 0.320
#> GSM613639     1   0.000     0.9724 1.000 0.000
#> GSM613640     2   0.163     0.9604 0.024 0.976
#> GSM613641     1   0.000     0.9724 1.000 0.000
#> GSM613642     2   0.000     0.9836 0.000 1.000
#> GSM613643     1   0.000     0.9724 1.000 0.000
#> GSM613644     1   0.000     0.9724 1.000 0.000
#> GSM613645     1   0.000     0.9724 1.000 0.000
#> GSM613646     1   0.163     0.9517 0.976 0.024
#> GSM613647     1   0.760     0.7150 0.780 0.220
#> GSM613648     2   0.000     0.9836 0.000 1.000
#> GSM613649     2   0.000     0.9836 0.000 1.000
#> GSM613650     1   0.000     0.9724 1.000 0.000
#> GSM613651     1   0.000     0.9724 1.000 0.000
#> GSM613652     1   0.000     0.9724 1.000 0.000
#> GSM613653     1   0.000     0.9724 1.000 0.000
#> GSM613654     1   0.000     0.9724 1.000 0.000
#> GSM613655     1   0.000     0.9724 1.000 0.000
#> GSM613656     1   0.000     0.9724 1.000 0.000
#> GSM613657     2   0.000     0.9836 0.000 1.000
#> GSM613658     1   0.000     0.9724 1.000 0.000
#> GSM613659     2   0.000     0.9836 0.000 1.000
#> GSM613660     2   0.000     0.9836 0.000 1.000
#> GSM613661     1   0.000     0.9724 1.000 0.000
#> GSM613662     2   0.000     0.9836 0.000 1.000
#> GSM613663     1   0.000     0.9724 1.000 0.000
#> GSM613664     2   0.000     0.9836 0.000 1.000
#> GSM613665     2   0.000     0.9836 0.000 1.000
#> GSM613666     1   0.000     0.9724 1.000 0.000
#> GSM613667     1   0.000     0.9724 1.000 0.000
#> GSM613668     1   0.000     0.9724 1.000 0.000
#> GSM613669     1   0.000     0.9724 1.000 0.000
#> GSM613670     2   0.000     0.9836 0.000 1.000
#> GSM613671     1   0.000     0.9724 1.000 0.000
#> GSM613672     1   0.000     0.9724 1.000 0.000
#> GSM613673     1   0.000     0.9724 1.000 0.000
#> GSM613674     2   0.000     0.9836 0.000 1.000
#> GSM613675     2   0.000     0.9836 0.000 1.000
#> GSM613676     2   0.000     0.9836 0.000 1.000
#> GSM613677     2   0.000     0.9836 0.000 1.000
#> GSM613678     1   0.141     0.9553 0.980 0.020
#> GSM613679     2   0.000     0.9836 0.000 1.000
#> GSM613680     1   0.000     0.9724 1.000 0.000
#> GSM613681     1   0.000     0.9724 1.000 0.000
#> GSM613682     1   0.000     0.9724 1.000 0.000
#> GSM613683     1   0.000     0.9724 1.000 0.000
#> GSM613684     2   0.000     0.9836 0.000 1.000
#> GSM613685     2   0.000     0.9836 0.000 1.000
#> GSM613686     1   0.000     0.9724 1.000 0.000
#> GSM613687     1   0.000     0.9724 1.000 0.000
#> GSM613688     2   0.000     0.9836 0.000 1.000
#> GSM613689     2   0.000     0.9836 0.000 1.000
#> GSM613690     2   0.000     0.9836 0.000 1.000
#> GSM613691     2   0.000     0.9836 0.000 1.000
#> GSM613692     1   0.000     0.9724 1.000 0.000
#> GSM613693     2   0.000     0.9836 0.000 1.000
#> GSM613694     1   0.000     0.9724 1.000 0.000
#> GSM613695     2   0.000     0.9836 0.000 1.000
#> GSM613696     2   0.000     0.9836 0.000 1.000
#> GSM613697     1   0.000     0.9724 1.000 0.000
#> GSM613698     1   0.552     0.8413 0.872 0.128
#> GSM613699     2   0.722     0.7413 0.200 0.800
#> GSM613700     2   0.000     0.9836 0.000 1.000
#> GSM613701     2   0.722     0.7413 0.200 0.800
#> GSM613702     2   0.000     0.9836 0.000 1.000
#> GSM613703     1   0.000     0.9724 1.000 0.000
#> GSM613704     2   0.000     0.9836 0.000 1.000
#> GSM613705     1   0.952     0.4078 0.628 0.372
#> GSM613706     1   0.000     0.9724 1.000 0.000
#> GSM613707     2   0.000     0.9836 0.000 1.000
#> GSM613708     1   0.000     0.9724 1.000 0.000
#> GSM613709     1   0.000     0.9724 1.000 0.000
#> GSM613710     2   0.000     0.9836 0.000 1.000
#> GSM613711     2   0.000     0.9836 0.000 1.000
#> GSM613712     2   0.997     0.0975 0.468 0.532
#> GSM613713     2   0.000     0.9836 0.000 1.000
#> GSM613714     2   0.000     0.9836 0.000 1.000
#> GSM613715     2   0.000     0.9836 0.000 1.000
#> GSM613716     2   0.000     0.9836 0.000 1.000
#> GSM613717     2   0.000     0.9836 0.000 1.000
#> GSM613718     2   0.000     0.9836 0.000 1.000
#> GSM613719     1   0.000     0.9724 1.000 0.000
#> GSM613720     2   0.000     0.9836 0.000 1.000
#> GSM613721     2   0.000     0.9836 0.000 1.000
#> GSM613722     2   0.000     0.9836 0.000 1.000
#> GSM613723     1   0.000     0.9724 1.000 0.000
#> GSM613724     1   0.000     0.9724 1.000 0.000
#> GSM613725     2   0.000     0.9836 0.000 1.000
#> GSM613726     1   0.000     0.9724 1.000 0.000
#> GSM613727     1   0.000     0.9724 1.000 0.000
#> GSM613728     2   0.000     0.9836 0.000 1.000
#> GSM613729     1   0.000     0.9724 1.000 0.000
#> GSM613730     2   0.000     0.9836 0.000 1.000
#> GSM613731     1   0.000     0.9724 1.000 0.000
#> GSM613732     2   0.000     0.9836 0.000 1.000
#> GSM613733     2   0.000     0.9836 0.000 1.000
#> GSM613734     1   0.000     0.9724 1.000 0.000
#> GSM613735     1   0.000     0.9724 1.000 0.000
#> GSM613736     2   0.000     0.9836 0.000 1.000
#> GSM613737     1   0.000     0.9724 1.000 0.000
#> GSM613738     1   0.000     0.9724 1.000 0.000
#> GSM613739     1   0.000     0.9724 1.000 0.000
#> GSM613740     2   0.000     0.9836 0.000 1.000
#> GSM613741     1   0.000     0.9724 1.000 0.000
#> GSM613742     1   0.000     0.9724 1.000 0.000
#> GSM613743     2   0.000     0.9836 0.000 1.000
#> GSM613744     2   0.000     0.9836 0.000 1.000
#> GSM613745     1   0.988     0.2413 0.564 0.436
#> GSM613746     2   0.000     0.9836 0.000 1.000
#> GSM613747     1   0.000     0.9724 1.000 0.000
#> GSM613748     2   0.000     0.9836 0.000 1.000
#> GSM613749     1   0.000     0.9724 1.000 0.000
#> GSM613750     2   0.000     0.9836 0.000 1.000
#> GSM613751     2   0.000     0.9836 0.000 1.000
#> GSM613752     2   0.000     0.9836 0.000 1.000
#> GSM613753     2   0.000     0.9836 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
#> GSM613638     3  0.4504     0.7103 0.196 0.000 0.804
#> GSM613639     1  0.1411     0.9270 0.964 0.036 0.000
#> GSM613640     3  0.1411     0.8545 0.000 0.036 0.964
#> GSM613641     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613642     3  0.1529     0.8676 0.000 0.040 0.960
#> GSM613643     1  0.1289     0.9285 0.968 0.000 0.032
#> GSM613644     3  0.7905     0.2847 0.376 0.064 0.560
#> GSM613645     1  0.2261     0.9026 0.932 0.068 0.000
#> GSM613646     2  0.4934     0.6957 0.156 0.820 0.024
#> GSM613647     3  0.2200     0.8407 0.004 0.056 0.940
#> GSM613648     3  0.2066     0.8746 0.000 0.060 0.940
#> GSM613649     3  0.2165     0.8741 0.000 0.064 0.936
#> GSM613650     1  0.0983     0.9396 0.980 0.016 0.004
#> GSM613651     1  0.6307     0.0290 0.512 0.000 0.488
#> GSM613652     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613653     1  0.6274     0.2550 0.544 0.456 0.000
#> GSM613654     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613655     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613656     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613657     3  0.2537     0.8683 0.000 0.080 0.920
#> GSM613658     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613659     2  0.1031     0.8619 0.000 0.976 0.024
#> GSM613660     2  0.4346     0.8601 0.000 0.816 0.184
#> GSM613661     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613662     2  0.2261     0.8823 0.000 0.932 0.068
#> GSM613663     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613664     2  0.2261     0.8823 0.000 0.932 0.068
#> GSM613665     2  0.4121     0.8706 0.000 0.832 0.168
#> GSM613666     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613667     1  0.2261     0.9026 0.932 0.068 0.000
#> GSM613668     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613669     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613670     2  0.0237     0.8480 0.000 0.996 0.004
#> GSM613671     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613672     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613673     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613674     2  0.4121     0.8706 0.000 0.832 0.168
#> GSM613675     2  0.2261     0.8823 0.000 0.932 0.068
#> GSM613676     2  0.4750     0.8273 0.000 0.784 0.216
#> GSM613677     3  0.5810     0.4561 0.000 0.336 0.664
#> GSM613678     2  0.2165     0.7979 0.064 0.936 0.000
#> GSM613679     2  0.4121     0.8706 0.000 0.832 0.168
#> GSM613680     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613681     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613682     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613683     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613684     2  0.4796     0.8192 0.000 0.780 0.220
#> GSM613685     2  0.4121     0.8706 0.000 0.832 0.168
#> GSM613686     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613687     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613688     2  0.4121     0.8706 0.000 0.832 0.168
#> GSM613689     3  0.2448     0.8702 0.000 0.076 0.924
#> GSM613690     3  0.0424     0.8727 0.000 0.008 0.992
#> GSM613691     2  0.2261     0.8823 0.000 0.932 0.068
#> GSM613692     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613693     2  0.4178     0.8682 0.000 0.828 0.172
#> GSM613694     1  0.2096     0.9059 0.944 0.004 0.052
#> GSM613695     3  0.0000     0.8701 0.000 0.000 1.000
#> GSM613696     2  0.3116     0.8807 0.000 0.892 0.108
#> GSM613697     1  0.5706     0.5225 0.680 0.000 0.320
#> GSM613698     3  0.5585     0.7515 0.092 0.096 0.812
#> GSM613699     3  0.9342     0.3207 0.180 0.336 0.484
#> GSM613700     2  0.4121     0.8704 0.000 0.832 0.168
#> GSM613701     2  0.4233     0.7560 0.160 0.836 0.004
#> GSM613702     2  0.1860     0.8771 0.000 0.948 0.052
#> GSM613703     1  0.1031     0.9355 0.976 0.024 0.000
#> GSM613704     2  0.2261     0.8823 0.000 0.932 0.068
#> GSM613705     3  0.2261     0.8265 0.068 0.000 0.932
#> GSM613706     1  0.0848     0.9421 0.984 0.008 0.008
#> GSM613707     2  0.4121     0.8706 0.000 0.832 0.168
#> GSM613708     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613709     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613710     3  0.3551     0.8231 0.000 0.132 0.868
#> GSM613711     3  0.2261     0.8732 0.000 0.068 0.932
#> GSM613712     3  0.4291     0.7258 0.180 0.000 0.820
#> GSM613713     3  0.3192     0.8461 0.000 0.112 0.888
#> GSM613714     3  0.0000     0.8701 0.000 0.000 1.000
#> GSM613715     3  0.0424     0.8727 0.000 0.008 0.992
#> GSM613716     3  0.4399     0.8014 0.000 0.188 0.812
#> GSM613717     3  0.2537     0.8683 0.000 0.080 0.920
#> GSM613718     3  0.2066     0.8746 0.000 0.060 0.940
#> GSM613719     1  0.7458     0.5776 0.672 0.084 0.244
#> GSM613720     3  0.4346     0.8042 0.000 0.184 0.816
#> GSM613721     2  0.1643     0.8730 0.000 0.956 0.044
#> GSM613722     2  0.4346     0.8601 0.000 0.816 0.184
#> GSM613723     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613724     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613725     2  0.4346     0.8601 0.000 0.816 0.184
#> GSM613726     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613727     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613728     2  0.2261     0.8823 0.000 0.932 0.068
#> GSM613729     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613730     2  0.1753     0.8752 0.000 0.952 0.048
#> GSM613731     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613732     3  0.2261     0.8732 0.000 0.068 0.932
#> GSM613733     3  0.3192     0.8440 0.000 0.112 0.888
#> GSM613734     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613735     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613736     3  0.2625     0.8670 0.000 0.084 0.916
#> GSM613737     3  0.5098     0.6539 0.248 0.000 0.752
#> GSM613738     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613739     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613740     3  0.2448     0.8703 0.000 0.076 0.924
#> GSM613741     2  0.6305    -0.0992 0.484 0.516 0.000
#> GSM613742     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613743     3  0.2537     0.8683 0.000 0.080 0.920
#> GSM613744     3  0.2261     0.8732 0.000 0.068 0.932
#> GSM613745     2  0.3482     0.7455 0.128 0.872 0.000
#> GSM613746     2  0.2261     0.8823 0.000 0.932 0.068
#> GSM613747     1  0.0000     0.9502 1.000 0.000 0.000
#> GSM613748     2  0.3340     0.8734 0.000 0.880 0.120
#> GSM613749     1  0.6095     0.3337 0.608 0.392 0.000
#> GSM613750     3  0.0424     0.8727 0.000 0.008 0.992
#> GSM613751     3  0.0424     0.8727 0.000 0.008 0.992
#> GSM613752     3  0.0424     0.8727 0.000 0.008 0.992
#> GSM613753     3  0.0000     0.8701 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
#> GSM613638     4  0.4877     0.6769 0.044 0.000 0.204 0.752
#> GSM613639     1  0.5880     0.4749 0.680 0.088 0.000 0.232
#> GSM613640     4  0.4584     0.4903 0.000 0.004 0.300 0.696
#> GSM613641     1  0.0524     0.7514 0.988 0.004 0.000 0.008
#> GSM613642     3  0.4829     0.7259 0.000 0.068 0.776 0.156
#> GSM613643     4  0.4730     0.2468 0.364 0.000 0.000 0.636
#> GSM613644     4  0.4519     0.6820 0.084 0.036 0.048 0.832
#> GSM613645     1  0.6187     0.4670 0.672 0.144 0.000 0.184
#> GSM613646     2  0.7778     0.1187 0.252 0.512 0.012 0.224
#> GSM613647     4  0.3311     0.6813 0.000 0.000 0.172 0.828
#> GSM613648     3  0.1767     0.8046 0.000 0.012 0.944 0.044
#> GSM613649     3  0.0804     0.8125 0.000 0.012 0.980 0.008
#> GSM613650     4  0.6313     0.1705 0.340 0.064 0.004 0.592
#> GSM613651     4  0.4467     0.6272 0.172 0.000 0.040 0.788
#> GSM613652     1  0.4955     0.2813 0.556 0.000 0.000 0.444
#> GSM613653     2  0.7869    -0.0362 0.348 0.420 0.004 0.228
#> GSM613654     1  0.4972     0.2528 0.544 0.000 0.000 0.456
#> GSM613655     1  0.0817     0.7540 0.976 0.000 0.000 0.024
#> GSM613656     1  0.4907     0.3292 0.580 0.000 0.000 0.420
#> GSM613657     3  0.0469     0.8119 0.000 0.012 0.988 0.000
#> GSM613658     1  0.0817     0.7540 0.976 0.000 0.000 0.024
#> GSM613659     2  0.2345     0.7193 0.000 0.900 0.100 0.000
#> GSM613660     2  0.4761     0.6542 0.000 0.664 0.332 0.004
#> GSM613661     1  0.0188     0.7533 0.996 0.004 0.000 0.000
#> GSM613662     2  0.2973     0.7274 0.000 0.856 0.144 0.000
#> GSM613663     1  0.0000     0.7539 1.000 0.000 0.000 0.000
#> GSM613664     2  0.2760     0.7262 0.000 0.872 0.128 0.000
#> GSM613665     2  0.4720     0.6619 0.000 0.672 0.324 0.004
#> GSM613666     1  0.0188     0.7533 0.996 0.004 0.000 0.000
#> GSM613667     1  0.4740     0.5986 0.788 0.132 0.000 0.080
#> GSM613668     1  0.0817     0.7540 0.976 0.000 0.000 0.024
#> GSM613669     1  0.0188     0.7533 0.996 0.004 0.000 0.000
#> GSM613670     2  0.1004     0.6891 0.000 0.972 0.024 0.004
#> GSM613671     1  0.0188     0.7533 0.996 0.004 0.000 0.000
#> GSM613672     1  0.0817     0.7540 0.976 0.000 0.000 0.024
#> GSM613673     1  0.0817     0.7540 0.976 0.000 0.000 0.024
#> GSM613674     2  0.4741     0.6593 0.000 0.668 0.328 0.004
#> GSM613675     2  0.3123     0.7265 0.000 0.844 0.156 0.000
#> GSM613676     3  0.5165    -0.3184 0.000 0.484 0.512 0.004
#> GSM613677     3  0.4655     0.2780 0.000 0.312 0.684 0.004
#> GSM613678     2  0.2773     0.6101 0.072 0.900 0.000 0.028
#> GSM613679     2  0.4720     0.6619 0.000 0.672 0.324 0.004
#> GSM613680     1  0.0817     0.7540 0.976 0.000 0.000 0.024
#> GSM613681     1  0.0188     0.7533 0.996 0.004 0.000 0.000
#> GSM613682     1  0.0817     0.7540 0.976 0.000 0.000 0.024
#> GSM613683     1  0.1211     0.7489 0.960 0.000 0.000 0.040
#> GSM613684     3  0.4977    -0.2479 0.000 0.460 0.540 0.000
#> GSM613685     2  0.4741     0.6593 0.000 0.668 0.328 0.004
#> GSM613686     1  0.3071     0.6876 0.888 0.044 0.000 0.068
#> GSM613687     1  0.0336     0.7546 0.992 0.000 0.000 0.008
#> GSM613688     2  0.4655     0.6714 0.000 0.684 0.312 0.004
#> GSM613689     3  0.1209     0.8084 0.000 0.004 0.964 0.032
#> GSM613690     3  0.3311     0.7142 0.000 0.000 0.828 0.172
#> GSM613691     2  0.2973     0.7274 0.000 0.856 0.144 0.000
#> GSM613692     1  0.4941     0.2976 0.564 0.000 0.000 0.436
#> GSM613693     2  0.4989     0.3974 0.000 0.528 0.472 0.000
#> GSM613694     1  0.7305     0.0824 0.496 0.020 0.092 0.392
#> GSM613695     3  0.4406     0.5198 0.000 0.000 0.700 0.300
#> GSM613696     2  0.5607     0.2386 0.000 0.492 0.488 0.020
#> GSM613697     4  0.5152     0.4050 0.316 0.000 0.020 0.664
#> GSM613698     4  0.5662     0.6496 0.024 0.032 0.236 0.708
#> GSM613699     3  0.8076     0.4025 0.076 0.224 0.568 0.132
#> GSM613700     2  0.4770     0.6858 0.000 0.700 0.288 0.012
#> GSM613701     2  0.5136     0.6015 0.064 0.788 0.024 0.124
#> GSM613702     2  0.4542     0.6819 0.000 0.804 0.088 0.108
#> GSM613703     1  0.4992     0.5829 0.772 0.096 0.000 0.132
#> GSM613704     2  0.3157     0.7275 0.000 0.852 0.144 0.004
#> GSM613705     4  0.4164     0.5825 0.000 0.000 0.264 0.736
#> GSM613706     1  0.6597     0.2182 0.540 0.088 0.000 0.372
#> GSM613707     2  0.5004     0.5615 0.000 0.604 0.392 0.004
#> GSM613708     1  0.3448     0.6807 0.828 0.004 0.000 0.168
#> GSM613709     1  0.0376     0.7526 0.992 0.004 0.000 0.004
#> GSM613710     3  0.2654     0.7215 0.000 0.108 0.888 0.004
#> GSM613711     3  0.0524     0.8136 0.000 0.008 0.988 0.004
#> GSM613712     4  0.4599     0.6251 0.016 0.000 0.248 0.736
#> GSM613713     3  0.0817     0.8057 0.000 0.024 0.976 0.000
#> GSM613714     3  0.3764     0.6714 0.000 0.000 0.784 0.216
#> GSM613715     3  0.3400     0.7170 0.000 0.000 0.820 0.180
#> GSM613716     3  0.5111     0.6306 0.000 0.204 0.740 0.056
#> GSM613717     3  0.0804     0.8121 0.000 0.012 0.980 0.008
#> GSM613718     3  0.0336     0.8137 0.000 0.008 0.992 0.000
#> GSM613719     4  0.6225     0.4889 0.112 0.196 0.008 0.684
#> GSM613720     3  0.3196     0.7267 0.000 0.136 0.856 0.008
#> GSM613721     2  0.2908     0.6894 0.000 0.896 0.064 0.040
#> GSM613722     2  0.4877     0.6610 0.000 0.664 0.328 0.008
#> GSM613723     1  0.4941     0.2979 0.564 0.000 0.000 0.436
#> GSM613724     1  0.3074     0.6873 0.848 0.000 0.000 0.152
#> GSM613725     2  0.4857     0.6634 0.000 0.668 0.324 0.008
#> GSM613726     1  0.1576     0.7313 0.948 0.004 0.000 0.048
#> GSM613727     1  0.0336     0.7546 0.992 0.000 0.000 0.008
#> GSM613728     2  0.3448     0.7257 0.000 0.828 0.168 0.004
#> GSM613729     1  0.1398     0.7354 0.956 0.004 0.000 0.040
#> GSM613730     2  0.5555     0.6655 0.004 0.732 0.176 0.088
#> GSM613731     1  0.3801     0.6621 0.780 0.000 0.000 0.220
#> GSM613732     3  0.0336     0.8137 0.000 0.008 0.992 0.000
#> GSM613733     3  0.0779     0.8092 0.000 0.016 0.980 0.004
#> GSM613734     1  0.3610     0.6464 0.800 0.000 0.000 0.200
#> GSM613735     1  0.4925     0.3147 0.572 0.000 0.000 0.428
#> GSM613736     3  0.0469     0.8126 0.000 0.012 0.988 0.000
#> GSM613737     4  0.5954     0.6759 0.112 0.008 0.168 0.712
#> GSM613738     1  0.4933     0.3067 0.568 0.000 0.000 0.432
#> GSM613739     1  0.4941     0.2979 0.564 0.000 0.000 0.436
#> GSM613740     3  0.0336     0.8137 0.000 0.008 0.992 0.000
#> GSM613741     2  0.7401     0.0988 0.320 0.512 0.004 0.164
#> GSM613742     1  0.4933     0.3067 0.568 0.000 0.000 0.432
#> GSM613743     3  0.0336     0.8137 0.000 0.008 0.992 0.000
#> GSM613744     3  0.0336     0.8137 0.000 0.008 0.992 0.000
#> GSM613745     2  0.7741     0.2432 0.084 0.596 0.092 0.228
#> GSM613746     2  0.2973     0.7274 0.000 0.856 0.144 0.000
#> GSM613747     1  0.3486     0.6576 0.812 0.000 0.000 0.188
#> GSM613748     2  0.6049     0.6176 0.000 0.652 0.264 0.084
#> GSM613749     1  0.6845     0.3151 0.564 0.308 0.000 0.128
#> GSM613750     3  0.3266     0.7183 0.000 0.000 0.832 0.168
#> GSM613751     3  0.3266     0.7183 0.000 0.000 0.832 0.168
#> GSM613752     3  0.3266     0.7183 0.000 0.000 0.832 0.168
#> GSM613753     3  0.3444     0.6995 0.000 0.000 0.816 0.184

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     5  0.5380     0.6569 0.024 0.000 0.104 0.164 0.708
#> GSM613639     4  0.5026     0.5175 0.372 0.000 0.000 0.588 0.040
#> GSM613640     5  0.6100     0.4235 0.000 0.004 0.136 0.304 0.556
#> GSM613641     1  0.0963     0.7037 0.964 0.000 0.000 0.036 0.000
#> GSM613642     3  0.6658     0.5714 0.000 0.108 0.612 0.088 0.192
#> GSM613643     5  0.5572     0.5265 0.192 0.000 0.000 0.164 0.644
#> GSM613644     5  0.4847     0.6254 0.040 0.000 0.016 0.236 0.708
#> GSM613645     4  0.4717     0.4950 0.396 0.000 0.000 0.584 0.020
#> GSM613646     4  0.3406     0.5909 0.032 0.084 0.004 0.860 0.020
#> GSM613647     5  0.5104     0.6477 0.000 0.000 0.116 0.192 0.692
#> GSM613648     3  0.3894     0.8134 0.000 0.080 0.832 0.056 0.032
#> GSM613649     3  0.3095     0.8256 0.000 0.092 0.868 0.024 0.016
#> GSM613650     4  0.5532     0.4251 0.156 0.000 0.000 0.648 0.196
#> GSM613651     5  0.4480     0.5961 0.128 0.000 0.012 0.084 0.776
#> GSM613652     1  0.4658     0.3341 0.504 0.000 0.000 0.012 0.484
#> GSM613653     4  0.4144     0.6165 0.068 0.084 0.000 0.816 0.032
#> GSM613654     1  0.4747     0.3255 0.500 0.000 0.000 0.016 0.484
#> GSM613655     1  0.0000     0.7176 1.000 0.000 0.000 0.000 0.000
#> GSM613656     1  0.4283     0.3968 0.544 0.000 0.000 0.000 0.456
#> GSM613657     3  0.1965     0.8250 0.000 0.096 0.904 0.000 0.000
#> GSM613658     1  0.0162     0.7175 0.996 0.000 0.000 0.000 0.004
#> GSM613659     2  0.1626     0.7174 0.000 0.940 0.016 0.044 0.000
#> GSM613660     2  0.4143     0.7195 0.000 0.764 0.196 0.036 0.004
#> GSM613661     1  0.0771     0.7079 0.976 0.000 0.000 0.020 0.004
#> GSM613662     2  0.0807     0.7355 0.000 0.976 0.012 0.012 0.000
#> GSM613663     1  0.0404     0.7142 0.988 0.000 0.000 0.012 0.000
#> GSM613664     2  0.0613     0.7358 0.000 0.984 0.004 0.008 0.004
#> GSM613665     2  0.2886     0.7462 0.000 0.844 0.148 0.008 0.000
#> GSM613666     1  0.0510     0.7125 0.984 0.000 0.000 0.016 0.000
#> GSM613667     1  0.3730     0.2818 0.712 0.000 0.000 0.288 0.000
#> GSM613668     1  0.0000     0.7176 1.000 0.000 0.000 0.000 0.000
#> GSM613669     1  0.0510     0.7125 0.984 0.000 0.000 0.016 0.000
#> GSM613670     2  0.2424     0.6560 0.000 0.868 0.000 0.132 0.000
#> GSM613671     1  0.0510     0.7125 0.984 0.000 0.000 0.016 0.000
#> GSM613672     1  0.0000     0.7176 1.000 0.000 0.000 0.000 0.000
#> GSM613673     1  0.0000     0.7176 1.000 0.000 0.000 0.000 0.000
#> GSM613674     2  0.2865     0.7472 0.000 0.856 0.132 0.008 0.004
#> GSM613675     2  0.0992     0.7399 0.000 0.968 0.024 0.008 0.000
#> GSM613676     2  0.3480     0.6824 0.000 0.752 0.248 0.000 0.000
#> GSM613677     2  0.4886     0.1789 0.000 0.512 0.468 0.004 0.016
#> GSM613678     2  0.5867     0.2696 0.180 0.604 0.000 0.216 0.000
#> GSM613679     2  0.2865     0.7494 0.000 0.856 0.132 0.008 0.004
#> GSM613680     1  0.0000     0.7176 1.000 0.000 0.000 0.000 0.000
#> GSM613681     1  0.0510     0.7125 0.984 0.000 0.000 0.016 0.000
#> GSM613682     1  0.0000     0.7176 1.000 0.000 0.000 0.000 0.000
#> GSM613683     1  0.0609     0.7153 0.980 0.000 0.000 0.000 0.020
#> GSM613684     2  0.4299     0.5880 0.000 0.672 0.316 0.004 0.008
#> GSM613685     2  0.2865     0.7472 0.000 0.856 0.132 0.008 0.004
#> GSM613686     1  0.2674     0.5725 0.856 0.000 0.000 0.140 0.004
#> GSM613687     1  0.0290     0.7155 0.992 0.000 0.000 0.008 0.000
#> GSM613688     2  0.2179     0.7540 0.000 0.896 0.100 0.000 0.004
#> GSM613689     3  0.2674     0.8206 0.000 0.060 0.896 0.012 0.032
#> GSM613690     3  0.3369     0.7667 0.000 0.024 0.856 0.028 0.092
#> GSM613691     2  0.1386     0.7332 0.000 0.952 0.016 0.032 0.000
#> GSM613692     1  0.4304     0.3476 0.516 0.000 0.000 0.000 0.484
#> GSM613693     2  0.3336     0.6818 0.000 0.772 0.228 0.000 0.000
#> GSM613694     1  0.7506     0.1230 0.452 0.000 0.060 0.200 0.288
#> GSM613695     3  0.4576     0.5567 0.000 0.000 0.692 0.040 0.268
#> GSM613696     2  0.4572     0.6400 0.000 0.708 0.256 0.024 0.012
#> GSM613697     5  0.3934     0.4282 0.236 0.000 0.012 0.004 0.748
#> GSM613698     5  0.5254     0.5546 0.012 0.000 0.220 0.080 0.688
#> GSM613699     3  0.8898     0.1867 0.080 0.180 0.448 0.152 0.140
#> GSM613700     2  0.6005     0.6792 0.000 0.660 0.148 0.156 0.036
#> GSM613701     2  0.7454     0.2341 0.036 0.452 0.020 0.352 0.140
#> GSM613702     2  0.6305     0.2111 0.000 0.476 0.040 0.424 0.060
#> GSM613703     1  0.4547    -0.0651 0.588 0.000 0.000 0.400 0.012
#> GSM613704     2  0.1626     0.7317 0.000 0.940 0.016 0.044 0.000
#> GSM613705     5  0.5197     0.6082 0.000 0.000 0.116 0.204 0.680
#> GSM613706     4  0.6762     0.2987 0.160 0.020 0.008 0.552 0.260
#> GSM613707     2  0.3170     0.7327 0.000 0.828 0.160 0.008 0.004
#> GSM613708     1  0.4317     0.6115 0.764 0.000 0.000 0.076 0.160
#> GSM613709     1  0.0880     0.7082 0.968 0.000 0.000 0.032 0.000
#> GSM613710     3  0.4635     0.6598 0.000 0.220 0.728 0.040 0.012
#> GSM613711     3  0.2237     0.8294 0.000 0.084 0.904 0.004 0.008
#> GSM613712     5  0.5952     0.6335 0.032 0.000 0.192 0.120 0.656
#> GSM613713     3  0.2719     0.8079 0.000 0.144 0.852 0.000 0.004
#> GSM613714     3  0.4605     0.7352 0.000 0.028 0.780 0.080 0.112
#> GSM613715     3  0.4747     0.7523 0.000 0.044 0.776 0.072 0.108
#> GSM613716     3  0.6211     0.6494 0.000 0.196 0.644 0.104 0.056
#> GSM613717     3  0.3023     0.8240 0.000 0.096 0.868 0.028 0.008
#> GSM613718     3  0.2052     0.8310 0.000 0.080 0.912 0.004 0.004
#> GSM613719     4  0.4579     0.4572 0.032 0.012 0.004 0.740 0.212
#> GSM613720     3  0.4570     0.7254 0.000 0.236 0.720 0.036 0.008
#> GSM613721     2  0.4789     0.4673 0.000 0.668 0.036 0.292 0.004
#> GSM613722     2  0.6207     0.6655 0.000 0.636 0.180 0.148 0.036
#> GSM613723     1  0.4306     0.3460 0.508 0.000 0.000 0.000 0.492
#> GSM613724     1  0.3684     0.6053 0.720 0.000 0.000 0.000 0.280
#> GSM613725     2  0.6207     0.6655 0.000 0.636 0.180 0.148 0.036
#> GSM613726     1  0.3944     0.5290 0.768 0.000 0.000 0.200 0.032
#> GSM613727     1  0.0404     0.7166 0.988 0.000 0.000 0.000 0.012
#> GSM613728     2  0.4939     0.6765 0.000 0.740 0.092 0.152 0.016
#> GSM613729     1  0.2293     0.6583 0.900 0.000 0.000 0.084 0.016
#> GSM613730     2  0.6374     0.1884 0.000 0.460 0.076 0.432 0.032
#> GSM613731     1  0.6200     0.3650 0.568 0.000 0.004 0.180 0.248
#> GSM613732     3  0.1892     0.8295 0.000 0.080 0.916 0.004 0.000
#> GSM613733     3  0.3246     0.8004 0.000 0.120 0.848 0.024 0.008
#> GSM613734     1  0.3876     0.5742 0.684 0.000 0.000 0.000 0.316
#> GSM613735     1  0.4300     0.3737 0.524 0.000 0.000 0.000 0.476
#> GSM613736     3  0.2389     0.8258 0.000 0.116 0.880 0.004 0.000
#> GSM613737     5  0.7005     0.3929 0.100 0.000 0.160 0.156 0.584
#> GSM613738     1  0.4450     0.3490 0.508 0.000 0.000 0.004 0.488
#> GSM613739     1  0.4306     0.3460 0.508 0.000 0.000 0.000 0.492
#> GSM613740     3  0.1892     0.8303 0.000 0.080 0.916 0.004 0.000
#> GSM613741     4  0.5711     0.5956 0.072 0.116 0.000 0.708 0.104
#> GSM613742     1  0.4451     0.3412 0.504 0.000 0.000 0.004 0.492
#> GSM613743     3  0.2011     0.8276 0.000 0.088 0.908 0.004 0.000
#> GSM613744     3  0.1952     0.8284 0.000 0.084 0.912 0.004 0.000
#> GSM613745     4  0.5765     0.5489 0.020 0.144 0.020 0.704 0.112
#> GSM613746     2  0.1485     0.7353 0.000 0.948 0.020 0.032 0.000
#> GSM613747     1  0.3796     0.5894 0.700 0.000 0.000 0.000 0.300
#> GSM613748     2  0.7762     0.2204 0.000 0.380 0.176 0.360 0.084
#> GSM613749     4  0.5943     0.4833 0.376 0.040 0.000 0.544 0.040
#> GSM613750     3  0.3729     0.7101 0.000 0.012 0.824 0.040 0.124
#> GSM613751     3  0.3729     0.7101 0.000 0.012 0.824 0.040 0.124
#> GSM613752     3  0.3783     0.7144 0.000 0.016 0.824 0.040 0.120
#> GSM613753     3  0.3895     0.6978 0.000 0.012 0.812 0.044 0.132

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     5  0.5568  -0.053274 0.000 0.000 0.048 0.420 0.488 0.044
#> GSM613639     6  0.4818   0.523151 0.336 0.000 0.000 0.052 0.008 0.604
#> GSM613640     4  0.6007   0.323311 0.000 0.000 0.080 0.588 0.240 0.092
#> GSM613641     1  0.1444   0.805169 0.928 0.000 0.000 0.000 0.000 0.072
#> GSM613642     3  0.6791   0.173043 0.000 0.056 0.428 0.388 0.104 0.024
#> GSM613643     5  0.5707   0.325279 0.084 0.000 0.000 0.280 0.588 0.048
#> GSM613644     5  0.6072   0.090462 0.020 0.004 0.008 0.384 0.484 0.100
#> GSM613645     6  0.4601   0.454565 0.376 0.004 0.000 0.028 0.004 0.588
#> GSM613646     6  0.2635   0.591606 0.004 0.080 0.004 0.020 0.008 0.884
#> GSM613647     5  0.5643  -0.020285 0.000 0.000 0.036 0.412 0.488 0.064
#> GSM613648     3  0.3405   0.716933 0.000 0.032 0.844 0.084 0.008 0.032
#> GSM613649     3  0.2471   0.732638 0.000 0.032 0.900 0.044 0.004 0.020
#> GSM613650     6  0.5153   0.552932 0.128 0.000 0.000 0.068 0.100 0.704
#> GSM613651     5  0.3886   0.423182 0.056 0.000 0.000 0.164 0.772 0.008
#> GSM613652     5  0.3861   0.604915 0.316 0.000 0.000 0.008 0.672 0.004
#> GSM613653     6  0.2833   0.626173 0.048 0.048 0.000 0.028 0.000 0.876
#> GSM613654     5  0.3861   0.604915 0.316 0.000 0.000 0.008 0.672 0.004
#> GSM613655     1  0.0790   0.819028 0.968 0.000 0.000 0.000 0.032 0.000
#> GSM613656     5  0.3607   0.580604 0.348 0.000 0.000 0.000 0.652 0.000
#> GSM613657     3  0.1124   0.741254 0.000 0.036 0.956 0.008 0.000 0.000
#> GSM613658     1  0.1444   0.788457 0.928 0.000 0.000 0.000 0.072 0.000
#> GSM613659     2  0.2020   0.628166 0.000 0.920 0.020 0.020 0.000 0.040
#> GSM613660     2  0.4854   0.544215 0.000 0.636 0.264 0.100 0.000 0.000
#> GSM613661     1  0.0858   0.819003 0.968 0.000 0.000 0.004 0.000 0.028
#> GSM613662     2  0.1672   0.656695 0.000 0.932 0.048 0.004 0.000 0.016
#> GSM613663     1  0.0146   0.824491 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM613664     2  0.1434   0.655938 0.000 0.948 0.028 0.012 0.000 0.012
#> GSM613665     2  0.3602   0.648546 0.000 0.760 0.208 0.032 0.000 0.000
#> GSM613666     1  0.0363   0.824212 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM613667     1  0.3411   0.498058 0.756 0.004 0.000 0.008 0.000 0.232
#> GSM613668     1  0.0865   0.816972 0.964 0.000 0.000 0.000 0.036 0.000
#> GSM613669     1  0.0713   0.820312 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM613670     2  0.2357   0.591971 0.000 0.872 0.000 0.012 0.000 0.116
#> GSM613671     1  0.0713   0.820312 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM613672     1  0.0937   0.815061 0.960 0.000 0.000 0.000 0.040 0.000
#> GSM613673     1  0.0713   0.820460 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM613674     2  0.3730   0.657356 0.000 0.772 0.168 0.060 0.000 0.000
#> GSM613675     2  0.1655   0.659222 0.000 0.932 0.052 0.008 0.000 0.008
#> GSM613676     2  0.3917   0.607764 0.000 0.692 0.284 0.024 0.000 0.000
#> GSM613677     3  0.5162  -0.207772 0.000 0.468 0.476 0.032 0.012 0.012
#> GSM613678     2  0.5163   0.316498 0.200 0.652 0.000 0.012 0.000 0.136
#> GSM613679     2  0.3744   0.653236 0.000 0.764 0.184 0.052 0.000 0.000
#> GSM613680     1  0.0713   0.820460 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM613681     1  0.0547   0.822901 0.980 0.000 0.000 0.000 0.000 0.020
#> GSM613682     1  0.0713   0.820460 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM613683     1  0.1814   0.757528 0.900 0.000 0.000 0.000 0.100 0.000
#> GSM613684     2  0.4966   0.532879 0.000 0.652 0.256 0.076 0.000 0.016
#> GSM613685     2  0.3763   0.655951 0.000 0.768 0.172 0.060 0.000 0.000
#> GSM613686     1  0.2257   0.722632 0.876 0.000 0.000 0.008 0.000 0.116
#> GSM613687     1  0.0458   0.823198 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM613688     2  0.3275   0.667314 0.000 0.820 0.140 0.032 0.000 0.008
#> GSM613689     3  0.3123   0.708718 0.000 0.032 0.840 0.116 0.012 0.000
#> GSM613690     3  0.4042   0.675608 0.000 0.000 0.784 0.120 0.072 0.024
#> GSM613691     2  0.2257   0.651985 0.000 0.904 0.048 0.008 0.000 0.040
#> GSM613692     5  0.3938   0.600654 0.324 0.000 0.000 0.016 0.660 0.000
#> GSM613693     2  0.3965   0.626198 0.000 0.720 0.248 0.024 0.000 0.008
#> GSM613694     5  0.7604   0.229736 0.368 0.004 0.056 0.064 0.376 0.132
#> GSM613695     3  0.5630   0.529858 0.000 0.000 0.592 0.232 0.160 0.016
#> GSM613696     2  0.5956   0.519448 0.000 0.652 0.152 0.120 0.032 0.044
#> GSM613697     5  0.3062   0.574080 0.144 0.000 0.000 0.032 0.824 0.000
#> GSM613698     5  0.6131   0.209306 0.004 0.004 0.140 0.160 0.620 0.072
#> GSM613699     3  0.8880   0.100071 0.036 0.180 0.392 0.144 0.136 0.112
#> GSM613700     2  0.7205  -0.055557 0.000 0.356 0.208 0.336 0.000 0.100
#> GSM613701     4  0.7483   0.395054 0.028 0.244 0.016 0.448 0.044 0.220
#> GSM613702     4  0.7061   0.327470 0.000 0.320 0.064 0.388 0.004 0.224
#> GSM613703     1  0.3999  -0.234053 0.500 0.000 0.000 0.004 0.000 0.496
#> GSM613704     2  0.2772   0.639315 0.000 0.876 0.048 0.016 0.000 0.060
#> GSM613705     4  0.6049   0.226316 0.000 0.000 0.072 0.508 0.352 0.068
#> GSM613706     4  0.6456   0.237637 0.092 0.000 0.004 0.556 0.116 0.232
#> GSM613707     2  0.4032   0.646783 0.000 0.740 0.192 0.068 0.000 0.000
#> GSM613708     1  0.5265   0.352882 0.636 0.000 0.000 0.028 0.252 0.084
#> GSM613709     1  0.1531   0.808487 0.928 0.000 0.000 0.000 0.004 0.068
#> GSM613710     3  0.4364   0.559423 0.000 0.112 0.732 0.152 0.004 0.000
#> GSM613711     3  0.1053   0.744660 0.000 0.020 0.964 0.012 0.004 0.000
#> GSM613712     5  0.6535  -0.000357 0.016 0.000 0.120 0.324 0.496 0.044
#> GSM613713     3  0.2511   0.728672 0.000 0.064 0.880 0.056 0.000 0.000
#> GSM613714     3  0.5033   0.586410 0.000 0.016 0.692 0.208 0.064 0.020
#> GSM613715     3  0.4868   0.659520 0.000 0.012 0.724 0.172 0.052 0.040
#> GSM613716     3  0.6621   0.475312 0.000 0.220 0.568 0.108 0.024 0.080
#> GSM613717     3  0.2265   0.731967 0.000 0.040 0.908 0.040 0.004 0.008
#> GSM613718     3  0.0820   0.745217 0.000 0.016 0.972 0.012 0.000 0.000
#> GSM613719     6  0.3566   0.602354 0.040 0.004 0.008 0.044 0.060 0.844
#> GSM613720     3  0.4786   0.578818 0.000 0.236 0.684 0.016 0.004 0.060
#> GSM613721     2  0.4918   0.155264 0.000 0.536 0.004 0.044 0.004 0.412
#> GSM613722     2  0.6985  -0.038476 0.000 0.352 0.236 0.348 0.000 0.064
#> GSM613723     5  0.3636   0.601742 0.320 0.000 0.000 0.000 0.676 0.004
#> GSM613724     1  0.4107  -0.164320 0.540 0.000 0.000 0.004 0.452 0.004
#> GSM613725     4  0.6966  -0.124196 0.000 0.352 0.228 0.356 0.000 0.064
#> GSM613726     1  0.5211   0.531042 0.684 0.000 0.000 0.152 0.040 0.124
#> GSM613727     1  0.1410   0.816080 0.944 0.000 0.000 0.004 0.044 0.008
#> GSM613728     2  0.6185   0.228365 0.000 0.564 0.116 0.248 0.000 0.072
#> GSM613729     1  0.2443   0.779383 0.880 0.000 0.000 0.004 0.020 0.096
#> GSM613730     2  0.7583  -0.314156 0.000 0.332 0.100 0.304 0.012 0.252
#> GSM613731     1  0.7012  -0.167247 0.392 0.000 0.000 0.212 0.320 0.076
#> GSM613732     3  0.0717   0.744384 0.000 0.016 0.976 0.008 0.000 0.000
#> GSM613733     3  0.2672   0.697812 0.000 0.052 0.868 0.080 0.000 0.000
#> GSM613734     5  0.4098   0.381500 0.444 0.000 0.000 0.004 0.548 0.004
#> GSM613735     5  0.3820   0.588250 0.332 0.000 0.000 0.004 0.660 0.004
#> GSM613736     3  0.2263   0.734969 0.000 0.048 0.896 0.056 0.000 0.000
#> GSM613737     5  0.5735   0.387653 0.048 0.000 0.092 0.080 0.696 0.084
#> GSM613738     5  0.3878   0.599183 0.320 0.000 0.000 0.004 0.668 0.008
#> GSM613739     5  0.3636   0.601742 0.320 0.000 0.000 0.000 0.676 0.004
#> GSM613740     3  0.1480   0.743356 0.000 0.020 0.940 0.040 0.000 0.000
#> GSM613741     6  0.4334   0.586471 0.020 0.080 0.000 0.068 0.040 0.792
#> GSM613742     5  0.3878   0.599183 0.320 0.000 0.000 0.004 0.668 0.008
#> GSM613743     3  0.1341   0.742031 0.000 0.024 0.948 0.028 0.000 0.000
#> GSM613744     3  0.0603   0.744063 0.000 0.016 0.980 0.004 0.000 0.000
#> GSM613745     6  0.4901   0.498905 0.000 0.148 0.004 0.080 0.044 0.724
#> GSM613746     2  0.2152   0.650102 0.000 0.912 0.036 0.012 0.000 0.040
#> GSM613747     5  0.4128   0.263369 0.488 0.000 0.000 0.004 0.504 0.004
#> GSM613748     4  0.7477   0.403927 0.000 0.204 0.128 0.480 0.032 0.156
#> GSM613749     6  0.6725   0.304954 0.348 0.012 0.000 0.232 0.020 0.388
#> GSM613750     3  0.5858   0.585316 0.000 0.024 0.640 0.208 0.080 0.048
#> GSM613751     3  0.5858   0.585316 0.000 0.024 0.640 0.208 0.080 0.048
#> GSM613752     3  0.5858   0.585316 0.000 0.024 0.640 0.208 0.080 0.048
#> GSM613753     3  0.5903   0.581072 0.000 0.024 0.636 0.208 0.084 0.048

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 disease.state(p) k
#> CV:skmeans 113         2.02e-02 2
#> CV:skmeans 109         1.39e-02 3
#> CV:skmeans  87         1.60e-04 4
#> CV:skmeans  87         4.17e-07 5
#> CV:skmeans  80         1.89e-07 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 27425 rows and 116 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 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-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.510           0.627       0.843         0.4900 0.503   0.503
#> 3 3 0.386           0.649       0.808         0.1448 0.873   0.770
#> 4 4 0.538           0.681       0.853         0.2045 0.780   0.566
#> 5 5 0.575           0.621       0.807         0.1106 0.897   0.698
#> 6 6 0.604           0.567       0.756         0.0691 0.909   0.674

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
#> GSM613638     1  0.2043     0.3976 0.968 0.032
#> GSM613639     1  0.9661     0.8082 0.608 0.392
#> GSM613640     1  0.2236     0.3910 0.964 0.036
#> GSM613641     1  0.9552     0.8224 0.624 0.376
#> GSM613642     1  0.5059     0.2288 0.888 0.112
#> GSM613643     1  0.2043     0.3976 0.968 0.032
#> GSM613644     1  0.2043     0.3976 0.968 0.032
#> GSM613645     1  0.9608     0.8129 0.616 0.384
#> GSM613646     1  0.7376    -0.0842 0.792 0.208
#> GSM613647     1  0.2423     0.3839 0.960 0.040
#> GSM613648     2  0.9580     0.7632 0.380 0.620
#> GSM613649     2  0.9552     0.7644 0.376 0.624
#> GSM613650     1  0.7745     0.6513 0.772 0.228
#> GSM613651     1  0.2043     0.3976 0.968 0.032
#> GSM613652     1  0.9460     0.8192 0.636 0.364
#> GSM613653     1  0.9732     0.8121 0.596 0.404
#> GSM613654     1  0.9460     0.8192 0.636 0.364
#> GSM613655     1  0.9552     0.8224 0.624 0.376
#> GSM613656     1  0.9608     0.8200 0.616 0.384
#> GSM613657     2  0.9552     0.7644 0.376 0.624
#> GSM613658     1  0.9552     0.8224 0.624 0.376
#> GSM613659     2  0.3114     0.4288 0.056 0.944
#> GSM613660     2  0.9552     0.7644 0.376 0.624
#> GSM613661     1  0.9635     0.8198 0.612 0.388
#> GSM613662     2  0.3733     0.4078 0.072 0.928
#> GSM613663     1  0.9552     0.8224 0.624 0.376
#> GSM613664     2  0.3114     0.4288 0.056 0.944
#> GSM613665     2  0.0000     0.4963 0.000 1.000
#> GSM613666     1  0.9552     0.8224 0.624 0.376
#> GSM613667     1  0.9686     0.8165 0.604 0.396
#> GSM613668     1  0.9608     0.8200 0.616 0.384
#> GSM613669     1  0.9552     0.8224 0.624 0.376
#> GSM613670     2  0.4431     0.3678 0.092 0.908
#> GSM613671     1  0.9552     0.8224 0.624 0.376
#> GSM613672     1  0.9552     0.8224 0.624 0.376
#> GSM613673     1  0.9608     0.8200 0.616 0.384
#> GSM613674     2  0.6531     0.6501 0.168 0.832
#> GSM613675     2  0.2603     0.4597 0.044 0.956
#> GSM613676     2  0.0376     0.4998 0.004 0.996
#> GSM613677     1  0.9996     0.7317 0.512 0.488
#> GSM613678     1  0.9795     0.8061 0.584 0.416
#> GSM613679     2  0.6973     0.6630 0.188 0.812
#> GSM613680     1  0.9552     0.8224 0.624 0.376
#> GSM613681     1  0.9552     0.8224 0.624 0.376
#> GSM613682     1  0.9608     0.8200 0.616 0.384
#> GSM613683     1  0.9552     0.8224 0.624 0.376
#> GSM613684     2  0.9552     0.7644 0.376 0.624
#> GSM613685     2  0.9460     0.7606 0.364 0.636
#> GSM613686     1  0.9552     0.8224 0.624 0.376
#> GSM613687     1  0.9580     0.8214 0.620 0.380
#> GSM613688     2  0.3879     0.3932 0.076 0.924
#> GSM613689     2  0.9944     0.6947 0.456 0.544
#> GSM613690     2  0.9358    -0.4732 0.352 0.648
#> GSM613691     2  0.3431     0.4160 0.064 0.936
#> GSM613692     1  0.9608     0.8200 0.616 0.384
#> GSM613693     2  0.9522     0.7635 0.372 0.628
#> GSM613694     1  0.2948     0.4036 0.948 0.052
#> GSM613695     1  0.6623     0.0836 0.828 0.172
#> GSM613696     1  0.9866     0.7966 0.568 0.432
#> GSM613697     1  0.9795     0.8080 0.584 0.416
#> GSM613698     1  0.9795     0.8080 0.584 0.416
#> GSM613699     1  0.9833     0.8030 0.576 0.424
#> GSM613700     2  0.9795     0.7467 0.416 0.584
#> GSM613701     1  0.9686     0.8055 0.604 0.396
#> GSM613702     2  0.9909     0.7292 0.444 0.556
#> GSM613703     1  0.9552     0.8224 0.624 0.376
#> GSM613704     2  0.2778     0.4725 0.048 0.952
#> GSM613705     1  0.2043     0.3976 0.968 0.032
#> GSM613706     1  0.8713     0.7205 0.708 0.292
#> GSM613707     2  0.9608     0.7616 0.384 0.616
#> GSM613708     1  0.9552     0.8224 0.624 0.376
#> GSM613709     1  0.9552     0.8224 0.624 0.376
#> GSM613710     2  0.9580     0.7632 0.380 0.620
#> GSM613711     2  0.9552     0.7644 0.376 0.624
#> GSM613712     1  0.2043     0.3976 0.968 0.032
#> GSM613713     2  0.9552     0.7644 0.376 0.624
#> GSM613714     2  0.9552     0.7644 0.376 0.624
#> GSM613715     2  0.9922     0.7165 0.448 0.552
#> GSM613716     2  0.9608     0.7616 0.384 0.616
#> GSM613717     2  0.9552     0.7644 0.376 0.624
#> GSM613718     2  0.9552     0.7644 0.376 0.624
#> GSM613719     1  0.4298     0.4739 0.912 0.088
#> GSM613720     2  0.9608     0.7616 0.384 0.616
#> GSM613721     1  1.0000    -0.6697 0.504 0.496
#> GSM613722     2  0.3431     0.4216 0.064 0.936
#> GSM613723     1  0.9608     0.8200 0.616 0.384
#> GSM613724     1  0.9552     0.8224 0.624 0.376
#> GSM613725     2  0.9552     0.7644 0.376 0.624
#> GSM613726     1  0.9661     0.8184 0.608 0.392
#> GSM613727     1  0.9552     0.8224 0.624 0.376
#> GSM613728     2  0.9358     0.7532 0.352 0.648
#> GSM613729     1  0.9552     0.8224 0.624 0.376
#> GSM613730     2  0.4298     0.4157 0.088 0.912
#> GSM613731     1  0.9686     0.8055 0.604 0.396
#> GSM613732     2  0.9552     0.7644 0.376 0.624
#> GSM613733     2  0.9552     0.7644 0.376 0.624
#> GSM613734     1  0.9552     0.8224 0.624 0.376
#> GSM613735     1  0.9552     0.8224 0.624 0.376
#> GSM613736     2  0.9552     0.7644 0.376 0.624
#> GSM613737     1  0.7815    -0.1305 0.768 0.232
#> GSM613738     1  0.9552     0.8224 0.624 0.376
#> GSM613739     1  0.9522     0.8218 0.628 0.372
#> GSM613740     2  0.9552     0.7644 0.376 0.624
#> GSM613741     2  0.8661    -0.2519 0.288 0.712
#> GSM613742     1  0.9686     0.8181 0.604 0.396
#> GSM613743     2  0.9552     0.7644 0.376 0.624
#> GSM613744     2  0.9552     0.7644 0.376 0.624
#> GSM613745     2  0.5294     0.4106 0.120 0.880
#> GSM613746     2  0.0000     0.4963 0.000 1.000
#> GSM613747     1  0.9552     0.8224 0.624 0.376
#> GSM613748     2  0.6973     0.1620 0.188 0.812
#> GSM613749     2  0.9881    -0.6092 0.436 0.564
#> GSM613750     2  0.9552     0.7644 0.376 0.624
#> GSM613751     2  0.9552     0.7644 0.376 0.624
#> GSM613752     2  0.9552     0.7644 0.376 0.624
#> GSM613753     1  0.8443    -0.2321 0.728 0.272

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM613638     1  0.9098      0.460 0.540 0.276 0.184
#> GSM613639     1  0.5285      0.742 0.824 0.064 0.112
#> GSM613640     1  0.9122      0.453 0.536 0.280 0.184
#> GSM613641     1  0.1289      0.787 0.968 0.000 0.032
#> GSM613642     1  0.9113      0.437 0.528 0.300 0.172
#> GSM613643     1  0.9098      0.460 0.540 0.276 0.184
#> GSM613644     1  0.9098      0.460 0.540 0.276 0.184
#> GSM613645     1  0.5883      0.722 0.796 0.092 0.112
#> GSM613646     2  0.8966      0.359 0.256 0.560 0.184
#> GSM613647     1  0.9089      0.446 0.536 0.288 0.176
#> GSM613648     2  0.5173      0.611 0.036 0.816 0.148
#> GSM613649     2  0.0747      0.693 0.000 0.984 0.016
#> GSM613650     1  0.7348      0.645 0.704 0.176 0.120
#> GSM613651     1  0.8889      0.478 0.560 0.276 0.164
#> GSM613652     1  0.5263      0.750 0.828 0.088 0.084
#> GSM613653     1  0.4235      0.735 0.824 0.000 0.176
#> GSM613654     1  0.5426      0.745 0.820 0.092 0.088
#> GSM613655     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613656     1  0.2860      0.777 0.912 0.004 0.084
#> GSM613657     2  0.0000      0.691 0.000 1.000 0.000
#> GSM613658     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613659     2  0.9054      0.362 0.404 0.460 0.136
#> GSM613660     2  0.0237      0.692 0.000 0.996 0.004
#> GSM613661     1  0.0892      0.784 0.980 0.000 0.020
#> GSM613662     2  0.6247      0.470 0.376 0.620 0.004
#> GSM613663     1  0.1529      0.785 0.960 0.000 0.040
#> GSM613664     2  0.7032      0.478 0.368 0.604 0.028
#> GSM613665     2  0.5363      0.518 0.276 0.724 0.000
#> GSM613666     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613667     1  0.1411      0.781 0.964 0.000 0.036
#> GSM613668     1  0.2860      0.777 0.912 0.004 0.084
#> GSM613669     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613670     2  0.7508      0.434 0.416 0.544 0.040
#> GSM613671     1  0.2448      0.780 0.924 0.000 0.076
#> GSM613672     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613673     1  0.2772      0.785 0.916 0.004 0.080
#> GSM613674     2  0.4452      0.590 0.192 0.808 0.000
#> GSM613675     2  0.5763      0.549 0.276 0.716 0.008
#> GSM613676     2  0.4605      0.588 0.204 0.796 0.000
#> GSM613677     1  0.6662      0.708 0.752 0.120 0.128
#> GSM613678     1  0.4748      0.741 0.832 0.024 0.144
#> GSM613679     2  0.3213      0.664 0.092 0.900 0.008
#> GSM613680     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613681     1  0.2537      0.779 0.920 0.000 0.080
#> GSM613682     1  0.3030      0.779 0.904 0.004 0.092
#> GSM613683     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613684     2  0.1267      0.692 0.004 0.972 0.024
#> GSM613685     2  0.2165      0.662 0.064 0.936 0.000
#> GSM613686     1  0.0592      0.785 0.988 0.000 0.012
#> GSM613687     1  0.2200      0.784 0.940 0.004 0.056
#> GSM613688     2  0.8509      0.416 0.392 0.512 0.096
#> GSM613689     2  0.8508      0.434 0.232 0.608 0.160
#> GSM613690     1  0.6902      0.704 0.736 0.116 0.148
#> GSM613691     2  0.7228      0.483 0.364 0.600 0.036
#> GSM613692     1  0.2860      0.777 0.912 0.004 0.084
#> GSM613693     2  0.0592      0.690 0.012 0.988 0.000
#> GSM613694     1  0.7495      0.617 0.692 0.188 0.120
#> GSM613695     1  0.9374      0.344 0.464 0.360 0.176
#> GSM613696     1  0.4802      0.737 0.824 0.020 0.156
#> GSM613697     1  0.3573      0.759 0.876 0.004 0.120
#> GSM613698     1  0.4521      0.733 0.816 0.004 0.180
#> GSM613699     1  0.4802      0.737 0.824 0.020 0.156
#> GSM613700     2  0.4094      0.650 0.028 0.872 0.100
#> GSM613701     1  0.6911      0.679 0.728 0.092 0.180
#> GSM613702     2  0.7108      0.550 0.100 0.716 0.184
#> GSM613703     1  0.0424      0.785 0.992 0.000 0.008
#> GSM613704     2  0.5109      0.603 0.212 0.780 0.008
#> GSM613705     1  0.9098      0.460 0.540 0.276 0.184
#> GSM613706     1  0.7917      0.622 0.664 0.152 0.184
#> GSM613707     2  0.0237      0.692 0.004 0.996 0.000
#> GSM613708     1  0.0592      0.785 0.988 0.000 0.012
#> GSM613709     1  0.0892      0.786 0.980 0.000 0.020
#> GSM613710     2  0.0747      0.693 0.000 0.984 0.016
#> GSM613711     2  0.0592      0.692 0.000 0.988 0.012
#> GSM613712     1  0.9018      0.468 0.548 0.276 0.176
#> GSM613713     2  0.0000      0.691 0.000 1.000 0.000
#> GSM613714     2  0.6297      0.568 0.060 0.756 0.184
#> GSM613715     2  0.7797      0.433 0.188 0.672 0.140
#> GSM613716     2  0.3780      0.668 0.044 0.892 0.064
#> GSM613717     2  0.0747      0.693 0.000 0.984 0.016
#> GSM613718     2  0.1031      0.690 0.000 0.976 0.024
#> GSM613719     1  0.8321      0.549 0.620 0.240 0.140
#> GSM613720     2  0.0475      0.693 0.004 0.992 0.004
#> GSM613721     2  0.6168      0.594 0.096 0.780 0.124
#> GSM613722     2  0.6047      0.507 0.312 0.680 0.008
#> GSM613723     1  0.2945      0.778 0.908 0.004 0.088
#> GSM613724     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613725     2  0.1031      0.691 0.000 0.976 0.024
#> GSM613726     1  0.3412      0.759 0.876 0.000 0.124
#> GSM613727     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613728     2  0.0829      0.695 0.012 0.984 0.004
#> GSM613729     1  0.0424      0.785 0.992 0.000 0.008
#> GSM613730     2  0.7416      0.560 0.276 0.656 0.068
#> GSM613731     1  0.6962      0.676 0.724 0.092 0.184
#> GSM613732     2  0.0000      0.691 0.000 1.000 0.000
#> GSM613733     2  0.0592      0.692 0.000 0.988 0.012
#> GSM613734     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613735     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613736     2  0.1163      0.692 0.000 0.972 0.028
#> GSM613737     2  0.9098      0.336 0.276 0.540 0.184
#> GSM613738     1  0.1643      0.788 0.956 0.000 0.044
#> GSM613739     1  0.3637      0.781 0.892 0.024 0.084
#> GSM613740     2  0.0000      0.691 0.000 1.000 0.000
#> GSM613741     1  0.7674     -0.332 0.484 0.472 0.044
#> GSM613742     1  0.2945      0.784 0.908 0.004 0.088
#> GSM613743     2  0.0000      0.691 0.000 1.000 0.000
#> GSM613744     2  0.0592      0.692 0.000 0.988 0.012
#> GSM613745     2  0.8082      0.528 0.296 0.608 0.096
#> GSM613746     2  0.5363      0.518 0.276 0.724 0.000
#> GSM613747     1  0.2625      0.778 0.916 0.000 0.084
#> GSM613748     2  0.9250      0.450 0.304 0.512 0.184
#> GSM613749     1  0.8869      0.206 0.560 0.280 0.160
#> GSM613750     3  0.5138      0.883 0.000 0.252 0.748
#> GSM613751     3  0.5291      0.884 0.000 0.268 0.732
#> GSM613752     3  0.5291      0.884 0.000 0.268 0.732
#> GSM613753     3  0.3713      0.713 0.032 0.076 0.892

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3 p4
#> GSM613638     3  0.0000    0.76155 0.000 0.000 1.000  0
#> GSM613639     1  0.4543    0.63509 0.676 0.000 0.324  0
#> GSM613640     3  0.0000    0.76155 0.000 0.000 1.000  0
#> GSM613641     1  0.2011    0.84778 0.920 0.000 0.080  0
#> GSM613642     3  0.0336    0.76245 0.000 0.008 0.992  0
#> GSM613643     3  0.1302    0.74718 0.044 0.000 0.956  0
#> GSM613644     3  0.0000    0.76155 0.000 0.000 1.000  0
#> GSM613645     3  0.4817    0.20058 0.388 0.000 0.612  0
#> GSM613646     3  0.1356    0.76118 0.008 0.032 0.960  0
#> GSM613647     3  0.0336    0.76135 0.008 0.000 0.992  0
#> GSM613648     3  0.2647    0.71112 0.000 0.120 0.880  0
#> GSM613649     3  0.4948    0.14628 0.000 0.440 0.560  0
#> GSM613650     3  0.4955   -0.03632 0.444 0.000 0.556  0
#> GSM613651     3  0.1302    0.75300 0.044 0.000 0.956  0
#> GSM613652     1  0.3528    0.69526 0.808 0.000 0.192  0
#> GSM613653     1  0.4250    0.70477 0.724 0.000 0.276  0
#> GSM613654     1  0.4697    0.35641 0.644 0.000 0.356  0
#> GSM613655     1  0.0000    0.85081 1.000 0.000 0.000  0
#> GSM613656     1  0.0000    0.85081 1.000 0.000 0.000  0
#> GSM613657     2  0.4164    0.52626 0.000 0.736 0.264  0
#> GSM613658     1  0.0000    0.85081 1.000 0.000 0.000  0
#> GSM613659     2  0.7122    0.24588 0.144 0.516 0.340  0
#> GSM613660     2  0.0000    0.78078 0.000 1.000 0.000  0
#> GSM613661     1  0.2589    0.83560 0.884 0.000 0.116  0
#> GSM613662     2  0.3577    0.66518 0.156 0.832 0.012  0
#> GSM613663     1  0.1474    0.85411 0.948 0.000 0.052  0
#> GSM613664     2  0.1398    0.76960 0.004 0.956 0.040  0
#> GSM613665     2  0.0000    0.78078 0.000 1.000 0.000  0
#> GSM613666     1  0.0336    0.85305 0.992 0.000 0.008  0
#> GSM613667     1  0.2973    0.81891 0.856 0.000 0.144  0
#> GSM613668     1  0.0336    0.85119 0.992 0.008 0.000  0
#> GSM613669     1  0.0336    0.85305 0.992 0.000 0.008  0
#> GSM613670     2  0.5293    0.62126 0.152 0.748 0.100  0
#> GSM613671     1  0.0707    0.85503 0.980 0.000 0.020  0
#> GSM613672     1  0.0336    0.85305 0.992 0.000 0.008  0
#> GSM613673     1  0.1256    0.85610 0.964 0.008 0.028  0
#> GSM613674     2  0.0000    0.78078 0.000 1.000 0.000  0
#> GSM613675     2  0.0524    0.78008 0.004 0.988 0.008  0
#> GSM613676     2  0.0188    0.78154 0.000 0.996 0.004  0
#> GSM613677     1  0.5678    0.68346 0.716 0.112 0.172  0
#> GSM613678     1  0.4391    0.72667 0.740 0.008 0.252  0
#> GSM613679     2  0.0000    0.78078 0.000 1.000 0.000  0
#> GSM613680     1  0.0336    0.85305 0.992 0.000 0.008  0
#> GSM613681     1  0.0469    0.85399 0.988 0.000 0.012  0
#> GSM613682     1  0.0804    0.85267 0.980 0.012 0.008  0
#> GSM613683     1  0.0000    0.85081 1.000 0.000 0.000  0
#> GSM613684     2  0.0817    0.77951 0.000 0.976 0.024  0
#> GSM613685     2  0.0000    0.78078 0.000 1.000 0.000  0
#> GSM613686     1  0.2530    0.83686 0.888 0.000 0.112  0
#> GSM613687     1  0.1256    0.85611 0.964 0.008 0.028  0
#> GSM613688     2  0.5222    0.63968 0.112 0.756 0.132  0
#> GSM613689     3  0.6957    0.34742 0.164 0.260 0.576  0
#> GSM613690     1  0.6668    0.29777 0.528 0.092 0.380  0
#> GSM613691     2  0.6974    0.14392 0.396 0.488 0.116  0
#> GSM613692     1  0.0000    0.85081 1.000 0.000 0.000  0
#> GSM613693     2  0.0000    0.78078 0.000 1.000 0.000  0
#> GSM613694     1  0.5250    0.37128 0.552 0.008 0.440  0
#> GSM613695     3  0.0817    0.75940 0.000 0.024 0.976  0
#> GSM613696     1  0.4690    0.70992 0.724 0.016 0.260  0
#> GSM613697     1  0.4011    0.76520 0.784 0.008 0.208  0
#> GSM613698     1  0.4647    0.68113 0.704 0.008 0.288  0
#> GSM613699     1  0.4635    0.70276 0.720 0.012 0.268  0
#> GSM613700     2  0.2868    0.72367 0.000 0.864 0.136  0
#> GSM613701     3  0.4331    0.46244 0.288 0.000 0.712  0
#> GSM613702     3  0.1474    0.75535 0.000 0.052 0.948  0
#> GSM613703     1  0.2408    0.83986 0.896 0.000 0.104  0
#> GSM613704     2  0.0336    0.78019 0.000 0.992 0.008  0
#> GSM613705     3  0.0000    0.76155 0.000 0.000 1.000  0
#> GSM613706     3  0.3105    0.66892 0.140 0.004 0.856  0
#> GSM613707     2  0.0817    0.78109 0.000 0.976 0.024  0
#> GSM613708     1  0.2760    0.83574 0.872 0.000 0.128  0
#> GSM613709     1  0.2216    0.84383 0.908 0.000 0.092  0
#> GSM613710     3  0.4994    0.01676 0.000 0.480 0.520  0
#> GSM613711     2  0.5000    0.00883 0.000 0.504 0.496  0
#> GSM613712     3  0.0817    0.75959 0.024 0.000 0.976  0
#> GSM613713     2  0.3311    0.70195 0.000 0.828 0.172  0
#> GSM613714     3  0.1211    0.75527 0.000 0.040 0.960  0
#> GSM613715     3  0.1867    0.73814 0.000 0.072 0.928  0
#> GSM613716     3  0.3610    0.61684 0.000 0.200 0.800  0
#> GSM613717     3  0.4955    0.13182 0.000 0.444 0.556  0
#> GSM613718     3  0.4713    0.34273 0.000 0.360 0.640  0
#> GSM613719     1  0.4972    0.36137 0.544 0.000 0.456  0
#> GSM613720     2  0.3942    0.64237 0.000 0.764 0.236  0
#> GSM613721     2  0.6362    0.32721 0.072 0.560 0.368  0
#> GSM613722     2  0.0707    0.78160 0.000 0.980 0.020  0
#> GSM613723     1  0.1302    0.84073 0.956 0.000 0.044  0
#> GSM613724     1  0.0000    0.85081 1.000 0.000 0.000  0
#> GSM613725     2  0.0921    0.77939 0.000 0.972 0.028  0
#> GSM613726     1  0.3801    0.76562 0.780 0.000 0.220  0
#> GSM613727     1  0.0188    0.85070 0.996 0.000 0.004  0
#> GSM613728     2  0.0469    0.78025 0.000 0.988 0.012  0
#> GSM613729     1  0.2469    0.84001 0.892 0.000 0.108  0
#> GSM613730     2  0.7184    0.24964 0.160 0.524 0.316  0
#> GSM613731     3  0.3311    0.63298 0.172 0.000 0.828  0
#> GSM613732     2  0.3356    0.70027 0.000 0.824 0.176  0
#> GSM613733     2  0.0336    0.78160 0.000 0.992 0.008  0
#> GSM613734     1  0.0188    0.85070 0.996 0.000 0.004  0
#> GSM613735     1  0.0188    0.85070 0.996 0.000 0.004  0
#> GSM613736     2  0.4790    0.42448 0.000 0.620 0.380  0
#> GSM613737     3  0.1557    0.74794 0.000 0.056 0.944  0
#> GSM613738     1  0.2469    0.84044 0.892 0.000 0.108  0
#> GSM613739     1  0.2149    0.82416 0.912 0.000 0.088  0
#> GSM613740     2  0.2469    0.74821 0.000 0.892 0.108  0
#> GSM613741     2  0.7279   -0.00631 0.408 0.444 0.148  0
#> GSM613742     1  0.1716    0.84440 0.936 0.000 0.064  0
#> GSM613743     2  0.3528    0.68405 0.000 0.808 0.192  0
#> GSM613744     2  0.2281    0.75617 0.000 0.904 0.096  0
#> GSM613745     2  0.7381    0.19394 0.180 0.492 0.328  0
#> GSM613746     2  0.0000    0.78078 0.000 1.000 0.000  0
#> GSM613747     1  0.0188    0.85070 0.996 0.000 0.004  0
#> GSM613748     3  0.5339    0.63394 0.156 0.100 0.744  0
#> GSM613749     1  0.7806    0.11957 0.392 0.356 0.252  0
#> GSM613750     4  0.0000    1.00000 0.000 0.000 0.000  1
#> GSM613751     4  0.0000    1.00000 0.000 0.000 0.000  1
#> GSM613752     4  0.0000    1.00000 0.000 0.000 0.000  1
#> GSM613753     4  0.0000    1.00000 0.000 0.000 0.000  1

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM613638     3  0.2438    0.72056 0.040 0.000 0.900  0 0.060
#> GSM613639     1  0.2230    0.67294 0.884 0.000 0.116  0 0.000
#> GSM613640     3  0.2592    0.72247 0.052 0.000 0.892  0 0.056
#> GSM613641     1  0.3109    0.66274 0.800 0.000 0.000  0 0.200
#> GSM613642     3  0.2644    0.71051 0.008 0.036 0.896  0 0.060
#> GSM613643     3  0.3102    0.71022 0.084 0.000 0.860  0 0.056
#> GSM613644     3  0.2661    0.72198 0.056 0.000 0.888  0 0.056
#> GSM613645     1  0.5174    0.16674 0.604 0.000 0.340  0 0.056
#> GSM613646     3  0.4734    0.62980 0.228 0.020 0.720  0 0.032
#> GSM613647     3  0.2592    0.72247 0.052 0.000 0.892  0 0.056
#> GSM613648     3  0.1124    0.69492 0.000 0.036 0.960  0 0.004
#> GSM613649     3  0.4264    0.25152 0.000 0.376 0.620  0 0.004
#> GSM613650     1  0.4558    0.30420 0.652 0.000 0.324  0 0.024
#> GSM613651     3  0.6388    0.44228 0.244 0.000 0.516  0 0.240
#> GSM613652     5  0.0912    0.82920 0.016 0.000 0.012  0 0.972
#> GSM613653     1  0.0671    0.72640 0.980 0.000 0.016  0 0.004
#> GSM613654     5  0.0912    0.82920 0.016 0.000 0.012  0 0.972
#> GSM613655     1  0.4060    0.50759 0.640 0.000 0.000  0 0.360
#> GSM613656     5  0.2329    0.80697 0.124 0.000 0.000  0 0.876
#> GSM613657     2  0.4235    0.44927 0.000 0.656 0.336  0 0.008
#> GSM613658     1  0.4030    0.51924 0.648 0.000 0.000  0 0.352
#> GSM613659     2  0.6581    0.18125 0.140 0.488 0.356  0 0.016
#> GSM613660     2  0.0290    0.77646 0.000 0.992 0.008  0 0.000
#> GSM613661     1  0.0162    0.72906 0.996 0.000 0.004  0 0.000
#> GSM613662     2  0.3210    0.67363 0.152 0.832 0.008  0 0.008
#> GSM613663     1  0.1197    0.73063 0.952 0.000 0.000  0 0.048
#> GSM613664     2  0.1106    0.76983 0.000 0.964 0.024  0 0.012
#> GSM613665     2  0.0703    0.77524 0.000 0.976 0.024  0 0.000
#> GSM613666     1  0.3452    0.65388 0.756 0.000 0.000  0 0.244
#> GSM613667     1  0.0162    0.73007 0.996 0.000 0.000  0 0.004
#> GSM613668     1  0.3741    0.63723 0.732 0.000 0.004  0 0.264
#> GSM613669     1  0.3242    0.67220 0.784 0.000 0.000  0 0.216
#> GSM613670     2  0.4467    0.60095 0.240 0.724 0.024  0 0.012
#> GSM613671     1  0.2773    0.70241 0.836 0.000 0.000  0 0.164
#> GSM613672     1  0.3534    0.64599 0.744 0.000 0.000  0 0.256
#> GSM613673     1  0.3630    0.68716 0.780 0.000 0.016  0 0.204
#> GSM613674     2  0.0693    0.77349 0.000 0.980 0.008  0 0.012
#> GSM613675     2  0.0162    0.77633 0.000 0.996 0.004  0 0.000
#> GSM613676     2  0.0404    0.77789 0.000 0.988 0.012  0 0.000
#> GSM613677     1  0.4424    0.63469 0.728 0.048 0.224  0 0.000
#> GSM613678     1  0.0865    0.72836 0.972 0.000 0.024  0 0.004
#> GSM613679     2  0.0324    0.77668 0.000 0.992 0.004  0 0.004
#> GSM613680     1  0.3534    0.64626 0.744 0.000 0.000  0 0.256
#> GSM613681     1  0.3366    0.66358 0.768 0.000 0.000  0 0.232
#> GSM613682     1  0.4082    0.65813 0.740 0.008 0.012  0 0.240
#> GSM613683     1  0.3857    0.57951 0.688 0.000 0.000  0 0.312
#> GSM613684     2  0.1579    0.77041 0.000 0.944 0.032  0 0.024
#> GSM613685     2  0.0693    0.77349 0.000 0.980 0.008  0 0.012
#> GSM613686     1  0.0162    0.73007 0.996 0.000 0.000  0 0.004
#> GSM613687     1  0.2439    0.71676 0.876 0.000 0.004  0 0.120
#> GSM613688     2  0.5104    0.61635 0.112 0.728 0.144  0 0.016
#> GSM613689     3  0.5850    0.45548 0.140 0.184 0.656  0 0.020
#> GSM613690     1  0.5349    0.26592 0.516 0.036 0.440  0 0.008
#> GSM613691     2  0.5793   -0.00364 0.456 0.464 0.076  0 0.004
#> GSM613692     5  0.3003    0.75343 0.188 0.000 0.000  0 0.812
#> GSM613693     2  0.0963    0.77420 0.000 0.964 0.036  0 0.000
#> GSM613694     1  0.4283    0.39987 0.644 0.000 0.348  0 0.008
#> GSM613695     3  0.2036    0.71397 0.000 0.024 0.920  0 0.056
#> GSM613696     1  0.3663    0.69572 0.840 0.060 0.084  0 0.016
#> GSM613697     1  0.4836    0.20674 0.612 0.000 0.032  0 0.356
#> GSM613698     1  0.4683    0.56715 0.732 0.000 0.092  0 0.176
#> GSM613699     1  0.4253    0.65930 0.756 0.032 0.204  0 0.008
#> GSM613700     2  0.3010    0.70413 0.000 0.824 0.172  0 0.004
#> GSM613701     3  0.4430    0.12556 0.456 0.000 0.540  0 0.004
#> GSM613702     3  0.2599    0.72391 0.044 0.028 0.904  0 0.024
#> GSM613703     1  0.0000    0.72939 1.000 0.000 0.000  0 0.000
#> GSM613704     2  0.0703    0.77524 0.000 0.976 0.024  0 0.000
#> GSM613705     3  0.2592    0.72247 0.052 0.000 0.892  0 0.056
#> GSM613706     3  0.4434    0.60635 0.208 0.000 0.736  0 0.056
#> GSM613707     2  0.1469    0.77690 0.000 0.948 0.036  0 0.016
#> GSM613708     1  0.1444    0.72108 0.948 0.000 0.012  0 0.040
#> GSM613709     1  0.0510    0.73193 0.984 0.000 0.000  0 0.016
#> GSM613710     3  0.4367    0.14702 0.000 0.416 0.580  0 0.004
#> GSM613711     3  0.4582    0.12834 0.000 0.416 0.572  0 0.012
#> GSM613712     3  0.3779    0.69314 0.144 0.000 0.804  0 0.052
#> GSM613713     2  0.4167    0.63234 0.000 0.724 0.252  0 0.024
#> GSM613714     3  0.0865    0.71237 0.000 0.004 0.972  0 0.024
#> GSM613715     3  0.1412    0.69486 0.004 0.036 0.952  0 0.008
#> GSM613716     3  0.2833    0.64083 0.004 0.140 0.852  0 0.004
#> GSM613717     3  0.4392    0.23795 0.000 0.380 0.612  0 0.008
#> GSM613718     3  0.4063    0.43860 0.000 0.280 0.708  0 0.012
#> GSM613719     1  0.3452    0.53170 0.756 0.000 0.244  0 0.000
#> GSM613720     2  0.4165    0.54829 0.000 0.672 0.320  0 0.008
#> GSM613721     2  0.6791    0.42474 0.240 0.552 0.172  0 0.036
#> GSM613722     2  0.1310    0.77447 0.000 0.956 0.024  0 0.020
#> GSM613723     5  0.0912    0.82813 0.012 0.000 0.016  0 0.972
#> GSM613724     1  0.3876    0.56607 0.684 0.000 0.000  0 0.316
#> GSM613725     2  0.1800    0.77576 0.000 0.932 0.048  0 0.020
#> GSM613726     1  0.0960    0.72642 0.972 0.004 0.016  0 0.008
#> GSM613727     5  0.4291   -0.09144 0.464 0.000 0.000  0 0.536
#> GSM613728     2  0.1444    0.77154 0.000 0.948 0.040  0 0.012
#> GSM613729     1  0.0290    0.72975 0.992 0.000 0.000  0 0.008
#> GSM613730     2  0.6862    0.13991 0.276 0.452 0.264  0 0.008
#> GSM613731     3  0.4793    0.55494 0.236 0.004 0.704  0 0.056
#> GSM613732     2  0.4206    0.59933 0.000 0.696 0.288  0 0.016
#> GSM613733     2  0.1942    0.76478 0.000 0.920 0.068  0 0.012
#> GSM613734     5  0.1671    0.83726 0.076 0.000 0.000  0 0.924
#> GSM613735     5  0.1792    0.83421 0.084 0.000 0.000  0 0.916
#> GSM613736     2  0.4979    0.19302 0.000 0.492 0.480  0 0.028
#> GSM613737     3  0.5389    0.31218 0.036 0.012 0.552  0 0.400
#> GSM613738     5  0.2921    0.71139 0.124 0.000 0.020  0 0.856
#> GSM613739     5  0.1310    0.82396 0.024 0.000 0.020  0 0.956
#> GSM613740     2  0.3462    0.68602 0.000 0.792 0.196  0 0.012
#> GSM613741     1  0.4749    0.29899 0.628 0.348 0.008  0 0.016
#> GSM613742     5  0.1830    0.81663 0.040 0.000 0.028  0 0.932
#> GSM613743     2  0.3942    0.62029 0.000 0.728 0.260  0 0.012
#> GSM613744     2  0.3530    0.69039 0.000 0.784 0.204  0 0.012
#> GSM613745     2  0.7207    0.17008 0.344 0.428 0.196  0 0.032
#> GSM613746     2  0.0898    0.77458 0.000 0.972 0.008  0 0.020
#> GSM613747     5  0.1732    0.83650 0.080 0.000 0.000  0 0.920
#> GSM613748     3  0.5527    0.54240 0.228 0.076 0.672  0 0.024
#> GSM613749     1  0.5051    0.36792 0.640 0.316 0.032  0 0.012
#> GSM613750     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000
#> GSM613751     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000
#> GSM613752     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000
#> GSM613753     4  0.0000    1.00000 0.000 0.000 0.000  1 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
#> GSM613638     4  0.2416     0.6527 0.000 0.000 0.156 0.844 0.000  0
#> GSM613639     1  0.3819     0.4887 0.672 0.000 0.012 0.316 0.000  0
#> GSM613640     4  0.2531     0.6647 0.012 0.000 0.132 0.856 0.000  0
#> GSM613641     1  0.5352     0.5332 0.620 0.000 0.008 0.168 0.204  0
#> GSM613642     4  0.4017     0.6271 0.012 0.056 0.168 0.764 0.000  0
#> GSM613643     4  0.0692     0.6730 0.004 0.000 0.020 0.976 0.000  0
#> GSM613644     4  0.0632     0.6664 0.024 0.000 0.000 0.976 0.000  0
#> GSM613645     4  0.4093     0.2171 0.404 0.000 0.012 0.584 0.000  0
#> GSM613646     4  0.3946     0.5222 0.228 0.000 0.016 0.736 0.020  0
#> GSM613647     4  0.3134     0.6470 0.024 0.000 0.168 0.808 0.000  0
#> GSM613648     4  0.3198     0.5754 0.000 0.000 0.260 0.740 0.000  0
#> GSM613649     3  0.5350     0.3790 0.000 0.140 0.564 0.296 0.000  0
#> GSM613650     1  0.4084     0.3197 0.588 0.000 0.012 0.400 0.000  0
#> GSM613651     4  0.4909     0.4794 0.236 0.000 0.012 0.664 0.088  0
#> GSM613652     5  0.0632     0.8748 0.000 0.000 0.000 0.024 0.976  0
#> GSM613653     1  0.4114     0.6005 0.732 0.000 0.072 0.196 0.000  0
#> GSM613654     5  0.0632     0.8748 0.000 0.000 0.000 0.024 0.976  0
#> GSM613655     1  0.3769     0.4466 0.640 0.000 0.004 0.000 0.356  0
#> GSM613656     5  0.1765     0.8283 0.096 0.000 0.000 0.000 0.904  0
#> GSM613657     3  0.4153     0.2681 0.000 0.340 0.636 0.024 0.000  0
#> GSM613658     1  0.3975     0.3946 0.600 0.000 0.008 0.000 0.392  0
#> GSM613659     2  0.5781     0.3005 0.016 0.568 0.092 0.308 0.016  0
#> GSM613660     2  0.3073     0.6752 0.000 0.824 0.152 0.016 0.008  0
#> GSM613661     1  0.0914     0.6750 0.968 0.000 0.016 0.016 0.000  0
#> GSM613662     2  0.1863     0.7174 0.044 0.920 0.036 0.000 0.000  0
#> GSM613663     1  0.1141     0.6716 0.948 0.000 0.000 0.000 0.052  0
#> GSM613664     2  0.0146     0.7177 0.000 0.996 0.000 0.004 0.000  0
#> GSM613665     2  0.2553     0.6904 0.000 0.848 0.144 0.000 0.008  0
#> GSM613666     1  0.3323     0.5909 0.752 0.000 0.008 0.000 0.240  0
#> GSM613667     1  0.0260     0.6752 0.992 0.000 0.008 0.000 0.000  0
#> GSM613668     1  0.3445     0.5750 0.732 0.000 0.008 0.000 0.260  0
#> GSM613669     1  0.3190     0.6047 0.772 0.000 0.008 0.000 0.220  0
#> GSM613670     2  0.3355     0.6535 0.076 0.836 0.016 0.072 0.000  0
#> GSM613671     1  0.2743     0.6391 0.828 0.000 0.008 0.000 0.164  0
#> GSM613672     1  0.3314     0.5817 0.740 0.000 0.004 0.000 0.256  0
#> GSM613673     1  0.3359     0.6191 0.784 0.000 0.012 0.008 0.196  0
#> GSM613674     2  0.0865     0.7214 0.000 0.964 0.036 0.000 0.000  0
#> GSM613675     2  0.1757     0.7148 0.000 0.916 0.076 0.000 0.008  0
#> GSM613676     2  0.2416     0.6788 0.000 0.844 0.156 0.000 0.000  0
#> GSM613677     1  0.5081     0.4912 0.636 0.040 0.044 0.280 0.000  0
#> GSM613678     1  0.1086     0.6770 0.964 0.012 0.012 0.012 0.000  0
#> GSM613679     2  0.2003     0.6986 0.000 0.884 0.116 0.000 0.000  0
#> GSM613680     1  0.3398     0.5832 0.740 0.000 0.008 0.000 0.252  0
#> GSM613681     1  0.3271     0.5975 0.760 0.000 0.008 0.000 0.232  0
#> GSM613682     1  0.4171     0.5815 0.716 0.040 0.008 0.000 0.236  0
#> GSM613683     1  0.3672     0.5204 0.688 0.000 0.008 0.000 0.304  0
#> GSM613684     2  0.3168     0.6175 0.000 0.792 0.192 0.000 0.016  0
#> GSM613685     2  0.0713     0.7206 0.000 0.972 0.028 0.000 0.000  0
#> GSM613686     1  0.0000     0.6754 1.000 0.000 0.000 0.000 0.000  0
#> GSM613687     1  0.2400     0.6564 0.872 0.000 0.008 0.004 0.116  0
#> GSM613688     2  0.3448     0.6397 0.000 0.828 0.092 0.064 0.016  0
#> GSM613689     3  0.5684     0.3047 0.004 0.124 0.580 0.276 0.016  0
#> GSM613690     3  0.6674     0.1517 0.304 0.016 0.432 0.232 0.016  0
#> GSM613691     2  0.6272     0.1649 0.372 0.464 0.132 0.016 0.016  0
#> GSM613692     5  0.2219     0.7821 0.136 0.000 0.000 0.000 0.864  0
#> GSM613693     2  0.2562     0.6788 0.000 0.828 0.172 0.000 0.000  0
#> GSM613694     1  0.5969     0.3518 0.560 0.008 0.260 0.156 0.016  0
#> GSM613695     4  0.3665     0.5774 0.000 0.000 0.252 0.728 0.020  0
#> GSM613696     1  0.6754     0.1590 0.472 0.336 0.108 0.068 0.016  0
#> GSM613697     1  0.5069     0.2884 0.588 0.000 0.040 0.028 0.344  0
#> GSM613698     1  0.5597     0.5142 0.652 0.000 0.104 0.068 0.176  0
#> GSM613699     1  0.6657     0.4533 0.564 0.120 0.096 0.204 0.016  0
#> GSM613700     2  0.5640     0.1874 0.000 0.516 0.128 0.348 0.008  0
#> GSM613701     4  0.3099     0.5698 0.176 0.000 0.008 0.808 0.008  0
#> GSM613702     4  0.0405     0.6671 0.004 0.000 0.000 0.988 0.008  0
#> GSM613703     1  0.2912     0.6312 0.816 0.000 0.012 0.172 0.000  0
#> GSM613704     2  0.4523     0.5918 0.000 0.724 0.144 0.124 0.008  0
#> GSM613705     4  0.3053     0.6465 0.020 0.000 0.168 0.812 0.000  0
#> GSM613706     4  0.0603     0.6662 0.000 0.000 0.004 0.980 0.016  0
#> GSM613707     2  0.1267     0.7126 0.000 0.940 0.060 0.000 0.000  0
#> GSM613708     1  0.3510     0.6257 0.772 0.000 0.016 0.204 0.008  0
#> GSM613709     1  0.3442     0.6373 0.796 0.000 0.016 0.172 0.016  0
#> GSM613710     3  0.5945     0.2011 0.000 0.220 0.420 0.360 0.000  0
#> GSM613711     3  0.3588     0.5454 0.000 0.044 0.776 0.180 0.000  0
#> GSM613712     4  0.2383     0.6345 0.096 0.000 0.024 0.880 0.000  0
#> GSM613713     3  0.3867     0.1696 0.000 0.488 0.512 0.000 0.000  0
#> GSM613714     4  0.2664     0.6318 0.000 0.000 0.184 0.816 0.000  0
#> GSM613715     4  0.3547     0.4819 0.000 0.000 0.332 0.668 0.000  0
#> GSM613716     4  0.5303     0.4172 0.000 0.136 0.260 0.600 0.004  0
#> GSM613717     3  0.5675     0.1102 0.000 0.156 0.444 0.400 0.000  0
#> GSM613718     3  0.3202     0.5453 0.000 0.024 0.800 0.176 0.000  0
#> GSM613719     1  0.5126     0.5015 0.636 0.000 0.100 0.252 0.012  0
#> GSM613720     3  0.4419     0.3442 0.000 0.384 0.584 0.032 0.000  0
#> GSM613721     2  0.7857     0.1181 0.192 0.384 0.188 0.216 0.020  0
#> GSM613722     2  0.2553     0.6855 0.000 0.848 0.144 0.000 0.008  0
#> GSM613723     5  0.0632     0.8748 0.000 0.000 0.000 0.024 0.976  0
#> GSM613724     1  0.3937     0.3663 0.572 0.000 0.004 0.000 0.424  0
#> GSM613725     2  0.4015     0.4064 0.000 0.656 0.328 0.008 0.008  0
#> GSM613726     1  0.2230     0.6689 0.892 0.000 0.024 0.084 0.000  0
#> GSM613727     5  0.4032     0.1166 0.420 0.000 0.008 0.000 0.572  0
#> GSM613728     2  0.3706     0.6311 0.000 0.780 0.172 0.040 0.008  0
#> GSM613729     1  0.3252     0.6468 0.828 0.000 0.012 0.128 0.032  0
#> GSM613730     4  0.6887     0.2417 0.144 0.216 0.112 0.520 0.008  0
#> GSM613731     4  0.2805     0.6040 0.160 0.000 0.000 0.828 0.012  0
#> GSM613732     3  0.0713     0.6032 0.000 0.028 0.972 0.000 0.000  0
#> GSM613733     3  0.3615     0.3475 0.000 0.292 0.700 0.000 0.008  0
#> GSM613734     5  0.0632     0.8782 0.024 0.000 0.000 0.000 0.976  0
#> GSM613735     5  0.0632     0.8782 0.024 0.000 0.000 0.000 0.976  0
#> GSM613736     3  0.3493     0.5430 0.000 0.228 0.756 0.008 0.008  0
#> GSM613737     4  0.6154     0.2424 0.020 0.000 0.168 0.460 0.352  0
#> GSM613738     5  0.2726     0.7465 0.112 0.000 0.000 0.032 0.856  0
#> GSM613739     5  0.1151     0.8691 0.012 0.000 0.000 0.032 0.956  0
#> GSM613740     3  0.2431     0.5886 0.000 0.132 0.860 0.000 0.008  0
#> GSM613741     1  0.6628     0.4746 0.588 0.092 0.116 0.176 0.028  0
#> GSM613742     5  0.1794     0.8611 0.036 0.000 0.000 0.040 0.924  0
#> GSM613743     3  0.2389     0.5909 0.000 0.128 0.864 0.000 0.008  0
#> GSM613744     3  0.1745     0.5886 0.000 0.068 0.920 0.000 0.012  0
#> GSM613745     4  0.7778    -0.0197 0.124 0.208 0.220 0.416 0.032  0
#> GSM613746     2  0.2948     0.6312 0.000 0.804 0.188 0.000 0.008  0
#> GSM613747     5  0.0777     0.8772 0.024 0.000 0.004 0.000 0.972  0
#> GSM613748     4  0.3447     0.5941 0.156 0.008 0.020 0.808 0.008  0
#> GSM613749     1  0.6202     0.5011 0.608 0.076 0.108 0.196 0.012  0
#> GSM613750     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM613751     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM613752     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1
#> GSM613753     6  0.0000     1.0000 0.000 0.000 0.000 0.000 0.000  1

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 disease.state(p) k
#> CV:pam 82         8.15e-03 2
#> CV:pam 93         1.80e-03 3
#> CV:pam 95         4.25e-07 4
#> CV:pam 92         4.46e-08 5
#> CV:pam 83         2.80e-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.


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 27425 rows and 116 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 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-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.945           0.934       0.973         0.1239 0.886   0.886
#> 3 3 0.207           0.593       0.808         2.4405 0.637   0.607
#> 4 4 0.423           0.586       0.803         0.4388 0.669   0.482
#> 5 5 0.615           0.746       0.812         0.1817 0.936   0.822
#> 6 6 0.811           0.852       0.916         0.0962 0.836   0.518

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
#> GSM613638     1  0.0000     0.9787 1.000 0.000
#> GSM613639     1  0.0000     0.9787 1.000 0.000
#> GSM613640     1  0.0000     0.9787 1.000 0.000
#> GSM613641     1  0.0000     0.9787 1.000 0.000
#> GSM613642     1  0.0000     0.9787 1.000 0.000
#> GSM613643     1  0.0000     0.9787 1.000 0.000
#> GSM613644     1  0.0000     0.9787 1.000 0.000
#> GSM613645     1  0.0000     0.9787 1.000 0.000
#> GSM613646     1  0.0000     0.9787 1.000 0.000
#> GSM613647     1  0.0000     0.9787 1.000 0.000
#> GSM613648     1  0.0000     0.9787 1.000 0.000
#> GSM613649     1  0.0000     0.9787 1.000 0.000
#> GSM613650     1  0.0000     0.9787 1.000 0.000
#> GSM613651     1  0.0000     0.9787 1.000 0.000
#> GSM613652     1  0.0000     0.9787 1.000 0.000
#> GSM613653     1  0.0000     0.9787 1.000 0.000
#> GSM613654     1  0.0000     0.9787 1.000 0.000
#> GSM613655     1  0.0000     0.9787 1.000 0.000
#> GSM613656     1  0.0000     0.9787 1.000 0.000
#> GSM613657     1  0.0938     0.9687 0.988 0.012
#> GSM613658     1  0.0000     0.9787 1.000 0.000
#> GSM613659     1  0.0000     0.9787 1.000 0.000
#> GSM613660     1  0.0672     0.9723 0.992 0.008
#> GSM613661     1  0.0000     0.9787 1.000 0.000
#> GSM613662     1  0.8267     0.5482 0.740 0.260
#> GSM613663     1  0.0000     0.9787 1.000 0.000
#> GSM613664     1  0.9732     0.0528 0.596 0.404
#> GSM613665     1  0.0000     0.9787 1.000 0.000
#> GSM613666     1  0.0000     0.9787 1.000 0.000
#> GSM613667     1  0.0000     0.9787 1.000 0.000
#> GSM613668     1  0.0000     0.9787 1.000 0.000
#> GSM613669     1  0.0000     0.9787 1.000 0.000
#> GSM613670     1  0.0000     0.9787 1.000 0.000
#> GSM613671     1  0.0000     0.9787 1.000 0.000
#> GSM613672     1  0.0000     0.9787 1.000 0.000
#> GSM613673     1  0.0000     0.9787 1.000 0.000
#> GSM613674     2  0.9881     0.4250 0.436 0.564
#> GSM613675     1  0.7950     0.6059 0.760 0.240
#> GSM613676     1  0.3114     0.9189 0.944 0.056
#> GSM613677     1  0.0000     0.9787 1.000 0.000
#> GSM613678     1  0.0000     0.9787 1.000 0.000
#> GSM613679     1  0.1633     0.9583 0.976 0.024
#> GSM613680     1  0.0000     0.9787 1.000 0.000
#> GSM613681     1  0.0000     0.9787 1.000 0.000
#> GSM613682     1  0.0000     0.9787 1.000 0.000
#> GSM613683     1  0.0000     0.9787 1.000 0.000
#> GSM613684     2  0.9044     0.6087 0.320 0.680
#> GSM613685     2  0.9933     0.3820 0.452 0.548
#> GSM613686     1  0.0000     0.9787 1.000 0.000
#> GSM613687     1  0.0000     0.9787 1.000 0.000
#> GSM613688     1  0.0000     0.9787 1.000 0.000
#> GSM613689     1  0.0000     0.9787 1.000 0.000
#> GSM613690     1  0.0000     0.9787 1.000 0.000
#> GSM613691     1  0.0000     0.9787 1.000 0.000
#> GSM613692     1  0.0000     0.9787 1.000 0.000
#> GSM613693     1  0.4298     0.8775 0.912 0.088
#> GSM613694     1  0.0000     0.9787 1.000 0.000
#> GSM613695     1  0.0000     0.9787 1.000 0.000
#> GSM613696     1  0.0000     0.9787 1.000 0.000
#> GSM613697     1  0.0000     0.9787 1.000 0.000
#> GSM613698     1  0.0000     0.9787 1.000 0.000
#> GSM613699     1  0.0000     0.9787 1.000 0.000
#> GSM613700     1  0.7528     0.6751 0.784 0.216
#> GSM613701     1  0.0000     0.9787 1.000 0.000
#> GSM613702     1  0.0000     0.9787 1.000 0.000
#> GSM613703     1  0.0000     0.9787 1.000 0.000
#> GSM613704     1  0.1414     0.9603 0.980 0.020
#> GSM613705     1  0.0000     0.9787 1.000 0.000
#> GSM613706     1  0.0000     0.9787 1.000 0.000
#> GSM613707     1  0.5737     0.8081 0.864 0.136
#> GSM613708     1  0.0000     0.9787 1.000 0.000
#> GSM613709     1  0.0000     0.9787 1.000 0.000
#> GSM613710     1  0.1184     0.9650 0.984 0.016
#> GSM613711     1  0.0672     0.9722 0.992 0.008
#> GSM613712     1  0.0000     0.9787 1.000 0.000
#> GSM613713     1  0.0376     0.9755 0.996 0.004
#> GSM613714     1  0.0000     0.9787 1.000 0.000
#> GSM613715     1  0.0000     0.9787 1.000 0.000
#> GSM613716     1  0.0000     0.9787 1.000 0.000
#> GSM613717     1  0.0000     0.9787 1.000 0.000
#> GSM613718     1  0.1843     0.9534 0.972 0.028
#> GSM613719     1  0.0000     0.9787 1.000 0.000
#> GSM613720     1  0.0000     0.9787 1.000 0.000
#> GSM613721     1  0.0000     0.9787 1.000 0.000
#> GSM613722     1  0.2043     0.9493 0.968 0.032
#> GSM613723     1  0.0000     0.9787 1.000 0.000
#> GSM613724     1  0.0000     0.9787 1.000 0.000
#> GSM613725     1  0.2778     0.9311 0.952 0.048
#> GSM613726     1  0.0000     0.9787 1.000 0.000
#> GSM613727     1  0.0000     0.9787 1.000 0.000
#> GSM613728     1  0.0000     0.9787 1.000 0.000
#> GSM613729     1  0.0000     0.9787 1.000 0.000
#> GSM613730     1  0.0000     0.9787 1.000 0.000
#> GSM613731     1  0.0000     0.9787 1.000 0.000
#> GSM613732     1  0.1843     0.9535 0.972 0.028
#> GSM613733     1  0.0938     0.9687 0.988 0.012
#> GSM613734     1  0.0000     0.9787 1.000 0.000
#> GSM613735     1  0.0000     0.9787 1.000 0.000
#> GSM613736     1  0.0000     0.9787 1.000 0.000
#> GSM613737     1  0.0000     0.9787 1.000 0.000
#> GSM613738     1  0.0000     0.9787 1.000 0.000
#> GSM613739     1  0.0000     0.9787 1.000 0.000
#> GSM613740     1  0.2236     0.9450 0.964 0.036
#> GSM613741     1  0.0000     0.9787 1.000 0.000
#> GSM613742     1  0.0000     0.9787 1.000 0.000
#> GSM613743     1  0.0938     0.9688 0.988 0.012
#> GSM613744     1  0.0000     0.9787 1.000 0.000
#> GSM613745     1  0.0000     0.9787 1.000 0.000
#> GSM613746     1  0.7056     0.7124 0.808 0.192
#> GSM613747     1  0.0000     0.9787 1.000 0.000
#> GSM613748     1  0.0000     0.9787 1.000 0.000
#> GSM613749     1  0.0000     0.9787 1.000 0.000
#> GSM613750     2  0.0000     0.7909 0.000 1.000
#> GSM613751     2  0.0000     0.7909 0.000 1.000
#> GSM613752     2  0.0000     0.7909 0.000 1.000
#> GSM613753     2  0.0000     0.7909 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
#> GSM613638     3  0.2711      0.706 0.088  0 0.912
#> GSM613639     3  0.6260      0.243 0.448  0 0.552
#> GSM613640     3  0.0592      0.728 0.012  0 0.988
#> GSM613641     1  0.5529      0.644 0.704  0 0.296
#> GSM613642     3  0.0424      0.727 0.008  0 0.992
#> GSM613643     3  0.4235      0.653 0.176  0 0.824
#> GSM613644     3  0.4291      0.666 0.180  0 0.820
#> GSM613645     3  0.6286      0.178 0.464  0 0.536
#> GSM613646     3  0.4842      0.684 0.224  0 0.776
#> GSM613647     3  0.1643      0.730 0.044  0 0.956
#> GSM613648     3  0.0000      0.724 0.000  0 1.000
#> GSM613649     3  0.0000      0.724 0.000  0 1.000
#> GSM613650     3  0.5497      0.505 0.292  0 0.708
#> GSM613651     3  0.2878      0.701 0.096  0 0.904
#> GSM613652     3  0.6260     -0.122 0.448  0 0.552
#> GSM613653     3  0.5650      0.605 0.312  0 0.688
#> GSM613654     3  0.6260     -0.122 0.448  0 0.552
#> GSM613655     1  0.4291      0.729 0.820  0 0.180
#> GSM613656     1  0.6286      0.339 0.536  0 0.464
#> GSM613657     3  0.0000      0.724 0.000  0 1.000
#> GSM613658     1  0.5733      0.538 0.676  0 0.324
#> GSM613659     3  0.5948      0.555 0.360  0 0.640
#> GSM613660     3  0.4750      0.631 0.216  0 0.784
#> GSM613661     1  0.5291      0.649 0.732  0 0.268
#> GSM613662     3  0.5988      0.550 0.368  0 0.632
#> GSM613663     1  0.1411      0.654 0.964  0 0.036
#> GSM613664     3  0.5988      0.550 0.368  0 0.632
#> GSM613665     3  0.4887      0.623 0.228  0 0.772
#> GSM613666     1  0.0424      0.627 0.992  0 0.008
#> GSM613667     1  0.3879      0.732 0.848  0 0.152
#> GSM613668     1  0.1411      0.654 0.964  0 0.036
#> GSM613669     1  0.3879      0.732 0.848  0 0.152
#> GSM613670     3  0.5948      0.555 0.360  0 0.640
#> GSM613671     1  0.1163      0.659 0.972  0 0.028
#> GSM613672     1  0.4121      0.732 0.832  0 0.168
#> GSM613673     1  0.1529      0.653 0.960  0 0.040
#> GSM613674     3  0.4974      0.623 0.236  0 0.764
#> GSM613675     3  0.5988      0.550 0.368  0 0.632
#> GSM613676     3  0.4654      0.637 0.208  0 0.792
#> GSM613677     3  0.4291      0.667 0.180  0 0.820
#> GSM613678     3  0.5948      0.555 0.360  0 0.640
#> GSM613679     3  0.4887      0.623 0.228  0 0.772
#> GSM613680     1  0.1411      0.654 0.964  0 0.036
#> GSM613681     1  0.0424      0.627 0.992  0 0.008
#> GSM613682     1  0.5785      0.531 0.668  0 0.332
#> GSM613683     1  0.5835      0.524 0.660  0 0.340
#> GSM613684     3  0.5497      0.612 0.292  0 0.708
#> GSM613685     3  0.4931      0.623 0.232  0 0.768
#> GSM613686     1  0.3879      0.732 0.848  0 0.152
#> GSM613687     1  0.1411      0.654 0.964  0 0.036
#> GSM613688     3  0.5835      0.573 0.340  0 0.660
#> GSM613689     3  0.0424      0.727 0.008  0 0.992
#> GSM613690     3  0.0424      0.727 0.008  0 0.992
#> GSM613691     3  0.5926      0.561 0.356  0 0.644
#> GSM613692     1  0.6225      0.408 0.568  0 0.432
#> GSM613693     3  0.5760      0.591 0.328  0 0.672
#> GSM613694     3  0.3551      0.698 0.132  0 0.868
#> GSM613695     3  0.0424      0.727 0.008  0 0.992
#> GSM613696     3  0.5621      0.604 0.308  0 0.692
#> GSM613697     3  0.3752      0.663 0.144  0 0.856
#> GSM613698     3  0.3192      0.715 0.112  0 0.888
#> GSM613699     3  0.2537      0.736 0.080  0 0.920
#> GSM613700     3  0.3038      0.714 0.104  0 0.896
#> GSM613701     3  0.4504      0.699 0.196  0 0.804
#> GSM613702     3  0.3551      0.722 0.132  0 0.868
#> GSM613703     1  0.4931      0.699 0.768  0 0.232
#> GSM613704     3  0.5216      0.664 0.260  0 0.740
#> GSM613705     3  0.0592      0.727 0.012  0 0.988
#> GSM613706     3  0.4002      0.709 0.160  0 0.840
#> GSM613707     3  0.5016      0.624 0.240  0 0.760
#> GSM613708     1  0.6286      0.273 0.536  0 0.464
#> GSM613709     1  0.5363      0.659 0.724  0 0.276
#> GSM613710     3  0.0000      0.724 0.000  0 1.000
#> GSM613711     3  0.0000      0.724 0.000  0 1.000
#> GSM613712     3  0.3267      0.713 0.116  0 0.884
#> GSM613713     3  0.0000      0.724 0.000  0 1.000
#> GSM613714     3  0.0424      0.727 0.008  0 0.992
#> GSM613715     3  0.0592      0.728 0.012  0 0.988
#> GSM613716     3  0.3941      0.705 0.156  0 0.844
#> GSM613717     3  0.0000      0.724 0.000  0 1.000
#> GSM613718     3  0.0000      0.724 0.000  0 1.000
#> GSM613719     3  0.4750      0.651 0.216  0 0.784
#> GSM613720     3  0.3879      0.706 0.152  0 0.848
#> GSM613721     3  0.5138      0.665 0.252  0 0.748
#> GSM613722     3  0.2959      0.716 0.100  0 0.900
#> GSM613723     3  0.6260     -0.122 0.448  0 0.552
#> GSM613724     1  0.6309      0.246 0.504  0 0.496
#> GSM613725     3  0.3038      0.714 0.104  0 0.896
#> GSM613726     3  0.6252      0.175 0.444  0 0.556
#> GSM613727     1  0.5529      0.653 0.704  0 0.296
#> GSM613728     3  0.4842      0.688 0.224  0 0.776
#> GSM613729     1  0.5363      0.659 0.724  0 0.276
#> GSM613730     3  0.4931      0.679 0.232  0 0.768
#> GSM613731     3  0.3941      0.689 0.156  0 0.844
#> GSM613732     3  0.0000      0.724 0.000  0 1.000
#> GSM613733     3  0.0000      0.724 0.000  0 1.000
#> GSM613734     3  0.6260     -0.122 0.448  0 0.552
#> GSM613735     3  0.6274     -0.142 0.456  0 0.544
#> GSM613736     3  0.0237      0.726 0.004  0 0.996
#> GSM613737     3  0.2537      0.707 0.080  0 0.920
#> GSM613738     3  0.6274     -0.142 0.456  0 0.544
#> GSM613739     3  0.6260     -0.122 0.448  0 0.552
#> GSM613740     3  0.0000      0.724 0.000  0 1.000
#> GSM613741     3  0.5363      0.647 0.276  0 0.724
#> GSM613742     3  0.6267     -0.132 0.452  0 0.548
#> GSM613743     3  0.0000      0.724 0.000  0 1.000
#> GSM613744     3  0.0000      0.724 0.000  0 1.000
#> GSM613745     3  0.4452      0.698 0.192  0 0.808
#> GSM613746     3  0.5835      0.590 0.340  0 0.660
#> GSM613747     3  0.6280     -0.151 0.460  0 0.540
#> GSM613748     3  0.2878      0.732 0.096  0 0.904
#> GSM613749     3  0.5465      0.617 0.288  0 0.712
#> GSM613750     2  0.0000      1.000 0.000  1 0.000
#> GSM613751     2  0.0000      1.000 0.000  1 0.000
#> GSM613752     2  0.0000      1.000 0.000  1 0.000
#> GSM613753     2  0.0000      1.000 0.000  1 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3 p4
#> GSM613638     3  0.3219     0.6553 0.164 0.000 0.836  0
#> GSM613639     3  0.7414     0.1406 0.320 0.188 0.492  0
#> GSM613640     3  0.0000     0.7864 0.000 0.000 1.000  0
#> GSM613641     1  0.6570     0.4624 0.580 0.100 0.320  0
#> GSM613642     3  0.0188     0.7863 0.000 0.004 0.996  0
#> GSM613643     3  0.4643     0.2937 0.344 0.000 0.656  0
#> GSM613644     3  0.4624     0.3085 0.340 0.000 0.660  0
#> GSM613645     1  0.7566     0.1935 0.416 0.192 0.392  0
#> GSM613646     3  0.6646     0.4806 0.172 0.204 0.624  0
#> GSM613647     3  0.0592     0.7825 0.016 0.000 0.984  0
#> GSM613648     3  0.0336     0.7861 0.000 0.008 0.992  0
#> GSM613649     3  0.0592     0.7846 0.000 0.016 0.984  0
#> GSM613650     3  0.6141     0.2862 0.300 0.076 0.624  0
#> GSM613651     3  0.3356     0.6402 0.176 0.000 0.824  0
#> GSM613652     1  0.5388     0.4084 0.532 0.012 0.456  0
#> GSM613653     3  0.7433     0.2051 0.288 0.208 0.504  0
#> GSM613654     1  0.5388     0.4084 0.532 0.012 0.456  0
#> GSM613655     1  0.0188     0.5549 0.996 0.004 0.000  0
#> GSM613656     1  0.5388     0.4084 0.532 0.012 0.456  0
#> GSM613657     3  0.0592     0.7846 0.000 0.016 0.984  0
#> GSM613658     1  0.1022     0.5414 0.968 0.032 0.000  0
#> GSM613659     2  0.0921     0.6836 0.000 0.972 0.028  0
#> GSM613660     2  0.4830     0.5117 0.000 0.608 0.392  0
#> GSM613661     1  0.0524     0.5580 0.988 0.004 0.008  0
#> GSM613662     2  0.2021     0.6829 0.040 0.936 0.024  0
#> GSM613663     1  0.0188     0.5549 0.996 0.004 0.000  0
#> GSM613664     2  0.2197     0.6801 0.048 0.928 0.024  0
#> GSM613665     2  0.4964     0.6575 0.032 0.724 0.244  0
#> GSM613666     1  0.3400     0.4639 0.820 0.180 0.000  0
#> GSM613667     1  0.3978     0.4593 0.796 0.192 0.012  0
#> GSM613668     1  0.0188     0.5549 0.996 0.004 0.000  0
#> GSM613669     1  0.3400     0.4638 0.820 0.180 0.000  0
#> GSM613670     2  0.3548     0.6696 0.068 0.864 0.068  0
#> GSM613671     1  0.3528     0.4532 0.808 0.192 0.000  0
#> GSM613672     1  0.0524     0.5604 0.988 0.004 0.008  0
#> GSM613673     1  0.0376     0.5548 0.992 0.004 0.004  0
#> GSM613674     2  0.3311     0.6935 0.000 0.828 0.172  0
#> GSM613675     2  0.0817     0.6846 0.000 0.976 0.024  0
#> GSM613676     2  0.3837     0.6579 0.000 0.776 0.224  0
#> GSM613677     3  0.2053     0.7574 0.004 0.072 0.924  0
#> GSM613678     2  0.4562     0.5365 0.208 0.764 0.028  0
#> GSM613679     2  0.6357     0.5089 0.068 0.544 0.388  0
#> GSM613680     1  0.0188     0.5549 0.996 0.004 0.000  0
#> GSM613681     1  0.2921     0.4915 0.860 0.140 0.000  0
#> GSM613682     1  0.0707     0.5455 0.980 0.020 0.000  0
#> GSM613683     1  0.0469     0.5546 0.988 0.012 0.000  0
#> GSM613684     2  0.2760     0.7070 0.000 0.872 0.128  0
#> GSM613685     2  0.3837     0.6579 0.000 0.776 0.224  0
#> GSM613686     1  0.3710     0.4521 0.804 0.192 0.004  0
#> GSM613687     1  0.0188     0.5549 0.996 0.004 0.000  0
#> GSM613688     2  0.1940     0.7049 0.000 0.924 0.076  0
#> GSM613689     3  0.0000     0.7864 0.000 0.000 1.000  0
#> GSM613690     3  0.0188     0.7863 0.000 0.004 0.996  0
#> GSM613691     2  0.5810     0.4671 0.064 0.660 0.276  0
#> GSM613692     1  0.5277     0.4005 0.532 0.008 0.460  0
#> GSM613693     2  0.0817     0.6846 0.000 0.976 0.024  0
#> GSM613694     3  0.0707     0.7818 0.020 0.000 0.980  0
#> GSM613695     3  0.0000     0.7864 0.000 0.000 1.000  0
#> GSM613696     2  0.4663     0.6507 0.012 0.716 0.272  0
#> GSM613697     3  0.5097    -0.0839 0.428 0.004 0.568  0
#> GSM613698     3  0.4193     0.4870 0.268 0.000 0.732  0
#> GSM613699     3  0.1661     0.7673 0.052 0.004 0.944  0
#> GSM613700     3  0.3761     0.7122 0.068 0.080 0.852  0
#> GSM613701     3  0.3052     0.7044 0.136 0.004 0.860  0
#> GSM613702     3  0.3052     0.7044 0.136 0.004 0.860  0
#> GSM613703     1  0.7318     0.4274 0.524 0.196 0.280  0
#> GSM613704     2  0.6452    -0.2198 0.068 0.468 0.464  0
#> GSM613705     3  0.0000     0.7864 0.000 0.000 1.000  0
#> GSM613706     3  0.3052     0.7044 0.136 0.004 0.860  0
#> GSM613707     2  0.3123     0.7006 0.000 0.844 0.156  0
#> GSM613708     1  0.5143     0.4827 0.628 0.012 0.360  0
#> GSM613709     1  0.6052     0.4858 0.616 0.064 0.320  0
#> GSM613710     3  0.0592     0.7846 0.000 0.016 0.984  0
#> GSM613711     3  0.0592     0.7846 0.000 0.016 0.984  0
#> GSM613712     3  0.3688     0.5960 0.208 0.000 0.792  0
#> GSM613713     3  0.0921     0.7841 0.000 0.028 0.972  0
#> GSM613714     3  0.0000     0.7864 0.000 0.000 1.000  0
#> GSM613715     3  0.0188     0.7863 0.000 0.004 0.996  0
#> GSM613716     3  0.4072     0.6274 0.000 0.252 0.748  0
#> GSM613717     3  0.0592     0.7846 0.000 0.016 0.984  0
#> GSM613718     3  0.0592     0.7846 0.000 0.016 0.984  0
#> GSM613719     3  0.5940     0.5229 0.120 0.188 0.692  0
#> GSM613720     3  0.4605     0.5418 0.000 0.336 0.664  0
#> GSM613721     3  0.6737     0.2622 0.092 0.420 0.488  0
#> GSM613722     3  0.3761     0.7122 0.068 0.080 0.852  0
#> GSM613723     1  0.5388     0.4084 0.532 0.012 0.456  0
#> GSM613724     1  0.5388     0.4084 0.532 0.012 0.456  0
#> GSM613725     3  0.3761     0.7122 0.068 0.080 0.852  0
#> GSM613726     1  0.4889     0.4600 0.636 0.004 0.360  0
#> GSM613727     1  0.4699     0.5078 0.676 0.004 0.320  0
#> GSM613728     3  0.5901     0.5542 0.068 0.280 0.652  0
#> GSM613729     1  0.7414     0.3823 0.492 0.188 0.320  0
#> GSM613730     3  0.6194     0.5425 0.132 0.200 0.668  0
#> GSM613731     3  0.3400     0.6937 0.180 0.000 0.820  0
#> GSM613732     3  0.0336     0.7861 0.000 0.008 0.992  0
#> GSM613733     3  0.0592     0.7846 0.000 0.016 0.984  0
#> GSM613734     1  0.5388     0.4084 0.532 0.012 0.456  0
#> GSM613735     1  0.5388     0.4084 0.532 0.012 0.456  0
#> GSM613736     3  0.0336     0.7867 0.000 0.008 0.992  0
#> GSM613737     3  0.0000     0.7864 0.000 0.000 1.000  0
#> GSM613738     1  0.5388     0.4084 0.532 0.012 0.456  0
#> GSM613739     1  0.5388     0.4084 0.532 0.012 0.456  0
#> GSM613740     3  0.0188     0.7863 0.000 0.004 0.996  0
#> GSM613741     3  0.7519     0.2284 0.256 0.248 0.496  0
#> GSM613742     1  0.5388     0.4084 0.532 0.012 0.456  0
#> GSM613743     3  0.0592     0.7846 0.000 0.016 0.984  0
#> GSM613744     3  0.0592     0.7846 0.000 0.016 0.984  0
#> GSM613745     3  0.6317     0.4959 0.096 0.280 0.624  0
#> GSM613746     2  0.2704     0.6688 0.000 0.876 0.124  0
#> GSM613747     1  0.5372     0.4185 0.544 0.012 0.444  0
#> GSM613748     3  0.2125     0.7537 0.076 0.004 0.920  0
#> GSM613749     3  0.7386     0.1488 0.320 0.184 0.496  0
#> GSM613750     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM613751     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM613752     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM613753     4  0.0000     1.0000 0.000 0.000 0.000  1

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM613638     3  0.2179     0.7268 0.004 0.000 0.896  0 0.100
#> GSM613639     3  0.4787     0.5190 0.324 0.036 0.640  0 0.000
#> GSM613640     3  0.0290     0.7630 0.000 0.000 0.992  0 0.008
#> GSM613641     1  0.0671     0.8634 0.980 0.004 0.000  0 0.016
#> GSM613642     3  0.1430     0.7627 0.000 0.052 0.944  0 0.004
#> GSM613643     3  0.2798     0.7002 0.008 0.000 0.852  0 0.140
#> GSM613644     3  0.3748     0.7127 0.056 0.020 0.836  0 0.088
#> GSM613645     1  0.5911     0.0395 0.488 0.104 0.408  0 0.000
#> GSM613646     3  0.4822     0.6349 0.076 0.220 0.704  0 0.000
#> GSM613647     3  0.0324     0.7631 0.004 0.000 0.992  0 0.004
#> GSM613648     3  0.3661     0.7341 0.000 0.000 0.724  0 0.276
#> GSM613649     3  0.3661     0.7341 0.000 0.000 0.724  0 0.276
#> GSM613650     3  0.4219     0.6219 0.264 0.016 0.716  0 0.004
#> GSM613651     3  0.3421     0.6442 0.008 0.000 0.788  0 0.204
#> GSM613652     5  0.3730     0.9155 0.288 0.000 0.000  0 0.712
#> GSM613653     3  0.5544     0.5796 0.168 0.184 0.648  0 0.000
#> GSM613654     5  0.3730     0.9155 0.288 0.000 0.000  0 0.712
#> GSM613655     1  0.1410     0.8590 0.940 0.000 0.000  0 0.060
#> GSM613656     5  0.3730     0.9155 0.288 0.000 0.000  0 0.712
#> GSM613657     3  0.3684     0.7339 0.000 0.000 0.720  0 0.280
#> GSM613658     1  0.1121     0.8680 0.956 0.000 0.000  0 0.044
#> GSM613659     2  0.0162     0.8069 0.000 0.996 0.004  0 0.000
#> GSM613660     2  0.5808     0.5519 0.000 0.608 0.232  0 0.160
#> GSM613661     1  0.1251     0.8474 0.956 0.000 0.036  0 0.008
#> GSM613662     2  0.0000     0.8072 0.000 1.000 0.000  0 0.000
#> GSM613663     1  0.1043     0.8687 0.960 0.000 0.000  0 0.040
#> GSM613664     2  0.0000     0.8072 0.000 1.000 0.000  0 0.000
#> GSM613665     2  0.4478     0.7403 0.000 0.756 0.100  0 0.144
#> GSM613666     1  0.0162     0.8649 0.996 0.004 0.000  0 0.000
#> GSM613667     1  0.2645     0.7703 0.888 0.068 0.044  0 0.000
#> GSM613668     1  0.1270     0.8648 0.948 0.000 0.000  0 0.052
#> GSM613669     1  0.0162     0.8649 0.996 0.004 0.000  0 0.000
#> GSM613670     2  0.1792     0.7570 0.000 0.916 0.084  0 0.000
#> GSM613671     1  0.0162     0.8649 0.996 0.004 0.000  0 0.000
#> GSM613672     1  0.2471     0.7725 0.864 0.000 0.000  0 0.136
#> GSM613673     1  0.3535     0.7706 0.832 0.000 0.080  0 0.088
#> GSM613674     2  0.3359     0.7984 0.000 0.844 0.072  0 0.084
#> GSM613675     2  0.0000     0.8072 0.000 1.000 0.000  0 0.000
#> GSM613676     2  0.3967     0.7675 0.000 0.800 0.108  0 0.092
#> GSM613677     3  0.3810     0.7393 0.000 0.100 0.812  0 0.088
#> GSM613678     2  0.3151     0.6877 0.020 0.836 0.144  0 0.000
#> GSM613679     2  0.4630     0.7263 0.000 0.744 0.116  0 0.140
#> GSM613680     1  0.1197     0.8665 0.952 0.000 0.000  0 0.048
#> GSM613681     1  0.0162     0.8649 0.996 0.004 0.000  0 0.000
#> GSM613682     1  0.1270     0.8648 0.948 0.000 0.000  0 0.052
#> GSM613683     1  0.1908     0.8316 0.908 0.000 0.000  0 0.092
#> GSM613684     2  0.2654     0.8144 0.000 0.888 0.064  0 0.048
#> GSM613685     2  0.4020     0.7657 0.000 0.796 0.108  0 0.096
#> GSM613686     1  0.1877     0.8083 0.924 0.064 0.012  0 0.000
#> GSM613687     1  0.1270     0.8648 0.948 0.000 0.000  0 0.052
#> GSM613688     2  0.1800     0.8215 0.000 0.932 0.048  0 0.020
#> GSM613689     3  0.1836     0.7658 0.000 0.036 0.932  0 0.032
#> GSM613690     3  0.2473     0.7637 0.000 0.032 0.896  0 0.072
#> GSM613691     2  0.0000     0.8072 0.000 1.000 0.000  0 0.000
#> GSM613692     1  0.3210     0.6183 0.788 0.000 0.000  0 0.212
#> GSM613693     2  0.1205     0.8167 0.000 0.956 0.004  0 0.040
#> GSM613694     3  0.0798     0.7602 0.008 0.000 0.976  0 0.016
#> GSM613695     3  0.0955     0.7639 0.000 0.028 0.968  0 0.004
#> GSM613696     2  0.5258     0.5970 0.064 0.636 0.296  0 0.004
#> GSM613697     5  0.3934     0.4534 0.008 0.000 0.276  0 0.716
#> GSM613698     3  0.2937     0.7371 0.040 0.016 0.884  0 0.060
#> GSM613699     3  0.0324     0.7632 0.004 0.000 0.992  0 0.004
#> GSM613700     3  0.5774     0.6215 0.000 0.156 0.612  0 0.232
#> GSM613701     3  0.2624     0.7131 0.012 0.116 0.872  0 0.000
#> GSM613702     3  0.2074     0.7632 0.000 0.036 0.920  0 0.044
#> GSM613703     1  0.2127     0.7724 0.892 0.108 0.000  0 0.000
#> GSM613704     2  0.2707     0.7520 0.000 0.876 0.024  0 0.100
#> GSM613705     3  0.0404     0.7631 0.000 0.000 0.988  0 0.012
#> GSM613706     3  0.0404     0.7631 0.000 0.000 0.988  0 0.012
#> GSM613707     2  0.3297     0.8005 0.000 0.848 0.068  0 0.084
#> GSM613708     1  0.2561     0.7337 0.856 0.000 0.000  0 0.144
#> GSM613709     1  0.0671     0.8634 0.980 0.004 0.000  0 0.016
#> GSM613710     3  0.3684     0.7339 0.000 0.000 0.720  0 0.280
#> GSM613711     3  0.3661     0.7341 0.000 0.000 0.724  0 0.276
#> GSM613712     3  0.2124     0.7290 0.004 0.000 0.900  0 0.096
#> GSM613713     3  0.3661     0.7341 0.000 0.000 0.724  0 0.276
#> GSM613714     3  0.3366     0.7451 0.000 0.000 0.768  0 0.232
#> GSM613715     3  0.3790     0.7342 0.000 0.004 0.724  0 0.272
#> GSM613716     3  0.5112     0.6730 0.000 0.256 0.664  0 0.080
#> GSM613717     3  0.3661     0.7341 0.000 0.000 0.724  0 0.276
#> GSM613718     3  0.3661     0.7341 0.000 0.000 0.724  0 0.276
#> GSM613719     3  0.4219     0.7062 0.116 0.104 0.780  0 0.000
#> GSM613720     3  0.6072     0.5973 0.000 0.292 0.552  0 0.156
#> GSM613721     3  0.4307     0.2304 0.000 0.500 0.500  0 0.000
#> GSM613722     3  0.5750     0.6241 0.000 0.156 0.616  0 0.228
#> GSM613723     5  0.3730     0.9155 0.288 0.000 0.000  0 0.712
#> GSM613724     5  0.3913     0.8735 0.324 0.000 0.000  0 0.676
#> GSM613725     3  0.5831     0.6108 0.000 0.160 0.604  0 0.236
#> GSM613726     3  0.5304     0.2495 0.384 0.000 0.560  0 0.056
#> GSM613727     1  0.1341     0.8637 0.944 0.000 0.000  0 0.056
#> GSM613728     3  0.6219     0.3682 0.000 0.424 0.436  0 0.140
#> GSM613729     1  0.0566     0.8643 0.984 0.004 0.000  0 0.012
#> GSM613730     3  0.3336     0.6781 0.000 0.228 0.772  0 0.000
#> GSM613731     3  0.1628     0.7459 0.008 0.000 0.936  0 0.056
#> GSM613732     3  0.3661     0.7341 0.000 0.000 0.724  0 0.276
#> GSM613733     3  0.3684     0.7339 0.000 0.000 0.720  0 0.280
#> GSM613734     5  0.3730     0.9155 0.288 0.000 0.000  0 0.712
#> GSM613735     5  0.3752     0.9133 0.292 0.000 0.000  0 0.708
#> GSM613736     3  0.3885     0.7332 0.000 0.008 0.724  0 0.268
#> GSM613737     3  0.0451     0.7629 0.004 0.000 0.988  0 0.008
#> GSM613738     5  0.4088     0.8934 0.304 0.000 0.008  0 0.688
#> GSM613739     5  0.3730     0.9155 0.288 0.000 0.000  0 0.712
#> GSM613740     3  0.3790     0.7342 0.000 0.004 0.724  0 0.272
#> GSM613741     3  0.5555     0.5679 0.140 0.220 0.640  0 0.000
#> GSM613742     5  0.5136     0.7303 0.180 0.000 0.128  0 0.692
#> GSM613743     3  0.3661     0.7341 0.000 0.000 0.724  0 0.276
#> GSM613744     3  0.3661     0.7341 0.000 0.000 0.724  0 0.276
#> GSM613745     3  0.5423     0.5818 0.124 0.224 0.652  0 0.000
#> GSM613746     2  0.0510     0.8057 0.000 0.984 0.000  0 0.016
#> GSM613747     5  0.3774     0.9100 0.296 0.000 0.000  0 0.704
#> GSM613748     3  0.0404     0.7651 0.000 0.000 0.988  0 0.012
#> GSM613749     3  0.4900     0.1228 0.464 0.024 0.512  0 0.000
#> GSM613750     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM613751     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM613752     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM613753     4  0.0000     1.0000 0.000 0.000 0.000  1 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
#> GSM613638     4  0.0405      0.885 0.000 0.000 0.004 0.988 0.008  0
#> GSM613639     4  0.3052      0.771 0.216 0.000 0.000 0.780 0.004  0
#> GSM613640     4  0.0260      0.886 0.000 0.000 0.008 0.992 0.000  0
#> GSM613641     1  0.0547      0.890 0.980 0.000 0.000 0.000 0.020  0
#> GSM613642     4  0.0363      0.885 0.000 0.000 0.012 0.988 0.000  0
#> GSM613643     4  0.0363      0.884 0.000 0.000 0.000 0.988 0.012  0
#> GSM613644     4  0.0520      0.884 0.008 0.000 0.000 0.984 0.008  0
#> GSM613645     4  0.3240      0.741 0.244 0.000 0.000 0.752 0.004  0
#> GSM613646     4  0.3343      0.787 0.024 0.176 0.000 0.796 0.004  0
#> GSM613647     4  0.0363      0.885 0.000 0.000 0.012 0.988 0.000  0
#> GSM613648     3  0.0000      0.956 0.000 0.000 1.000 0.000 0.000  0
#> GSM613649     3  0.0000      0.956 0.000 0.000 1.000 0.000 0.000  0
#> GSM613650     4  0.2902      0.788 0.196 0.000 0.000 0.800 0.004  0
#> GSM613651     4  0.0363      0.884 0.000 0.000 0.000 0.988 0.012  0
#> GSM613652     5  0.0146      0.980 0.004 0.000 0.000 0.000 0.996  0
#> GSM613653     4  0.3311      0.775 0.204 0.012 0.000 0.780 0.004  0
#> GSM613654     5  0.0146      0.980 0.004 0.000 0.000 0.000 0.996  0
#> GSM613655     1  0.2730      0.809 0.808 0.000 0.000 0.000 0.192  0
#> GSM613656     5  0.0146      0.980 0.004 0.000 0.000 0.000 0.996  0
#> GSM613657     3  0.0000      0.956 0.000 0.000 1.000 0.000 0.000  0
#> GSM613658     1  0.2664      0.814 0.816 0.000 0.000 0.000 0.184  0
#> GSM613659     2  0.0260      0.834 0.000 0.992 0.000 0.008 0.000  0
#> GSM613660     2  0.3728      0.652 0.000 0.652 0.344 0.004 0.000  0
#> GSM613661     1  0.0146      0.880 0.996 0.000 0.000 0.000 0.004  0
#> GSM613662     2  0.0146      0.839 0.000 0.996 0.000 0.004 0.000  0
#> GSM613663     1  0.0713      0.890 0.972 0.000 0.000 0.000 0.028  0
#> GSM613664     2  0.0146      0.839 0.000 0.996 0.000 0.004 0.000  0
#> GSM613665     2  0.2762      0.816 0.000 0.804 0.196 0.000 0.000  0
#> GSM613666     1  0.0547      0.890 0.980 0.000 0.000 0.000 0.020  0
#> GSM613667     1  0.0405      0.871 0.988 0.000 0.000 0.008 0.004  0
#> GSM613668     1  0.2631      0.820 0.820 0.000 0.000 0.000 0.180  0
#> GSM613669     1  0.0547      0.890 0.980 0.000 0.000 0.000 0.020  0
#> GSM613670     2  0.0146      0.839 0.000 0.996 0.000 0.004 0.000  0
#> GSM613671     1  0.0547      0.890 0.980 0.000 0.000 0.000 0.020  0
#> GSM613672     1  0.2793      0.801 0.800 0.000 0.000 0.000 0.200  0
#> GSM613673     1  0.3202      0.726 0.800 0.000 0.000 0.176 0.024  0
#> GSM613674     2  0.2527      0.829 0.000 0.832 0.168 0.000 0.000  0
#> GSM613675     2  0.0146      0.839 0.000 0.996 0.000 0.004 0.000  0
#> GSM613676     2  0.2912      0.806 0.000 0.784 0.216 0.000 0.000  0
#> GSM613677     4  0.3806      0.705 0.000 0.048 0.200 0.752 0.000  0
#> GSM613678     2  0.3755      0.490 0.020 0.732 0.000 0.244 0.004  0
#> GSM613679     2  0.3043      0.812 0.000 0.792 0.200 0.008 0.000  0
#> GSM613680     1  0.2135      0.852 0.872 0.000 0.000 0.000 0.128  0
#> GSM613681     1  0.0547      0.890 0.980 0.000 0.000 0.000 0.020  0
#> GSM613682     1  0.1151      0.887 0.956 0.000 0.000 0.012 0.032  0
#> GSM613683     1  0.2762      0.805 0.804 0.000 0.000 0.000 0.196  0
#> GSM613684     2  0.1863      0.842 0.000 0.896 0.104 0.000 0.000  0
#> GSM613685     2  0.2762      0.816 0.000 0.804 0.196 0.000 0.000  0
#> GSM613686     1  0.0146      0.875 0.996 0.000 0.000 0.000 0.004  0
#> GSM613687     1  0.1141      0.885 0.948 0.000 0.000 0.000 0.052  0
#> GSM613688     2  0.0632      0.844 0.000 0.976 0.024 0.000 0.000  0
#> GSM613689     4  0.0260      0.886 0.000 0.000 0.008 0.992 0.000  0
#> GSM613690     4  0.2416      0.771 0.000 0.000 0.156 0.844 0.000  0
#> GSM613691     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000  0
#> GSM613692     5  0.2258      0.875 0.060 0.000 0.000 0.044 0.896  0
#> GSM613693     2  0.0937      0.845 0.000 0.960 0.040 0.000 0.000  0
#> GSM613694     4  0.0405      0.886 0.000 0.000 0.008 0.988 0.004  0
#> GSM613695     4  0.0363      0.885 0.000 0.000 0.012 0.988 0.000  0
#> GSM613696     4  0.1674      0.851 0.004 0.068 0.004 0.924 0.000  0
#> GSM613697     4  0.0363      0.884 0.000 0.000 0.000 0.988 0.012  0
#> GSM613698     4  0.0405      0.886 0.000 0.000 0.008 0.988 0.004  0
#> GSM613699     4  0.0405      0.886 0.000 0.000 0.008 0.988 0.004  0
#> GSM613700     2  0.3323      0.783 0.000 0.752 0.240 0.008 0.000  0
#> GSM613701     4  0.3011      0.706 0.000 0.192 0.004 0.800 0.004  0
#> GSM613702     4  0.0632      0.881 0.000 0.000 0.024 0.976 0.000  0
#> GSM613703     1  0.0436      0.874 0.988 0.004 0.000 0.004 0.004  0
#> GSM613704     2  0.0146      0.839 0.000 0.996 0.000 0.004 0.000  0
#> GSM613705     4  0.0260      0.886 0.000 0.000 0.008 0.992 0.000  0
#> GSM613706     4  0.0146      0.885 0.000 0.000 0.004 0.996 0.000  0
#> GSM613707     2  0.2378      0.833 0.000 0.848 0.152 0.000 0.000  0
#> GSM613708     1  0.4167      0.289 0.612 0.000 0.000 0.368 0.020  0
#> GSM613709     1  0.0547      0.890 0.980 0.000 0.000 0.000 0.020  0
#> GSM613710     3  0.0146      0.952 0.000 0.000 0.996 0.004 0.000  0
#> GSM613711     3  0.0000      0.956 0.000 0.000 1.000 0.000 0.000  0
#> GSM613712     4  0.0405      0.886 0.000 0.000 0.008 0.988 0.004  0
#> GSM613713     3  0.0000      0.956 0.000 0.000 1.000 0.000 0.000  0
#> GSM613714     3  0.2996      0.612 0.000 0.000 0.772 0.228 0.000  0
#> GSM613715     3  0.0146      0.953 0.000 0.004 0.996 0.000 0.000  0
#> GSM613716     4  0.5827      0.305 0.000 0.208 0.316 0.476 0.000  0
#> GSM613717     3  0.0000      0.956 0.000 0.000 1.000 0.000 0.000  0
#> GSM613718     3  0.0000      0.956 0.000 0.000 1.000 0.000 0.000  0
#> GSM613719     4  0.3043      0.786 0.196 0.004 0.000 0.796 0.004  0
#> GSM613720     3  0.3221      0.603 0.000 0.264 0.736 0.000 0.000  0
#> GSM613721     4  0.3833      0.696 0.016 0.272 0.000 0.708 0.004  0
#> GSM613722     2  0.3323      0.783 0.000 0.752 0.240 0.008 0.000  0
#> GSM613723     5  0.0146      0.980 0.004 0.000 0.000 0.000 0.996  0
#> GSM613724     5  0.0865      0.952 0.036 0.000 0.000 0.000 0.964  0
#> GSM613725     2  0.3555      0.741 0.000 0.712 0.280 0.008 0.000  0
#> GSM613726     4  0.0405      0.884 0.008 0.000 0.000 0.988 0.004  0
#> GSM613727     1  0.2664      0.816 0.816 0.000 0.000 0.000 0.184  0
#> GSM613728     2  0.0405      0.840 0.000 0.988 0.008 0.004 0.000  0
#> GSM613729     1  0.0547      0.890 0.980 0.000 0.000 0.000 0.020  0
#> GSM613730     4  0.3052      0.766 0.000 0.216 0.004 0.780 0.000  0
#> GSM613731     4  0.0405      0.886 0.000 0.000 0.008 0.988 0.004  0
#> GSM613732     3  0.0000      0.956 0.000 0.000 1.000 0.000 0.000  0
#> GSM613733     3  0.0146      0.952 0.000 0.000 0.996 0.004 0.000  0
#> GSM613734     5  0.0146      0.980 0.004 0.000 0.000 0.000 0.996  0
#> GSM613735     5  0.0260      0.976 0.008 0.000 0.000 0.000 0.992  0
#> GSM613736     3  0.0260      0.949 0.000 0.008 0.992 0.000 0.000  0
#> GSM613737     4  0.0405      0.886 0.000 0.000 0.008 0.988 0.004  0
#> GSM613738     5  0.0632      0.966 0.024 0.000 0.000 0.000 0.976  0
#> GSM613739     5  0.0146      0.980 0.004 0.000 0.000 0.000 0.996  0
#> GSM613740     3  0.0146      0.953 0.000 0.004 0.996 0.000 0.000  0
#> GSM613741     4  0.3628      0.772 0.036 0.184 0.000 0.776 0.004  0
#> GSM613742     4  0.3388      0.763 0.036 0.000 0.000 0.792 0.172  0
#> GSM613743     3  0.0000      0.956 0.000 0.000 1.000 0.000 0.000  0
#> GSM613744     3  0.0000      0.956 0.000 0.000 1.000 0.000 0.000  0
#> GSM613745     4  0.3409      0.781 0.024 0.184 0.000 0.788 0.004  0
#> GSM613746     2  0.0146      0.839 0.000 0.996 0.000 0.004 0.000  0
#> GSM613747     5  0.0146      0.980 0.004 0.000 0.000 0.000 0.996  0
#> GSM613748     4  0.0363      0.885 0.000 0.000 0.012 0.988 0.000  0
#> GSM613749     4  0.2980      0.789 0.192 0.000 0.000 0.800 0.008  0
#> GSM613750     6  0.0000      1.000 0.000 0.000 0.000 0.000 0.000  1
#> GSM613751     6  0.0000      1.000 0.000 0.000 0.000 0.000 0.000  1
#> GSM613752     6  0.0000      1.000 0.000 0.000 0.000 0.000 0.000  1
#> GSM613753     6  0.0000      1.000 0.000 0.000 0.000 0.000 0.000  1

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 disease.state(p) k
#> CV:mclust 113         6.71e-02 2
#> CV:mclust 100         1.90e-04 3
#> CV:mclust  77         2.82e-08 4
#> CV:mclust 110         2.31e-10 5
#> CV:mclust 113         4.66e-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.


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 27425 rows and 116 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.945           0.948       0.976         0.5014 0.499   0.499
#> 3 3 0.684           0.822       0.906         0.3041 0.769   0.569
#> 4 4 0.607           0.579       0.794         0.1012 0.802   0.519
#> 5 5 0.672           0.608       0.794         0.0559 0.877   0.621
#> 6 6 0.623           0.532       0.727         0.0482 0.909   0.670

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
#> GSM613638     2  0.9248      0.536 0.340 0.660
#> GSM613639     1  0.0000      0.993 1.000 0.000
#> GSM613640     2  0.4562      0.879 0.096 0.904
#> GSM613641     1  0.0000      0.993 1.000 0.000
#> GSM613642     2  0.0000      0.959 0.000 1.000
#> GSM613643     1  0.0000      0.993 1.000 0.000
#> GSM613644     1  0.1184      0.980 0.984 0.016
#> GSM613645     1  0.0000      0.993 1.000 0.000
#> GSM613646     1  0.4161      0.906 0.916 0.084
#> GSM613647     2  0.7453      0.750 0.212 0.788
#> GSM613648     2  0.0000      0.959 0.000 1.000
#> GSM613649     2  0.0000      0.959 0.000 1.000
#> GSM613650     1  0.0000      0.993 1.000 0.000
#> GSM613651     1  0.0672      0.987 0.992 0.008
#> GSM613652     1  0.0000      0.993 1.000 0.000
#> GSM613653     1  0.0376      0.990 0.996 0.004
#> GSM613654     1  0.0000      0.993 1.000 0.000
#> GSM613655     1  0.0000      0.993 1.000 0.000
#> GSM613656     1  0.0000      0.993 1.000 0.000
#> GSM613657     2  0.0000      0.959 0.000 1.000
#> GSM613658     1  0.0000      0.993 1.000 0.000
#> GSM613659     2  0.0000      0.959 0.000 1.000
#> GSM613660     2  0.0000      0.959 0.000 1.000
#> GSM613661     1  0.0000      0.993 1.000 0.000
#> GSM613662     2  0.0000      0.959 0.000 1.000
#> GSM613663     1  0.0000      0.993 1.000 0.000
#> GSM613664     2  0.0000      0.959 0.000 1.000
#> GSM613665     2  0.0000      0.959 0.000 1.000
#> GSM613666     1  0.0000      0.993 1.000 0.000
#> GSM613667     1  0.0000      0.993 1.000 0.000
#> GSM613668     1  0.0000      0.993 1.000 0.000
#> GSM613669     1  0.0000      0.993 1.000 0.000
#> GSM613670     2  0.0376      0.957 0.004 0.996
#> GSM613671     1  0.0000      0.993 1.000 0.000
#> GSM613672     1  0.0000      0.993 1.000 0.000
#> GSM613673     1  0.0000      0.993 1.000 0.000
#> GSM613674     2  0.0000      0.959 0.000 1.000
#> GSM613675     2  0.0000      0.959 0.000 1.000
#> GSM613676     2  0.0000      0.959 0.000 1.000
#> GSM613677     2  0.0000      0.959 0.000 1.000
#> GSM613678     1  0.0672      0.987 0.992 0.008
#> GSM613679     2  0.0000      0.959 0.000 1.000
#> GSM613680     1  0.0000      0.993 1.000 0.000
#> GSM613681     1  0.0000      0.993 1.000 0.000
#> GSM613682     1  0.0000      0.993 1.000 0.000
#> GSM613683     1  0.0000      0.993 1.000 0.000
#> GSM613684     2  0.0000      0.959 0.000 1.000
#> GSM613685     2  0.0000      0.959 0.000 1.000
#> GSM613686     1  0.0000      0.993 1.000 0.000
#> GSM613687     1  0.0000      0.993 1.000 0.000
#> GSM613688     2  0.0000      0.959 0.000 1.000
#> GSM613689     2  0.0000      0.959 0.000 1.000
#> GSM613690     2  0.0000      0.959 0.000 1.000
#> GSM613691     2  0.0000      0.959 0.000 1.000
#> GSM613692     1  0.0000      0.993 1.000 0.000
#> GSM613693     2  0.0000      0.959 0.000 1.000
#> GSM613694     1  0.3431      0.929 0.936 0.064
#> GSM613695     2  0.0000      0.959 0.000 1.000
#> GSM613696     2  0.3733      0.901 0.072 0.928
#> GSM613697     1  0.0000      0.993 1.000 0.000
#> GSM613698     2  0.9775      0.364 0.412 0.588
#> GSM613699     2  0.8327      0.676 0.264 0.736
#> GSM613700     2  0.0000      0.959 0.000 1.000
#> GSM613701     2  0.7883      0.718 0.236 0.764
#> GSM613702     2  0.0000      0.959 0.000 1.000
#> GSM613703     1  0.0000      0.993 1.000 0.000
#> GSM613704     2  0.0000      0.959 0.000 1.000
#> GSM613705     2  0.8144      0.695 0.252 0.748
#> GSM613706     1  0.0376      0.990 0.996 0.004
#> GSM613707     2  0.0000      0.959 0.000 1.000
#> GSM613708     1  0.0000      0.993 1.000 0.000
#> GSM613709     1  0.0000      0.993 1.000 0.000
#> GSM613710     2  0.0000      0.959 0.000 1.000
#> GSM613711     2  0.0000      0.959 0.000 1.000
#> GSM613712     2  0.8443      0.663 0.272 0.728
#> GSM613713     2  0.0000      0.959 0.000 1.000
#> GSM613714     2  0.0000      0.959 0.000 1.000
#> GSM613715     2  0.0000      0.959 0.000 1.000
#> GSM613716     2  0.0000      0.959 0.000 1.000
#> GSM613717     2  0.0000      0.959 0.000 1.000
#> GSM613718     2  0.0000      0.959 0.000 1.000
#> GSM613719     1  0.0672      0.987 0.992 0.008
#> GSM613720     2  0.0000      0.959 0.000 1.000
#> GSM613721     2  0.0000      0.959 0.000 1.000
#> GSM613722     2  0.0000      0.959 0.000 1.000
#> GSM613723     1  0.0000      0.993 1.000 0.000
#> GSM613724     1  0.0000      0.993 1.000 0.000
#> GSM613725     2  0.0000      0.959 0.000 1.000
#> GSM613726     1  0.0000      0.993 1.000 0.000
#> GSM613727     1  0.0000      0.993 1.000 0.000
#> GSM613728     2  0.0000      0.959 0.000 1.000
#> GSM613729     1  0.0000      0.993 1.000 0.000
#> GSM613730     2  0.0000      0.959 0.000 1.000
#> GSM613731     1  0.0000      0.993 1.000 0.000
#> GSM613732     2  0.0000      0.959 0.000 1.000
#> GSM613733     2  0.0000      0.959 0.000 1.000
#> GSM613734     1  0.0000      0.993 1.000 0.000
#> GSM613735     1  0.0000      0.993 1.000 0.000
#> GSM613736     2  0.0000      0.959 0.000 1.000
#> GSM613737     1  0.5519      0.848 0.872 0.128
#> GSM613738     1  0.0000      0.993 1.000 0.000
#> GSM613739     1  0.0000      0.993 1.000 0.000
#> GSM613740     2  0.0000      0.959 0.000 1.000
#> GSM613741     1  0.0672      0.987 0.992 0.008
#> GSM613742     1  0.0000      0.993 1.000 0.000
#> GSM613743     2  0.0000      0.959 0.000 1.000
#> GSM613744     2  0.0000      0.959 0.000 1.000
#> GSM613745     2  0.8813      0.615 0.300 0.700
#> GSM613746     2  0.0000      0.959 0.000 1.000
#> GSM613747     1  0.0000      0.993 1.000 0.000
#> GSM613748     2  0.0376      0.957 0.004 0.996
#> GSM613749     1  0.0000      0.993 1.000 0.000
#> GSM613750     2  0.0000      0.959 0.000 1.000
#> GSM613751     2  0.0000      0.959 0.000 1.000
#> GSM613752     2  0.0000      0.959 0.000 1.000
#> GSM613753     2  0.0000      0.959 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
#> GSM613638     3  0.4002      0.766 0.160 0.000 0.840
#> GSM613639     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613640     3  0.1860      0.850 0.052 0.000 0.948
#> GSM613641     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613642     3  0.2796      0.817 0.000 0.092 0.908
#> GSM613643     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613644     1  0.5016      0.646 0.760 0.000 0.240
#> GSM613645     1  0.4504      0.762 0.804 0.196 0.000
#> GSM613646     1  0.5591      0.631 0.696 0.304 0.000
#> GSM613647     3  0.3752      0.777 0.144 0.000 0.856
#> GSM613648     3  0.0424      0.871 0.000 0.008 0.992
#> GSM613649     3  0.0747      0.869 0.000 0.016 0.984
#> GSM613650     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613651     3  0.6111      0.388 0.396 0.000 0.604
#> GSM613652     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613653     1  0.5560      0.634 0.700 0.300 0.000
#> GSM613654     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613655     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613656     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613657     3  0.1411      0.861 0.000 0.036 0.964
#> GSM613658     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613659     2  0.0000      0.851 0.000 1.000 0.000
#> GSM613660     2  0.5327      0.762 0.000 0.728 0.272
#> GSM613661     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613662     2  0.0000      0.851 0.000 1.000 0.000
#> GSM613663     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613664     2  0.0000      0.851 0.000 1.000 0.000
#> GSM613665     2  0.4346      0.842 0.000 0.816 0.184
#> GSM613666     1  0.0592      0.925 0.988 0.012 0.000
#> GSM613667     1  0.3116      0.851 0.892 0.108 0.000
#> GSM613668     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613669     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613670     2  0.0000      0.851 0.000 1.000 0.000
#> GSM613671     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613672     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613673     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613674     2  0.4002      0.852 0.000 0.840 0.160
#> GSM613675     2  0.0000      0.851 0.000 1.000 0.000
#> GSM613676     2  0.5363      0.757 0.000 0.724 0.276
#> GSM613677     3  0.5178      0.568 0.000 0.256 0.744
#> GSM613678     2  0.0424      0.846 0.008 0.992 0.000
#> GSM613679     2  0.4121      0.849 0.000 0.832 0.168
#> GSM613680     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613681     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613682     1  0.0747      0.923 0.984 0.016 0.000
#> GSM613683     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613684     2  0.5178      0.780 0.000 0.744 0.256
#> GSM613685     2  0.4062      0.850 0.000 0.836 0.164
#> GSM613686     1  0.6079      0.371 0.612 0.388 0.000
#> GSM613687     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613688     2  0.3879      0.853 0.000 0.848 0.152
#> GSM613689     3  0.1031      0.866 0.000 0.024 0.976
#> GSM613690     3  0.0000      0.872 0.000 0.000 1.000
#> GSM613691     2  0.0000      0.851 0.000 1.000 0.000
#> GSM613692     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613693     2  0.4504      0.833 0.000 0.804 0.196
#> GSM613694     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613695     3  0.0000      0.872 0.000 0.000 1.000
#> GSM613696     2  0.6349      0.759 0.140 0.768 0.092
#> GSM613697     3  0.6260      0.241 0.448 0.000 0.552
#> GSM613698     3  0.4931      0.695 0.232 0.000 0.768
#> GSM613699     1  0.8283      0.137 0.536 0.084 0.380
#> GSM613700     2  0.4178      0.847 0.000 0.828 0.172
#> GSM613701     2  0.4555      0.720 0.200 0.800 0.000
#> GSM613702     2  0.4110      0.853 0.004 0.844 0.152
#> GSM613703     1  0.4346      0.777 0.816 0.184 0.000
#> GSM613704     2  0.0000      0.851 0.000 1.000 0.000
#> GSM613705     3  0.2959      0.814 0.100 0.000 0.900
#> GSM613706     1  0.1860      0.893 0.948 0.052 0.000
#> GSM613707     2  0.4452      0.837 0.000 0.808 0.192
#> GSM613708     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613709     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613710     3  0.4750      0.647 0.000 0.216 0.784
#> GSM613711     3  0.1163      0.865 0.000 0.028 0.972
#> GSM613712     3  0.4346      0.740 0.184 0.000 0.816
#> GSM613713     3  0.3816      0.759 0.000 0.148 0.852
#> GSM613714     3  0.0000      0.872 0.000 0.000 1.000
#> GSM613715     3  0.0000      0.872 0.000 0.000 1.000
#> GSM613716     3  0.4654      0.732 0.000 0.208 0.792
#> GSM613717     3  0.2959      0.815 0.000 0.100 0.900
#> GSM613718     3  0.0000      0.872 0.000 0.000 1.000
#> GSM613719     1  0.1411      0.905 0.964 0.000 0.036
#> GSM613720     3  0.4504      0.760 0.000 0.196 0.804
#> GSM613721     2  0.0000      0.851 0.000 1.000 0.000
#> GSM613722     2  0.4555      0.832 0.000 0.800 0.200
#> GSM613723     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613724     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613725     2  0.4842      0.815 0.000 0.776 0.224
#> GSM613726     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613727     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613728     2  0.0000      0.851 0.000 1.000 0.000
#> GSM613729     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613730     2  0.1031      0.848 0.000 0.976 0.024
#> GSM613731     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613732     3  0.0000      0.872 0.000 0.000 1.000
#> GSM613733     3  0.2878      0.817 0.000 0.096 0.904
#> GSM613734     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613735     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613736     3  0.1163      0.867 0.000 0.028 0.972
#> GSM613737     3  0.5178      0.669 0.256 0.000 0.744
#> GSM613738     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613739     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613740     3  0.0892      0.868 0.000 0.020 0.980
#> GSM613741     1  0.6204      0.398 0.576 0.424 0.000
#> GSM613742     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613743     3  0.1289      0.864 0.000 0.032 0.968
#> GSM613744     3  0.0000      0.872 0.000 0.000 1.000
#> GSM613745     1  0.8795      0.110 0.444 0.444 0.112
#> GSM613746     2  0.0424      0.851 0.000 0.992 0.008
#> GSM613747     1  0.0000      0.932 1.000 0.000 0.000
#> GSM613748     2  0.7186      0.622 0.040 0.624 0.336
#> GSM613749     2  0.5678      0.532 0.316 0.684 0.000
#> GSM613750     3  0.0000      0.872 0.000 0.000 1.000
#> GSM613751     3  0.0000      0.872 0.000 0.000 1.000
#> GSM613752     3  0.0000      0.872 0.000 0.000 1.000
#> GSM613753     3  0.0000      0.872 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
#> GSM613638     3  0.7273   0.230493 0.408 0.128 0.460 0.004
#> GSM613639     1  0.3942   0.659389 0.764 0.000 0.000 0.236
#> GSM613640     2  0.8555   0.074620 0.268 0.480 0.196 0.056
#> GSM613641     1  0.0469   0.872649 0.988 0.000 0.000 0.012
#> GSM613642     2  0.3625   0.585187 0.000 0.828 0.160 0.012
#> GSM613643     1  0.0524   0.873792 0.988 0.004 0.000 0.008
#> GSM613644     1  0.6179   0.045803 0.504 0.012 0.456 0.028
#> GSM613645     1  0.4998   0.012208 0.512 0.000 0.000 0.488
#> GSM613646     4  0.6437   0.496384 0.168 0.184 0.000 0.648
#> GSM613647     3  0.4036   0.707621 0.032 0.116 0.840 0.012
#> GSM613648     3  0.6334   0.482274 0.000 0.328 0.592 0.080
#> GSM613649     3  0.6668   0.417992 0.000 0.380 0.528 0.092
#> GSM613650     1  0.4746   0.704739 0.792 0.064 0.004 0.140
#> GSM613651     1  0.6614  -0.079015 0.484 0.052 0.452 0.012
#> GSM613652     1  0.0376   0.874944 0.992 0.004 0.000 0.004
#> GSM613653     4  0.6170   0.516751 0.192 0.136 0.000 0.672
#> GSM613654     1  0.0524   0.873792 0.988 0.004 0.000 0.008
#> GSM613655     1  0.0000   0.875029 1.000 0.000 0.000 0.000
#> GSM613656     1  0.0000   0.875029 1.000 0.000 0.000 0.000
#> GSM613657     2  0.3726   0.505478 0.000 0.788 0.212 0.000
#> GSM613658     1  0.0188   0.874318 0.996 0.000 0.000 0.004
#> GSM613659     4  0.3813   0.642891 0.000 0.148 0.024 0.828
#> GSM613660     2  0.2647   0.619659 0.000 0.880 0.000 0.120
#> GSM613661     1  0.0000   0.875029 1.000 0.000 0.000 0.000
#> GSM613662     4  0.2704   0.659060 0.000 0.124 0.000 0.876
#> GSM613663     1  0.0188   0.874318 0.996 0.000 0.000 0.004
#> GSM613664     4  0.3649   0.593626 0.000 0.204 0.000 0.796
#> GSM613665     2  0.3873   0.542343 0.000 0.772 0.000 0.228
#> GSM613666     1  0.3764   0.672128 0.784 0.000 0.000 0.216
#> GSM613667     1  0.2647   0.776300 0.880 0.000 0.000 0.120
#> GSM613668     1  0.0376   0.874612 0.992 0.004 0.000 0.004
#> GSM613669     1  0.0336   0.873419 0.992 0.000 0.000 0.008
#> GSM613670     4  0.2281   0.667878 0.000 0.096 0.000 0.904
#> GSM613671     1  0.1022   0.861473 0.968 0.000 0.000 0.032
#> GSM613672     1  0.0188   0.875165 0.996 0.004 0.000 0.000
#> GSM613673     1  0.0804   0.869008 0.980 0.012 0.000 0.008
#> GSM613674     2  0.4661   0.380104 0.000 0.652 0.000 0.348
#> GSM613675     4  0.3606   0.649469 0.000 0.140 0.020 0.840
#> GSM613676     2  0.4599   0.516393 0.000 0.736 0.016 0.248
#> GSM613677     3  0.6007   0.089702 0.000 0.408 0.548 0.044
#> GSM613678     4  0.3208   0.644872 0.000 0.148 0.004 0.848
#> GSM613679     2  0.4103   0.514521 0.000 0.744 0.000 0.256
#> GSM613680     1  0.0188   0.875165 0.996 0.004 0.000 0.000
#> GSM613681     1  0.0336   0.873419 0.992 0.000 0.000 0.008
#> GSM613682     1  0.5203   0.571214 0.720 0.048 0.000 0.232
#> GSM613683     1  0.0188   0.875165 0.996 0.004 0.000 0.000
#> GSM613684     2  0.6585   0.285806 0.000 0.584 0.104 0.312
#> GSM613685     2  0.4564   0.414572 0.000 0.672 0.000 0.328
#> GSM613686     1  0.6607  -0.019373 0.476 0.080 0.000 0.444
#> GSM613687     1  0.0188   0.874318 0.996 0.000 0.000 0.004
#> GSM613688     2  0.4925   0.206347 0.000 0.572 0.000 0.428
#> GSM613689     2  0.2814   0.599651 0.000 0.868 0.132 0.000
#> GSM613690     3  0.1302   0.712817 0.000 0.044 0.956 0.000
#> GSM613691     4  0.1557   0.674595 0.000 0.056 0.000 0.944
#> GSM613692     1  0.0817   0.865187 0.976 0.000 0.024 0.000
#> GSM613693     4  0.5500   0.000381 0.000 0.464 0.016 0.520
#> GSM613694     1  0.0188   0.874926 0.996 0.004 0.000 0.000
#> GSM613695     3  0.1109   0.713686 0.004 0.028 0.968 0.000
#> GSM613696     4  0.8675   0.307002 0.192 0.228 0.080 0.500
#> GSM613697     3  0.5297   0.158797 0.444 0.004 0.548 0.004
#> GSM613698     3  0.2400   0.700408 0.032 0.012 0.928 0.028
#> GSM613699     1  0.6106   0.362719 0.592 0.348 0.060 0.000
#> GSM613700     2  0.2011   0.637490 0.000 0.920 0.000 0.080
#> GSM613701     2  0.3706   0.606835 0.040 0.848 0.000 0.112
#> GSM613702     2  0.3130   0.632407 0.012 0.892 0.024 0.072
#> GSM613703     4  0.4277   0.517877 0.280 0.000 0.000 0.720
#> GSM613704     4  0.2737   0.661078 0.000 0.104 0.008 0.888
#> GSM613705     2  0.8154  -0.101265 0.240 0.444 0.300 0.016
#> GSM613706     2  0.4844   0.354673 0.300 0.688 0.000 0.012
#> GSM613707     2  0.3907   0.538566 0.000 0.768 0.000 0.232
#> GSM613708     1  0.0469   0.872682 0.988 0.000 0.000 0.012
#> GSM613709     1  0.0469   0.872649 0.988 0.000 0.000 0.012
#> GSM613710     2  0.2125   0.629574 0.000 0.920 0.076 0.004
#> GSM613711     2  0.5345  -0.078029 0.000 0.560 0.428 0.012
#> GSM613712     3  0.4543   0.687485 0.080 0.080 0.824 0.016
#> GSM613713     2  0.3447   0.583301 0.000 0.852 0.128 0.020
#> GSM613714     2  0.5742   0.099813 0.000 0.596 0.368 0.036
#> GSM613715     3  0.4832   0.672833 0.000 0.176 0.768 0.056
#> GSM613716     3  0.7218   0.117585 0.000 0.140 0.444 0.416
#> GSM613717     2  0.4969   0.497832 0.000 0.772 0.140 0.088
#> GSM613718     3  0.4284   0.653978 0.000 0.224 0.764 0.012
#> GSM613719     1  0.9143  -0.158994 0.372 0.104 0.164 0.360
#> GSM613720     4  0.7534  -0.103629 0.000 0.188 0.380 0.432
#> GSM613721     4  0.2530   0.645350 0.000 0.112 0.000 0.888
#> GSM613722     2  0.2125   0.638925 0.000 0.920 0.004 0.076
#> GSM613723     1  0.0188   0.875165 0.996 0.004 0.000 0.000
#> GSM613724     1  0.0000   0.875029 1.000 0.000 0.000 0.000
#> GSM613725     2  0.2197   0.637453 0.000 0.916 0.004 0.080
#> GSM613726     1  0.0188   0.875165 0.996 0.004 0.000 0.000
#> GSM613727     1  0.0000   0.875029 1.000 0.000 0.000 0.000
#> GSM613728     2  0.4343   0.469815 0.000 0.732 0.004 0.264
#> GSM613729     1  0.0469   0.872213 0.988 0.000 0.000 0.012
#> GSM613730     4  0.4985   0.185921 0.000 0.468 0.000 0.532
#> GSM613731     1  0.0376   0.874664 0.992 0.004 0.000 0.004
#> GSM613732     3  0.2408   0.710256 0.000 0.104 0.896 0.000
#> GSM613733     2  0.3160   0.595369 0.000 0.872 0.108 0.020
#> GSM613734     1  0.0188   0.875165 0.996 0.004 0.000 0.000
#> GSM613735     1  0.0000   0.875029 1.000 0.000 0.000 0.000
#> GSM613736     2  0.4855   0.265945 0.000 0.644 0.352 0.004
#> GSM613737     1  0.8705  -0.075003 0.456 0.164 0.308 0.072
#> GSM613738     1  0.0188   0.875165 0.996 0.004 0.000 0.000
#> GSM613739     1  0.0376   0.874664 0.992 0.004 0.000 0.004
#> GSM613740     3  0.4978   0.454252 0.000 0.384 0.612 0.004
#> GSM613741     4  0.4677   0.592908 0.176 0.048 0.000 0.776
#> GSM613742     1  0.0376   0.874664 0.992 0.004 0.000 0.004
#> GSM613743     2  0.4837   0.243651 0.000 0.648 0.348 0.004
#> GSM613744     3  0.5137   0.331357 0.000 0.452 0.544 0.004
#> GSM613745     4  0.6637   0.535569 0.160 0.116 0.036 0.688
#> GSM613746     4  0.1256   0.672421 0.000 0.028 0.008 0.964
#> GSM613747     1  0.0188   0.875165 0.996 0.004 0.000 0.000
#> GSM613748     2  0.2861   0.635516 0.032 0.908 0.048 0.012
#> GSM613749     1  0.5515   0.590752 0.732 0.116 0.000 0.152
#> GSM613750     3  0.0921   0.713997 0.000 0.028 0.972 0.000
#> GSM613751     3  0.0921   0.713997 0.000 0.028 0.972 0.000
#> GSM613752     3  0.0921   0.713997 0.000 0.028 0.972 0.000
#> GSM613753     3  0.0921   0.713997 0.000 0.028 0.972 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
#> GSM613638     1  0.7098     0.0423 0.444 0.000 0.292 0.020 0.244
#> GSM613639     4  0.3918     0.5446 0.232 0.008 0.008 0.752 0.000
#> GSM613640     3  0.6304     0.4875 0.092 0.100 0.700 0.056 0.052
#> GSM613641     1  0.1331     0.8733 0.952 0.000 0.008 0.040 0.000
#> GSM613642     3  0.3194     0.5842 0.000 0.148 0.832 0.000 0.020
#> GSM613643     1  0.2316     0.8524 0.916 0.000 0.036 0.036 0.012
#> GSM613644     1  0.9074    -0.0339 0.400 0.092 0.104 0.164 0.240
#> GSM613645     4  0.4002     0.6388 0.152 0.044 0.008 0.796 0.000
#> GSM613646     4  0.1596     0.7162 0.012 0.000 0.028 0.948 0.012
#> GSM613647     5  0.5869     0.5954 0.016 0.000 0.256 0.104 0.624
#> GSM613648     3  0.7555     0.2147 0.000 0.180 0.516 0.184 0.120
#> GSM613649     3  0.6749     0.1186 0.000 0.020 0.528 0.208 0.244
#> GSM613650     4  0.6189     0.3508 0.304 0.000 0.084 0.580 0.032
#> GSM613651     1  0.6992     0.2975 0.544 0.000 0.168 0.052 0.236
#> GSM613652     1  0.0162     0.8841 0.996 0.000 0.000 0.004 0.000
#> GSM613653     4  0.1364     0.7247 0.036 0.012 0.000 0.952 0.000
#> GSM613654     1  0.0510     0.8837 0.984 0.000 0.000 0.016 0.000
#> GSM613655     1  0.0000     0.8839 1.000 0.000 0.000 0.000 0.000
#> GSM613656     1  0.0000     0.8839 1.000 0.000 0.000 0.000 0.000
#> GSM613657     3  0.1836     0.6434 0.000 0.032 0.932 0.000 0.036
#> GSM613658     1  0.0162     0.8842 0.996 0.000 0.000 0.004 0.000
#> GSM613659     2  0.3790     0.2962 0.000 0.724 0.000 0.272 0.004
#> GSM613660     3  0.4182     0.1960 0.000 0.352 0.644 0.000 0.004
#> GSM613661     1  0.0798     0.8817 0.976 0.016 0.000 0.008 0.000
#> GSM613662     4  0.4302     0.1604 0.000 0.480 0.000 0.520 0.000
#> GSM613663     1  0.0324     0.8842 0.992 0.004 0.000 0.004 0.000
#> GSM613664     2  0.3957     0.3867 0.000 0.712 0.008 0.280 0.000
#> GSM613665     2  0.4283     0.3834 0.000 0.544 0.456 0.000 0.000
#> GSM613666     1  0.3921     0.7234 0.784 0.172 0.000 0.044 0.000
#> GSM613667     1  0.2798     0.8367 0.888 0.044 0.008 0.060 0.000
#> GSM613668     1  0.0162     0.8841 0.996 0.004 0.000 0.000 0.000
#> GSM613669     1  0.0693     0.8829 0.980 0.008 0.000 0.012 0.000
#> GSM613670     4  0.3913     0.4922 0.000 0.324 0.000 0.676 0.000
#> GSM613671     1  0.2790     0.8231 0.880 0.052 0.000 0.068 0.000
#> GSM613672     1  0.0000     0.8839 1.000 0.000 0.000 0.000 0.000
#> GSM613673     1  0.0510     0.8828 0.984 0.016 0.000 0.000 0.000
#> GSM613674     2  0.3895     0.5542 0.000 0.680 0.320 0.000 0.000
#> GSM613675     2  0.4088     0.0522 0.000 0.632 0.000 0.368 0.000
#> GSM613676     2  0.4808     0.4579 0.000 0.576 0.400 0.000 0.024
#> GSM613677     5  0.6745    -0.0352 0.000 0.188 0.400 0.008 0.404
#> GSM613678     2  0.3966     0.2330 0.000 0.664 0.000 0.336 0.000
#> GSM613679     2  0.4291     0.3645 0.000 0.536 0.464 0.000 0.000
#> GSM613680     1  0.0162     0.8841 0.996 0.004 0.000 0.000 0.000
#> GSM613681     1  0.0451     0.8838 0.988 0.008 0.000 0.004 0.000
#> GSM613682     1  0.4101     0.5265 0.664 0.332 0.000 0.004 0.000
#> GSM613683     1  0.0162     0.8841 0.996 0.004 0.000 0.000 0.000
#> GSM613684     2  0.6120     0.4995 0.000 0.564 0.196 0.000 0.240
#> GSM613685     2  0.4030     0.5298 0.000 0.648 0.352 0.000 0.000
#> GSM613686     1  0.5866     0.1737 0.488 0.424 0.004 0.084 0.000
#> GSM613687     1  0.0324     0.8842 0.992 0.004 0.000 0.004 0.000
#> GSM613688     2  0.3909     0.5987 0.000 0.760 0.216 0.024 0.000
#> GSM613689     3  0.2763     0.5782 0.000 0.148 0.848 0.000 0.004
#> GSM613690     5  0.1597     0.7667 0.000 0.000 0.048 0.012 0.940
#> GSM613691     4  0.3109     0.6491 0.000 0.200 0.000 0.800 0.000
#> GSM613692     1  0.2911     0.7940 0.852 0.008 0.000 0.004 0.136
#> GSM613693     2  0.4955     0.5968 0.000 0.724 0.204 0.036 0.036
#> GSM613694     1  0.0162     0.8844 0.996 0.000 0.004 0.000 0.000
#> GSM613695     5  0.3443     0.7524 0.008 0.032 0.100 0.008 0.852
#> GSM613696     2  0.6268     0.2907 0.216 0.616 0.004 0.020 0.144
#> GSM613697     1  0.4446     0.3607 0.592 0.000 0.000 0.008 0.400
#> GSM613698     5  0.3779     0.7388 0.020 0.012 0.028 0.100 0.840
#> GSM613699     1  0.4839     0.6370 0.720 0.024 0.220 0.000 0.036
#> GSM613700     3  0.3424     0.4631 0.000 0.240 0.760 0.000 0.000
#> GSM613701     3  0.3835     0.4201 0.008 0.260 0.732 0.000 0.000
#> GSM613702     3  0.3599     0.6216 0.016 0.140 0.824 0.020 0.000
#> GSM613703     4  0.3031     0.6996 0.016 0.128 0.004 0.852 0.000
#> GSM613704     4  0.3081     0.6866 0.000 0.156 0.012 0.832 0.000
#> GSM613705     3  0.5864     0.3941 0.188 0.000 0.668 0.036 0.108
#> GSM613706     3  0.4527     0.4194 0.260 0.040 0.700 0.000 0.000
#> GSM613707     2  0.4430     0.3701 0.000 0.540 0.456 0.000 0.004
#> GSM613708     1  0.1205     0.8764 0.956 0.000 0.004 0.040 0.000
#> GSM613709     1  0.1331     0.8733 0.952 0.000 0.008 0.040 0.000
#> GSM613710     3  0.2233     0.6101 0.000 0.104 0.892 0.000 0.004
#> GSM613711     3  0.3064     0.6237 0.000 0.000 0.856 0.036 0.108
#> GSM613712     5  0.5438     0.6824 0.076 0.000 0.124 0.072 0.728
#> GSM613713     3  0.3768     0.5925 0.000 0.156 0.808 0.020 0.016
#> GSM613714     3  0.3427     0.6060 0.000 0.000 0.836 0.056 0.108
#> GSM613715     5  0.6138     0.5313 0.000 0.000 0.272 0.176 0.552
#> GSM613716     4  0.4688     0.6190 0.000 0.068 0.056 0.784 0.092
#> GSM613717     3  0.2798     0.6401 0.000 0.008 0.888 0.060 0.044
#> GSM613718     5  0.5240     0.4584 0.000 0.000 0.360 0.056 0.584
#> GSM613719     4  0.4712     0.6126 0.076 0.000 0.076 0.784 0.064
#> GSM613720     4  0.4507     0.6140 0.000 0.028 0.048 0.776 0.148
#> GSM613721     4  0.2464     0.7129 0.000 0.096 0.016 0.888 0.000
#> GSM613722     3  0.3715     0.4345 0.000 0.260 0.736 0.004 0.000
#> GSM613723     1  0.0000     0.8839 1.000 0.000 0.000 0.000 0.000
#> GSM613724     1  0.0162     0.8841 0.996 0.000 0.000 0.004 0.000
#> GSM613725     3  0.3814     0.4071 0.000 0.276 0.720 0.004 0.000
#> GSM613726     1  0.0579     0.8831 0.984 0.000 0.008 0.008 0.000
#> GSM613727     1  0.0451     0.8837 0.988 0.000 0.004 0.008 0.000
#> GSM613728     3  0.6024     0.2328 0.000 0.148 0.556 0.296 0.000
#> GSM613729     1  0.1430     0.8697 0.944 0.000 0.004 0.052 0.000
#> GSM613730     4  0.4800     0.0292 0.000 0.004 0.476 0.508 0.012
#> GSM613731     1  0.1356     0.8765 0.956 0.004 0.012 0.028 0.000
#> GSM613732     5  0.2881     0.7558 0.000 0.008 0.092 0.024 0.876
#> GSM613733     3  0.1168     0.6391 0.000 0.032 0.960 0.008 0.000
#> GSM613734     1  0.0000     0.8839 1.000 0.000 0.000 0.000 0.000
#> GSM613735     1  0.0404     0.8839 0.988 0.000 0.000 0.012 0.000
#> GSM613736     3  0.4183     0.5647 0.000 0.020 0.776 0.024 0.180
#> GSM613737     1  0.7365     0.0971 0.456 0.004 0.356 0.104 0.080
#> GSM613738     1  0.1124     0.8768 0.960 0.000 0.004 0.036 0.000
#> GSM613739     1  0.0451     0.8839 0.988 0.000 0.004 0.008 0.000
#> GSM613740     3  0.5430    -0.1175 0.000 0.008 0.484 0.040 0.468
#> GSM613741     4  0.1484     0.7219 0.008 0.048 0.000 0.944 0.000
#> GSM613742     1  0.1202     0.8764 0.960 0.004 0.004 0.032 0.000
#> GSM613743     3  0.2864     0.6324 0.000 0.000 0.864 0.024 0.112
#> GSM613744     3  0.4326     0.4160 0.000 0.000 0.708 0.028 0.264
#> GSM613745     4  0.1918     0.7148 0.004 0.048 0.012 0.932 0.004
#> GSM613746     4  0.3171     0.6800 0.000 0.176 0.000 0.816 0.008
#> GSM613747     1  0.0162     0.8841 0.996 0.000 0.000 0.004 0.000
#> GSM613748     3  0.3944     0.5910 0.004 0.224 0.756 0.016 0.000
#> GSM613749     1  0.3343     0.8214 0.864 0.068 0.028 0.040 0.000
#> GSM613750     5  0.1444     0.7471 0.000 0.040 0.000 0.012 0.948
#> GSM613751     5  0.1597     0.7420 0.000 0.048 0.000 0.012 0.940
#> GSM613752     5  0.1597     0.7420 0.000 0.048 0.000 0.012 0.940
#> GSM613753     5  0.1444     0.7471 0.000 0.040 0.000 0.012 0.948

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     4  0.5486     0.3363 0.344 0.000 0.052 0.560 0.044 0.000
#> GSM613639     6  0.4826     0.6187 0.072 0.064 0.000 0.120 0.004 0.740
#> GSM613640     4  0.4240     0.4339 0.020 0.000 0.288 0.680 0.004 0.008
#> GSM613641     1  0.2757     0.8312 0.884 0.024 0.000 0.036 0.004 0.052
#> GSM613642     3  0.4492     0.2956 0.000 0.016 0.624 0.344 0.008 0.008
#> GSM613643     1  0.4346     0.1979 0.524 0.004 0.004 0.460 0.000 0.008
#> GSM613644     4  0.5065     0.4405 0.100 0.040 0.000 0.744 0.048 0.068
#> GSM613645     6  0.5199     0.5869 0.064 0.100 0.000 0.124 0.004 0.708
#> GSM613646     6  0.3046     0.6801 0.000 0.012 0.000 0.188 0.000 0.800
#> GSM613647     4  0.3929     0.5156 0.016 0.004 0.028 0.780 0.168 0.004
#> GSM613648     4  0.2989     0.5471 0.000 0.004 0.120 0.848 0.012 0.016
#> GSM613649     4  0.4986     0.5020 0.000 0.004 0.248 0.668 0.048 0.032
#> GSM613650     6  0.5717     0.4330 0.156 0.016 0.000 0.256 0.000 0.572
#> GSM613651     4  0.5124     0.3482 0.324 0.000 0.012 0.592 0.072 0.000
#> GSM613652     1  0.1074     0.8522 0.960 0.012 0.000 0.028 0.000 0.000
#> GSM613653     6  0.1296     0.6897 0.004 0.004 0.000 0.044 0.000 0.948
#> GSM613654     1  0.1391     0.8516 0.944 0.016 0.000 0.040 0.000 0.000
#> GSM613655     1  0.0146     0.8497 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM613656     1  0.0405     0.8498 0.988 0.004 0.000 0.008 0.000 0.000
#> GSM613657     3  0.3930     0.2455 0.000 0.004 0.628 0.364 0.004 0.000
#> GSM613658     1  0.0551     0.8499 0.984 0.008 0.000 0.004 0.000 0.004
#> GSM613659     2  0.6157     0.4586 0.004 0.624 0.052 0.196 0.020 0.104
#> GSM613660     3  0.2480     0.5540 0.000 0.104 0.872 0.024 0.000 0.000
#> GSM613661     1  0.3896     0.7741 0.808 0.100 0.000 0.036 0.004 0.052
#> GSM613662     2  0.4602     0.0792 0.000 0.528 0.008 0.016 0.004 0.444
#> GSM613663     1  0.1364     0.8492 0.952 0.020 0.000 0.012 0.000 0.016
#> GSM613664     2  0.4763     0.5669 0.000 0.700 0.164 0.004 0.004 0.128
#> GSM613665     3  0.3934     0.0679 0.000 0.376 0.616 0.008 0.000 0.000
#> GSM613666     1  0.3580     0.7126 0.772 0.196 0.000 0.004 0.000 0.028
#> GSM613667     1  0.7554    -0.0636 0.372 0.280 0.004 0.116 0.004 0.224
#> GSM613668     1  0.0405     0.8493 0.988 0.008 0.000 0.004 0.000 0.000
#> GSM613669     1  0.2189     0.8401 0.916 0.028 0.000 0.024 0.004 0.028
#> GSM613670     6  0.4289     0.3336 0.000 0.340 0.000 0.024 0.004 0.632
#> GSM613671     1  0.3582     0.7899 0.820 0.064 0.000 0.020 0.000 0.096
#> GSM613672     1  0.0622     0.8504 0.980 0.008 0.000 0.012 0.000 0.000
#> GSM613673     1  0.2126     0.8348 0.904 0.072 0.004 0.020 0.000 0.000
#> GSM613674     2  0.4578     0.3470 0.000 0.568 0.396 0.000 0.032 0.004
#> GSM613675     2  0.5693     0.3770 0.000 0.616 0.024 0.120 0.008 0.232
#> GSM613676     2  0.5206     0.2546 0.000 0.492 0.436 0.012 0.060 0.000
#> GSM613677     4  0.6783     0.3399 0.000 0.108 0.288 0.476 0.128 0.000
#> GSM613678     2  0.6267     0.4488 0.012 0.612 0.056 0.116 0.008 0.196
#> GSM613679     3  0.3727     0.0491 0.000 0.388 0.612 0.000 0.000 0.000
#> GSM613680     1  0.1176     0.8521 0.956 0.024 0.000 0.020 0.000 0.000
#> GSM613681     1  0.1699     0.8481 0.936 0.032 0.000 0.016 0.000 0.016
#> GSM613682     1  0.4538     0.4194 0.612 0.340 0.048 0.000 0.000 0.000
#> GSM613683     1  0.0405     0.8493 0.988 0.008 0.000 0.004 0.000 0.000
#> GSM613684     2  0.5425     0.4242 0.000 0.560 0.156 0.000 0.284 0.000
#> GSM613685     2  0.4772     0.2268 0.000 0.504 0.452 0.000 0.040 0.004
#> GSM613686     2  0.7178     0.1354 0.348 0.392 0.028 0.032 0.004 0.196
#> GSM613687     1  0.1458     0.8499 0.948 0.020 0.000 0.016 0.000 0.016
#> GSM613688     2  0.4194     0.5104 0.000 0.692 0.272 0.000 0.024 0.012
#> GSM613689     3  0.1693     0.6077 0.000 0.020 0.932 0.044 0.004 0.000
#> GSM613690     4  0.5398     0.2142 0.004 0.016 0.060 0.504 0.416 0.000
#> GSM613691     6  0.3352     0.5808 0.000 0.208 0.000 0.008 0.008 0.776
#> GSM613692     1  0.4198     0.7222 0.768 0.020 0.000 0.084 0.128 0.000
#> GSM613693     2  0.5584     0.5175 0.000 0.656 0.200 0.008 0.080 0.056
#> GSM613694     1  0.2288     0.8421 0.896 0.028 0.000 0.072 0.000 0.004
#> GSM613695     4  0.4624     0.3028 0.012 0.032 0.004 0.648 0.304 0.000
#> GSM613696     2  0.6836     0.4242 0.176 0.588 0.064 0.024 0.128 0.020
#> GSM613697     1  0.5894    -0.0512 0.464 0.008 0.000 0.368 0.160 0.000
#> GSM613698     4  0.6200     0.1631 0.020 0.076 0.000 0.536 0.324 0.044
#> GSM613699     1  0.5397     0.6745 0.708 0.040 0.128 0.100 0.020 0.004
#> GSM613700     3  0.1934     0.5963 0.000 0.044 0.916 0.040 0.000 0.000
#> GSM613701     3  0.4258     0.5124 0.088 0.068 0.792 0.044 0.004 0.004
#> GSM613702     3  0.6609     0.3732 0.048 0.080 0.536 0.296 0.004 0.036
#> GSM613703     6  0.2271     0.6670 0.004 0.056 0.000 0.032 0.004 0.904
#> GSM613704     6  0.2214     0.6625 0.000 0.092 0.012 0.004 0.000 0.892
#> GSM613705     4  0.4799     0.3834 0.040 0.000 0.356 0.592 0.012 0.000
#> GSM613706     3  0.5553     0.3849 0.160 0.020 0.632 0.184 0.000 0.004
#> GSM613707     3  0.4591    -0.0588 0.000 0.408 0.552 0.000 0.040 0.000
#> GSM613708     1  0.3793     0.7909 0.812 0.020 0.000 0.080 0.004 0.084
#> GSM613709     1  0.2675     0.8311 0.888 0.020 0.000 0.036 0.004 0.052
#> GSM613710     3  0.2454     0.5618 0.000 0.000 0.840 0.160 0.000 0.000
#> GSM613711     4  0.4722     0.1453 0.000 0.000 0.468 0.492 0.036 0.004
#> GSM613712     4  0.5271     0.3483 0.084 0.000 0.000 0.576 0.328 0.012
#> GSM613713     3  0.5285     0.4899 0.000 0.172 0.688 0.092 0.040 0.008
#> GSM613714     4  0.4069     0.3329 0.000 0.004 0.376 0.612 0.008 0.000
#> GSM613715     4  0.4645     0.4949 0.000 0.000 0.044 0.712 0.204 0.040
#> GSM613716     4  0.5603    -0.2400 0.000 0.032 0.000 0.452 0.064 0.452
#> GSM613717     3  0.4128    -0.1137 0.000 0.000 0.500 0.492 0.004 0.004
#> GSM613718     4  0.5116     0.5197 0.000 0.000 0.168 0.644 0.184 0.004
#> GSM613719     6  0.3720     0.6588 0.000 0.020 0.000 0.208 0.012 0.760
#> GSM613720     6  0.6193     0.5432 0.000 0.104 0.004 0.168 0.116 0.608
#> GSM613721     6  0.4855     0.5664 0.000 0.212 0.020 0.020 0.044 0.704
#> GSM613722     3  0.1124     0.5878 0.000 0.036 0.956 0.008 0.000 0.000
#> GSM613723     1  0.1579     0.8493 0.944 0.020 0.000 0.024 0.008 0.004
#> GSM613724     1  0.1269     0.8512 0.956 0.020 0.000 0.012 0.000 0.012
#> GSM613725     3  0.1700     0.5580 0.000 0.080 0.916 0.000 0.004 0.000
#> GSM613726     1  0.2653     0.8430 0.896 0.024 0.024 0.020 0.000 0.036
#> GSM613727     1  0.1053     0.8513 0.964 0.020 0.000 0.012 0.000 0.004
#> GSM613728     3  0.6472     0.2298 0.000 0.084 0.548 0.024 0.064 0.280
#> GSM613729     1  0.3399     0.7924 0.816 0.020 0.000 0.024 0.000 0.140
#> GSM613730     6  0.7299     0.1267 0.004 0.048 0.348 0.128 0.048 0.424
#> GSM613731     1  0.2736     0.8369 0.888 0.048 0.012 0.036 0.000 0.016
#> GSM613732     5  0.4319     0.6275 0.000 0.020 0.060 0.160 0.756 0.004
#> GSM613733     3  0.2959     0.5789 0.000 0.008 0.844 0.124 0.024 0.000
#> GSM613734     1  0.1148     0.8498 0.960 0.016 0.000 0.020 0.000 0.004
#> GSM613735     1  0.1129     0.8512 0.964 0.012 0.000 0.012 0.004 0.008
#> GSM613736     3  0.7494     0.2215 0.000 0.144 0.436 0.156 0.248 0.016
#> GSM613737     1  0.7665     0.3549 0.516 0.052 0.064 0.228 0.092 0.048
#> GSM613738     1  0.3436     0.8160 0.852 0.032 0.000 0.060 0.028 0.028
#> GSM613739     1  0.1921     0.8484 0.928 0.024 0.000 0.032 0.012 0.004
#> GSM613740     5  0.7070     0.1593 0.000 0.068 0.304 0.096 0.484 0.048
#> GSM613741     6  0.3910     0.6699 0.004 0.052 0.020 0.040 0.056 0.828
#> GSM613742     1  0.4755     0.7676 0.784 0.052 0.016 0.064 0.048 0.036
#> GSM613743     3  0.6205     0.3710 0.000 0.024 0.560 0.184 0.220 0.012
#> GSM613744     3  0.6259     0.1762 0.000 0.020 0.508 0.312 0.148 0.012
#> GSM613745     6  0.6244     0.6110 0.004 0.100 0.024 0.160 0.076 0.636
#> GSM613746     6  0.5208     0.5151 0.000 0.264 0.012 0.008 0.080 0.636
#> GSM613747     1  0.1434     0.8490 0.948 0.024 0.000 0.020 0.000 0.008
#> GSM613748     3  0.5108     0.5140 0.004 0.068 0.696 0.196 0.008 0.028
#> GSM613749     1  0.7195     0.4361 0.540 0.076 0.236 0.028 0.028 0.092
#> GSM613750     5  0.2100     0.7839 0.000 0.004 0.000 0.112 0.884 0.000
#> GSM613751     5  0.2361     0.7837 0.000 0.028 0.000 0.088 0.884 0.000
#> GSM613752     5  0.2094     0.7851 0.000 0.020 0.000 0.080 0.900 0.000
#> GSM613753     5  0.2212     0.7827 0.000 0.008 0.000 0.112 0.880 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-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 disease.state(p) k
#> CV:NMF 115         5.80e-02 2
#> CV:NMF 110         6.73e-03 3
#> CV:NMF  83         2.51e-01 4
#> CV:NMF  81         1.63e-03 5
#> CV:NMF  69         3.11e-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 27425 rows and 116 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.576           0.824       0.915         0.4539 0.544   0.544
#> 3 3 0.414           0.605       0.767         0.3753 0.770   0.586
#> 4 4 0.490           0.598       0.770         0.1080 0.879   0.684
#> 5 5 0.520           0.624       0.727         0.0617 0.921   0.753
#> 6 6 0.530           0.583       0.639         0.0617 0.950   0.809

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
#> GSM613638     2  0.6623     0.8241 0.172 0.828
#> GSM613639     1  0.9775     0.2519 0.588 0.412
#> GSM613640     2  0.9170     0.5760 0.332 0.668
#> GSM613641     1  0.0000     0.8994 1.000 0.000
#> GSM613642     2  0.2778     0.8999 0.048 0.952
#> GSM613643     1  0.9998    -0.0361 0.508 0.492
#> GSM613644     2  0.9881     0.3132 0.436 0.564
#> GSM613645     1  0.7883     0.6710 0.764 0.236
#> GSM613646     2  0.4562     0.8824 0.096 0.904
#> GSM613647     2  0.6343     0.8383 0.160 0.840
#> GSM613648     2  0.5737     0.8555 0.136 0.864
#> GSM613649     2  0.0376     0.9063 0.004 0.996
#> GSM613650     2  0.7376     0.7920 0.208 0.792
#> GSM613651     2  0.9460     0.5253 0.364 0.636
#> GSM613652     1  0.0000     0.8994 1.000 0.000
#> GSM613653     2  0.7376     0.7920 0.208 0.792
#> GSM613654     1  0.0000     0.8994 1.000 0.000
#> GSM613655     1  0.0000     0.8994 1.000 0.000
#> GSM613656     1  0.0000     0.8994 1.000 0.000
#> GSM613657     2  0.0000     0.9067 0.000 1.000
#> GSM613658     1  0.0000     0.8994 1.000 0.000
#> GSM613659     2  0.4298     0.8865 0.088 0.912
#> GSM613660     2  0.0000     0.9067 0.000 1.000
#> GSM613661     1  0.1184     0.8946 0.984 0.016
#> GSM613662     2  0.0000     0.9067 0.000 1.000
#> GSM613663     1  0.0376     0.8988 0.996 0.004
#> GSM613664     2  0.0000     0.9067 0.000 1.000
#> GSM613665     2  0.0000     0.9067 0.000 1.000
#> GSM613666     1  0.0000     0.8994 1.000 0.000
#> GSM613667     1  0.7299     0.7119 0.796 0.204
#> GSM613668     1  0.0000     0.8994 1.000 0.000
#> GSM613669     1  0.0000     0.8994 1.000 0.000
#> GSM613670     2  0.0000     0.9067 0.000 1.000
#> GSM613671     1  0.0000     0.8994 1.000 0.000
#> GSM613672     1  0.0376     0.8988 0.996 0.004
#> GSM613673     1  0.0376     0.8988 0.996 0.004
#> GSM613674     2  0.0000     0.9067 0.000 1.000
#> GSM613675     2  0.0376     0.9059 0.004 0.996
#> GSM613676     2  0.0000     0.9067 0.000 1.000
#> GSM613677     2  0.3114     0.8986 0.056 0.944
#> GSM613678     2  0.3879     0.8917 0.076 0.924
#> GSM613679     2  0.0000     0.9067 0.000 1.000
#> GSM613680     1  0.0376     0.8988 0.996 0.004
#> GSM613681     1  0.1633     0.8906 0.976 0.024
#> GSM613682     1  0.4022     0.8547 0.920 0.080
#> GSM613683     1  0.0376     0.8988 0.996 0.004
#> GSM613684     2  0.0000     0.9067 0.000 1.000
#> GSM613685     2  0.0000     0.9067 0.000 1.000
#> GSM613686     1  0.7528     0.7186 0.784 0.216
#> GSM613687     1  0.1633     0.8906 0.976 0.024
#> GSM613688     2  0.0000     0.9067 0.000 1.000
#> GSM613689     2  0.4562     0.8824 0.096 0.904
#> GSM613690     2  0.3733     0.8936 0.072 0.928
#> GSM613691     2  0.3733     0.8928 0.072 0.928
#> GSM613692     1  1.0000    -0.1240 0.500 0.500
#> GSM613693     2  0.0000     0.9067 0.000 1.000
#> GSM613694     2  0.5059     0.8744 0.112 0.888
#> GSM613695     2  0.5946     0.8502 0.144 0.856
#> GSM613696     2  0.4161     0.8883 0.084 0.916
#> GSM613697     2  0.9460     0.5253 0.364 0.636
#> GSM613698     2  0.7950     0.7492 0.240 0.760
#> GSM613699     2  0.4690     0.8807 0.100 0.900
#> GSM613700     2  0.0000     0.9067 0.000 1.000
#> GSM613701     2  0.8861     0.6025 0.304 0.696
#> GSM613702     2  0.8555     0.6465 0.280 0.720
#> GSM613703     1  0.0376     0.8988 0.996 0.004
#> GSM613704     2  0.0000     0.9067 0.000 1.000
#> GSM613705     2  0.6148     0.8430 0.152 0.848
#> GSM613706     2  0.8861     0.6079 0.304 0.696
#> GSM613707     2  0.0000     0.9067 0.000 1.000
#> GSM613708     1  0.7815     0.6751 0.768 0.232
#> GSM613709     1  0.0000     0.8994 1.000 0.000
#> GSM613710     2  0.0000     0.9067 0.000 1.000
#> GSM613711     2  0.0000     0.9067 0.000 1.000
#> GSM613712     2  0.7056     0.8108 0.192 0.808
#> GSM613713     2  0.0000     0.9067 0.000 1.000
#> GSM613714     2  0.5946     0.8502 0.144 0.856
#> GSM613715     2  0.3431     0.8959 0.064 0.936
#> GSM613716     2  0.5842     0.8533 0.140 0.860
#> GSM613717     2  0.0000     0.9067 0.000 1.000
#> GSM613718     2  0.0000     0.9067 0.000 1.000
#> GSM613719     2  0.7376     0.7920 0.208 0.792
#> GSM613720     2  0.0000     0.9067 0.000 1.000
#> GSM613721     2  0.1633     0.9036 0.024 0.976
#> GSM613722     2  0.0000     0.9067 0.000 1.000
#> GSM613723     1  0.0000     0.8994 1.000 0.000
#> GSM613724     1  0.0376     0.8988 0.996 0.004
#> GSM613725     2  0.0000     0.9067 0.000 1.000
#> GSM613726     1  0.8386     0.6062 0.732 0.268
#> GSM613727     1  0.0000     0.8994 1.000 0.000
#> GSM613728     2  0.1843     0.9033 0.028 0.972
#> GSM613729     1  0.0376     0.8988 0.996 0.004
#> GSM613730     2  0.2778     0.8989 0.048 0.952
#> GSM613731     1  0.9998    -0.0361 0.508 0.492
#> GSM613732     2  0.0000     0.9067 0.000 1.000
#> GSM613733     2  0.0000     0.9067 0.000 1.000
#> GSM613734     1  0.0000     0.8994 1.000 0.000
#> GSM613735     1  0.0000     0.8994 1.000 0.000
#> GSM613736     2  0.0000     0.9067 0.000 1.000
#> GSM613737     2  0.6623     0.8285 0.172 0.828
#> GSM613738     1  0.3431     0.8635 0.936 0.064
#> GSM613739     1  0.3431     0.8635 0.936 0.064
#> GSM613740     2  0.0000     0.9067 0.000 1.000
#> GSM613741     2  0.7376     0.7920 0.208 0.792
#> GSM613742     1  0.3431     0.8635 0.936 0.064
#> GSM613743     2  0.0000     0.9067 0.000 1.000
#> GSM613744     2  0.0000     0.9067 0.000 1.000
#> GSM613745     2  0.4562     0.8824 0.096 0.904
#> GSM613746     2  0.0000     0.9067 0.000 1.000
#> GSM613747     1  0.0000     0.8994 1.000 0.000
#> GSM613748     2  0.3879     0.8902 0.076 0.924
#> GSM613749     2  0.9460     0.4628 0.364 0.636
#> GSM613750     2  0.0000     0.9067 0.000 1.000
#> GSM613751     2  0.0000     0.9067 0.000 1.000
#> GSM613752     2  0.0000     0.9067 0.000 1.000
#> GSM613753     2  0.0000     0.9067 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
#> GSM613638     3  0.9075      0.331 0.140 0.388 0.472
#> GSM613639     1  0.8926      0.198 0.568 0.192 0.240
#> GSM613640     3  0.9849      0.372 0.300 0.280 0.420
#> GSM613641     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613642     2  0.6217      0.493 0.024 0.712 0.264
#> GSM613643     1  0.9563     -0.026 0.480 0.236 0.284
#> GSM613644     1  0.9602     -0.313 0.404 0.200 0.396
#> GSM613645     1  0.6662      0.616 0.736 0.072 0.192
#> GSM613646     3  0.7332      0.612 0.064 0.276 0.660
#> GSM613647     3  0.6526      0.713 0.128 0.112 0.760
#> GSM613648     3  0.7677      0.671 0.120 0.204 0.676
#> GSM613649     2  0.6111      0.418 0.000 0.604 0.396
#> GSM613650     3  0.7875      0.701 0.176 0.156 0.668
#> GSM613651     3  0.7622      0.561 0.332 0.060 0.608
#> GSM613652     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613653     3  0.7927      0.700 0.176 0.160 0.664
#> GSM613654     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613655     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613656     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613657     2  0.5968      0.467 0.000 0.636 0.364
#> GSM613658     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613659     2  0.7770      0.113 0.056 0.560 0.384
#> GSM613660     2  0.0424      0.697 0.000 0.992 0.008
#> GSM613661     1  0.1399      0.871 0.968 0.004 0.028
#> GSM613662     2  0.0000      0.696 0.000 1.000 0.000
#> GSM613663     1  0.0829      0.878 0.984 0.004 0.012
#> GSM613664     2  0.0424      0.697 0.000 0.992 0.008
#> GSM613665     2  0.0747      0.699 0.000 0.984 0.016
#> GSM613666     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613667     1  0.5901      0.655 0.768 0.040 0.192
#> GSM613668     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613669     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613670     2  0.0000      0.696 0.000 1.000 0.000
#> GSM613671     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613672     1  0.0661      0.880 0.988 0.004 0.008
#> GSM613673     1  0.0983      0.877 0.980 0.004 0.016
#> GSM613674     2  0.0000      0.696 0.000 1.000 0.000
#> GSM613675     2  0.1525      0.696 0.004 0.964 0.032
#> GSM613676     2  0.0747      0.699 0.000 0.984 0.016
#> GSM613677     2  0.6630      0.425 0.028 0.672 0.300
#> GSM613678     2  0.7368      0.229 0.044 0.604 0.352
#> GSM613679     2  0.0237      0.697 0.000 0.996 0.004
#> GSM613680     1  0.0661      0.880 0.988 0.004 0.008
#> GSM613681     1  0.1620      0.870 0.964 0.024 0.012
#> GSM613682     1  0.3272      0.820 0.904 0.080 0.016
#> GSM613683     1  0.0661      0.880 0.988 0.004 0.008
#> GSM613684     2  0.1753      0.694 0.000 0.952 0.048
#> GSM613685     2  0.0000      0.696 0.000 1.000 0.000
#> GSM613686     1  0.5708      0.661 0.768 0.204 0.028
#> GSM613687     1  0.1620      0.870 0.964 0.024 0.012
#> GSM613688     2  0.1753      0.694 0.000 0.952 0.048
#> GSM613689     3  0.6576      0.682 0.068 0.192 0.740
#> GSM613690     3  0.7442      0.371 0.044 0.368 0.588
#> GSM613691     3  0.7492      0.528 0.052 0.340 0.608
#> GSM613692     3  0.7672      0.247 0.468 0.044 0.488
#> GSM613693     2  0.2261      0.687 0.000 0.932 0.068
#> GSM613694     3  0.6407      0.699 0.080 0.160 0.760
#> GSM613695     3  0.7082      0.710 0.120 0.156 0.724
#> GSM613696     3  0.7250      0.601 0.056 0.288 0.656
#> GSM613697     3  0.7622      0.561 0.332 0.060 0.608
#> GSM613698     3  0.7525      0.689 0.208 0.108 0.684
#> GSM613699     3  0.6562      0.688 0.072 0.184 0.744
#> GSM613700     2  0.0000      0.696 0.000 1.000 0.000
#> GSM613701     2  0.9830     -0.128 0.272 0.424 0.304
#> GSM613702     2  0.9804     -0.155 0.248 0.416 0.336
#> GSM613703     1  0.0237      0.881 0.996 0.004 0.000
#> GSM613704     2  0.0000      0.696 0.000 1.000 0.000
#> GSM613705     3  0.8871      0.301 0.120 0.408 0.472
#> GSM613706     2  0.9880     -0.177 0.272 0.404 0.324
#> GSM613707     2  0.0747      0.698 0.000 0.984 0.016
#> GSM613708     1  0.6587      0.635 0.752 0.156 0.092
#> GSM613709     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613710     2  0.0424      0.697 0.000 0.992 0.008
#> GSM613711     2  0.5948      0.470 0.000 0.640 0.360
#> GSM613712     3  0.7265      0.710 0.160 0.128 0.712
#> GSM613713     2  0.5016      0.585 0.000 0.760 0.240
#> GSM613714     3  0.7082      0.710 0.120 0.156 0.724
#> GSM613715     3  0.7487      0.263 0.040 0.408 0.552
#> GSM613716     3  0.6960      0.714 0.116 0.152 0.732
#> GSM613717     2  0.5968      0.467 0.000 0.636 0.364
#> GSM613718     2  0.5968      0.467 0.000 0.636 0.364
#> GSM613719     3  0.7927      0.700 0.176 0.160 0.664
#> GSM613720     2  0.2711      0.679 0.000 0.912 0.088
#> GSM613721     2  0.6045      0.312 0.000 0.620 0.380
#> GSM613722     2  0.1031      0.691 0.000 0.976 0.024
#> GSM613723     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613724     1  0.0829      0.878 0.984 0.004 0.012
#> GSM613725     2  0.0000      0.696 0.000 1.000 0.000
#> GSM613726     1  0.7372      0.554 0.704 0.128 0.168
#> GSM613727     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613728     2  0.4840      0.603 0.016 0.816 0.168
#> GSM613729     1  0.0237      0.881 0.996 0.004 0.000
#> GSM613730     2  0.6062      0.448 0.016 0.708 0.276
#> GSM613731     1  0.9563     -0.026 0.480 0.236 0.284
#> GSM613732     2  0.5968      0.467 0.000 0.636 0.364
#> GSM613733     2  0.5905      0.481 0.000 0.648 0.352
#> GSM613734     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613735     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613736     2  0.5905      0.468 0.000 0.648 0.352
#> GSM613737     3  0.6644      0.713 0.140 0.108 0.752
#> GSM613738     1  0.2537      0.831 0.920 0.000 0.080
#> GSM613739     1  0.2537      0.831 0.920 0.000 0.080
#> GSM613740     2  0.5905      0.479 0.000 0.648 0.352
#> GSM613741     3  0.7927      0.700 0.176 0.160 0.664
#> GSM613742     1  0.2537      0.831 0.920 0.000 0.080
#> GSM613743     2  0.5810      0.499 0.000 0.664 0.336
#> GSM613744     2  0.5968      0.467 0.000 0.636 0.364
#> GSM613745     3  0.7332      0.612 0.064 0.276 0.660
#> GSM613746     2  0.1860      0.692 0.000 0.948 0.052
#> GSM613747     1  0.0000      0.881 1.000 0.000 0.000
#> GSM613748     2  0.7406      0.228 0.044 0.596 0.360
#> GSM613749     2  0.9895     -0.137 0.332 0.396 0.272
#> GSM613750     3  0.4178      0.422 0.000 0.172 0.828
#> GSM613751     3  0.4178      0.422 0.000 0.172 0.828
#> GSM613752     3  0.4178      0.422 0.000 0.172 0.828
#> GSM613753     3  0.4178      0.422 0.000 0.172 0.828

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM613638     3  0.8068     0.4608 0.120 0.276 0.540 0.064
#> GSM613639     1  0.7176     0.1403 0.536 0.108 0.344 0.012
#> GSM613640     3  0.7386     0.5069 0.268 0.160 0.560 0.012
#> GSM613641     1  0.0000     0.8891 1.000 0.000 0.000 0.000
#> GSM613642     2  0.6385     0.3531 0.008 0.628 0.288 0.076
#> GSM613643     1  0.7607    -0.1184 0.448 0.140 0.400 0.012
#> GSM613644     3  0.7252     0.3454 0.372 0.108 0.508 0.012
#> GSM613645     1  0.5094     0.5942 0.724 0.024 0.244 0.008
#> GSM613646     3  0.3689     0.5933 0.036 0.068 0.872 0.024
#> GSM613647     3  0.3463     0.5838 0.096 0.000 0.864 0.040
#> GSM613648     3  0.5666     0.5372 0.088 0.064 0.772 0.076
#> GSM613649     3  0.7789    -0.3673 0.000 0.352 0.400 0.248
#> GSM613650     3  0.3822     0.6102 0.140 0.016 0.836 0.008
#> GSM613651     3  0.5792     0.4875 0.296 0.000 0.648 0.056
#> GSM613652     1  0.0336     0.8876 0.992 0.000 0.008 0.000
#> GSM613653     3  0.3949     0.6107 0.140 0.016 0.832 0.012
#> GSM613654     1  0.0336     0.8876 0.992 0.000 0.008 0.000
#> GSM613655     1  0.0000     0.8891 1.000 0.000 0.000 0.000
#> GSM613656     1  0.0336     0.8876 0.992 0.000 0.008 0.000
#> GSM613657     2  0.7786     0.3661 0.000 0.388 0.368 0.244
#> GSM613658     1  0.0000     0.8891 1.000 0.000 0.000 0.000
#> GSM613659     3  0.6637     0.3353 0.032 0.344 0.584 0.040
#> GSM613660     2  0.1297     0.6859 0.000 0.964 0.020 0.016
#> GSM613661     1  0.1209     0.8782 0.964 0.004 0.032 0.000
#> GSM613662     2  0.2131     0.6781 0.000 0.932 0.032 0.036
#> GSM613663     1  0.0779     0.8865 0.980 0.004 0.016 0.000
#> GSM613664     2  0.1510     0.6792 0.000 0.956 0.028 0.016
#> GSM613665     2  0.2111     0.6891 0.000 0.932 0.044 0.024
#> GSM613666     1  0.0000     0.8891 1.000 0.000 0.000 0.000
#> GSM613667     1  0.4408     0.6321 0.756 0.008 0.232 0.004
#> GSM613668     1  0.0000     0.8891 1.000 0.000 0.000 0.000
#> GSM613669     1  0.0000     0.8891 1.000 0.000 0.000 0.000
#> GSM613670     2  0.2131     0.6781 0.000 0.932 0.032 0.036
#> GSM613671     1  0.0000     0.8891 1.000 0.000 0.000 0.000
#> GSM613672     1  0.0657     0.8876 0.984 0.004 0.012 0.000
#> GSM613673     1  0.0895     0.8848 0.976 0.004 0.020 0.000
#> GSM613674     2  0.0592     0.6770 0.000 0.984 0.000 0.016
#> GSM613675     2  0.3308     0.6605 0.000 0.872 0.092 0.036
#> GSM613676     2  0.2111     0.6891 0.000 0.932 0.044 0.024
#> GSM613677     2  0.7130     0.2075 0.016 0.556 0.328 0.100
#> GSM613678     3  0.6380     0.1730 0.020 0.460 0.492 0.028
#> GSM613679     2  0.0927     0.6827 0.000 0.976 0.008 0.016
#> GSM613680     1  0.0657     0.8876 0.984 0.004 0.012 0.000
#> GSM613681     1  0.1484     0.8787 0.960 0.016 0.020 0.004
#> GSM613682     1  0.3130     0.8244 0.892 0.072 0.024 0.012
#> GSM613683     1  0.0657     0.8876 0.984 0.004 0.012 0.000
#> GSM613684     2  0.4636     0.6568 0.000 0.792 0.140 0.068
#> GSM613685     2  0.0592     0.6770 0.000 0.984 0.000 0.016
#> GSM613686     1  0.5347     0.6726 0.756 0.176 0.048 0.020
#> GSM613687     1  0.1484     0.8787 0.960 0.016 0.020 0.004
#> GSM613688     2  0.4387     0.6610 0.000 0.804 0.144 0.052
#> GSM613689     3  0.3280     0.5602 0.040 0.020 0.892 0.048
#> GSM613690     3  0.6338     0.4182 0.028 0.124 0.708 0.140
#> GSM613691     3  0.4596     0.5433 0.028 0.140 0.808 0.024
#> GSM613692     3  0.6187     0.2361 0.432 0.000 0.516 0.052
#> GSM613693     2  0.5883     0.6244 0.000 0.700 0.172 0.128
#> GSM613694     3  0.2494     0.5710 0.048 0.000 0.916 0.036
#> GSM613695     3  0.4504     0.5719 0.088 0.020 0.828 0.064
#> GSM613696     3  0.3771     0.5815 0.032 0.084 0.864 0.020
#> GSM613697     3  0.5792     0.4875 0.296 0.000 0.648 0.056
#> GSM613698     3  0.4292     0.5898 0.180 0.008 0.796 0.016
#> GSM613699     3  0.3135     0.5642 0.044 0.012 0.896 0.048
#> GSM613700     2  0.0592     0.6785 0.000 0.984 0.000 0.016
#> GSM613701     3  0.8323     0.3564 0.244 0.328 0.408 0.020
#> GSM613702     3  0.8203     0.3791 0.220 0.320 0.440 0.020
#> GSM613703     1  0.0336     0.8888 0.992 0.000 0.008 0.000
#> GSM613704     2  0.2131     0.6781 0.000 0.932 0.032 0.036
#> GSM613705     3  0.8023     0.4269 0.100 0.304 0.528 0.068
#> GSM613706     3  0.8274     0.3927 0.244 0.304 0.432 0.020
#> GSM613707     2  0.2021     0.6842 0.000 0.936 0.024 0.040
#> GSM613708     1  0.5575     0.6280 0.736 0.104 0.156 0.004
#> GSM613709     1  0.0000     0.8891 1.000 0.000 0.000 0.000
#> GSM613710     2  0.1297     0.6859 0.000 0.964 0.020 0.016
#> GSM613711     2  0.7772     0.3707 0.000 0.392 0.368 0.240
#> GSM613712     3  0.5437     0.5703 0.124 0.020 0.768 0.088
#> GSM613713     2  0.7317     0.5079 0.000 0.528 0.268 0.204
#> GSM613714     3  0.4504     0.5719 0.088 0.020 0.828 0.064
#> GSM613715     3  0.6610     0.3731 0.024 0.160 0.680 0.136
#> GSM613716     3  0.4326     0.5890 0.088 0.036 0.840 0.036
#> GSM613717     2  0.7786     0.3661 0.000 0.388 0.368 0.244
#> GSM613718     2  0.7786     0.3661 0.000 0.388 0.368 0.244
#> GSM613719     3  0.3949     0.6107 0.140 0.016 0.832 0.012
#> GSM613720     2  0.6714     0.5662 0.000 0.612 0.228 0.160
#> GSM613721     3  0.6520     0.0648 0.000 0.384 0.536 0.080
#> GSM613722     2  0.1724     0.6790 0.000 0.948 0.032 0.020
#> GSM613723     1  0.0336     0.8876 0.992 0.000 0.008 0.000
#> GSM613724     1  0.0779     0.8865 0.980 0.004 0.016 0.000
#> GSM613725     2  0.0592     0.6785 0.000 0.984 0.000 0.016
#> GSM613726     1  0.6252     0.5123 0.676 0.088 0.224 0.012
#> GSM613727     1  0.0000     0.8891 1.000 0.000 0.000 0.000
#> GSM613728     2  0.5433     0.4329 0.004 0.688 0.272 0.036
#> GSM613729     1  0.0336     0.8888 0.992 0.000 0.008 0.000
#> GSM613730     2  0.5810     0.1423 0.004 0.580 0.388 0.028
#> GSM613731     1  0.7607    -0.1184 0.448 0.140 0.400 0.012
#> GSM613732     2  0.7786     0.3661 0.000 0.388 0.368 0.244
#> GSM613733     2  0.7740     0.3813 0.000 0.404 0.364 0.232
#> GSM613734     1  0.0336     0.8876 0.992 0.000 0.008 0.000
#> GSM613735     1  0.0469     0.8870 0.988 0.000 0.012 0.000
#> GSM613736     3  0.7684    -0.3982 0.000 0.388 0.396 0.216
#> GSM613737     3  0.3557     0.5856 0.108 0.000 0.856 0.036
#> GSM613738     1  0.2216     0.8329 0.908 0.000 0.092 0.000
#> GSM613739     1  0.2216     0.8329 0.908 0.000 0.092 0.000
#> GSM613740     2  0.7758     0.3796 0.000 0.396 0.368 0.236
#> GSM613741     3  0.3949     0.6107 0.140 0.016 0.832 0.012
#> GSM613742     1  0.2216     0.8329 0.908 0.000 0.092 0.000
#> GSM613743     2  0.7733     0.4015 0.000 0.412 0.356 0.232
#> GSM613744     2  0.7799     0.3599 0.000 0.384 0.368 0.248
#> GSM613745     3  0.3689     0.5933 0.036 0.068 0.872 0.024
#> GSM613746     2  0.6433     0.5851 0.000 0.648 0.188 0.164
#> GSM613747     1  0.0336     0.8876 0.992 0.000 0.008 0.000
#> GSM613748     3  0.6636     0.1466 0.032 0.468 0.472 0.028
#> GSM613749     3  0.8446     0.3234 0.304 0.308 0.368 0.020
#> GSM613750     4  0.3486     1.0000 0.000 0.000 0.188 0.812
#> GSM613751     4  0.3486     1.0000 0.000 0.000 0.188 0.812
#> GSM613752     4  0.3486     1.0000 0.000 0.000 0.188 0.812
#> GSM613753     4  0.3486     1.0000 0.000 0.000 0.188 0.812

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     4  0.7443     0.4109 0.052 0.200 0.124 0.576 0.048
#> GSM613639     1  0.6537    -0.0359 0.448 0.096 0.016 0.432 0.008
#> GSM613640     4  0.6669     0.4959 0.196 0.128 0.052 0.616 0.008
#> GSM613641     1  0.0162     0.8814 0.996 0.000 0.000 0.000 0.004
#> GSM613642     2  0.7580     0.4113 0.004 0.452 0.212 0.280 0.052
#> GSM613643     4  0.7050     0.2073 0.388 0.124 0.032 0.448 0.008
#> GSM613644     4  0.6010     0.4443 0.288 0.096 0.008 0.600 0.008
#> GSM613645     1  0.4468     0.5885 0.696 0.024 0.000 0.276 0.004
#> GSM613646     4  0.3997     0.5908 0.012 0.056 0.092 0.828 0.012
#> GSM613647     4  0.2629     0.6012 0.004 0.000 0.104 0.880 0.012
#> GSM613648     4  0.3832     0.5300 0.000 0.016 0.172 0.796 0.016
#> GSM613649     3  0.4803     0.7492 0.000 0.064 0.712 0.220 0.004
#> GSM613650     4  0.1686     0.6266 0.020 0.008 0.028 0.944 0.000
#> GSM613651     4  0.4799     0.5468 0.164 0.000 0.028 0.752 0.056
#> GSM613652     1  0.2074     0.8671 0.896 0.000 0.000 0.104 0.000
#> GSM613653     4  0.1799     0.6267 0.020 0.012 0.028 0.940 0.000
#> GSM613654     1  0.2074     0.8671 0.896 0.000 0.000 0.104 0.000
#> GSM613655     1  0.0162     0.8814 0.996 0.000 0.000 0.000 0.004
#> GSM613656     1  0.2074     0.8671 0.896 0.000 0.000 0.104 0.000
#> GSM613657     3  0.4681     0.7916 0.000 0.084 0.728 0.188 0.000
#> GSM613658     1  0.0162     0.8814 0.996 0.000 0.000 0.000 0.004
#> GSM613659     4  0.6656     0.2903 0.016 0.304 0.124 0.544 0.012
#> GSM613660     2  0.4439     0.6624 0.000 0.728 0.236 0.012 0.024
#> GSM613661     1  0.1948     0.8785 0.928 0.004 0.008 0.056 0.004
#> GSM613662     2  0.5125     0.5579 0.000 0.748 0.096 0.044 0.112
#> GSM613663     1  0.1285     0.8856 0.956 0.004 0.000 0.036 0.004
#> GSM613664     2  0.3880     0.6668 0.000 0.824 0.112 0.036 0.028
#> GSM613665     2  0.4309     0.6789 0.000 0.792 0.136 0.044 0.028
#> GSM613666     1  0.0162     0.8814 0.996 0.000 0.000 0.000 0.004
#> GSM613667     1  0.3989     0.6326 0.728 0.008 0.000 0.260 0.004
#> GSM613668     1  0.0324     0.8817 0.992 0.000 0.000 0.004 0.004
#> GSM613669     1  0.0162     0.8814 0.996 0.000 0.000 0.000 0.004
#> GSM613670     2  0.5125     0.5579 0.000 0.748 0.096 0.044 0.112
#> GSM613671     1  0.0162     0.8814 0.996 0.000 0.000 0.000 0.004
#> GSM613672     1  0.1124     0.8860 0.960 0.004 0.000 0.036 0.000
#> GSM613673     1  0.1365     0.8848 0.952 0.004 0.000 0.040 0.004
#> GSM613674     2  0.3805     0.6815 0.000 0.784 0.184 0.000 0.032
#> GSM613675     2  0.5478     0.5914 0.000 0.728 0.084 0.108 0.080
#> GSM613676     2  0.4309     0.6789 0.000 0.792 0.136 0.044 0.028
#> GSM613677     2  0.7480     0.2840 0.004 0.404 0.212 0.344 0.036
#> GSM613678     4  0.6198     0.0568 0.020 0.420 0.068 0.488 0.004
#> GSM613679     2  0.3751     0.6825 0.000 0.772 0.212 0.004 0.012
#> GSM613680     1  0.1041     0.8862 0.964 0.004 0.000 0.032 0.000
#> GSM613681     1  0.1862     0.8821 0.932 0.016 0.000 0.048 0.004
#> GSM613682     1  0.2728     0.8399 0.888 0.068 0.000 0.040 0.004
#> GSM613683     1  0.1041     0.8862 0.964 0.004 0.000 0.032 0.000
#> GSM613684     2  0.5690     0.3853 0.000 0.592 0.336 0.032 0.040
#> GSM613685     2  0.3805     0.6815 0.000 0.784 0.184 0.000 0.032
#> GSM613686     1  0.4873     0.6928 0.744 0.168 0.012 0.072 0.004
#> GSM613687     1  0.1862     0.8821 0.932 0.016 0.000 0.048 0.004
#> GSM613688     2  0.5868     0.4271 0.000 0.600 0.312 0.048 0.040
#> GSM613689     4  0.3559     0.5623 0.000 0.008 0.176 0.804 0.012
#> GSM613690     4  0.5041     0.2008 0.000 0.020 0.380 0.588 0.012
#> GSM613691     4  0.4909     0.5232 0.004 0.100 0.144 0.744 0.008
#> GSM613692     4  0.5698     0.3636 0.308 0.000 0.028 0.612 0.052
#> GSM613693     3  0.6334    -0.0438 0.000 0.372 0.520 0.040 0.068
#> GSM613694     4  0.3170     0.5808 0.004 0.000 0.160 0.828 0.008
#> GSM613695     4  0.3022     0.5807 0.000 0.004 0.136 0.848 0.012
#> GSM613696     4  0.4168     0.5745 0.004 0.056 0.124 0.804 0.012
#> GSM613697     4  0.4799     0.5468 0.164 0.000 0.028 0.752 0.056
#> GSM613698     4  0.2654     0.6203 0.056 0.000 0.040 0.896 0.008
#> GSM613699     4  0.3399     0.5690 0.000 0.004 0.172 0.812 0.012
#> GSM613700     2  0.4029     0.6688 0.000 0.744 0.232 0.000 0.024
#> GSM613701     4  0.7710     0.2547 0.236 0.292 0.052 0.416 0.004
#> GSM613702     4  0.7574     0.2849 0.220 0.284 0.048 0.444 0.004
#> GSM613703     1  0.0740     0.8810 0.980 0.000 0.008 0.008 0.004
#> GSM613704     2  0.5125     0.5579 0.000 0.748 0.096 0.044 0.112
#> GSM613705     4  0.7350     0.3799 0.036 0.208 0.136 0.572 0.048
#> GSM613706     4  0.7561     0.3139 0.216 0.268 0.052 0.460 0.004
#> GSM613707     2  0.3976     0.6420 0.000 0.760 0.216 0.004 0.020
#> GSM613708     1  0.5759     0.5729 0.652 0.088 0.012 0.240 0.008
#> GSM613709     1  0.0162     0.8814 0.996 0.000 0.000 0.000 0.004
#> GSM613710     2  0.4439     0.6624 0.000 0.728 0.236 0.012 0.024
#> GSM613711     3  0.4734     0.7915 0.000 0.088 0.724 0.188 0.000
#> GSM613712     4  0.4431     0.5918 0.024 0.004 0.128 0.792 0.052
#> GSM613713     3  0.6225     0.5548 0.000 0.216 0.628 0.116 0.040
#> GSM613714     4  0.3022     0.5807 0.000 0.004 0.136 0.848 0.012
#> GSM613715     4  0.5184     0.0774 0.000 0.036 0.404 0.556 0.004
#> GSM613716     4  0.2957     0.5928 0.000 0.012 0.120 0.860 0.008
#> GSM613717     3  0.4681     0.7916 0.000 0.084 0.728 0.188 0.000
#> GSM613718     3  0.4681     0.7916 0.000 0.084 0.728 0.188 0.000
#> GSM613719     4  0.1799     0.6267 0.020 0.012 0.028 0.940 0.000
#> GSM613720     3  0.7204     0.0872 0.000 0.268 0.484 0.040 0.208
#> GSM613721     4  0.7661     0.1013 0.000 0.220 0.320 0.400 0.060
#> GSM613722     2  0.4839     0.6728 0.000 0.720 0.220 0.036 0.024
#> GSM613723     1  0.2074     0.8671 0.896 0.000 0.000 0.104 0.000
#> GSM613724     1  0.1282     0.8853 0.952 0.004 0.000 0.044 0.000
#> GSM613725     2  0.4029     0.6688 0.000 0.744 0.232 0.000 0.024
#> GSM613726     1  0.5843     0.4862 0.636 0.068 0.020 0.268 0.008
#> GSM613727     1  0.0162     0.8814 0.996 0.000 0.000 0.000 0.004
#> GSM613728     2  0.5987     0.4817 0.004 0.612 0.092 0.276 0.016
#> GSM613729     1  0.0740     0.8810 0.980 0.000 0.008 0.008 0.004
#> GSM613730     2  0.6119     0.2466 0.004 0.512 0.100 0.380 0.004
#> GSM613731     4  0.7050     0.2073 0.388 0.124 0.032 0.448 0.008
#> GSM613732     3  0.4681     0.7916 0.000 0.084 0.728 0.188 0.000
#> GSM613733     3  0.4990     0.7883 0.000 0.096 0.712 0.188 0.004
#> GSM613734     1  0.2074     0.8671 0.896 0.000 0.000 0.104 0.000
#> GSM613735     1  0.2127     0.8651 0.892 0.000 0.000 0.108 0.000
#> GSM613736     3  0.5504     0.7495 0.000 0.092 0.672 0.220 0.016
#> GSM613737     4  0.2805     0.6016 0.012 0.000 0.108 0.872 0.008
#> GSM613738     1  0.3438     0.8044 0.808 0.000 0.020 0.172 0.000
#> GSM613739     1  0.3438     0.8044 0.808 0.000 0.020 0.172 0.000
#> GSM613740     3  0.5059     0.7893 0.000 0.092 0.712 0.188 0.008
#> GSM613741     4  0.1799     0.6267 0.020 0.012 0.028 0.940 0.000
#> GSM613742     1  0.3438     0.8044 0.808 0.000 0.020 0.172 0.000
#> GSM613743     3  0.5292     0.7717 0.000 0.108 0.700 0.180 0.012
#> GSM613744     3  0.4627     0.7882 0.000 0.080 0.732 0.188 0.000
#> GSM613745     4  0.3997     0.5908 0.012 0.056 0.092 0.828 0.012
#> GSM613746     3  0.6692     0.0563 0.000 0.292 0.488 0.008 0.212
#> GSM613747     1  0.2074     0.8671 0.896 0.000 0.000 0.104 0.000
#> GSM613748     4  0.6568     0.0260 0.024 0.404 0.096 0.472 0.004
#> GSM613749     4  0.7618     0.2310 0.296 0.280 0.036 0.384 0.004
#> GSM613750     5  0.3579     1.0000 0.000 0.000 0.240 0.004 0.756
#> GSM613751     5  0.3579     1.0000 0.000 0.000 0.240 0.004 0.756
#> GSM613752     5  0.3579     1.0000 0.000 0.000 0.240 0.004 0.756
#> GSM613753     5  0.3579     1.0000 0.000 0.000 0.240 0.004 0.756

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     4   0.766     0.3766 0.040 0.184 0.124 0.524 0.096 0.032
#> GSM613639     4   0.728     0.1064 0.364 0.084 0.012 0.384 0.152 0.004
#> GSM613640     4   0.706     0.4532 0.172 0.120 0.060 0.568 0.076 0.004
#> GSM613641     1   0.107     0.7966 0.952 0.000 0.000 0.000 0.048 0.000
#> GSM613642     2   0.787     0.3890 0.016 0.392 0.256 0.244 0.048 0.044
#> GSM613643     4   0.754     0.1988 0.356 0.108 0.040 0.396 0.096 0.004
#> GSM613644     4   0.670     0.4036 0.232 0.088 0.012 0.552 0.112 0.004
#> GSM613645     1   0.420     0.4959 0.704 0.020 0.000 0.256 0.020 0.000
#> GSM613646     4   0.358     0.5685 0.012 0.044 0.092 0.832 0.020 0.000
#> GSM613647     4   0.323     0.5665 0.004 0.000 0.104 0.832 0.060 0.000
#> GSM613648     4   0.401     0.4932 0.000 0.004 0.192 0.756 0.040 0.008
#> GSM613649     3   0.307     0.7467 0.000 0.004 0.792 0.200 0.000 0.004
#> GSM613650     4   0.193     0.5987 0.004 0.004 0.028 0.924 0.040 0.000
#> GSM613651     4   0.497     0.4915 0.044 0.000 0.004 0.672 0.244 0.036
#> GSM613652     5   0.501     0.9318 0.368 0.000 0.000 0.080 0.552 0.000
#> GSM613653     4   0.204     0.5987 0.004 0.008 0.028 0.920 0.040 0.000
#> GSM613654     5   0.501     0.9318 0.368 0.000 0.000 0.080 0.552 0.000
#> GSM613655     1   0.226     0.7255 0.860 0.000 0.000 0.000 0.140 0.000
#> GSM613656     5   0.501     0.9318 0.368 0.000 0.000 0.080 0.552 0.000
#> GSM613657     3   0.274     0.7834 0.000 0.008 0.828 0.164 0.000 0.000
#> GSM613658     1   0.234     0.7027 0.852 0.000 0.000 0.000 0.148 0.000
#> GSM613659     4   0.636     0.2734 0.016 0.292 0.124 0.532 0.036 0.000
#> GSM613660     2   0.551     0.5996 0.000 0.588 0.308 0.008 0.076 0.020
#> GSM613661     1   0.224     0.7765 0.896 0.000 0.000 0.036 0.068 0.000
#> GSM613662     2   0.568     0.5052 0.000 0.700 0.072 0.052 0.072 0.104
#> GSM613663     1   0.148     0.7998 0.940 0.000 0.000 0.020 0.040 0.000
#> GSM613664     2   0.453     0.6175 0.000 0.764 0.136 0.044 0.036 0.020
#> GSM613665     2   0.472     0.6294 0.000 0.732 0.180 0.032 0.036 0.020
#> GSM613666     1   0.107     0.7966 0.952 0.000 0.000 0.000 0.048 0.000
#> GSM613667     1   0.381     0.5317 0.732 0.004 0.000 0.240 0.024 0.000
#> GSM613668     1   0.205     0.7510 0.880 0.000 0.000 0.000 0.120 0.000
#> GSM613669     1   0.107     0.7966 0.952 0.000 0.000 0.000 0.048 0.000
#> GSM613670     2   0.568     0.5052 0.000 0.700 0.072 0.052 0.072 0.104
#> GSM613671     1   0.107     0.7966 0.952 0.000 0.000 0.000 0.048 0.000
#> GSM613672     1   0.155     0.7940 0.936 0.000 0.000 0.020 0.044 0.000
#> GSM613673     1   0.149     0.8004 0.940 0.000 0.000 0.024 0.036 0.000
#> GSM613674     2   0.512     0.6204 0.000 0.644 0.252 0.000 0.084 0.020
#> GSM613675     2   0.610     0.5335 0.004 0.660 0.136 0.092 0.032 0.076
#> GSM613676     2   0.472     0.6294 0.000 0.732 0.180 0.032 0.036 0.020
#> GSM613677     2   0.774     0.2650 0.012 0.356 0.256 0.292 0.060 0.024
#> GSM613678     4   0.631     0.0528 0.024 0.396 0.072 0.468 0.040 0.000
#> GSM613679     2   0.480     0.6259 0.000 0.652 0.272 0.004 0.068 0.004
#> GSM613680     1   0.117     0.8025 0.956 0.000 0.000 0.016 0.028 0.000
#> GSM613681     1   0.178     0.7980 0.932 0.012 0.000 0.032 0.024 0.000
#> GSM613682     1   0.283     0.7493 0.876 0.056 0.000 0.032 0.036 0.000
#> GSM613683     1   0.125     0.8013 0.952 0.000 0.000 0.016 0.032 0.000
#> GSM613684     2   0.594     0.3774 0.000 0.520 0.372 0.036 0.044 0.028
#> GSM613685     2   0.512     0.6204 0.000 0.644 0.252 0.000 0.084 0.020
#> GSM613686     1   0.490     0.5531 0.720 0.148 0.000 0.064 0.068 0.000
#> GSM613687     1   0.178     0.7980 0.932 0.012 0.000 0.032 0.024 0.000
#> GSM613688     2   0.580     0.4144 0.000 0.548 0.348 0.052 0.032 0.020
#> GSM613689     4   0.404     0.5271 0.000 0.004 0.172 0.760 0.060 0.004
#> GSM613690     4   0.491     0.1624 0.000 0.008 0.396 0.556 0.032 0.008
#> GSM613691     4   0.445     0.5129 0.004 0.076 0.160 0.744 0.016 0.000
#> GSM613692     4   0.566     0.2337 0.076 0.000 0.000 0.544 0.344 0.036
#> GSM613693     3   0.631    -0.0522 0.000 0.324 0.532 0.044 0.068 0.032
#> GSM613694     4   0.380     0.5457 0.004 0.000 0.148 0.780 0.068 0.000
#> GSM613695     4   0.347     0.5434 0.000 0.000 0.144 0.804 0.048 0.004
#> GSM613696     4   0.398     0.5551 0.008 0.044 0.124 0.800 0.020 0.004
#> GSM613697     4   0.497     0.4915 0.044 0.000 0.004 0.672 0.244 0.036
#> GSM613698     4   0.310     0.5868 0.004 0.000 0.048 0.840 0.108 0.000
#> GSM613699     4   0.411     0.5344 0.004 0.004 0.164 0.764 0.060 0.004
#> GSM613700     2   0.528     0.6067 0.000 0.604 0.296 0.000 0.080 0.020
#> GSM613701     4   0.743     0.2264 0.248 0.276 0.032 0.392 0.052 0.000
#> GSM613702     4   0.722     0.2563 0.232 0.268 0.032 0.428 0.040 0.000
#> GSM613703     1   0.181     0.7866 0.912 0.000 0.000 0.008 0.080 0.000
#> GSM613704     2   0.568     0.5052 0.000 0.700 0.072 0.052 0.072 0.104
#> GSM613705     4   0.764     0.3473 0.024 0.188 0.148 0.512 0.092 0.036
#> GSM613706     4   0.728     0.2853 0.232 0.252 0.032 0.436 0.048 0.000
#> GSM613707     2   0.492     0.5982 0.000 0.660 0.260 0.004 0.060 0.016
#> GSM613708     1   0.657     0.2348 0.556 0.076 0.004 0.212 0.148 0.004
#> GSM613709     1   0.107     0.7966 0.952 0.000 0.000 0.000 0.048 0.000
#> GSM613710     2   0.551     0.5996 0.000 0.588 0.308 0.008 0.076 0.020
#> GSM613711     3   0.284     0.7827 0.000 0.012 0.824 0.164 0.000 0.000
#> GSM613712     4   0.500     0.5569 0.012 0.004 0.100 0.736 0.112 0.036
#> GSM613713     3   0.488     0.5463 0.000 0.136 0.732 0.092 0.016 0.024
#> GSM613714     4   0.347     0.5434 0.000 0.000 0.144 0.804 0.048 0.004
#> GSM613715     4   0.490     0.0272 0.000 0.012 0.440 0.516 0.028 0.004
#> GSM613716     4   0.335     0.5589 0.000 0.012 0.124 0.828 0.032 0.004
#> GSM613717     3   0.274     0.7834 0.000 0.008 0.828 0.164 0.000 0.000
#> GSM613718     3   0.278     0.7827 0.000 0.008 0.824 0.168 0.000 0.000
#> GSM613719     4   0.204     0.5987 0.004 0.008 0.028 0.920 0.040 0.000
#> GSM613720     3   0.809    -0.0629 0.000 0.280 0.352 0.044 0.148 0.176
#> GSM613721     4   0.748     0.1313 0.000 0.212 0.280 0.408 0.072 0.028
#> GSM613722     2   0.595     0.6136 0.000 0.592 0.268 0.032 0.088 0.020
#> GSM613723     5   0.501     0.9318 0.368 0.000 0.000 0.080 0.552 0.000
#> GSM613724     1   0.134     0.8008 0.948 0.000 0.000 0.028 0.024 0.000
#> GSM613725     2   0.528     0.6067 0.000 0.604 0.296 0.000 0.080 0.020
#> GSM613726     1   0.617     0.3806 0.600 0.064 0.008 0.228 0.096 0.004
#> GSM613727     1   0.222     0.7296 0.864 0.000 0.000 0.000 0.136 0.000
#> GSM613728     2   0.652     0.4353 0.008 0.552 0.144 0.248 0.032 0.016
#> GSM613729     1   0.181     0.7866 0.912 0.000 0.000 0.008 0.080 0.000
#> GSM613730     2   0.649     0.2407 0.008 0.456 0.144 0.356 0.036 0.000
#> GSM613731     4   0.754     0.1988 0.356 0.108 0.040 0.396 0.096 0.004
#> GSM613732     3   0.278     0.7827 0.000 0.008 0.824 0.168 0.000 0.000
#> GSM613733     3   0.316     0.7778 0.000 0.020 0.812 0.164 0.000 0.004
#> GSM613734     5   0.501     0.9318 0.368 0.000 0.000 0.080 0.552 0.000
#> GSM613735     5   0.506     0.9252 0.372 0.000 0.000 0.084 0.544 0.000
#> GSM613736     3   0.404     0.7391 0.000 0.032 0.760 0.188 0.008 0.012
#> GSM613737     4   0.347     0.5625 0.004 0.000 0.096 0.816 0.084 0.000
#> GSM613738     5   0.519     0.8544 0.288 0.000 0.000 0.124 0.588 0.000
#> GSM613739     5   0.519     0.8544 0.288 0.000 0.000 0.124 0.588 0.000
#> GSM613740     3   0.330     0.7805 0.000 0.020 0.804 0.168 0.000 0.008
#> GSM613741     4   0.204     0.5987 0.004 0.008 0.028 0.920 0.040 0.000
#> GSM613742     5   0.519     0.8544 0.288 0.000 0.000 0.124 0.588 0.000
#> GSM613743     3   0.353     0.7587 0.000 0.032 0.804 0.152 0.004 0.008
#> GSM613744     3   0.267     0.7798 0.000 0.004 0.828 0.168 0.000 0.000
#> GSM613745     4   0.358     0.5685 0.012 0.044 0.092 0.832 0.020 0.000
#> GSM613746     3   0.770    -0.0881 0.000 0.296 0.356 0.012 0.160 0.176
#> GSM613747     5   0.501     0.9318 0.368 0.000 0.000 0.080 0.552 0.000
#> GSM613748     4   0.672     0.0130 0.036 0.380 0.112 0.440 0.032 0.000
#> GSM613749     4   0.722     0.2132 0.308 0.264 0.016 0.364 0.048 0.000
#> GSM613750     6   0.279     1.0000 0.000 0.000 0.200 0.000 0.000 0.800
#> GSM613751     6   0.279     1.0000 0.000 0.000 0.200 0.000 0.000 0.800
#> GSM613752     6   0.279     1.0000 0.000 0.000 0.200 0.000 0.000 0.800
#> GSM613753     6   0.279     1.0000 0.000 0.000 0.200 0.000 0.000 0.800

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 disease.state(p) k
#> MAD:hclust 110         1.51e-01 2
#> MAD:hclust  80         4.55e-02 3
#> MAD:hclust  82         1.55e-03 4
#> MAD:hclust  88         1.89e-03 5
#> MAD:hclust  83         7.13e-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: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 27425 rows and 116 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.838           0.910       0.951         0.4872 0.517   0.517
#> 3 3 0.592           0.728       0.843         0.3483 0.760   0.559
#> 4 4 0.576           0.621       0.785         0.1268 0.862   0.616
#> 5 5 0.642           0.587       0.739         0.0653 0.862   0.528
#> 6 6 0.692           0.583       0.730         0.0457 0.929   0.672

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
#> GSM613638     2   0.574      0.835 0.136 0.864
#> GSM613639     1   0.000      0.963 1.000 0.000
#> GSM613640     2   0.343      0.924 0.064 0.936
#> GSM613641     1   0.000      0.963 1.000 0.000
#> GSM613642     2   0.327      0.926 0.060 0.940
#> GSM613643     1   0.000      0.963 1.000 0.000
#> GSM613644     1   0.000      0.963 1.000 0.000
#> GSM613645     1   0.000      0.963 1.000 0.000
#> GSM613646     2   0.753      0.735 0.216 0.784
#> GSM613647     2   0.738      0.746 0.208 0.792
#> GSM613648     2   0.000      0.934 0.000 1.000
#> GSM613649     2   0.000      0.934 0.000 1.000
#> GSM613650     1   0.760      0.753 0.780 0.220
#> GSM613651     1   0.753      0.759 0.784 0.216
#> GSM613652     1   0.343      0.926 0.936 0.064
#> GSM613653     2   0.844      0.646 0.272 0.728
#> GSM613654     1   0.343      0.926 0.936 0.064
#> GSM613655     1   0.000      0.963 1.000 0.000
#> GSM613656     1   0.343      0.926 0.936 0.064
#> GSM613657     2   0.000      0.934 0.000 1.000
#> GSM613658     1   0.000      0.963 1.000 0.000
#> GSM613659     2   0.343      0.924 0.064 0.936
#> GSM613660     2   0.327      0.926 0.060 0.940
#> GSM613661     1   0.000      0.963 1.000 0.000
#> GSM613662     2   0.343      0.924 0.064 0.936
#> GSM613663     1   0.000      0.963 1.000 0.000
#> GSM613664     2   0.343      0.924 0.064 0.936
#> GSM613665     2   0.343      0.924 0.064 0.936
#> GSM613666     1   0.000      0.963 1.000 0.000
#> GSM613667     1   0.000      0.963 1.000 0.000
#> GSM613668     1   0.000      0.963 1.000 0.000
#> GSM613669     1   0.000      0.963 1.000 0.000
#> GSM613670     2   0.343      0.924 0.064 0.936
#> GSM613671     1   0.000      0.963 1.000 0.000
#> GSM613672     1   0.000      0.963 1.000 0.000
#> GSM613673     1   0.000      0.963 1.000 0.000
#> GSM613674     2   0.343      0.924 0.064 0.936
#> GSM613675     2   0.343      0.924 0.064 0.936
#> GSM613676     2   0.204      0.931 0.032 0.968
#> GSM613677     2   0.204      0.931 0.032 0.968
#> GSM613678     1   0.895      0.484 0.688 0.312
#> GSM613679     2   0.343      0.924 0.064 0.936
#> GSM613680     1   0.000      0.963 1.000 0.000
#> GSM613681     1   0.000      0.963 1.000 0.000
#> GSM613682     1   0.000      0.963 1.000 0.000
#> GSM613683     1   0.000      0.963 1.000 0.000
#> GSM613684     2   0.000      0.934 0.000 1.000
#> GSM613685     2   0.343      0.924 0.064 0.936
#> GSM613686     1   0.000      0.963 1.000 0.000
#> GSM613687     1   0.000      0.963 1.000 0.000
#> GSM613688     2   0.343      0.924 0.064 0.936
#> GSM613689     2   0.000      0.934 0.000 1.000
#> GSM613690     2   0.000      0.934 0.000 1.000
#> GSM613691     2   0.000      0.934 0.000 1.000
#> GSM613692     1   0.343      0.926 0.936 0.064
#> GSM613693     2   0.000      0.934 0.000 1.000
#> GSM613694     2   0.808      0.687 0.248 0.752
#> GSM613695     2   0.000      0.934 0.000 1.000
#> GSM613696     2   0.000      0.934 0.000 1.000
#> GSM613697     1   0.753      0.759 0.784 0.216
#> GSM613698     2   0.671      0.788 0.176 0.824
#> GSM613699     2   0.000      0.934 0.000 1.000
#> GSM613700     2   0.343      0.924 0.064 0.936
#> GSM613701     2   0.343      0.924 0.064 0.936
#> GSM613702     2   0.343      0.924 0.064 0.936
#> GSM613703     1   0.000      0.963 1.000 0.000
#> GSM613704     2   0.343      0.924 0.064 0.936
#> GSM613705     2   0.000      0.934 0.000 1.000
#> GSM613706     2   0.886      0.663 0.304 0.696
#> GSM613707     2   0.327      0.926 0.060 0.940
#> GSM613708     1   0.000      0.963 1.000 0.000
#> GSM613709     1   0.000      0.963 1.000 0.000
#> GSM613710     2   0.327      0.926 0.060 0.940
#> GSM613711     2   0.000      0.934 0.000 1.000
#> GSM613712     2   0.482      0.866 0.104 0.896
#> GSM613713     2   0.000      0.934 0.000 1.000
#> GSM613714     2   0.000      0.934 0.000 1.000
#> GSM613715     2   0.000      0.934 0.000 1.000
#> GSM613716     2   0.000      0.934 0.000 1.000
#> GSM613717     2   0.000      0.934 0.000 1.000
#> GSM613718     2   0.000      0.934 0.000 1.000
#> GSM613719     2   0.932      0.488 0.348 0.652
#> GSM613720     2   0.000      0.934 0.000 1.000
#> GSM613721     2   0.000      0.934 0.000 1.000
#> GSM613722     2   0.343      0.924 0.064 0.936
#> GSM613723     1   0.343      0.926 0.936 0.064
#> GSM613724     1   0.000      0.963 1.000 0.000
#> GSM613725     2   0.343      0.924 0.064 0.936
#> GSM613726     1   0.000      0.963 1.000 0.000
#> GSM613727     1   0.000      0.963 1.000 0.000
#> GSM613728     2   0.343      0.924 0.064 0.936
#> GSM613729     1   0.000      0.963 1.000 0.000
#> GSM613730     2   0.343      0.924 0.064 0.936
#> GSM613731     1   0.000      0.963 1.000 0.000
#> GSM613732     2   0.000      0.934 0.000 1.000
#> GSM613733     2   0.000      0.934 0.000 1.000
#> GSM613734     1   0.000      0.963 1.000 0.000
#> GSM613735     1   0.343      0.926 0.936 0.064
#> GSM613736     2   0.000      0.934 0.000 1.000
#> GSM613737     2   0.767      0.724 0.224 0.776
#> GSM613738     1   0.343      0.926 0.936 0.064
#> GSM613739     1   0.343      0.926 0.936 0.064
#> GSM613740     2   0.000      0.934 0.000 1.000
#> GSM613741     2   0.844      0.646 0.272 0.728
#> GSM613742     1   0.343      0.926 0.936 0.064
#> GSM613743     2   0.000      0.934 0.000 1.000
#> GSM613744     2   0.000      0.934 0.000 1.000
#> GSM613745     2   0.443      0.876 0.092 0.908
#> GSM613746     2   0.000      0.934 0.000 1.000
#> GSM613747     1   0.000      0.963 1.000 0.000
#> GSM613748     2   0.343      0.924 0.064 0.936
#> GSM613749     1   0.000      0.963 1.000 0.000
#> GSM613750     2   0.000      0.934 0.000 1.000
#> GSM613751     2   0.000      0.934 0.000 1.000
#> GSM613752     2   0.000      0.934 0.000 1.000
#> GSM613753     2   0.000      0.934 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
#> GSM613638     3  0.3377      0.705 0.012 0.092 0.896
#> GSM613639     1  0.5216      0.704 0.740 0.000 0.260
#> GSM613640     2  0.6309      0.147 0.000 0.504 0.496
#> GSM613641     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613642     2  0.4235      0.694 0.000 0.824 0.176
#> GSM613643     1  0.5465      0.679 0.712 0.000 0.288
#> GSM613644     1  0.5733      0.644 0.676 0.000 0.324
#> GSM613645     1  0.4654      0.768 0.792 0.000 0.208
#> GSM613646     3  0.5775      0.557 0.012 0.260 0.728
#> GSM613647     3  0.2339      0.695 0.012 0.048 0.940
#> GSM613648     3  0.5785      0.663 0.000 0.332 0.668
#> GSM613649     3  0.6111      0.632 0.000 0.396 0.604
#> GSM613650     3  0.4978      0.493 0.216 0.004 0.780
#> GSM613651     3  0.2261      0.651 0.068 0.000 0.932
#> GSM613652     1  0.3116      0.887 0.892 0.000 0.108
#> GSM613653     3  0.5843      0.556 0.016 0.252 0.732
#> GSM613654     1  0.3116      0.887 0.892 0.000 0.108
#> GSM613655     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613656     1  0.3116      0.887 0.892 0.000 0.108
#> GSM613657     3  0.6235      0.608 0.000 0.436 0.564
#> GSM613658     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613659     2  0.5291      0.622 0.000 0.732 0.268
#> GSM613660     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613661     1  0.2066      0.896 0.940 0.000 0.060
#> GSM613662     2  0.0237      0.796 0.000 0.996 0.004
#> GSM613663     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613664     2  0.0237      0.796 0.000 0.996 0.004
#> GSM613665     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613666     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613667     1  0.4654      0.768 0.792 0.000 0.208
#> GSM613668     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613669     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613670     2  0.5618      0.626 0.008 0.732 0.260
#> GSM613671     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613672     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613673     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613674     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613675     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613676     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613677     2  0.4346      0.678 0.000 0.816 0.184
#> GSM613678     2  0.8379      0.503 0.128 0.604 0.268
#> GSM613679     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613680     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613681     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613682     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613683     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613684     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613685     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613686     1  0.1031      0.915 0.976 0.000 0.024
#> GSM613687     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613688     2  0.0592      0.793 0.000 0.988 0.012
#> GSM613689     3  0.4504      0.695 0.000 0.196 0.804
#> GSM613690     3  0.3340      0.712 0.000 0.120 0.880
#> GSM613691     2  0.3038      0.748 0.000 0.896 0.104
#> GSM613692     1  0.3340      0.879 0.880 0.000 0.120
#> GSM613693     2  0.6062     -0.238 0.000 0.616 0.384
#> GSM613694     3  0.2339      0.695 0.012 0.048 0.940
#> GSM613695     3  0.2448      0.704 0.000 0.076 0.924
#> GSM613696     3  0.3551      0.703 0.000 0.132 0.868
#> GSM613697     3  0.2261      0.651 0.068 0.000 0.932
#> GSM613698     3  0.2339      0.695 0.012 0.048 0.940
#> GSM613699     3  0.3340      0.705 0.000 0.120 0.880
#> GSM613700     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613701     2  0.5216      0.629 0.000 0.740 0.260
#> GSM613702     2  0.5291      0.622 0.000 0.732 0.268
#> GSM613703     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613704     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613705     3  0.2261      0.701 0.000 0.068 0.932
#> GSM613706     2  0.7959      0.514 0.092 0.620 0.288
#> GSM613707     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613708     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613709     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613710     2  0.0237      0.793 0.000 0.996 0.004
#> GSM613711     3  0.6252      0.599 0.000 0.444 0.556
#> GSM613712     3  0.2280      0.696 0.008 0.052 0.940
#> GSM613713     3  0.6286      0.569 0.000 0.464 0.536
#> GSM613714     3  0.3619      0.707 0.000 0.136 0.864
#> GSM613715     3  0.5465      0.679 0.000 0.288 0.712
#> GSM613716     3  0.3941      0.704 0.000 0.156 0.844
#> GSM613717     3  0.6252      0.599 0.000 0.444 0.556
#> GSM613718     3  0.6235      0.608 0.000 0.436 0.564
#> GSM613719     3  0.2636      0.691 0.020 0.048 0.932
#> GSM613720     3  0.6252      0.600 0.000 0.444 0.556
#> GSM613721     3  0.6299      0.050 0.000 0.476 0.524
#> GSM613722     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613723     1  0.3116      0.887 0.892 0.000 0.108
#> GSM613724     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613725     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613726     1  0.4796      0.754 0.780 0.000 0.220
#> GSM613727     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613728     2  0.0000      0.796 0.000 1.000 0.000
#> GSM613729     1  0.0000      0.923 1.000 0.000 0.000
#> GSM613730     2  0.5291      0.622 0.000 0.732 0.268
#> GSM613731     1  0.5291      0.696 0.732 0.000 0.268
#> GSM613732     3  0.6235      0.608 0.000 0.436 0.564
#> GSM613733     3  0.6286      0.569 0.000 0.464 0.536
#> GSM613734     1  0.1964      0.907 0.944 0.000 0.056
#> GSM613735     1  0.3038      0.889 0.896 0.000 0.104
#> GSM613736     3  0.6244      0.603 0.000 0.440 0.560
#> GSM613737     3  0.2339      0.695 0.012 0.048 0.940
#> GSM613738     1  0.3340      0.879 0.880 0.000 0.120
#> GSM613739     1  0.3340      0.879 0.880 0.000 0.120
#> GSM613740     3  0.6235      0.608 0.000 0.436 0.564
#> GSM613741     3  0.5843      0.556 0.016 0.252 0.732
#> GSM613742     1  0.3551      0.873 0.868 0.000 0.132
#> GSM613743     3  0.6244      0.603 0.000 0.440 0.560
#> GSM613744     3  0.6235      0.608 0.000 0.436 0.564
#> GSM613745     3  0.5656      0.556 0.008 0.264 0.728
#> GSM613746     2  0.2625      0.694 0.000 0.916 0.084
#> GSM613747     1  0.1964      0.907 0.944 0.000 0.056
#> GSM613748     2  0.5291      0.622 0.000 0.732 0.268
#> GSM613749     2  0.8994      0.449 0.184 0.556 0.260
#> GSM613750     3  0.5859      0.615 0.000 0.344 0.656
#> GSM613751     3  0.6026      0.595 0.000 0.376 0.624
#> GSM613752     3  0.6026      0.595 0.000 0.376 0.624
#> GSM613753     3  0.1163      0.682 0.000 0.028 0.972

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM613638     4  0.5291     0.5867 0.000 0.024 0.324 0.652
#> GSM613639     1  0.5112     0.3491 0.608 0.000 0.008 0.384
#> GSM613640     4  0.7870     0.4342 0.028 0.220 0.208 0.544
#> GSM613641     1  0.0000     0.7914 1.000 0.000 0.000 0.000
#> GSM613642     2  0.4235     0.7509 0.000 0.824 0.092 0.084
#> GSM613643     4  0.6000     0.2504 0.356 0.000 0.052 0.592
#> GSM613644     4  0.5754     0.3302 0.316 0.000 0.048 0.636
#> GSM613645     1  0.4720     0.4633 0.672 0.004 0.000 0.324
#> GSM613646     4  0.6495     0.5682 0.020 0.092 0.220 0.668
#> GSM613647     4  0.4790     0.5588 0.000 0.000 0.380 0.620
#> GSM613648     3  0.2376     0.8001 0.000 0.068 0.916 0.016
#> GSM613649     3  0.3390     0.8254 0.000 0.132 0.852 0.016
#> GSM613650     4  0.4986     0.6182 0.044 0.000 0.216 0.740
#> GSM613651     4  0.4560     0.5701 0.004 0.000 0.296 0.700
#> GSM613652     1  0.5407     0.1884 0.504 0.000 0.012 0.484
#> GSM613653     4  0.6527     0.5690 0.020 0.092 0.224 0.664
#> GSM613654     1  0.5407     0.1884 0.504 0.000 0.012 0.484
#> GSM613655     1  0.0469     0.7879 0.988 0.000 0.000 0.012
#> GSM613656     1  0.5407     0.1884 0.504 0.000 0.012 0.484
#> GSM613657     3  0.2921     0.8281 0.000 0.140 0.860 0.000
#> GSM613658     1  0.0469     0.7879 0.988 0.000 0.000 0.012
#> GSM613659     2  0.5954     0.5543 0.000 0.604 0.052 0.344
#> GSM613660     2  0.1820     0.8121 0.000 0.944 0.036 0.020
#> GSM613661     1  0.4277     0.5312 0.720 0.000 0.000 0.280
#> GSM613662     2  0.2125     0.8000 0.000 0.920 0.004 0.076
#> GSM613663     1  0.0336     0.7897 0.992 0.000 0.000 0.008
#> GSM613664     2  0.1716     0.8036 0.000 0.936 0.000 0.064
#> GSM613665     2  0.1584     0.8124 0.000 0.952 0.036 0.012
#> GSM613666     1  0.0000     0.7914 1.000 0.000 0.000 0.000
#> GSM613667     1  0.4543     0.4684 0.676 0.000 0.000 0.324
#> GSM613668     1  0.0188     0.7908 0.996 0.000 0.000 0.004
#> GSM613669     1  0.0000     0.7914 1.000 0.000 0.000 0.000
#> GSM613670     2  0.4589     0.7306 0.000 0.784 0.048 0.168
#> GSM613671     1  0.0000     0.7914 1.000 0.000 0.000 0.000
#> GSM613672     1  0.0188     0.7908 0.996 0.000 0.000 0.004
#> GSM613673     1  0.0469     0.7886 0.988 0.000 0.000 0.012
#> GSM613674     2  0.1118     0.8118 0.000 0.964 0.036 0.000
#> GSM613675     2  0.1576     0.8053 0.000 0.948 0.004 0.048
#> GSM613676     2  0.1677     0.8114 0.000 0.948 0.040 0.012
#> GSM613677     2  0.6475     0.6209 0.000 0.644 0.172 0.184
#> GSM613678     2  0.7054     0.4592 0.048 0.532 0.040 0.380
#> GSM613679     2  0.1452     0.8119 0.000 0.956 0.036 0.008
#> GSM613680     1  0.0000     0.7914 1.000 0.000 0.000 0.000
#> GSM613681     1  0.0000     0.7914 1.000 0.000 0.000 0.000
#> GSM613682     1  0.0469     0.7886 0.988 0.000 0.000 0.012
#> GSM613683     1  0.0469     0.7879 0.988 0.000 0.000 0.012
#> GSM613684     2  0.1305     0.8116 0.000 0.960 0.036 0.004
#> GSM613685     2  0.1118     0.8118 0.000 0.964 0.036 0.000
#> GSM613686     1  0.3837     0.6083 0.776 0.000 0.000 0.224
#> GSM613687     1  0.0469     0.7886 0.988 0.000 0.000 0.012
#> GSM613688     2  0.1520     0.8091 0.000 0.956 0.024 0.020
#> GSM613689     3  0.1767     0.7483 0.000 0.012 0.944 0.044
#> GSM613690     3  0.1824     0.7329 0.000 0.004 0.936 0.060
#> GSM613691     2  0.5160     0.7230 0.000 0.760 0.104 0.136
#> GSM613692     4  0.5643    -0.0357 0.428 0.000 0.024 0.548
#> GSM613693     3  0.5812     0.6015 0.000 0.328 0.624 0.048
#> GSM613694     4  0.4790     0.5588 0.000 0.000 0.380 0.620
#> GSM613695     3  0.3528     0.5409 0.000 0.000 0.808 0.192
#> GSM613696     3  0.5057     0.1786 0.000 0.012 0.648 0.340
#> GSM613697     4  0.4560     0.5443 0.004 0.000 0.296 0.700
#> GSM613698     4  0.5050     0.5206 0.000 0.004 0.408 0.588
#> GSM613699     3  0.5039    -0.1130 0.000 0.004 0.592 0.404
#> GSM613700     2  0.1820     0.8121 0.000 0.944 0.036 0.020
#> GSM613701     2  0.5672     0.6192 0.000 0.668 0.056 0.276
#> GSM613702     2  0.5903     0.5618 0.000 0.616 0.052 0.332
#> GSM613703     1  0.2081     0.7472 0.916 0.000 0.000 0.084
#> GSM613704     2  0.1743     0.8029 0.000 0.940 0.004 0.056
#> GSM613705     4  0.4585     0.5923 0.000 0.000 0.332 0.668
#> GSM613706     2  0.8257     0.2149 0.080 0.436 0.088 0.396
#> GSM613707     2  0.1118     0.8118 0.000 0.964 0.036 0.000
#> GSM613708     1  0.1302     0.7714 0.956 0.000 0.000 0.044
#> GSM613709     1  0.0000     0.7914 1.000 0.000 0.000 0.000
#> GSM613710     2  0.1913     0.8108 0.000 0.940 0.040 0.020
#> GSM613711     3  0.2973     0.8272 0.000 0.144 0.856 0.000
#> GSM613712     4  0.4907     0.5097 0.000 0.000 0.420 0.580
#> GSM613713     3  0.4008     0.7518 0.000 0.244 0.756 0.000
#> GSM613714     3  0.1902     0.7285 0.000 0.004 0.932 0.064
#> GSM613715     3  0.2036     0.7601 0.000 0.032 0.936 0.032
#> GSM613716     3  0.5472     0.3905 0.000 0.044 0.676 0.280
#> GSM613717     3  0.2973     0.8272 0.000 0.144 0.856 0.000
#> GSM613718     3  0.3142     0.8288 0.000 0.132 0.860 0.008
#> GSM613719     4  0.4608     0.5836 0.000 0.004 0.304 0.692
#> GSM613720     3  0.4839     0.7838 0.000 0.200 0.756 0.044
#> GSM613721     2  0.7269     0.3917 0.000 0.524 0.180 0.296
#> GSM613722     2  0.1820     0.8121 0.000 0.944 0.036 0.020
#> GSM613723     1  0.5407     0.1884 0.504 0.000 0.012 0.484
#> GSM613724     1  0.0469     0.7879 0.988 0.000 0.000 0.012
#> GSM613725     2  0.1820     0.8121 0.000 0.944 0.036 0.020
#> GSM613726     1  0.5038     0.4299 0.652 0.000 0.012 0.336
#> GSM613727     1  0.0188     0.7908 0.996 0.000 0.000 0.004
#> GSM613728     2  0.1004     0.8128 0.000 0.972 0.004 0.024
#> GSM613729     1  0.0188     0.7907 0.996 0.000 0.000 0.004
#> GSM613730     2  0.5847     0.5836 0.000 0.628 0.052 0.320
#> GSM613731     1  0.6101     0.2396 0.560 0.000 0.052 0.388
#> GSM613732     3  0.3142     0.8288 0.000 0.132 0.860 0.008
#> GSM613733     3  0.4319     0.7559 0.000 0.228 0.760 0.012
#> GSM613734     1  0.4744     0.5420 0.704 0.000 0.012 0.284
#> GSM613735     1  0.5402     0.2144 0.516 0.000 0.012 0.472
#> GSM613736     3  0.2921     0.8281 0.000 0.140 0.860 0.000
#> GSM613737     4  0.4898     0.5125 0.000 0.000 0.416 0.584
#> GSM613738     4  0.5643    -0.0357 0.428 0.000 0.024 0.548
#> GSM613739     4  0.5650    -0.0434 0.432 0.000 0.024 0.544
#> GSM613740     3  0.3142     0.8288 0.000 0.132 0.860 0.008
#> GSM613741     4  0.6551     0.5678 0.020 0.096 0.220 0.664
#> GSM613742     4  0.5933     0.0220 0.408 0.000 0.040 0.552
#> GSM613743     3  0.2973     0.8272 0.000 0.144 0.856 0.000
#> GSM613744     3  0.3142     0.8288 0.000 0.132 0.860 0.008
#> GSM613745     4  0.6606     0.5651 0.020 0.100 0.220 0.660
#> GSM613746     2  0.3392     0.7557 0.000 0.872 0.072 0.056
#> GSM613747     1  0.4770     0.5369 0.700 0.000 0.012 0.288
#> GSM613748     2  0.5985     0.5400 0.000 0.596 0.052 0.352
#> GSM613749     4  0.8465    -0.1575 0.232 0.348 0.028 0.392
#> GSM613750     3  0.3533     0.7950 0.000 0.080 0.864 0.056
#> GSM613751     3  0.4094     0.7984 0.000 0.116 0.828 0.056
#> GSM613752     3  0.4094     0.7984 0.000 0.116 0.828 0.056
#> GSM613753     3  0.2281     0.7266 0.000 0.000 0.904 0.096

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     4  0.5916   0.472503 0.000 0.060 0.080 0.672 0.188
#> GSM613639     4  0.4841   0.162091 0.416 0.024 0.000 0.560 0.000
#> GSM613640     4  0.5619   0.530212 0.004 0.148 0.036 0.708 0.104
#> GSM613641     1  0.0451   0.869342 0.988 0.000 0.000 0.004 0.008
#> GSM613642     2  0.5274   0.638034 0.000 0.724 0.036 0.160 0.080
#> GSM613643     4  0.5436   0.461520 0.212 0.008 0.000 0.672 0.108
#> GSM613644     4  0.5038   0.493073 0.168 0.016 0.000 0.728 0.088
#> GSM613645     1  0.4829   0.031776 0.500 0.020 0.000 0.480 0.000
#> GSM613646     4  0.5407   0.510563 0.000 0.064 0.076 0.728 0.132
#> GSM613647     5  0.6257  -0.068944 0.000 0.000 0.148 0.392 0.460
#> GSM613648     3  0.3441   0.768681 0.000 0.008 0.848 0.088 0.056
#> GSM613649     3  0.2321   0.807990 0.000 0.024 0.916 0.044 0.016
#> GSM613650     4  0.5518   0.384432 0.004 0.004 0.088 0.648 0.256
#> GSM613651     5  0.5240   0.262283 0.000 0.000 0.092 0.252 0.656
#> GSM613652     5  0.4060   0.605940 0.360 0.000 0.000 0.000 0.640
#> GSM613653     4  0.5690   0.502354 0.000 0.076 0.084 0.708 0.132
#> GSM613654     5  0.4045   0.609542 0.356 0.000 0.000 0.000 0.644
#> GSM613655     1  0.0609   0.864706 0.980 0.000 0.000 0.000 0.020
#> GSM613656     5  0.4060   0.605940 0.360 0.000 0.000 0.000 0.640
#> GSM613657     3  0.0566   0.823537 0.000 0.012 0.984 0.000 0.004
#> GSM613658     1  0.0898   0.864508 0.972 0.000 0.000 0.008 0.020
#> GSM613659     4  0.5569   0.176580 0.000 0.364 0.000 0.556 0.080
#> GSM613660     2  0.4374   0.763375 0.000 0.792 0.112 0.076 0.020
#> GSM613661     1  0.4473   0.270043 0.580 0.008 0.000 0.412 0.000
#> GSM613662     2  0.4568   0.682358 0.000 0.768 0.012 0.136 0.084
#> GSM613663     1  0.0566   0.865462 0.984 0.004 0.000 0.012 0.000
#> GSM613664     2  0.4249   0.699414 0.000 0.792 0.008 0.100 0.100
#> GSM613665     2  0.3059   0.786317 0.000 0.860 0.108 0.028 0.004
#> GSM613666     1  0.0579   0.868986 0.984 0.000 0.000 0.008 0.008
#> GSM613667     1  0.4807   0.127412 0.532 0.020 0.000 0.448 0.000
#> GSM613668     1  0.0609   0.864706 0.980 0.000 0.000 0.000 0.020
#> GSM613669     1  0.0579   0.868986 0.984 0.000 0.000 0.008 0.008
#> GSM613670     2  0.5040   0.570654 0.000 0.680 0.000 0.236 0.084
#> GSM613671     1  0.0579   0.868986 0.984 0.000 0.000 0.008 0.008
#> GSM613672     1  0.0898   0.865063 0.972 0.008 0.000 0.000 0.020
#> GSM613673     1  0.1408   0.844730 0.948 0.008 0.000 0.044 0.000
#> GSM613674     2  0.3350   0.780205 0.000 0.844 0.112 0.004 0.040
#> GSM613675     2  0.4750   0.690836 0.000 0.764 0.024 0.132 0.080
#> GSM613676     2  0.3160   0.785208 0.000 0.852 0.116 0.028 0.004
#> GSM613677     4  0.6882   0.267336 0.000 0.320 0.048 0.512 0.120
#> GSM613678     4  0.5447   0.420270 0.084 0.280 0.000 0.632 0.004
#> GSM613679     2  0.2968   0.784332 0.000 0.864 0.112 0.012 0.012
#> GSM613680     1  0.0404   0.868102 0.988 0.000 0.000 0.000 0.012
#> GSM613681     1  0.0451   0.869443 0.988 0.000 0.000 0.008 0.004
#> GSM613682     1  0.0898   0.860768 0.972 0.008 0.000 0.020 0.000
#> GSM613683     1  0.0609   0.864706 0.980 0.000 0.000 0.000 0.020
#> GSM613684     2  0.3830   0.778116 0.000 0.824 0.116 0.020 0.040
#> GSM613685     2  0.3350   0.780205 0.000 0.844 0.112 0.004 0.040
#> GSM613686     1  0.4193   0.494881 0.684 0.012 0.000 0.304 0.000
#> GSM613687     1  0.0898   0.860768 0.972 0.008 0.000 0.020 0.000
#> GSM613688     2  0.2713   0.742990 0.000 0.888 0.004 0.036 0.072
#> GSM613689     3  0.3912   0.733210 0.000 0.000 0.804 0.088 0.108
#> GSM613690     3  0.4270   0.709824 0.000 0.000 0.776 0.112 0.112
#> GSM613691     2  0.6034   0.421562 0.000 0.588 0.020 0.300 0.092
#> GSM613692     5  0.4477   0.644165 0.288 0.000 0.008 0.016 0.688
#> GSM613693     3  0.7410   0.251238 0.000 0.248 0.512 0.144 0.096
#> GSM613694     4  0.6248   0.166573 0.000 0.000 0.148 0.468 0.384
#> GSM613695     3  0.5604   0.496402 0.000 0.000 0.628 0.240 0.132
#> GSM613696     4  0.6886   0.064938 0.000 0.020 0.344 0.460 0.176
#> GSM613697     5  0.5053   0.305454 0.000 0.000 0.096 0.216 0.688
#> GSM613698     5  0.6372   0.052255 0.000 0.000 0.184 0.324 0.492
#> GSM613699     3  0.6413   0.027685 0.000 0.000 0.432 0.396 0.172
#> GSM613700     2  0.4179   0.765068 0.000 0.800 0.112 0.076 0.012
#> GSM613701     2  0.4826   0.004089 0.000 0.508 0.000 0.472 0.020
#> GSM613702     4  0.4276   0.313187 0.000 0.380 0.000 0.616 0.004
#> GSM613703     1  0.2011   0.808691 0.908 0.000 0.000 0.088 0.004
#> GSM613704     2  0.4726   0.689146 0.000 0.768 0.024 0.120 0.088
#> GSM613705     4  0.6185   0.404510 0.000 0.032 0.116 0.620 0.232
#> GSM613706     4  0.5496   0.521504 0.036 0.192 0.000 0.696 0.076
#> GSM613707     2  0.3350   0.780205 0.000 0.844 0.112 0.004 0.040
#> GSM613708     1  0.1697   0.836919 0.932 0.008 0.000 0.060 0.000
#> GSM613709     1  0.0451   0.869342 0.988 0.000 0.000 0.004 0.008
#> GSM613710     2  0.4583   0.754491 0.000 0.776 0.120 0.084 0.020
#> GSM613711     3  0.0771   0.822617 0.000 0.020 0.976 0.000 0.004
#> GSM613712     5  0.6552  -0.025479 0.000 0.000 0.208 0.348 0.444
#> GSM613713     3  0.3927   0.694822 0.000 0.164 0.792 0.004 0.040
#> GSM613714     3  0.4743   0.665665 0.000 0.000 0.732 0.156 0.112
#> GSM613715     3  0.3907   0.748891 0.000 0.012 0.820 0.100 0.068
#> GSM613716     4  0.7779  -0.019356 0.000 0.100 0.364 0.384 0.152
#> GSM613717     3  0.0771   0.822617 0.000 0.020 0.976 0.000 0.004
#> GSM613718     3  0.0404   0.823777 0.000 0.012 0.988 0.000 0.000
#> GSM613719     4  0.6151   0.224397 0.000 0.004 0.124 0.516 0.356
#> GSM613720     3  0.6419   0.565333 0.000 0.124 0.644 0.148 0.084
#> GSM613721     4  0.6903  -0.000414 0.000 0.400 0.040 0.440 0.120
#> GSM613722     2  0.4179   0.765068 0.000 0.800 0.112 0.076 0.012
#> GSM613723     5  0.4045   0.609542 0.356 0.000 0.000 0.000 0.644
#> GSM613724     1  0.0609   0.864706 0.980 0.000 0.000 0.000 0.020
#> GSM613725     2  0.4374   0.763375 0.000 0.792 0.112 0.076 0.020
#> GSM613726     4  0.4905   0.028765 0.464 0.012 0.000 0.516 0.008
#> GSM613727     1  0.0609   0.864706 0.980 0.000 0.000 0.000 0.020
#> GSM613728     2  0.3656   0.744597 0.000 0.844 0.024 0.080 0.052
#> GSM613729     1  0.0510   0.867180 0.984 0.000 0.000 0.016 0.000
#> GSM613730     4  0.5168   0.297602 0.000 0.356 0.000 0.592 0.052
#> GSM613731     4  0.5158   0.386055 0.316 0.008 0.000 0.632 0.044
#> GSM613732     3  0.0404   0.823777 0.000 0.012 0.988 0.000 0.000
#> GSM613733     3  0.2678   0.766458 0.000 0.100 0.880 0.016 0.004
#> GSM613734     5  0.4291   0.424680 0.464 0.000 0.000 0.000 0.536
#> GSM613735     5  0.4074   0.600483 0.364 0.000 0.000 0.000 0.636
#> GSM613736     3  0.0771   0.822617 0.000 0.020 0.976 0.000 0.004
#> GSM613737     5  0.6455   0.034161 0.000 0.000 0.200 0.320 0.480
#> GSM613738     5  0.4477   0.644165 0.288 0.000 0.008 0.016 0.688
#> GSM613739     5  0.4477   0.644165 0.288 0.000 0.008 0.016 0.688
#> GSM613740     3  0.0404   0.823777 0.000 0.012 0.988 0.000 0.000
#> GSM613741     4  0.5839   0.499495 0.000 0.084 0.084 0.696 0.136
#> GSM613742     5  0.4702   0.642483 0.256 0.000 0.008 0.036 0.700
#> GSM613743     3  0.0771   0.822617 0.000 0.020 0.976 0.000 0.004
#> GSM613744     3  0.0404   0.823777 0.000 0.012 0.988 0.000 0.000
#> GSM613745     4  0.5863   0.501224 0.000 0.088 0.076 0.692 0.144
#> GSM613746     2  0.5873   0.621205 0.000 0.676 0.044 0.172 0.108
#> GSM613747     5  0.4287   0.434209 0.460 0.000 0.000 0.000 0.540
#> GSM613748     4  0.4193   0.409834 0.000 0.304 0.000 0.684 0.012
#> GSM613749     4  0.5490   0.346673 0.324 0.084 0.000 0.592 0.000
#> GSM613750     3  0.3248   0.775454 0.000 0.004 0.856 0.052 0.088
#> GSM613751     3  0.3257   0.775098 0.000 0.008 0.860 0.052 0.080
#> GSM613752     3  0.3197   0.775183 0.000 0.008 0.864 0.052 0.076
#> GSM613753     3  0.4674   0.731025 0.000 0.004 0.748 0.100 0.148

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     4  0.4182     0.4755 0.000 0.016 0.072 0.784 0.116 0.012
#> GSM613639     4  0.5110     0.3693 0.324 0.004 0.000 0.592 0.004 0.076
#> GSM613640     4  0.4038     0.5087 0.000 0.056 0.060 0.804 0.076 0.004
#> GSM613641     1  0.1390     0.8872 0.948 0.000 0.000 0.016 0.004 0.032
#> GSM613642     2  0.4972     0.5040 0.000 0.656 0.024 0.256 0.064 0.000
#> GSM613643     4  0.3858     0.5503 0.164 0.004 0.000 0.776 0.052 0.004
#> GSM613644     4  0.3825     0.5439 0.112 0.004 0.000 0.808 0.028 0.048
#> GSM613645     4  0.5101     0.1259 0.424 0.004 0.000 0.504 0.000 0.068
#> GSM613646     6  0.4646     0.3477 0.000 0.000 0.008 0.356 0.036 0.600
#> GSM613647     4  0.6394    -0.0433 0.000 0.000 0.088 0.420 0.412 0.080
#> GSM613648     3  0.3771     0.7490 0.000 0.012 0.828 0.060 0.040 0.060
#> GSM613649     3  0.3469     0.7811 0.000 0.028 0.852 0.044 0.032 0.044
#> GSM613650     4  0.6064    -0.1796 0.000 0.000 0.008 0.428 0.192 0.372
#> GSM613651     5  0.4678     0.4375 0.000 0.000 0.056 0.184 0.720 0.040
#> GSM613652     5  0.2730     0.7063 0.192 0.000 0.000 0.000 0.808 0.000
#> GSM613653     6  0.4390     0.4521 0.000 0.000 0.004 0.272 0.048 0.676
#> GSM613654     5  0.2730     0.7063 0.192 0.000 0.000 0.000 0.808 0.000
#> GSM613655     1  0.0914     0.8836 0.968 0.000 0.000 0.000 0.016 0.016
#> GSM613656     5  0.2730     0.7063 0.192 0.000 0.000 0.000 0.808 0.000
#> GSM613657     3  0.1563     0.8277 0.000 0.056 0.932 0.000 0.000 0.012
#> GSM613658     1  0.1605     0.8851 0.940 0.000 0.000 0.012 0.016 0.032
#> GSM613659     4  0.5856    -0.0353 0.000 0.192 0.000 0.404 0.000 0.404
#> GSM613660     2  0.3057     0.7316 0.000 0.844 0.024 0.120 0.004 0.008
#> GSM613661     1  0.4731     0.0296 0.488 0.004 0.000 0.476 0.004 0.028
#> GSM613662     2  0.4594     0.2797 0.000 0.504 0.004 0.020 0.004 0.468
#> GSM613663     1  0.1226     0.8788 0.952 0.004 0.000 0.040 0.000 0.004
#> GSM613664     2  0.4161     0.5067 0.000 0.612 0.000 0.008 0.008 0.372
#> GSM613665     2  0.2095     0.7590 0.000 0.916 0.016 0.028 0.000 0.040
#> GSM613666     1  0.1391     0.8862 0.944 0.000 0.000 0.016 0.000 0.040
#> GSM613667     1  0.5120    -0.0645 0.468 0.004 0.000 0.460 0.000 0.068
#> GSM613668     1  0.0603     0.8852 0.980 0.000 0.000 0.000 0.016 0.004
#> GSM613669     1  0.1536     0.8856 0.940 0.000 0.000 0.016 0.004 0.040
#> GSM613670     6  0.4574    -0.2245 0.000 0.440 0.000 0.036 0.000 0.524
#> GSM613671     1  0.1536     0.8856 0.940 0.000 0.000 0.016 0.004 0.040
#> GSM613672     1  0.1109     0.8845 0.964 0.004 0.000 0.016 0.012 0.004
#> GSM613673     1  0.1788     0.8543 0.916 0.004 0.000 0.076 0.000 0.004
#> GSM613674     2  0.2017     0.7469 0.000 0.920 0.020 0.004 0.008 0.048
#> GSM613675     2  0.4724     0.2935 0.000 0.508 0.004 0.028 0.004 0.456
#> GSM613676     2  0.2122     0.7593 0.000 0.916 0.024 0.028 0.000 0.032
#> GSM613677     4  0.5596     0.4618 0.000 0.112 0.060 0.704 0.048 0.076
#> GSM613678     4  0.5850     0.4668 0.076 0.120 0.000 0.628 0.000 0.176
#> GSM613679     2  0.1053     0.7573 0.000 0.964 0.020 0.012 0.000 0.004
#> GSM613680     1  0.0405     0.8884 0.988 0.000 0.000 0.008 0.000 0.004
#> GSM613681     1  0.0622     0.8908 0.980 0.000 0.000 0.012 0.000 0.008
#> GSM613682     1  0.1429     0.8727 0.940 0.004 0.000 0.052 0.000 0.004
#> GSM613683     1  0.0653     0.8857 0.980 0.000 0.000 0.004 0.012 0.004
#> GSM613684     2  0.2605     0.7323 0.000 0.876 0.020 0.000 0.012 0.092
#> GSM613685     2  0.2017     0.7469 0.000 0.920 0.020 0.004 0.008 0.048
#> GSM613686     1  0.3945     0.6823 0.748 0.004 0.000 0.200 0.000 0.048
#> GSM613687     1  0.1429     0.8727 0.940 0.004 0.000 0.052 0.000 0.004
#> GSM613688     2  0.3879     0.6315 0.000 0.724 0.004 0.012 0.008 0.252
#> GSM613689     3  0.4535     0.6582 0.000 0.000 0.748 0.104 0.116 0.032
#> GSM613690     3  0.5361     0.5855 0.000 0.000 0.676 0.144 0.128 0.052
#> GSM613691     6  0.3702     0.4297 0.000 0.164 0.008 0.044 0.000 0.784
#> GSM613692     5  0.2706     0.7038 0.160 0.000 0.000 0.000 0.832 0.008
#> GSM613693     6  0.5984     0.2637 0.000 0.204 0.296 0.000 0.008 0.492
#> GSM613694     5  0.7243    -0.1538 0.000 0.000 0.088 0.312 0.324 0.276
#> GSM613695     3  0.5919     0.4766 0.000 0.000 0.608 0.200 0.132 0.060
#> GSM613696     6  0.7102     0.3654 0.000 0.004 0.168 0.204 0.140 0.484
#> GSM613697     5  0.4451     0.4595 0.000 0.000 0.056 0.164 0.744 0.036
#> GSM613698     5  0.7078     0.0991 0.000 0.000 0.112 0.220 0.452 0.216
#> GSM613699     6  0.7552     0.1997 0.000 0.000 0.296 0.256 0.148 0.300
#> GSM613700     2  0.2636     0.7366 0.000 0.860 0.016 0.120 0.004 0.000
#> GSM613701     4  0.5228     0.0792 0.000 0.424 0.000 0.504 0.016 0.056
#> GSM613702     4  0.4821     0.4799 0.000 0.168 0.000 0.696 0.012 0.124
#> GSM613703     1  0.3103     0.8096 0.836 0.000 0.000 0.100 0.000 0.064
#> GSM613704     2  0.4524     0.2829 0.000 0.492 0.004 0.016 0.004 0.484
#> GSM613705     4  0.4890     0.4030 0.000 0.008 0.100 0.716 0.156 0.020
#> GSM613706     4  0.4135     0.5291 0.008 0.116 0.012 0.788 0.072 0.004
#> GSM613707     2  0.2017     0.7469 0.000 0.920 0.020 0.004 0.008 0.048
#> GSM613708     1  0.2597     0.8277 0.868 0.004 0.000 0.112 0.004 0.012
#> GSM613709     1  0.1390     0.8872 0.948 0.000 0.000 0.016 0.004 0.032
#> GSM613710     2  0.3281     0.7216 0.000 0.832 0.036 0.120 0.004 0.008
#> GSM613711     3  0.1563     0.8277 0.000 0.056 0.932 0.000 0.000 0.012
#> GSM613712     5  0.7304     0.0424 0.000 0.000 0.136 0.252 0.408 0.204
#> GSM613713     3  0.4436     0.6638 0.000 0.220 0.712 0.000 0.016 0.052
#> GSM613714     3  0.5867     0.5252 0.000 0.000 0.624 0.172 0.136 0.068
#> GSM613715     3  0.3811     0.7329 0.000 0.004 0.820 0.068 0.056 0.052
#> GSM613716     6  0.4659     0.5305 0.000 0.008 0.112 0.080 0.044 0.756
#> GSM613717     3  0.1707     0.8271 0.000 0.056 0.928 0.000 0.004 0.012
#> GSM613718     3  0.1493     0.8281 0.000 0.056 0.936 0.000 0.004 0.004
#> GSM613719     6  0.6810     0.2192 0.000 0.000 0.048 0.292 0.256 0.404
#> GSM613720     6  0.5389     0.3295 0.000 0.048 0.324 0.016 0.020 0.592
#> GSM613721     6  0.4879     0.5093 0.000 0.120 0.008 0.116 0.028 0.728
#> GSM613722     2  0.2544     0.7362 0.000 0.864 0.012 0.120 0.004 0.000
#> GSM613723     5  0.2730     0.7063 0.192 0.000 0.000 0.000 0.808 0.000
#> GSM613724     1  0.0603     0.8852 0.980 0.000 0.000 0.000 0.016 0.004
#> GSM613725     2  0.2865     0.7349 0.000 0.852 0.020 0.120 0.004 0.004
#> GSM613726     4  0.4157     0.3619 0.360 0.004 0.000 0.624 0.004 0.008
#> GSM613727     1  0.1168     0.8839 0.956 0.000 0.000 0.000 0.016 0.028
#> GSM613728     2  0.4968     0.6395 0.000 0.668 0.004 0.116 0.004 0.208
#> GSM613729     1  0.1461     0.8854 0.940 0.000 0.000 0.016 0.000 0.044
#> GSM613730     4  0.4662     0.4602 0.000 0.140 0.000 0.688 0.000 0.172
#> GSM613731     4  0.4016     0.5447 0.208 0.004 0.000 0.744 0.040 0.004
#> GSM613732     3  0.1462     0.8280 0.000 0.056 0.936 0.000 0.008 0.000
#> GSM613733     3  0.2785     0.7802 0.000 0.128 0.852 0.008 0.004 0.008
#> GSM613734     5  0.3266     0.6406 0.272 0.000 0.000 0.000 0.728 0.000
#> GSM613735     5  0.2730     0.7063 0.192 0.000 0.000 0.000 0.808 0.000
#> GSM613736     3  0.1707     0.8271 0.000 0.056 0.928 0.000 0.004 0.012
#> GSM613737     5  0.7046     0.0911 0.000 0.000 0.104 0.220 0.452 0.224
#> GSM613738     5  0.2706     0.7038 0.160 0.000 0.000 0.000 0.832 0.008
#> GSM613739     5  0.2558     0.7041 0.156 0.000 0.000 0.000 0.840 0.004
#> GSM613740     3  0.1493     0.8277 0.000 0.056 0.936 0.000 0.004 0.004
#> GSM613741     6  0.4349     0.4559 0.000 0.000 0.004 0.264 0.048 0.684
#> GSM613742     5  0.2704     0.6916 0.140 0.000 0.000 0.000 0.844 0.016
#> GSM613743     3  0.1707     0.8271 0.000 0.056 0.928 0.000 0.004 0.012
#> GSM613744     3  0.1462     0.8280 0.000 0.056 0.936 0.000 0.008 0.000
#> GSM613745     6  0.4391     0.4050 0.000 0.000 0.008 0.320 0.028 0.644
#> GSM613746     6  0.4303     0.1307 0.000 0.316 0.012 0.008 0.008 0.656
#> GSM613747     5  0.3266     0.6406 0.272 0.000 0.000 0.000 0.728 0.000
#> GSM613748     4  0.4283     0.5245 0.000 0.148 0.008 0.768 0.024 0.052
#> GSM613749     4  0.5581     0.4796 0.244 0.032 0.000 0.612 0.000 0.112
#> GSM613750     3  0.3788     0.7535 0.000 0.016 0.824 0.056 0.024 0.080
#> GSM613751     3  0.4095     0.7554 0.000 0.036 0.808 0.056 0.020 0.080
#> GSM613752     3  0.4095     0.7554 0.000 0.036 0.808 0.056 0.020 0.080
#> GSM613753     3  0.4495     0.7142 0.000 0.000 0.764 0.076 0.076 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-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 disease.state(p) k
#> MAD:kmeans 114         0.056452 2
#> MAD:kmeans 111         0.032102 3
#> MAD:kmeans  92         0.001352 4
#> MAD:kmeans  78         0.000451 5
#> MAD:kmeans  78         0.000152 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 27425 rows and 116 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 1.000           0.976       0.990         0.5043 0.496   0.496
#> 3 3 0.754           0.855       0.920         0.3066 0.728   0.505
#> 4 4 0.749           0.851       0.894         0.1309 0.845   0.578
#> 5 5 0.777           0.750       0.871         0.0565 0.917   0.694
#> 6 6 0.886           0.801       0.892         0.0370 0.931   0.703

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
#> GSM613638     2  0.9815      0.289 0.420 0.580
#> GSM613639     1  0.0000      0.992 1.000 0.000
#> GSM613640     2  0.1843      0.964 0.028 0.972
#> GSM613641     1  0.0000      0.992 1.000 0.000
#> GSM613642     2  0.0000      0.987 0.000 1.000
#> GSM613643     1  0.0000      0.992 1.000 0.000
#> GSM613644     1  0.0000      0.992 1.000 0.000
#> GSM613645     1  0.0000      0.992 1.000 0.000
#> GSM613646     1  0.2043      0.965 0.968 0.032
#> GSM613647     1  0.0000      0.992 1.000 0.000
#> GSM613648     2  0.0000      0.987 0.000 1.000
#> GSM613649     2  0.0000      0.987 0.000 1.000
#> GSM613650     1  0.0000      0.992 1.000 0.000
#> GSM613651     1  0.0000      0.992 1.000 0.000
#> GSM613652     1  0.0000      0.992 1.000 0.000
#> GSM613653     1  0.1633      0.972 0.976 0.024
#> GSM613654     1  0.0000      0.992 1.000 0.000
#> GSM613655     1  0.0000      0.992 1.000 0.000
#> GSM613656     1  0.0000      0.992 1.000 0.000
#> GSM613657     2  0.0000      0.987 0.000 1.000
#> GSM613658     1  0.0000      0.992 1.000 0.000
#> GSM613659     2  0.0000      0.987 0.000 1.000
#> GSM613660     2  0.0000      0.987 0.000 1.000
#> GSM613661     1  0.0000      0.992 1.000 0.000
#> GSM613662     2  0.0000      0.987 0.000 1.000
#> GSM613663     1  0.0000      0.992 1.000 0.000
#> GSM613664     2  0.0000      0.987 0.000 1.000
#> GSM613665     2  0.0000      0.987 0.000 1.000
#> GSM613666     1  0.0000      0.992 1.000 0.000
#> GSM613667     1  0.0000      0.992 1.000 0.000
#> GSM613668     1  0.0000      0.992 1.000 0.000
#> GSM613669     1  0.0000      0.992 1.000 0.000
#> GSM613670     2  0.1843      0.962 0.028 0.972
#> GSM613671     1  0.0000      0.992 1.000 0.000
#> GSM613672     1  0.0000      0.992 1.000 0.000
#> GSM613673     1  0.0000      0.992 1.000 0.000
#> GSM613674     2  0.0000      0.987 0.000 1.000
#> GSM613675     2  0.0000      0.987 0.000 1.000
#> GSM613676     2  0.0000      0.987 0.000 1.000
#> GSM613677     2  0.0000      0.987 0.000 1.000
#> GSM613678     1  0.0000      0.992 1.000 0.000
#> GSM613679     2  0.0000      0.987 0.000 1.000
#> GSM613680     1  0.0000      0.992 1.000 0.000
#> GSM613681     1  0.0000      0.992 1.000 0.000
#> GSM613682     1  0.0000      0.992 1.000 0.000
#> GSM613683     1  0.0000      0.992 1.000 0.000
#> GSM613684     2  0.0000      0.987 0.000 1.000
#> GSM613685     2  0.0000      0.987 0.000 1.000
#> GSM613686     1  0.0000      0.992 1.000 0.000
#> GSM613687     1  0.0000      0.992 1.000 0.000
#> GSM613688     2  0.0000      0.987 0.000 1.000
#> GSM613689     2  0.0000      0.987 0.000 1.000
#> GSM613690     2  0.0000      0.987 0.000 1.000
#> GSM613691     2  0.0000      0.987 0.000 1.000
#> GSM613692     1  0.0000      0.992 1.000 0.000
#> GSM613693     2  0.0000      0.987 0.000 1.000
#> GSM613694     1  0.0376      0.989 0.996 0.004
#> GSM613695     2  0.0000      0.987 0.000 1.000
#> GSM613696     2  0.0000      0.987 0.000 1.000
#> GSM613697     1  0.0000      0.992 1.000 0.000
#> GSM613698     1  0.4161      0.911 0.916 0.084
#> GSM613699     2  0.0000      0.987 0.000 1.000
#> GSM613700     2  0.0000      0.987 0.000 1.000
#> GSM613701     2  0.0000      0.987 0.000 1.000
#> GSM613702     2  0.1414      0.970 0.020 0.980
#> GSM613703     1  0.0000      0.992 1.000 0.000
#> GSM613704     2  0.0000      0.987 0.000 1.000
#> GSM613705     2  0.1843      0.964 0.028 0.972
#> GSM613706     1  0.0000      0.992 1.000 0.000
#> GSM613707     2  0.0000      0.987 0.000 1.000
#> GSM613708     1  0.0000      0.992 1.000 0.000
#> GSM613709     1  0.0000      0.992 1.000 0.000
#> GSM613710     2  0.0000      0.987 0.000 1.000
#> GSM613711     2  0.0000      0.987 0.000 1.000
#> GSM613712     2  0.7376      0.735 0.208 0.792
#> GSM613713     2  0.0000      0.987 0.000 1.000
#> GSM613714     2  0.0000      0.987 0.000 1.000
#> GSM613715     2  0.0000      0.987 0.000 1.000
#> GSM613716     2  0.0000      0.987 0.000 1.000
#> GSM613717     2  0.0000      0.987 0.000 1.000
#> GSM613718     2  0.0000      0.987 0.000 1.000
#> GSM613719     1  0.1414      0.976 0.980 0.020
#> GSM613720     2  0.0000      0.987 0.000 1.000
#> GSM613721     2  0.0000      0.987 0.000 1.000
#> GSM613722     2  0.0000      0.987 0.000 1.000
#> GSM613723     1  0.0000      0.992 1.000 0.000
#> GSM613724     1  0.0000      0.992 1.000 0.000
#> GSM613725     2  0.0000      0.987 0.000 1.000
#> GSM613726     1  0.0000      0.992 1.000 0.000
#> GSM613727     1  0.0000      0.992 1.000 0.000
#> GSM613728     2  0.0000      0.987 0.000 1.000
#> GSM613729     1  0.0000      0.992 1.000 0.000
#> GSM613730     2  0.0000      0.987 0.000 1.000
#> GSM613731     1  0.0000      0.992 1.000 0.000
#> GSM613732     2  0.0000      0.987 0.000 1.000
#> GSM613733     2  0.0000      0.987 0.000 1.000
#> GSM613734     1  0.0000      0.992 1.000 0.000
#> GSM613735     1  0.0000      0.992 1.000 0.000
#> GSM613736     2  0.0000      0.987 0.000 1.000
#> GSM613737     1  0.2043      0.965 0.968 0.032
#> GSM613738     1  0.0000      0.992 1.000 0.000
#> GSM613739     1  0.0000      0.992 1.000 0.000
#> GSM613740     2  0.0000      0.987 0.000 1.000
#> GSM613741     1  0.1633      0.972 0.976 0.024
#> GSM613742     1  0.0000      0.992 1.000 0.000
#> GSM613743     2  0.0000      0.987 0.000 1.000
#> GSM613744     2  0.0000      0.987 0.000 1.000
#> GSM613745     1  0.7883      0.695 0.764 0.236
#> GSM613746     2  0.0000      0.987 0.000 1.000
#> GSM613747     1  0.0000      0.992 1.000 0.000
#> GSM613748     2  0.1414      0.970 0.020 0.980
#> GSM613749     1  0.0000      0.992 1.000 0.000
#> GSM613750     2  0.0000      0.987 0.000 1.000
#> GSM613751     2  0.0000      0.987 0.000 1.000
#> GSM613752     2  0.0000      0.987 0.000 1.000
#> GSM613753     2  0.0000      0.987 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
#> GSM613638     3  0.4351    0.75387 0.168 0.004 0.828
#> GSM613639     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613640     2  0.6824    0.46004 0.016 0.576 0.408
#> GSM613641     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613642     2  0.2537    0.89463 0.000 0.920 0.080
#> GSM613643     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613644     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613645     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613646     3  0.8547    0.33985 0.364 0.104 0.532
#> GSM613647     3  0.1289    0.85783 0.032 0.000 0.968
#> GSM613648     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613649     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613650     1  0.6026    0.34686 0.624 0.000 0.376
#> GSM613651     3  0.3116    0.81127 0.108 0.000 0.892
#> GSM613652     1  0.0592    0.95731 0.988 0.000 0.012
#> GSM613653     1  0.8391    0.00846 0.484 0.084 0.432
#> GSM613654     1  0.0592    0.95731 0.988 0.000 0.012
#> GSM613655     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613656     1  0.0592    0.95731 0.988 0.000 0.012
#> GSM613657     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613658     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613659     2  0.0000    0.88644 0.000 1.000 0.000
#> GSM613660     2  0.2448    0.89715 0.000 0.924 0.076
#> GSM613661     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613662     2  0.0000    0.88644 0.000 1.000 0.000
#> GSM613663     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613664     2  0.0000    0.88644 0.000 1.000 0.000
#> GSM613665     2  0.2356    0.89840 0.000 0.928 0.072
#> GSM613666     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613667     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613668     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613669     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613670     2  0.0000    0.88644 0.000 1.000 0.000
#> GSM613671     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613672     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613673     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613674     2  0.2356    0.89840 0.000 0.928 0.072
#> GSM613675     2  0.0000    0.88644 0.000 1.000 0.000
#> GSM613676     2  0.2448    0.89715 0.000 0.924 0.076
#> GSM613677     2  0.3038    0.87581 0.000 0.896 0.104
#> GSM613678     2  0.3192    0.78395 0.112 0.888 0.000
#> GSM613679     2  0.2356    0.89840 0.000 0.928 0.072
#> GSM613680     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613681     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613682     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613683     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613684     2  0.2356    0.89840 0.000 0.928 0.072
#> GSM613685     2  0.2356    0.89840 0.000 0.928 0.072
#> GSM613686     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613687     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613688     2  0.2165    0.89860 0.000 0.936 0.064
#> GSM613689     3  0.0747    0.87228 0.000 0.016 0.984
#> GSM613690     3  0.0747    0.87228 0.000 0.016 0.984
#> GSM613691     2  0.0424    0.88476 0.000 0.992 0.008
#> GSM613692     1  0.0592    0.95731 0.988 0.000 0.012
#> GSM613693     3  0.5859    0.54993 0.000 0.344 0.656
#> GSM613694     3  0.2796    0.82285 0.092 0.000 0.908
#> GSM613695     3  0.0000    0.86828 0.000 0.000 1.000
#> GSM613696     3  0.2711    0.88194 0.000 0.088 0.912
#> GSM613697     3  0.3038    0.81444 0.104 0.000 0.896
#> GSM613698     3  0.2636    0.84556 0.020 0.048 0.932
#> GSM613699     3  0.0000    0.86828 0.000 0.000 1.000
#> GSM613700     2  0.2448    0.89715 0.000 0.924 0.076
#> GSM613701     2  0.1964    0.89804 0.000 0.944 0.056
#> GSM613702     2  0.0424    0.88914 0.000 0.992 0.008
#> GSM613703     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613704     2  0.0000    0.88644 0.000 1.000 0.000
#> GSM613705     3  0.0000    0.86828 0.000 0.000 1.000
#> GSM613706     2  0.8362    0.37954 0.348 0.556 0.096
#> GSM613707     2  0.2356    0.89840 0.000 0.928 0.072
#> GSM613708     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613709     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613710     2  0.2448    0.89715 0.000 0.924 0.076
#> GSM613711     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613712     3  0.2537    0.83086 0.080 0.000 0.920
#> GSM613713     3  0.3412    0.87261 0.000 0.124 0.876
#> GSM613714     3  0.0592    0.87138 0.000 0.012 0.988
#> GSM613715     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613716     3  0.4555    0.84001 0.000 0.200 0.800
#> GSM613717     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613718     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613719     3  0.5901    0.73927 0.192 0.040 0.768
#> GSM613720     3  0.4452    0.84502 0.000 0.192 0.808
#> GSM613721     2  0.6026    0.17590 0.000 0.624 0.376
#> GSM613722     2  0.2448    0.89715 0.000 0.924 0.076
#> GSM613723     1  0.0592    0.95731 0.988 0.000 0.012
#> GSM613724     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613725     2  0.2448    0.89715 0.000 0.924 0.076
#> GSM613726     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613727     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613728     2  0.0424    0.88914 0.000 0.992 0.008
#> GSM613729     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613730     2  0.0000    0.88644 0.000 1.000 0.000
#> GSM613731     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613732     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613733     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613734     1  0.0000    0.96305 1.000 0.000 0.000
#> GSM613735     1  0.0592    0.95731 0.988 0.000 0.012
#> GSM613736     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613737     3  0.2165    0.83997 0.064 0.000 0.936
#> GSM613738     1  0.0592    0.95731 0.988 0.000 0.012
#> GSM613739     1  0.0592    0.95731 0.988 0.000 0.012
#> GSM613740     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613741     1  0.8382    0.03912 0.492 0.084 0.424
#> GSM613742     1  0.0592    0.95731 0.988 0.000 0.012
#> GSM613743     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613744     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613745     3  0.8765    0.58453 0.168 0.252 0.580
#> GSM613746     2  0.4291    0.68834 0.000 0.820 0.180
#> GSM613747     1  0.0237    0.96122 0.996 0.000 0.004
#> GSM613748     2  0.1753    0.89716 0.000 0.952 0.048
#> GSM613749     2  0.6111    0.35503 0.396 0.604 0.000
#> GSM613750     3  0.1289    0.87593 0.000 0.032 0.968
#> GSM613751     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613752     3  0.3192    0.88102 0.000 0.112 0.888
#> GSM613753     3  0.0000    0.86828 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
#> GSM613638     3  0.6605     0.3934 0.068 0.008 0.556 0.368
#> GSM613639     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613640     3  0.9464     0.1208 0.336 0.204 0.340 0.120
#> GSM613641     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613642     2  0.3444     0.8524 0.000 0.816 0.184 0.000
#> GSM613643     1  0.0188     0.9866 0.996 0.000 0.000 0.004
#> GSM613644     1  0.0672     0.9795 0.984 0.008 0.000 0.008
#> GSM613645     1  0.0336     0.9813 0.992 0.008 0.000 0.000
#> GSM613646     4  0.7240     0.5965 0.032 0.184 0.156 0.628
#> GSM613647     4  0.1792     0.7993 0.000 0.000 0.068 0.932
#> GSM613648     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613649     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613650     4  0.3266     0.8462 0.168 0.000 0.000 0.832
#> GSM613651     4  0.2111     0.8165 0.024 0.000 0.044 0.932
#> GSM613652     4  0.3486     0.8465 0.188 0.000 0.000 0.812
#> GSM613653     4  0.5545     0.6999 0.008 0.180 0.076 0.736
#> GSM613654     4  0.3486     0.8465 0.188 0.000 0.000 0.812
#> GSM613655     1  0.0188     0.9866 0.996 0.000 0.000 0.004
#> GSM613656     4  0.3486     0.8465 0.188 0.000 0.000 0.812
#> GSM613657     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613658     1  0.0188     0.9866 0.996 0.000 0.000 0.004
#> GSM613659     2  0.1118     0.8144 0.000 0.964 0.000 0.036
#> GSM613660     2  0.3400     0.8551 0.000 0.820 0.180 0.000
#> GSM613661     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613662     2  0.1452     0.8194 0.000 0.956 0.008 0.036
#> GSM613663     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613664     2  0.1256     0.8225 0.000 0.964 0.008 0.028
#> GSM613665     2  0.3400     0.8551 0.000 0.820 0.180 0.000
#> GSM613666     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613667     1  0.0336     0.9813 0.992 0.008 0.000 0.000
#> GSM613668     1  0.0188     0.9866 0.996 0.000 0.000 0.004
#> GSM613669     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613670     2  0.1118     0.8144 0.000 0.964 0.000 0.036
#> GSM613671     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613672     1  0.0188     0.9866 0.996 0.000 0.000 0.004
#> GSM613673     1  0.0188     0.9866 0.996 0.000 0.000 0.004
#> GSM613674     2  0.3400     0.8551 0.000 0.820 0.180 0.000
#> GSM613675     2  0.1584     0.8218 0.000 0.952 0.012 0.036
#> GSM613676     2  0.3400     0.8551 0.000 0.820 0.180 0.000
#> GSM613677     2  0.4907     0.4830 0.000 0.580 0.420 0.000
#> GSM613678     2  0.5928     0.0104 0.456 0.508 0.000 0.036
#> GSM613679     2  0.3400     0.8551 0.000 0.820 0.180 0.000
#> GSM613680     1  0.0188     0.9866 0.996 0.000 0.000 0.004
#> GSM613681     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613682     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613683     1  0.0188     0.9866 0.996 0.000 0.000 0.004
#> GSM613684     2  0.3400     0.8551 0.000 0.820 0.180 0.000
#> GSM613685     2  0.3400     0.8551 0.000 0.820 0.180 0.000
#> GSM613686     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613687     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613688     2  0.3266     0.8559 0.000 0.832 0.168 0.000
#> GSM613689     3  0.1637     0.8816 0.000 0.000 0.940 0.060
#> GSM613690     3  0.1211     0.8921 0.000 0.000 0.960 0.040
#> GSM613691     2  0.4227     0.7387 0.000 0.820 0.120 0.060
#> GSM613692     4  0.3486     0.8465 0.188 0.000 0.000 0.812
#> GSM613693     3  0.1510     0.8809 0.000 0.016 0.956 0.028
#> GSM613694     4  0.1975     0.8120 0.016 0.000 0.048 0.936
#> GSM613695     3  0.2704     0.8380 0.000 0.000 0.876 0.124
#> GSM613696     3  0.2224     0.8722 0.000 0.032 0.928 0.040
#> GSM613697     4  0.2111     0.8165 0.024 0.000 0.044 0.932
#> GSM613698     4  0.1474     0.8036 0.000 0.000 0.052 0.948
#> GSM613699     3  0.3486     0.7723 0.000 0.000 0.812 0.188
#> GSM613700     2  0.3400     0.8551 0.000 0.820 0.180 0.000
#> GSM613701     2  0.3542     0.8504 0.028 0.852 0.120 0.000
#> GSM613702     2  0.0336     0.8287 0.000 0.992 0.008 0.000
#> GSM613703     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613704     2  0.1584     0.8218 0.000 0.952 0.012 0.036
#> GSM613705     3  0.5007     0.5233 0.000 0.008 0.636 0.356
#> GSM613706     1  0.5396     0.6823 0.740 0.104 0.000 0.156
#> GSM613707     2  0.3400     0.8551 0.000 0.820 0.180 0.000
#> GSM613708     1  0.0188     0.9866 0.996 0.000 0.000 0.004
#> GSM613709     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613710     2  0.3444     0.8524 0.000 0.816 0.184 0.000
#> GSM613711     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613712     4  0.3249     0.7343 0.008 0.000 0.140 0.852
#> GSM613713     3  0.0469     0.8996 0.000 0.012 0.988 0.000
#> GSM613714     3  0.2647     0.8403 0.000 0.000 0.880 0.120
#> GSM613715     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613716     3  0.4937     0.7110 0.000 0.172 0.764 0.064
#> GSM613717     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613718     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613719     4  0.2731     0.8205 0.032 0.048 0.008 0.912
#> GSM613720     3  0.2578     0.8555 0.000 0.036 0.912 0.052
#> GSM613721     2  0.5007     0.6715 0.000 0.760 0.172 0.068
#> GSM613722     2  0.3400     0.8551 0.000 0.820 0.180 0.000
#> GSM613723     4  0.3486     0.8465 0.188 0.000 0.000 0.812
#> GSM613724     1  0.0188     0.9866 0.996 0.000 0.000 0.004
#> GSM613725     2  0.3400     0.8551 0.000 0.820 0.180 0.000
#> GSM613726     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613727     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613728     2  0.1767     0.8404 0.000 0.944 0.044 0.012
#> GSM613729     1  0.0000     0.9875 1.000 0.000 0.000 0.000
#> GSM613730     2  0.0707     0.8203 0.000 0.980 0.000 0.020
#> GSM613731     1  0.0188     0.9866 0.996 0.000 0.000 0.004
#> GSM613732     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613733     3  0.0469     0.8988 0.000 0.012 0.988 0.000
#> GSM613734     4  0.4477     0.6948 0.312 0.000 0.000 0.688
#> GSM613735     4  0.3486     0.8465 0.188 0.000 0.000 0.812
#> GSM613736     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613737     4  0.1716     0.7995 0.000 0.000 0.064 0.936
#> GSM613738     4  0.3486     0.8465 0.188 0.000 0.000 0.812
#> GSM613739     4  0.3486     0.8465 0.188 0.000 0.000 0.812
#> GSM613740     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613741     4  0.5479     0.7027 0.008 0.180 0.072 0.740
#> GSM613742     4  0.3486     0.8465 0.188 0.000 0.000 0.812
#> GSM613743     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613744     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613745     4  0.6774     0.5913 0.008 0.196 0.160 0.636
#> GSM613746     2  0.4638     0.7092 0.000 0.788 0.152 0.060
#> GSM613747     4  0.3649     0.8327 0.204 0.000 0.000 0.796
#> GSM613748     2  0.1557     0.8455 0.000 0.944 0.056 0.000
#> GSM613749     1  0.1004     0.9604 0.972 0.024 0.000 0.004
#> GSM613750     3  0.0188     0.9053 0.000 0.000 0.996 0.004
#> GSM613751     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613752     3  0.0000     0.9064 0.000 0.000 1.000 0.000
#> GSM613753     3  0.2647     0.8403 0.000 0.000 0.880 0.120

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     5  0.7875     0.2411 0.000 0.168 0.268 0.120 0.444
#> GSM613639     1  0.0609     0.9433 0.980 0.000 0.000 0.020 0.000
#> GSM613640     2  0.7375     0.4240 0.036 0.604 0.128 0.120 0.112
#> GSM613641     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613642     2  0.3275     0.7572 0.000 0.860 0.064 0.068 0.008
#> GSM613643     1  0.4088     0.7914 0.812 0.040 0.000 0.116 0.032
#> GSM613644     1  0.4758     0.7526 0.772 0.056 0.000 0.124 0.048
#> GSM613645     1  0.0865     0.9380 0.972 0.004 0.000 0.024 0.000
#> GSM613646     4  0.2548     0.6879 0.000 0.004 0.004 0.876 0.116
#> GSM613647     5  0.2436     0.7423 0.000 0.020 0.036 0.032 0.912
#> GSM613648     3  0.0000     0.9270 0.000 0.000 1.000 0.000 0.000
#> GSM613649     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613650     5  0.5659     0.5357 0.100 0.000 0.000 0.320 0.580
#> GSM613651     5  0.0404     0.7774 0.012 0.000 0.000 0.000 0.988
#> GSM613652     5  0.2732     0.8211 0.160 0.000 0.000 0.000 0.840
#> GSM613653     4  0.2377     0.6784 0.000 0.000 0.000 0.872 0.128
#> GSM613654     5  0.2732     0.8211 0.160 0.000 0.000 0.000 0.840
#> GSM613655     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613656     5  0.2732     0.8211 0.160 0.000 0.000 0.000 0.840
#> GSM613657     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613658     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613659     4  0.4307    -0.0110 0.000 0.496 0.000 0.504 0.000
#> GSM613660     2  0.1671     0.7864 0.000 0.924 0.076 0.000 0.000
#> GSM613661     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613662     2  0.4446    -0.0127 0.000 0.520 0.004 0.476 0.000
#> GSM613663     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613664     2  0.4367     0.1651 0.000 0.580 0.004 0.416 0.000
#> GSM613665     2  0.2172     0.7870 0.000 0.908 0.076 0.016 0.000
#> GSM613666     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613667     1  0.0865     0.9380 0.972 0.004 0.000 0.024 0.000
#> GSM613668     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613669     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613670     4  0.4300     0.0576 0.000 0.476 0.000 0.524 0.000
#> GSM613671     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613672     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613673     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613674     2  0.2409     0.7840 0.000 0.900 0.068 0.032 0.000
#> GSM613675     2  0.4425     0.0732 0.000 0.544 0.004 0.452 0.000
#> GSM613676     2  0.2069     0.7874 0.000 0.912 0.076 0.012 0.000
#> GSM613677     2  0.5615     0.4619 0.000 0.584 0.320 0.096 0.000
#> GSM613678     1  0.6750    -0.1644 0.408 0.300 0.000 0.292 0.000
#> GSM613679     2  0.2046     0.7874 0.000 0.916 0.068 0.016 0.000
#> GSM613680     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613681     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613682     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613683     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613684     2  0.2903     0.7710 0.000 0.872 0.080 0.048 0.000
#> GSM613685     2  0.2409     0.7840 0.000 0.900 0.068 0.032 0.000
#> GSM613686     1  0.0510     0.9457 0.984 0.000 0.000 0.016 0.000
#> GSM613687     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613688     2  0.2580     0.7781 0.000 0.892 0.064 0.044 0.000
#> GSM613689     3  0.1571     0.8903 0.000 0.004 0.936 0.000 0.060
#> GSM613690     3  0.0703     0.9125 0.000 0.000 0.976 0.000 0.024
#> GSM613691     4  0.3318     0.6570 0.000 0.180 0.012 0.808 0.000
#> GSM613692     5  0.2690     0.8214 0.156 0.000 0.000 0.000 0.844
#> GSM613693     3  0.5037     0.3367 0.000 0.048 0.616 0.336 0.000
#> GSM613694     5  0.2569     0.7325 0.000 0.000 0.040 0.068 0.892
#> GSM613695     3  0.2445     0.8456 0.000 0.004 0.884 0.004 0.108
#> GSM613696     3  0.5367     0.0720 0.000 0.008 0.488 0.468 0.036
#> GSM613697     5  0.0404     0.7774 0.012 0.000 0.000 0.000 0.988
#> GSM613698     5  0.1740     0.7638 0.000 0.000 0.012 0.056 0.932
#> GSM613699     3  0.4686     0.6957 0.000 0.000 0.736 0.104 0.160
#> GSM613700     2  0.1544     0.7877 0.000 0.932 0.068 0.000 0.000
#> GSM613701     2  0.0451     0.7607 0.000 0.988 0.004 0.000 0.008
#> GSM613702     2  0.1608     0.7456 0.000 0.928 0.000 0.072 0.000
#> GSM613703     1  0.0609     0.9433 0.980 0.000 0.000 0.020 0.000
#> GSM613704     2  0.4446    -0.0127 0.000 0.520 0.004 0.476 0.000
#> GSM613705     5  0.7132     0.3290 0.000 0.080 0.272 0.120 0.528
#> GSM613706     2  0.7489     0.2748 0.236 0.512 0.000 0.120 0.132
#> GSM613707     2  0.2409     0.7840 0.000 0.900 0.068 0.032 0.000
#> GSM613708     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613709     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613710     2  0.2974     0.7662 0.000 0.868 0.080 0.052 0.000
#> GSM613711     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613712     5  0.0671     0.7681 0.000 0.000 0.016 0.004 0.980
#> GSM613713     3  0.1041     0.9036 0.000 0.032 0.964 0.004 0.000
#> GSM613714     3  0.2068     0.8629 0.000 0.000 0.904 0.004 0.092
#> GSM613715     3  0.0000     0.9270 0.000 0.000 1.000 0.000 0.000
#> GSM613716     4  0.4127     0.4735 0.000 0.008 0.312 0.680 0.000
#> GSM613717     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613718     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613719     5  0.4425     0.2721 0.004 0.000 0.000 0.452 0.544
#> GSM613720     4  0.4738     0.1019 0.000 0.016 0.464 0.520 0.000
#> GSM613721     4  0.2843     0.6783 0.000 0.144 0.008 0.848 0.000
#> GSM613722     2  0.1544     0.7877 0.000 0.932 0.068 0.000 0.000
#> GSM613723     5  0.2732     0.8211 0.160 0.000 0.000 0.000 0.840
#> GSM613724     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613725     2  0.1544     0.7877 0.000 0.932 0.068 0.000 0.000
#> GSM613726     1  0.0324     0.9500 0.992 0.004 0.000 0.000 0.004
#> GSM613727     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613728     2  0.2351     0.7449 0.000 0.896 0.016 0.088 0.000
#> GSM613729     1  0.0000     0.9544 1.000 0.000 0.000 0.000 0.000
#> GSM613730     2  0.3336     0.6693 0.000 0.772 0.000 0.228 0.000
#> GSM613731     1  0.3830     0.8033 0.824 0.040 0.000 0.116 0.020
#> GSM613732     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613733     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613734     5  0.3003     0.7980 0.188 0.000 0.000 0.000 0.812
#> GSM613735     5  0.2732     0.8211 0.160 0.000 0.000 0.000 0.840
#> GSM613736     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613737     5  0.1386     0.7643 0.000 0.000 0.032 0.016 0.952
#> GSM613738     5  0.2732     0.8211 0.160 0.000 0.000 0.000 0.840
#> GSM613739     5  0.2690     0.8214 0.156 0.000 0.000 0.000 0.844
#> GSM613740     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613741     4  0.2329     0.6829 0.000 0.000 0.000 0.876 0.124
#> GSM613742     5  0.2690     0.8212 0.156 0.000 0.000 0.000 0.844
#> GSM613743     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613744     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613745     4  0.2733     0.6931 0.000 0.012 0.004 0.872 0.112
#> GSM613746     4  0.3476     0.6598 0.000 0.176 0.020 0.804 0.000
#> GSM613747     5  0.2813     0.8150 0.168 0.000 0.000 0.000 0.832
#> GSM613748     2  0.2660     0.6845 0.000 0.864 0.000 0.128 0.008
#> GSM613749     1  0.1493     0.9213 0.948 0.024 0.000 0.028 0.000
#> GSM613750     3  0.0000     0.9270 0.000 0.000 1.000 0.000 0.000
#> GSM613751     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613752     3  0.0162     0.9284 0.000 0.004 0.996 0.000 0.000
#> GSM613753     3  0.1544     0.8811 0.000 0.000 0.932 0.000 0.068

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     4  0.2231     0.7109 0.004 0.000 0.028 0.900 0.068 0.000
#> GSM613639     1  0.0951     0.9648 0.968 0.000 0.000 0.008 0.004 0.020
#> GSM613640     4  0.1334     0.7250 0.000 0.032 0.000 0.948 0.020 0.000
#> GSM613641     1  0.0000     0.9856 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613642     2  0.3990     0.5759 0.000 0.688 0.028 0.284 0.000 0.000
#> GSM613643     4  0.3719     0.6250 0.248 0.000 0.000 0.728 0.024 0.000
#> GSM613644     4  0.3607     0.6522 0.204 0.000 0.000 0.768 0.016 0.012
#> GSM613645     1  0.1321     0.9482 0.952 0.000 0.000 0.020 0.004 0.024
#> GSM613646     6  0.0520     0.7486 0.000 0.000 0.000 0.008 0.008 0.984
#> GSM613647     5  0.4240     0.5221 0.000 0.004 0.012 0.304 0.668 0.012
#> GSM613648     3  0.0405     0.9148 0.000 0.004 0.988 0.008 0.000 0.000
#> GSM613649     3  0.0260     0.9178 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM613650     6  0.4317     0.4019 0.028 0.000 0.000 0.004 0.328 0.640
#> GSM613651     5  0.0547     0.8782 0.000 0.000 0.000 0.020 0.980 0.000
#> GSM613652     5  0.1444     0.9194 0.072 0.000 0.000 0.000 0.928 0.000
#> GSM613653     6  0.0862     0.7487 0.000 0.008 0.000 0.004 0.016 0.972
#> GSM613654     5  0.1444     0.9194 0.072 0.000 0.000 0.000 0.928 0.000
#> GSM613655     1  0.0260     0.9841 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM613656     5  0.1444     0.9194 0.072 0.000 0.000 0.000 0.928 0.000
#> GSM613657     3  0.0260     0.9178 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM613658     1  0.0260     0.9841 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM613659     2  0.4344     0.5076 0.000 0.652 0.000 0.044 0.000 0.304
#> GSM613660     2  0.2999     0.7538 0.000 0.836 0.040 0.124 0.000 0.000
#> GSM613661     1  0.0000     0.9856 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613662     2  0.4066     0.5630 0.000 0.692 0.000 0.036 0.000 0.272
#> GSM613663     1  0.0000     0.9856 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613664     2  0.2909     0.7062 0.000 0.836 0.000 0.028 0.000 0.136
#> GSM613665     2  0.1480     0.7878 0.000 0.940 0.040 0.020 0.000 0.000
#> GSM613666     1  0.0000     0.9856 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613667     1  0.1321     0.9482 0.952 0.000 0.000 0.020 0.004 0.024
#> GSM613668     1  0.0260     0.9841 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM613669     1  0.0000     0.9856 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613670     2  0.4332     0.4934 0.000 0.644 0.000 0.040 0.000 0.316
#> GSM613671     1  0.0000     0.9856 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613672     1  0.0363     0.9815 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM613673     1  0.0260     0.9841 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM613674     2  0.1196     0.7873 0.000 0.952 0.040 0.008 0.000 0.000
#> GSM613675     2  0.3865     0.5925 0.000 0.720 0.000 0.032 0.000 0.248
#> GSM613676     2  0.1564     0.7878 0.000 0.936 0.040 0.024 0.000 0.000
#> GSM613677     4  0.5607     0.3712 0.000 0.284 0.184 0.532 0.000 0.000
#> GSM613678     2  0.6820     0.1138 0.336 0.412 0.000 0.064 0.000 0.188
#> GSM613679     2  0.1564     0.7865 0.000 0.936 0.040 0.024 0.000 0.000
#> GSM613680     1  0.0260     0.9841 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM613681     1  0.0000     0.9856 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613682     1  0.0146     0.9850 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM613683     1  0.0363     0.9815 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM613684     2  0.1500     0.7813 0.000 0.936 0.052 0.012 0.000 0.000
#> GSM613685     2  0.1196     0.7873 0.000 0.952 0.040 0.008 0.000 0.000
#> GSM613686     1  0.0508     0.9762 0.984 0.000 0.000 0.004 0.000 0.012
#> GSM613687     1  0.0000     0.9856 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613688     2  0.0914     0.7816 0.000 0.968 0.016 0.016 0.000 0.000
#> GSM613689     3  0.1245     0.8921 0.000 0.000 0.952 0.032 0.016 0.000
#> GSM613690     3  0.0508     0.9108 0.000 0.000 0.984 0.012 0.004 0.000
#> GSM613691     6  0.3731     0.5872 0.000 0.240 0.004 0.020 0.000 0.736
#> GSM613692     5  0.1444     0.9194 0.072 0.000 0.000 0.000 0.928 0.000
#> GSM613693     3  0.5038     0.5228 0.000 0.176 0.664 0.008 0.000 0.152
#> GSM613694     5  0.4508     0.6455 0.000 0.004 0.036 0.044 0.740 0.176
#> GSM613695     3  0.2053     0.8691 0.000 0.004 0.916 0.052 0.024 0.004
#> GSM613696     3  0.4703     0.0983 0.000 0.016 0.508 0.004 0.012 0.460
#> GSM613697     5  0.0547     0.8782 0.000 0.000 0.000 0.020 0.980 0.000
#> GSM613698     5  0.1498     0.8700 0.000 0.004 0.012 0.012 0.948 0.024
#> GSM613699     3  0.4865     0.6465 0.000 0.004 0.720 0.044 0.064 0.168
#> GSM613700     2  0.3023     0.7472 0.000 0.828 0.032 0.140 0.000 0.000
#> GSM613701     2  0.3136     0.6868 0.000 0.768 0.000 0.228 0.000 0.004
#> GSM613702     2  0.3445     0.6630 0.000 0.732 0.000 0.260 0.000 0.008
#> GSM613703     1  0.0653     0.9734 0.980 0.000 0.000 0.004 0.004 0.012
#> GSM613704     2  0.3978     0.5719 0.000 0.700 0.000 0.032 0.000 0.268
#> GSM613705     4  0.2309     0.7050 0.000 0.000 0.028 0.888 0.084 0.000
#> GSM613706     4  0.1821     0.7267 0.008 0.040 0.000 0.928 0.024 0.000
#> GSM613707     2  0.1196     0.7873 0.000 0.952 0.040 0.008 0.000 0.000
#> GSM613708     1  0.0000     0.9856 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613709     1  0.0000     0.9856 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613710     2  0.3542     0.7191 0.000 0.788 0.052 0.160 0.000 0.000
#> GSM613711     3  0.0260     0.9178 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM613712     5  0.1594     0.8596 0.000 0.000 0.016 0.052 0.932 0.000
#> GSM613713     3  0.1444     0.8717 0.000 0.072 0.928 0.000 0.000 0.000
#> GSM613714     3  0.1852     0.8770 0.000 0.004 0.928 0.040 0.024 0.004
#> GSM613715     3  0.0508     0.9143 0.000 0.004 0.984 0.012 0.000 0.000
#> GSM613716     6  0.4946     0.2699 0.000 0.052 0.384 0.008 0.000 0.556
#> GSM613717     3  0.0260     0.9178 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM613718     3  0.0260     0.9178 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM613719     6  0.3672     0.5182 0.000 0.004 0.000 0.008 0.276 0.712
#> GSM613720     3  0.4970     0.2450 0.000 0.064 0.560 0.004 0.000 0.372
#> GSM613721     6  0.1387     0.7347 0.000 0.068 0.000 0.000 0.000 0.932
#> GSM613722     2  0.2983     0.7472 0.000 0.832 0.032 0.136 0.000 0.000
#> GSM613723     5  0.1444     0.9194 0.072 0.000 0.000 0.000 0.928 0.000
#> GSM613724     1  0.0260     0.9841 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM613725     2  0.3023     0.7472 0.000 0.828 0.032 0.140 0.000 0.000
#> GSM613726     1  0.0603     0.9768 0.980 0.000 0.000 0.016 0.004 0.000
#> GSM613727     1  0.0260     0.9841 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM613728     2  0.2129     0.7725 0.000 0.904 0.000 0.056 0.000 0.040
#> GSM613729     1  0.0146     0.9842 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM613730     4  0.5228     0.3162 0.000 0.308 0.000 0.572 0.000 0.120
#> GSM613731     4  0.3564     0.6134 0.264 0.000 0.000 0.724 0.012 0.000
#> GSM613732     3  0.0260     0.9178 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM613733     3  0.0405     0.9162 0.000 0.008 0.988 0.004 0.000 0.000
#> GSM613734     5  0.1765     0.8971 0.096 0.000 0.000 0.000 0.904 0.000
#> GSM613735     5  0.1444     0.9194 0.072 0.000 0.000 0.000 0.928 0.000
#> GSM613736     3  0.0260     0.9178 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM613737     5  0.1570     0.8646 0.000 0.004 0.008 0.028 0.944 0.016
#> GSM613738     5  0.1444     0.9194 0.072 0.000 0.000 0.000 0.928 0.000
#> GSM613739     5  0.1444     0.9194 0.072 0.000 0.000 0.000 0.928 0.000
#> GSM613740     3  0.0260     0.9178 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM613741     6  0.0665     0.7500 0.000 0.008 0.000 0.004 0.008 0.980
#> GSM613742     5  0.1444     0.9194 0.072 0.000 0.000 0.000 0.928 0.000
#> GSM613743     3  0.0260     0.9178 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM613744     3  0.0260     0.9178 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM613745     6  0.0551     0.7488 0.000 0.004 0.000 0.008 0.004 0.984
#> GSM613746     6  0.4006     0.5665 0.000 0.252 0.012 0.020 0.000 0.716
#> GSM613747     5  0.1663     0.9055 0.088 0.000 0.000 0.000 0.912 0.000
#> GSM613748     4  0.2333     0.6915 0.000 0.120 0.004 0.872 0.000 0.004
#> GSM613749     1  0.1856     0.9195 0.920 0.000 0.000 0.048 0.000 0.032
#> GSM613750     3  0.0551     0.9164 0.000 0.008 0.984 0.004 0.004 0.000
#> GSM613751     3  0.0405     0.9172 0.000 0.008 0.988 0.004 0.000 0.000
#> GSM613752     3  0.0405     0.9172 0.000 0.008 0.988 0.004 0.000 0.000
#> GSM613753     3  0.1282     0.8944 0.000 0.004 0.956 0.024 0.012 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-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 disease.state(p) k
#> MAD:skmeans 115          0.01478 2
#> MAD:skmeans 108          0.05864 3
#> MAD:skmeans 112          0.00891 4
#> MAD:skmeans  99          0.10080 5
#> MAD:skmeans 108          0.00583 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 27425 rows and 116 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 0.528           0.741       0.895         0.4968 0.497   0.497
#> 3 3 0.445           0.562       0.771         0.3264 0.737   0.521
#> 4 4 0.685           0.639       0.816         0.1227 0.854   0.617
#> 5 5 0.665           0.679       0.818         0.0658 0.857   0.544
#> 6 6 0.736           0.681       0.824         0.0327 0.956   0.800

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
#> GSM613638     1  0.9866    0.20261 0.568 0.432
#> GSM613639     1  0.0000    0.88105 1.000 0.000
#> GSM613640     1  0.8081    0.60757 0.752 0.248
#> GSM613641     1  0.0000    0.88105 1.000 0.000
#> GSM613642     2  0.6712    0.75413 0.176 0.824
#> GSM613643     1  0.0000    0.88105 1.000 0.000
#> GSM613644     1  0.3584    0.83129 0.932 0.068
#> GSM613645     1  0.0000    0.88105 1.000 0.000
#> GSM613646     1  0.9044    0.51189 0.680 0.320
#> GSM613647     2  0.9954    0.14037 0.460 0.540
#> GSM613648     2  0.0000    0.86083 0.000 1.000
#> GSM613649     2  0.0000    0.86083 0.000 1.000
#> GSM613650     1  0.8267    0.59812 0.740 0.260
#> GSM613651     2  0.9996    0.05248 0.488 0.512
#> GSM613652     1  0.0000    0.88105 1.000 0.000
#> GSM613653     2  0.8207    0.65049 0.256 0.744
#> GSM613654     1  0.0000    0.88105 1.000 0.000
#> GSM613655     1  0.0000    0.88105 1.000 0.000
#> GSM613656     1  0.0000    0.88105 1.000 0.000
#> GSM613657     2  0.0000    0.86083 0.000 1.000
#> GSM613658     1  0.0000    0.88105 1.000 0.000
#> GSM613659     1  0.5178    0.79645 0.884 0.116
#> GSM613660     2  0.0672    0.85913 0.008 0.992
#> GSM613661     1  0.0000    0.88105 1.000 0.000
#> GSM613662     2  0.7453    0.70314 0.212 0.788
#> GSM613663     1  0.0000    0.88105 1.000 0.000
#> GSM613664     1  0.8386    0.58785 0.732 0.268
#> GSM613665     2  0.0000    0.86083 0.000 1.000
#> GSM613666     1  0.0000    0.88105 1.000 0.000
#> GSM613667     1  0.0000    0.88105 1.000 0.000
#> GSM613668     1  0.0000    0.88105 1.000 0.000
#> GSM613669     1  0.0000    0.88105 1.000 0.000
#> GSM613670     1  0.9286    0.48567 0.656 0.344
#> GSM613671     1  0.0000    0.88105 1.000 0.000
#> GSM613672     1  0.0000    0.88105 1.000 0.000
#> GSM613673     1  0.0000    0.88105 1.000 0.000
#> GSM613674     2  0.8813    0.52542 0.300 0.700
#> GSM613675     2  0.2778    0.84451 0.048 0.952
#> GSM613676     2  0.0000    0.86083 0.000 1.000
#> GSM613677     2  0.4298    0.82252 0.088 0.912
#> GSM613678     1  0.0000    0.88105 1.000 0.000
#> GSM613679     2  0.9996    0.04842 0.488 0.512
#> GSM613680     1  0.0000    0.88105 1.000 0.000
#> GSM613681     1  0.0000    0.88105 1.000 0.000
#> GSM613682     1  0.0000    0.88105 1.000 0.000
#> GSM613683     1  0.0000    0.88105 1.000 0.000
#> GSM613684     2  0.0000    0.86083 0.000 1.000
#> GSM613685     2  0.9815    0.25130 0.420 0.580
#> GSM613686     1  0.0000    0.88105 1.000 0.000
#> GSM613687     1  0.0000    0.88105 1.000 0.000
#> GSM613688     2  0.8909    0.54737 0.308 0.692
#> GSM613689     2  0.3733    0.83515 0.072 0.928
#> GSM613690     2  0.3733    0.83515 0.072 0.928
#> GSM613691     2  0.0000    0.86083 0.000 1.000
#> GSM613692     1  0.9954    0.11358 0.540 0.460
#> GSM613693     2  0.0000    0.86083 0.000 1.000
#> GSM613694     1  0.2236    0.85684 0.964 0.036
#> GSM613695     2  0.4161    0.82878 0.084 0.916
#> GSM613696     2  0.4562    0.82080 0.096 0.904
#> GSM613697     2  0.9427    0.44657 0.360 0.640
#> GSM613698     2  0.7883    0.68163 0.236 0.764
#> GSM613699     2  0.6801    0.75085 0.180 0.820
#> GSM613700     1  0.9996   -0.00112 0.512 0.488
#> GSM613701     1  0.0000    0.88105 1.000 0.000
#> GSM613702     1  0.2948    0.84438 0.948 0.052
#> GSM613703     1  0.0000    0.88105 1.000 0.000
#> GSM613704     2  0.1184    0.85659 0.016 0.984
#> GSM613705     1  0.9754    0.26888 0.592 0.408
#> GSM613706     1  0.0000    0.88105 1.000 0.000
#> GSM613707     2  0.5629    0.76610 0.132 0.868
#> GSM613708     1  0.0000    0.88105 1.000 0.000
#> GSM613709     1  0.0000    0.88105 1.000 0.000
#> GSM613710     2  0.0376    0.86000 0.004 0.996
#> GSM613711     2  0.0000    0.86083 0.000 1.000
#> GSM613712     2  0.8386    0.63216 0.268 0.732
#> GSM613713     2  0.0000    0.86083 0.000 1.000
#> GSM613714     2  0.4022    0.83157 0.080 0.920
#> GSM613715     2  0.0000    0.86083 0.000 1.000
#> GSM613716     2  0.0000    0.86083 0.000 1.000
#> GSM613717     2  0.0000    0.86083 0.000 1.000
#> GSM613718     2  0.0000    0.86083 0.000 1.000
#> GSM613719     2  0.9998    0.03669 0.492 0.508
#> GSM613720     2  0.0000    0.86083 0.000 1.000
#> GSM613721     2  0.5059    0.81012 0.112 0.888
#> GSM613722     2  0.9996    0.08745 0.488 0.512
#> GSM613723     1  0.0000    0.88105 1.000 0.000
#> GSM613724     1  0.0000    0.88105 1.000 0.000
#> GSM613725     1  1.0000   -0.02813 0.504 0.496
#> GSM613726     1  0.0000    0.88105 1.000 0.000
#> GSM613727     1  0.0000    0.88105 1.000 0.000
#> GSM613728     2  0.5737    0.76415 0.136 0.864
#> GSM613729     1  0.0000    0.88105 1.000 0.000
#> GSM613730     1  0.6148    0.74497 0.848 0.152
#> GSM613731     1  0.0000    0.88105 1.000 0.000
#> GSM613732     2  0.0000    0.86083 0.000 1.000
#> GSM613733     2  0.0000    0.86083 0.000 1.000
#> GSM613734     1  0.0000    0.88105 1.000 0.000
#> GSM613735     1  0.0000    0.88105 1.000 0.000
#> GSM613736     2  0.0000    0.86083 0.000 1.000
#> GSM613737     2  0.5629    0.79417 0.132 0.868
#> GSM613738     1  0.8386    0.58628 0.732 0.268
#> GSM613739     1  0.9933    0.14183 0.548 0.452
#> GSM613740     2  0.0000    0.86083 0.000 1.000
#> GSM613741     1  0.8499    0.57390 0.724 0.276
#> GSM613742     1  0.9661    0.32433 0.608 0.392
#> GSM613743     2  0.0000    0.86083 0.000 1.000
#> GSM613744     2  0.0000    0.86083 0.000 1.000
#> GSM613745     1  0.8386    0.58788 0.732 0.268
#> GSM613746     2  0.0000    0.86083 0.000 1.000
#> GSM613747     1  0.0000    0.88105 1.000 0.000
#> GSM613748     1  0.3114    0.84387 0.944 0.056
#> GSM613749     1  0.0000    0.88105 1.000 0.000
#> GSM613750     2  0.0000    0.86083 0.000 1.000
#> GSM613751     2  0.0000    0.86083 0.000 1.000
#> GSM613752     2  0.0000    0.86083 0.000 1.000
#> GSM613753     2  0.3733    0.83515 0.072 0.928

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM613638     3  0.8889   -0.24106 0.428 0.120 0.452
#> GSM613639     1  0.7588    0.65487 0.684 0.120 0.196
#> GSM613640     3  0.7677    0.35210 0.204 0.120 0.676
#> GSM613641     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613642     2  0.5414    0.48741 0.016 0.772 0.212
#> GSM613643     1  0.7804    0.63927 0.664 0.120 0.216
#> GSM613644     1  0.7804    0.63927 0.664 0.120 0.216
#> GSM613645     1  0.4654    0.72054 0.792 0.000 0.208
#> GSM613646     1  0.9770    0.21335 0.400 0.368 0.232
#> GSM613647     3  0.3340    0.48853 0.000 0.120 0.880
#> GSM613648     2  0.6308   -0.51286 0.000 0.508 0.492
#> GSM613649     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613650     1  0.6723    0.68317 0.724 0.064 0.212
#> GSM613651     3  0.3607    0.48892 0.008 0.112 0.880
#> GSM613652     1  0.4291    0.69068 0.820 0.000 0.180
#> GSM613653     3  0.5659    0.54941 0.052 0.152 0.796
#> GSM613654     1  0.4291    0.69068 0.820 0.000 0.180
#> GSM613655     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613656     1  0.4291    0.69068 0.820 0.000 0.180
#> GSM613657     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613658     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613659     2  0.8595    0.36687 0.180 0.604 0.216
#> GSM613660     2  0.0237    0.67736 0.000 0.996 0.004
#> GSM613661     1  0.0237    0.79040 0.996 0.000 0.004
#> GSM613662     2  0.3752    0.59997 0.144 0.856 0.000
#> GSM613663     1  0.0237    0.79041 0.996 0.000 0.004
#> GSM613664     2  0.4521    0.56783 0.180 0.816 0.004
#> GSM613665     2  0.3340    0.65813 0.000 0.880 0.120
#> GSM613666     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613667     1  0.4834    0.72108 0.792 0.004 0.204
#> GSM613668     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613669     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613670     2  0.6511    0.51132 0.180 0.748 0.072
#> GSM613671     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613672     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613673     1  0.3412    0.75791 0.876 0.000 0.124
#> GSM613674     2  0.3340    0.65813 0.000 0.880 0.120
#> GSM613675     2  0.0983    0.67425 0.016 0.980 0.004
#> GSM613676     2  0.3340    0.65813 0.000 0.880 0.120
#> GSM613677     3  0.6955    0.47939 0.016 0.492 0.492
#> GSM613678     1  0.9683    0.23250 0.416 0.368 0.216
#> GSM613679     2  0.0237    0.67876 0.004 0.996 0.000
#> GSM613680     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613681     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613682     1  0.4605    0.72270 0.796 0.000 0.204
#> GSM613683     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613684     2  0.3340    0.65813 0.000 0.880 0.120
#> GSM613685     2  0.3340    0.65813 0.000 0.880 0.120
#> GSM613686     1  0.4346    0.73310 0.816 0.000 0.184
#> GSM613687     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613688     2  0.5521    0.56840 0.180 0.788 0.032
#> GSM613689     3  0.5138    0.56395 0.000 0.252 0.748
#> GSM613690     3  0.4931    0.56833 0.000 0.232 0.768
#> GSM613691     2  0.5905    0.14633 0.000 0.648 0.352
#> GSM613692     1  0.6180    0.32945 0.584 0.000 0.416
#> GSM613693     2  0.4062    0.60617 0.000 0.836 0.164
#> GSM613694     1  0.9824    0.27362 0.404 0.248 0.348
#> GSM613695     3  0.5497    0.51012 0.000 0.292 0.708
#> GSM613696     2  0.5254    0.58129 0.000 0.736 0.264
#> GSM613697     3  0.3340    0.48853 0.000 0.120 0.880
#> GSM613698     3  0.3340    0.48853 0.000 0.120 0.880
#> GSM613699     3  0.6783    0.12029 0.016 0.396 0.588
#> GSM613700     2  0.0237    0.67736 0.000 0.996 0.004
#> GSM613701     2  0.8595    0.36687 0.180 0.604 0.216
#> GSM613702     1  0.9683    0.23250 0.416 0.368 0.216
#> GSM613703     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613704     2  0.2703    0.67970 0.016 0.928 0.056
#> GSM613705     3  0.6322    0.49824 0.024 0.276 0.700
#> GSM613706     1  0.9683    0.23250 0.416 0.368 0.216
#> GSM613707     2  0.3340    0.65813 0.000 0.880 0.120
#> GSM613708     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613709     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613710     2  0.0237    0.67736 0.000 0.996 0.004
#> GSM613711     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613712     3  0.3340    0.48853 0.000 0.120 0.880
#> GSM613713     2  0.3340    0.65813 0.000 0.880 0.120
#> GSM613714     3  0.5968    0.52283 0.000 0.364 0.636
#> GSM613715     3  0.6095    0.56392 0.000 0.392 0.608
#> GSM613716     3  0.6095    0.56392 0.000 0.392 0.608
#> GSM613717     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613718     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613719     3  0.4068    0.48368 0.016 0.120 0.864
#> GSM613720     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613721     2  0.5363    0.57457 0.000 0.724 0.276
#> GSM613722     2  0.1337    0.67131 0.016 0.972 0.012
#> GSM613723     1  0.4291    0.69068 0.820 0.000 0.180
#> GSM613724     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613725     2  0.3267    0.65987 0.000 0.884 0.116
#> GSM613726     1  0.7762    0.64269 0.668 0.120 0.212
#> GSM613727     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613728     2  0.0237    0.67736 0.000 0.996 0.004
#> GSM613729     1  0.0000    0.79098 1.000 0.000 0.000
#> GSM613730     2  0.9573   -0.00832 0.328 0.460 0.212
#> GSM613731     1  0.7804    0.63927 0.664 0.120 0.216
#> GSM613732     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613733     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613734     1  0.4291    0.69068 0.820 0.000 0.180
#> GSM613735     1  0.4291    0.69068 0.820 0.000 0.180
#> GSM613736     2  0.5138    0.45918 0.000 0.748 0.252
#> GSM613737     3  0.0237    0.52376 0.000 0.004 0.996
#> GSM613738     1  0.5650    0.54602 0.688 0.000 0.312
#> GSM613739     3  0.6252   -0.24186 0.444 0.000 0.556
#> GSM613740     3  0.6095    0.56392 0.000 0.392 0.608
#> GSM613741     2  0.9952    0.21394 0.292 0.376 0.332
#> GSM613742     3  0.6111   -0.22388 0.396 0.000 0.604
#> GSM613743     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613744     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613745     1  0.8445    0.54008 0.580 0.116 0.304
#> GSM613746     2  0.3340    0.65813 0.000 0.880 0.120
#> GSM613747     1  0.4291    0.69068 0.820 0.000 0.180
#> GSM613748     1  0.9386    0.44525 0.500 0.204 0.296
#> GSM613749     1  0.7525    0.65667 0.684 0.108 0.208
#> GSM613750     3  0.6095    0.56392 0.000 0.392 0.608
#> GSM613751     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613752     3  0.6111    0.56252 0.000 0.396 0.604
#> GSM613753     3  0.2356    0.54271 0.000 0.072 0.928

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM613638     1  0.5000    -0.3945 0.500 0.000 0.500 0.000
#> GSM613639     1  0.3311     0.5533 0.828 0.000 0.000 0.172
#> GSM613640     1  0.4985    -0.3262 0.532 0.000 0.468 0.000
#> GSM613641     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613642     2  0.3668     0.7559 0.188 0.808 0.004 0.000
#> GSM613643     1  0.0000     0.5574 1.000 0.000 0.000 0.000
#> GSM613644     1  0.0000     0.5574 1.000 0.000 0.000 0.000
#> GSM613645     1  0.1940     0.5732 0.924 0.000 0.000 0.076
#> GSM613646     1  0.0000     0.5574 1.000 0.000 0.000 0.000
#> GSM613647     1  0.7519    -0.2396 0.480 0.000 0.208 0.312
#> GSM613648     3  0.0336     0.8477 0.008 0.000 0.992 0.000
#> GSM613649     3  0.2469     0.8029 0.000 0.108 0.892 0.000
#> GSM613650     1  0.2949     0.5640 0.888 0.000 0.024 0.088
#> GSM613651     4  0.7417     0.1860 0.208 0.000 0.284 0.508
#> GSM613652     4  0.0000     0.7785 0.000 0.000 0.000 1.000
#> GSM613653     3  0.3710     0.7242 0.192 0.004 0.804 0.000
#> GSM613654     4  0.0000     0.7785 0.000 0.000 0.000 1.000
#> GSM613655     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613656     4  0.0000     0.7785 0.000 0.000 0.000 1.000
#> GSM613657     3  0.0000     0.8494 0.000 0.000 1.000 0.000
#> GSM613658     1  0.4999     0.5089 0.508 0.000 0.000 0.492
#> GSM613659     2  0.3528     0.7522 0.192 0.808 0.000 0.000
#> GSM613660     2  0.2542     0.8471 0.084 0.904 0.012 0.000
#> GSM613661     1  0.4992     0.5260 0.524 0.000 0.000 0.476
#> GSM613662     2  0.0000     0.8884 0.000 1.000 0.000 0.000
#> GSM613663     1  0.4955     0.5293 0.556 0.000 0.000 0.444
#> GSM613664     2  0.0000     0.8884 0.000 1.000 0.000 0.000
#> GSM613665     2  0.0469     0.8861 0.000 0.988 0.012 0.000
#> GSM613666     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613667     1  0.2216     0.5736 0.908 0.000 0.000 0.092
#> GSM613668     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613669     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613670     2  0.0000     0.8884 0.000 1.000 0.000 0.000
#> GSM613671     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613672     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613673     1  0.4222     0.5534 0.728 0.000 0.000 0.272
#> GSM613674     2  0.0000     0.8884 0.000 1.000 0.000 0.000
#> GSM613675     2  0.0000     0.8884 0.000 1.000 0.000 0.000
#> GSM613676     2  0.0336     0.8872 0.000 0.992 0.008 0.000
#> GSM613677     3  0.2976     0.7996 0.008 0.120 0.872 0.000
#> GSM613678     1  0.2081     0.5347 0.916 0.084 0.000 0.000
#> GSM613679     2  0.0000     0.8884 0.000 1.000 0.000 0.000
#> GSM613680     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613681     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613682     1  0.2216     0.5736 0.908 0.000 0.000 0.092
#> GSM613683     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613684     2  0.3400     0.8147 0.000 0.820 0.180 0.000
#> GSM613685     2  0.0000     0.8884 0.000 1.000 0.000 0.000
#> GSM613686     1  0.2530     0.5737 0.888 0.000 0.000 0.112
#> GSM613687     1  0.4992     0.5267 0.524 0.000 0.000 0.476
#> GSM613688     2  0.3311     0.8210 0.000 0.828 0.172 0.000
#> GSM613689     3  0.0000     0.8494 0.000 0.000 1.000 0.000
#> GSM613690     3  0.0000     0.8494 0.000 0.000 1.000 0.000
#> GSM613691     3  0.4972    -0.0557 0.000 0.456 0.544 0.000
#> GSM613692     4  0.0000     0.7785 0.000 0.000 0.000 1.000
#> GSM613693     2  0.4624     0.6036 0.000 0.660 0.340 0.000
#> GSM613694     1  0.0000     0.5574 1.000 0.000 0.000 0.000
#> GSM613695     3  0.3688     0.7149 0.208 0.000 0.792 0.000
#> GSM613696     2  0.3852     0.8127 0.012 0.808 0.180 0.000
#> GSM613697     3  0.7573     0.2235 0.208 0.000 0.460 0.332
#> GSM613698     3  0.7453     0.3053 0.204 0.000 0.496 0.300
#> GSM613699     3  0.7587     0.0581 0.196 0.392 0.412 0.000
#> GSM613700     2  0.2125     0.8540 0.076 0.920 0.004 0.000
#> GSM613701     2  0.3528     0.7522 0.192 0.808 0.000 0.000
#> GSM613702     1  0.0000     0.5574 1.000 0.000 0.000 0.000
#> GSM613703     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613704     2  0.0000     0.8884 0.000 1.000 0.000 0.000
#> GSM613705     3  0.4955     0.4476 0.444 0.000 0.556 0.000
#> GSM613706     1  0.0000     0.5574 1.000 0.000 0.000 0.000
#> GSM613707     2  0.0469     0.8879 0.000 0.988 0.012 0.000
#> GSM613708     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613709     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613710     2  0.2542     0.8471 0.084 0.904 0.012 0.000
#> GSM613711     3  0.0469     0.8472 0.000 0.012 0.988 0.000
#> GSM613712     3  0.3688     0.7134 0.208 0.000 0.792 0.000
#> GSM613713     2  0.3649     0.8004 0.000 0.796 0.204 0.000
#> GSM613714     3  0.2589     0.7940 0.116 0.000 0.884 0.000
#> GSM613715     3  0.0000     0.8494 0.000 0.000 1.000 0.000
#> GSM613716     3  0.0817     0.8425 0.000 0.024 0.976 0.000
#> GSM613717     3  0.0188     0.8488 0.000 0.004 0.996 0.000
#> GSM613718     3  0.0000     0.8494 0.000 0.000 1.000 0.000
#> GSM613719     3  0.3649     0.7169 0.204 0.000 0.796 0.000
#> GSM613720     3  0.3024     0.7763 0.000 0.148 0.852 0.000
#> GSM613721     2  0.3852     0.8125 0.012 0.808 0.180 0.000
#> GSM613722     2  0.0000     0.8884 0.000 1.000 0.000 0.000
#> GSM613723     4  0.0000     0.7785 0.000 0.000 0.000 1.000
#> GSM613724     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613725     2  0.2149     0.8693 0.000 0.912 0.088 0.000
#> GSM613726     1  0.0000     0.5574 1.000 0.000 0.000 0.000
#> GSM613727     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613728     2  0.0000     0.8884 0.000 1.000 0.000 0.000
#> GSM613729     1  0.4994     0.5259 0.520 0.000 0.000 0.480
#> GSM613730     1  0.4372     0.2550 0.728 0.268 0.004 0.000
#> GSM613731     1  0.0000     0.5574 1.000 0.000 0.000 0.000
#> GSM613732     3  0.0000     0.8494 0.000 0.000 1.000 0.000
#> GSM613733     3  0.3172     0.7669 0.000 0.160 0.840 0.000
#> GSM613734     4  0.0000     0.7785 0.000 0.000 0.000 1.000
#> GSM613735     4  0.0000     0.7785 0.000 0.000 0.000 1.000
#> GSM613736     2  0.6559     0.2273 0.076 0.468 0.456 0.000
#> GSM613737     4  0.6937     0.3666 0.376 0.000 0.116 0.508
#> GSM613738     4  0.0469     0.7708 0.012 0.000 0.000 0.988
#> GSM613739     4  0.4250     0.5255 0.276 0.000 0.000 0.724
#> GSM613740     3  0.0000     0.8494 0.000 0.000 1.000 0.000
#> GSM613741     1  0.5721     0.0267 0.584 0.388 0.024 0.004
#> GSM613742     4  0.4804     0.3995 0.384 0.000 0.000 0.616
#> GSM613743     3  0.0000     0.8494 0.000 0.000 1.000 0.000
#> GSM613744     3  0.0000     0.8494 0.000 0.000 1.000 0.000
#> GSM613745     1  0.1576     0.5689 0.948 0.000 0.004 0.048
#> GSM613746     2  0.1940     0.8730 0.000 0.924 0.076 0.000
#> GSM613747     4  0.0000     0.7785 0.000 0.000 0.000 1.000
#> GSM613748     1  0.0000     0.5574 1.000 0.000 0.000 0.000
#> GSM613749     1  0.1940     0.5725 0.924 0.000 0.000 0.076
#> GSM613750     3  0.0000     0.8494 0.000 0.000 1.000 0.000
#> GSM613751     3  0.0592     0.8455 0.000 0.016 0.984 0.000
#> GSM613752     3  0.0188     0.8486 0.000 0.004 0.996 0.000
#> GSM613753     3  0.0000     0.8494 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
#> GSM613638     4  0.2966     0.6841 0.000 0.000 0.184 0.816 0.000
#> GSM613639     4  0.3700     0.6952 0.240 0.000 0.000 0.752 0.008
#> GSM613640     4  0.3495     0.7154 0.032 0.000 0.152 0.816 0.000
#> GSM613641     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613642     2  0.3521     0.6570 0.000 0.764 0.004 0.232 0.000
#> GSM613643     4  0.2966     0.7510 0.184 0.000 0.000 0.816 0.000
#> GSM613644     4  0.2966     0.7510 0.184 0.000 0.000 0.816 0.000
#> GSM613645     1  0.3689     0.6477 0.740 0.000 0.000 0.256 0.004
#> GSM613646     1  0.6265     0.4667 0.596 0.000 0.016 0.172 0.216
#> GSM613647     4  0.3647     0.6512 0.000 0.000 0.052 0.816 0.132
#> GSM613648     3  0.3731     0.6907 0.000 0.000 0.800 0.160 0.040
#> GSM613649     3  0.2592     0.8368 0.000 0.052 0.892 0.000 0.056
#> GSM613650     1  0.6818     0.2463 0.484 0.000 0.020 0.324 0.172
#> GSM613651     5  0.2249     0.6373 0.000 0.000 0.008 0.096 0.896
#> GSM613652     5  0.3561     0.7250 0.260 0.000 0.000 0.000 0.740
#> GSM613653     5  0.7005    -0.2458 0.000 0.208 0.388 0.016 0.388
#> GSM613654     5  0.3561     0.7250 0.260 0.000 0.000 0.000 0.740
#> GSM613655     1  0.0794     0.8298 0.972 0.000 0.000 0.000 0.028
#> GSM613656     5  0.3561     0.7250 0.260 0.000 0.000 0.000 0.740
#> GSM613657     3  0.0510     0.8519 0.000 0.000 0.984 0.000 0.016
#> GSM613658     1  0.0162     0.8495 0.996 0.000 0.000 0.000 0.004
#> GSM613659     2  0.4401     0.7109 0.000 0.764 0.000 0.104 0.132
#> GSM613660     4  0.5320     0.1645 0.000 0.424 0.052 0.524 0.000
#> GSM613661     1  0.0404     0.8485 0.988 0.000 0.000 0.012 0.000
#> GSM613662     2  0.0162     0.8147 0.000 0.996 0.000 0.000 0.004
#> GSM613663     1  0.0404     0.8487 0.988 0.000 0.000 0.012 0.000
#> GSM613664     2  0.0000     0.8148 0.000 1.000 0.000 0.000 0.000
#> GSM613665     2  0.1121     0.8057 0.000 0.956 0.044 0.000 0.000
#> GSM613666     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613667     1  0.3508     0.6538 0.748 0.000 0.000 0.252 0.000
#> GSM613668     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613669     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613670     2  0.0963     0.8116 0.000 0.964 0.000 0.000 0.036
#> GSM613671     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613672     1  0.0162     0.8515 0.996 0.000 0.000 0.004 0.000
#> GSM613673     1  0.2561     0.7641 0.856 0.000 0.000 0.144 0.000
#> GSM613674     2  0.0000     0.8148 0.000 1.000 0.000 0.000 0.000
#> GSM613675     2  0.0000     0.8148 0.000 1.000 0.000 0.000 0.000
#> GSM613676     2  0.1121     0.8053 0.000 0.956 0.044 0.000 0.000
#> GSM613677     4  0.7457     0.0781 0.000 0.124 0.384 0.408 0.084
#> GSM613678     1  0.5512     0.4987 0.620 0.104 0.000 0.276 0.000
#> GSM613679     2  0.0000     0.8148 0.000 1.000 0.000 0.000 0.000
#> GSM613680     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613681     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613682     1  0.3508     0.6538 0.748 0.000 0.000 0.252 0.000
#> GSM613683     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613684     2  0.2471     0.7696 0.000 0.864 0.136 0.000 0.000
#> GSM613685     2  0.0000     0.8148 0.000 1.000 0.000 0.000 0.000
#> GSM613686     1  0.3720     0.6733 0.760 0.000 0.000 0.228 0.012
#> GSM613687     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613688     2  0.3182     0.7853 0.000 0.864 0.092 0.016 0.028
#> GSM613689     3  0.2830     0.8180 0.000 0.000 0.876 0.044 0.080
#> GSM613690     3  0.3305     0.7268 0.000 0.000 0.776 0.000 0.224
#> GSM613691     2  0.5213     0.6513 0.000 0.696 0.176 0.004 0.124
#> GSM613692     5  0.3395     0.7294 0.236 0.000 0.000 0.000 0.764
#> GSM613693     2  0.4410     0.3383 0.000 0.556 0.440 0.000 0.004
#> GSM613694     1  0.5922     0.5138 0.604 0.000 0.016 0.096 0.284
#> GSM613695     4  0.6498     0.1682 0.000 0.000 0.352 0.452 0.196
#> GSM613696     2  0.4610     0.7037 0.000 0.740 0.040 0.016 0.204
#> GSM613697     5  0.4119     0.5488 0.000 0.000 0.152 0.068 0.780
#> GSM613698     5  0.3535     0.5187 0.000 0.000 0.164 0.028 0.808
#> GSM613699     2  0.7557     0.2447 0.000 0.440 0.268 0.056 0.236
#> GSM613700     2  0.4528     0.0933 0.000 0.548 0.008 0.444 0.000
#> GSM613701     2  0.3877     0.6712 0.000 0.764 0.000 0.212 0.024
#> GSM613702     4  0.2966     0.7510 0.184 0.000 0.000 0.816 0.000
#> GSM613703     1  0.0290     0.8501 0.992 0.000 0.000 0.000 0.008
#> GSM613704     2  0.0000     0.8148 0.000 1.000 0.000 0.000 0.000
#> GSM613705     4  0.3355     0.6773 0.000 0.000 0.184 0.804 0.012
#> GSM613706     4  0.2966     0.7510 0.184 0.000 0.000 0.816 0.000
#> GSM613707     2  0.0162     0.8150 0.000 0.996 0.004 0.000 0.000
#> GSM613708     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613709     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613710     2  0.5458    -0.0787 0.000 0.476 0.060 0.464 0.000
#> GSM613711     3  0.0162     0.8523 0.000 0.004 0.996 0.000 0.000
#> GSM613712     5  0.5688     0.1875 0.000 0.000 0.328 0.100 0.572
#> GSM613713     2  0.4161     0.4763 0.000 0.608 0.392 0.000 0.000
#> GSM613714     4  0.5873     0.4163 0.000 0.000 0.312 0.564 0.124
#> GSM613715     3  0.2325     0.8384 0.000 0.000 0.904 0.028 0.068
#> GSM613716     3  0.7524     0.3459 0.000 0.236 0.460 0.060 0.244
#> GSM613717     3  0.0671     0.8524 0.000 0.004 0.980 0.000 0.016
#> GSM613718     3  0.0000     0.8518 0.000 0.000 1.000 0.000 0.000
#> GSM613719     5  0.4491     0.2061 0.004 0.000 0.336 0.012 0.648
#> GSM613720     3  0.3141     0.7731 0.000 0.152 0.832 0.000 0.016
#> GSM613721     2  0.4498     0.7269 0.000 0.756 0.132 0.000 0.112
#> GSM613722     2  0.0000     0.8148 0.000 1.000 0.000 0.000 0.000
#> GSM613723     5  0.3561     0.7250 0.260 0.000 0.000 0.000 0.740
#> GSM613724     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613725     2  0.1544     0.8031 0.000 0.932 0.068 0.000 0.000
#> GSM613726     4  0.2966     0.7510 0.184 0.000 0.000 0.816 0.000
#> GSM613727     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613728     2  0.0000     0.8148 0.000 1.000 0.000 0.000 0.000
#> GSM613729     1  0.0000     0.8525 1.000 0.000 0.000 0.000 0.000
#> GSM613730     4  0.4512     0.7442 0.140 0.044 0.000 0.780 0.036
#> GSM613731     4  0.2966     0.7510 0.184 0.000 0.000 0.816 0.000
#> GSM613732     3  0.0794     0.8493 0.000 0.000 0.972 0.000 0.028
#> GSM613733     3  0.2020     0.8151 0.000 0.100 0.900 0.000 0.000
#> GSM613734     5  0.3586     0.7213 0.264 0.000 0.000 0.000 0.736
#> GSM613735     5  0.3561     0.7250 0.260 0.000 0.000 0.000 0.740
#> GSM613736     3  0.4791     0.6209 0.000 0.124 0.740 0.132 0.004
#> GSM613737     5  0.2331     0.6293 0.000 0.000 0.020 0.080 0.900
#> GSM613738     5  0.3890     0.7257 0.252 0.000 0.000 0.012 0.736
#> GSM613739     5  0.4610     0.6308 0.092 0.000 0.000 0.168 0.740
#> GSM613740     3  0.0000     0.8518 0.000 0.000 1.000 0.000 0.000
#> GSM613741     2  0.8213     0.0933 0.220 0.352 0.028 0.052 0.348
#> GSM613742     5  0.2848     0.6115 0.004 0.000 0.000 0.156 0.840
#> GSM613743     3  0.0000     0.8518 0.000 0.000 1.000 0.000 0.000
#> GSM613744     3  0.0880     0.8491 0.000 0.000 0.968 0.000 0.032
#> GSM613745     1  0.5728     0.4925 0.588 0.000 0.024 0.052 0.336
#> GSM613746     2  0.1965     0.8058 0.000 0.924 0.052 0.000 0.024
#> GSM613747     5  0.4088     0.5819 0.368 0.000 0.000 0.000 0.632
#> GSM613748     4  0.2966     0.7510 0.184 0.000 0.000 0.816 0.000
#> GSM613749     1  0.4101     0.4584 0.628 0.000 0.000 0.372 0.000
#> GSM613750     3  0.3724     0.7652 0.000 0.000 0.788 0.184 0.028
#> GSM613751     3  0.4707     0.7493 0.000 0.040 0.748 0.184 0.028
#> GSM613752     3  0.3724     0.7652 0.000 0.000 0.788 0.184 0.028
#> GSM613753     3  0.5577     0.6946 0.000 0.000 0.644 0.184 0.172

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     4  0.0000     0.8073 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613639     4  0.1787     0.7518 0.068 0.000 0.000 0.920 0.008 0.004
#> GSM613640     4  0.0000     0.8073 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613641     1  0.0458     0.8529 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM613642     2  0.3074     0.7281 0.000 0.792 0.004 0.200 0.000 0.004
#> GSM613643     4  0.0000     0.8073 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613644     4  0.0000     0.8073 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613645     1  0.3383     0.6822 0.728 0.000 0.000 0.268 0.000 0.004
#> GSM613646     1  0.5493     0.5590 0.640 0.000 0.000 0.056 0.224 0.080
#> GSM613647     4  0.0146     0.8065 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM613648     3  0.4184     0.5097 0.000 0.000 0.744 0.196 0.028 0.032
#> GSM613649     3  0.1492     0.7412 0.000 0.024 0.940 0.000 0.000 0.036
#> GSM613650     4  0.6711    -0.0410 0.368 0.000 0.000 0.404 0.168 0.060
#> GSM613651     5  0.2149     0.5761 0.000 0.000 0.004 0.104 0.888 0.004
#> GSM613652     5  0.4518     0.6511 0.200 0.000 0.000 0.000 0.696 0.104
#> GSM613653     5  0.7461    -0.1026 0.000 0.272 0.284 0.008 0.344 0.092
#> GSM613654     5  0.4518     0.6511 0.200 0.000 0.000 0.000 0.696 0.104
#> GSM613655     1  0.1950     0.8299 0.912 0.000 0.000 0.000 0.024 0.064
#> GSM613656     5  0.4641     0.6464 0.200 0.000 0.000 0.000 0.684 0.116
#> GSM613657     3  0.0363     0.7518 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM613658     1  0.1588     0.8402 0.924 0.000 0.000 0.000 0.004 0.072
#> GSM613659     2  0.4179     0.7569 0.000 0.776 0.000 0.080 0.116 0.028
#> GSM613660     4  0.4911     0.5552 0.000 0.204 0.116 0.672 0.000 0.008
#> GSM613661     1  0.2740     0.8169 0.864 0.000 0.000 0.076 0.000 0.060
#> GSM613662     2  0.1327     0.8405 0.000 0.936 0.000 0.000 0.000 0.064
#> GSM613663     1  0.0363     0.8515 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM613664     2  0.1501     0.8421 0.000 0.924 0.000 0.000 0.000 0.076
#> GSM613665     2  0.2937     0.7951 0.000 0.848 0.096 0.000 0.000 0.056
#> GSM613666     1  0.0458     0.8529 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM613667     1  0.2793     0.7422 0.800 0.000 0.000 0.200 0.000 0.000
#> GSM613668     1  0.0000     0.8524 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613669     1  0.1501     0.8425 0.924 0.000 0.000 0.000 0.000 0.076
#> GSM613670     2  0.1858     0.8394 0.000 0.904 0.000 0.000 0.004 0.092
#> GSM613671     1  0.0458     0.8529 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM613672     1  0.0260     0.8525 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM613673     1  0.2527     0.7756 0.832 0.000 0.000 0.168 0.000 0.000
#> GSM613674     2  0.0547     0.8394 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM613675     2  0.1610     0.8382 0.000 0.916 0.000 0.000 0.000 0.084
#> GSM613676     2  0.2668     0.7375 0.000 0.828 0.168 0.000 0.000 0.004
#> GSM613677     4  0.6881     0.3296 0.000 0.124 0.264 0.520 0.052 0.040
#> GSM613678     1  0.4664     0.6118 0.644 0.076 0.000 0.280 0.000 0.000
#> GSM613679     2  0.0363     0.8396 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM613680     1  0.0000     0.8524 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613681     1  0.0146     0.8526 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM613682     1  0.2996     0.7229 0.772 0.000 0.000 0.228 0.000 0.000
#> GSM613683     1  0.1267     0.8438 0.940 0.000 0.000 0.000 0.000 0.060
#> GSM613684     2  0.2356     0.8120 0.000 0.884 0.096 0.000 0.004 0.016
#> GSM613685     2  0.0547     0.8394 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM613686     1  0.3053     0.7572 0.812 0.000 0.000 0.168 0.000 0.020
#> GSM613687     1  0.0000     0.8524 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613688     2  0.2602     0.8248 0.000 0.892 0.052 0.004 0.020 0.032
#> GSM613689     3  0.3620     0.6046 0.000 0.000 0.808 0.060 0.120 0.012
#> GSM613690     3  0.5147     0.4127 0.000 0.000 0.652 0.060 0.248 0.040
#> GSM613691     2  0.5104     0.6806 0.000 0.664 0.168 0.000 0.012 0.156
#> GSM613692     5  0.3141     0.6597 0.200 0.000 0.000 0.000 0.788 0.012
#> GSM613693     3  0.4473    -0.1941 0.000 0.480 0.492 0.000 0.000 0.028
#> GSM613694     1  0.4436     0.5418 0.632 0.000 0.000 0.028 0.332 0.008
#> GSM613695     4  0.6089     0.3059 0.000 0.000 0.224 0.524 0.232 0.020
#> GSM613696     2  0.4358     0.6690 0.000 0.704 0.028 0.000 0.244 0.024
#> GSM613697     5  0.3429     0.5199 0.000 0.000 0.108 0.056 0.824 0.012
#> GSM613698     5  0.3894     0.4360 0.000 0.000 0.152 0.008 0.776 0.064
#> GSM613699     2  0.7272     0.0515 0.000 0.360 0.292 0.024 0.284 0.040
#> GSM613700     4  0.4336     0.4013 0.000 0.408 0.012 0.572 0.000 0.008
#> GSM613701     2  0.3589     0.7255 0.004 0.776 0.000 0.196 0.016 0.008
#> GSM613702     4  0.0520     0.8039 0.000 0.000 0.000 0.984 0.008 0.008
#> GSM613703     1  0.1663     0.8431 0.912 0.000 0.000 0.000 0.000 0.088
#> GSM613704     2  0.1267     0.8400 0.000 0.940 0.000 0.000 0.000 0.060
#> GSM613705     4  0.0547     0.8003 0.000 0.000 0.000 0.980 0.020 0.000
#> GSM613706     4  0.0000     0.8073 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613707     2  0.0806     0.8407 0.000 0.972 0.008 0.000 0.000 0.020
#> GSM613708     1  0.0632     0.8520 0.976 0.000 0.000 0.000 0.000 0.024
#> GSM613709     1  0.1501     0.8425 0.924 0.000 0.000 0.000 0.000 0.076
#> GSM613710     4  0.5405     0.4801 0.000 0.208 0.172 0.612 0.000 0.008
#> GSM613711     3  0.0146     0.7522 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM613712     5  0.5041     0.3088 0.000 0.000 0.248 0.044 0.660 0.048
#> GSM613713     2  0.4066     0.4258 0.000 0.596 0.392 0.000 0.000 0.012
#> GSM613714     4  0.4508     0.6169 0.000 0.000 0.136 0.740 0.104 0.020
#> GSM613715     3  0.2179     0.7199 0.000 0.000 0.900 0.000 0.036 0.064
#> GSM613716     3  0.8411     0.1115 0.000 0.184 0.376 0.128 0.204 0.108
#> GSM613717     3  0.0405     0.7530 0.000 0.004 0.988 0.000 0.000 0.008
#> GSM613718     3  0.0000     0.7516 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613719     5  0.4837     0.3357 0.000 0.000 0.248 0.008 0.660 0.084
#> GSM613720     3  0.2875     0.6711 0.000 0.096 0.852 0.000 0.000 0.052
#> GSM613721     2  0.4597     0.7585 0.000 0.756 0.080 0.000 0.084 0.080
#> GSM613722     2  0.0363     0.8403 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM613723     5  0.4641     0.6464 0.200 0.000 0.000 0.000 0.684 0.116
#> GSM613724     1  0.1267     0.8438 0.940 0.000 0.000 0.000 0.000 0.060
#> GSM613725     2  0.1682     0.8337 0.000 0.928 0.052 0.000 0.000 0.020
#> GSM613726     4  0.0000     0.8073 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613727     1  0.1501     0.8425 0.924 0.000 0.000 0.000 0.000 0.076
#> GSM613728     2  0.1204     0.8402 0.000 0.944 0.000 0.000 0.000 0.056
#> GSM613729     1  0.1501     0.8425 0.924 0.000 0.000 0.000 0.000 0.076
#> GSM613730     4  0.1493     0.7821 0.000 0.004 0.000 0.936 0.004 0.056
#> GSM613731     4  0.0000     0.8073 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613732     3  0.0260     0.7500 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM613733     3  0.1267     0.7208 0.000 0.060 0.940 0.000 0.000 0.000
#> GSM613734     5  0.4641     0.6464 0.200 0.000 0.000 0.000 0.684 0.116
#> GSM613735     5  0.3925     0.6572 0.200 0.000 0.000 0.000 0.744 0.056
#> GSM613736     3  0.4497     0.3495 0.000 0.028 0.708 0.232 0.028 0.004
#> GSM613737     5  0.0767     0.5698 0.000 0.000 0.004 0.012 0.976 0.008
#> GSM613738     5  0.3858     0.6586 0.196 0.000 0.000 0.032 0.760 0.012
#> GSM613739     5  0.4618     0.6082 0.080 0.000 0.000 0.120 0.748 0.052
#> GSM613740     3  0.0000     0.7516 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613741     5  0.7545    -0.0917 0.220 0.332 0.008 0.008 0.348 0.084
#> GSM613742     5  0.2178     0.5736 0.000 0.000 0.000 0.132 0.868 0.000
#> GSM613743     3  0.0000     0.7516 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613744     3  0.0260     0.7500 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM613745     1  0.5205     0.4555 0.572 0.000 0.000 0.008 0.336 0.084
#> GSM613746     2  0.2696     0.8291 0.000 0.856 0.028 0.000 0.000 0.116
#> GSM613747     5  0.4866     0.6113 0.236 0.000 0.000 0.000 0.648 0.116
#> GSM613748     4  0.0000     0.8073 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613749     1  0.3531     0.6049 0.672 0.000 0.000 0.328 0.000 0.000
#> GSM613750     6  0.3464     0.8976 0.000 0.000 0.312 0.000 0.000 0.688
#> GSM613751     6  0.3879     0.8898 0.000 0.020 0.292 0.000 0.000 0.688
#> GSM613752     6  0.3464     0.8976 0.000 0.000 0.312 0.000 0.000 0.688
#> GSM613753     6  0.4493     0.7546 0.000 0.000 0.160 0.000 0.132 0.708

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 disease.state(p) k
#> MAD:pam 101         1.41e-01 2
#> MAD:pam  88         5.57e-03 3
#> MAD:pam 102         8.82e-03 4
#> MAD:pam  97         2.30e-05 5
#> MAD:pam  99         2.37e-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: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 27425 rows and 116 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 6.
#> 
#> 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.466           0.800       0.867         0.4596 0.529   0.529
#> 3 3 0.358           0.511       0.720         0.2934 0.795   0.629
#> 4 4 0.394           0.424       0.680         0.1696 0.766   0.477
#> 5 5 0.693           0.720       0.844         0.0870 0.858   0.571
#> 6 6 0.832           0.787       0.894         0.0701 0.884   0.560

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

suggest_best_k(res)
#> [1] 6

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
#> GSM613638     2  0.8713     0.7737 0.292 0.708
#> GSM613639     1  0.0376     0.9025 0.996 0.004
#> GSM613640     2  0.8909     0.7693 0.308 0.692
#> GSM613641     1  0.0376     0.9025 0.996 0.004
#> GSM613642     2  0.8909     0.7693 0.308 0.692
#> GSM613643     1  0.0938     0.8983 0.988 0.012
#> GSM613644     1  0.5294     0.8181 0.880 0.120
#> GSM613645     1  0.0376     0.9025 0.996 0.004
#> GSM613646     2  0.5842     0.8316 0.140 0.860
#> GSM613647     2  0.3733     0.8343 0.072 0.928
#> GSM613648     2  0.0000     0.8025 0.000 1.000
#> GSM613649     2  0.0938     0.8097 0.012 0.988
#> GSM613650     2  0.9963     0.0436 0.464 0.536
#> GSM613651     2  0.8909     0.5118 0.308 0.692
#> GSM613652     1  0.8081     0.7113 0.752 0.248
#> GSM613653     2  0.4690     0.8378 0.100 0.900
#> GSM613654     1  0.8081     0.7113 0.752 0.248
#> GSM613655     1  0.0376     0.9025 0.996 0.004
#> GSM613656     1  0.8081     0.7113 0.752 0.248
#> GSM613657     2  0.0000     0.8025 0.000 1.000
#> GSM613658     1  0.0672     0.9008 0.992 0.008
#> GSM613659     2  0.9000     0.7660 0.316 0.684
#> GSM613660     2  0.8955     0.7685 0.312 0.688
#> GSM613661     1  0.0376     0.9025 0.996 0.004
#> GSM613662     2  0.9000     0.7671 0.316 0.684
#> GSM613663     1  0.0376     0.9025 0.996 0.004
#> GSM613664     2  0.8955     0.7685 0.312 0.688
#> GSM613665     2  0.8955     0.7685 0.312 0.688
#> GSM613666     1  0.0376     0.9025 0.996 0.004
#> GSM613667     1  0.0376     0.9025 0.996 0.004
#> GSM613668     1  0.0376     0.9025 0.996 0.004
#> GSM613669     1  0.0376     0.9025 0.996 0.004
#> GSM613670     2  0.9000     0.7671 0.316 0.684
#> GSM613671     1  0.0376     0.9025 0.996 0.004
#> GSM613672     1  0.0938     0.8983 0.988 0.012
#> GSM613673     1  0.0376     0.9025 0.996 0.004
#> GSM613674     2  0.8955     0.7685 0.312 0.688
#> GSM613675     2  0.9000     0.7671 0.316 0.684
#> GSM613676     2  0.8955     0.7685 0.312 0.688
#> GSM613677     2  0.6712     0.8210 0.176 0.824
#> GSM613678     1  0.9922    -0.2679 0.552 0.448
#> GSM613679     2  0.8955     0.7685 0.312 0.688
#> GSM613680     1  0.0376     0.9025 0.996 0.004
#> GSM613681     1  0.0376     0.9025 0.996 0.004
#> GSM613682     1  0.0376     0.9025 0.996 0.004
#> GSM613683     1  0.0376     0.9025 0.996 0.004
#> GSM613684     2  0.8955     0.7685 0.312 0.688
#> GSM613685     2  0.8955     0.7685 0.312 0.688
#> GSM613686     1  0.0376     0.9025 0.996 0.004
#> GSM613687     1  0.0376     0.9025 0.996 0.004
#> GSM613688     2  0.8955     0.7685 0.312 0.688
#> GSM613689     2  0.3584     0.8344 0.068 0.932
#> GSM613690     2  0.3584     0.8344 0.068 0.932
#> GSM613691     2  0.4690     0.8382 0.100 0.900
#> GSM613692     1  0.8081     0.7113 0.752 0.248
#> GSM613693     2  0.4562     0.8382 0.096 0.904
#> GSM613694     2  0.3879     0.8333 0.076 0.924
#> GSM613695     2  0.3733     0.8343 0.072 0.928
#> GSM613696     2  0.4022     0.8362 0.080 0.920
#> GSM613697     2  0.9323     0.4109 0.348 0.652
#> GSM613698     2  0.3733     0.8343 0.072 0.928
#> GSM613699     2  0.3733     0.8343 0.072 0.928
#> GSM613700     2  0.8955     0.7685 0.312 0.688
#> GSM613701     2  0.9000     0.7660 0.316 0.684
#> GSM613702     2  0.9000     0.7660 0.316 0.684
#> GSM613703     1  0.0376     0.9025 0.996 0.004
#> GSM613704     2  0.9000     0.7671 0.316 0.684
#> GSM613705     2  0.3733     0.8343 0.072 0.928
#> GSM613706     2  0.8909     0.7693 0.308 0.692
#> GSM613707     2  0.8955     0.7685 0.312 0.688
#> GSM613708     1  0.0376     0.9025 0.996 0.004
#> GSM613709     1  0.0376     0.9025 0.996 0.004
#> GSM613710     2  0.8955     0.7685 0.312 0.688
#> GSM613711     2  0.0000     0.8025 0.000 1.000
#> GSM613712     2  0.3733     0.8343 0.072 0.928
#> GSM613713     2  0.4161     0.8387 0.084 0.916
#> GSM613714     2  0.3584     0.8344 0.068 0.932
#> GSM613715     2  0.2423     0.8242 0.040 0.960
#> GSM613716     2  0.4022     0.8371 0.080 0.920
#> GSM613717     2  0.0938     0.8094 0.012 0.988
#> GSM613718     2  0.0000     0.8025 0.000 1.000
#> GSM613719     2  0.5178     0.8210 0.116 0.884
#> GSM613720     2  0.4022     0.8371 0.080 0.920
#> GSM613721     2  0.4815     0.8377 0.104 0.896
#> GSM613722     2  0.8955     0.7685 0.312 0.688
#> GSM613723     1  0.8081     0.7113 0.752 0.248
#> GSM613724     1  0.0672     0.9008 0.992 0.008
#> GSM613725     2  0.8955     0.7685 0.312 0.688
#> GSM613726     1  0.0376     0.9025 0.996 0.004
#> GSM613727     1  0.0376     0.9025 0.996 0.004
#> GSM613728     2  0.8955     0.7685 0.312 0.688
#> GSM613729     1  0.0376     0.9025 0.996 0.004
#> GSM613730     2  0.9000     0.7660 0.316 0.684
#> GSM613731     1  0.0672     0.9006 0.992 0.008
#> GSM613732     2  0.0000     0.8025 0.000 1.000
#> GSM613733     2  0.4161     0.8384 0.084 0.916
#> GSM613734     1  0.2603     0.8786 0.956 0.044
#> GSM613735     1  0.8081     0.7113 0.752 0.248
#> GSM613736     2  0.3584     0.8344 0.068 0.932
#> GSM613737     2  0.3733     0.8343 0.072 0.928
#> GSM613738     1  0.8081     0.7113 0.752 0.248
#> GSM613739     1  0.8081     0.7113 0.752 0.248
#> GSM613740     2  0.0000     0.8025 0.000 1.000
#> GSM613741     2  0.4815     0.8377 0.104 0.896
#> GSM613742     1  0.8081     0.7113 0.752 0.248
#> GSM613743     2  0.0000     0.8025 0.000 1.000
#> GSM613744     2  0.0000     0.8025 0.000 1.000
#> GSM613745     2  0.4815     0.8377 0.104 0.896
#> GSM613746     2  0.4690     0.8382 0.100 0.900
#> GSM613747     1  0.8081     0.7113 0.752 0.248
#> GSM613748     2  0.9000     0.7660 0.316 0.684
#> GSM613749     1  0.0376     0.9025 0.996 0.004
#> GSM613750     2  0.3114     0.8309 0.056 0.944
#> GSM613751     2  0.0000     0.8025 0.000 1.000
#> GSM613752     2  0.0000     0.8025 0.000 1.000
#> GSM613753     2  0.3584     0.8344 0.068 0.932

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM613638     3  0.2297     0.4913 0.036 0.020 0.944
#> GSM613639     1  0.7158     0.3298 0.596 0.032 0.372
#> GSM613640     3  0.6742     0.2388 0.240 0.052 0.708
#> GSM613641     1  0.0661     0.7996 0.988 0.008 0.004
#> GSM613642     3  0.8491    -0.3273 0.116 0.312 0.572
#> GSM613643     1  0.7015     0.2820 0.584 0.024 0.392
#> GSM613644     3  0.6813     0.0743 0.468 0.012 0.520
#> GSM613645     1  0.4172     0.7028 0.840 0.004 0.156
#> GSM613646     3  0.7872     0.2427 0.296 0.084 0.620
#> GSM613647     3  0.0237     0.5185 0.004 0.000 0.996
#> GSM613648     3  0.4121     0.4214 0.000 0.168 0.832
#> GSM613649     3  0.5216     0.4355 0.000 0.260 0.740
#> GSM613650     3  0.5986     0.3030 0.284 0.012 0.704
#> GSM613651     3  0.1765     0.5128 0.040 0.004 0.956
#> GSM613652     1  0.9213     0.5653 0.536 0.236 0.228
#> GSM613653     3  0.8172     0.2452 0.272 0.112 0.616
#> GSM613654     1  0.9213     0.5653 0.536 0.236 0.228
#> GSM613655     1  0.0829     0.7996 0.984 0.012 0.004
#> GSM613656     1  0.9213     0.5653 0.536 0.236 0.228
#> GSM613657     3  0.5443     0.4332 0.004 0.260 0.736
#> GSM613658     1  0.1585     0.7963 0.964 0.028 0.008
#> GSM613659     3  0.8985    -0.1365 0.216 0.220 0.564
#> GSM613660     2  0.6962     0.8629 0.020 0.568 0.412
#> GSM613661     1  0.3769     0.7439 0.880 0.016 0.104
#> GSM613662     2  0.7334     0.7677 0.048 0.624 0.328
#> GSM613663     1  0.0829     0.7996 0.984 0.012 0.004
#> GSM613664     2  0.7334     0.7677 0.048 0.624 0.328
#> GSM613665     2  0.7601     0.8479 0.044 0.540 0.416
#> GSM613666     1  0.1399     0.7961 0.968 0.028 0.004
#> GSM613667     1  0.3941     0.7039 0.844 0.000 0.156
#> GSM613668     1  0.0829     0.7996 0.984 0.012 0.004
#> GSM613669     1  0.1267     0.7961 0.972 0.024 0.004
#> GSM613670     2  0.7759     0.4554 0.048 0.480 0.472
#> GSM613671     1  0.1267     0.7961 0.972 0.024 0.004
#> GSM613672     1  0.0829     0.7996 0.984 0.012 0.004
#> GSM613673     1  0.0829     0.7996 0.984 0.012 0.004
#> GSM613674     2  0.6962     0.8629 0.020 0.568 0.412
#> GSM613675     2  0.7334     0.7677 0.048 0.624 0.328
#> GSM613676     2  0.7411     0.8520 0.036 0.548 0.416
#> GSM613677     3  0.8132    -0.0928 0.104 0.284 0.612
#> GSM613678     3  0.9527    -0.0756 0.300 0.220 0.480
#> GSM613679     2  0.6962     0.8629 0.020 0.568 0.412
#> GSM613680     1  0.0829     0.7996 0.984 0.012 0.004
#> GSM613681     1  0.0237     0.7987 0.996 0.000 0.004
#> GSM613682     1  0.0829     0.7996 0.984 0.012 0.004
#> GSM613683     1  0.1267     0.7991 0.972 0.024 0.004
#> GSM613684     2  0.7411     0.8520 0.036 0.548 0.416
#> GSM613685     2  0.6962     0.8629 0.020 0.568 0.412
#> GSM613686     1  0.1170     0.7979 0.976 0.016 0.008
#> GSM613687     1  0.0829     0.7996 0.984 0.012 0.004
#> GSM613688     2  0.7767     0.8402 0.052 0.536 0.412
#> GSM613689     3  0.1878     0.5096 0.004 0.044 0.952
#> GSM613690     3  0.3573     0.4669 0.004 0.120 0.876
#> GSM613691     2  0.6667     0.7282 0.016 0.616 0.368
#> GSM613692     1  0.6793     0.2541 0.536 0.012 0.452
#> GSM613693     3  0.6836    -0.1372 0.016 0.412 0.572
#> GSM613694     3  0.0237     0.5185 0.004 0.000 0.996
#> GSM613695     3  0.0237     0.5185 0.004 0.000 0.996
#> GSM613696     3  0.3030     0.4797 0.004 0.092 0.904
#> GSM613697     3  0.1878     0.5112 0.044 0.004 0.952
#> GSM613698     3  0.3112     0.4769 0.004 0.096 0.900
#> GSM613699     3  0.0475     0.5172 0.004 0.004 0.992
#> GSM613700     2  0.6962     0.8629 0.020 0.568 0.412
#> GSM613701     3  0.8944    -0.1407 0.204 0.228 0.568
#> GSM613702     3  0.8948    -0.1380 0.208 0.224 0.568
#> GSM613703     1  0.6486     0.6266 0.760 0.096 0.144
#> GSM613704     2  0.7334     0.7677 0.048 0.624 0.328
#> GSM613705     3  0.1315     0.5122 0.008 0.020 0.972
#> GSM613706     3  0.7169     0.1474 0.404 0.028 0.568
#> GSM613707     2  0.6962     0.8629 0.020 0.568 0.412
#> GSM613708     1  0.0983     0.7982 0.980 0.016 0.004
#> GSM613709     1  0.0237     0.7987 0.996 0.000 0.004
#> GSM613710     2  0.6962     0.8629 0.020 0.568 0.412
#> GSM613711     3  0.5443     0.4332 0.004 0.260 0.736
#> GSM613712     3  0.0661     0.5170 0.004 0.008 0.988
#> GSM613713     3  0.5291     0.4060 0.000 0.268 0.732
#> GSM613714     3  0.3784     0.4557 0.004 0.132 0.864
#> GSM613715     3  0.4351     0.4224 0.004 0.168 0.828
#> GSM613716     3  0.6543     0.1479 0.016 0.344 0.640
#> GSM613717     3  0.5443     0.4332 0.004 0.260 0.736
#> GSM613718     3  0.5443     0.4332 0.004 0.260 0.736
#> GSM613719     3  0.3459     0.4714 0.012 0.096 0.892
#> GSM613720     3  0.6848    -0.1392 0.016 0.416 0.568
#> GSM613721     3  0.8157    -0.0654 0.096 0.308 0.596
#> GSM613722     2  0.6962     0.8629 0.020 0.568 0.412
#> GSM613723     1  0.9213     0.5653 0.536 0.236 0.228
#> GSM613724     1  0.1399     0.7981 0.968 0.028 0.004
#> GSM613725     2  0.6962     0.8629 0.020 0.568 0.412
#> GSM613726     1  0.4514     0.7036 0.832 0.012 0.156
#> GSM613727     1  0.0983     0.7995 0.980 0.016 0.004
#> GSM613728     2  0.8018     0.8389 0.064 0.520 0.416
#> GSM613729     1  0.1399     0.7961 0.968 0.028 0.004
#> GSM613730     3  0.9442    -0.3126 0.216 0.288 0.496
#> GSM613731     1  0.7015     0.2820 0.584 0.024 0.392
#> GSM613732     3  0.5443     0.4332 0.004 0.260 0.736
#> GSM613733     3  0.6053     0.1848 0.020 0.260 0.720
#> GSM613734     1  0.8957     0.5913 0.564 0.244 0.192
#> GSM613735     1  0.9211     0.5670 0.536 0.240 0.224
#> GSM613736     3  0.4351     0.4224 0.004 0.168 0.828
#> GSM613737     3  0.0475     0.5182 0.004 0.004 0.992
#> GSM613738     1  0.6793     0.2541 0.536 0.012 0.452
#> GSM613739     1  0.9213     0.5653 0.536 0.236 0.228
#> GSM613740     3  0.5443     0.4332 0.004 0.260 0.736
#> GSM613741     3  0.8013     0.2602 0.252 0.112 0.636
#> GSM613742     1  0.6669     0.2308 0.524 0.008 0.468
#> GSM613743     3  0.5443     0.4332 0.004 0.260 0.736
#> GSM613744     3  0.5443     0.4332 0.004 0.260 0.736
#> GSM613745     3  0.7180     0.3085 0.168 0.116 0.716
#> GSM613746     2  0.6737     0.7045 0.016 0.600 0.384
#> GSM613747     1  0.9208     0.5696 0.536 0.244 0.220
#> GSM613748     3  0.8944    -0.1407 0.204 0.228 0.568
#> GSM613749     3  0.9022     0.0545 0.384 0.136 0.480
#> GSM613750     3  0.4351     0.4224 0.004 0.168 0.828
#> GSM613751     3  0.5216     0.4355 0.000 0.260 0.740
#> GSM613752     3  0.5443     0.4332 0.004 0.260 0.736
#> GSM613753     3  0.0983     0.5161 0.004 0.016 0.980

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM613638     3  0.6185     0.3591 0.056 0.208 0.700 0.036
#> GSM613639     1  0.8916     0.1615 0.496 0.124 0.172 0.208
#> GSM613640     3  0.7512     0.1799 0.116 0.272 0.576 0.036
#> GSM613641     1  0.0336     0.7800 0.992 0.000 0.000 0.008
#> GSM613642     2  0.7348     0.2675 0.080 0.524 0.364 0.032
#> GSM613643     1  0.8012     0.1146 0.480 0.136 0.348 0.036
#> GSM613644     3  0.8602    -0.0491 0.368 0.136 0.424 0.072
#> GSM613645     1  0.3821     0.6804 0.840 0.000 0.120 0.040
#> GSM613646     3  0.9068    -0.3392 0.128 0.124 0.388 0.360
#> GSM613647     3  0.5436     0.4267 0.040 0.136 0.772 0.052
#> GSM613648     3  0.3333     0.5133 0.000 0.088 0.872 0.040
#> GSM613649     3  0.4093     0.5023 0.000 0.072 0.832 0.096
#> GSM613650     3  0.8590    -0.0770 0.108 0.124 0.512 0.256
#> GSM613651     3  0.7572     0.2556 0.092 0.064 0.596 0.248
#> GSM613652     3  0.7902     0.0575 0.328 0.000 0.368 0.304
#> GSM613653     4  0.7020     0.3982 0.000 0.124 0.376 0.500
#> GSM613654     3  0.7902     0.0575 0.328 0.000 0.368 0.304
#> GSM613655     1  0.0469     0.7819 0.988 0.012 0.000 0.000
#> GSM613656     3  0.7902     0.0575 0.328 0.000 0.368 0.304
#> GSM613657     3  0.4332     0.4983 0.000 0.072 0.816 0.112
#> GSM613658     1  0.3801     0.5708 0.780 0.000 0.000 0.220
#> GSM613659     1  0.9875    -0.3182 0.300 0.292 0.196 0.212
#> GSM613660     2  0.0336     0.6533 0.000 0.992 0.008 0.000
#> GSM613661     1  0.3089     0.7397 0.896 0.008 0.052 0.044
#> GSM613662     2  0.7444     0.4435 0.032 0.544 0.096 0.328
#> GSM613663     1  0.0469     0.7819 0.988 0.012 0.000 0.000
#> GSM613664     2  0.7080     0.4506 0.016 0.560 0.096 0.328
#> GSM613665     2  0.3110     0.6481 0.004 0.892 0.056 0.048
#> GSM613666     1  0.0336     0.7800 0.992 0.000 0.000 0.008
#> GSM613667     1  0.3198     0.7179 0.880 0.000 0.080 0.040
#> GSM613668     1  0.0469     0.7819 0.988 0.012 0.000 0.000
#> GSM613669     1  0.0336     0.7800 0.992 0.000 0.000 0.008
#> GSM613670     2  0.9342     0.2750 0.228 0.348 0.096 0.328
#> GSM613671     1  0.0336     0.7800 0.992 0.000 0.000 0.008
#> GSM613672     1  0.0469     0.7819 0.988 0.012 0.000 0.000
#> GSM613673     1  0.0469     0.7819 0.988 0.012 0.000 0.000
#> GSM613674     2  0.0000     0.6530 0.000 1.000 0.000 0.000
#> GSM613675     2  0.7080     0.4506 0.016 0.560 0.096 0.328
#> GSM613676     2  0.3914     0.6314 0.008 0.848 0.104 0.040
#> GSM613677     3  0.6842     0.3671 0.028 0.288 0.612 0.072
#> GSM613678     1  0.7841     0.3095 0.584 0.168 0.196 0.052
#> GSM613679     2  0.0000     0.6530 0.000 1.000 0.000 0.000
#> GSM613680     1  0.0469     0.7819 0.988 0.012 0.000 0.000
#> GSM613681     1  0.0336     0.7800 0.992 0.000 0.000 0.008
#> GSM613682     1  0.0469     0.7819 0.988 0.012 0.000 0.000
#> GSM613683     1  0.0469     0.7819 0.988 0.012 0.000 0.000
#> GSM613684     2  0.4939     0.5819 0.020 0.768 0.188 0.024
#> GSM613685     2  0.0000     0.6530 0.000 1.000 0.000 0.000
#> GSM613686     1  0.0895     0.7773 0.976 0.000 0.004 0.020
#> GSM613687     1  0.0469     0.7819 0.988 0.012 0.000 0.000
#> GSM613688     2  0.7364     0.5019 0.200 0.624 0.132 0.044
#> GSM613689     3  0.5437     0.4458 0.020 0.244 0.712 0.024
#> GSM613690     3  0.2408     0.5057 0.000 0.104 0.896 0.000
#> GSM613691     4  0.6952    -0.1163 0.000 0.364 0.120 0.516
#> GSM613692     4  0.8378     0.2376 0.316 0.040 0.184 0.460
#> GSM613693     4  0.7902     0.1530 0.000 0.336 0.300 0.364
#> GSM613694     3  0.5827     0.3957 0.060 0.164 0.740 0.036
#> GSM613695     3  0.3762     0.4696 0.024 0.072 0.868 0.036
#> GSM613696     3  0.7555    -0.0547 0.028 0.124 0.552 0.296
#> GSM613697     3  0.7345     0.2637 0.080 0.056 0.604 0.260
#> GSM613698     3  0.7515    -0.1262 0.024 0.112 0.520 0.344
#> GSM613699     3  0.5161     0.4179 0.028 0.124 0.788 0.060
#> GSM613700     2  0.0000     0.6530 0.000 1.000 0.000 0.000
#> GSM613701     2  0.8117     0.3562 0.264 0.508 0.196 0.032
#> GSM613702     2  0.8176     0.3565 0.260 0.508 0.196 0.036
#> GSM613703     1  0.6152     0.4346 0.668 0.120 0.000 0.212
#> GSM613704     2  0.7080     0.4506 0.016 0.560 0.096 0.328
#> GSM613705     3  0.5458     0.3961 0.028 0.192 0.744 0.036
#> GSM613706     1  0.8491    -0.0891 0.420 0.336 0.208 0.036
#> GSM613707     2  0.0000     0.6530 0.000 1.000 0.000 0.000
#> GSM613708     1  0.2921     0.6772 0.860 0.000 0.000 0.140
#> GSM613709     1  0.0336     0.7800 0.992 0.000 0.000 0.008
#> GSM613710     2  0.1022     0.6452 0.000 0.968 0.032 0.000
#> GSM613711     3  0.4332     0.4983 0.000 0.072 0.816 0.112
#> GSM613712     3  0.5008     0.4263 0.028 0.124 0.796 0.052
#> GSM613713     3  0.6031     0.4883 0.000 0.216 0.676 0.108
#> GSM613714     3  0.4706     0.4574 0.020 0.248 0.732 0.000
#> GSM613715     3  0.3043     0.5117 0.004 0.112 0.876 0.008
#> GSM613716     3  0.7206    -0.2507 0.000 0.140 0.460 0.400
#> GSM613717     3  0.5798     0.5027 0.000 0.184 0.704 0.112
#> GSM613718     3  0.4332     0.4983 0.000 0.072 0.816 0.112
#> GSM613719     3  0.7584    -0.1854 0.020 0.124 0.500 0.356
#> GSM613720     4  0.7530     0.3293 0.000 0.212 0.308 0.480
#> GSM613721     4  0.7193     0.4021 0.000 0.152 0.340 0.508
#> GSM613722     2  0.0804     0.6560 0.008 0.980 0.012 0.000
#> GSM613723     3  0.7902     0.0575 0.328 0.000 0.368 0.304
#> GSM613724     1  0.3113     0.7030 0.876 0.012 0.004 0.108
#> GSM613725     2  0.0188     0.6522 0.000 0.996 0.004 0.000
#> GSM613726     1  0.4028     0.6945 0.848 0.020 0.100 0.032
#> GSM613727     1  0.0469     0.7819 0.988 0.012 0.000 0.000
#> GSM613728     2  0.4108     0.6323 0.012 0.844 0.092 0.052
#> GSM613729     1  0.0336     0.7800 0.992 0.000 0.000 0.008
#> GSM613730     2  0.8346     0.4159 0.260 0.516 0.164 0.060
#> GSM613731     1  0.7038     0.4222 0.652 0.136 0.176 0.036
#> GSM613732     3  0.4332     0.4983 0.000 0.072 0.816 0.112
#> GSM613733     2  0.6396    -0.1699 0.000 0.468 0.468 0.064
#> GSM613734     1  0.8279    -0.1602 0.360 0.012 0.328 0.300
#> GSM613735     4  0.7191     0.1988 0.328 0.000 0.156 0.516
#> GSM613736     3  0.5091     0.5078 0.000 0.180 0.752 0.068
#> GSM613737     3  0.4906     0.4465 0.028 0.096 0.808 0.068
#> GSM613738     4  0.7862     0.2276 0.328 0.016 0.176 0.480
#> GSM613739     3  0.7902     0.0575 0.328 0.000 0.368 0.304
#> GSM613740     3  0.4332     0.4983 0.000 0.072 0.816 0.112
#> GSM613741     4  0.7020     0.3982 0.000 0.124 0.376 0.500
#> GSM613742     4  0.8235     0.2242 0.260 0.028 0.232 0.480
#> GSM613743     3  0.4332     0.4983 0.000 0.072 0.816 0.112
#> GSM613744     3  0.4332     0.4983 0.000 0.072 0.816 0.112
#> GSM613745     4  0.7049     0.3764 0.000 0.124 0.392 0.484
#> GSM613746     2  0.7641     0.1843 0.000 0.452 0.224 0.324
#> GSM613747     3  0.7908     0.0474 0.336 0.000 0.360 0.304
#> GSM613748     2  0.8177     0.3462 0.260 0.500 0.208 0.032
#> GSM613749     1  0.7419     0.3737 0.620 0.140 0.196 0.044
#> GSM613750     3  0.3117     0.5141 0.000 0.092 0.880 0.028
#> GSM613751     3  0.4332     0.4983 0.000 0.072 0.816 0.112
#> GSM613752     3  0.4332     0.4983 0.000 0.072 0.816 0.112
#> GSM613753     3  0.2882     0.4987 0.024 0.084 0.892 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
#> GSM613638     3  0.1533      0.728 0.004 0.016 0.952 0.004 0.024
#> GSM613639     1  0.4153      0.628 0.756 0.000 0.212 0.008 0.024
#> GSM613640     2  0.5305      0.251 0.008 0.484 0.480 0.004 0.024
#> GSM613641     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613642     2  0.4304      0.661 0.000 0.736 0.232 0.008 0.024
#> GSM613643     1  0.4935      0.493 0.668 0.016 0.288 0.000 0.028
#> GSM613644     1  0.4853      0.483 0.664 0.008 0.296 0.000 0.032
#> GSM613645     1  0.2444      0.837 0.912 0.000 0.036 0.028 0.024
#> GSM613646     4  0.6891      0.656 0.184 0.000 0.296 0.496 0.024
#> GSM613647     3  0.2605      0.642 0.000 0.000 0.852 0.000 0.148
#> GSM613648     3  0.1943      0.747 0.000 0.000 0.924 0.056 0.020
#> GSM613649     3  0.4181      0.689 0.000 0.000 0.712 0.268 0.020
#> GSM613650     3  0.5678      0.264 0.128 0.000 0.612 0.000 0.260
#> GSM613651     5  0.3796      0.538 0.000 0.000 0.300 0.000 0.700
#> GSM613652     5  0.1121      0.812 0.044 0.000 0.000 0.000 0.956
#> GSM613653     4  0.4425      0.861 0.000 0.000 0.296 0.680 0.024
#> GSM613654     5  0.1121      0.812 0.044 0.000 0.000 0.000 0.956
#> GSM613655     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613656     5  0.1121      0.812 0.044 0.000 0.000 0.000 0.956
#> GSM613657     3  0.4181      0.689 0.000 0.000 0.712 0.268 0.020
#> GSM613658     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613659     4  0.5857      0.851 0.000 0.096 0.240 0.640 0.024
#> GSM613660     2  0.0000      0.788 0.000 1.000 0.000 0.000 0.000
#> GSM613661     1  0.0992      0.870 0.968 0.000 0.008 0.000 0.024
#> GSM613662     4  0.4803      0.853 0.000 0.096 0.184 0.720 0.000
#> GSM613663     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613664     4  0.5251      0.818 0.000 0.136 0.184 0.680 0.000
#> GSM613665     2  0.0912      0.786 0.000 0.972 0.016 0.012 0.000
#> GSM613666     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613667     1  0.0992      0.869 0.968 0.000 0.008 0.000 0.024
#> GSM613668     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613669     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613670     4  0.4725      0.865 0.000 0.080 0.200 0.720 0.000
#> GSM613671     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613672     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613673     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613674     2  0.0000      0.788 0.000 1.000 0.000 0.000 0.000
#> GSM613675     4  0.4803      0.853 0.000 0.096 0.184 0.720 0.000
#> GSM613676     2  0.1956      0.773 0.000 0.916 0.076 0.008 0.000
#> GSM613677     3  0.1377      0.732 0.000 0.020 0.956 0.004 0.020
#> GSM613678     1  0.7478      0.244 0.548 0.064 0.228 0.136 0.024
#> GSM613679     2  0.0000      0.788 0.000 1.000 0.000 0.000 0.000
#> GSM613680     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613681     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613682     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613683     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613684     2  0.3757      0.701 0.000 0.772 0.208 0.020 0.000
#> GSM613685     2  0.0000      0.788 0.000 1.000 0.000 0.000 0.000
#> GSM613686     1  0.0404      0.881 0.988 0.000 0.000 0.000 0.012
#> GSM613687     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613688     2  0.4301      0.687 0.000 0.756 0.204 0.020 0.020
#> GSM613689     3  0.0404      0.743 0.000 0.000 0.988 0.000 0.012
#> GSM613690     3  0.0000      0.746 0.000 0.000 1.000 0.000 0.000
#> GSM613691     4  0.4106      0.876 0.000 0.020 0.256 0.724 0.000
#> GSM613692     5  0.4689      0.618 0.048 0.000 0.264 0.000 0.688
#> GSM613693     3  0.4641     -0.410 0.000 0.012 0.532 0.456 0.000
#> GSM613694     3  0.1121      0.734 0.000 0.000 0.956 0.000 0.044
#> GSM613695     3  0.0703      0.739 0.000 0.000 0.976 0.000 0.024
#> GSM613696     3  0.1195      0.734 0.000 0.000 0.960 0.012 0.028
#> GSM613697     5  0.3774      0.542 0.000 0.000 0.296 0.000 0.704
#> GSM613698     3  0.2248      0.693 0.000 0.000 0.900 0.012 0.088
#> GSM613699     3  0.0963      0.737 0.000 0.000 0.964 0.000 0.036
#> GSM613700     2  0.0000      0.788 0.000 1.000 0.000 0.000 0.000
#> GSM613701     2  0.4089      0.691 0.000 0.764 0.204 0.008 0.024
#> GSM613702     2  0.4089      0.691 0.000 0.764 0.204 0.008 0.024
#> GSM613703     1  0.6368     -0.219 0.436 0.000 0.164 0.400 0.000
#> GSM613704     4  0.4803      0.853 0.000 0.096 0.184 0.720 0.000
#> GSM613705     3  0.1043      0.735 0.000 0.000 0.960 0.000 0.040
#> GSM613706     2  0.5679      0.538 0.056 0.640 0.276 0.004 0.024
#> GSM613707     2  0.0000      0.788 0.000 1.000 0.000 0.000 0.000
#> GSM613708     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613709     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613710     2  0.0000      0.788 0.000 1.000 0.000 0.000 0.000
#> GSM613711     3  0.4181      0.689 0.000 0.000 0.712 0.268 0.020
#> GSM613712     3  0.1043      0.735 0.000 0.000 0.960 0.000 0.040
#> GSM613713     3  0.3416      0.730 0.000 0.016 0.840 0.124 0.020
#> GSM613714     3  0.0000      0.746 0.000 0.000 1.000 0.000 0.000
#> GSM613715     3  0.0000      0.746 0.000 0.000 1.000 0.000 0.000
#> GSM613716     3  0.2890      0.566 0.000 0.000 0.836 0.160 0.004
#> GSM613717     3  0.4181      0.689 0.000 0.000 0.712 0.268 0.020
#> GSM613718     3  0.4181      0.689 0.000 0.000 0.712 0.268 0.020
#> GSM613719     3  0.5726      0.184 0.000 0.000 0.612 0.140 0.248
#> GSM613720     3  0.3752      0.247 0.000 0.000 0.708 0.292 0.000
#> GSM613721     4  0.4737      0.869 0.000 0.012 0.284 0.680 0.024
#> GSM613722     2  0.0000      0.788 0.000 1.000 0.000 0.000 0.000
#> GSM613723     5  0.1121      0.812 0.044 0.000 0.000 0.000 0.956
#> GSM613724     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613725     2  0.0000      0.788 0.000 1.000 0.000 0.000 0.000
#> GSM613726     1  0.2300      0.819 0.904 0.000 0.072 0.000 0.024
#> GSM613727     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613728     2  0.4133      0.659 0.000 0.768 0.052 0.180 0.000
#> GSM613729     1  0.0000      0.887 1.000 0.000 0.000 0.000 0.000
#> GSM613730     2  0.5858      0.501 0.000 0.632 0.204 0.156 0.008
#> GSM613731     1  0.4743      0.531 0.692 0.016 0.268 0.000 0.024
#> GSM613732     3  0.4181      0.689 0.000 0.000 0.712 0.268 0.020
#> GSM613733     3  0.3904      0.684 0.000 0.116 0.820 0.044 0.020
#> GSM613734     5  0.1544      0.793 0.068 0.000 0.000 0.000 0.932
#> GSM613735     5  0.1121      0.812 0.044 0.000 0.000 0.000 0.956
#> GSM613736     3  0.3621      0.715 0.000 0.000 0.788 0.192 0.020
#> GSM613737     3  0.1043      0.736 0.000 0.000 0.960 0.000 0.040
#> GSM613738     5  0.4689      0.618 0.048 0.000 0.264 0.000 0.688
#> GSM613739     5  0.1121      0.812 0.044 0.000 0.000 0.000 0.956
#> GSM613740     3  0.4181      0.689 0.000 0.000 0.712 0.268 0.020
#> GSM613741     4  0.4425      0.861 0.000 0.000 0.296 0.680 0.024
#> GSM613742     5  0.4268      0.592 0.024 0.000 0.268 0.000 0.708
#> GSM613743     3  0.4181      0.689 0.000 0.000 0.712 0.268 0.020
#> GSM613744     3  0.4181      0.689 0.000 0.000 0.712 0.268 0.020
#> GSM613745     4  0.4465      0.855 0.000 0.000 0.304 0.672 0.024
#> GSM613746     4  0.3967      0.873 0.000 0.012 0.264 0.724 0.000
#> GSM613747     5  0.1121      0.812 0.044 0.000 0.000 0.000 0.956
#> GSM613748     2  0.4388      0.642 0.000 0.724 0.244 0.008 0.024
#> GSM613749     1  0.5115      0.584 0.716 0.048 0.208 0.004 0.024
#> GSM613750     3  0.1568      0.749 0.000 0.000 0.944 0.036 0.020
#> GSM613751     3  0.4181      0.689 0.000 0.000 0.712 0.268 0.020
#> GSM613752     3  0.4181      0.689 0.000 0.000 0.712 0.268 0.020
#> GSM613753     3  0.0000      0.746 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
#> GSM613638     4  0.0363    0.78603 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM613639     1  0.4698    0.51699 0.648 0.000 0.000 0.296 0.028 0.028
#> GSM613640     4  0.0363    0.78603 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM613641     1  0.0632    0.91276 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM613642     2  0.4083    0.22985 0.000 0.532 0.000 0.460 0.000 0.008
#> GSM613643     4  0.0363    0.78603 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM613644     4  0.1003    0.78171 0.000 0.004 0.000 0.964 0.028 0.004
#> GSM613645     1  0.3276    0.82334 0.840 0.000 0.000 0.100 0.028 0.032
#> GSM613646     4  0.1492    0.76026 0.000 0.000 0.000 0.940 0.024 0.036
#> GSM613647     4  0.0508    0.78822 0.000 0.000 0.004 0.984 0.012 0.000
#> GSM613648     3  0.0520    0.95828 0.000 0.000 0.984 0.008 0.000 0.008
#> GSM613649     3  0.0146    0.96220 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM613650     4  0.0713    0.78278 0.000 0.000 0.000 0.972 0.028 0.000
#> GSM613651     4  0.2902    0.72872 0.000 0.000 0.004 0.800 0.196 0.000
#> GSM613652     5  0.1341    0.95928 0.028 0.000 0.000 0.024 0.948 0.000
#> GSM613653     6  0.4263    0.40579 0.000 0.000 0.000 0.376 0.024 0.600
#> GSM613654     5  0.1341    0.95928 0.028 0.000 0.000 0.024 0.948 0.000
#> GSM613655     1  0.0146    0.91441 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM613656     5  0.1341    0.95928 0.028 0.000 0.000 0.024 0.948 0.000
#> GSM613657     3  0.0000    0.96294 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613658     1  0.0777    0.90643 0.972 0.000 0.000 0.024 0.004 0.000
#> GSM613659     6  0.4042    0.50702 0.000 0.016 0.000 0.316 0.004 0.664
#> GSM613660     2  0.0000    0.84609 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613661     1  0.2266    0.88349 0.908 0.000 0.000 0.040 0.028 0.024
#> GSM613662     6  0.0260    0.76103 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM613663     1  0.0291    0.91438 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM613664     6  0.1524    0.72194 0.000 0.060 0.000 0.008 0.000 0.932
#> GSM613665     2  0.0937    0.83507 0.000 0.960 0.000 0.000 0.000 0.040
#> GSM613666     1  0.0777    0.91266 0.972 0.000 0.000 0.000 0.024 0.004
#> GSM613667     1  0.2351    0.88681 0.904 0.000 0.000 0.032 0.028 0.036
#> GSM613668     1  0.0291    0.91438 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM613669     1  0.0777    0.91266 0.972 0.000 0.000 0.000 0.024 0.004
#> GSM613670     6  0.0260    0.76103 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM613671     1  0.0777    0.91266 0.972 0.000 0.000 0.000 0.024 0.004
#> GSM613672     1  0.0291    0.91438 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM613673     1  0.0976    0.91156 0.968 0.000 0.000 0.016 0.008 0.008
#> GSM613674     2  0.0000    0.84609 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613675     6  0.0260    0.76103 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM613676     2  0.0937    0.83507 0.000 0.960 0.000 0.000 0.000 0.040
#> GSM613677     4  0.2393    0.73407 0.000 0.064 0.004 0.892 0.000 0.040
#> GSM613678     1  0.5081    0.37738 0.584 0.000 0.000 0.348 0.028 0.040
#> GSM613679     2  0.0000    0.84609 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613680     1  0.0291    0.91438 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM613681     1  0.0777    0.91266 0.972 0.000 0.000 0.000 0.024 0.004
#> GSM613682     1  0.0976    0.91156 0.968 0.000 0.000 0.016 0.008 0.008
#> GSM613683     1  0.0291    0.91438 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM613684     2  0.2556    0.80009 0.000 0.888 0.052 0.012 0.000 0.048
#> GSM613685     2  0.0000    0.84609 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613686     1  0.2045    0.89268 0.920 0.000 0.000 0.024 0.028 0.028
#> GSM613687     1  0.0551    0.91407 0.984 0.000 0.000 0.004 0.004 0.008
#> GSM613688     2  0.4243    0.68992 0.000 0.732 0.000 0.104 0.000 0.164
#> GSM613689     3  0.2778    0.77793 0.000 0.000 0.824 0.168 0.000 0.008
#> GSM613690     3  0.1643    0.92018 0.000 0.000 0.924 0.068 0.000 0.008
#> GSM613691     6  0.0547    0.76021 0.000 0.000 0.000 0.020 0.000 0.980
#> GSM613692     4  0.5034    0.48406 0.132 0.000 0.000 0.628 0.240 0.000
#> GSM613693     6  0.4333    0.07500 0.000 0.000 0.468 0.020 0.000 0.512
#> GSM613694     4  0.0405    0.78763 0.000 0.000 0.004 0.988 0.008 0.000
#> GSM613695     4  0.2994    0.66358 0.000 0.000 0.208 0.788 0.000 0.004
#> GSM613696     4  0.3546    0.70815 0.000 0.000 0.076 0.808 0.004 0.112
#> GSM613697     4  0.2902    0.72872 0.000 0.000 0.004 0.800 0.196 0.000
#> GSM613698     4  0.2805    0.73344 0.000 0.000 0.004 0.812 0.184 0.000
#> GSM613699     4  0.0405    0.78718 0.000 0.000 0.008 0.988 0.004 0.000
#> GSM613700     2  0.0000    0.84609 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613701     2  0.4230    0.47695 0.000 0.648 0.000 0.324 0.004 0.024
#> GSM613702     2  0.4115    0.59060 0.000 0.696 0.000 0.268 0.004 0.032
#> GSM613703     1  0.2125    0.89015 0.916 0.000 0.000 0.028 0.028 0.028
#> GSM613704     6  0.0260    0.76103 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM613705     4  0.0405    0.78763 0.000 0.000 0.004 0.988 0.008 0.000
#> GSM613706     4  0.3774    0.09079 0.000 0.408 0.000 0.592 0.000 0.000
#> GSM613707     2  0.0000    0.84609 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613708     1  0.1036    0.90971 0.964 0.000 0.000 0.008 0.004 0.024
#> GSM613709     1  0.0777    0.91266 0.972 0.000 0.000 0.000 0.024 0.004
#> GSM613710     2  0.0000    0.84609 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613711     3  0.0000    0.96294 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613712     4  0.3014    0.68732 0.000 0.000 0.184 0.804 0.012 0.000
#> GSM613713     3  0.0000    0.96294 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613714     3  0.1918    0.90069 0.000 0.000 0.904 0.088 0.000 0.008
#> GSM613715     3  0.1265    0.93753 0.000 0.000 0.948 0.044 0.000 0.008
#> GSM613716     4  0.5037    0.50960 0.000 0.000 0.188 0.640 0.000 0.172
#> GSM613717     3  0.0000    0.96294 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613718     3  0.0000    0.96294 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613719     4  0.3403    0.72283 0.000 0.000 0.000 0.768 0.212 0.020
#> GSM613720     3  0.1983    0.90047 0.000 0.000 0.908 0.020 0.000 0.072
#> GSM613721     6  0.3789    0.59792 0.000 0.000 0.000 0.260 0.024 0.716
#> GSM613722     2  0.0260    0.84469 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM613723     5  0.1341    0.95928 0.028 0.000 0.000 0.024 0.948 0.000
#> GSM613724     1  0.0146    0.91441 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM613725     2  0.0146    0.84566 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM613726     1  0.3240    0.78338 0.820 0.000 0.000 0.144 0.028 0.008
#> GSM613727     1  0.0146    0.91441 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM613728     2  0.2838    0.73913 0.000 0.808 0.000 0.004 0.000 0.188
#> GSM613729     1  0.0777    0.91266 0.972 0.000 0.000 0.000 0.024 0.004
#> GSM613730     2  0.5672    0.44385 0.000 0.512 0.000 0.304 0.000 0.184
#> GSM613731     4  0.4300   -0.00122 0.456 0.012 0.000 0.528 0.004 0.000
#> GSM613732     3  0.0000    0.96294 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613733     3  0.0260    0.96087 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM613734     5  0.1492    0.95108 0.036 0.000 0.000 0.024 0.940 0.000
#> GSM613735     5  0.1341    0.95928 0.028 0.000 0.000 0.024 0.948 0.000
#> GSM613736     3  0.0520    0.95828 0.000 0.000 0.984 0.008 0.000 0.008
#> GSM613737     4  0.3247    0.74481 0.000 0.000 0.036 0.808 0.156 0.000
#> GSM613738     5  0.4691    0.63580 0.108 0.000 0.000 0.220 0.672 0.000
#> GSM613739     5  0.1341    0.95928 0.028 0.000 0.000 0.024 0.948 0.000
#> GSM613740     3  0.0000    0.96294 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613741     6  0.4251    0.46138 0.000 0.000 0.000 0.348 0.028 0.624
#> GSM613742     4  0.3470    0.70158 0.028 0.000 0.000 0.772 0.200 0.000
#> GSM613743     3  0.0000    0.96294 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613744     3  0.0000    0.96294 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613745     4  0.2333    0.73630 0.000 0.000 0.000 0.884 0.024 0.092
#> GSM613746     6  0.0547    0.76021 0.000 0.000 0.000 0.020 0.000 0.980
#> GSM613747     5  0.1341    0.95928 0.028 0.000 0.000 0.024 0.948 0.000
#> GSM613748     4  0.4417    0.00625 0.000 0.416 0.000 0.556 0.000 0.028
#> GSM613749     1  0.4643    0.50906 0.648 0.000 0.000 0.300 0.028 0.024
#> GSM613750     3  0.1049    0.94600 0.000 0.000 0.960 0.032 0.000 0.008
#> GSM613751     3  0.0146    0.96220 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM613752     3  0.0000    0.96294 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613753     3  0.1701    0.91690 0.000 0.000 0.920 0.072 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 disease.state(p) k
#> MAD:mclust 113         0.086411 2
#> MAD:mclust  65         0.542675 3
#> MAD:mclust  46         0.137276 4
#> MAD:mclust 107         0.093447 5
#> MAD:mclust 105         0.000444 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 27425 rows and 116 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.844           0.919       0.965         0.4989 0.499   0.499
#> 3 3 0.677           0.775       0.902         0.3070 0.752   0.547
#> 4 4 0.690           0.752       0.873         0.1163 0.859   0.628
#> 5 5 0.593           0.599       0.780         0.0746 0.877   0.601
#> 6 6 0.594           0.448       0.607         0.0415 0.951   0.791

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
#> GSM613638     2  0.7815    0.70505 0.232 0.768
#> GSM613639     1  0.0000    0.96509 1.000 0.000
#> GSM613640     2  0.4939    0.86828 0.108 0.892
#> GSM613641     1  0.0000    0.96509 1.000 0.000
#> GSM613642     2  0.0000    0.95969 0.000 1.000
#> GSM613643     1  0.0000    0.96509 1.000 0.000
#> GSM613644     1  0.0000    0.96509 1.000 0.000
#> GSM613645     1  0.0000    0.96509 1.000 0.000
#> GSM613646     1  0.6438    0.80445 0.836 0.164
#> GSM613647     1  0.9998    0.00846 0.508 0.492
#> GSM613648     2  0.0000    0.95969 0.000 1.000
#> GSM613649     2  0.0000    0.95969 0.000 1.000
#> GSM613650     1  0.0000    0.96509 1.000 0.000
#> GSM613651     1  0.6801    0.78405 0.820 0.180
#> GSM613652     1  0.0000    0.96509 1.000 0.000
#> GSM613653     1  0.4562    0.88124 0.904 0.096
#> GSM613654     1  0.0000    0.96509 1.000 0.000
#> GSM613655     1  0.0000    0.96509 1.000 0.000
#> GSM613656     1  0.0000    0.96509 1.000 0.000
#> GSM613657     2  0.0000    0.95969 0.000 1.000
#> GSM613658     1  0.0000    0.96509 1.000 0.000
#> GSM613659     2  0.0000    0.95969 0.000 1.000
#> GSM613660     2  0.0000    0.95969 0.000 1.000
#> GSM613661     1  0.0000    0.96509 1.000 0.000
#> GSM613662     2  0.0000    0.95969 0.000 1.000
#> GSM613663     1  0.0000    0.96509 1.000 0.000
#> GSM613664     2  0.0000    0.95969 0.000 1.000
#> GSM613665     2  0.0000    0.95969 0.000 1.000
#> GSM613666     1  0.0000    0.96509 1.000 0.000
#> GSM613667     1  0.0000    0.96509 1.000 0.000
#> GSM613668     1  0.0000    0.96509 1.000 0.000
#> GSM613669     1  0.0000    0.96509 1.000 0.000
#> GSM613670     2  0.8207    0.65745 0.256 0.744
#> GSM613671     1  0.0000    0.96509 1.000 0.000
#> GSM613672     1  0.0000    0.96509 1.000 0.000
#> GSM613673     1  0.0000    0.96509 1.000 0.000
#> GSM613674     2  0.0000    0.95969 0.000 1.000
#> GSM613675     2  0.0000    0.95969 0.000 1.000
#> GSM613676     2  0.0000    0.95969 0.000 1.000
#> GSM613677     2  0.0000    0.95969 0.000 1.000
#> GSM613678     1  0.0000    0.96509 1.000 0.000
#> GSM613679     2  0.0000    0.95969 0.000 1.000
#> GSM613680     1  0.0000    0.96509 1.000 0.000
#> GSM613681     1  0.0000    0.96509 1.000 0.000
#> GSM613682     1  0.0000    0.96509 1.000 0.000
#> GSM613683     1  0.0000    0.96509 1.000 0.000
#> GSM613684     2  0.0000    0.95969 0.000 1.000
#> GSM613685     2  0.0000    0.95969 0.000 1.000
#> GSM613686     1  0.0000    0.96509 1.000 0.000
#> GSM613687     1  0.0000    0.96509 1.000 0.000
#> GSM613688     2  0.0000    0.95969 0.000 1.000
#> GSM613689     2  0.0000    0.95969 0.000 1.000
#> GSM613690     2  0.0000    0.95969 0.000 1.000
#> GSM613691     2  0.0000    0.95969 0.000 1.000
#> GSM613692     1  0.0000    0.96509 1.000 0.000
#> GSM613693     2  0.0000    0.95969 0.000 1.000
#> GSM613694     1  0.8207    0.66250 0.744 0.256
#> GSM613695     2  0.0000    0.95969 0.000 1.000
#> GSM613696     2  0.1633    0.94164 0.024 0.976
#> GSM613697     1  0.6973    0.77313 0.812 0.188
#> GSM613698     2  0.8861    0.57561 0.304 0.696
#> GSM613699     2  0.6148    0.81589 0.152 0.848
#> GSM613700     2  0.0000    0.95969 0.000 1.000
#> GSM613701     2  0.3274    0.91167 0.060 0.940
#> GSM613702     2  0.3879    0.89539 0.076 0.924
#> GSM613703     1  0.0000    0.96509 1.000 0.000
#> GSM613704     2  0.0000    0.95969 0.000 1.000
#> GSM613705     2  0.6343    0.80633 0.160 0.840
#> GSM613706     1  0.2423    0.93352 0.960 0.040
#> GSM613707     2  0.0000    0.95969 0.000 1.000
#> GSM613708     1  0.0000    0.96509 1.000 0.000
#> GSM613709     1  0.0000    0.96509 1.000 0.000
#> GSM613710     2  0.0000    0.95969 0.000 1.000
#> GSM613711     2  0.0000    0.95969 0.000 1.000
#> GSM613712     2  0.7376    0.74146 0.208 0.792
#> GSM613713     2  0.0000    0.95969 0.000 1.000
#> GSM613714     2  0.0000    0.95969 0.000 1.000
#> GSM613715     2  0.0000    0.95969 0.000 1.000
#> GSM613716     2  0.0000    0.95969 0.000 1.000
#> GSM613717     2  0.0000    0.95969 0.000 1.000
#> GSM613718     2  0.0000    0.95969 0.000 1.000
#> GSM613719     1  0.7056    0.76707 0.808 0.192
#> GSM613720     2  0.0000    0.95969 0.000 1.000
#> GSM613721     2  0.0000    0.95969 0.000 1.000
#> GSM613722     2  0.0000    0.95969 0.000 1.000
#> GSM613723     1  0.0000    0.96509 1.000 0.000
#> GSM613724     1  0.0000    0.96509 1.000 0.000
#> GSM613725     2  0.0000    0.95969 0.000 1.000
#> GSM613726     1  0.0000    0.96509 1.000 0.000
#> GSM613727     1  0.0000    0.96509 1.000 0.000
#> GSM613728     2  0.0000    0.95969 0.000 1.000
#> GSM613729     1  0.0000    0.96509 1.000 0.000
#> GSM613730     2  0.0000    0.95969 0.000 1.000
#> GSM613731     1  0.0000    0.96509 1.000 0.000
#> GSM613732     2  0.0000    0.95969 0.000 1.000
#> GSM613733     2  0.0000    0.95969 0.000 1.000
#> GSM613734     1  0.0000    0.96509 1.000 0.000
#> GSM613735     1  0.0000    0.96509 1.000 0.000
#> GSM613736     2  0.0000    0.95969 0.000 1.000
#> GSM613737     2  0.9866    0.24609 0.432 0.568
#> GSM613738     1  0.0000    0.96509 1.000 0.000
#> GSM613739     1  0.0000    0.96509 1.000 0.000
#> GSM613740     2  0.0000    0.95969 0.000 1.000
#> GSM613741     1  0.4562    0.88129 0.904 0.096
#> GSM613742     1  0.0000    0.96509 1.000 0.000
#> GSM613743     2  0.0000    0.95969 0.000 1.000
#> GSM613744     2  0.0000    0.95969 0.000 1.000
#> GSM613745     2  0.9209    0.50771 0.336 0.664
#> GSM613746     2  0.0000    0.95969 0.000 1.000
#> GSM613747     1  0.0000    0.96509 1.000 0.000
#> GSM613748     2  0.0376    0.95678 0.004 0.996
#> GSM613749     1  0.0000    0.96509 1.000 0.000
#> GSM613750     2  0.0000    0.95969 0.000 1.000
#> GSM613751     2  0.0000    0.95969 0.000 1.000
#> GSM613752     2  0.0000    0.95969 0.000 1.000
#> GSM613753     2  0.0000    0.95969 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
#> GSM613638     3  0.5016     0.6716 0.240 0.000 0.760
#> GSM613639     1  0.0424     0.9517 0.992 0.008 0.000
#> GSM613640     3  0.4047     0.7431 0.148 0.004 0.848
#> GSM613641     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613642     3  0.6180     0.1388 0.000 0.416 0.584
#> GSM613643     1  0.0237     0.9557 0.996 0.000 0.004
#> GSM613644     1  0.0237     0.9557 0.996 0.000 0.004
#> GSM613645     2  0.5760     0.4845 0.328 0.672 0.000
#> GSM613646     1  0.4504     0.7253 0.804 0.000 0.196
#> GSM613647     3  0.5760     0.5424 0.328 0.000 0.672
#> GSM613648     3  0.0000     0.8178 0.000 0.000 1.000
#> GSM613649     3  0.0000     0.8178 0.000 0.000 1.000
#> GSM613650     1  0.1031     0.9411 0.976 0.000 0.024
#> GSM613651     3  0.6286     0.2323 0.464 0.000 0.536
#> GSM613652     1  0.0237     0.9557 0.996 0.000 0.004
#> GSM613653     1  0.4504     0.7241 0.804 0.000 0.196
#> GSM613654     1  0.0237     0.9557 0.996 0.000 0.004
#> GSM613655     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613656     1  0.0237     0.9557 0.996 0.000 0.004
#> GSM613657     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613658     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613659     2  0.0000     0.8646 0.000 1.000 0.000
#> GSM613660     3  0.6215     0.0958 0.000 0.428 0.572
#> GSM613661     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613662     2  0.0000     0.8646 0.000 1.000 0.000
#> GSM613663     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613664     2  0.0000     0.8646 0.000 1.000 0.000
#> GSM613665     2  0.4654     0.7642 0.000 0.792 0.208
#> GSM613666     1  0.0892     0.9432 0.980 0.020 0.000
#> GSM613667     1  0.2625     0.8863 0.916 0.084 0.000
#> GSM613668     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613669     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613670     2  0.0237     0.8636 0.004 0.996 0.000
#> GSM613671     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613672     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613673     1  0.2448     0.8937 0.924 0.076 0.000
#> GSM613674     2  0.1964     0.8565 0.000 0.944 0.056
#> GSM613675     2  0.0237     0.8640 0.000 0.996 0.004
#> GSM613676     3  0.5560     0.4413 0.000 0.300 0.700
#> GSM613677     3  0.0424     0.8165 0.000 0.008 0.992
#> GSM613678     2  0.0237     0.8636 0.004 0.996 0.000
#> GSM613679     2  0.4121     0.8035 0.000 0.832 0.168
#> GSM613680     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613681     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613682     1  0.6274     0.1149 0.544 0.456 0.000
#> GSM613683     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613684     3  0.6307    -0.1213 0.000 0.488 0.512
#> GSM613685     2  0.4399     0.7871 0.000 0.812 0.188
#> GSM613686     2  0.2625     0.8241 0.084 0.916 0.000
#> GSM613687     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613688     2  0.2537     0.8479 0.000 0.920 0.080
#> GSM613689     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613690     3  0.0000     0.8178 0.000 0.000 1.000
#> GSM613691     2  0.6062     0.2360 0.000 0.616 0.384
#> GSM613692     1  0.0424     0.9533 0.992 0.000 0.008
#> GSM613693     3  0.0592     0.8142 0.000 0.012 0.988
#> GSM613694     3  0.6215     0.3319 0.428 0.000 0.572
#> GSM613695     3  0.0000     0.8178 0.000 0.000 1.000
#> GSM613696     3  0.1878     0.8008 0.044 0.004 0.952
#> GSM613697     3  0.6260     0.2776 0.448 0.000 0.552
#> GSM613698     3  0.4796     0.6877 0.220 0.000 0.780
#> GSM613699     3  0.3038     0.7676 0.104 0.000 0.896
#> GSM613700     2  0.4121     0.8037 0.000 0.832 0.168
#> GSM613701     2  0.4663     0.7606 0.156 0.828 0.016
#> GSM613702     2  0.0237     0.8636 0.004 0.996 0.000
#> GSM613703     1  0.4796     0.7115 0.780 0.220 0.000
#> GSM613704     2  0.0000     0.8646 0.000 1.000 0.000
#> GSM613705     3  0.4178     0.7234 0.172 0.000 0.828
#> GSM613706     2  0.6302     0.0862 0.480 0.520 0.000
#> GSM613707     2  0.4178     0.8008 0.000 0.828 0.172
#> GSM613708     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613709     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613710     3  0.5926     0.3063 0.000 0.356 0.644
#> GSM613711     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613712     3  0.4555     0.7031 0.200 0.000 0.800
#> GSM613713     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613714     3  0.0000     0.8178 0.000 0.000 1.000
#> GSM613715     3  0.0000     0.8178 0.000 0.000 1.000
#> GSM613716     3  0.0424     0.8165 0.000 0.008 0.992
#> GSM613717     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613718     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613719     3  0.6302     0.1804 0.480 0.000 0.520
#> GSM613720     3  0.0424     0.8165 0.000 0.008 0.992
#> GSM613721     3  0.5968     0.4499 0.000 0.364 0.636
#> GSM613722     2  0.4504     0.7792 0.000 0.804 0.196
#> GSM613723     1  0.0237     0.9557 0.996 0.000 0.004
#> GSM613724     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613725     2  0.4605     0.7711 0.000 0.796 0.204
#> GSM613726     1  0.1411     0.9312 0.964 0.036 0.000
#> GSM613727     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613728     2  0.0000     0.8646 0.000 1.000 0.000
#> GSM613729     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613730     2  0.0000     0.8646 0.000 1.000 0.000
#> GSM613731     1  0.0000     0.9563 1.000 0.000 0.000
#> GSM613732     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613733     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613734     1  0.0237     0.9557 0.996 0.000 0.004
#> GSM613735     1  0.0237     0.9557 0.996 0.000 0.004
#> GSM613736     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613737     3  0.5098     0.6620 0.248 0.000 0.752
#> GSM613738     1  0.0237     0.9557 0.996 0.000 0.004
#> GSM613739     1  0.0237     0.9557 0.996 0.000 0.004
#> GSM613740     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613741     1  0.7493     0.6465 0.696 0.136 0.168
#> GSM613742     1  0.1163     0.9377 0.972 0.000 0.028
#> GSM613743     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613744     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613745     3  0.8557     0.5248 0.180 0.212 0.608
#> GSM613746     3  0.5988     0.4725 0.000 0.368 0.632
#> GSM613747     1  0.0237     0.9557 0.996 0.000 0.004
#> GSM613748     2  0.1765     0.8610 0.004 0.956 0.040
#> GSM613749     2  0.0592     0.8621 0.012 0.988 0.000
#> GSM613750     3  0.0000     0.8178 0.000 0.000 1.000
#> GSM613751     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613752     3  0.0237     0.8180 0.000 0.004 0.996
#> GSM613753     3  0.0000     0.8178 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
#> GSM613638     3  0.7827   -0.06778 0.260 0.352 0.388 0.000
#> GSM613639     1  0.5276    0.29116 0.560 0.004 0.004 0.432
#> GSM613640     2  0.6515    0.60717 0.128 0.624 0.248 0.000
#> GSM613641     1  0.0376    0.90617 0.992 0.004 0.000 0.004
#> GSM613642     2  0.3400    0.78399 0.000 0.820 0.180 0.000
#> GSM613643     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613644     1  0.0376    0.90651 0.992 0.000 0.004 0.004
#> GSM613645     1  0.6965    0.00198 0.460 0.112 0.000 0.428
#> GSM613646     4  0.4898    0.69833 0.072 0.000 0.156 0.772
#> GSM613647     3  0.3356    0.73284 0.176 0.000 0.824 0.000
#> GSM613648     3  0.0779    0.82630 0.000 0.004 0.980 0.016
#> GSM613649     3  0.1576    0.81726 0.000 0.004 0.948 0.048
#> GSM613650     1  0.3764    0.68255 0.784 0.000 0.216 0.000
#> GSM613651     3  0.4564    0.55000 0.328 0.000 0.672 0.000
#> GSM613652     1  0.0188    0.90644 0.996 0.000 0.004 0.000
#> GSM613653     4  0.2867    0.78685 0.012 0.000 0.104 0.884
#> GSM613654     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613655     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613656     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613657     3  0.0817    0.82285 0.000 0.024 0.976 0.000
#> GSM613658     1  0.0376    0.90651 0.992 0.000 0.004 0.004
#> GSM613659     4  0.2704    0.76681 0.000 0.124 0.000 0.876
#> GSM613660     2  0.3074    0.80118 0.000 0.848 0.152 0.000
#> GSM613661     1  0.0336    0.90626 0.992 0.000 0.000 0.008
#> GSM613662     4  0.1792    0.79548 0.000 0.068 0.000 0.932
#> GSM613663     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613664     4  0.4382    0.59219 0.000 0.296 0.000 0.704
#> GSM613665     2  0.2563    0.83984 0.000 0.908 0.072 0.020
#> GSM613666     1  0.5070    0.44259 0.620 0.008 0.000 0.372
#> GSM613667     1  0.2578    0.86005 0.912 0.052 0.000 0.036
#> GSM613668     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613669     1  0.1661    0.88176 0.944 0.004 0.000 0.052
#> GSM613670     4  0.2011    0.79182 0.000 0.080 0.000 0.920
#> GSM613671     1  0.4990    0.48327 0.640 0.008 0.000 0.352
#> GSM613672     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613673     1  0.2281    0.84203 0.904 0.096 0.000 0.000
#> GSM613674     2  0.0927    0.83379 0.000 0.976 0.008 0.016
#> GSM613675     4  0.1004    0.80446 0.000 0.024 0.004 0.972
#> GSM613676     2  0.3764    0.75623 0.000 0.784 0.216 0.000
#> GSM613677     3  0.1302    0.81512 0.000 0.044 0.956 0.000
#> GSM613678     4  0.4830    0.40508 0.000 0.392 0.000 0.608
#> GSM613679     2  0.1520    0.83683 0.000 0.956 0.020 0.024
#> GSM613680     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613681     1  0.1004    0.89796 0.972 0.004 0.000 0.024
#> GSM613682     1  0.4423    0.72359 0.788 0.176 0.000 0.036
#> GSM613683     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613684     2  0.5700    0.72723 0.000 0.716 0.164 0.120
#> GSM613685     2  0.1452    0.84377 0.000 0.956 0.036 0.008
#> GSM613686     4  0.7894    0.20556 0.320 0.304 0.000 0.376
#> GSM613687     1  0.0592    0.90191 0.984 0.016 0.000 0.000
#> GSM613688     2  0.4807    0.58157 0.000 0.728 0.024 0.248
#> GSM613689     3  0.2814    0.73357 0.000 0.132 0.868 0.000
#> GSM613690     3  0.0921    0.82289 0.000 0.000 0.972 0.028
#> GSM613691     4  0.1474    0.80577 0.000 0.000 0.052 0.948
#> GSM613692     1  0.4932    0.61994 0.728 0.000 0.240 0.032
#> GSM613693     3  0.4889    0.48122 0.000 0.004 0.636 0.360
#> GSM613694     3  0.5000    0.10882 0.500 0.000 0.500 0.000
#> GSM613695     3  0.0469    0.82588 0.000 0.012 0.988 0.000
#> GSM613696     3  0.4964    0.64490 0.032 0.000 0.724 0.244
#> GSM613697     3  0.4304    0.61414 0.284 0.000 0.716 0.000
#> GSM613698     3  0.5033    0.70504 0.072 0.000 0.760 0.168
#> GSM613699     3  0.2623    0.80065 0.064 0.000 0.908 0.028
#> GSM613700     2  0.1042    0.84112 0.000 0.972 0.020 0.008
#> GSM613701     2  0.1404    0.83640 0.012 0.964 0.012 0.012
#> GSM613702     2  0.1004    0.82241 0.004 0.972 0.000 0.024
#> GSM613703     4  0.3709    0.74830 0.100 0.040 0.004 0.856
#> GSM613704     4  0.1474    0.79955 0.000 0.052 0.000 0.948
#> GSM613705     3  0.6664    0.50468 0.232 0.152 0.616 0.000
#> GSM613706     2  0.3787    0.74902 0.124 0.840 0.036 0.000
#> GSM613707     2  0.1388    0.84221 0.000 0.960 0.028 0.012
#> GSM613708     1  0.0336    0.90626 0.992 0.000 0.000 0.008
#> GSM613709     1  0.0336    0.90626 0.992 0.000 0.000 0.008
#> GSM613710     2  0.3649    0.76567 0.000 0.796 0.204 0.000
#> GSM613711     3  0.0469    0.82582 0.000 0.012 0.988 0.000
#> GSM613712     3  0.4123    0.74701 0.136 0.000 0.820 0.044
#> GSM613713     3  0.3557    0.76869 0.000 0.108 0.856 0.036
#> GSM613714     3  0.1867    0.79213 0.000 0.072 0.928 0.000
#> GSM613715     3  0.1118    0.82054 0.000 0.000 0.964 0.036
#> GSM613716     3  0.4679    0.50679 0.000 0.000 0.648 0.352
#> GSM613717     3  0.0707    0.82402 0.000 0.020 0.980 0.000
#> GSM613718     3  0.0672    0.82676 0.000 0.008 0.984 0.008
#> GSM613719     3  0.6948    0.51240 0.204 0.000 0.588 0.208
#> GSM613720     3  0.4837    0.51556 0.000 0.004 0.648 0.348
#> GSM613721     4  0.2149    0.79775 0.000 0.000 0.088 0.912
#> GSM613722     2  0.1398    0.84348 0.000 0.956 0.040 0.004
#> GSM613723     1  0.0336    0.90451 0.992 0.000 0.008 0.000
#> GSM613724     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613725     2  0.1716    0.83917 0.000 0.936 0.064 0.000
#> GSM613726     1  0.1557    0.87723 0.944 0.056 0.000 0.000
#> GSM613727     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613728     2  0.1211    0.81490 0.000 0.960 0.000 0.040
#> GSM613729     1  0.1396    0.89350 0.960 0.004 0.004 0.032
#> GSM613730     2  0.3529    0.72255 0.000 0.836 0.012 0.152
#> GSM613731     1  0.0188    0.90657 0.996 0.004 0.000 0.000
#> GSM613732     3  0.1042    0.82610 0.000 0.008 0.972 0.020
#> GSM613733     2  0.4998    0.21569 0.000 0.512 0.488 0.000
#> GSM613734     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613735     1  0.0188    0.90644 0.996 0.000 0.004 0.000
#> GSM613736     3  0.1637    0.80213 0.000 0.060 0.940 0.000
#> GSM613737     3  0.3554    0.75690 0.136 0.000 0.844 0.020
#> GSM613738     1  0.1824    0.86630 0.936 0.000 0.060 0.004
#> GSM613739     1  0.1557    0.87151 0.944 0.000 0.056 0.000
#> GSM613740     3  0.1256    0.82460 0.000 0.008 0.964 0.028
#> GSM613741     4  0.1940    0.80244 0.000 0.000 0.076 0.924
#> GSM613742     1  0.4988    0.53178 0.692 0.000 0.288 0.020
#> GSM613743     3  0.1022    0.81994 0.000 0.032 0.968 0.000
#> GSM613744     3  0.0672    0.82676 0.000 0.008 0.984 0.008
#> GSM613745     4  0.3610    0.66332 0.000 0.000 0.200 0.800
#> GSM613746     4  0.2011    0.79989 0.000 0.000 0.080 0.920
#> GSM613747     1  0.0000    0.90741 1.000 0.000 0.000 0.000
#> GSM613748     2  0.1492    0.84022 0.004 0.956 0.036 0.004
#> GSM613749     2  0.4673    0.66026 0.076 0.792 0.000 0.132
#> GSM613750     3  0.0336    0.82633 0.000 0.008 0.992 0.000
#> GSM613751     3  0.0707    0.82402 0.000 0.020 0.980 0.000
#> GSM613752     3  0.1042    0.82610 0.000 0.008 0.972 0.020
#> GSM613753     3  0.0592    0.82608 0.000 0.000 0.984 0.016

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     5  0.5733     0.5556 0.208 0.124 0.004 0.008 0.656
#> GSM613639     4  0.4637     0.5376 0.160 0.000 0.100 0.740 0.000
#> GSM613640     5  0.6380     0.3224 0.004 0.208 0.004 0.220 0.564
#> GSM613641     1  0.1197     0.8367 0.952 0.000 0.000 0.048 0.000
#> GSM613642     2  0.5237     0.6231 0.000 0.696 0.004 0.140 0.160
#> GSM613643     1  0.7508     0.2308 0.492 0.096 0.000 0.264 0.148
#> GSM613644     4  0.5773     0.1969 0.100 0.000 0.000 0.544 0.356
#> GSM613645     4  0.3248     0.5865 0.084 0.020 0.032 0.864 0.000
#> GSM613646     3  0.5244     0.5873 0.084 0.004 0.728 0.160 0.024
#> GSM613647     5  0.2731     0.7398 0.016 0.000 0.004 0.104 0.876
#> GSM613648     5  0.2344     0.7574 0.000 0.000 0.032 0.064 0.904
#> GSM613649     5  0.2149     0.7556 0.000 0.000 0.048 0.036 0.916
#> GSM613650     1  0.3343     0.7909 0.864 0.000 0.028 0.040 0.068
#> GSM613651     5  0.5302     0.5144 0.280 0.000 0.032 0.032 0.656
#> GSM613652     1  0.0162     0.8382 0.996 0.000 0.000 0.004 0.000
#> GSM613653     3  0.3831     0.6438 0.004 0.000 0.784 0.188 0.024
#> GSM613654     1  0.0510     0.8364 0.984 0.000 0.000 0.016 0.000
#> GSM613655     1  0.0162     0.8387 0.996 0.000 0.000 0.004 0.000
#> GSM613656     1  0.0000     0.8381 1.000 0.000 0.000 0.000 0.000
#> GSM613657     5  0.1372     0.7694 0.000 0.024 0.016 0.004 0.956
#> GSM613658     1  0.0955     0.8394 0.968 0.000 0.000 0.028 0.004
#> GSM613659     4  0.3209     0.4695 0.000 0.008 0.180 0.812 0.000
#> GSM613660     2  0.4123     0.6646 0.000 0.796 0.004 0.092 0.108
#> GSM613661     4  0.4397     0.1002 0.432 0.000 0.000 0.564 0.004
#> GSM613662     4  0.4359     0.1843 0.000 0.004 0.412 0.584 0.000
#> GSM613663     1  0.2020     0.8118 0.900 0.000 0.000 0.100 0.000
#> GSM613664     2  0.5887     0.1109 0.000 0.476 0.424 0.100 0.000
#> GSM613665     2  0.4631     0.5686 0.000 0.704 0.004 0.252 0.040
#> GSM613666     1  0.5589     0.4701 0.628 0.000 0.128 0.244 0.000
#> GSM613667     4  0.3611     0.5530 0.208 0.008 0.000 0.780 0.004
#> GSM613668     1  0.0162     0.8384 0.996 0.000 0.000 0.004 0.000
#> GSM613669     1  0.3928     0.6054 0.700 0.000 0.004 0.296 0.000
#> GSM613670     4  0.4166     0.3061 0.000 0.004 0.348 0.648 0.000
#> GSM613671     1  0.5154     0.3791 0.580 0.000 0.048 0.372 0.000
#> GSM613672     1  0.1121     0.8382 0.956 0.000 0.000 0.044 0.000
#> GSM613673     1  0.3307     0.7603 0.844 0.104 0.000 0.052 0.000
#> GSM613674     2  0.2583     0.6579 0.000 0.864 0.132 0.004 0.000
#> GSM613675     4  0.3689     0.4021 0.000 0.000 0.256 0.740 0.004
#> GSM613676     2  0.6188     0.4831 0.000 0.552 0.004 0.152 0.292
#> GSM613677     5  0.2102     0.7614 0.000 0.012 0.004 0.068 0.916
#> GSM613678     4  0.3012     0.5488 0.000 0.104 0.036 0.860 0.000
#> GSM613679     2  0.2464     0.6743 0.000 0.892 0.012 0.092 0.004
#> GSM613680     1  0.0880     0.8391 0.968 0.000 0.000 0.032 0.000
#> GSM613681     1  0.2230     0.8054 0.884 0.000 0.000 0.116 0.000
#> GSM613682     1  0.2513     0.7803 0.876 0.116 0.000 0.008 0.000
#> GSM613683     1  0.0404     0.8398 0.988 0.000 0.000 0.012 0.000
#> GSM613684     2  0.4993     0.5173 0.000 0.672 0.268 0.004 0.056
#> GSM613685     2  0.2798     0.6536 0.000 0.852 0.140 0.000 0.008
#> GSM613686     4  0.4737     0.5812 0.148 0.080 0.016 0.756 0.000
#> GSM613687     1  0.0963     0.8390 0.964 0.000 0.000 0.036 0.000
#> GSM613688     2  0.5288     0.5018 0.000 0.664 0.260 0.064 0.012
#> GSM613689     5  0.5833     0.0306 0.000 0.440 0.080 0.004 0.476
#> GSM613690     5  0.1992     0.7581 0.000 0.000 0.044 0.032 0.924
#> GSM613691     3  0.3551     0.6153 0.000 0.000 0.772 0.220 0.008
#> GSM613692     1  0.6108     0.4965 0.644 0.000 0.128 0.036 0.192
#> GSM613693     3  0.3919     0.6175 0.000 0.100 0.816 0.008 0.076
#> GSM613694     1  0.5715     0.6088 0.732 0.128 0.052 0.048 0.040
#> GSM613695     5  0.1116     0.7708 0.004 0.004 0.000 0.028 0.964
#> GSM613696     3  0.5342     0.5612 0.032 0.124 0.732 0.004 0.108
#> GSM613697     5  0.4419     0.6369 0.188 0.000 0.020 0.032 0.760
#> GSM613698     5  0.6410     0.3302 0.056 0.000 0.300 0.072 0.572
#> GSM613699     5  0.8539     0.1560 0.204 0.160 0.260 0.008 0.368
#> GSM613700     2  0.2722     0.6690 0.000 0.872 0.000 0.108 0.020
#> GSM613701     2  0.1772     0.6834 0.016 0.944 0.012 0.024 0.004
#> GSM613702     2  0.4305     0.1685 0.000 0.512 0.000 0.488 0.000
#> GSM613703     4  0.5103     0.1935 0.040 0.000 0.404 0.556 0.000
#> GSM613704     3  0.4473     0.4433 0.000 0.020 0.656 0.324 0.000
#> GSM613705     5  0.3319     0.7488 0.052 0.040 0.004 0.032 0.872
#> GSM613706     2  0.6060     0.5090 0.156 0.672 0.004 0.124 0.044
#> GSM613707     2  0.3250     0.6351 0.000 0.820 0.168 0.004 0.008
#> GSM613708     1  0.3480     0.6853 0.752 0.000 0.000 0.248 0.000
#> GSM613709     1  0.3586     0.6583 0.736 0.000 0.000 0.264 0.000
#> GSM613710     2  0.3906     0.6705 0.000 0.812 0.004 0.080 0.104
#> GSM613711     5  0.2504     0.7576 0.000 0.064 0.032 0.004 0.900
#> GSM613712     5  0.5410     0.5735 0.204 0.000 0.080 0.024 0.692
#> GSM613713     2  0.5863     0.4224 0.000 0.588 0.292 0.004 0.116
#> GSM613714     5  0.3174     0.7459 0.000 0.080 0.036 0.016 0.868
#> GSM613715     5  0.2074     0.7570 0.000 0.000 0.044 0.036 0.920
#> GSM613716     3  0.5915     0.2966 0.000 0.000 0.508 0.108 0.384
#> GSM613717     5  0.3693     0.7131 0.000 0.124 0.044 0.008 0.824
#> GSM613718     5  0.0992     0.7713 0.000 0.008 0.024 0.000 0.968
#> GSM613719     3  0.6540     0.4705 0.108 0.000 0.572 0.044 0.276
#> GSM613720     3  0.4932     0.5634 0.000 0.004 0.668 0.048 0.280
#> GSM613721     3  0.2361     0.6247 0.000 0.096 0.892 0.012 0.000
#> GSM613722     2  0.3216     0.6703 0.000 0.848 0.000 0.108 0.044
#> GSM613723     1  0.0000     0.8381 1.000 0.000 0.000 0.000 0.000
#> GSM613724     1  0.1197     0.8346 0.952 0.000 0.000 0.048 0.000
#> GSM613725     2  0.1179     0.6856 0.000 0.964 0.016 0.004 0.016
#> GSM613726     1  0.4701     0.6552 0.720 0.076 0.000 0.204 0.000
#> GSM613727     1  0.0963     0.8376 0.964 0.000 0.000 0.036 0.000
#> GSM613728     2  0.3928     0.5220 0.000 0.700 0.000 0.296 0.004
#> GSM613729     1  0.3607     0.6843 0.752 0.000 0.004 0.244 0.000
#> GSM613730     4  0.4347     0.3626 0.000 0.264 0.012 0.712 0.012
#> GSM613731     4  0.6702     0.2445 0.336 0.176 0.000 0.476 0.012
#> GSM613732     5  0.1560     0.7724 0.000 0.020 0.028 0.004 0.948
#> GSM613733     2  0.5175     0.3096 0.000 0.584 0.040 0.004 0.372
#> GSM613734     1  0.0000     0.8381 1.000 0.000 0.000 0.000 0.000
#> GSM613735     1  0.0162     0.8380 0.996 0.000 0.004 0.000 0.000
#> GSM613736     2  0.6620     0.1407 0.000 0.480 0.104 0.032 0.384
#> GSM613737     5  0.5347     0.6314 0.180 0.008 0.076 0.020 0.716
#> GSM613738     1  0.2313     0.8007 0.912 0.000 0.044 0.004 0.040
#> GSM613739     1  0.4078     0.6574 0.776 0.000 0.004 0.040 0.180
#> GSM613740     5  0.5618     0.5764 0.000 0.192 0.152 0.004 0.652
#> GSM613741     3  0.3246     0.6407 0.000 0.000 0.808 0.184 0.008
#> GSM613742     1  0.4872     0.6353 0.744 0.000 0.072 0.020 0.164
#> GSM613743     5  0.5932     0.3155 0.000 0.336 0.096 0.008 0.560
#> GSM613744     5  0.1168     0.7712 0.000 0.008 0.032 0.000 0.960
#> GSM613745     3  0.4461     0.6524 0.000 0.000 0.728 0.220 0.052
#> GSM613746     3  0.2332     0.6591 0.000 0.016 0.904 0.076 0.004
#> GSM613747     1  0.0162     0.8384 0.996 0.000 0.000 0.004 0.000
#> GSM613748     4  0.5139     0.1245 0.000 0.360 0.004 0.596 0.040
#> GSM613749     2  0.5763     0.4040 0.096 0.604 0.008 0.292 0.000
#> GSM613750     5  0.1830     0.7681 0.000 0.012 0.052 0.004 0.932
#> GSM613751     5  0.3215     0.7379 0.000 0.068 0.068 0.004 0.860
#> GSM613752     5  0.3629     0.7302 0.000 0.072 0.092 0.004 0.832
#> GSM613753     5  0.1571     0.7657 0.000 0.000 0.060 0.004 0.936

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     3  0.6241     0.1676 0.224 0.312 0.452 0.008 0.004 0.000
#> GSM613639     4  0.5492     0.2587 0.060 0.020 0.000 0.472 0.004 0.444
#> GSM613640     2  0.7028     0.2364 0.004 0.472 0.268 0.168 0.084 0.004
#> GSM613641     1  0.2594     0.7415 0.884 0.000 0.000 0.072 0.016 0.028
#> GSM613642     2  0.6928     0.3672 0.008 0.484 0.280 0.116 0.112 0.000
#> GSM613643     1  0.6671     0.1490 0.496 0.172 0.076 0.256 0.000 0.000
#> GSM613644     4  0.5301     0.1417 0.004 0.032 0.200 0.684 0.068 0.012
#> GSM613645     4  0.5444     0.4577 0.024 0.068 0.000 0.656 0.024 0.228
#> GSM613646     6  0.6985     0.3347 0.016 0.012 0.052 0.272 0.144 0.504
#> GSM613647     3  0.6448     0.4814 0.016 0.036 0.544 0.296 0.096 0.012
#> GSM613648     3  0.7240     0.4364 0.000 0.128 0.500 0.196 0.156 0.020
#> GSM613649     3  0.4832     0.5939 0.000 0.032 0.752 0.124 0.040 0.052
#> GSM613650     1  0.8093    -0.0417 0.368 0.008 0.196 0.060 0.076 0.292
#> GSM613651     3  0.6078     0.3520 0.260 0.000 0.544 0.172 0.016 0.008
#> GSM613652     1  0.0692     0.7609 0.976 0.000 0.000 0.020 0.004 0.000
#> GSM613653     6  0.2290     0.5326 0.016 0.000 0.020 0.012 0.040 0.912
#> GSM613654     1  0.1333     0.7502 0.944 0.000 0.000 0.048 0.008 0.000
#> GSM613655     1  0.0260     0.7647 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM613656     1  0.0291     0.7634 0.992 0.000 0.000 0.004 0.004 0.000
#> GSM613657     3  0.4121     0.5206 0.000 0.200 0.736 0.000 0.060 0.004
#> GSM613658     1  0.1036     0.7627 0.964 0.000 0.000 0.024 0.008 0.004
#> GSM613659     4  0.5533     0.3417 0.000 0.048 0.000 0.644 0.108 0.200
#> GSM613660     2  0.2325     0.4944 0.000 0.884 0.100 0.008 0.008 0.000
#> GSM613661     4  0.6446     0.1721 0.392 0.012 0.008 0.420 0.008 0.160
#> GSM613662     6  0.4578    -0.0900 0.000 0.032 0.000 0.396 0.004 0.568
#> GSM613663     1  0.1858     0.7455 0.904 0.000 0.000 0.092 0.004 0.000
#> GSM613664     5  0.5265     0.7087 0.000 0.252 0.000 0.028 0.636 0.084
#> GSM613665     2  0.4707     0.4600 0.000 0.696 0.068 0.220 0.012 0.004
#> GSM613666     1  0.3910     0.6849 0.792 0.000 0.000 0.100 0.016 0.092
#> GSM613667     4  0.5954     0.4868 0.096 0.072 0.000 0.644 0.016 0.172
#> GSM613668     1  0.0291     0.7642 0.992 0.000 0.000 0.004 0.004 0.000
#> GSM613669     1  0.5262     0.4558 0.632 0.000 0.000 0.204 0.008 0.156
#> GSM613670     6  0.5023    -0.0440 0.000 0.056 0.000 0.356 0.012 0.576
#> GSM613671     1  0.5976     0.2157 0.508 0.000 0.000 0.188 0.012 0.292
#> GSM613672     1  0.0972     0.7660 0.964 0.008 0.000 0.028 0.000 0.000
#> GSM613673     1  0.3989     0.6475 0.776 0.096 0.000 0.120 0.008 0.000
#> GSM613674     5  0.4141     0.6494 0.000 0.388 0.000 0.016 0.596 0.000
#> GSM613675     4  0.6058     0.0995 0.000 0.040 0.052 0.568 0.036 0.304
#> GSM613676     2  0.6079     0.3689 0.000 0.484 0.336 0.160 0.020 0.000
#> GSM613677     3  0.4854     0.5226 0.000 0.036 0.708 0.208 0.024 0.024
#> GSM613678     4  0.5467     0.3667 0.000 0.256 0.000 0.608 0.020 0.116
#> GSM613679     2  0.4735     0.0492 0.000 0.628 0.000 0.076 0.296 0.000
#> GSM613680     1  0.1615     0.7469 0.928 0.004 0.000 0.064 0.004 0.000
#> GSM613681     1  0.3352     0.6994 0.812 0.000 0.000 0.148 0.008 0.032
#> GSM613682     1  0.4462     0.5971 0.748 0.072 0.000 0.032 0.148 0.000
#> GSM613683     1  0.0603     0.7656 0.980 0.000 0.000 0.016 0.004 0.000
#> GSM613684     5  0.3858     0.7183 0.000 0.248 0.000 0.004 0.724 0.024
#> GSM613685     5  0.4047     0.6557 0.000 0.384 0.000 0.012 0.604 0.000
#> GSM613686     4  0.6843     0.4534 0.140 0.076 0.000 0.516 0.016 0.252
#> GSM613687     1  0.1493     0.7621 0.936 0.004 0.000 0.056 0.004 0.000
#> GSM613688     5  0.4601     0.6853 0.000 0.348 0.000 0.020 0.612 0.020
#> GSM613689     3  0.5787     0.2573 0.000 0.372 0.504 0.016 0.104 0.004
#> GSM613690     3  0.3277     0.5841 0.000 0.008 0.836 0.120 0.020 0.016
#> GSM613691     6  0.1838     0.5215 0.000 0.000 0.012 0.040 0.020 0.928
#> GSM613692     1  0.7131     0.1191 0.444 0.000 0.288 0.196 0.036 0.036
#> GSM613693     5  0.4562     0.5033 0.000 0.016 0.012 0.020 0.676 0.276
#> GSM613694     1  0.8565     0.0101 0.396 0.084 0.200 0.164 0.140 0.016
#> GSM613695     3  0.5768     0.5613 0.012 0.036 0.660 0.172 0.112 0.008
#> GSM613696     5  0.5051     0.4504 0.016 0.004 0.024 0.028 0.660 0.268
#> GSM613697     3  0.5584     0.4477 0.184 0.000 0.628 0.164 0.020 0.004
#> GSM613698     3  0.7398     0.2518 0.032 0.000 0.444 0.280 0.080 0.164
#> GSM613699     3  0.9627     0.2098 0.144 0.184 0.300 0.112 0.148 0.112
#> GSM613700     2  0.2796     0.4369 0.000 0.868 0.008 0.044 0.080 0.000
#> GSM613701     2  0.4012     0.2149 0.024 0.724 0.000 0.012 0.240 0.000
#> GSM613702     2  0.4667     0.2264 0.000 0.576 0.000 0.380 0.040 0.004
#> GSM613703     6  0.4924     0.1371 0.072 0.004 0.000 0.248 0.012 0.664
#> GSM613704     6  0.2742     0.4804 0.000 0.016 0.000 0.072 0.036 0.876
#> GSM613705     3  0.5871     0.4512 0.032 0.272 0.604 0.068 0.020 0.004
#> GSM613706     2  0.4312     0.4739 0.112 0.784 0.024 0.060 0.020 0.000
#> GSM613707     5  0.3841     0.6603 0.000 0.380 0.000 0.004 0.616 0.000
#> GSM613708     1  0.2955     0.6979 0.816 0.000 0.000 0.172 0.008 0.004
#> GSM613709     1  0.4675     0.5604 0.696 0.000 0.000 0.200 0.008 0.096
#> GSM613710     2  0.2573     0.4807 0.000 0.856 0.132 0.004 0.008 0.000
#> GSM613711     3  0.4977     0.4859 0.000 0.232 0.668 0.012 0.084 0.004
#> GSM613712     3  0.6459     0.4182 0.176 0.000 0.580 0.176 0.032 0.036
#> GSM613713     5  0.4651     0.7026 0.000 0.232 0.020 0.000 0.692 0.056
#> GSM613714     3  0.6959     0.3286 0.000 0.288 0.468 0.084 0.152 0.008
#> GSM613715     3  0.2996     0.6089 0.000 0.020 0.872 0.064 0.012 0.032
#> GSM613716     6  0.6651     0.3583 0.000 0.000 0.164 0.264 0.076 0.496
#> GSM613717     3  0.6521     0.3527 0.000 0.296 0.516 0.044 0.128 0.016
#> GSM613718     3  0.2734     0.6037 0.000 0.064 0.876 0.004 0.052 0.004
#> GSM613719     6  0.6738     0.4026 0.076 0.000 0.196 0.080 0.064 0.584
#> GSM613720     6  0.6886     0.3427 0.000 0.000 0.184 0.192 0.124 0.500
#> GSM613721     5  0.3955     0.4579 0.000 0.012 0.004 0.000 0.668 0.316
#> GSM613722     2  0.4442     0.4008 0.000 0.760 0.048 0.068 0.124 0.000
#> GSM613723     1  0.0405     0.7629 0.988 0.000 0.000 0.008 0.004 0.000
#> GSM613724     1  0.1606     0.7546 0.932 0.000 0.000 0.056 0.008 0.004
#> GSM613725     2  0.3183     0.2932 0.000 0.788 0.008 0.004 0.200 0.000
#> GSM613726     1  0.4735     0.5788 0.700 0.064 0.000 0.216 0.008 0.012
#> GSM613727     1  0.1124     0.7612 0.956 0.000 0.000 0.036 0.008 0.000
#> GSM613728     2  0.5899     0.2787 0.000 0.636 0.004 0.136 0.072 0.152
#> GSM613729     1  0.5570     0.3528 0.568 0.000 0.000 0.148 0.008 0.276
#> GSM613730     2  0.7847    -0.1815 0.000 0.356 0.052 0.264 0.068 0.260
#> GSM613731     4  0.6325     0.2724 0.272 0.280 0.008 0.436 0.004 0.000
#> GSM613732     3  0.2697     0.5962 0.000 0.004 0.872 0.092 0.028 0.004
#> GSM613733     2  0.5139    -0.0520 0.000 0.516 0.416 0.012 0.056 0.000
#> GSM613734     1  0.0291     0.7634 0.992 0.000 0.000 0.004 0.004 0.000
#> GSM613735     1  0.0520     0.7639 0.984 0.000 0.000 0.008 0.008 0.000
#> GSM613736     2  0.7924    -0.1387 0.000 0.304 0.264 0.156 0.260 0.016
#> GSM613737     3  0.8758     0.3089 0.204 0.060 0.408 0.136 0.128 0.064
#> GSM613738     1  0.4721     0.6176 0.752 0.000 0.064 0.132 0.020 0.032
#> GSM613739     1  0.5229     0.4407 0.632 0.000 0.220 0.140 0.008 0.000
#> GSM613740     3  0.5952     0.4640 0.000 0.176 0.616 0.004 0.152 0.052
#> GSM613741     6  0.2011     0.5333 0.000 0.000 0.004 0.020 0.064 0.912
#> GSM613742     1  0.6170     0.4444 0.608 0.000 0.124 0.204 0.028 0.036
#> GSM613743     3  0.6714     0.2761 0.000 0.320 0.460 0.028 0.172 0.020
#> GSM613744     3  0.2006     0.6103 0.000 0.060 0.916 0.004 0.016 0.004
#> GSM613745     6  0.6267     0.3841 0.004 0.008 0.048 0.244 0.120 0.576
#> GSM613746     6  0.4063     0.0651 0.000 0.000 0.004 0.004 0.420 0.572
#> GSM613747     1  0.0622     0.7629 0.980 0.000 0.000 0.012 0.008 0.000
#> GSM613748     2  0.5271     0.2498 0.000 0.608 0.032 0.316 0.024 0.020
#> GSM613749     2  0.6847    -0.0794 0.084 0.456 0.000 0.360 0.032 0.068
#> GSM613750     3  0.2711     0.6034 0.000 0.012 0.872 0.004 0.096 0.016
#> GSM613751     3  0.3237     0.5926 0.000 0.036 0.836 0.004 0.116 0.008
#> GSM613752     3  0.3272     0.5879 0.000 0.020 0.820 0.000 0.144 0.016
#> GSM613753     3  0.2293     0.6094 0.000 0.004 0.896 0.016 0.080 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-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 disease.state(p) k
#> MAD:NMF 114           0.0403 2
#> MAD:NMF 101           0.0436 3
#> MAD:NMF 106           0.3869 4
#> MAD:NMF  87           0.2175 5
#> MAD:NMF  50           0.3268 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 27425 rows and 116 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.354           0.697       0.867         0.4478 0.505   0.505
#> 3 3 0.511           0.676       0.840         0.4178 0.635   0.414
#> 4 4 0.624           0.669       0.810         0.1490 0.838   0.587
#> 5 5 0.712           0.645       0.819         0.0551 0.942   0.789
#> 6 6 0.760           0.619       0.768         0.0340 0.903   0.636

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
#> GSM613638     1  0.9170      0.546 0.668 0.332
#> GSM613639     1  0.6887      0.777 0.816 0.184
#> GSM613640     1  0.7453      0.750 0.788 0.212
#> GSM613641     1  0.0000      0.844 1.000 0.000
#> GSM613642     1  0.6801      0.780 0.820 0.180
#> GSM613643     1  0.8144      0.698 0.748 0.252
#> GSM613644     1  0.8016      0.709 0.756 0.244
#> GSM613645     1  0.0000      0.844 1.000 0.000
#> GSM613646     2  0.9944      0.209 0.456 0.544
#> GSM613647     2  0.0000      0.794 0.000 1.000
#> GSM613648     2  0.0000      0.794 0.000 1.000
#> GSM613649     2  0.0000      0.794 0.000 1.000
#> GSM613650     2  0.9909      0.247 0.444 0.556
#> GSM613651     2  0.0000      0.794 0.000 1.000
#> GSM613652     2  0.0000      0.794 0.000 1.000
#> GSM613653     2  0.9993      0.098 0.484 0.516
#> GSM613654     2  0.0000      0.794 0.000 1.000
#> GSM613655     1  0.5519      0.817 0.872 0.128
#> GSM613656     2  0.0000      0.794 0.000 1.000
#> GSM613657     2  0.7815      0.635 0.232 0.768
#> GSM613658     1  0.9580      0.423 0.620 0.380
#> GSM613659     1  0.7056      0.770 0.808 0.192
#> GSM613660     1  0.7528      0.746 0.784 0.216
#> GSM613661     1  0.5178      0.822 0.884 0.116
#> GSM613662     1  0.0000      0.844 1.000 0.000
#> GSM613663     1  0.5178      0.822 0.884 0.116
#> GSM613664     1  0.0000      0.844 1.000 0.000
#> GSM613665     1  0.0000      0.844 1.000 0.000
#> GSM613666     1  0.0000      0.844 1.000 0.000
#> GSM613667     1  0.0000      0.844 1.000 0.000
#> GSM613668     1  0.4939      0.825 0.892 0.108
#> GSM613669     1  0.0000      0.844 1.000 0.000
#> GSM613670     1  0.0000      0.844 1.000 0.000
#> GSM613671     1  0.0000      0.844 1.000 0.000
#> GSM613672     1  0.2778      0.839 0.952 0.048
#> GSM613673     1  0.0000      0.844 1.000 0.000
#> GSM613674     1  0.0000      0.844 1.000 0.000
#> GSM613675     1  0.4815      0.827 0.896 0.104
#> GSM613676     1  0.4939      0.825 0.892 0.108
#> GSM613677     1  0.8207      0.691 0.744 0.256
#> GSM613678     1  0.0000      0.844 1.000 0.000
#> GSM613679     1  0.0000      0.844 1.000 0.000
#> GSM613680     1  0.0376      0.844 0.996 0.004
#> GSM613681     1  0.0376      0.844 0.996 0.004
#> GSM613682     1  0.5737      0.812 0.864 0.136
#> GSM613683     1  0.8763      0.622 0.704 0.296
#> GSM613684     1  0.7376      0.751 0.792 0.208
#> GSM613685     1  0.0000      0.844 1.000 0.000
#> GSM613686     1  0.0000      0.844 1.000 0.000
#> GSM613687     1  0.0376      0.844 0.996 0.004
#> GSM613688     1  0.6801      0.780 0.820 0.180
#> GSM613689     2  0.9686      0.371 0.396 0.604
#> GSM613690     2  0.0000      0.794 0.000 1.000
#> GSM613691     1  0.9954      0.139 0.540 0.460
#> GSM613692     2  0.0000      0.794 0.000 1.000
#> GSM613693     2  0.9970      0.167 0.468 0.532
#> GSM613694     2  0.9833      0.304 0.424 0.576
#> GSM613695     2  0.0000      0.794 0.000 1.000
#> GSM613696     2  0.9044      0.517 0.320 0.680
#> GSM613697     2  0.0000      0.794 0.000 1.000
#> GSM613698     2  0.0000      0.794 0.000 1.000
#> GSM613699     2  0.9710      0.362 0.400 0.600
#> GSM613700     1  0.0000      0.844 1.000 0.000
#> GSM613701     1  0.0000      0.844 1.000 0.000
#> GSM613702     1  0.0000      0.844 1.000 0.000
#> GSM613703     1  0.0000      0.844 1.000 0.000
#> GSM613704     1  0.0000      0.844 1.000 0.000
#> GSM613705     1  0.9209      0.537 0.664 0.336
#> GSM613706     1  0.7376      0.754 0.792 0.208
#> GSM613707     1  0.2603      0.839 0.956 0.044
#> GSM613708     1  0.8016      0.709 0.756 0.244
#> GSM613709     1  0.0000      0.844 1.000 0.000
#> GSM613710     1  0.6801      0.780 0.820 0.180
#> GSM613711     2  0.8386      0.596 0.268 0.732
#> GSM613712     2  0.0000      0.794 0.000 1.000
#> GSM613713     2  0.9970      0.167 0.468 0.532
#> GSM613714     2  0.7950      0.627 0.240 0.760
#> GSM613715     2  0.0000      0.794 0.000 1.000
#> GSM613716     2  0.9833      0.303 0.424 0.576
#> GSM613717     2  0.8386      0.596 0.268 0.732
#> GSM613718     2  0.0000      0.794 0.000 1.000
#> GSM613719     2  0.0000      0.794 0.000 1.000
#> GSM613720     2  0.0000      0.794 0.000 1.000
#> GSM613721     2  0.9970      0.167 0.468 0.532
#> GSM613722     1  0.0000      0.844 1.000 0.000
#> GSM613723     2  0.0000      0.794 0.000 1.000
#> GSM613724     1  0.9580      0.423 0.620 0.380
#> GSM613725     1  0.0000      0.844 1.000 0.000
#> GSM613726     1  0.5294      0.820 0.880 0.120
#> GSM613727     1  0.0000      0.844 1.000 0.000
#> GSM613728     1  0.0000      0.844 1.000 0.000
#> GSM613729     1  0.0000      0.844 1.000 0.000
#> GSM613730     1  0.7528      0.746 0.784 0.216
#> GSM613731     1  0.5294      0.820 0.880 0.120
#> GSM613732     2  0.0000      0.794 0.000 1.000
#> GSM613733     1  0.9944      0.156 0.544 0.456
#> GSM613734     1  0.9833      0.281 0.576 0.424
#> GSM613735     2  0.0000      0.794 0.000 1.000
#> GSM613736     2  0.8327      0.601 0.264 0.736
#> GSM613737     2  0.0000      0.794 0.000 1.000
#> GSM613738     2  0.0000      0.794 0.000 1.000
#> GSM613739     2  0.0000      0.794 0.000 1.000
#> GSM613740     2  0.0000      0.794 0.000 1.000
#> GSM613741     2  0.9954      0.196 0.460 0.540
#> GSM613742     2  0.0000      0.794 0.000 1.000
#> GSM613743     2  0.8327      0.601 0.264 0.736
#> GSM613744     2  0.0000      0.794 0.000 1.000
#> GSM613745     2  0.9944      0.209 0.456 0.544
#> GSM613746     2  0.9970      0.167 0.468 0.532
#> GSM613747     1  0.9833      0.281 0.576 0.424
#> GSM613748     1  0.4815      0.827 0.896 0.104
#> GSM613749     1  0.0000      0.844 1.000 0.000
#> GSM613750     2  0.0000      0.794 0.000 1.000
#> GSM613751     2  0.0000      0.794 0.000 1.000
#> GSM613752     2  0.0000      0.794 0.000 1.000
#> GSM613753     2  0.0000      0.794 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
#> GSM613638     1  0.2297     0.6711 0.944 0.020 0.036
#> GSM613639     1  0.3983     0.6236 0.852 0.144 0.004
#> GSM613640     1  0.3500     0.6406 0.880 0.116 0.004
#> GSM613641     2  0.4842     0.6765 0.224 0.776 0.000
#> GSM613642     1  0.4842     0.5519 0.776 0.224 0.000
#> GSM613643     1  0.3031     0.6577 0.912 0.076 0.012
#> GSM613644     1  0.2682     0.6537 0.920 0.076 0.004
#> GSM613645     2  0.6309     0.1849 0.500 0.500 0.000
#> GSM613646     1  0.5502     0.6502 0.744 0.008 0.248
#> GSM613647     3  0.0424     0.9905 0.008 0.000 0.992
#> GSM613648     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613649     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613650     1  0.5443     0.6386 0.736 0.004 0.260
#> GSM613651     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613652     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613653     1  0.5202     0.6636 0.772 0.008 0.220
#> GSM613654     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613655     1  0.5016     0.5099 0.760 0.240 0.000
#> GSM613656     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613657     1  0.6309     0.1906 0.504 0.000 0.496
#> GSM613658     1  0.2625     0.6776 0.916 0.000 0.084
#> GSM613659     1  0.4047     0.6257 0.848 0.148 0.004
#> GSM613660     1  0.3682     0.6432 0.876 0.116 0.008
#> GSM613661     1  0.5216     0.4865 0.740 0.260 0.000
#> GSM613662     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613663     1  0.5254     0.4800 0.736 0.264 0.000
#> GSM613664     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613665     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613666     2  0.6126     0.4106 0.400 0.600 0.000
#> GSM613667     1  0.6308    -0.1894 0.508 0.492 0.000
#> GSM613668     1  0.5465     0.4299 0.712 0.288 0.000
#> GSM613669     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613670     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613671     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613672     1  0.5968     0.2470 0.636 0.364 0.000
#> GSM613673     2  0.6305     0.2211 0.484 0.516 0.000
#> GSM613674     2  0.5591     0.5675 0.304 0.696 0.000
#> GSM613675     1  0.5678     0.4103 0.684 0.316 0.000
#> GSM613676     1  0.5650     0.4187 0.688 0.312 0.000
#> GSM613677     1  0.3183     0.6593 0.908 0.076 0.016
#> GSM613678     1  0.6309    -0.1626 0.504 0.496 0.000
#> GSM613679     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613680     1  0.6267    -0.0494 0.548 0.452 0.000
#> GSM613681     1  0.6267    -0.0494 0.548 0.452 0.000
#> GSM613682     1  0.4974     0.5240 0.764 0.236 0.000
#> GSM613683     1  0.3899     0.6711 0.888 0.056 0.056
#> GSM613684     1  0.3918     0.6325 0.856 0.140 0.004
#> GSM613685     2  0.5591     0.5675 0.304 0.696 0.000
#> GSM613686     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613687     1  0.6267    -0.0494 0.548 0.452 0.000
#> GSM613688     1  0.4233     0.6185 0.836 0.160 0.004
#> GSM613689     1  0.5929     0.5742 0.676 0.004 0.320
#> GSM613690     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613691     1  0.4921     0.6745 0.816 0.020 0.164
#> GSM613692     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613693     1  0.5378     0.6593 0.756 0.008 0.236
#> GSM613694     1  0.5623     0.6189 0.716 0.004 0.280
#> GSM613695     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613696     1  0.6079     0.4589 0.612 0.000 0.388
#> GSM613697     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613698     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613699     1  0.5815     0.5911 0.692 0.004 0.304
#> GSM613700     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613701     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613702     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613703     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613704     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613705     1  0.2414     0.6720 0.940 0.020 0.040
#> GSM613706     1  0.3573     0.6385 0.876 0.120 0.004
#> GSM613707     2  0.6095     0.3941 0.392 0.608 0.000
#> GSM613708     1  0.2682     0.6537 0.920 0.076 0.004
#> GSM613709     2  0.6309     0.1849 0.500 0.500 0.000
#> GSM613710     1  0.4842     0.5519 0.776 0.224 0.000
#> GSM613711     1  0.6235     0.3487 0.564 0.000 0.436
#> GSM613712     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613713     1  0.5378     0.6593 0.756 0.008 0.236
#> GSM613714     1  0.6286     0.2753 0.536 0.000 0.464
#> GSM613715     3  0.0424     0.9905 0.008 0.000 0.992
#> GSM613716     1  0.5623     0.6171 0.716 0.004 0.280
#> GSM613717     1  0.6235     0.3487 0.564 0.000 0.436
#> GSM613718     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613719     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613720     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613721     1  0.5378     0.6593 0.756 0.008 0.236
#> GSM613722     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613723     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613724     1  0.2625     0.6776 0.916 0.000 0.084
#> GSM613725     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613726     1  0.5138     0.5112 0.748 0.252 0.000
#> GSM613727     2  0.5968     0.4834 0.364 0.636 0.000
#> GSM613728     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613729     2  0.3941     0.7404 0.156 0.844 0.000
#> GSM613730     1  0.3682     0.6432 0.876 0.116 0.008
#> GSM613731     1  0.5138     0.5112 0.748 0.252 0.000
#> GSM613732     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613733     1  0.4862     0.6751 0.820 0.020 0.160
#> GSM613734     1  0.3482     0.6778 0.872 0.000 0.128
#> GSM613735     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613736     1  0.6252     0.3316 0.556 0.000 0.444
#> GSM613737     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613738     3  0.0237     0.9952 0.004 0.000 0.996
#> GSM613739     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613740     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613741     1  0.5461     0.6533 0.748 0.008 0.244
#> GSM613742     3  0.0237     0.9952 0.004 0.000 0.996
#> GSM613743     1  0.6252     0.3316 0.556 0.000 0.444
#> GSM613744     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613745     1  0.5502     0.6502 0.744 0.008 0.248
#> GSM613746     1  0.5378     0.6593 0.756 0.008 0.236
#> GSM613747     1  0.3482     0.6778 0.872 0.000 0.128
#> GSM613748     1  0.5678     0.4103 0.684 0.316 0.000
#> GSM613749     2  0.0000     0.8316 0.000 1.000 0.000
#> GSM613750     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613751     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613752     3  0.0000     0.9990 0.000 0.000 1.000
#> GSM613753     3  0.0000     0.9990 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
#> GSM613638     4  0.4855    0.00209 0.400 0.000 0.000 0.600
#> GSM613639     1  0.5721    0.59296 0.660 0.056 0.000 0.284
#> GSM613640     1  0.5182    0.57859 0.684 0.028 0.000 0.288
#> GSM613641     2  0.4290    0.58550 0.212 0.772 0.000 0.016
#> GSM613642     1  0.6634    0.55815 0.592 0.116 0.000 0.292
#> GSM613643     1  0.4877    0.45543 0.592 0.000 0.000 0.408
#> GSM613644     1  0.4790    0.49079 0.620 0.000 0.000 0.380
#> GSM613645     1  0.5466    0.17020 0.548 0.436 0.000 0.016
#> GSM613646     4  0.2198    0.75302 0.008 0.000 0.072 0.920
#> GSM613647     3  0.0336    0.99080 0.000 0.000 0.992 0.008
#> GSM613648     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613649     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613650     4  0.2266    0.75686 0.004 0.000 0.084 0.912
#> GSM613651     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613652     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613653     4  0.2670    0.70019 0.072 0.000 0.024 0.904
#> GSM613654     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613655     1  0.5417    0.56045 0.732 0.180 0.000 0.088
#> GSM613656     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613657     4  0.4978    0.54120 0.004 0.000 0.384 0.612
#> GSM613658     1  0.4948    0.05574 0.560 0.000 0.000 0.440
#> GSM613659     1  0.6000    0.54535 0.592 0.052 0.000 0.356
#> GSM613660     1  0.5478    0.54418 0.628 0.028 0.000 0.344
#> GSM613661     1  0.4956    0.55536 0.756 0.188 0.000 0.056
#> GSM613662     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613663     1  0.4996    0.55257 0.752 0.192 0.000 0.056
#> GSM613664     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613665     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613666     2  0.5268    0.26608 0.396 0.592 0.000 0.012
#> GSM613667     1  0.5503    0.05746 0.516 0.468 0.000 0.016
#> GSM613668     1  0.5090    0.51171 0.728 0.228 0.000 0.044
#> GSM613669     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613670     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613671     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613672     1  0.5254    0.42544 0.672 0.300 0.000 0.028
#> GSM613673     1  0.5512   -0.01536 0.492 0.492 0.000 0.016
#> GSM613674     2  0.7201    0.28916 0.224 0.552 0.000 0.224
#> GSM613675     1  0.7433    0.56492 0.504 0.208 0.000 0.288
#> GSM613676     1  0.7407    0.56617 0.508 0.204 0.000 0.288
#> GSM613677     1  0.4907    0.43545 0.580 0.000 0.000 0.420
#> GSM613678     2  0.7796   -0.34163 0.360 0.392 0.000 0.248
#> GSM613679     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613680     1  0.5244    0.27805 0.600 0.388 0.000 0.012
#> GSM613681     1  0.5244    0.27805 0.600 0.388 0.000 0.012
#> GSM613682     1  0.4955    0.56087 0.772 0.144 0.000 0.084
#> GSM613683     1  0.3942    0.47923 0.764 0.000 0.000 0.236
#> GSM613684     1  0.4713    0.47263 0.640 0.000 0.000 0.360
#> GSM613685     2  0.7201    0.28916 0.224 0.552 0.000 0.224
#> GSM613686     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613687     1  0.5244    0.27805 0.600 0.388 0.000 0.012
#> GSM613688     1  0.5742    0.50788 0.596 0.036 0.000 0.368
#> GSM613689     4  0.3668    0.73218 0.004 0.000 0.188 0.808
#> GSM613690     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613691     4  0.3447    0.62717 0.128 0.000 0.020 0.852
#> GSM613692     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613693     4  0.1677    0.73954 0.012 0.000 0.040 0.948
#> GSM613694     4  0.2714    0.75637 0.004 0.000 0.112 0.884
#> GSM613695     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613696     4  0.4428    0.68500 0.004 0.000 0.276 0.720
#> GSM613697     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613698     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613699     4  0.3257    0.74832 0.004 0.000 0.152 0.844
#> GSM613700     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613701     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613702     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613703     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613704     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613705     4  0.4843    0.01803 0.396 0.000 0.000 0.604
#> GSM613706     1  0.5272    0.57978 0.680 0.032 0.000 0.288
#> GSM613707     2  0.7687   -0.02951 0.348 0.428 0.000 0.224
#> GSM613708     1  0.4790    0.49079 0.620 0.000 0.000 0.380
#> GSM613709     1  0.5466    0.17020 0.548 0.436 0.000 0.016
#> GSM613710     1  0.6634    0.55815 0.592 0.116 0.000 0.292
#> GSM613711     4  0.4535    0.67823 0.004 0.000 0.292 0.704
#> GSM613712     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613713     4  0.1677    0.73954 0.012 0.000 0.040 0.948
#> GSM613714     4  0.4699    0.64919 0.004 0.000 0.320 0.676
#> GSM613715     3  0.0336    0.99080 0.000 0.000 0.992 0.008
#> GSM613716     4  0.2593    0.75866 0.004 0.000 0.104 0.892
#> GSM613717     4  0.4535    0.67823 0.004 0.000 0.292 0.704
#> GSM613718     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613719     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613720     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613721     4  0.1677    0.73954 0.012 0.000 0.040 0.948
#> GSM613722     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613723     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613724     1  0.4948    0.05574 0.560 0.000 0.000 0.440
#> GSM613725     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613726     1  0.6613    0.62518 0.628 0.172 0.000 0.200
#> GSM613727     2  0.5127    0.37574 0.356 0.632 0.000 0.012
#> GSM613728     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613729     2  0.3479    0.68216 0.148 0.840 0.000 0.012
#> GSM613730     1  0.5495    0.54085 0.624 0.028 0.000 0.348
#> GSM613731     1  0.6613    0.62518 0.628 0.172 0.000 0.200
#> GSM613732     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613733     4  0.3335    0.62447 0.128 0.000 0.016 0.856
#> GSM613734     4  0.4925    0.26612 0.428 0.000 0.000 0.572
#> GSM613735     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613736     4  0.4608    0.66942 0.004 0.000 0.304 0.692
#> GSM613737     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613738     3  0.0188    0.99517 0.000 0.000 0.996 0.004
#> GSM613739     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613740     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613741     4  0.2376    0.75213 0.016 0.000 0.068 0.916
#> GSM613742     3  0.0188    0.99517 0.000 0.000 0.996 0.004
#> GSM613743     4  0.4608    0.66942 0.004 0.000 0.304 0.692
#> GSM613744     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613745     4  0.2329    0.75344 0.012 0.000 0.072 0.916
#> GSM613746     4  0.1677    0.73954 0.012 0.000 0.040 0.948
#> GSM613747     4  0.4925    0.26612 0.428 0.000 0.000 0.572
#> GSM613748     1  0.7433    0.56492 0.504 0.208 0.000 0.288
#> GSM613749     2  0.0000    0.83565 0.000 1.000 0.000 0.000
#> GSM613750     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613751     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613752     3  0.0000    0.99898 0.000 0.000 1.000 0.000
#> GSM613753     3  0.0000    0.99898 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
#> GSM613638     1  0.6631     0.1582 0.452 0.000 0.292 0.256 0.000
#> GSM613639     1  0.4518     0.3728 0.732 0.004 0.048 0.216 0.000
#> GSM613640     1  0.4589     0.3664 0.704 0.000 0.048 0.248 0.000
#> GSM613641     2  0.3861     0.5948 0.264 0.728 0.000 0.008 0.000
#> GSM613642     1  0.4924     0.1777 0.552 0.000 0.028 0.420 0.000
#> GSM613643     1  0.5776     0.2878 0.588 0.000 0.124 0.288 0.000
#> GSM613644     1  0.5613     0.2984 0.604 0.000 0.108 0.288 0.000
#> GSM613645     1  0.5233     0.2802 0.636 0.288 0.000 0.076 0.000
#> GSM613646     3  0.1989     0.7868 0.020 0.000 0.932 0.016 0.032
#> GSM613647     5  0.0290     0.9907 0.000 0.000 0.008 0.000 0.992
#> GSM613648     5  0.0162     0.9955 0.000 0.000 0.004 0.000 0.996
#> GSM613649     5  0.0162     0.9955 0.000 0.000 0.004 0.000 0.996
#> GSM613650     3  0.1988     0.7927 0.016 0.000 0.928 0.008 0.048
#> GSM613651     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613652     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613653     3  0.2504     0.7187 0.064 0.000 0.896 0.040 0.000
#> GSM613654     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613655     1  0.2859     0.4168 0.876 0.096 0.016 0.012 0.000
#> GSM613656     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613657     3  0.4999     0.6049 0.004 0.000 0.604 0.032 0.360
#> GSM613658     1  0.5390     0.2337 0.600 0.000 0.324 0.076 0.000
#> GSM613659     1  0.5275     0.2674 0.640 0.004 0.068 0.288 0.000
#> GSM613660     1  0.5361     0.3311 0.648 0.004 0.084 0.264 0.000
#> GSM613661     1  0.2305     0.4134 0.896 0.092 0.000 0.012 0.000
#> GSM613662     2  0.0404     0.9061 0.012 0.988 0.000 0.000 0.000
#> GSM613663     1  0.2361     0.4135 0.892 0.096 0.000 0.012 0.000
#> GSM613664     2  0.0000     0.9069 0.000 1.000 0.000 0.000 0.000
#> GSM613665     2  0.0404     0.9061 0.012 0.988 0.000 0.000 0.000
#> GSM613666     2  0.4546     0.2128 0.460 0.532 0.000 0.008 0.000
#> GSM613667     1  0.4866     0.1552 0.580 0.392 0.000 0.028 0.000
#> GSM613668     1  0.2753     0.3998 0.856 0.136 0.000 0.008 0.000
#> GSM613669     2  0.0000     0.9069 0.000 1.000 0.000 0.000 0.000
#> GSM613670     2  0.0000     0.9069 0.000 1.000 0.000 0.000 0.000
#> GSM613671     2  0.0000     0.9069 0.000 1.000 0.000 0.000 0.000
#> GSM613672     1  0.3805     0.3697 0.784 0.184 0.000 0.032 0.000
#> GSM613673     1  0.4833     0.0997 0.564 0.412 0.000 0.024 0.000
#> GSM613674     4  0.4229     0.6682 0.104 0.104 0.004 0.788 0.000
#> GSM613675     1  0.5119     0.1578 0.576 0.008 0.028 0.388 0.000
#> GSM613676     1  0.5109     0.1627 0.580 0.008 0.028 0.384 0.000
#> GSM613677     1  0.5905     0.2750 0.572 0.000 0.136 0.292 0.000
#> GSM613678     1  0.7033     0.0153 0.440 0.172 0.028 0.360 0.000
#> GSM613679     2  0.0000     0.9069 0.000 1.000 0.000 0.000 0.000
#> GSM613680     1  0.4959     0.3151 0.684 0.240 0.000 0.076 0.000
#> GSM613681     1  0.4959     0.3151 0.684 0.240 0.000 0.076 0.000
#> GSM613682     1  0.5136     0.3135 0.736 0.084 0.032 0.148 0.000
#> GSM613683     1  0.4410     0.3673 0.764 0.000 0.124 0.112 0.000
#> GSM613684     4  0.5847    -0.1467 0.424 0.000 0.096 0.480 0.000
#> GSM613685     4  0.4229     0.6682 0.104 0.104 0.004 0.788 0.000
#> GSM613686     2  0.0000     0.9069 0.000 1.000 0.000 0.000 0.000
#> GSM613687     1  0.4959     0.3151 0.684 0.240 0.000 0.076 0.000
#> GSM613688     1  0.5691     0.0692 0.536 0.000 0.088 0.376 0.000
#> GSM613689     3  0.3853     0.7738 0.008 0.000 0.804 0.036 0.152
#> GSM613690     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613691     3  0.4959     0.5286 0.160 0.000 0.712 0.128 0.000
#> GSM613692     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613693     3  0.1124     0.7571 0.004 0.000 0.960 0.036 0.000
#> GSM613694     3  0.3089     0.7915 0.012 0.000 0.872 0.040 0.076
#> GSM613695     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613696     3  0.4532     0.7193 0.004 0.000 0.712 0.036 0.248
#> GSM613697     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613698     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613699     3  0.3446     0.7869 0.008 0.000 0.840 0.036 0.116
#> GSM613700     2  0.0000     0.9069 0.000 1.000 0.000 0.000 0.000
#> GSM613701     2  0.0404     0.9061 0.012 0.988 0.000 0.000 0.000
#> GSM613702     2  0.0404     0.9061 0.012 0.988 0.000 0.000 0.000
#> GSM613703     2  0.0000     0.9069 0.000 1.000 0.000 0.000 0.000
#> GSM613704     2  0.0000     0.9069 0.000 1.000 0.000 0.000 0.000
#> GSM613705     1  0.6627     0.1564 0.452 0.000 0.296 0.252 0.000
#> GSM613706     1  0.4717     0.3675 0.704 0.004 0.048 0.244 0.000
#> GSM613707     4  0.2921     0.6233 0.148 0.004 0.004 0.844 0.000
#> GSM613708     1  0.5613     0.2984 0.604 0.000 0.108 0.288 0.000
#> GSM613709     1  0.5233     0.2802 0.636 0.288 0.000 0.076 0.000
#> GSM613710     1  0.4924     0.1777 0.552 0.000 0.028 0.420 0.000
#> GSM613711     3  0.4928     0.7176 0.012 0.000 0.684 0.040 0.264
#> GSM613712     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613713     3  0.1124     0.7611 0.004 0.000 0.960 0.036 0.000
#> GSM613714     3  0.5011     0.6927 0.012 0.000 0.660 0.036 0.292
#> GSM613715     5  0.0290     0.9907 0.000 0.000 0.008 0.000 0.992
#> GSM613716     3  0.2331     0.7961 0.016 0.000 0.908 0.008 0.068
#> GSM613717     3  0.4782     0.7193 0.012 0.000 0.692 0.032 0.264
#> GSM613718     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613719     5  0.0162     0.9955 0.000 0.000 0.004 0.000 0.996
#> GSM613720     5  0.0162     0.9955 0.000 0.000 0.004 0.000 0.996
#> GSM613721     3  0.1124     0.7571 0.004 0.000 0.960 0.036 0.000
#> GSM613722     2  0.0404     0.9061 0.012 0.988 0.000 0.000 0.000
#> GSM613723     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613724     1  0.5390     0.2337 0.600 0.000 0.324 0.076 0.000
#> GSM613725     2  0.0290     0.9066 0.008 0.992 0.000 0.000 0.000
#> GSM613726     1  0.4527     0.4060 0.780 0.080 0.020 0.120 0.000
#> GSM613727     2  0.4455     0.3608 0.404 0.588 0.000 0.008 0.000
#> GSM613728     2  0.0404     0.9061 0.012 0.988 0.000 0.000 0.000
#> GSM613729     2  0.3353     0.6922 0.196 0.796 0.000 0.008 0.000
#> GSM613730     1  0.5455     0.3302 0.636 0.004 0.088 0.272 0.000
#> GSM613731     1  0.4527     0.4060 0.780 0.080 0.020 0.120 0.000
#> GSM613732     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613733     3  0.5237     0.4884 0.160 0.000 0.684 0.156 0.000
#> GSM613734     1  0.5295    -0.1105 0.488 0.000 0.464 0.048 0.000
#> GSM613735     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613736     3  0.4997     0.7081 0.012 0.000 0.672 0.040 0.276
#> GSM613737     5  0.0162     0.9955 0.000 0.000 0.004 0.000 0.996
#> GSM613738     5  0.0162     0.9949 0.000 0.000 0.004 0.000 0.996
#> GSM613739     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613740     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613741     3  0.2450     0.7843 0.028 0.000 0.912 0.028 0.032
#> GSM613742     5  0.0162     0.9949 0.000 0.000 0.004 0.000 0.996
#> GSM613743     3  0.4997     0.7081 0.012 0.000 0.672 0.040 0.276
#> GSM613744     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613745     3  0.2362     0.7850 0.024 0.000 0.916 0.028 0.032
#> GSM613746     3  0.1124     0.7571 0.004 0.000 0.960 0.036 0.000
#> GSM613747     1  0.5295    -0.1105 0.488 0.000 0.464 0.048 0.000
#> GSM613748     1  0.5119     0.1578 0.576 0.008 0.028 0.388 0.000
#> GSM613749     2  0.0162     0.9069 0.004 0.996 0.000 0.000 0.000
#> GSM613750     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613751     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613752     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.000
#> GSM613753     5  0.0000     0.9981 0.000 0.000 0.000 0.000 1.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
#> GSM613638     4  0.4029     0.5352 0.220 0.000 0.032 0.736 0.000 0.012
#> GSM613639     4  0.3764     0.6431 0.160 0.000 0.012 0.784 0.000 0.044
#> GSM613640     4  0.3257     0.6617 0.152 0.000 0.012 0.816 0.000 0.020
#> GSM613641     2  0.4811     0.5770 0.196 0.704 0.000 0.064 0.000 0.036
#> GSM613642     4  0.2668     0.6626 0.004 0.000 0.000 0.828 0.000 0.168
#> GSM613643     4  0.1820     0.6967 0.044 0.000 0.012 0.928 0.000 0.016
#> GSM613644     4  0.1332     0.7035 0.008 0.000 0.012 0.952 0.000 0.028
#> GSM613645     1  0.7367     0.3119 0.400 0.256 0.000 0.184 0.000 0.160
#> GSM613646     3  0.4749     0.6984 0.176 0.000 0.716 0.076 0.032 0.000
#> GSM613647     5  0.0260     0.9682 0.008 0.000 0.000 0.000 0.992 0.000
#> GSM613648     5  0.0146     0.9715 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM613649     5  0.0146     0.9715 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM613650     3  0.5103     0.6943 0.196 0.000 0.684 0.072 0.048 0.000
#> GSM613651     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613652     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613653     3  0.3098     0.4784 0.164 0.000 0.812 0.000 0.000 0.024
#> GSM613654     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613655     1  0.6360     0.2069 0.496 0.076 0.000 0.328 0.000 0.100
#> GSM613656     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613657     5  0.6807    -0.4060 0.296 0.000 0.312 0.024 0.360 0.008
#> GSM613658     1  0.3230     0.2268 0.776 0.000 0.012 0.212 0.000 0.000
#> GSM613659     4  0.3400     0.6991 0.044 0.000 0.008 0.816 0.000 0.132
#> GSM613660     4  0.2790     0.7060 0.080 0.000 0.028 0.872 0.000 0.020
#> GSM613661     1  0.6448     0.0995 0.420 0.072 0.000 0.404 0.000 0.104
#> GSM613662     2  0.0363     0.8652 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM613663     1  0.6486     0.1066 0.420 0.076 0.000 0.400 0.000 0.104
#> GSM613664     2  0.0000     0.8631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613665     2  0.0363     0.8652 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM613666     2  0.6041     0.1991 0.348 0.512 0.000 0.072 0.000 0.068
#> GSM613667     1  0.6780     0.1467 0.420 0.360 0.000 0.128 0.000 0.092
#> GSM613668     1  0.6752     0.2287 0.452 0.116 0.000 0.328 0.000 0.104
#> GSM613669     2  0.0508     0.8609 0.012 0.984 0.000 0.000 0.000 0.004
#> GSM613670     2  0.0000     0.8631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613671     2  0.0508     0.8609 0.012 0.984 0.000 0.000 0.000 0.004
#> GSM613672     1  0.7158     0.2785 0.424 0.156 0.000 0.284 0.000 0.136
#> GSM613673     2  0.6824    -0.1567 0.388 0.388 0.000 0.128 0.000 0.096
#> GSM613674     6  0.2504     0.9163 0.004 0.088 0.000 0.028 0.000 0.880
#> GSM613675     4  0.3494     0.6203 0.012 0.000 0.000 0.736 0.000 0.252
#> GSM613676     4  0.3470     0.6247 0.012 0.000 0.000 0.740 0.000 0.248
#> GSM613677     4  0.2164     0.6892 0.060 0.000 0.012 0.908 0.000 0.020
#> GSM613678     4  0.5993     0.3573 0.032 0.148 0.000 0.552 0.000 0.268
#> GSM613679     2  0.0000     0.8631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613680     1  0.7411     0.3224 0.400 0.208 0.000 0.224 0.000 0.168
#> GSM613681     1  0.7411     0.3224 0.400 0.208 0.000 0.224 0.000 0.168
#> GSM613682     4  0.7066    -0.0784 0.352 0.080 0.000 0.356 0.000 0.212
#> GSM613683     1  0.4045    -0.0163 0.564 0.000 0.000 0.428 0.000 0.008
#> GSM613684     4  0.3692     0.5157 0.008 0.000 0.012 0.736 0.000 0.244
#> GSM613685     6  0.2504     0.9163 0.004 0.088 0.000 0.028 0.000 0.880
#> GSM613686     2  0.0146     0.8640 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM613687     1  0.7411     0.3224 0.400 0.208 0.000 0.224 0.000 0.168
#> GSM613688     4  0.3616     0.6156 0.012 0.000 0.008 0.748 0.000 0.232
#> GSM613689     3  0.6776     0.5392 0.316 0.000 0.464 0.060 0.152 0.008
#> GSM613690     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613691     3  0.5317     0.4730 0.112 0.000 0.568 0.316 0.000 0.004
#> GSM613692     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613693     3  0.0508     0.6273 0.004 0.000 0.984 0.000 0.000 0.012
#> GSM613694     3  0.6329     0.5725 0.356 0.000 0.492 0.068 0.076 0.008
#> GSM613695     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613696     3  0.7000     0.4209 0.320 0.000 0.380 0.044 0.248 0.008
#> GSM613697     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613698     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613699     3  0.6579     0.5531 0.344 0.000 0.472 0.060 0.116 0.008
#> GSM613700     2  0.0000     0.8631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613701     2  0.0363     0.8652 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM613702     2  0.0363     0.8652 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM613703     2  0.0146     0.8640 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM613704     2  0.0000     0.8631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613705     4  0.4056     0.5316 0.224 0.000 0.032 0.732 0.000 0.012
#> GSM613706     4  0.3411     0.6565 0.160 0.000 0.012 0.804 0.000 0.024
#> GSM613707     6  0.1957     0.8183 0.000 0.000 0.000 0.112 0.000 0.888
#> GSM613708     4  0.1332     0.7035 0.008 0.000 0.012 0.952 0.000 0.028
#> GSM613709     1  0.7367     0.3119 0.400 0.256 0.000 0.184 0.000 0.160
#> GSM613710     4  0.2778     0.6632 0.008 0.000 0.000 0.824 0.000 0.168
#> GSM613711     1  0.7267    -0.3917 0.360 0.000 0.300 0.068 0.264 0.008
#> GSM613712     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613713     3  0.1053     0.6366 0.020 0.000 0.964 0.004 0.000 0.012
#> GSM613714     1  0.7239    -0.3657 0.360 0.000 0.276 0.064 0.292 0.008
#> GSM613715     5  0.0260     0.9682 0.008 0.000 0.000 0.000 0.992 0.000
#> GSM613716     3  0.5482     0.6851 0.212 0.000 0.648 0.072 0.068 0.000
#> GSM613717     1  0.7280    -0.4081 0.340 0.000 0.320 0.068 0.264 0.008
#> GSM613718     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613719     5  0.0146     0.9715 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM613720     5  0.0146     0.9715 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM613721     3  0.0508     0.6273 0.004 0.000 0.984 0.000 0.000 0.012
#> GSM613722     2  0.0363     0.8652 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM613723     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613724     1  0.3230     0.2268 0.776 0.000 0.012 0.212 0.000 0.000
#> GSM613725     2  0.0260     0.8650 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM613726     4  0.6013     0.2930 0.276 0.060 0.000 0.564 0.000 0.100
#> GSM613727     2  0.5520     0.3150 0.340 0.560 0.000 0.060 0.000 0.040
#> GSM613728     2  0.0363     0.8652 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM613729     2  0.4284     0.6564 0.132 0.768 0.000 0.060 0.000 0.040
#> GSM613730     4  0.2615     0.7083 0.088 0.000 0.028 0.876 0.000 0.008
#> GSM613731     4  0.6013     0.2930 0.276 0.060 0.000 0.564 0.000 0.100
#> GSM613732     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613733     3  0.5466     0.4351 0.120 0.000 0.532 0.344 0.000 0.004
#> GSM613734     1  0.2113     0.1980 0.912 0.000 0.032 0.048 0.000 0.008
#> GSM613735     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613736     1  0.7272    -0.3772 0.360 0.000 0.288 0.068 0.276 0.008
#> GSM613737     5  0.0146     0.9715 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM613738     5  0.0146     0.9714 0.004 0.000 0.000 0.000 0.996 0.000
#> GSM613739     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613740     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613741     3  0.4528     0.6913 0.140 0.000 0.752 0.072 0.032 0.004
#> GSM613742     5  0.0146     0.9714 0.004 0.000 0.000 0.000 0.996 0.000
#> GSM613743     1  0.7272    -0.3772 0.360 0.000 0.288 0.068 0.276 0.008
#> GSM613744     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613745     3  0.4542     0.6928 0.136 0.000 0.752 0.076 0.032 0.004
#> GSM613746     3  0.0603     0.6237 0.004 0.000 0.980 0.000 0.000 0.016
#> GSM613747     1  0.2113     0.1980 0.912 0.000 0.032 0.048 0.000 0.008
#> GSM613748     4  0.3494     0.6203 0.012 0.000 0.000 0.736 0.000 0.252
#> GSM613749     2  0.0405     0.8643 0.008 0.988 0.000 0.000 0.000 0.004
#> GSM613750     5  0.0260     0.9697 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM613751     5  0.0260     0.9697 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM613752     5  0.0260     0.9697 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM613753     5  0.0260     0.9697 0.000 0.000 0.000 0.000 0.992 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-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 disease.state(p) k
#> ATC:hclust 97            0.015 2
#> ATC:hclust 91            0.220 3
#> ATC:hclust 90            0.344 4
#> ATC:hclust 73            0.413 5
#> ATC:hclust 83            0.316 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 27425 rows and 116 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.995       0.998         0.5041 0.496   0.496
#> 3 3 0.720           0.834       0.910         0.3190 0.741   0.523
#> 4 4 0.747           0.856       0.899         0.1227 0.795   0.475
#> 5 5 0.724           0.588       0.760         0.0595 0.946   0.793
#> 6 6 0.737           0.717       0.789         0.0361 0.920   0.679

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
#> GSM613638     2  0.0000      0.996 0.000 1.000
#> GSM613639     1  0.0000      1.000 1.000 0.000
#> GSM613640     1  0.0000      1.000 1.000 0.000
#> GSM613641     1  0.0000      1.000 1.000 0.000
#> GSM613642     1  0.0000      1.000 1.000 0.000
#> GSM613643     1  0.0000      1.000 1.000 0.000
#> GSM613644     1  0.0000      1.000 1.000 0.000
#> GSM613645     1  0.0000      1.000 1.000 0.000
#> GSM613646     2  0.0000      0.996 0.000 1.000
#> GSM613647     2  0.0000      0.996 0.000 1.000
#> GSM613648     2  0.0000      0.996 0.000 1.000
#> GSM613649     2  0.0000      0.996 0.000 1.000
#> GSM613650     2  0.0000      0.996 0.000 1.000
#> GSM613651     2  0.0000      0.996 0.000 1.000
#> GSM613652     2  0.0000      0.996 0.000 1.000
#> GSM613653     2  0.0000      0.996 0.000 1.000
#> GSM613654     2  0.0000      0.996 0.000 1.000
#> GSM613655     1  0.0000      1.000 1.000 0.000
#> GSM613656     2  0.0000      0.996 0.000 1.000
#> GSM613657     2  0.0000      0.996 0.000 1.000
#> GSM613658     2  0.0938      0.984 0.012 0.988
#> GSM613659     1  0.0000      1.000 1.000 0.000
#> GSM613660     1  0.0000      1.000 1.000 0.000
#> GSM613661     1  0.0000      1.000 1.000 0.000
#> GSM613662     1  0.0000      1.000 1.000 0.000
#> GSM613663     1  0.0000      1.000 1.000 0.000
#> GSM613664     1  0.0000      1.000 1.000 0.000
#> GSM613665     1  0.0000      1.000 1.000 0.000
#> GSM613666     1  0.0000      1.000 1.000 0.000
#> GSM613667     1  0.0000      1.000 1.000 0.000
#> GSM613668     1  0.0000      1.000 1.000 0.000
#> GSM613669     1  0.0000      1.000 1.000 0.000
#> GSM613670     1  0.0000      1.000 1.000 0.000
#> GSM613671     1  0.0000      1.000 1.000 0.000
#> GSM613672     1  0.0000      1.000 1.000 0.000
#> GSM613673     1  0.0000      1.000 1.000 0.000
#> GSM613674     1  0.0000      1.000 1.000 0.000
#> GSM613675     1  0.0000      1.000 1.000 0.000
#> GSM613676     1  0.0000      1.000 1.000 0.000
#> GSM613677     1  0.0000      1.000 1.000 0.000
#> GSM613678     1  0.0000      1.000 1.000 0.000
#> GSM613679     1  0.0000      1.000 1.000 0.000
#> GSM613680     1  0.0000      1.000 1.000 0.000
#> GSM613681     1  0.0000      1.000 1.000 0.000
#> GSM613682     1  0.0000      1.000 1.000 0.000
#> GSM613683     1  0.0000      1.000 1.000 0.000
#> GSM613684     1  0.1414      0.979 0.980 0.020
#> GSM613685     1  0.0000      1.000 1.000 0.000
#> GSM613686     1  0.0000      1.000 1.000 0.000
#> GSM613687     1  0.0000      1.000 1.000 0.000
#> GSM613688     1  0.0000      1.000 1.000 0.000
#> GSM613689     2  0.0000      0.996 0.000 1.000
#> GSM613690     2  0.0000      0.996 0.000 1.000
#> GSM613691     1  0.0000      1.000 1.000 0.000
#> GSM613692     2  0.0000      0.996 0.000 1.000
#> GSM613693     2  0.0000      0.996 0.000 1.000
#> GSM613694     2  0.0000      0.996 0.000 1.000
#> GSM613695     2  0.0000      0.996 0.000 1.000
#> GSM613696     2  0.0000      0.996 0.000 1.000
#> GSM613697     2  0.0000      0.996 0.000 1.000
#> GSM613698     2  0.0000      0.996 0.000 1.000
#> GSM613699     2  0.0000      0.996 0.000 1.000
#> GSM613700     1  0.0000      1.000 1.000 0.000
#> GSM613701     1  0.0000      1.000 1.000 0.000
#> GSM613702     1  0.0000      1.000 1.000 0.000
#> GSM613703     1  0.0000      1.000 1.000 0.000
#> GSM613704     1  0.0000      1.000 1.000 0.000
#> GSM613705     2  0.0000      0.996 0.000 1.000
#> GSM613706     1  0.0000      1.000 1.000 0.000
#> GSM613707     1  0.0000      1.000 1.000 0.000
#> GSM613708     1  0.0000      1.000 1.000 0.000
#> GSM613709     1  0.0000      1.000 1.000 0.000
#> GSM613710     1  0.0000      1.000 1.000 0.000
#> GSM613711     2  0.0000      0.996 0.000 1.000
#> GSM613712     2  0.0000      0.996 0.000 1.000
#> GSM613713     2  0.0000      0.996 0.000 1.000
#> GSM613714     2  0.0000      0.996 0.000 1.000
#> GSM613715     2  0.0000      0.996 0.000 1.000
#> GSM613716     2  0.0000      0.996 0.000 1.000
#> GSM613717     2  0.0000      0.996 0.000 1.000
#> GSM613718     2  0.0000      0.996 0.000 1.000
#> GSM613719     2  0.0000      0.996 0.000 1.000
#> GSM613720     2  0.0000      0.996 0.000 1.000
#> GSM613721     2  0.7745      0.705 0.228 0.772
#> GSM613722     1  0.0000      1.000 1.000 0.000
#> GSM613723     2  0.0000      0.996 0.000 1.000
#> GSM613724     1  0.0000      1.000 1.000 0.000
#> GSM613725     1  0.0000      1.000 1.000 0.000
#> GSM613726     1  0.0000      1.000 1.000 0.000
#> GSM613727     1  0.0000      1.000 1.000 0.000
#> GSM613728     1  0.0000      1.000 1.000 0.000
#> GSM613729     1  0.0000      1.000 1.000 0.000
#> GSM613730     1  0.0000      1.000 1.000 0.000
#> GSM613731     1  0.0000      1.000 1.000 0.000
#> GSM613732     2  0.0000      0.996 0.000 1.000
#> GSM613733     2  0.0000      0.996 0.000 1.000
#> GSM613734     2  0.0000      0.996 0.000 1.000
#> GSM613735     2  0.0000      0.996 0.000 1.000
#> GSM613736     2  0.0000      0.996 0.000 1.000
#> GSM613737     2  0.0000      0.996 0.000 1.000
#> GSM613738     2  0.0000      0.996 0.000 1.000
#> GSM613739     2  0.0000      0.996 0.000 1.000
#> GSM613740     2  0.0000      0.996 0.000 1.000
#> GSM613741     2  0.0000      0.996 0.000 1.000
#> GSM613742     2  0.0000      0.996 0.000 1.000
#> GSM613743     2  0.0000      0.996 0.000 1.000
#> GSM613744     2  0.0000      0.996 0.000 1.000
#> GSM613745     2  0.0000      0.996 0.000 1.000
#> GSM613746     2  0.0000      0.996 0.000 1.000
#> GSM613747     2  0.0000      0.996 0.000 1.000
#> GSM613748     1  0.0000      1.000 1.000 0.000
#> GSM613749     1  0.0000      1.000 1.000 0.000
#> GSM613750     2  0.0000      0.996 0.000 1.000
#> GSM613751     2  0.0000      0.996 0.000 1.000
#> GSM613752     2  0.0000      0.996 0.000 1.000
#> GSM613753     2  0.0000      0.996 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
#> GSM613638     2  0.1643     0.8467 0.000 0.956 0.044
#> GSM613639     1  0.5882     0.6039 0.652 0.348 0.000
#> GSM613640     2  0.2165     0.8358 0.064 0.936 0.000
#> GSM613641     1  0.0747     0.9074 0.984 0.016 0.000
#> GSM613642     2  0.2165     0.8365 0.064 0.936 0.000
#> GSM613643     2  0.1753     0.8408 0.048 0.952 0.000
#> GSM613644     2  0.1753     0.8408 0.048 0.952 0.000
#> GSM613645     1  0.3816     0.8617 0.852 0.148 0.000
#> GSM613646     2  0.3038     0.8276 0.000 0.896 0.104
#> GSM613647     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613648     3  0.1411     0.9319 0.000 0.036 0.964
#> GSM613649     3  0.1411     0.9319 0.000 0.036 0.964
#> GSM613650     2  0.5016     0.6958 0.000 0.760 0.240
#> GSM613651     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613652     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613653     2  0.3267     0.8212 0.000 0.884 0.116
#> GSM613654     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613655     1  0.5497     0.7016 0.708 0.292 0.000
#> GSM613656     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613657     3  0.1529     0.9296 0.000 0.040 0.960
#> GSM613658     2  0.1999     0.8413 0.012 0.952 0.036
#> GSM613659     2  0.2165     0.8361 0.064 0.936 0.000
#> GSM613660     2  0.2356     0.8345 0.072 0.928 0.000
#> GSM613661     1  0.5926     0.5880 0.644 0.356 0.000
#> GSM613662     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613663     1  0.3879     0.8593 0.848 0.152 0.000
#> GSM613664     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613665     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613666     1  0.0747     0.9074 0.984 0.016 0.000
#> GSM613667     1  0.0747     0.9074 0.984 0.016 0.000
#> GSM613668     1  0.3879     0.8593 0.848 0.152 0.000
#> GSM613669     1  0.0747     0.9074 0.984 0.016 0.000
#> GSM613670     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613671     1  0.0747     0.9074 0.984 0.016 0.000
#> GSM613672     1  0.4235     0.8409 0.824 0.176 0.000
#> GSM613673     1  0.1289     0.9059 0.968 0.032 0.000
#> GSM613674     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613675     1  0.4974     0.7756 0.764 0.236 0.000
#> GSM613676     2  0.4178     0.7328 0.172 0.828 0.000
#> GSM613677     2  0.2066     0.8365 0.060 0.940 0.000
#> GSM613678     1  0.2537     0.8909 0.920 0.080 0.000
#> GSM613679     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613680     1  0.4121     0.8474 0.832 0.168 0.000
#> GSM613681     1  0.3816     0.8617 0.852 0.148 0.000
#> GSM613682     1  0.4235     0.8415 0.824 0.176 0.000
#> GSM613683     2  0.1860     0.8400 0.052 0.948 0.000
#> GSM613684     2  0.1453     0.8447 0.008 0.968 0.024
#> GSM613685     1  0.1860     0.8869 0.948 0.052 0.000
#> GSM613686     1  0.0000     0.9080 1.000 0.000 0.000
#> GSM613687     1  0.3879     0.8593 0.848 0.152 0.000
#> GSM613688     2  0.5621     0.4723 0.308 0.692 0.000
#> GSM613689     3  0.1529     0.9296 0.000 0.040 0.960
#> GSM613690     3  0.0000     0.9432 0.000 0.000 1.000
#> GSM613691     2  0.1289     0.8431 0.032 0.968 0.000
#> GSM613692     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613693     2  0.3192     0.8231 0.000 0.888 0.112
#> GSM613694     3  0.6079     0.3362 0.000 0.388 0.612
#> GSM613695     3  0.0000     0.9432 0.000 0.000 1.000
#> GSM613696     3  0.1529     0.9296 0.000 0.040 0.960
#> GSM613697     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613698     3  0.0000     0.9432 0.000 0.000 1.000
#> GSM613699     3  0.6126     0.3013 0.000 0.400 0.600
#> GSM613700     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613701     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613702     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613703     1  0.0237     0.9080 0.996 0.004 0.000
#> GSM613704     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613705     2  0.4178     0.7789 0.000 0.828 0.172
#> GSM613706     2  0.2165     0.8358 0.064 0.936 0.000
#> GSM613707     2  0.6305    -0.0892 0.484 0.516 0.000
#> GSM613708     2  0.2165     0.8358 0.064 0.936 0.000
#> GSM613709     1  0.1860     0.9012 0.948 0.052 0.000
#> GSM613710     2  0.4178     0.7328 0.172 0.828 0.000
#> GSM613711     3  0.3267     0.8546 0.000 0.116 0.884
#> GSM613712     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613713     2  0.6008     0.4395 0.000 0.628 0.372
#> GSM613714     3  0.1411     0.9319 0.000 0.036 0.964
#> GSM613715     3  0.0000     0.9432 0.000 0.000 1.000
#> GSM613716     2  0.4399     0.7596 0.000 0.812 0.188
#> GSM613717     2  0.4605     0.7405 0.000 0.796 0.204
#> GSM613718     3  0.0000     0.9432 0.000 0.000 1.000
#> GSM613719     3  0.1411     0.9319 0.000 0.036 0.964
#> GSM613720     3  0.1289     0.9337 0.000 0.032 0.968
#> GSM613721     2  0.3295     0.8301 0.008 0.896 0.096
#> GSM613722     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613723     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613724     2  0.1753     0.8408 0.048 0.952 0.000
#> GSM613725     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613726     1  0.3619     0.8680 0.864 0.136 0.000
#> GSM613727     1  0.0747     0.9074 0.984 0.016 0.000
#> GSM613728     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613729     1  0.0747     0.9074 0.984 0.016 0.000
#> GSM613730     2  0.2066     0.8365 0.060 0.940 0.000
#> GSM613731     1  0.6008     0.5557 0.628 0.372 0.000
#> GSM613732     3  0.0000     0.9432 0.000 0.000 1.000
#> GSM613733     2  0.3038     0.8276 0.000 0.896 0.104
#> GSM613734     2  0.3826     0.8029 0.008 0.868 0.124
#> GSM613735     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613736     2  0.6062     0.4094 0.000 0.616 0.384
#> GSM613737     3  0.0000     0.9432 0.000 0.000 1.000
#> GSM613738     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613739     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613740     3  0.0747     0.9398 0.000 0.016 0.984
#> GSM613741     2  0.4291     0.7683 0.000 0.820 0.180
#> GSM613742     3  0.0747     0.9405 0.000 0.016 0.984
#> GSM613743     3  0.1529     0.9296 0.000 0.040 0.960
#> GSM613744     3  0.0747     0.9398 0.000 0.016 0.984
#> GSM613745     2  0.4291     0.7683 0.000 0.820 0.180
#> GSM613746     2  0.3686     0.8030 0.000 0.860 0.140
#> GSM613747     3  0.6305    -0.0490 0.000 0.484 0.516
#> GSM613748     1  0.5397     0.7234 0.720 0.280 0.000
#> GSM613749     1  0.0424     0.9082 0.992 0.008 0.000
#> GSM613750     3  0.0000     0.9432 0.000 0.000 1.000
#> GSM613751     3  0.0747     0.9398 0.000 0.016 0.984
#> GSM613752     3  0.0000     0.9432 0.000 0.000 1.000
#> GSM613753     3  0.0000     0.9432 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
#> GSM613638     1  0.4889      0.590 0.636 0.000 0.004 0.360
#> GSM613639     1  0.2408      0.831 0.896 0.104 0.000 0.000
#> GSM613640     1  0.3852      0.842 0.808 0.012 0.000 0.180
#> GSM613641     2  0.2973      0.869 0.144 0.856 0.000 0.000
#> GSM613642     1  0.3969      0.839 0.804 0.016 0.000 0.180
#> GSM613643     1  0.3681      0.842 0.816 0.008 0.000 0.176
#> GSM613644     1  0.3808      0.834 0.808 0.004 0.004 0.184
#> GSM613645     1  0.2647      0.820 0.880 0.120 0.000 0.000
#> GSM613646     4  0.1398      0.864 0.040 0.004 0.000 0.956
#> GSM613647     3  0.0469      0.941 0.012 0.000 0.988 0.000
#> GSM613648     3  0.3311      0.832 0.000 0.000 0.828 0.172
#> GSM613649     3  0.3311      0.832 0.000 0.000 0.828 0.172
#> GSM613650     4  0.0524      0.869 0.004 0.000 0.008 0.988
#> GSM613651     3  0.0592      0.941 0.016 0.000 0.984 0.000
#> GSM613652     3  0.0592      0.941 0.016 0.000 0.984 0.000
#> GSM613653     4  0.1398      0.865 0.040 0.000 0.004 0.956
#> GSM613654     3  0.0592      0.941 0.016 0.000 0.984 0.000
#> GSM613655     1  0.2408      0.831 0.896 0.104 0.000 0.000
#> GSM613656     3  0.0592      0.941 0.016 0.000 0.984 0.000
#> GSM613657     3  0.4643      0.522 0.000 0.000 0.656 0.344
#> GSM613658     1  0.3099      0.850 0.876 0.000 0.020 0.104
#> GSM613659     1  0.3969      0.839 0.804 0.016 0.000 0.180
#> GSM613660     1  0.4012      0.836 0.800 0.016 0.000 0.184
#> GSM613661     1  0.2281      0.834 0.904 0.096 0.000 0.000
#> GSM613662     2  0.0000      0.930 0.000 1.000 0.000 0.000
#> GSM613663     1  0.2760      0.813 0.872 0.128 0.000 0.000
#> GSM613664     2  0.0000      0.930 0.000 1.000 0.000 0.000
#> GSM613665     2  0.0188      0.929 0.004 0.996 0.000 0.000
#> GSM613666     2  0.2973      0.870 0.144 0.856 0.000 0.000
#> GSM613667     2  0.3024      0.867 0.148 0.852 0.000 0.000
#> GSM613668     1  0.2760      0.813 0.872 0.128 0.000 0.000
#> GSM613669     2  0.1792      0.908 0.068 0.932 0.000 0.000
#> GSM613670     2  0.0000      0.930 0.000 1.000 0.000 0.000
#> GSM613671     2  0.1792      0.908 0.068 0.932 0.000 0.000
#> GSM613672     1  0.2281      0.834 0.904 0.096 0.000 0.000
#> GSM613673     2  0.3764      0.792 0.216 0.784 0.000 0.000
#> GSM613674     2  0.0188      0.928 0.004 0.996 0.000 0.000
#> GSM613675     1  0.3828      0.857 0.848 0.084 0.000 0.068
#> GSM613676     1  0.4149      0.845 0.804 0.028 0.000 0.168
#> GSM613677     1  0.4054      0.836 0.796 0.016 0.000 0.188
#> GSM613678     2  0.4830      0.412 0.392 0.608 0.000 0.000
#> GSM613679     2  0.0000      0.930 0.000 1.000 0.000 0.000
#> GSM613680     1  0.2589      0.823 0.884 0.116 0.000 0.000
#> GSM613681     1  0.4072      0.641 0.748 0.252 0.000 0.000
#> GSM613682     1  0.2408      0.831 0.896 0.104 0.000 0.000
#> GSM613683     1  0.1722      0.857 0.944 0.008 0.000 0.048
#> GSM613684     1  0.4074      0.820 0.792 0.004 0.008 0.196
#> GSM613685     2  0.1398      0.904 0.040 0.956 0.000 0.004
#> GSM613686     2  0.0188      0.929 0.004 0.996 0.000 0.000
#> GSM613687     1  0.2647      0.820 0.880 0.120 0.000 0.000
#> GSM613688     1  0.4322      0.850 0.804 0.044 0.000 0.152
#> GSM613689     4  0.3528      0.746 0.000 0.000 0.192 0.808
#> GSM613690     3  0.1489      0.943 0.004 0.000 0.952 0.044
#> GSM613691     4  0.3982      0.646 0.220 0.004 0.000 0.776
#> GSM613692     3  0.0592      0.941 0.016 0.000 0.984 0.000
#> GSM613693     4  0.1489      0.864 0.044 0.004 0.000 0.952
#> GSM613694     4  0.3172      0.781 0.000 0.000 0.160 0.840
#> GSM613695     3  0.1302      0.942 0.000 0.000 0.956 0.044
#> GSM613696     4  0.3486      0.749 0.000 0.000 0.188 0.812
#> GSM613697     3  0.0592      0.941 0.016 0.000 0.984 0.000
#> GSM613698     3  0.1388      0.944 0.012 0.000 0.960 0.028
#> GSM613699     4  0.3123      0.785 0.000 0.000 0.156 0.844
#> GSM613700     2  0.0000      0.930 0.000 1.000 0.000 0.000
#> GSM613701     2  0.0188      0.929 0.004 0.996 0.000 0.000
#> GSM613702     2  0.0188      0.929 0.004 0.996 0.000 0.000
#> GSM613703     2  0.0188      0.929 0.004 0.996 0.000 0.000
#> GSM613704     2  0.0000      0.930 0.000 1.000 0.000 0.000
#> GSM613705     4  0.1854      0.865 0.048 0.000 0.012 0.940
#> GSM613706     1  0.2805      0.859 0.888 0.012 0.000 0.100
#> GSM613707     1  0.4356      0.850 0.804 0.048 0.000 0.148
#> GSM613708     1  0.2867      0.860 0.884 0.012 0.000 0.104
#> GSM613709     2  0.4356      0.674 0.292 0.708 0.000 0.000
#> GSM613710     1  0.4149      0.845 0.804 0.028 0.000 0.168
#> GSM613711     4  0.2408      0.828 0.000 0.000 0.104 0.896
#> GSM613712     3  0.1452      0.944 0.008 0.000 0.956 0.036
#> GSM613713     4  0.0376      0.868 0.004 0.000 0.004 0.992
#> GSM613714     4  0.3610      0.743 0.000 0.000 0.200 0.800
#> GSM613715     3  0.1302      0.942 0.000 0.000 0.956 0.044
#> GSM613716     4  0.1022      0.867 0.032 0.000 0.000 0.968
#> GSM613717     4  0.0000      0.868 0.000 0.000 0.000 1.000
#> GSM613718     3  0.2111      0.939 0.024 0.000 0.932 0.044
#> GSM613719     3  0.3266      0.833 0.000 0.000 0.832 0.168
#> GSM613720     3  0.1557      0.940 0.000 0.000 0.944 0.056
#> GSM613721     4  0.1489      0.864 0.044 0.004 0.000 0.952
#> GSM613722     2  0.0000      0.930 0.000 1.000 0.000 0.000
#> GSM613723     3  0.1118      0.934 0.036 0.000 0.964 0.000
#> GSM613724     1  0.2345      0.855 0.900 0.000 0.000 0.100
#> GSM613725     2  0.0000      0.930 0.000 1.000 0.000 0.000
#> GSM613726     1  0.3873      0.689 0.772 0.228 0.000 0.000
#> GSM613727     2  0.3024      0.867 0.148 0.852 0.000 0.000
#> GSM613728     2  0.0188      0.929 0.004 0.996 0.000 0.000
#> GSM613729     2  0.2921      0.872 0.140 0.860 0.000 0.000
#> GSM613730     1  0.4054      0.836 0.796 0.016 0.000 0.188
#> GSM613731     1  0.1792      0.847 0.932 0.068 0.000 0.000
#> GSM613732     3  0.2002      0.940 0.020 0.000 0.936 0.044
#> GSM613733     4  0.1398      0.864 0.040 0.004 0.000 0.956
#> GSM613734     4  0.5973      0.432 0.332 0.000 0.056 0.612
#> GSM613735     3  0.0592      0.941 0.016 0.000 0.984 0.000
#> GSM613736     4  0.0592      0.866 0.000 0.000 0.016 0.984
#> GSM613737     3  0.1389      0.943 0.000 0.000 0.952 0.048
#> GSM613738     3  0.0592      0.941 0.016 0.000 0.984 0.000
#> GSM613739     3  0.0592      0.941 0.016 0.000 0.984 0.000
#> GSM613740     3  0.1576      0.941 0.004 0.000 0.948 0.048
#> GSM613741     4  0.1398      0.865 0.040 0.000 0.004 0.956
#> GSM613742     3  0.0592      0.941 0.016 0.000 0.984 0.000
#> GSM613743     4  0.3668      0.755 0.004 0.000 0.188 0.808
#> GSM613744     3  0.1576      0.941 0.004 0.000 0.948 0.048
#> GSM613745     4  0.1398      0.865 0.040 0.000 0.004 0.956
#> GSM613746     4  0.1489      0.864 0.044 0.004 0.000 0.952
#> GSM613747     4  0.5038      0.583 0.012 0.000 0.336 0.652
#> GSM613748     1  0.3009      0.862 0.892 0.056 0.000 0.052
#> GSM613749     2  0.0000      0.930 0.000 1.000 0.000 0.000
#> GSM613750     3  0.2408      0.935 0.036 0.000 0.920 0.044
#> GSM613751     3  0.2494      0.934 0.036 0.000 0.916 0.048
#> GSM613752     3  0.2408      0.935 0.036 0.000 0.920 0.044
#> GSM613753     3  0.2408      0.935 0.036 0.000 0.920 0.044

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     4  0.6155     0.4846 0.336 0.000 0.148 0.516 0.000
#> GSM613639     1  0.1626     0.4309 0.940 0.016 0.000 0.044 0.000
#> GSM613640     1  0.4559    -0.6531 0.512 0.000 0.008 0.480 0.000
#> GSM613641     2  0.4298     0.6098 0.352 0.640 0.000 0.008 0.000
#> GSM613642     4  0.4481     0.7734 0.416 0.000 0.008 0.576 0.000
#> GSM613643     1  0.4560    -0.6519 0.508 0.000 0.008 0.484 0.000
#> GSM613644     1  0.4560    -0.6609 0.508 0.000 0.008 0.484 0.000
#> GSM613645     1  0.0609     0.4485 0.980 0.000 0.000 0.020 0.000
#> GSM613646     3  0.1851     0.8778 0.000 0.000 0.912 0.088 0.000
#> GSM613647     5  0.1732     0.8949 0.000 0.000 0.000 0.080 0.920
#> GSM613648     5  0.4101     0.7384 0.000 0.000 0.184 0.048 0.768
#> GSM613649     5  0.4096     0.7246 0.000 0.000 0.200 0.040 0.760
#> GSM613650     3  0.0324     0.8873 0.000 0.000 0.992 0.004 0.004
#> GSM613651     5  0.1908     0.8925 0.000 0.000 0.000 0.092 0.908
#> GSM613652     5  0.1851     0.8917 0.000 0.000 0.000 0.088 0.912
#> GSM613653     3  0.1851     0.8778 0.000 0.000 0.912 0.088 0.000
#> GSM613654     5  0.2074     0.8891 0.000 0.000 0.000 0.104 0.896
#> GSM613655     1  0.0798     0.4513 0.976 0.016 0.000 0.008 0.000
#> GSM613656     5  0.1792     0.8922 0.000 0.000 0.000 0.084 0.916
#> GSM613657     5  0.5519     0.2061 0.000 0.000 0.412 0.068 0.520
#> GSM613658     1  0.4481    -0.4621 0.576 0.000 0.008 0.416 0.000
#> GSM613659     4  0.4538     0.7627 0.452 0.000 0.008 0.540 0.000
#> GSM613660     4  0.4562     0.6785 0.492 0.000 0.008 0.500 0.000
#> GSM613661     1  0.1270     0.4142 0.948 0.000 0.000 0.052 0.000
#> GSM613662     2  0.0162     0.8289 0.004 0.996 0.000 0.000 0.000
#> GSM613663     1  0.0510     0.4522 0.984 0.016 0.000 0.000 0.000
#> GSM613664     2  0.0000     0.8289 0.000 1.000 0.000 0.000 0.000
#> GSM613665     2  0.3596     0.7453 0.212 0.776 0.000 0.012 0.000
#> GSM613666     2  0.4522     0.5253 0.440 0.552 0.000 0.008 0.000
#> GSM613667     2  0.4562     0.4497 0.492 0.500 0.000 0.008 0.000
#> GSM613668     1  0.1211     0.4501 0.960 0.016 0.000 0.024 0.000
#> GSM613669     2  0.2753     0.7823 0.136 0.856 0.000 0.008 0.000
#> GSM613670     2  0.0162     0.8287 0.000 0.996 0.000 0.004 0.000
#> GSM613671     2  0.2753     0.7823 0.136 0.856 0.000 0.008 0.000
#> GSM613672     1  0.0000     0.4482 1.000 0.000 0.000 0.000 0.000
#> GSM613673     1  0.4655    -0.4437 0.512 0.476 0.000 0.012 0.000
#> GSM613674     2  0.2488     0.7636 0.004 0.872 0.000 0.124 0.000
#> GSM613675     1  0.4426    -0.2885 0.612 0.004 0.004 0.380 0.000
#> GSM613676     4  0.4651     0.7583 0.428 0.004 0.008 0.560 0.000
#> GSM613677     1  0.4560    -0.6609 0.508 0.000 0.008 0.484 0.000
#> GSM613678     1  0.5931     0.2330 0.596 0.204 0.000 0.200 0.000
#> GSM613679     2  0.0000     0.8289 0.000 1.000 0.000 0.000 0.000
#> GSM613680     1  0.0609     0.4485 0.980 0.000 0.000 0.020 0.000
#> GSM613681     1  0.2144     0.4258 0.912 0.068 0.000 0.020 0.000
#> GSM613682     1  0.2690     0.3484 0.844 0.000 0.000 0.156 0.000
#> GSM613683     1  0.4201    -0.4531 0.592 0.000 0.000 0.408 0.000
#> GSM613684     4  0.4387     0.7296 0.348 0.000 0.012 0.640 0.000
#> GSM613685     2  0.5892     0.5613 0.180 0.600 0.000 0.220 0.000
#> GSM613686     2  0.0290     0.8285 0.000 0.992 0.000 0.008 0.000
#> GSM613687     1  0.0609     0.4485 0.980 0.000 0.000 0.020 0.000
#> GSM613688     4  0.4706     0.5226 0.488 0.004 0.008 0.500 0.000
#> GSM613689     3  0.3169     0.8471 0.000 0.000 0.856 0.060 0.084
#> GSM613690     5  0.1282     0.8958 0.000 0.000 0.004 0.044 0.952
#> GSM613691     3  0.4394     0.7225 0.048 0.000 0.732 0.220 0.000
#> GSM613692     5  0.1851     0.8926 0.000 0.000 0.000 0.088 0.912
#> GSM613693     3  0.2179     0.8704 0.000 0.000 0.888 0.112 0.000
#> GSM613694     3  0.0992     0.8852 0.000 0.000 0.968 0.024 0.008
#> GSM613695     5  0.1638     0.8930 0.000 0.000 0.004 0.064 0.932
#> GSM613696     3  0.1195     0.8849 0.000 0.000 0.960 0.028 0.012
#> GSM613697     5  0.1965     0.8925 0.000 0.000 0.000 0.096 0.904
#> GSM613698     5  0.1197     0.8963 0.000 0.000 0.000 0.048 0.952
#> GSM613699     3  0.0290     0.8873 0.000 0.000 0.992 0.000 0.008
#> GSM613700     2  0.0000     0.8289 0.000 1.000 0.000 0.000 0.000
#> GSM613701     2  0.3141     0.7774 0.152 0.832 0.000 0.016 0.000
#> GSM613702     2  0.3143     0.7578 0.204 0.796 0.000 0.000 0.000
#> GSM613703     2  0.0290     0.8285 0.000 0.992 0.000 0.008 0.000
#> GSM613704     2  0.0000     0.8289 0.000 1.000 0.000 0.000 0.000
#> GSM613705     3  0.5301     0.6361 0.088 0.000 0.688 0.212 0.012
#> GSM613706     1  0.3550     0.0573 0.760 0.000 0.004 0.236 0.000
#> GSM613707     1  0.4702    -0.5223 0.512 0.004 0.008 0.476 0.000
#> GSM613708     1  0.4560    -0.6609 0.508 0.000 0.008 0.484 0.000
#> GSM613709     1  0.4380    -0.1757 0.616 0.376 0.000 0.008 0.000
#> GSM613710     4  0.4533     0.7644 0.448 0.000 0.008 0.544 0.000
#> GSM613711     3  0.3180     0.8492 0.000 0.000 0.856 0.068 0.076
#> GSM613712     5  0.0880     0.8982 0.000 0.000 0.000 0.032 0.968
#> GSM613713     3  0.1851     0.8844 0.000 0.000 0.912 0.088 0.000
#> GSM613714     3  0.3297     0.8446 0.000 0.000 0.848 0.068 0.084
#> GSM613715     5  0.1357     0.8955 0.000 0.000 0.004 0.048 0.948
#> GSM613716     3  0.0794     0.8858 0.000 0.000 0.972 0.028 0.000
#> GSM613717     3  0.0609     0.8864 0.000 0.000 0.980 0.020 0.000
#> GSM613718     5  0.1952     0.8891 0.000 0.000 0.004 0.084 0.912
#> GSM613719     5  0.4054     0.7239 0.000 0.000 0.204 0.036 0.760
#> GSM613720     5  0.1894     0.8919 0.000 0.000 0.008 0.072 0.920
#> GSM613721     3  0.2179     0.8704 0.000 0.000 0.888 0.112 0.000
#> GSM613722     2  0.0000     0.8289 0.000 1.000 0.000 0.000 0.000
#> GSM613723     5  0.2127     0.8886 0.000 0.000 0.000 0.108 0.892
#> GSM613724     1  0.4367    -0.4605 0.580 0.000 0.004 0.416 0.000
#> GSM613725     2  0.0000     0.8289 0.000 1.000 0.000 0.000 0.000
#> GSM613726     1  0.2377     0.3943 0.872 0.128 0.000 0.000 0.000
#> GSM613727     2  0.4555     0.4803 0.472 0.520 0.000 0.008 0.000
#> GSM613728     2  0.3318     0.7660 0.180 0.808 0.000 0.012 0.000
#> GSM613729     2  0.4380     0.5891 0.376 0.616 0.000 0.008 0.000
#> GSM613730     1  0.4555    -0.6547 0.520 0.000 0.008 0.472 0.000
#> GSM613731     1  0.1270     0.4152 0.948 0.000 0.000 0.052 0.000
#> GSM613732     5  0.1704     0.8923 0.000 0.000 0.004 0.068 0.928
#> GSM613733     3  0.0880     0.8869 0.000 0.000 0.968 0.032 0.000
#> GSM613734     3  0.7210     0.3955 0.300 0.000 0.500 0.128 0.072
#> GSM613735     5  0.1792     0.8922 0.000 0.000 0.000 0.084 0.916
#> GSM613736     3  0.3055     0.8523 0.000 0.000 0.864 0.072 0.064
#> GSM613737     5  0.1408     0.8952 0.000 0.000 0.008 0.044 0.948
#> GSM613738     5  0.1908     0.8921 0.000 0.000 0.000 0.092 0.908
#> GSM613739     5  0.1851     0.8917 0.000 0.000 0.000 0.088 0.912
#> GSM613740     5  0.2069     0.8885 0.000 0.000 0.012 0.076 0.912
#> GSM613741     3  0.1851     0.8778 0.000 0.000 0.912 0.088 0.000
#> GSM613742     5  0.1908     0.8921 0.000 0.000 0.000 0.092 0.908
#> GSM613743     3  0.3242     0.8473 0.000 0.000 0.852 0.072 0.076
#> GSM613744     5  0.2006     0.8892 0.000 0.000 0.012 0.072 0.916
#> GSM613745     3  0.0703     0.8862 0.000 0.000 0.976 0.024 0.000
#> GSM613746     3  0.2179     0.8704 0.000 0.000 0.888 0.112 0.000
#> GSM613747     3  0.6190     0.5384 0.032 0.000 0.616 0.112 0.240
#> GSM613748     1  0.4182    -0.2748 0.644 0.000 0.004 0.352 0.000
#> GSM613749     2  0.0290     0.8285 0.000 0.992 0.000 0.008 0.000
#> GSM613750     5  0.2536     0.8732 0.000 0.000 0.004 0.128 0.868
#> GSM613751     5  0.2930     0.8566 0.000 0.000 0.004 0.164 0.832
#> GSM613752     5  0.2536     0.8732 0.000 0.000 0.004 0.128 0.868
#> GSM613753     5  0.2536     0.8732 0.000 0.000 0.004 0.128 0.868

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5 p6
#> GSM613638     4  0.3376      0.701 0.060 0.000 0.084 0.836 0.000 NA
#> GSM613639     1  0.3450      0.761 0.780 0.000 0.000 0.188 0.000 NA
#> GSM613640     4  0.1285      0.766 0.052 0.000 0.000 0.944 0.000 NA
#> GSM613641     1  0.4312      0.396 0.604 0.368 0.000 0.000 0.000 NA
#> GSM613642     4  0.2020      0.754 0.008 0.000 0.000 0.896 0.000 NA
#> GSM613643     4  0.1141      0.763 0.052 0.000 0.000 0.948 0.000 NA
#> GSM613644     4  0.1219      0.765 0.048 0.000 0.000 0.948 0.000 NA
#> GSM613645     1  0.2668      0.777 0.828 0.000 0.000 0.168 0.000 NA
#> GSM613646     3  0.2961      0.818 0.048 0.000 0.860 0.012 0.000 NA
#> GSM613647     5  0.3052      0.819 0.004 0.000 0.000 0.000 0.780 NA
#> GSM613648     5  0.4692      0.691 0.012 0.000 0.108 0.000 0.708 NA
#> GSM613649     5  0.4733      0.688 0.012 0.000 0.112 0.000 0.704 NA
#> GSM613650     3  0.1296      0.836 0.004 0.000 0.948 0.004 0.000 NA
#> GSM613651     5  0.2871      0.820 0.004 0.000 0.000 0.000 0.804 NA
#> GSM613652     5  0.2793      0.816 0.000 0.000 0.000 0.000 0.800 NA
#> GSM613653     3  0.3413      0.818 0.052 0.000 0.824 0.012 0.000 NA
#> GSM613654     5  0.3215      0.812 0.004 0.000 0.000 0.000 0.756 NA
#> GSM613655     1  0.3312      0.769 0.792 0.000 0.000 0.180 0.000 NA
#> GSM613656     5  0.2793      0.816 0.000 0.000 0.000 0.000 0.800 NA
#> GSM613657     5  0.6138      0.165 0.012 0.000 0.324 0.000 0.460 NA
#> GSM613658     4  0.3010      0.698 0.148 0.000 0.004 0.828 0.000 NA
#> GSM613659     4  0.3555      0.712 0.044 0.000 0.000 0.780 0.000 NA
#> GSM613660     4  0.2685      0.763 0.060 0.000 0.000 0.868 0.000 NA
#> GSM613661     1  0.3377      0.759 0.784 0.000 0.000 0.188 0.000 NA
#> GSM613662     2  0.0291      0.826 0.004 0.992 0.000 0.000 0.000 NA
#> GSM613663     1  0.3245      0.771 0.800 0.000 0.000 0.172 0.000 NA
#> GSM613664     2  0.0000      0.825 0.000 1.000 0.000 0.000 0.000 NA
#> GSM613665     2  0.4723      0.508 0.296 0.636 0.000 0.004 0.000 NA
#> GSM613666     1  0.4009      0.536 0.684 0.288 0.000 0.000 0.000 NA
#> GSM613667     1  0.3460      0.631 0.760 0.220 0.000 0.000 0.000 NA
#> GSM613668     1  0.2743      0.778 0.828 0.000 0.000 0.164 0.000 NA
#> GSM613669     2  0.3668      0.592 0.228 0.744 0.000 0.000 0.000 NA
#> GSM613670     2  0.0508      0.824 0.004 0.984 0.000 0.000 0.000 NA
#> GSM613671     2  0.3668      0.592 0.228 0.744 0.000 0.000 0.000 NA
#> GSM613672     1  0.3279      0.768 0.796 0.000 0.000 0.176 0.000 NA
#> GSM613673     1  0.3471      0.683 0.784 0.188 0.000 0.020 0.000 NA
#> GSM613674     2  0.4985      0.624 0.024 0.640 0.004 0.044 0.000 NA
#> GSM613675     4  0.5611      0.331 0.292 0.000 0.000 0.528 0.000 NA
#> GSM613676     4  0.3683      0.703 0.048 0.000 0.000 0.768 0.000 NA
#> GSM613677     4  0.1285      0.766 0.052 0.000 0.000 0.944 0.000 NA
#> GSM613678     1  0.6634      0.476 0.532 0.100 0.000 0.192 0.000 NA
#> GSM613679     2  0.0405      0.825 0.004 0.988 0.000 0.000 0.000 NA
#> GSM613680     1  0.2703      0.775 0.824 0.000 0.000 0.172 0.000 NA
#> GSM613681     1  0.3125      0.779 0.828 0.032 0.000 0.136 0.000 NA
#> GSM613682     1  0.5777      0.365 0.500 0.000 0.000 0.216 0.000 NA
#> GSM613683     4  0.2790      0.700 0.140 0.000 0.000 0.840 0.000 NA
#> GSM613684     4  0.4327      0.675 0.020 0.000 0.028 0.700 0.000 NA
#> GSM613685     2  0.6929      0.378 0.124 0.428 0.004 0.100 0.000 NA
#> GSM613686     2  0.1168      0.815 0.016 0.956 0.000 0.000 0.000 NA
#> GSM613687     1  0.2668      0.777 0.828 0.000 0.000 0.168 0.000 NA
#> GSM613688     4  0.5315      0.541 0.104 0.000 0.004 0.552 0.000 NA
#> GSM613689     3  0.4947      0.694 0.008 0.000 0.676 0.000 0.156 NA
#> GSM613690     5  0.0260      0.832 0.000 0.000 0.008 0.000 0.992 NA
#> GSM613691     3  0.4796      0.721 0.048 0.000 0.732 0.116 0.000 NA
#> GSM613692     5  0.2941      0.817 0.000 0.000 0.000 0.000 0.780 NA
#> GSM613693     3  0.3128      0.812 0.052 0.000 0.844 0.008 0.000 NA
#> GSM613694     3  0.1845      0.833 0.008 0.000 0.916 0.000 0.004 NA
#> GSM613695     5  0.1542      0.826 0.004 0.000 0.008 0.000 0.936 NA
#> GSM613696     3  0.2445      0.823 0.008 0.000 0.868 0.000 0.004 NA
#> GSM613697     5  0.2871      0.825 0.004 0.000 0.000 0.000 0.804 NA
#> GSM613698     5  0.2572      0.826 0.012 0.000 0.000 0.000 0.852 NA
#> GSM613699     3  0.1728      0.834 0.008 0.000 0.924 0.000 0.004 NA
#> GSM613700     2  0.0146      0.826 0.004 0.996 0.000 0.000 0.000 NA
#> GSM613701     2  0.4817      0.647 0.132 0.680 0.000 0.004 0.000 NA
#> GSM613702     2  0.3867      0.497 0.328 0.660 0.000 0.000 0.000 NA
#> GSM613703     2  0.0858      0.820 0.004 0.968 0.000 0.000 0.000 NA
#> GSM613704     2  0.0146      0.826 0.004 0.996 0.000 0.000 0.000 NA
#> GSM613705     4  0.5859      0.111 0.028 0.000 0.372 0.524 0.024 NA
#> GSM613706     4  0.4065      0.485 0.300 0.000 0.000 0.672 0.000 NA
#> GSM613707     4  0.5859      0.501 0.116 0.004 0.016 0.508 0.000 NA
#> GSM613708     4  0.1471      0.764 0.064 0.000 0.000 0.932 0.000 NA
#> GSM613709     1  0.3726      0.721 0.796 0.144 0.000 0.040 0.000 NA
#> GSM613710     4  0.2432      0.750 0.024 0.000 0.000 0.876 0.000 NA
#> GSM613711     3  0.4325      0.762 0.008 0.000 0.760 0.008 0.124 NA
#> GSM613712     5  0.0405      0.834 0.000 0.000 0.004 0.000 0.988 NA
#> GSM613713     3  0.2487      0.835 0.032 0.000 0.876 0.000 0.000 NA
#> GSM613714     3  0.4670      0.727 0.008 0.000 0.716 0.004 0.164 NA
#> GSM613715     5  0.1194      0.829 0.004 0.000 0.008 0.000 0.956 NA
#> GSM613716     3  0.0870      0.835 0.004 0.000 0.972 0.012 0.000 NA
#> GSM613717     3  0.1493      0.832 0.004 0.000 0.936 0.004 0.000 NA
#> GSM613718     5  0.1719      0.824 0.008 0.000 0.008 0.000 0.928 NA
#> GSM613719     5  0.4804      0.683 0.012 0.000 0.140 0.000 0.700 NA
#> GSM613720     5  0.2841      0.800 0.012 0.000 0.012 0.000 0.848 NA
#> GSM613721     3  0.3176      0.812 0.052 0.000 0.840 0.008 0.000 NA
#> GSM613722     2  0.0146      0.826 0.004 0.996 0.000 0.000 0.000 NA
#> GSM613723     5  0.2941      0.813 0.000 0.000 0.000 0.000 0.780 NA
#> GSM613724     4  0.3010      0.698 0.148 0.000 0.004 0.828 0.000 NA
#> GSM613725     2  0.0260      0.824 0.000 0.992 0.000 0.000 0.000 NA
#> GSM613726     1  0.3743      0.779 0.792 0.024 0.000 0.152 0.000 NA
#> GSM613727     1  0.3956      0.594 0.712 0.252 0.000 0.000 0.000 NA
#> GSM613728     2  0.4632      0.544 0.276 0.656 0.000 0.004 0.000 NA
#> GSM613729     1  0.4249      0.479 0.640 0.328 0.000 0.000 0.000 NA
#> GSM613730     4  0.1950      0.767 0.064 0.000 0.000 0.912 0.000 NA
#> GSM613731     1  0.3694      0.711 0.740 0.000 0.000 0.232 0.000 NA
#> GSM613732     5  0.0976      0.829 0.008 0.000 0.008 0.000 0.968 NA
#> GSM613733     3  0.1296      0.835 0.004 0.000 0.952 0.012 0.000 NA
#> GSM613734     3  0.7813      0.180 0.088 0.000 0.380 0.256 0.040 NA
#> GSM613735     5  0.2793      0.816 0.000 0.000 0.000 0.000 0.800 NA
#> GSM613736     3  0.4196      0.770 0.008 0.000 0.772 0.008 0.116 NA
#> GSM613737     5  0.3231      0.805 0.012 0.000 0.008 0.000 0.800 NA
#> GSM613738     5  0.2969      0.816 0.000 0.000 0.000 0.000 0.776 NA
#> GSM613739     5  0.2762      0.817 0.000 0.000 0.000 0.000 0.804 NA
#> GSM613740     5  0.2704      0.805 0.012 0.000 0.020 0.000 0.868 NA
#> GSM613741     3  0.3368      0.819 0.052 0.000 0.828 0.012 0.000 NA
#> GSM613742     5  0.2969      0.816 0.000 0.000 0.000 0.000 0.776 NA
#> GSM613743     3  0.4257      0.759 0.008 0.000 0.760 0.004 0.128 NA
#> GSM613744     5  0.2752      0.803 0.012 0.000 0.020 0.000 0.864 NA
#> GSM613745     3  0.1138      0.835 0.004 0.000 0.960 0.012 0.000 NA
#> GSM613746     3  0.3176      0.812 0.052 0.000 0.840 0.008 0.000 NA
#> GSM613747     3  0.6881      0.490 0.024 0.000 0.528 0.104 0.096 NA
#> GSM613748     4  0.5438      0.329 0.304 0.000 0.000 0.548 0.000 NA
#> GSM613749     2  0.0777      0.821 0.004 0.972 0.000 0.000 0.000 NA
#> GSM613750     5  0.3618      0.777 0.080 0.000 0.008 0.000 0.808 NA
#> GSM613751     5  0.4507      0.744 0.088 0.000 0.020 0.000 0.736 NA
#> GSM613752     5  0.3836      0.769 0.080 0.000 0.008 0.000 0.788 NA
#> GSM613753     5  0.3618      0.777 0.080 0.000 0.008 0.000 0.808 NA

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 disease.state(p) k
#> ATC:kmeans 116          0.00835 2
#> ATC:kmeans 109          0.03614 3
#> ATC:kmeans 114          0.05669 4
#> ATC:kmeans  82          0.10712 5
#> ATC:kmeans 103          0.05998 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 27425 rows and 116 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 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-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 1.000           0.998       0.999         0.5043 0.496   0.496
#> 3 3 0.831           0.905       0.945         0.2173 0.894   0.788
#> 4 4 0.918           0.889       0.939         0.1130 0.922   0.805
#> 5 5 0.790           0.667       0.833         0.0799 0.989   0.966
#> 6 6 0.747           0.476       0.763         0.0540 0.908   0.716

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

suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2

There is also optional best \(k\) = 2 that is worth to check.

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
#> GSM613638     2   0.000      1.000 0.0 1.0
#> GSM613639     1   0.000      0.998 1.0 0.0
#> GSM613640     1   0.000      0.998 1.0 0.0
#> GSM613641     1   0.000      0.998 1.0 0.0
#> GSM613642     1   0.000      0.998 1.0 0.0
#> GSM613643     1   0.000      0.998 1.0 0.0
#> GSM613644     1   0.000      0.998 1.0 0.0
#> GSM613645     1   0.000      0.998 1.0 0.0
#> GSM613646     2   0.000      1.000 0.0 1.0
#> GSM613647     2   0.000      1.000 0.0 1.0
#> GSM613648     2   0.000      1.000 0.0 1.0
#> GSM613649     2   0.000      1.000 0.0 1.0
#> GSM613650     2   0.000      1.000 0.0 1.0
#> GSM613651     2   0.000      1.000 0.0 1.0
#> GSM613652     2   0.000      1.000 0.0 1.0
#> GSM613653     2   0.000      1.000 0.0 1.0
#> GSM613654     2   0.000      1.000 0.0 1.0
#> GSM613655     1   0.000      0.998 1.0 0.0
#> GSM613656     2   0.000      1.000 0.0 1.0
#> GSM613657     2   0.000      1.000 0.0 1.0
#> GSM613658     2   0.000      1.000 0.0 1.0
#> GSM613659     1   0.000      0.998 1.0 0.0
#> GSM613660     1   0.000      0.998 1.0 0.0
#> GSM613661     1   0.000      0.998 1.0 0.0
#> GSM613662     1   0.000      0.998 1.0 0.0
#> GSM613663     1   0.000      0.998 1.0 0.0
#> GSM613664     1   0.000      0.998 1.0 0.0
#> GSM613665     1   0.000      0.998 1.0 0.0
#> GSM613666     1   0.000      0.998 1.0 0.0
#> GSM613667     1   0.000      0.998 1.0 0.0
#> GSM613668     1   0.000      0.998 1.0 0.0
#> GSM613669     1   0.000      0.998 1.0 0.0
#> GSM613670     1   0.000      0.998 1.0 0.0
#> GSM613671     1   0.000      0.998 1.0 0.0
#> GSM613672     1   0.000      0.998 1.0 0.0
#> GSM613673     1   0.000      0.998 1.0 0.0
#> GSM613674     1   0.000      0.998 1.0 0.0
#> GSM613675     1   0.000      0.998 1.0 0.0
#> GSM613676     1   0.000      0.998 1.0 0.0
#> GSM613677     1   0.000      0.998 1.0 0.0
#> GSM613678     1   0.000      0.998 1.0 0.0
#> GSM613679     1   0.000      0.998 1.0 0.0
#> GSM613680     1   0.000      0.998 1.0 0.0
#> GSM613681     1   0.000      0.998 1.0 0.0
#> GSM613682     1   0.000      0.998 1.0 0.0
#> GSM613683     1   0.000      0.998 1.0 0.0
#> GSM613684     1   0.469      0.889 0.9 0.1
#> GSM613685     1   0.000      0.998 1.0 0.0
#> GSM613686     1   0.000      0.998 1.0 0.0
#> GSM613687     1   0.000      0.998 1.0 0.0
#> GSM613688     1   0.000      0.998 1.0 0.0
#> GSM613689     2   0.000      1.000 0.0 1.0
#> GSM613690     2   0.000      1.000 0.0 1.0
#> GSM613691     1   0.000      0.998 1.0 0.0
#> GSM613692     2   0.000      1.000 0.0 1.0
#> GSM613693     2   0.000      1.000 0.0 1.0
#> GSM613694     2   0.000      1.000 0.0 1.0
#> GSM613695     2   0.000      1.000 0.0 1.0
#> GSM613696     2   0.000      1.000 0.0 1.0
#> GSM613697     2   0.000      1.000 0.0 1.0
#> GSM613698     2   0.000      1.000 0.0 1.0
#> GSM613699     2   0.000      1.000 0.0 1.0
#> GSM613700     1   0.000      0.998 1.0 0.0
#> GSM613701     1   0.000      0.998 1.0 0.0
#> GSM613702     1   0.000      0.998 1.0 0.0
#> GSM613703     1   0.000      0.998 1.0 0.0
#> GSM613704     1   0.000      0.998 1.0 0.0
#> GSM613705     2   0.000      1.000 0.0 1.0
#> GSM613706     1   0.000      0.998 1.0 0.0
#> GSM613707     1   0.000      0.998 1.0 0.0
#> GSM613708     1   0.000      0.998 1.0 0.0
#> GSM613709     1   0.000      0.998 1.0 0.0
#> GSM613710     1   0.000      0.998 1.0 0.0
#> GSM613711     2   0.000      1.000 0.0 1.0
#> GSM613712     2   0.000      1.000 0.0 1.0
#> GSM613713     2   0.000      1.000 0.0 1.0
#> GSM613714     2   0.000      1.000 0.0 1.0
#> GSM613715     2   0.000      1.000 0.0 1.0
#> GSM613716     2   0.000      1.000 0.0 1.0
#> GSM613717     2   0.000      1.000 0.0 1.0
#> GSM613718     2   0.000      1.000 0.0 1.0
#> GSM613719     2   0.000      1.000 0.0 1.0
#> GSM613720     2   0.000      1.000 0.0 1.0
#> GSM613721     2   0.000      1.000 0.0 1.0
#> GSM613722     1   0.000      0.998 1.0 0.0
#> GSM613723     2   0.000      1.000 0.0 1.0
#> GSM613724     1   0.000      0.998 1.0 0.0
#> GSM613725     1   0.000      0.998 1.0 0.0
#> GSM613726     1   0.000      0.998 1.0 0.0
#> GSM613727     1   0.000      0.998 1.0 0.0
#> GSM613728     1   0.000      0.998 1.0 0.0
#> GSM613729     1   0.000      0.998 1.0 0.0
#> GSM613730     1   0.000      0.998 1.0 0.0
#> GSM613731     1   0.000      0.998 1.0 0.0
#> GSM613732     2   0.000      1.000 0.0 1.0
#> GSM613733     2   0.000      1.000 0.0 1.0
#> GSM613734     2   0.000      1.000 0.0 1.0
#> GSM613735     2   0.000      1.000 0.0 1.0
#> GSM613736     2   0.000      1.000 0.0 1.0
#> GSM613737     2   0.000      1.000 0.0 1.0
#> GSM613738     2   0.000      1.000 0.0 1.0
#> GSM613739     2   0.000      1.000 0.0 1.0
#> GSM613740     2   0.000      1.000 0.0 1.0
#> GSM613741     2   0.000      1.000 0.0 1.0
#> GSM613742     2   0.000      1.000 0.0 1.0
#> GSM613743     2   0.000      1.000 0.0 1.0
#> GSM613744     2   0.000      1.000 0.0 1.0
#> GSM613745     2   0.000      1.000 0.0 1.0
#> GSM613746     2   0.000      1.000 0.0 1.0
#> GSM613747     2   0.000      1.000 0.0 1.0
#> GSM613748     1   0.000      0.998 1.0 0.0
#> GSM613749     1   0.000      0.998 1.0 0.0
#> GSM613750     2   0.000      1.000 0.0 1.0
#> GSM613751     2   0.000      1.000 0.0 1.0
#> GSM613752     2   0.000      1.000 0.0 1.0
#> GSM613753     2   0.000      1.000 0.0 1.0

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM613638     2  0.3551      0.804 0.000 0.868 0.132
#> GSM613639     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613640     2  0.0424      0.888 0.008 0.992 0.000
#> GSM613641     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613642     2  0.3619      0.866 0.136 0.864 0.000
#> GSM613643     2  0.0237      0.890 0.000 0.996 0.004
#> GSM613644     2  0.0237      0.890 0.000 0.996 0.004
#> GSM613645     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613646     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613647     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613648     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613649     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613650     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613651     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613652     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613653     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613654     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613655     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613656     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613657     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613658     2  0.0237      0.890 0.000 0.996 0.004
#> GSM613659     1  0.6062      0.182 0.616 0.384 0.000
#> GSM613660     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613661     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613662     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613663     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613664     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613665     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613666     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613667     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613668     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613669     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613670     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613671     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613672     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613673     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613674     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613675     1  0.2537      0.817 0.920 0.080 0.000
#> GSM613676     2  0.6295      0.287 0.472 0.528 0.000
#> GSM613677     2  0.3340      0.873 0.120 0.880 0.000
#> GSM613678     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613679     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613680     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613681     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613682     1  0.3267      0.899 0.884 0.116 0.000
#> GSM613683     2  0.0237      0.890 0.004 0.996 0.000
#> GSM613684     2  0.3896      0.866 0.128 0.864 0.008
#> GSM613685     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613686     1  0.3267      0.899 0.884 0.116 0.000
#> GSM613687     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613688     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613689     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613690     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613691     1  0.0475      0.880 0.992 0.004 0.004
#> GSM613692     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613693     3  0.1878      0.946 0.044 0.004 0.952
#> GSM613694     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613695     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613696     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613697     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613698     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613699     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613700     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613701     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613702     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613703     1  0.3267      0.899 0.884 0.116 0.000
#> GSM613704     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613705     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613706     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613707     1  0.6286     -0.134 0.536 0.464 0.000
#> GSM613708     2  0.0424      0.888 0.008 0.992 0.000
#> GSM613709     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613710     2  0.3619      0.866 0.136 0.864 0.000
#> GSM613711     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613712     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613713     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613714     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613715     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613716     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613717     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613718     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613719     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613720     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613721     3  0.3784      0.841 0.132 0.004 0.864
#> GSM613722     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613723     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613724     2  0.0237      0.890 0.000 0.996 0.004
#> GSM613725     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613726     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613727     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613728     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613729     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613730     2  0.3482      0.871 0.128 0.872 0.000
#> GSM613731     1  0.3482      0.899 0.872 0.128 0.000
#> GSM613732     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613733     3  0.3349      0.870 0.108 0.004 0.888
#> GSM613734     3  0.3551      0.836 0.000 0.132 0.868
#> GSM613735     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613736     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613737     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613738     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613739     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613740     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613741     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613742     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613743     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613744     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613745     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613746     3  0.1878      0.946 0.044 0.004 0.952
#> GSM613747     3  0.0237      0.987 0.000 0.004 0.996
#> GSM613748     1  0.5859      0.310 0.656 0.344 0.000
#> GSM613749     1  0.0000      0.885 1.000 0.000 0.000
#> GSM613750     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613751     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613752     3  0.0000      0.988 0.000 0.000 1.000
#> GSM613753     3  0.0000      0.988 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
#> GSM613638     2  0.2266      0.798 0.000 0.912 0.084 0.004
#> GSM613639     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613640     2  0.1474      0.852 0.052 0.948 0.000 0.000
#> GSM613641     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613642     2  0.0188      0.847 0.000 0.996 0.000 0.004
#> GSM613643     2  0.1576      0.852 0.048 0.948 0.000 0.004
#> GSM613644     2  0.1771      0.852 0.036 0.948 0.012 0.004
#> GSM613645     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613646     4  0.1022      0.957 0.000 0.000 0.032 0.968
#> GSM613647     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613648     3  0.2469      0.911 0.000 0.000 0.892 0.108
#> GSM613649     3  0.2469      0.911 0.000 0.000 0.892 0.108
#> GSM613650     3  0.2589      0.905 0.000 0.000 0.884 0.116
#> GSM613651     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613652     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613653     4  0.1302      0.956 0.000 0.000 0.044 0.956
#> GSM613654     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613655     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613656     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613657     3  0.2469      0.911 0.000 0.000 0.892 0.108
#> GSM613658     2  0.4041      0.776 0.056 0.840 0.100 0.004
#> GSM613659     1  0.6005      0.131 0.500 0.460 0.000 0.040
#> GSM613660     1  0.2546      0.920 0.912 0.060 0.000 0.028
#> GSM613661     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613662     1  0.2385      0.923 0.920 0.052 0.000 0.028
#> GSM613663     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613664     1  0.2385      0.923 0.920 0.052 0.000 0.028
#> GSM613665     1  0.2385      0.923 0.920 0.052 0.000 0.028
#> GSM613666     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613667     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613668     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613669     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613670     1  0.2385      0.923 0.920 0.052 0.000 0.028
#> GSM613671     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613672     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613673     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613674     1  0.2759      0.915 0.904 0.052 0.000 0.044
#> GSM613675     1  0.4775      0.720 0.740 0.232 0.000 0.028
#> GSM613676     2  0.5331      0.406 0.332 0.644 0.000 0.024
#> GSM613677     2  0.0188      0.849 0.004 0.996 0.000 0.000
#> GSM613678     1  0.2413      0.921 0.916 0.064 0.000 0.020
#> GSM613679     1  0.2385      0.923 0.920 0.052 0.000 0.028
#> GSM613680     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613681     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613682     1  0.0592      0.935 0.984 0.000 0.000 0.016
#> GSM613683     2  0.1637      0.848 0.060 0.940 0.000 0.000
#> GSM613684     2  0.0707      0.842 0.000 0.980 0.000 0.020
#> GSM613685     1  0.4070      0.843 0.824 0.132 0.000 0.044
#> GSM613686     1  0.0376      0.936 0.992 0.004 0.000 0.004
#> GSM613687     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613688     1  0.2840      0.913 0.900 0.056 0.000 0.044
#> GSM613689     3  0.2345      0.916 0.000 0.000 0.900 0.100
#> GSM613690     3  0.0188      0.945 0.000 0.000 0.996 0.004
#> GSM613691     4  0.0524      0.922 0.004 0.008 0.000 0.988
#> GSM613692     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613693     4  0.0817      0.954 0.000 0.000 0.024 0.976
#> GSM613694     3  0.2408      0.914 0.000 0.000 0.896 0.104
#> GSM613695     3  0.0188      0.945 0.000 0.000 0.996 0.004
#> GSM613696     3  0.2704      0.899 0.000 0.000 0.876 0.124
#> GSM613697     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613698     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM613699     3  0.2814      0.891 0.000 0.000 0.868 0.132
#> GSM613700     1  0.2385      0.923 0.920 0.052 0.000 0.028
#> GSM613701     1  0.2385      0.923 0.920 0.052 0.000 0.028
#> GSM613702     1  0.2174      0.925 0.928 0.052 0.000 0.020
#> GSM613703     1  0.0524      0.936 0.988 0.004 0.000 0.008
#> GSM613704     1  0.2385      0.923 0.920 0.052 0.000 0.028
#> GSM613705     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613706     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613707     2  0.5905      0.208 0.396 0.564 0.000 0.040
#> GSM613708     2  0.1474      0.852 0.052 0.948 0.000 0.000
#> GSM613709     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613710     2  0.0188      0.847 0.000 0.996 0.000 0.004
#> GSM613711     3  0.2216      0.921 0.000 0.000 0.908 0.092
#> GSM613712     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613713     4  0.1389      0.954 0.000 0.000 0.048 0.952
#> GSM613714     3  0.1118      0.943 0.000 0.000 0.964 0.036
#> GSM613715     3  0.0469      0.945 0.000 0.000 0.988 0.012
#> GSM613716     3  0.2216      0.921 0.000 0.000 0.908 0.092
#> GSM613717     3  0.4967      0.248 0.000 0.000 0.548 0.452
#> GSM613718     3  0.1118      0.943 0.000 0.000 0.964 0.036
#> GSM613719     3  0.2530      0.908 0.000 0.000 0.888 0.112
#> GSM613720     3  0.2469      0.911 0.000 0.000 0.892 0.108
#> GSM613721     4  0.0336      0.936 0.000 0.000 0.008 0.992
#> GSM613722     1  0.2385      0.923 0.920 0.052 0.000 0.028
#> GSM613723     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613724     2  0.3504      0.810 0.056 0.872 0.068 0.004
#> GSM613725     1  0.2385      0.923 0.920 0.052 0.000 0.028
#> GSM613726     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613727     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613728     1  0.2385      0.923 0.920 0.052 0.000 0.028
#> GSM613729     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613730     2  0.0188      0.848 0.004 0.996 0.000 0.000
#> GSM613731     1  0.0000      0.937 1.000 0.000 0.000 0.000
#> GSM613732     3  0.0469      0.945 0.000 0.000 0.988 0.012
#> GSM613733     4  0.1940      0.928 0.000 0.000 0.076 0.924
#> GSM613734     3  0.1743      0.897 0.056 0.000 0.940 0.004
#> GSM613735     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613736     3  0.1118      0.943 0.000 0.000 0.964 0.036
#> GSM613737     3  0.2469      0.911 0.000 0.000 0.892 0.108
#> GSM613738     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613739     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613740     3  0.1118      0.943 0.000 0.000 0.964 0.036
#> GSM613741     4  0.1474      0.952 0.000 0.000 0.052 0.948
#> GSM613742     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613743     3  0.1867      0.930 0.000 0.000 0.928 0.072
#> GSM613744     3  0.1118      0.943 0.000 0.000 0.964 0.036
#> GSM613745     4  0.2469      0.888 0.000 0.000 0.108 0.892
#> GSM613746     4  0.0817      0.954 0.000 0.000 0.024 0.976
#> GSM613747     3  0.0188      0.944 0.000 0.000 0.996 0.004
#> GSM613748     1  0.5483      0.225 0.536 0.448 0.000 0.016
#> GSM613749     1  0.2089      0.926 0.932 0.048 0.000 0.020
#> GSM613750     3  0.0469      0.945 0.000 0.000 0.988 0.012
#> GSM613751     3  0.1118      0.943 0.000 0.000 0.964 0.036
#> GSM613752     3  0.1118      0.943 0.000 0.000 0.964 0.036
#> GSM613753     3  0.0188      0.945 0.000 0.000 0.996 0.004

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     4  0.1557      0.810 0.000 0.052 0.000 0.940 0.008
#> GSM613639     1  0.4150      0.659 0.612 0.388 0.000 0.000 0.000
#> GSM613640     4  0.0404      0.822 0.000 0.012 0.000 0.988 0.000
#> GSM613641     1  0.4101      0.661 0.628 0.372 0.000 0.000 0.000
#> GSM613642     4  0.3550      0.651 0.004 0.236 0.000 0.760 0.000
#> GSM613643     4  0.0162      0.822 0.000 0.004 0.000 0.996 0.000
#> GSM613644     4  0.0290      0.823 0.000 0.008 0.000 0.992 0.000
#> GSM613645     1  0.4126      0.660 0.620 0.380 0.000 0.000 0.000
#> GSM613646     3  0.0865      0.938 0.000 0.004 0.972 0.000 0.024
#> GSM613647     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613648     5  0.2077      0.891 0.000 0.008 0.084 0.000 0.908
#> GSM613649     5  0.2136      0.888 0.000 0.008 0.088 0.000 0.904
#> GSM613650     5  0.2685      0.875 0.000 0.028 0.092 0.000 0.880
#> GSM613651     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613652     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613653     3  0.1059      0.936 0.004 0.008 0.968 0.000 0.020
#> GSM613654     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613655     1  0.4331      0.653 0.596 0.400 0.000 0.004 0.000
#> GSM613656     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613657     5  0.2136      0.888 0.000 0.008 0.088 0.000 0.904
#> GSM613658     4  0.3917      0.708 0.000 0.184 0.024 0.784 0.008
#> GSM613659     1  0.6003     -0.784 0.448 0.440 0.000 0.112 0.000
#> GSM613660     1  0.2561      0.200 0.856 0.144 0.000 0.000 0.000
#> GSM613661     1  0.4192      0.653 0.596 0.404 0.000 0.000 0.000
#> GSM613662     1  0.0000      0.478 1.000 0.000 0.000 0.000 0.000
#> GSM613663     1  0.4192      0.653 0.596 0.404 0.000 0.000 0.000
#> GSM613664     1  0.0000      0.478 1.000 0.000 0.000 0.000 0.000
#> GSM613665     1  0.0510      0.455 0.984 0.016 0.000 0.000 0.000
#> GSM613666     1  0.4030      0.659 0.648 0.352 0.000 0.000 0.000
#> GSM613667     1  0.4161      0.658 0.608 0.392 0.000 0.000 0.000
#> GSM613668     1  0.4101      0.659 0.628 0.372 0.000 0.000 0.000
#> GSM613669     1  0.4138      0.659 0.616 0.384 0.000 0.000 0.000
#> GSM613670     1  0.0000      0.478 1.000 0.000 0.000 0.000 0.000
#> GSM613671     1  0.4088      0.661 0.632 0.368 0.000 0.000 0.000
#> GSM613672     1  0.4341      0.651 0.592 0.404 0.000 0.004 0.000
#> GSM613673     1  0.4060      0.660 0.640 0.360 0.000 0.000 0.000
#> GSM613674     1  0.4256     -0.639 0.564 0.436 0.000 0.000 0.000
#> GSM613675     1  0.5684     -0.640 0.564 0.340 0.000 0.096 0.000
#> GSM613676     2  0.6576      0.646 0.340 0.444 0.000 0.216 0.000
#> GSM613677     4  0.0451      0.820 0.004 0.008 0.000 0.988 0.000
#> GSM613678     1  0.3636     -0.256 0.728 0.272 0.000 0.000 0.000
#> GSM613679     1  0.0162      0.473 0.996 0.004 0.000 0.000 0.000
#> GSM613680     1  0.4310      0.655 0.604 0.392 0.000 0.004 0.000
#> GSM613681     1  0.4161      0.657 0.608 0.392 0.000 0.000 0.000
#> GSM613682     2  0.4114      0.390 0.376 0.624 0.000 0.000 0.000
#> GSM613683     4  0.1792      0.780 0.000 0.084 0.000 0.916 0.000
#> GSM613684     4  0.4680      0.301 0.008 0.448 0.004 0.540 0.000
#> GSM613685     1  0.5548     -0.738 0.492 0.440 0.000 0.068 0.000
#> GSM613686     1  0.3895      0.649 0.680 0.320 0.000 0.000 0.000
#> GSM613687     1  0.4150      0.658 0.612 0.388 0.000 0.000 0.000
#> GSM613688     1  0.4256     -0.639 0.564 0.436 0.000 0.000 0.000
#> GSM613689     5  0.2208      0.892 0.000 0.020 0.072 0.000 0.908
#> GSM613690     5  0.0162      0.910 0.000 0.004 0.000 0.000 0.996
#> GSM613691     3  0.2769      0.800 0.092 0.032 0.876 0.000 0.000
#> GSM613692     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613693     3  0.0865      0.938 0.000 0.004 0.972 0.000 0.024
#> GSM613694     5  0.2423      0.886 0.000 0.024 0.080 0.000 0.896
#> GSM613695     5  0.0162      0.910 0.000 0.004 0.000 0.000 0.996
#> GSM613696     5  0.2597      0.877 0.000 0.024 0.092 0.000 0.884
#> GSM613697     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613698     5  0.0324      0.910 0.000 0.004 0.004 0.000 0.992
#> GSM613699     5  0.2707      0.871 0.000 0.024 0.100 0.000 0.876
#> GSM613700     1  0.0000      0.478 1.000 0.000 0.000 0.000 0.000
#> GSM613701     1  0.0162      0.473 0.996 0.004 0.000 0.000 0.000
#> GSM613702     1  0.0000      0.478 1.000 0.000 0.000 0.000 0.000
#> GSM613703     1  0.3837      0.645 0.692 0.308 0.000 0.000 0.000
#> GSM613704     1  0.0000      0.478 1.000 0.000 0.000 0.000 0.000
#> GSM613705     5  0.3281      0.867 0.000 0.080 0.024 0.032 0.864
#> GSM613706     1  0.4138      0.659 0.616 0.384 0.000 0.000 0.000
#> GSM613707     2  0.6344      0.701 0.400 0.440 0.000 0.160 0.000
#> GSM613708     4  0.0162      0.822 0.000 0.004 0.000 0.996 0.000
#> GSM613709     1  0.4150      0.658 0.612 0.388 0.000 0.000 0.000
#> GSM613710     4  0.5091      0.509 0.088 0.236 0.000 0.676 0.000
#> GSM613711     5  0.1845      0.901 0.000 0.016 0.056 0.000 0.928
#> GSM613712     5  0.0865      0.905 0.000 0.004 0.024 0.000 0.972
#> GSM613713     3  0.2144      0.905 0.000 0.020 0.912 0.000 0.068
#> GSM613714     5  0.1211      0.909 0.000 0.016 0.024 0.000 0.960
#> GSM613715     5  0.0162      0.910 0.000 0.004 0.000 0.000 0.996
#> GSM613716     5  0.1638      0.901 0.000 0.004 0.064 0.000 0.932
#> GSM613717     5  0.4789      0.345 0.000 0.024 0.392 0.000 0.584
#> GSM613718     5  0.0865      0.910 0.000 0.004 0.024 0.000 0.972
#> GSM613719     5  0.2193      0.886 0.000 0.008 0.092 0.000 0.900
#> GSM613720     5  0.2077      0.891 0.000 0.008 0.084 0.000 0.908
#> GSM613721     3  0.0960      0.924 0.016 0.004 0.972 0.000 0.008
#> GSM613722     1  0.0000      0.478 1.000 0.000 0.000 0.000 0.000
#> GSM613723     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613724     4  0.3565      0.722 0.000 0.176 0.024 0.800 0.000
#> GSM613725     1  0.0162      0.473 0.996 0.004 0.000 0.000 0.000
#> GSM613726     1  0.4138      0.659 0.616 0.384 0.000 0.000 0.000
#> GSM613727     1  0.4171      0.656 0.604 0.396 0.000 0.000 0.000
#> GSM613728     1  0.0404      0.461 0.988 0.012 0.000 0.000 0.000
#> GSM613729     1  0.4138      0.659 0.616 0.384 0.000 0.000 0.000
#> GSM613730     4  0.4430      0.641 0.076 0.172 0.000 0.752 0.000
#> GSM613731     1  0.4192      0.653 0.596 0.404 0.000 0.000 0.000
#> GSM613732     5  0.0162      0.910 0.000 0.004 0.000 0.000 0.996
#> GSM613733     3  0.2628      0.877 0.000 0.028 0.884 0.000 0.088
#> GSM613734     5  0.5299      0.697 0.000 0.204 0.024 0.072 0.700
#> GSM613735     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613736     5  0.1386      0.907 0.000 0.016 0.032 0.000 0.952
#> GSM613737     5  0.2077      0.891 0.000 0.008 0.084 0.000 0.908
#> GSM613738     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613739     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613740     5  0.1386      0.907 0.000 0.016 0.032 0.000 0.952
#> GSM613741     3  0.1106      0.936 0.000 0.012 0.964 0.000 0.024
#> GSM613742     5  0.2582      0.884 0.000 0.080 0.024 0.004 0.892
#> GSM613743     5  0.1626      0.904 0.000 0.016 0.044 0.000 0.940
#> GSM613744     5  0.1168      0.908 0.000 0.008 0.032 0.000 0.960
#> GSM613745     3  0.2653      0.869 0.000 0.024 0.880 0.000 0.096
#> GSM613746     3  0.0865      0.938 0.000 0.004 0.972 0.000 0.024
#> GSM613747     5  0.3206      0.863 0.000 0.108 0.024 0.012 0.856
#> GSM613748     1  0.6220     -0.607 0.540 0.272 0.000 0.188 0.000
#> GSM613749     1  0.0963      0.501 0.964 0.036 0.000 0.000 0.000
#> GSM613750     5  0.0000      0.910 0.000 0.000 0.000 0.000 1.000
#> GSM613751     5  0.0703      0.910 0.000 0.000 0.024 0.000 0.976
#> GSM613752     5  0.0865      0.910 0.000 0.004 0.024 0.000 0.972
#> GSM613753     5  0.0000      0.910 0.000 0.000 0.000 0.000 1.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
#> GSM613638     4  0.2357     0.7593 0.012 0.000 0.000 0.872 0.116 0.000
#> GSM613639     1  0.3838     0.8333 0.552 0.448 0.000 0.000 0.000 0.000
#> GSM613640     4  0.1572     0.7822 0.028 0.000 0.000 0.936 0.036 0.000
#> GSM613641     1  0.3854     0.8296 0.536 0.464 0.000 0.000 0.000 0.000
#> GSM613642     4  0.3961     0.7119 0.124 0.000 0.000 0.764 0.112 0.000
#> GSM613643     4  0.0458     0.7854 0.000 0.000 0.000 0.984 0.016 0.000
#> GSM613644     4  0.0000     0.7878 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613645     1  0.3797     0.8383 0.580 0.420 0.000 0.000 0.000 0.000
#> GSM613646     6  0.0713     0.8655 0.000 0.000 0.000 0.000 0.028 0.972
#> GSM613647     3  0.0146     0.4637 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM613648     3  0.4605     0.2464 0.008 0.000 0.596 0.000 0.364 0.032
#> GSM613649     3  0.4767     0.2230 0.008 0.000 0.592 0.000 0.356 0.044
#> GSM613650     3  0.5236    -0.0709 0.008 0.000 0.548 0.000 0.364 0.080
#> GSM613651     3  0.0000     0.4637 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613652     3  0.0146     0.4628 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM613653     6  0.1555     0.8572 0.004 0.004 0.000 0.000 0.060 0.932
#> GSM613654     3  0.0146     0.4628 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM613655     1  0.4101     0.8360 0.580 0.408 0.000 0.000 0.012 0.000
#> GSM613656     3  0.0146     0.4628 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM613657     3  0.4630     0.1483 0.008 0.000 0.560 0.000 0.404 0.028
#> GSM613658     4  0.6031     0.5019 0.016 0.000 0.188 0.512 0.284 0.000
#> GSM613659     2  0.6253     0.2944 0.364 0.452 0.000 0.020 0.160 0.004
#> GSM613660     2  0.3210     0.5573 0.168 0.804 0.000 0.000 0.028 0.000
#> GSM613661     1  0.3782     0.8390 0.588 0.412 0.000 0.000 0.000 0.000
#> GSM613662     2  0.0146     0.5995 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM613663     1  0.3789     0.8406 0.584 0.416 0.000 0.000 0.000 0.000
#> GSM613664     2  0.0000     0.6021 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613665     2  0.0632     0.6045 0.024 0.976 0.000 0.000 0.000 0.000
#> GSM613666     2  0.3868    -0.7861 0.492 0.508 0.000 0.000 0.000 0.000
#> GSM613667     1  0.3833     0.8411 0.556 0.444 0.000 0.000 0.000 0.000
#> GSM613668     1  0.3857     0.8251 0.532 0.468 0.000 0.000 0.000 0.000
#> GSM613669     1  0.3854     0.8295 0.536 0.464 0.000 0.000 0.000 0.000
#> GSM613670     2  0.0146     0.5995 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM613671     1  0.3860     0.8221 0.528 0.472 0.000 0.000 0.000 0.000
#> GSM613672     1  0.3737     0.8285 0.608 0.392 0.000 0.000 0.000 0.000
#> GSM613673     1  0.3862     0.8159 0.524 0.476 0.000 0.000 0.000 0.000
#> GSM613674     2  0.5436     0.3614 0.364 0.528 0.000 0.000 0.100 0.008
#> GSM613675     2  0.5537     0.4608 0.280 0.588 0.000 0.020 0.112 0.000
#> GSM613676     1  0.7494    -0.4275 0.360 0.268 0.000 0.212 0.160 0.000
#> GSM613677     4  0.0458     0.7883 0.000 0.000 0.000 0.984 0.016 0.000
#> GSM613678     2  0.4513     0.5328 0.212 0.700 0.000 0.004 0.084 0.000
#> GSM613679     2  0.0000     0.6021 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613680     1  0.3782     0.8362 0.588 0.412 0.000 0.000 0.000 0.000
#> GSM613681     1  0.3797     0.8376 0.580 0.420 0.000 0.000 0.000 0.000
#> GSM613682     1  0.5063    -0.2792 0.604 0.284 0.000 0.000 0.112 0.000
#> GSM613683     4  0.2872     0.7392 0.024 0.000 0.000 0.836 0.140 0.000
#> GSM613684     4  0.6181     0.4449 0.364 0.000 0.000 0.436 0.184 0.016
#> GSM613685     2  0.5993     0.3128 0.364 0.468 0.000 0.004 0.156 0.008
#> GSM613686     2  0.3866    -0.7732 0.484 0.516 0.000 0.000 0.000 0.000
#> GSM613687     1  0.3804     0.8398 0.576 0.424 0.000 0.000 0.000 0.000
#> GSM613688     2  0.5443     0.3587 0.364 0.520 0.000 0.000 0.112 0.004
#> GSM613689     3  0.4550    -0.0426 0.008 0.000 0.524 0.000 0.448 0.020
#> GSM613690     3  0.3428     0.4313 0.000 0.000 0.696 0.000 0.304 0.000
#> GSM613691     6  0.1788     0.8228 0.028 0.040 0.000 0.000 0.004 0.928
#> GSM613692     3  0.0146     0.4628 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM613693     6  0.0806     0.8648 0.008 0.000 0.000 0.000 0.020 0.972
#> GSM613694     3  0.5024    -0.2583 0.008 0.000 0.500 0.000 0.440 0.052
#> GSM613695     3  0.3515     0.4205 0.000 0.000 0.676 0.000 0.324 0.000
#> GSM613696     3  0.5300    -0.3929 0.008 0.000 0.468 0.000 0.448 0.076
#> GSM613697     3  0.0000     0.4637 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613698     3  0.2553     0.4555 0.008 0.000 0.848 0.000 0.144 0.000
#> GSM613699     3  0.5451    -0.4682 0.008 0.000 0.456 0.000 0.444 0.092
#> GSM613700     2  0.0146     0.5995 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM613701     2  0.0146     0.6036 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM613702     2  0.0146     0.5995 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM613703     2  0.3774    -0.6331 0.408 0.592 0.000 0.000 0.000 0.000
#> GSM613704     2  0.0146     0.5995 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM613705     3  0.0806     0.4425 0.000 0.000 0.972 0.020 0.008 0.000
#> GSM613706     1  0.4229     0.7954 0.548 0.436 0.000 0.000 0.016 0.000
#> GSM613707     2  0.6799     0.2331 0.364 0.416 0.000 0.052 0.160 0.008
#> GSM613708     4  0.0508     0.7886 0.012 0.000 0.000 0.984 0.004 0.000
#> GSM613709     1  0.3797     0.8383 0.580 0.420 0.000 0.000 0.000 0.000
#> GSM613710     4  0.5108     0.6742 0.152 0.036 0.000 0.692 0.120 0.000
#> GSM613711     3  0.4101     0.2225 0.000 0.000 0.580 0.000 0.408 0.012
#> GSM613712     3  0.2340     0.4569 0.000 0.000 0.852 0.000 0.148 0.000
#> GSM613713     6  0.3840     0.6247 0.000 0.000 0.020 0.000 0.284 0.696
#> GSM613714     3  0.3747     0.2950 0.000 0.000 0.604 0.000 0.396 0.000
#> GSM613715     3  0.3464     0.4277 0.000 0.000 0.688 0.000 0.312 0.000
#> GSM613716     3  0.4289     0.3224 0.000 0.000 0.612 0.000 0.360 0.028
#> GSM613717     5  0.5900     0.0000 0.004 0.000 0.336 0.000 0.472 0.188
#> GSM613718     3  0.3607     0.3936 0.000 0.000 0.652 0.000 0.348 0.000
#> GSM613719     3  0.4937     0.1841 0.008 0.000 0.592 0.000 0.340 0.060
#> GSM613720     3  0.4679     0.2260 0.008 0.000 0.588 0.000 0.368 0.036
#> GSM613721     6  0.0291     0.8636 0.004 0.000 0.000 0.000 0.004 0.992
#> GSM613722     2  0.0146     0.5995 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM613723     3  0.0146     0.4628 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM613724     4  0.5512     0.5760 0.016 0.000 0.116 0.584 0.284 0.000
#> GSM613725     2  0.0146     0.6035 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM613726     1  0.3828     0.8382 0.560 0.440 0.000 0.000 0.000 0.000
#> GSM613727     1  0.3810     0.8414 0.572 0.428 0.000 0.000 0.000 0.000
#> GSM613728     2  0.0547     0.6047 0.020 0.980 0.000 0.000 0.000 0.000
#> GSM613729     1  0.3833     0.8396 0.556 0.444 0.000 0.000 0.000 0.000
#> GSM613730     4  0.4905     0.6984 0.148 0.044 0.000 0.716 0.092 0.000
#> GSM613731     1  0.4057     0.8240 0.600 0.388 0.000 0.000 0.012 0.000
#> GSM613732     3  0.3547     0.4140 0.000 0.000 0.668 0.000 0.332 0.000
#> GSM613733     6  0.4107     0.6768 0.000 0.000 0.044 0.000 0.256 0.700
#> GSM613734     3  0.4712     0.0414 0.016 0.000 0.648 0.044 0.292 0.000
#> GSM613735     3  0.0146     0.4628 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM613736     3  0.4076     0.0280 0.000 0.000 0.540 0.000 0.452 0.008
#> GSM613737     3  0.4645     0.2596 0.008 0.000 0.616 0.000 0.336 0.040
#> GSM613738     3  0.0146     0.4628 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM613739     3  0.0146     0.4628 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM613740     3  0.3737     0.3062 0.000 0.000 0.608 0.000 0.392 0.000
#> GSM613741     6  0.1531     0.8567 0.004 0.000 0.000 0.000 0.068 0.928
#> GSM613742     3  0.0146     0.4628 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM613743     3  0.4076     0.0280 0.000 0.000 0.540 0.000 0.452 0.008
#> GSM613744     3  0.3695     0.3443 0.000 0.000 0.624 0.000 0.376 0.000
#> GSM613745     6  0.4000     0.7458 0.004 0.000 0.060 0.000 0.184 0.752
#> GSM613746     6  0.0291     0.8636 0.004 0.000 0.000 0.000 0.004 0.992
#> GSM613747     3  0.3259     0.1686 0.000 0.000 0.772 0.012 0.216 0.000
#> GSM613748     2  0.6886     0.2942 0.212 0.488 0.000 0.196 0.104 0.000
#> GSM613749     2  0.1007     0.5322 0.044 0.956 0.000 0.000 0.000 0.000
#> GSM613750     3  0.3547     0.4140 0.000 0.000 0.668 0.000 0.332 0.000
#> GSM613751     3  0.3578     0.4044 0.000 0.000 0.660 0.000 0.340 0.000
#> GSM613752     3  0.3578     0.4044 0.000 0.000 0.660 0.000 0.340 0.000
#> GSM613753     3  0.3531     0.4175 0.000 0.000 0.672 0.000 0.328 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-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 disease.state(p) k
#> ATC:skmeans 116          0.00835 2
#> ATC:skmeans 112          0.00141 3
#> ATC:skmeans 111          0.02037 4
#> ATC:skmeans  93          0.20474 5
#> ATC:skmeans  58          0.15102 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 27425 rows and 116 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 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-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 1.000           0.979       0.992         0.5011 0.499   0.499
#> 3 3 0.873           0.932       0.964         0.3051 0.770   0.571
#> 4 4 0.979           0.947       0.977         0.1105 0.911   0.749
#> 5 5 0.878           0.843       0.929         0.0725 0.951   0.825
#> 6 6 0.836           0.718       0.865         0.0340 0.970   0.873

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

suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2

There is also optional best \(k\) = 2 that is worth to check.

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
#> GSM613638     2  0.0000      0.992 0.000 1.000
#> GSM613639     1  0.0000      0.992 1.000 0.000
#> GSM613640     1  0.0000      0.992 1.000 0.000
#> GSM613641     1  0.0000      0.992 1.000 0.000
#> GSM613642     1  0.0000      0.992 1.000 0.000
#> GSM613643     1  0.0000      0.992 1.000 0.000
#> GSM613644     1  0.1414      0.973 0.980 0.020
#> GSM613645     1  0.0000      0.992 1.000 0.000
#> GSM613646     1  0.9686      0.339 0.604 0.396
#> GSM613647     2  0.0000      0.992 0.000 1.000
#> GSM613648     2  0.0000      0.992 0.000 1.000
#> GSM613649     2  0.0000      0.992 0.000 1.000
#> GSM613650     2  0.0000      0.992 0.000 1.000
#> GSM613651     2  0.0000      0.992 0.000 1.000
#> GSM613652     2  0.0000      0.992 0.000 1.000
#> GSM613653     2  0.0000      0.992 0.000 1.000
#> GSM613654     2  0.0000      0.992 0.000 1.000
#> GSM613655     1  0.0000      0.992 1.000 0.000
#> GSM613656     2  0.0000      0.992 0.000 1.000
#> GSM613657     2  0.0000      0.992 0.000 1.000
#> GSM613658     1  0.3274      0.931 0.940 0.060
#> GSM613659     1  0.0000      0.992 1.000 0.000
#> GSM613660     1  0.0000      0.992 1.000 0.000
#> GSM613661     1  0.0000      0.992 1.000 0.000
#> GSM613662     1  0.0000      0.992 1.000 0.000
#> GSM613663     1  0.0000      0.992 1.000 0.000
#> GSM613664     1  0.0000      0.992 1.000 0.000
#> GSM613665     1  0.0000      0.992 1.000 0.000
#> GSM613666     1  0.0000      0.992 1.000 0.000
#> GSM613667     1  0.0000      0.992 1.000 0.000
#> GSM613668     1  0.0000      0.992 1.000 0.000
#> GSM613669     1  0.0000      0.992 1.000 0.000
#> GSM613670     1  0.0000      0.992 1.000 0.000
#> GSM613671     1  0.0000      0.992 1.000 0.000
#> GSM613672     1  0.0000      0.992 1.000 0.000
#> GSM613673     1  0.0000      0.992 1.000 0.000
#> GSM613674     1  0.0000      0.992 1.000 0.000
#> GSM613675     1  0.0000      0.992 1.000 0.000
#> GSM613676     1  0.0000      0.992 1.000 0.000
#> GSM613677     1  0.1184      0.977 0.984 0.016
#> GSM613678     1  0.0000      0.992 1.000 0.000
#> GSM613679     1  0.0000      0.992 1.000 0.000
#> GSM613680     1  0.0000      0.992 1.000 0.000
#> GSM613681     1  0.0000      0.992 1.000 0.000
#> GSM613682     1  0.0000      0.992 1.000 0.000
#> GSM613683     1  0.0000      0.992 1.000 0.000
#> GSM613684     1  0.0000      0.992 1.000 0.000
#> GSM613685     1  0.0000      0.992 1.000 0.000
#> GSM613686     1  0.0000      0.992 1.000 0.000
#> GSM613687     1  0.0000      0.992 1.000 0.000
#> GSM613688     1  0.0000      0.992 1.000 0.000
#> GSM613689     2  0.0000      0.992 0.000 1.000
#> GSM613690     2  0.0000      0.992 0.000 1.000
#> GSM613691     1  0.0000      0.992 1.000 0.000
#> GSM613692     2  0.0000      0.992 0.000 1.000
#> GSM613693     2  0.1414      0.972 0.020 0.980
#> GSM613694     2  0.0000      0.992 0.000 1.000
#> GSM613695     2  0.0000      0.992 0.000 1.000
#> GSM613696     2  0.0000      0.992 0.000 1.000
#> GSM613697     2  0.0000      0.992 0.000 1.000
#> GSM613698     2  0.0000      0.992 0.000 1.000
#> GSM613699     2  0.0000      0.992 0.000 1.000
#> GSM613700     1  0.0000      0.992 1.000 0.000
#> GSM613701     1  0.0000      0.992 1.000 0.000
#> GSM613702     1  0.0000      0.992 1.000 0.000
#> GSM613703     1  0.0000      0.992 1.000 0.000
#> GSM613704     1  0.0000      0.992 1.000 0.000
#> GSM613705     2  0.0000      0.992 0.000 1.000
#> GSM613706     1  0.0000      0.992 1.000 0.000
#> GSM613707     1  0.0000      0.992 1.000 0.000
#> GSM613708     1  0.0000      0.992 1.000 0.000
#> GSM613709     1  0.0000      0.992 1.000 0.000
#> GSM613710     1  0.0000      0.992 1.000 0.000
#> GSM613711     2  0.0000      0.992 0.000 1.000
#> GSM613712     2  0.0000      0.992 0.000 1.000
#> GSM613713     2  0.0000      0.992 0.000 1.000
#> GSM613714     2  0.0000      0.992 0.000 1.000
#> GSM613715     2  0.0000      0.992 0.000 1.000
#> GSM613716     2  0.0000      0.992 0.000 1.000
#> GSM613717     2  0.0000      0.992 0.000 1.000
#> GSM613718     2  0.0000      0.992 0.000 1.000
#> GSM613719     2  0.0000      0.992 0.000 1.000
#> GSM613720     2  0.0000      0.992 0.000 1.000
#> GSM613721     1  0.0672      0.985 0.992 0.008
#> GSM613722     1  0.0000      0.992 1.000 0.000
#> GSM613723     2  0.0000      0.992 0.000 1.000
#> GSM613724     1  0.0000      0.992 1.000 0.000
#> GSM613725     1  0.0000      0.992 1.000 0.000
#> GSM613726     1  0.0000      0.992 1.000 0.000
#> GSM613727     1  0.0000      0.992 1.000 0.000
#> GSM613728     1  0.0000      0.992 1.000 0.000
#> GSM613729     1  0.0000      0.992 1.000 0.000
#> GSM613730     1  0.0000      0.992 1.000 0.000
#> GSM613731     1  0.0000      0.992 1.000 0.000
#> GSM613732     2  0.0000      0.992 0.000 1.000
#> GSM613733     2  0.0000      0.992 0.000 1.000
#> GSM613734     2  0.9732      0.310 0.404 0.596
#> GSM613735     2  0.0000      0.992 0.000 1.000
#> GSM613736     2  0.0000      0.992 0.000 1.000
#> GSM613737     2  0.0000      0.992 0.000 1.000
#> GSM613738     2  0.0000      0.992 0.000 1.000
#> GSM613739     2  0.0000      0.992 0.000 1.000
#> GSM613740     2  0.0000      0.992 0.000 1.000
#> GSM613741     2  0.0000      0.992 0.000 1.000
#> GSM613742     2  0.0000      0.992 0.000 1.000
#> GSM613743     2  0.0000      0.992 0.000 1.000
#> GSM613744     2  0.0000      0.992 0.000 1.000
#> GSM613745     2  0.0000      0.992 0.000 1.000
#> GSM613746     2  0.0000      0.992 0.000 1.000
#> GSM613747     2  0.0000      0.992 0.000 1.000
#> GSM613748     1  0.0000      0.992 1.000 0.000
#> GSM613749     1  0.0000      0.992 1.000 0.000
#> GSM613750     2  0.0000      0.992 0.000 1.000
#> GSM613751     2  0.0000      0.992 0.000 1.000
#> GSM613752     2  0.0000      0.992 0.000 1.000
#> GSM613753     2  0.0000      0.992 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
#> GSM613638     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613639     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613640     2  0.0237      0.967 0.004 0.996 0.000
#> GSM613641     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613642     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613643     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613644     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613645     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613646     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613647     3  0.0592      0.923 0.000 0.012 0.988
#> GSM613648     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613649     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613650     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613651     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613652     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613653     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613654     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613655     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613656     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613657     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613658     2  0.2400      0.901 0.064 0.932 0.004
#> GSM613659     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613660     1  0.6267      0.196 0.548 0.452 0.000
#> GSM613661     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613662     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613663     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613664     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613665     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613666     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613667     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613668     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613669     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613670     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613671     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613672     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613673     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613674     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613675     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613676     1  0.5785      0.508 0.668 0.332 0.000
#> GSM613677     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613678     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613679     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613680     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613681     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613682     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613683     1  0.1643      0.934 0.956 0.044 0.000
#> GSM613684     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613685     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613686     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613687     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613688     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613689     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613690     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613691     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613692     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613693     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613694     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613695     3  0.3551      0.889 0.000 0.132 0.868
#> GSM613696     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613697     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613698     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613699     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613700     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613701     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613702     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613703     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613704     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613705     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613706     1  0.4504      0.748 0.804 0.196 0.000
#> GSM613707     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613708     1  0.0424      0.968 0.992 0.008 0.000
#> GSM613709     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613710     1  0.4555      0.736 0.800 0.200 0.000
#> GSM613711     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613712     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613713     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613714     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613715     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613716     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613717     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613718     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613719     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613720     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613721     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613722     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613723     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613724     2  0.5138      0.655 0.252 0.748 0.000
#> GSM613725     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613726     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613727     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613728     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613729     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613730     2  0.3267      0.841 0.116 0.884 0.000
#> GSM613731     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613732     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613733     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613734     2  0.4782      0.788 0.016 0.820 0.164
#> GSM613735     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613736     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613737     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613738     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613739     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613740     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613741     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613742     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613743     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613744     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613745     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613746     2  0.0000      0.971 0.000 1.000 0.000
#> GSM613747     2  0.4062      0.799 0.000 0.836 0.164
#> GSM613748     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613749     1  0.0000      0.974 1.000 0.000 0.000
#> GSM613750     3  0.0000      0.926 0.000 0.000 1.000
#> GSM613751     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613752     3  0.4062      0.877 0.000 0.164 0.836
#> GSM613753     3  0.0000      0.926 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
#> GSM613638     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613639     2  0.0188      0.978 0.004 0.996 0.000 0.000
#> GSM613640     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613641     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613642     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613643     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613644     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613645     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613646     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613647     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613648     3  0.4817      0.373 0.000 0.000 0.612 0.388
#> GSM613649     3  0.0592      0.974 0.000 0.000 0.984 0.016
#> GSM613650     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613651     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613652     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613653     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613654     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613655     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613656     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613657     3  0.0469      0.977 0.000 0.000 0.988 0.012
#> GSM613658     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613659     2  0.3444      0.775 0.184 0.816 0.000 0.000
#> GSM613660     1  0.3569      0.741 0.804 0.000 0.000 0.196
#> GSM613661     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613662     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613663     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613664     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613665     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613666     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613667     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613668     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613669     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613670     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613671     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613672     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613673     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613674     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613675     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613676     2  0.6537      0.508 0.200 0.636 0.000 0.164
#> GSM613677     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613678     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613679     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613680     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613681     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613682     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613683     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613684     4  0.4304      0.566 0.284 0.000 0.000 0.716
#> GSM613685     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613686     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613687     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613688     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613689     3  0.1716      0.927 0.000 0.000 0.936 0.064
#> GSM613690     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613691     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613692     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613693     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613694     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613695     3  0.0188      0.979 0.000 0.000 0.996 0.004
#> GSM613696     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613697     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613698     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613699     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613700     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613701     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613702     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613703     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613704     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613705     1  0.3311      0.793 0.828 0.000 0.000 0.172
#> GSM613706     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613707     2  0.0592      0.966 0.000 0.984 0.000 0.016
#> GSM613708     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613709     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613710     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613711     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613712     3  0.0188      0.979 0.000 0.000 0.996 0.004
#> GSM613713     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613714     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613715     3  0.0469      0.977 0.000 0.000 0.988 0.012
#> GSM613716     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613717     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613718     3  0.0336      0.978 0.000 0.000 0.992 0.008
#> GSM613719     3  0.0469      0.977 0.000 0.000 0.988 0.012
#> GSM613720     3  0.0469      0.977 0.000 0.000 0.988 0.012
#> GSM613721     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613722     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613723     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613724     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613725     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613726     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613727     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613728     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613729     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613730     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613731     1  0.0000      0.941 1.000 0.000 0.000 0.000
#> GSM613732     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613733     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613734     1  0.3718      0.792 0.820 0.000 0.012 0.168
#> GSM613735     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613736     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613737     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613738     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613739     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613740     3  0.0469      0.977 0.000 0.000 0.988 0.012
#> GSM613741     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613742     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613743     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613744     3  0.0469      0.977 0.000 0.000 0.988 0.012
#> GSM613745     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613746     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM613747     1  0.5300      0.350 0.580 0.000 0.012 0.408
#> GSM613748     2  0.4164      0.645 0.264 0.736 0.000 0.000
#> GSM613749     2  0.0000      0.981 0.000 1.000 0.000 0.000
#> GSM613750     3  0.0000      0.980 0.000 0.000 1.000 0.000
#> GSM613751     3  0.0469      0.977 0.000 0.000 0.988 0.012
#> GSM613752     3  0.0469      0.977 0.000 0.000 0.988 0.012
#> GSM613753     3  0.0000      0.980 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
#> GSM613638     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613639     1  0.0162     0.8446 0.996 0.000 0.000 0.004 0.000
#> GSM613640     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613641     1  0.2127     0.7556 0.892 0.108 0.000 0.000 0.000
#> GSM613642     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613643     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613644     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613645     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613646     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613647     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613648     5  0.4774     0.4433 0.000 0.028 0.360 0.000 0.612
#> GSM613649     5  0.1270     0.9422 0.000 0.000 0.052 0.000 0.948
#> GSM613650     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613651     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613652     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613653     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613654     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613655     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613656     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613657     5  0.1197     0.9452 0.000 0.000 0.048 0.000 0.952
#> GSM613658     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613659     1  0.5038     0.6080 0.704 0.164 0.000 0.132 0.000
#> GSM613660     4  0.3695     0.7172 0.000 0.164 0.036 0.800 0.000
#> GSM613661     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613662     2  0.3707     0.6293 0.284 0.716 0.000 0.000 0.000
#> GSM613663     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613664     2  0.0963     0.7810 0.036 0.964 0.000 0.000 0.000
#> GSM613665     1  0.2773     0.7425 0.836 0.164 0.000 0.000 0.000
#> GSM613666     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613667     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613668     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613669     2  0.3837     0.6119 0.308 0.692 0.000 0.000 0.000
#> GSM613670     2  0.0963     0.7810 0.036 0.964 0.000 0.000 0.000
#> GSM613671     1  0.3366     0.5847 0.768 0.232 0.000 0.000 0.000
#> GSM613672     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613673     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613674     1  0.4126     0.4083 0.620 0.380 0.000 0.000 0.000
#> GSM613675     1  0.2773     0.7425 0.836 0.164 0.000 0.000 0.000
#> GSM613676     1  0.5887     0.5496 0.668 0.164 0.032 0.136 0.000
#> GSM613677     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613678     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613679     2  0.4227     0.1517 0.420 0.580 0.000 0.000 0.000
#> GSM613680     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613681     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613682     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613683     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613684     3  0.3707     0.5689 0.000 0.000 0.716 0.284 0.000
#> GSM613685     1  0.3612     0.6236 0.732 0.268 0.000 0.000 0.000
#> GSM613686     1  0.4242    -0.0168 0.572 0.428 0.000 0.000 0.000
#> GSM613687     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613688     1  0.1043     0.8289 0.960 0.040 0.000 0.000 0.000
#> GSM613689     5  0.2020     0.8936 0.000 0.000 0.100 0.000 0.900
#> GSM613690     5  0.0963     0.9612 0.000 0.036 0.000 0.000 0.964
#> GSM613691     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613692     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613693     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613694     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613695     5  0.1124     0.9610 0.000 0.036 0.004 0.000 0.960
#> GSM613696     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613697     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613698     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613699     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613700     2  0.0963     0.7810 0.036 0.964 0.000 0.000 0.000
#> GSM613701     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613702     1  0.2773     0.7425 0.836 0.164 0.000 0.000 0.000
#> GSM613703     2  0.3109     0.6948 0.200 0.800 0.000 0.000 0.000
#> GSM613704     2  0.0963     0.7810 0.036 0.964 0.000 0.000 0.000
#> GSM613705     4  0.2852     0.7729 0.000 0.000 0.172 0.828 0.000
#> GSM613706     4  0.0404     0.9170 0.012 0.000 0.000 0.988 0.000
#> GSM613707     1  0.3053     0.7385 0.828 0.164 0.008 0.000 0.000
#> GSM613708     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613709     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613710     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613711     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613712     5  0.0451     0.9642 0.000 0.008 0.004 0.000 0.988
#> GSM613713     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613714     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613715     5  0.1364     0.9592 0.000 0.036 0.012 0.000 0.952
#> GSM613716     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613717     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613718     5  0.1251     0.9602 0.000 0.036 0.008 0.000 0.956
#> GSM613719     5  0.1121     0.9479 0.000 0.000 0.044 0.000 0.956
#> GSM613720     5  0.1364     0.9592 0.000 0.036 0.012 0.000 0.952
#> GSM613721     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613722     2  0.3895     0.5718 0.320 0.680 0.000 0.000 0.000
#> GSM613723     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613724     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613725     1  0.4219     0.3146 0.584 0.416 0.000 0.000 0.000
#> GSM613726     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613727     1  0.0000     0.8470 1.000 0.000 0.000 0.000 0.000
#> GSM613728     1  0.2813     0.7394 0.832 0.168 0.000 0.000 0.000
#> GSM613729     1  0.2127     0.7556 0.892 0.108 0.000 0.000 0.000
#> GSM613730     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613731     4  0.0000     0.9288 0.000 0.000 0.000 1.000 0.000
#> GSM613732     5  0.0963     0.9612 0.000 0.036 0.000 0.000 0.964
#> GSM613733     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613734     4  0.3953     0.7479 0.000 0.000 0.168 0.784 0.048
#> GSM613735     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613736     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613737     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613738     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613739     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613740     5  0.1364     0.9592 0.000 0.036 0.012 0.000 0.952
#> GSM613741     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613742     5  0.0000     0.9642 0.000 0.000 0.000 0.000 1.000
#> GSM613743     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613744     5  0.1364     0.9592 0.000 0.036 0.012 0.000 0.952
#> GSM613745     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613746     3  0.0000     0.9839 0.000 0.000 1.000 0.000 0.000
#> GSM613747     4  0.5236     0.3008 0.000 0.000 0.408 0.544 0.048
#> GSM613748     1  0.4467     0.6685 0.752 0.164 0.000 0.084 0.000
#> GSM613749     1  0.4030     0.1983 0.648 0.352 0.000 0.000 0.000
#> GSM613750     5  0.0963     0.9612 0.000 0.036 0.000 0.000 0.964
#> GSM613751     5  0.1364     0.9592 0.000 0.036 0.012 0.000 0.952
#> GSM613752     5  0.1364     0.9592 0.000 0.036 0.012 0.000 0.952
#> GSM613753     5  0.0963     0.9612 0.000 0.036 0.000 0.000 0.964

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613639     1  0.0146     0.8256 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM613640     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613641     1  0.2135     0.7247 0.872 0.128 0.000 0.000 0.000 0.000
#> GSM613642     4  0.0146     0.9649 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM613643     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613644     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613645     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613646     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613647     5  0.3695     0.5263 0.000 0.000 0.000 0.000 0.624 0.376
#> GSM613648     5  0.5526     0.2471 0.000 0.000 0.324 0.000 0.524 0.152
#> GSM613649     5  0.5182     0.4612 0.000 0.000 0.096 0.000 0.532 0.372
#> GSM613650     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613651     5  0.0000     0.5508 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613652     5  0.0000     0.5508 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613653     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613654     5  0.0000     0.5508 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613655     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613656     5  0.0000     0.5508 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613657     5  0.5152     0.4626 0.000 0.000 0.092 0.000 0.532 0.376
#> GSM613658     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613659     1  0.4929     0.5599 0.664 0.200 0.000 0.132 0.000 0.004
#> GSM613660     4  0.2793     0.7057 0.000 0.200 0.000 0.800 0.000 0.000
#> GSM613661     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613662     2  0.3641     0.6091 0.248 0.732 0.000 0.000 0.000 0.020
#> GSM613663     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613664     2  0.0000     0.7140 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613665     1  0.3315     0.6880 0.780 0.200 0.000 0.000 0.000 0.020
#> GSM613666     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613667     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613668     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613669     2  0.3446     0.5547 0.308 0.692 0.000 0.000 0.000 0.000
#> GSM613670     2  0.0000     0.7140 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613671     1  0.3023     0.5939 0.768 0.232 0.000 0.000 0.000 0.000
#> GSM613672     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613673     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613674     1  0.4620     0.4016 0.584 0.368 0.000 0.000 0.000 0.048
#> GSM613675     1  0.2933     0.6959 0.796 0.200 0.000 0.000 0.000 0.004
#> GSM613676     1  0.4929     0.5535 0.664 0.200 0.000 0.132 0.000 0.004
#> GSM613677     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613678     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613679     2  0.3955     0.1590 0.384 0.608 0.000 0.000 0.000 0.008
#> GSM613680     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613681     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613682     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613683     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613684     3  0.3468     0.5795 0.000 0.000 0.712 0.284 0.000 0.004
#> GSM613685     1  0.4460     0.5243 0.644 0.304 0.000 0.000 0.000 0.052
#> GSM613686     1  0.3810     0.0544 0.572 0.428 0.000 0.000 0.000 0.000
#> GSM613687     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613688     1  0.1528     0.8032 0.936 0.048 0.000 0.000 0.000 0.016
#> GSM613689     5  0.5576     0.3740 0.000 0.000 0.144 0.000 0.480 0.376
#> GSM613690     5  0.3857     0.4653 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM613691     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613692     5  0.3221     0.5492 0.000 0.000 0.000 0.000 0.736 0.264
#> GSM613693     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613694     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613695     5  0.3857     0.4653 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM613696     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613697     5  0.3221     0.5492 0.000 0.000 0.000 0.000 0.736 0.264
#> GSM613698     5  0.3695     0.5263 0.000 0.000 0.000 0.000 0.624 0.376
#> GSM613699     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613700     2  0.0000     0.7140 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613701     1  0.1075     0.8081 0.952 0.000 0.000 0.000 0.000 0.048
#> GSM613702     1  0.3806     0.6700 0.752 0.200 0.000 0.000 0.000 0.048
#> GSM613703     2  0.2793     0.6087 0.200 0.800 0.000 0.000 0.000 0.000
#> GSM613704     2  0.0000     0.7140 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613705     4  0.2562     0.7570 0.000 0.000 0.172 0.828 0.000 0.000
#> GSM613706     4  0.0363     0.9547 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM613707     1  0.3867     0.6671 0.748 0.200 0.000 0.000 0.000 0.052
#> GSM613708     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613709     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613710     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613711     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613712     5  0.3756     0.5146 0.000 0.000 0.000 0.000 0.600 0.400
#> GSM613713     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613714     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613715     5  0.3857     0.4653 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM613716     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613717     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613718     5  0.3857     0.4653 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM613719     5  0.5029     0.4767 0.000 0.000 0.080 0.000 0.544 0.376
#> GSM613720     5  0.3857     0.4653 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM613721     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613722     2  0.4313     0.5339 0.284 0.668 0.000 0.000 0.000 0.048
#> GSM613723     5  0.0363     0.5407 0.000 0.000 0.000 0.000 0.988 0.012
#> GSM613724     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613725     1  0.4697     0.3155 0.548 0.404 0.000 0.000 0.000 0.048
#> GSM613726     1  0.0000     0.8276 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM613727     1  0.0146     0.8260 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM613728     1  0.3835     0.6661 0.748 0.204 0.000 0.000 0.000 0.048
#> GSM613729     1  0.2135     0.7247 0.872 0.128 0.000 0.000 0.000 0.000
#> GSM613730     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613731     4  0.0000     0.9677 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM613732     5  0.3857     0.4653 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM613733     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613734     5  0.5709    -0.2159 0.000 0.000 0.168 0.364 0.468 0.000
#> GSM613735     5  0.0000     0.5508 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613736     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613737     5  0.0000     0.5508 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613738     5  0.0000     0.5508 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613739     5  0.0000     0.5508 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613740     5  0.3857     0.4653 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM613741     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613742     5  0.0000     0.5508 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM613743     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613744     5  0.3857     0.4653 0.000 0.000 0.000 0.000 0.532 0.468
#> GSM613745     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613746     3  0.0000     0.9833 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM613747     5  0.5495    -0.1706 0.000 0.000 0.404 0.128 0.468 0.000
#> GSM613748     1  0.3945     0.6609 0.748 0.200 0.000 0.048 0.000 0.004
#> GSM613749     1  0.3620     0.2516 0.648 0.352 0.000 0.000 0.000 0.000
#> GSM613750     6  0.1141     0.9976 0.000 0.000 0.000 0.000 0.052 0.948
#> GSM613751     6  0.1204     0.9928 0.000 0.000 0.000 0.000 0.056 0.944
#> GSM613752     6  0.1141     0.9976 0.000 0.000 0.000 0.000 0.052 0.948
#> GSM613753     6  0.1141     0.9976 0.000 0.000 0.000 0.000 0.052 0.948

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 disease.state(p) k
#> ATC:pam 114          0.00782 2
#> ATC:pam 115          0.01264 3
#> ATC:pam 114          0.03159 4
#> ATC:pam 109          0.06145 5
#> ATC:pam  96          0.00675 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 27425 rows and 116 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 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-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 1.000           0.988       0.995         0.5019 0.498   0.498
#> 3 3 0.766           0.799       0.895         0.1706 0.965   0.930
#> 4 4 0.571           0.421       0.744         0.1791 0.866   0.718
#> 5 5 0.593           0.436       0.681         0.0813 0.814   0.545
#> 6 6 0.615           0.611       0.740         0.0544 0.833   0.493

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
#> GSM613638     1   0.118      0.983 0.984 0.016
#> GSM613639     1   0.000      0.999 1.000 0.000
#> GSM613640     1   0.000      0.999 1.000 0.000
#> GSM613641     1   0.000      0.999 1.000 0.000
#> GSM613642     1   0.000      0.999 1.000 0.000
#> GSM613643     1   0.000      0.999 1.000 0.000
#> GSM613644     1   0.000      0.999 1.000 0.000
#> GSM613645     1   0.000      0.999 1.000 0.000
#> GSM613646     2   0.000      0.991 0.000 1.000
#> GSM613647     2   0.000      0.991 0.000 1.000
#> GSM613648     2   0.000      0.991 0.000 1.000
#> GSM613649     2   0.000      0.991 0.000 1.000
#> GSM613650     2   0.000      0.991 0.000 1.000
#> GSM613651     2   0.000      0.991 0.000 1.000
#> GSM613652     2   0.000      0.991 0.000 1.000
#> GSM613653     2   0.000      0.991 0.000 1.000
#> GSM613654     2   0.000      0.991 0.000 1.000
#> GSM613655     1   0.000      0.999 1.000 0.000
#> GSM613656     2   0.000      0.991 0.000 1.000
#> GSM613657     2   0.000      0.991 0.000 1.000
#> GSM613658     1   0.118      0.983 0.984 0.016
#> GSM613659     1   0.000      0.999 1.000 0.000
#> GSM613660     1   0.000      0.999 1.000 0.000
#> GSM613661     1   0.000      0.999 1.000 0.000
#> GSM613662     1   0.000      0.999 1.000 0.000
#> GSM613663     1   0.000      0.999 1.000 0.000
#> GSM613664     1   0.000      0.999 1.000 0.000
#> GSM613665     1   0.000      0.999 1.000 0.000
#> GSM613666     1   0.000      0.999 1.000 0.000
#> GSM613667     1   0.000      0.999 1.000 0.000
#> GSM613668     1   0.000      0.999 1.000 0.000
#> GSM613669     1   0.000      0.999 1.000 0.000
#> GSM613670     1   0.000      0.999 1.000 0.000
#> GSM613671     1   0.000      0.999 1.000 0.000
#> GSM613672     1   0.000      0.999 1.000 0.000
#> GSM613673     1   0.000      0.999 1.000 0.000
#> GSM613674     1   0.000      0.999 1.000 0.000
#> GSM613675     1   0.000      0.999 1.000 0.000
#> GSM613676     1   0.000      0.999 1.000 0.000
#> GSM613677     1   0.000      0.999 1.000 0.000
#> GSM613678     1   0.000      0.999 1.000 0.000
#> GSM613679     1   0.000      0.999 1.000 0.000
#> GSM613680     1   0.000      0.999 1.000 0.000
#> GSM613681     1   0.000      0.999 1.000 0.000
#> GSM613682     1   0.000      0.999 1.000 0.000
#> GSM613683     1   0.000      0.999 1.000 0.000
#> GSM613684     1   0.000      0.999 1.000 0.000
#> GSM613685     1   0.000      0.999 1.000 0.000
#> GSM613686     1   0.000      0.999 1.000 0.000
#> GSM613687     1   0.000      0.999 1.000 0.000
#> GSM613688     1   0.000      0.999 1.000 0.000
#> GSM613689     2   0.000      0.991 0.000 1.000
#> GSM613690     2   0.000      0.991 0.000 1.000
#> GSM613691     2   0.118      0.976 0.016 0.984
#> GSM613692     2   0.000      0.991 0.000 1.000
#> GSM613693     2   0.000      0.991 0.000 1.000
#> GSM613694     2   0.000      0.991 0.000 1.000
#> GSM613695     2   0.000      0.991 0.000 1.000
#> GSM613696     2   0.000      0.991 0.000 1.000
#> GSM613697     2   0.000      0.991 0.000 1.000
#> GSM613698     2   0.000      0.991 0.000 1.000
#> GSM613699     2   0.000      0.991 0.000 1.000
#> GSM613700     1   0.000      0.999 1.000 0.000
#> GSM613701     1   0.000      0.999 1.000 0.000
#> GSM613702     1   0.000      0.999 1.000 0.000
#> GSM613703     1   0.000      0.999 1.000 0.000
#> GSM613704     1   0.000      0.999 1.000 0.000
#> GSM613705     2   0.988      0.225 0.436 0.564
#> GSM613706     1   0.000      0.999 1.000 0.000
#> GSM613707     1   0.000      0.999 1.000 0.000
#> GSM613708     1   0.000      0.999 1.000 0.000
#> GSM613709     1   0.000      0.999 1.000 0.000
#> GSM613710     1   0.000      0.999 1.000 0.000
#> GSM613711     2   0.000      0.991 0.000 1.000
#> GSM613712     2   0.000      0.991 0.000 1.000
#> GSM613713     2   0.000      0.991 0.000 1.000
#> GSM613714     2   0.000      0.991 0.000 1.000
#> GSM613715     2   0.000      0.991 0.000 1.000
#> GSM613716     2   0.000      0.991 0.000 1.000
#> GSM613717     2   0.000      0.991 0.000 1.000
#> GSM613718     2   0.000      0.991 0.000 1.000
#> GSM613719     2   0.000      0.991 0.000 1.000
#> GSM613720     2   0.000      0.991 0.000 1.000
#> GSM613721     2   0.118      0.976 0.016 0.984
#> GSM613722     1   0.000      0.999 1.000 0.000
#> GSM613723     2   0.000      0.991 0.000 1.000
#> GSM613724     1   0.000      0.999 1.000 0.000
#> GSM613725     1   0.000      0.999 1.000 0.000
#> GSM613726     1   0.000      0.999 1.000 0.000
#> GSM613727     1   0.000      0.999 1.000 0.000
#> GSM613728     1   0.000      0.999 1.000 0.000
#> GSM613729     1   0.000      0.999 1.000 0.000
#> GSM613730     1   0.000      0.999 1.000 0.000
#> GSM613731     1   0.000      0.999 1.000 0.000
#> GSM613732     2   0.000      0.991 0.000 1.000
#> GSM613733     2   0.000      0.991 0.000 1.000
#> GSM613734     1   0.295      0.946 0.948 0.052
#> GSM613735     2   0.000      0.991 0.000 1.000
#> GSM613736     2   0.000      0.991 0.000 1.000
#> GSM613737     2   0.000      0.991 0.000 1.000
#> GSM613738     2   0.000      0.991 0.000 1.000
#> GSM613739     2   0.000      0.991 0.000 1.000
#> GSM613740     2   0.000      0.991 0.000 1.000
#> GSM613741     2   0.000      0.991 0.000 1.000
#> GSM613742     2   0.000      0.991 0.000 1.000
#> GSM613743     2   0.000      0.991 0.000 1.000
#> GSM613744     2   0.000      0.991 0.000 1.000
#> GSM613745     2   0.000      0.991 0.000 1.000
#> GSM613746     2   0.000      0.991 0.000 1.000
#> GSM613747     2   0.000      0.991 0.000 1.000
#> GSM613748     1   0.000      0.999 1.000 0.000
#> GSM613749     1   0.000      0.999 1.000 0.000
#> GSM613750     2   0.000      0.991 0.000 1.000
#> GSM613751     2   0.000      0.991 0.000 1.000
#> GSM613752     2   0.000      0.991 0.000 1.000
#> GSM613753     2   0.000      0.991 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
#> GSM613638     1  0.6192     0.1879 0.580 0.420 0.000
#> GSM613639     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613640     1  0.5529     0.4957 0.704 0.296 0.000
#> GSM613641     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613642     1  0.6252     0.0844 0.556 0.444 0.000
#> GSM613643     1  0.5706     0.4505 0.680 0.320 0.000
#> GSM613644     1  0.6192     0.1823 0.580 0.420 0.000
#> GSM613645     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613646     3  0.1643     0.9122 0.000 0.044 0.956
#> GSM613647     3  0.3267     0.9058 0.000 0.116 0.884
#> GSM613648     3  0.2448     0.9189 0.000 0.076 0.924
#> GSM613649     3  0.2448     0.9189 0.000 0.076 0.924
#> GSM613650     3  0.1643     0.9122 0.000 0.044 0.956
#> GSM613651     3  0.3879     0.9112 0.000 0.152 0.848
#> GSM613652     3  0.3686     0.9145 0.000 0.140 0.860
#> GSM613653     3  0.2448     0.9189 0.000 0.076 0.924
#> GSM613654     3  0.3752     0.9136 0.000 0.144 0.856
#> GSM613655     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613656     3  0.2448     0.9161 0.000 0.076 0.924
#> GSM613657     3  0.2448     0.9189 0.000 0.076 0.924
#> GSM613658     1  0.2711     0.7588 0.912 0.088 0.000
#> GSM613659     1  0.6168     0.2156 0.588 0.412 0.000
#> GSM613660     1  0.7864     0.2646 0.596 0.332 0.072
#> GSM613661     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613662     1  0.0237     0.8423 0.996 0.004 0.000
#> GSM613663     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613664     1  0.0747     0.8361 0.984 0.016 0.000
#> GSM613665     1  0.2796     0.7728 0.908 0.092 0.000
#> GSM613666     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613667     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613668     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613669     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613670     1  0.0747     0.8361 0.984 0.016 0.000
#> GSM613671     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613672     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613673     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613674     2  0.4654     1.0000 0.208 0.792 0.000
#> GSM613675     1  0.5926     0.3719 0.644 0.356 0.000
#> GSM613676     1  0.6260     0.0662 0.552 0.448 0.000
#> GSM613677     1  0.5988     0.3413 0.632 0.368 0.000
#> GSM613678     1  0.1643     0.8189 0.956 0.044 0.000
#> GSM613679     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613680     1  0.0237     0.8428 0.996 0.004 0.000
#> GSM613681     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613682     1  0.1964     0.8097 0.944 0.056 0.000
#> GSM613683     1  0.0892     0.8353 0.980 0.020 0.000
#> GSM613684     2  0.4654     1.0000 0.208 0.792 0.000
#> GSM613685     2  0.4654     1.0000 0.208 0.792 0.000
#> GSM613686     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613687     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613688     1  0.6180     0.2021 0.584 0.416 0.000
#> GSM613689     3  0.2066     0.9218 0.000 0.060 0.940
#> GSM613690     3  0.3752     0.9136 0.000 0.144 0.856
#> GSM613691     3  0.1643     0.9122 0.000 0.044 0.956
#> GSM613692     3  0.3267     0.9058 0.000 0.116 0.884
#> GSM613693     3  0.1643     0.9122 0.000 0.044 0.956
#> GSM613694     3  0.1289     0.9157 0.000 0.032 0.968
#> GSM613695     3  0.3267     0.9058 0.000 0.116 0.884
#> GSM613696     3  0.2261     0.9205 0.000 0.068 0.932
#> GSM613697     3  0.3879     0.9112 0.000 0.152 0.848
#> GSM613698     3  0.2537     0.9187 0.000 0.080 0.920
#> GSM613699     3  0.2261     0.9205 0.000 0.068 0.932
#> GSM613700     1  0.0747     0.8361 0.984 0.016 0.000
#> GSM613701     1  0.0892     0.8369 0.980 0.020 0.000
#> GSM613702     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613703     1  0.0424     0.8409 0.992 0.008 0.000
#> GSM613704     1  0.0747     0.8361 0.984 0.016 0.000
#> GSM613705     3  0.8857     0.1697 0.344 0.132 0.524
#> GSM613706     1  0.0592     0.8394 0.988 0.012 0.000
#> GSM613707     2  0.4654     1.0000 0.208 0.792 0.000
#> GSM613708     1  0.5859     0.4003 0.656 0.344 0.000
#> GSM613709     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613710     1  0.6180     0.1968 0.584 0.416 0.000
#> GSM613711     3  0.1643     0.9122 0.000 0.044 0.956
#> GSM613712     3  0.3116     0.9180 0.000 0.108 0.892
#> GSM613713     3  0.0424     0.9205 0.000 0.008 0.992
#> GSM613714     3  0.3267     0.9058 0.000 0.116 0.884
#> GSM613715     3  0.3340     0.9175 0.000 0.120 0.880
#> GSM613716     3  0.1643     0.9122 0.000 0.044 0.956
#> GSM613717     3  0.1643     0.9122 0.000 0.044 0.956
#> GSM613718     3  0.3816     0.9127 0.000 0.148 0.852
#> GSM613719     3  0.2448     0.9189 0.000 0.076 0.924
#> GSM613720     3  0.2448     0.9189 0.000 0.076 0.924
#> GSM613721     3  0.0592     0.9199 0.000 0.012 0.988
#> GSM613722     1  0.0747     0.8361 0.984 0.016 0.000
#> GSM613723     3  0.3686     0.9147 0.000 0.140 0.860
#> GSM613724     1  0.0747     0.8373 0.984 0.016 0.000
#> GSM613725     1  0.0747     0.8361 0.984 0.016 0.000
#> GSM613726     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613727     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613728     1  0.0237     0.8425 0.996 0.004 0.000
#> GSM613729     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613730     1  0.5859     0.4003 0.656 0.344 0.000
#> GSM613731     1  0.0000     0.8440 1.000 0.000 0.000
#> GSM613732     3  0.3752     0.9138 0.000 0.144 0.856
#> GSM613733     3  0.1643     0.9122 0.000 0.044 0.956
#> GSM613734     1  0.5117     0.6281 0.832 0.108 0.060
#> GSM613735     3  0.2796     0.9133 0.000 0.092 0.908
#> GSM613736     3  0.1643     0.9122 0.000 0.044 0.956
#> GSM613737     3  0.2448     0.9189 0.000 0.076 0.924
#> GSM613738     3  0.2796     0.9133 0.000 0.092 0.908
#> GSM613739     3  0.3752     0.9136 0.000 0.144 0.856
#> GSM613740     3  0.2356     0.9198 0.000 0.072 0.928
#> GSM613741     3  0.0747     0.9191 0.000 0.016 0.984
#> GSM613742     3  0.2711     0.9141 0.000 0.088 0.912
#> GSM613743     3  0.1529     0.9135 0.000 0.040 0.960
#> GSM613744     3  0.2261     0.9205 0.000 0.068 0.932
#> GSM613745     3  0.1643     0.9122 0.000 0.044 0.956
#> GSM613746     3  0.2356     0.9198 0.000 0.072 0.928
#> GSM613747     3  0.3267     0.9058 0.000 0.116 0.884
#> GSM613748     1  0.5835     0.4092 0.660 0.340 0.000
#> GSM613749     1  0.0424     0.8402 0.992 0.008 0.000
#> GSM613750     3  0.3816     0.9127 0.000 0.148 0.852
#> GSM613751     3  0.1753     0.9128 0.000 0.048 0.952
#> GSM613752     3  0.3816     0.9127 0.000 0.148 0.852
#> GSM613753     3  0.3816     0.9127 0.000 0.148 0.852

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM613638     2  0.3266     0.7254 0.168 0.832 0.000 0.000
#> GSM613639     1  0.3610     0.5650 0.800 0.200 0.000 0.000
#> GSM613640     2  0.3486     0.7193 0.188 0.812 0.000 0.000
#> GSM613641     1  0.0000     0.6640 1.000 0.000 0.000 0.000
#> GSM613642     2  0.2973     0.7254 0.144 0.856 0.000 0.000
#> GSM613643     2  0.3801     0.6979 0.220 0.780 0.000 0.000
#> GSM613644     2  0.3400     0.7165 0.180 0.820 0.000 0.000
#> GSM613645     1  0.4992    -0.1640 0.524 0.476 0.000 0.000
#> GSM613646     3  0.3123     0.4462 0.000 0.000 0.844 0.156
#> GSM613647     3  0.1940     0.5920 0.000 0.000 0.924 0.076
#> GSM613648     3  0.4761    -0.2720 0.000 0.000 0.628 0.372
#> GSM613649     3  0.4967    -0.5419 0.000 0.000 0.548 0.452
#> GSM613650     3  0.2530     0.5028 0.000 0.000 0.888 0.112
#> GSM613651     3  0.3649     0.5264 0.000 0.000 0.796 0.204
#> GSM613652     3  0.2704     0.5857 0.000 0.000 0.876 0.124
#> GSM613653     3  0.4941    -0.7807 0.000 0.000 0.564 0.436
#> GSM613654     3  0.2647     0.5943 0.000 0.000 0.880 0.120
#> GSM613655     1  0.3024     0.6076 0.852 0.148 0.000 0.000
#> GSM613656     3  0.2345     0.5858 0.000 0.000 0.900 0.100
#> GSM613657     3  0.4877    -0.4015 0.000 0.000 0.592 0.408
#> GSM613658     2  0.4972     0.3270 0.456 0.544 0.000 0.000
#> GSM613659     2  0.2149     0.6915 0.088 0.912 0.000 0.000
#> GSM613660     2  0.4661     0.2959 0.348 0.652 0.000 0.000
#> GSM613661     1  0.3688     0.5504 0.792 0.208 0.000 0.000
#> GSM613662     1  0.5058     0.6085 0.768 0.104 0.000 0.128
#> GSM613663     1  0.2814     0.6160 0.868 0.132 0.000 0.000
#> GSM613664     1  0.5812     0.5400 0.708 0.156 0.000 0.136
#> GSM613665     1  0.4741     0.4725 0.668 0.328 0.000 0.004
#> GSM613666     1  0.0707     0.6622 0.980 0.020 0.000 0.000
#> GSM613667     1  0.2704     0.6214 0.876 0.124 0.000 0.000
#> GSM613668     1  0.3528     0.5636 0.808 0.192 0.000 0.000
#> GSM613669     1  0.0000     0.6640 1.000 0.000 0.000 0.000
#> GSM613670     1  0.5102     0.5907 0.764 0.100 0.000 0.136
#> GSM613671     1  0.0000     0.6640 1.000 0.000 0.000 0.000
#> GSM613672     1  0.4989    -0.1500 0.528 0.472 0.000 0.000
#> GSM613673     1  0.4661     0.2227 0.652 0.348 0.000 0.000
#> GSM613674     2  0.7095     0.2053 0.260 0.560 0.000 0.180
#> GSM613675     2  0.3219     0.7247 0.164 0.836 0.000 0.000
#> GSM613676     2  0.2281     0.7005 0.096 0.904 0.000 0.000
#> GSM613677     2  0.3172     0.7266 0.160 0.840 0.000 0.000
#> GSM613678     2  0.4985     0.2659 0.468 0.532 0.000 0.000
#> GSM613679     1  0.5051     0.5930 0.768 0.100 0.000 0.132
#> GSM613680     1  0.4996    -0.1910 0.516 0.484 0.000 0.000
#> GSM613681     1  0.4961    -0.0757 0.552 0.448 0.000 0.000
#> GSM613682     2  0.4977     0.2932 0.460 0.540 0.000 0.000
#> GSM613683     2  0.4925     0.3863 0.428 0.572 0.000 0.000
#> GSM613684     2  0.3400     0.5302 0.000 0.820 0.000 0.180
#> GSM613685     2  0.5536     0.4355 0.096 0.724 0.000 0.180
#> GSM613686     1  0.0000     0.6640 1.000 0.000 0.000 0.000
#> GSM613687     1  0.4981    -0.1237 0.536 0.464 0.000 0.000
#> GSM613688     2  0.3606     0.5642 0.140 0.840 0.000 0.020
#> GSM613689     3  0.2408     0.5668 0.000 0.000 0.896 0.104
#> GSM613690     3  0.3172     0.5431 0.000 0.000 0.840 0.160
#> GSM613691     3  0.3172     0.4378 0.000 0.000 0.840 0.160
#> GSM613692     3  0.1867     0.5935 0.000 0.000 0.928 0.072
#> GSM613693     3  0.3610     0.3397 0.000 0.000 0.800 0.200
#> GSM613694     3  0.2081     0.5439 0.000 0.000 0.916 0.084
#> GSM613695     3  0.0336     0.6125 0.000 0.000 0.992 0.008
#> GSM613696     3  0.3764     0.4383 0.000 0.000 0.784 0.216
#> GSM613697     3  0.3528     0.5336 0.000 0.000 0.808 0.192
#> GSM613698     3  0.3266     0.5353 0.000 0.000 0.832 0.168
#> GSM613699     3  0.4382    -0.1929 0.000 0.000 0.704 0.296
#> GSM613700     1  0.5102     0.5907 0.764 0.100 0.000 0.136
#> GSM613701     1  0.5764     0.5093 0.644 0.304 0.000 0.052
#> GSM613702     1  0.1637     0.6621 0.940 0.060 0.000 0.000
#> GSM613703     1  0.3803     0.6230 0.836 0.032 0.000 0.132
#> GSM613704     1  0.5102     0.5907 0.764 0.100 0.000 0.136
#> GSM613705     3  0.7243     0.0199 0.092 0.220 0.632 0.056
#> GSM613706     1  0.4697     0.3386 0.644 0.356 0.000 0.000
#> GSM613707     2  0.3852     0.5266 0.012 0.808 0.000 0.180
#> GSM613708     2  0.4250     0.6392 0.276 0.724 0.000 0.000
#> GSM613709     1  0.4746     0.1684 0.632 0.368 0.000 0.000
#> GSM613710     2  0.3024     0.7263 0.148 0.852 0.000 0.000
#> GSM613711     3  0.1118     0.6009 0.000 0.000 0.964 0.036
#> GSM613712     3  0.1716     0.6108 0.000 0.000 0.936 0.064
#> GSM613713     3  0.3610     0.3397 0.000 0.000 0.800 0.200
#> GSM613714     3  0.0592     0.6067 0.000 0.000 0.984 0.016
#> GSM613715     3  0.1211     0.6161 0.000 0.000 0.960 0.040
#> GSM613716     3  0.1211     0.5939 0.000 0.000 0.960 0.040
#> GSM613717     3  0.2868     0.4781 0.000 0.000 0.864 0.136
#> GSM613718     3  0.3172     0.5326 0.000 0.000 0.840 0.160
#> GSM613719     3  0.4967    -0.5419 0.000 0.000 0.548 0.452
#> GSM613720     3  0.4955    -0.5168 0.000 0.000 0.556 0.444
#> GSM613721     3  0.4961    -0.7572 0.000 0.000 0.552 0.448
#> GSM613722     1  0.5051     0.5930 0.768 0.100 0.000 0.132
#> GSM613723     3  0.3528     0.5440 0.000 0.000 0.808 0.192
#> GSM613724     2  0.4941     0.3714 0.436 0.564 0.000 0.000
#> GSM613725     1  0.5722     0.5482 0.716 0.148 0.000 0.136
#> GSM613726     1  0.2760     0.6203 0.872 0.128 0.000 0.000
#> GSM613727     1  0.1557     0.6535 0.944 0.056 0.000 0.000
#> GSM613728     1  0.6194     0.5342 0.668 0.200 0.000 0.132
#> GSM613729     1  0.0000     0.6640 1.000 0.000 0.000 0.000
#> GSM613730     2  0.3123     0.7262 0.156 0.844 0.000 0.000
#> GSM613731     1  0.4008     0.4989 0.756 0.244 0.000 0.000
#> GSM613732     3  0.3123     0.5372 0.000 0.000 0.844 0.156
#> GSM613733     3  0.2868     0.4781 0.000 0.000 0.864 0.136
#> GSM613734     1  0.5227     0.3496 0.668 0.312 0.008 0.012
#> GSM613735     3  0.2281     0.5801 0.000 0.000 0.904 0.096
#> GSM613736     3  0.0707     0.6049 0.000 0.000 0.980 0.020
#> GSM613737     3  0.4955    -0.5168 0.000 0.000 0.556 0.444
#> GSM613738     3  0.2216     0.5882 0.000 0.000 0.908 0.092
#> GSM613739     3  0.2647     0.5861 0.000 0.000 0.880 0.120
#> GSM613740     3  0.3172     0.5326 0.000 0.000 0.840 0.160
#> GSM613741     3  0.4776    -0.6466 0.000 0.000 0.624 0.376
#> GSM613742     3  0.2216     0.5881 0.000 0.000 0.908 0.092
#> GSM613743     3  0.1022     0.6029 0.000 0.000 0.968 0.032
#> GSM613744     3  0.3074     0.5417 0.000 0.000 0.848 0.152
#> GSM613745     3  0.2647     0.4934 0.000 0.000 0.880 0.120
#> GSM613746     4  0.4999     0.0000 0.000 0.000 0.492 0.508
#> GSM613747     3  0.3323     0.5182 0.064 0.000 0.876 0.060
#> GSM613748     2  0.3569     0.7164 0.196 0.804 0.000 0.000
#> GSM613749     1  0.2266     0.6467 0.912 0.084 0.000 0.004
#> GSM613750     3  0.3123     0.5372 0.000 0.000 0.844 0.156
#> GSM613751     3  0.0592     0.6067 0.000 0.000 0.984 0.016
#> GSM613752     3  0.3172     0.5326 0.000 0.000 0.840 0.160
#> GSM613753     3  0.3123     0.5372 0.000 0.000 0.844 0.156

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM613638     1  0.5102    0.18875 0.660 0.032 0.020 0.288 0.000
#> GSM613639     1  0.4974   -0.21606 0.508 0.464 0.000 0.028 0.000
#> GSM613640     1  0.3910    0.40027 0.772 0.032 0.000 0.196 0.000
#> GSM613641     2  0.4824    0.48962 0.376 0.596 0.000 0.028 0.000
#> GSM613642     1  0.3861    0.22065 0.712 0.004 0.000 0.284 0.000
#> GSM613643     1  0.2329    0.48542 0.876 0.000 0.000 0.124 0.000
#> GSM613644     1  0.2329    0.48530 0.876 0.000 0.000 0.124 0.000
#> GSM613645     1  0.0451    0.53409 0.988 0.008 0.000 0.004 0.000
#> GSM613646     5  0.5637    0.31058 0.000 0.000 0.284 0.112 0.604
#> GSM613647     5  0.5790    0.50365 0.000 0.000 0.184 0.200 0.616
#> GSM613648     5  0.3752    0.08370 0.000 0.000 0.292 0.000 0.708
#> GSM613649     3  0.4268    0.67780 0.000 0.000 0.556 0.000 0.444
#> GSM613650     5  0.4329    0.37816 0.000 0.000 0.252 0.032 0.716
#> GSM613651     5  0.2519    0.62197 0.000 0.000 0.100 0.016 0.884
#> GSM613652     5  0.4065    0.55575 0.000 0.000 0.180 0.048 0.772
#> GSM613653     3  0.3395    0.71205 0.000 0.000 0.764 0.000 0.236
#> GSM613654     5  0.3513    0.57627 0.000 0.000 0.180 0.020 0.800
#> GSM613655     1  0.5032   -0.17898 0.520 0.448 0.000 0.032 0.000
#> GSM613656     5  0.5050    0.54688 0.000 0.000 0.180 0.120 0.700
#> GSM613657     5  0.3969    0.00939 0.000 0.000 0.304 0.004 0.692
#> GSM613658     1  0.4970    0.47443 0.728 0.156 0.008 0.108 0.000
#> GSM613659     1  0.6128    0.00634 0.560 0.188 0.000 0.252 0.000
#> GSM613660     2  0.6883    0.28414 0.224 0.484 0.000 0.276 0.016
#> GSM613661     1  0.4965   -0.18684 0.520 0.452 0.000 0.028 0.000
#> GSM613662     2  0.1670    0.68378 0.052 0.936 0.000 0.012 0.000
#> GSM613663     1  0.4876   -0.03917 0.576 0.396 0.000 0.028 0.000
#> GSM613664     2  0.2674    0.59730 0.004 0.856 0.000 0.140 0.000
#> GSM613665     2  0.5357    0.50180 0.264 0.640 0.000 0.096 0.000
#> GSM613666     2  0.4824    0.48962 0.376 0.596 0.000 0.028 0.000
#> GSM613667     1  0.4876   -0.07270 0.576 0.396 0.000 0.028 0.000
#> GSM613668     2  0.4980    0.23083 0.484 0.488 0.000 0.028 0.000
#> GSM613669     2  0.4616    0.56849 0.288 0.676 0.000 0.036 0.000
#> GSM613670     2  0.2674    0.60193 0.004 0.856 0.000 0.140 0.000
#> GSM613671     2  0.4503    0.55470 0.312 0.664 0.000 0.024 0.000
#> GSM613672     1  0.0451    0.53409 0.988 0.008 0.000 0.004 0.000
#> GSM613673     1  0.3370    0.47549 0.824 0.148 0.000 0.028 0.000
#> GSM613674     2  0.5002    0.37919 0.040 0.596 0.000 0.364 0.000
#> GSM613675     1  0.3487    0.29163 0.780 0.008 0.000 0.212 0.000
#> GSM613676     1  0.4106    0.17824 0.724 0.020 0.000 0.256 0.000
#> GSM613677     1  0.4338    0.23872 0.696 0.024 0.000 0.280 0.000
#> GSM613678     1  0.0771    0.52658 0.976 0.004 0.000 0.020 0.000
#> GSM613679     2  0.1469    0.66475 0.036 0.948 0.000 0.016 0.000
#> GSM613680     1  0.0290    0.53335 0.992 0.008 0.000 0.000 0.000
#> GSM613681     1  0.0451    0.53409 0.988 0.008 0.000 0.004 0.000
#> GSM613682     1  0.3339    0.46059 0.840 0.112 0.000 0.048 0.000
#> GSM613683     1  0.2233    0.49861 0.892 0.004 0.000 0.104 0.000
#> GSM613684     4  0.5015    0.46860 0.392 0.028 0.004 0.576 0.000
#> GSM613685     4  0.5773    0.47927 0.436 0.088 0.000 0.476 0.000
#> GSM613686     2  0.4484    0.55777 0.308 0.668 0.000 0.024 0.000
#> GSM613687     1  0.0451    0.53409 0.988 0.008 0.000 0.004 0.000
#> GSM613688     2  0.6158    0.39214 0.184 0.552 0.000 0.264 0.000
#> GSM613689     5  0.1124    0.62409 0.000 0.000 0.036 0.004 0.960
#> GSM613690     5  0.0000    0.64578 0.000 0.000 0.000 0.000 1.000
#> GSM613691     5  0.5906    0.28860 0.000 0.000 0.284 0.140 0.576
#> GSM613692     5  0.5844    0.49283 0.000 0.000 0.184 0.208 0.608
#> GSM613693     5  0.5729    0.02209 0.000 0.000 0.396 0.088 0.516
#> GSM613694     5  0.4367    0.49214 0.000 0.000 0.192 0.060 0.748
#> GSM613695     5  0.2864    0.62170 0.000 0.000 0.012 0.136 0.852
#> GSM613696     5  0.4522   -0.20049 0.000 0.000 0.440 0.008 0.552
#> GSM613697     5  0.1106    0.64528 0.000 0.000 0.024 0.012 0.964
#> GSM613698     5  0.0510    0.64132 0.000 0.000 0.016 0.000 0.984
#> GSM613699     3  0.4437    0.45408 0.000 0.000 0.532 0.004 0.464
#> GSM613700     2  0.2674    0.60193 0.004 0.856 0.000 0.140 0.000
#> GSM613701     2  0.3112    0.66635 0.044 0.856 0.000 0.100 0.000
#> GSM613702     2  0.4924    0.44222 0.420 0.552 0.000 0.028 0.000
#> GSM613703     2  0.4720    0.65023 0.124 0.736 0.000 0.140 0.000
#> GSM613704     2  0.2798    0.60040 0.008 0.852 0.000 0.140 0.000
#> GSM613705     4  0.9023   -0.14899 0.104 0.068 0.180 0.364 0.284
#> GSM613706     1  0.5557   -0.22081 0.468 0.464 0.000 0.068 0.000
#> GSM613707     4  0.5042    0.47310 0.460 0.032 0.000 0.508 0.000
#> GSM613708     1  0.2280    0.48833 0.880 0.000 0.000 0.120 0.000
#> GSM613709     1  0.1300    0.52651 0.956 0.016 0.000 0.028 0.000
#> GSM613710     1  0.3689    0.25743 0.740 0.004 0.000 0.256 0.000
#> GSM613711     5  0.4541    0.55506 0.000 0.000 0.112 0.136 0.752
#> GSM613712     5  0.0898    0.64740 0.000 0.000 0.020 0.008 0.972
#> GSM613713     5  0.4882   -0.13168 0.000 0.000 0.444 0.024 0.532
#> GSM613714     5  0.3098    0.61342 0.000 0.000 0.016 0.148 0.836
#> GSM613715     5  0.0000    0.64578 0.000 0.000 0.000 0.000 1.000
#> GSM613716     5  0.5155    0.49007 0.000 0.000 0.168 0.140 0.692
#> GSM613717     5  0.5265    0.32765 0.000 0.000 0.284 0.080 0.636
#> GSM613718     5  0.0771    0.64149 0.000 0.000 0.020 0.004 0.976
#> GSM613719     3  0.4268    0.67780 0.000 0.000 0.556 0.000 0.444
#> GSM613720     3  0.4262    0.67735 0.000 0.000 0.560 0.000 0.440
#> GSM613721     3  0.3210    0.69799 0.000 0.000 0.788 0.000 0.212
#> GSM613722     2  0.0898    0.66756 0.008 0.972 0.000 0.020 0.000
#> GSM613723     5  0.4065    0.55575 0.000 0.000 0.180 0.048 0.772
#> GSM613724     1  0.2984    0.50244 0.860 0.032 0.000 0.108 0.000
#> GSM613725     2  0.1082    0.66530 0.008 0.964 0.000 0.028 0.000
#> GSM613726     1  0.4974   -0.21506 0.508 0.464 0.000 0.028 0.000
#> GSM613727     2  0.4942    0.38147 0.432 0.540 0.000 0.028 0.000
#> GSM613728     2  0.1845    0.67993 0.056 0.928 0.000 0.016 0.000
#> GSM613729     2  0.4722    0.49969 0.368 0.608 0.000 0.024 0.000
#> GSM613730     1  0.4735    0.25529 0.680 0.048 0.000 0.272 0.000
#> GSM613731     1  0.4957   -0.16925 0.528 0.444 0.000 0.028 0.000
#> GSM613732     5  0.0451    0.64487 0.000 0.000 0.008 0.004 0.988
#> GSM613733     5  0.5870    0.29691 0.000 0.000 0.284 0.136 0.580
#> GSM613734     1  0.8083   -0.02138 0.392 0.264 0.044 0.276 0.024
#> GSM613735     5  0.5867    0.48474 0.000 0.000 0.180 0.216 0.604
#> GSM613736     5  0.5258    0.49589 0.000 0.000 0.140 0.180 0.680
#> GSM613737     3  0.4268    0.67780 0.000 0.000 0.556 0.000 0.444
#> GSM613738     5  0.3513    0.57627 0.000 0.000 0.180 0.020 0.800
#> GSM613739     5  0.3513    0.57627 0.000 0.000 0.180 0.020 0.800
#> GSM613740     5  0.0771    0.64149 0.000 0.000 0.020 0.004 0.976
#> GSM613741     3  0.4196    0.66430 0.000 0.000 0.640 0.004 0.356
#> GSM613742     5  0.4444    0.57971 0.000 0.000 0.180 0.072 0.748
#> GSM613743     5  0.3767    0.60194 0.000 0.000 0.068 0.120 0.812
#> GSM613744     5  0.0451    0.64487 0.000 0.000 0.008 0.004 0.988
#> GSM613745     5  0.5640    0.32832 0.000 0.000 0.276 0.116 0.608
#> GSM613746     3  0.3177    0.69907 0.000 0.000 0.792 0.000 0.208
#> GSM613747     5  0.7260    0.41622 0.076 0.000 0.164 0.232 0.528
#> GSM613748     1  0.1952    0.49563 0.912 0.004 0.000 0.084 0.000
#> GSM613749     2  0.2331    0.68244 0.080 0.900 0.000 0.020 0.000
#> GSM613750     5  0.1216    0.64168 0.000 0.000 0.020 0.020 0.960
#> GSM613751     5  0.3123    0.60899 0.000 0.000 0.012 0.160 0.828
#> GSM613752     5  0.0771    0.64149 0.000 0.000 0.020 0.004 0.976
#> GSM613753     5  0.1216    0.64168 0.000 0.000 0.020 0.020 0.960

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     4  0.4624      0.647 0.140 0.104 0.000 0.732 0.024 0.000
#> GSM613639     1  0.3192      0.575 0.776 0.216 0.000 0.004 0.004 0.000
#> GSM613640     4  0.4693      0.236 0.424 0.016 0.000 0.540 0.020 0.000
#> GSM613641     1  0.2697      0.629 0.812 0.188 0.000 0.000 0.000 0.000
#> GSM613642     4  0.3323      0.658 0.240 0.008 0.000 0.752 0.000 0.000
#> GSM613643     1  0.4153      0.360 0.636 0.000 0.000 0.340 0.024 0.000
#> GSM613644     1  0.4273      0.266 0.596 0.000 0.000 0.380 0.024 0.000
#> GSM613645     1  0.2454      0.578 0.840 0.000 0.000 0.160 0.000 0.000
#> GSM613646     3  0.4904      0.645 0.000 0.000 0.656 0.000 0.148 0.196
#> GSM613647     5  0.3076      0.732 0.000 0.000 0.240 0.000 0.760 0.000
#> GSM613648     3  0.2376      0.695 0.000 0.000 0.888 0.000 0.068 0.044
#> GSM613649     6  0.3907      0.795 0.000 0.000 0.176 0.000 0.068 0.756
#> GSM613650     3  0.4079      0.703 0.000 0.000 0.744 0.000 0.172 0.084
#> GSM613651     3  0.1958      0.638 0.000 0.000 0.896 0.000 0.100 0.004
#> GSM613652     5  0.3756      0.782 0.000 0.000 0.400 0.000 0.600 0.000
#> GSM613653     6  0.1649      0.739 0.000 0.000 0.032 0.000 0.036 0.932
#> GSM613654     3  0.3864     -0.680 0.000 0.000 0.520 0.000 0.480 0.000
#> GSM613655     1  0.2615      0.649 0.852 0.136 0.000 0.008 0.004 0.000
#> GSM613656     5  0.3695      0.789 0.000 0.000 0.376 0.000 0.624 0.000
#> GSM613657     3  0.5041      0.432 0.000 0.000 0.624 0.000 0.128 0.248
#> GSM613658     1  0.5696      0.460 0.576 0.112 0.000 0.284 0.028 0.000
#> GSM613659     4  0.5604      0.515 0.268 0.172 0.000 0.556 0.004 0.000
#> GSM613660     2  0.5895      0.580 0.280 0.580 0.008 0.108 0.008 0.016
#> GSM613661     1  0.2504      0.646 0.856 0.136 0.000 0.004 0.004 0.000
#> GSM613662     2  0.2378      0.806 0.152 0.848 0.000 0.000 0.000 0.000
#> GSM613663     1  0.1524      0.656 0.932 0.060 0.000 0.008 0.000 0.000
#> GSM613664     2  0.0260      0.775 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM613665     2  0.3737      0.563 0.392 0.608 0.000 0.000 0.000 0.000
#> GSM613666     1  0.2762      0.616 0.804 0.196 0.000 0.000 0.000 0.000
#> GSM613667     1  0.1088      0.647 0.960 0.024 0.000 0.016 0.000 0.000
#> GSM613668     1  0.2597      0.634 0.824 0.176 0.000 0.000 0.000 0.000
#> GSM613669     1  0.3756      0.365 0.600 0.400 0.000 0.000 0.000 0.000
#> GSM613670     2  0.0000      0.778 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613671     1  0.3244      0.491 0.732 0.268 0.000 0.000 0.000 0.000
#> GSM613672     1  0.2454      0.578 0.840 0.000 0.000 0.160 0.000 0.000
#> GSM613673     1  0.0603      0.643 0.980 0.004 0.000 0.016 0.000 0.000
#> GSM613674     2  0.4925      0.702 0.132 0.680 0.000 0.180 0.004 0.004
#> GSM613675     4  0.4018      0.548 0.412 0.008 0.000 0.580 0.000 0.000
#> GSM613676     4  0.4147      0.653 0.304 0.024 0.000 0.668 0.004 0.000
#> GSM613677     4  0.3617      0.644 0.244 0.000 0.000 0.736 0.020 0.000
#> GSM613678     1  0.2743      0.573 0.828 0.008 0.000 0.164 0.000 0.000
#> GSM613679     2  0.3151      0.734 0.252 0.748 0.000 0.000 0.000 0.000
#> GSM613680     1  0.2454      0.578 0.840 0.000 0.000 0.160 0.000 0.000
#> GSM613681     1  0.2454      0.578 0.840 0.000 0.000 0.160 0.000 0.000
#> GSM613682     1  0.4393      0.589 0.716 0.112 0.000 0.172 0.000 0.000
#> GSM613683     1  0.4139      0.364 0.640 0.000 0.000 0.336 0.024 0.000
#> GSM613684     4  0.1003      0.569 0.000 0.016 0.000 0.964 0.020 0.000
#> GSM613685     4  0.3849      0.580 0.112 0.060 0.000 0.804 0.020 0.004
#> GSM613686     1  0.3288      0.479 0.724 0.276 0.000 0.000 0.000 0.000
#> GSM613687     1  0.2454      0.578 0.840 0.000 0.000 0.160 0.000 0.000
#> GSM613688     4  0.6011      0.131 0.296 0.272 0.000 0.432 0.000 0.000
#> GSM613689     3  0.2706      0.711 0.000 0.000 0.852 0.000 0.124 0.024
#> GSM613690     3  0.1531      0.665 0.000 0.000 0.928 0.000 0.068 0.004
#> GSM613691     3  0.5188      0.629 0.000 0.000 0.632 0.004 0.160 0.204
#> GSM613692     5  0.3076      0.732 0.000 0.000 0.240 0.000 0.760 0.000
#> GSM613693     3  0.4261      0.633 0.000 0.000 0.692 0.000 0.056 0.252
#> GSM613694     3  0.3874      0.704 0.000 0.000 0.760 0.000 0.172 0.068
#> GSM613695     3  0.3409      0.511 0.000 0.000 0.700 0.000 0.300 0.000
#> GSM613696     3  0.4387      0.676 0.000 0.000 0.720 0.000 0.152 0.128
#> GSM613697     3  0.1082      0.679 0.000 0.000 0.956 0.000 0.040 0.004
#> GSM613698     3  0.0777      0.683 0.000 0.000 0.972 0.000 0.024 0.004
#> GSM613699     3  0.4536      0.659 0.000 0.000 0.700 0.000 0.120 0.180
#> GSM613700     2  0.0000      0.778 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613701     2  0.3023      0.766 0.232 0.768 0.000 0.000 0.000 0.000
#> GSM613702     1  0.3371      0.376 0.708 0.292 0.000 0.000 0.000 0.000
#> GSM613703     2  0.0260      0.778 0.008 0.992 0.000 0.000 0.000 0.000
#> GSM613704     2  0.0000      0.778 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM613705     5  0.3834      0.408 0.040 0.032 0.008 0.108 0.812 0.000
#> GSM613706     2  0.4663      0.310 0.472 0.492 0.000 0.032 0.004 0.000
#> GSM613707     4  0.3460      0.606 0.132 0.024 0.000 0.820 0.020 0.004
#> GSM613708     1  0.4139      0.364 0.640 0.000 0.000 0.336 0.024 0.000
#> GSM613709     1  0.2454      0.578 0.840 0.000 0.000 0.160 0.000 0.000
#> GSM613710     4  0.3601      0.648 0.312 0.004 0.000 0.684 0.000 0.000
#> GSM613711     3  0.4134      0.671 0.000 0.000 0.656 0.000 0.316 0.028
#> GSM613712     3  0.1814      0.653 0.000 0.000 0.900 0.000 0.100 0.000
#> GSM613713     3  0.4546      0.650 0.000 0.000 0.692 0.000 0.104 0.204
#> GSM613714     3  0.3747      0.563 0.000 0.000 0.604 0.000 0.396 0.000
#> GSM613715     3  0.2300      0.653 0.000 0.000 0.856 0.000 0.144 0.000
#> GSM613716     3  0.4697      0.660 0.000 0.000 0.612 0.000 0.324 0.064
#> GSM613717     3  0.4358      0.693 0.000 0.000 0.712 0.000 0.196 0.092
#> GSM613718     3  0.1471      0.678 0.000 0.000 0.932 0.000 0.064 0.004
#> GSM613719     6  0.3939      0.792 0.000 0.000 0.180 0.000 0.068 0.752
#> GSM613720     6  0.3923      0.792 0.000 0.000 0.192 0.000 0.060 0.748
#> GSM613721     6  0.4050      0.501 0.000 0.000 0.236 0.000 0.048 0.716
#> GSM613722     2  0.2219      0.810 0.136 0.864 0.000 0.000 0.000 0.000
#> GSM613723     5  0.3706      0.785 0.000 0.000 0.380 0.000 0.620 0.000
#> GSM613724     1  0.5828      0.403 0.528 0.108 0.000 0.336 0.028 0.000
#> GSM613725     2  0.2178      0.810 0.132 0.868 0.000 0.000 0.000 0.000
#> GSM613726     1  0.2402      0.646 0.856 0.140 0.000 0.004 0.000 0.000
#> GSM613727     1  0.2454      0.641 0.840 0.160 0.000 0.000 0.000 0.000
#> GSM613728     2  0.3126      0.753 0.248 0.752 0.000 0.000 0.000 0.000
#> GSM613729     1  0.2762      0.625 0.804 0.196 0.000 0.000 0.000 0.000
#> GSM613730     4  0.4806      0.640 0.160 0.112 0.000 0.708 0.020 0.000
#> GSM613731     1  0.2806      0.649 0.844 0.136 0.000 0.016 0.004 0.000
#> GSM613732     3  0.1411      0.673 0.000 0.000 0.936 0.000 0.060 0.004
#> GSM613733     3  0.5065      0.637 0.000 0.000 0.636 0.000 0.172 0.192
#> GSM613734     1  0.5711      0.424 0.612 0.032 0.000 0.160 0.196 0.000
#> GSM613735     5  0.3390      0.768 0.000 0.000 0.296 0.000 0.704 0.000
#> GSM613736     3  0.4499      0.559 0.000 0.000 0.540 0.000 0.428 0.032
#> GSM613737     6  0.3916      0.788 0.000 0.000 0.184 0.000 0.064 0.752
#> GSM613738     5  0.3866      0.681 0.000 0.000 0.484 0.000 0.516 0.000
#> GSM613739     5  0.3857      0.702 0.000 0.000 0.468 0.000 0.532 0.000
#> GSM613740     3  0.1588      0.696 0.000 0.000 0.924 0.000 0.072 0.004
#> GSM613741     3  0.4467      0.574 0.000 0.000 0.632 0.000 0.048 0.320
#> GSM613742     5  0.3756      0.787 0.000 0.000 0.400 0.000 0.600 0.000
#> GSM613743     3  0.3421      0.702 0.000 0.000 0.736 0.000 0.256 0.008
#> GSM613744     3  0.1285      0.683 0.000 0.000 0.944 0.000 0.052 0.004
#> GSM613745     3  0.4787      0.666 0.000 0.000 0.656 0.000 0.236 0.108
#> GSM613746     6  0.1528      0.717 0.000 0.000 0.016 0.000 0.048 0.936
#> GSM613747     5  0.2456      0.559 0.000 0.000 0.076 0.028 0.888 0.008
#> GSM613748     1  0.3563      0.232 0.664 0.000 0.000 0.336 0.000 0.000
#> GSM613749     2  0.2260      0.809 0.140 0.860 0.000 0.000 0.000 0.000
#> GSM613750     3  0.2122      0.678 0.000 0.000 0.900 0.000 0.076 0.024
#> GSM613751     3  0.3371      0.525 0.000 0.000 0.708 0.000 0.292 0.000
#> GSM613752     3  0.1471      0.683 0.000 0.000 0.932 0.000 0.064 0.004
#> GSM613753     3  0.2176      0.677 0.000 0.000 0.896 0.000 0.080 0.024

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 disease.state(p) k
#> ATC:mclust 115           0.0235 2
#> ATC:mclust 100           0.0575 3
#> ATC:mclust  77           0.1166 4
#> ATC:mclust  59           0.1116 5
#> ATC:mclust  98           0.0464 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 27425 rows and 116 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 1.000           0.963       0.985         0.5042 0.496   0.496
#> 3 3 0.541           0.706       0.818         0.2694 0.867   0.736
#> 4 4 0.642           0.710       0.831         0.0992 0.843   0.618
#> 5 5 0.561           0.609       0.757         0.0747 0.903   0.690
#> 6 6 0.609           0.567       0.751         0.0523 0.898   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
#> GSM613638     2  0.0000     0.9876 0.000 1.000
#> GSM613639     1  0.0000     0.9808 1.000 0.000
#> GSM613640     1  0.0000     0.9808 1.000 0.000
#> GSM613641     1  0.0000     0.9808 1.000 0.000
#> GSM613642     1  0.0000     0.9808 1.000 0.000
#> GSM613643     1  0.8909     0.5526 0.692 0.308
#> GSM613644     1  0.9988     0.0731 0.520 0.480
#> GSM613645     1  0.0000     0.9808 1.000 0.000
#> GSM613646     2  0.0376     0.9843 0.004 0.996
#> GSM613647     2  0.0000     0.9876 0.000 1.000
#> GSM613648     2  0.0000     0.9876 0.000 1.000
#> GSM613649     2  0.0000     0.9876 0.000 1.000
#> GSM613650     2  0.0000     0.9876 0.000 1.000
#> GSM613651     2  0.0000     0.9876 0.000 1.000
#> GSM613652     2  0.0000     0.9876 0.000 1.000
#> GSM613653     2  0.2236     0.9539 0.036 0.964
#> GSM613654     2  0.0000     0.9876 0.000 1.000
#> GSM613655     1  0.0000     0.9808 1.000 0.000
#> GSM613656     2  0.0000     0.9876 0.000 1.000
#> GSM613657     2  0.0000     0.9876 0.000 1.000
#> GSM613658     2  0.0672     0.9808 0.008 0.992
#> GSM613659     1  0.0000     0.9808 1.000 0.000
#> GSM613660     1  0.0000     0.9808 1.000 0.000
#> GSM613661     1  0.0000     0.9808 1.000 0.000
#> GSM613662     1  0.0000     0.9808 1.000 0.000
#> GSM613663     1  0.0000     0.9808 1.000 0.000
#> GSM613664     1  0.0000     0.9808 1.000 0.000
#> GSM613665     1  0.0000     0.9808 1.000 0.000
#> GSM613666     1  0.0000     0.9808 1.000 0.000
#> GSM613667     1  0.0000     0.9808 1.000 0.000
#> GSM613668     1  0.0000     0.9808 1.000 0.000
#> GSM613669     1  0.0000     0.9808 1.000 0.000
#> GSM613670     1  0.0000     0.9808 1.000 0.000
#> GSM613671     1  0.0000     0.9808 1.000 0.000
#> GSM613672     1  0.0000     0.9808 1.000 0.000
#> GSM613673     1  0.0000     0.9808 1.000 0.000
#> GSM613674     1  0.0000     0.9808 1.000 0.000
#> GSM613675     1  0.0000     0.9808 1.000 0.000
#> GSM613676     1  0.0000     0.9808 1.000 0.000
#> GSM613677     1  0.8267     0.6441 0.740 0.260
#> GSM613678     1  0.0000     0.9808 1.000 0.000
#> GSM613679     1  0.0000     0.9808 1.000 0.000
#> GSM613680     1  0.0000     0.9808 1.000 0.000
#> GSM613681     1  0.0000     0.9808 1.000 0.000
#> GSM613682     1  0.0000     0.9808 1.000 0.000
#> GSM613683     1  0.0000     0.9808 1.000 0.000
#> GSM613684     2  0.7219     0.7506 0.200 0.800
#> GSM613685     1  0.0000     0.9808 1.000 0.000
#> GSM613686     1  0.0000     0.9808 1.000 0.000
#> GSM613687     1  0.0000     0.9808 1.000 0.000
#> GSM613688     1  0.0000     0.9808 1.000 0.000
#> GSM613689     2  0.0000     0.9876 0.000 1.000
#> GSM613690     2  0.0000     0.9876 0.000 1.000
#> GSM613691     1  0.1184     0.9658 0.984 0.016
#> GSM613692     2  0.0000     0.9876 0.000 1.000
#> GSM613693     2  0.0000     0.9876 0.000 1.000
#> GSM613694     2  0.0000     0.9876 0.000 1.000
#> GSM613695     2  0.0000     0.9876 0.000 1.000
#> GSM613696     2  0.0000     0.9876 0.000 1.000
#> GSM613697     2  0.0000     0.9876 0.000 1.000
#> GSM613698     2  0.0000     0.9876 0.000 1.000
#> GSM613699     2  0.0000     0.9876 0.000 1.000
#> GSM613700     1  0.0000     0.9808 1.000 0.000
#> GSM613701     1  0.0000     0.9808 1.000 0.000
#> GSM613702     1  0.0000     0.9808 1.000 0.000
#> GSM613703     1  0.0000     0.9808 1.000 0.000
#> GSM613704     1  0.0000     0.9808 1.000 0.000
#> GSM613705     2  0.0000     0.9876 0.000 1.000
#> GSM613706     1  0.0000     0.9808 1.000 0.000
#> GSM613707     1  0.0000     0.9808 1.000 0.000
#> GSM613708     1  0.0000     0.9808 1.000 0.000
#> GSM613709     1  0.0000     0.9808 1.000 0.000
#> GSM613710     1  0.0000     0.9808 1.000 0.000
#> GSM613711     2  0.0000     0.9876 0.000 1.000
#> GSM613712     2  0.0000     0.9876 0.000 1.000
#> GSM613713     2  0.0000     0.9876 0.000 1.000
#> GSM613714     2  0.0000     0.9876 0.000 1.000
#> GSM613715     2  0.0000     0.9876 0.000 1.000
#> GSM613716     2  0.0000     0.9876 0.000 1.000
#> GSM613717     2  0.0000     0.9876 0.000 1.000
#> GSM613718     2  0.0000     0.9876 0.000 1.000
#> GSM613719     2  0.0000     0.9876 0.000 1.000
#> GSM613720     2  0.0000     0.9876 0.000 1.000
#> GSM613721     2  0.6712     0.7873 0.176 0.824
#> GSM613722     1  0.0000     0.9808 1.000 0.000
#> GSM613723     2  0.0000     0.9876 0.000 1.000
#> GSM613724     2  0.8267     0.6494 0.260 0.740
#> GSM613725     1  0.0000     0.9808 1.000 0.000
#> GSM613726     1  0.0000     0.9808 1.000 0.000
#> GSM613727     1  0.0000     0.9808 1.000 0.000
#> GSM613728     1  0.0000     0.9808 1.000 0.000
#> GSM613729     1  0.0000     0.9808 1.000 0.000
#> GSM613730     1  0.0000     0.9808 1.000 0.000
#> GSM613731     1  0.0000     0.9808 1.000 0.000
#> GSM613732     2  0.0000     0.9876 0.000 1.000
#> GSM613733     2  0.0376     0.9843 0.004 0.996
#> GSM613734     2  0.0000     0.9876 0.000 1.000
#> GSM613735     2  0.0000     0.9876 0.000 1.000
#> GSM613736     2  0.0000     0.9876 0.000 1.000
#> GSM613737     2  0.0000     0.9876 0.000 1.000
#> GSM613738     2  0.0000     0.9876 0.000 1.000
#> GSM613739     2  0.0000     0.9876 0.000 1.000
#> GSM613740     2  0.0000     0.9876 0.000 1.000
#> GSM613741     2  0.0000     0.9876 0.000 1.000
#> GSM613742     2  0.0000     0.9876 0.000 1.000
#> GSM613743     2  0.0000     0.9876 0.000 1.000
#> GSM613744     2  0.0000     0.9876 0.000 1.000
#> GSM613745     2  0.0000     0.9876 0.000 1.000
#> GSM613746     2  0.0000     0.9876 0.000 1.000
#> GSM613747     2  0.0000     0.9876 0.000 1.000
#> GSM613748     1  0.0000     0.9808 1.000 0.000
#> GSM613749     1  0.0000     0.9808 1.000 0.000
#> GSM613750     2  0.0000     0.9876 0.000 1.000
#> GSM613751     2  0.0000     0.9876 0.000 1.000
#> GSM613752     2  0.0000     0.9876 0.000 1.000
#> GSM613753     2  0.0000     0.9876 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
#> GSM613638     3  0.6432     0.2843 0.428 0.004 0.568
#> GSM613639     2  0.3619     0.7635 0.136 0.864 0.000
#> GSM613640     2  0.6798     0.3275 0.400 0.584 0.016
#> GSM613641     2  0.5465     0.5395 0.288 0.712 0.000
#> GSM613642     2  0.6357     0.5224 0.336 0.652 0.012
#> GSM613643     1  0.6079     0.6810 0.784 0.088 0.128
#> GSM613644     1  0.5467     0.6722 0.816 0.072 0.112
#> GSM613645     2  0.5216     0.6626 0.260 0.740 0.000
#> GSM613646     3  0.6594     0.7469 0.128 0.116 0.756
#> GSM613647     3  0.2537     0.8332 0.080 0.000 0.920
#> GSM613648     3  0.1860     0.8556 0.052 0.000 0.948
#> GSM613649     3  0.2878     0.8428 0.096 0.000 0.904
#> GSM613650     3  0.1289     0.8591 0.032 0.000 0.968
#> GSM613651     3  0.1411     0.8538 0.036 0.000 0.964
#> GSM613652     3  0.5760     0.5318 0.328 0.000 0.672
#> GSM613653     3  0.7273     0.7020 0.156 0.132 0.712
#> GSM613654     3  0.5733     0.5330 0.324 0.000 0.676
#> GSM613655     1  0.5465     0.6582 0.712 0.288 0.000
#> GSM613656     3  0.6079     0.4077 0.388 0.000 0.612
#> GSM613657     3  0.3030     0.8440 0.092 0.004 0.904
#> GSM613658     1  0.5756     0.6348 0.764 0.028 0.208
#> GSM613659     2  0.3619     0.7734 0.136 0.864 0.000
#> GSM613660     2  0.3370     0.7313 0.024 0.904 0.072
#> GSM613661     1  0.6260     0.3660 0.552 0.448 0.000
#> GSM613662     2  0.0892     0.7892 0.020 0.980 0.000
#> GSM613663     1  0.5291     0.6660 0.732 0.268 0.000
#> GSM613664     2  0.0892     0.7787 0.020 0.980 0.000
#> GSM613665     2  0.1411     0.7889 0.036 0.964 0.000
#> GSM613666     2  0.3619     0.7601 0.136 0.864 0.000
#> GSM613667     2  0.4346     0.7392 0.184 0.816 0.000
#> GSM613668     2  0.6280    -0.0272 0.460 0.540 0.000
#> GSM613669     2  0.4235     0.7434 0.176 0.824 0.000
#> GSM613670     2  0.1753     0.7788 0.048 0.952 0.000
#> GSM613671     2  0.3941     0.7502 0.156 0.844 0.000
#> GSM613672     1  0.5216     0.6719 0.740 0.260 0.000
#> GSM613673     2  0.4399     0.7359 0.188 0.812 0.000
#> GSM613674     2  0.3412     0.7359 0.124 0.876 0.000
#> GSM613675     2  0.4555     0.7375 0.200 0.800 0.000
#> GSM613676     2  0.4654     0.7298 0.208 0.792 0.000
#> GSM613677     1  0.9792     0.3250 0.436 0.288 0.276
#> GSM613678     2  0.4291     0.7615 0.180 0.820 0.000
#> GSM613679     2  0.1031     0.7899 0.024 0.976 0.000
#> GSM613680     1  0.5327     0.6634 0.728 0.272 0.000
#> GSM613681     1  0.6008     0.5034 0.628 0.372 0.000
#> GSM613682     2  0.4931     0.7456 0.232 0.768 0.000
#> GSM613683     1  0.5688     0.6942 0.788 0.168 0.044
#> GSM613684     3  0.8854     0.4073 0.236 0.188 0.576
#> GSM613685     2  0.3551     0.7334 0.132 0.868 0.000
#> GSM613686     2  0.2959     0.7786 0.100 0.900 0.000
#> GSM613687     2  0.6235     0.2008 0.436 0.564 0.000
#> GSM613688     2  0.2878     0.7617 0.096 0.904 0.000
#> GSM613689     3  0.2066     0.8540 0.060 0.000 0.940
#> GSM613690     3  0.1031     0.8576 0.024 0.000 0.976
#> GSM613691     2  0.8957     0.1376 0.152 0.536 0.312
#> GSM613692     3  0.3038     0.8175 0.104 0.000 0.896
#> GSM613693     3  0.7412     0.6956 0.176 0.124 0.700
#> GSM613694     3  0.1163     0.8594 0.028 0.000 0.972
#> GSM613695     3  0.1163     0.8566 0.028 0.000 0.972
#> GSM613696     3  0.3425     0.8359 0.112 0.004 0.884
#> GSM613697     3  0.1163     0.8566 0.028 0.000 0.972
#> GSM613698     3  0.0000     0.8602 0.000 0.000 1.000
#> GSM613699     3  0.3192     0.8371 0.112 0.000 0.888
#> GSM613700     2  0.1031     0.7869 0.024 0.976 0.000
#> GSM613701     2  0.2625     0.7651 0.084 0.916 0.000
#> GSM613702     2  0.2356     0.7911 0.072 0.928 0.000
#> GSM613703     2  0.2625     0.7835 0.084 0.916 0.000
#> GSM613704     2  0.1753     0.7678 0.048 0.952 0.000
#> GSM613705     3  0.4504     0.7355 0.196 0.000 0.804
#> GSM613706     2  0.4062     0.7526 0.164 0.836 0.000
#> GSM613707     2  0.3619     0.7341 0.136 0.864 0.000
#> GSM613708     1  0.4861     0.6826 0.800 0.192 0.008
#> GSM613709     1  0.6026     0.5049 0.624 0.376 0.000
#> GSM613710     2  0.5178     0.6684 0.256 0.744 0.000
#> GSM613711     3  0.2527     0.8559 0.044 0.020 0.936
#> GSM613712     3  0.1031     0.8576 0.024 0.000 0.976
#> GSM613713     3  0.5239     0.7950 0.160 0.032 0.808
#> GSM613714     3  0.1031     0.8576 0.024 0.000 0.976
#> GSM613715     3  0.1031     0.8576 0.024 0.000 0.976
#> GSM613716     3  0.0000     0.8602 0.000 0.000 1.000
#> GSM613717     3  0.4676     0.8179 0.112 0.040 0.848
#> GSM613718     3  0.0424     0.8596 0.008 0.000 0.992
#> GSM613719     3  0.2796     0.8446 0.092 0.000 0.908
#> GSM613720     3  0.2537     0.8478 0.080 0.000 0.920
#> GSM613721     3  0.8472     0.5692 0.160 0.228 0.612
#> GSM613722     2  0.0592     0.7863 0.012 0.988 0.000
#> GSM613723     3  0.4178     0.7568 0.172 0.000 0.828
#> GSM613724     1  0.6093     0.6688 0.776 0.068 0.156
#> GSM613725     2  0.1860     0.7683 0.052 0.948 0.000
#> GSM613726     2  0.4002     0.7473 0.160 0.840 0.000
#> GSM613727     1  0.6280     0.3420 0.540 0.460 0.000
#> GSM613728     2  0.1289     0.7759 0.032 0.968 0.000
#> GSM613729     2  0.5016     0.6475 0.240 0.760 0.000
#> GSM613730     2  0.5216     0.6711 0.260 0.740 0.000
#> GSM613731     1  0.5678     0.6180 0.684 0.316 0.000
#> GSM613732     3  0.1031     0.8576 0.024 0.000 0.976
#> GSM613733     3  0.5650     0.7891 0.108 0.084 0.808
#> GSM613734     1  0.5327     0.5268 0.728 0.000 0.272
#> GSM613735     3  0.6215     0.3077 0.428 0.000 0.572
#> GSM613736     3  0.3886     0.8277 0.096 0.024 0.880
#> GSM613737     3  0.2261     0.8516 0.068 0.000 0.932
#> GSM613738     3  0.4796     0.7000 0.220 0.000 0.780
#> GSM613739     3  0.5497     0.5955 0.292 0.000 0.708
#> GSM613740     3  0.0424     0.8610 0.008 0.000 0.992
#> GSM613741     3  0.4195     0.8207 0.136 0.012 0.852
#> GSM613742     3  0.2356     0.8373 0.072 0.000 0.928
#> GSM613743     3  0.3207     0.8455 0.084 0.012 0.904
#> GSM613744     3  0.0000     0.8602 0.000 0.000 1.000
#> GSM613745     3  0.0892     0.8602 0.020 0.000 0.980
#> GSM613746     3  0.7256     0.7097 0.164 0.124 0.712
#> GSM613747     1  0.6180     0.1700 0.584 0.000 0.416
#> GSM613748     2  0.5397     0.6572 0.280 0.720 0.000
#> GSM613749     2  0.1411     0.7890 0.036 0.964 0.000
#> GSM613750     3  0.1031     0.8576 0.024 0.000 0.976
#> GSM613751     3  0.1031     0.8576 0.024 0.000 0.976
#> GSM613752     3  0.0424     0.8609 0.008 0.000 0.992
#> GSM613753     3  0.1031     0.8576 0.024 0.000 0.976

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM613638     2  0.7906     0.1102 0.300 0.356 0.344 0.000
#> GSM613639     4  0.4542     0.7321 0.088 0.108 0.000 0.804
#> GSM613640     2  0.5897     0.4463 0.368 0.588 0.000 0.044
#> GSM613641     4  0.5935     0.6028 0.256 0.080 0.000 0.664
#> GSM613642     2  0.2915     0.7335 0.080 0.892 0.000 0.028
#> GSM613643     1  0.2400     0.7388 0.928 0.032 0.028 0.012
#> GSM613644     2  0.5033     0.6427 0.220 0.740 0.036 0.004
#> GSM613645     2  0.6337     0.1302 0.468 0.472 0.000 0.060
#> GSM613646     3  0.4298     0.8527 0.036 0.032 0.840 0.092
#> GSM613647     3  0.1118     0.9267 0.036 0.000 0.964 0.000
#> GSM613648     3  0.0712     0.9314 0.008 0.004 0.984 0.004
#> GSM613649     3  0.1820     0.9192 0.036 0.000 0.944 0.020
#> GSM613650     3  0.1004     0.9284 0.024 0.000 0.972 0.004
#> GSM613651     3  0.0592     0.9320 0.016 0.000 0.984 0.000
#> GSM613652     3  0.2973     0.8461 0.144 0.000 0.856 0.000
#> GSM613653     4  0.5083     0.3481 0.036 0.000 0.248 0.716
#> GSM613654     3  0.3157     0.8428 0.144 0.000 0.852 0.004
#> GSM613655     1  0.3479     0.7281 0.840 0.012 0.000 0.148
#> GSM613656     3  0.4193     0.6770 0.268 0.000 0.732 0.000
#> GSM613657     3  0.1229     0.9277 0.020 0.008 0.968 0.004
#> GSM613658     1  0.1940     0.7067 0.924 0.000 0.076 0.000
#> GSM613659     2  0.2319     0.7283 0.040 0.924 0.000 0.036
#> GSM613660     2  0.6618    -0.2585 0.012 0.472 0.052 0.464
#> GSM613661     4  0.5695     0.1059 0.476 0.024 0.000 0.500
#> GSM613662     4  0.4663     0.6874 0.012 0.272 0.000 0.716
#> GSM613663     1  0.2796     0.7601 0.892 0.016 0.000 0.092
#> GSM613664     4  0.3972     0.7245 0.008 0.204 0.000 0.788
#> GSM613665     2  0.5693    -0.2418 0.024 0.504 0.000 0.472
#> GSM613666     4  0.5948     0.7000 0.160 0.144 0.000 0.696
#> GSM613667     4  0.6773     0.6071 0.136 0.276 0.000 0.588
#> GSM613668     1  0.6248     0.5005 0.644 0.104 0.000 0.252
#> GSM613669     4  0.3144     0.7004 0.072 0.044 0.000 0.884
#> GSM613670     4  0.0921     0.6802 0.000 0.028 0.000 0.972
#> GSM613671     4  0.5669     0.7205 0.092 0.200 0.000 0.708
#> GSM613672     1  0.2466     0.7580 0.916 0.028 0.000 0.056
#> GSM613673     1  0.7905    -0.0713 0.368 0.312 0.000 0.320
#> GSM613674     2  0.1302     0.7013 0.000 0.956 0.000 0.044
#> GSM613675     2  0.3421     0.7279 0.088 0.868 0.000 0.044
#> GSM613676     2  0.2002     0.7282 0.044 0.936 0.000 0.020
#> GSM613677     2  0.5947     0.4507 0.376 0.588 0.016 0.020
#> GSM613678     2  0.4426     0.6965 0.096 0.812 0.000 0.092
#> GSM613679     4  0.5364     0.5250 0.016 0.392 0.000 0.592
#> GSM613680     1  0.2926     0.7546 0.896 0.048 0.000 0.056
#> GSM613681     1  0.5062     0.6382 0.752 0.184 0.000 0.064
#> GSM613682     2  0.3144     0.7288 0.072 0.884 0.000 0.044
#> GSM613683     1  0.1929     0.7518 0.940 0.024 0.000 0.036
#> GSM613684     2  0.1635     0.6659 0.008 0.948 0.044 0.000
#> GSM613685     2  0.0469     0.7099 0.000 0.988 0.000 0.012
#> GSM613686     4  0.5157     0.6748 0.028 0.284 0.000 0.688
#> GSM613687     1  0.5327     0.5754 0.720 0.220 0.000 0.060
#> GSM613688     2  0.0895     0.7088 0.004 0.976 0.000 0.020
#> GSM613689     3  0.0524     0.9318 0.004 0.008 0.988 0.000
#> GSM613690     3  0.0779     0.9319 0.016 0.004 0.980 0.000
#> GSM613691     4  0.6426     0.4173 0.024 0.064 0.256 0.656
#> GSM613692     3  0.1109     0.9289 0.028 0.004 0.968 0.000
#> GSM613693     3  0.3845     0.8456 0.012 0.132 0.840 0.016
#> GSM613694     3  0.0376     0.9322 0.000 0.004 0.992 0.004
#> GSM613695     3  0.1004     0.9301 0.024 0.004 0.972 0.000
#> GSM613696     3  0.1510     0.9227 0.028 0.016 0.956 0.000
#> GSM613697     3  0.0592     0.9320 0.016 0.000 0.984 0.000
#> GSM613698     3  0.0188     0.9323 0.000 0.000 0.996 0.004
#> GSM613699     3  0.1913     0.9177 0.040 0.000 0.940 0.020
#> GSM613700     4  0.3636     0.7319 0.008 0.172 0.000 0.820
#> GSM613701     2  0.2647     0.6631 0.000 0.880 0.000 0.120
#> GSM613702     4  0.5630     0.5637 0.032 0.360 0.000 0.608
#> GSM613703     4  0.0927     0.6695 0.008 0.016 0.000 0.976
#> GSM613704     4  0.1792     0.7073 0.000 0.068 0.000 0.932
#> GSM613705     3  0.2647     0.8695 0.120 0.000 0.880 0.000
#> GSM613706     4  0.6412     0.6679 0.200 0.124 0.008 0.668
#> GSM613707     2  0.0712     0.6978 0.008 0.984 0.004 0.004
#> GSM613708     1  0.4379     0.6476 0.792 0.172 0.000 0.036
#> GSM613709     1  0.4669     0.7164 0.796 0.104 0.000 0.100
#> GSM613710     2  0.3706     0.7249 0.112 0.848 0.000 0.040
#> GSM613711     3  0.1398     0.9268 0.004 0.040 0.956 0.000
#> GSM613712     3  0.0895     0.9311 0.020 0.004 0.976 0.000
#> GSM613713     3  0.3625     0.8272 0.012 0.160 0.828 0.000
#> GSM613714     3  0.0779     0.9319 0.016 0.004 0.980 0.000
#> GSM613715     3  0.0779     0.9319 0.016 0.004 0.980 0.000
#> GSM613716     3  0.0188     0.9326 0.000 0.004 0.996 0.000
#> GSM613717     3  0.2179     0.9065 0.012 0.064 0.924 0.000
#> GSM613718     3  0.0524     0.9325 0.008 0.004 0.988 0.000
#> GSM613719     3  0.2660     0.9019 0.036 0.000 0.908 0.056
#> GSM613720     3  0.1114     0.9291 0.016 0.008 0.972 0.004
#> GSM613721     4  0.5270     0.3911 0.044 0.008 0.212 0.736
#> GSM613722     4  0.4328     0.7071 0.008 0.244 0.000 0.748
#> GSM613723     3  0.1389     0.9219 0.048 0.000 0.952 0.000
#> GSM613724     1  0.1675     0.7290 0.948 0.004 0.044 0.004
#> GSM613725     4  0.4746     0.5882 0.000 0.368 0.000 0.632
#> GSM613726     4  0.5972     0.6902 0.176 0.132 0.000 0.692
#> GSM613727     1  0.5833     0.0571 0.528 0.032 0.000 0.440
#> GSM613728     4  0.4522     0.6481 0.000 0.320 0.000 0.680
#> GSM613729     4  0.3597     0.6556 0.148 0.016 0.000 0.836
#> GSM613730     2  0.5090     0.6448 0.228 0.728 0.000 0.044
#> GSM613731     1  0.3335     0.7442 0.856 0.016 0.000 0.128
#> GSM613732     3  0.0657     0.9322 0.012 0.004 0.984 0.000
#> GSM613733     3  0.2125     0.9144 0.012 0.052 0.932 0.004
#> GSM613734     1  0.2647     0.6707 0.880 0.000 0.120 0.000
#> GSM613735     3  0.4804     0.4440 0.384 0.000 0.616 0.000
#> GSM613736     2  0.5217     0.1813 0.012 0.608 0.380 0.000
#> GSM613737     3  0.1151     0.9278 0.024 0.000 0.968 0.008
#> GSM613738     3  0.1474     0.9194 0.052 0.000 0.948 0.000
#> GSM613739     3  0.1716     0.9122 0.064 0.000 0.936 0.000
#> GSM613740     3  0.0937     0.9316 0.012 0.012 0.976 0.000
#> GSM613741     3  0.5577     0.5914 0.036 0.000 0.636 0.328
#> GSM613742     3  0.1004     0.9301 0.024 0.004 0.972 0.000
#> GSM613743     3  0.3695     0.8366 0.016 0.156 0.828 0.000
#> GSM613744     3  0.0524     0.9325 0.004 0.008 0.988 0.000
#> GSM613745     3  0.0712     0.9315 0.008 0.004 0.984 0.004
#> GSM613746     3  0.6528     0.6388 0.036 0.056 0.656 0.252
#> GSM613747     1  0.4134     0.5111 0.740 0.000 0.260 0.000
#> GSM613748     2  0.4719     0.6821 0.180 0.772 0.000 0.048
#> GSM613749     4  0.3498     0.7334 0.008 0.160 0.000 0.832
#> GSM613750     3  0.0657     0.9322 0.012 0.004 0.984 0.000
#> GSM613751     3  0.1004     0.9306 0.004 0.024 0.972 0.000
#> GSM613752     3  0.0937     0.9316 0.012 0.012 0.976 0.000
#> GSM613753     3  0.0779     0.9319 0.016 0.004 0.980 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
#> GSM613638     4  0.5571     0.2262 0.060 0.000 0.008 0.568 0.364
#> GSM613639     2  0.3380     0.7384 0.008 0.840 0.028 0.124 0.000
#> GSM613640     4  0.5446     0.6532 0.044 0.200 0.012 0.708 0.036
#> GSM613641     2  0.3724     0.6559 0.204 0.776 0.000 0.020 0.000
#> GSM613642     4  0.1843     0.6134 0.008 0.008 0.052 0.932 0.000
#> GSM613643     4  0.5013     0.5665 0.240 0.008 0.008 0.700 0.044
#> GSM613644     4  0.2460     0.6525 0.072 0.000 0.004 0.900 0.024
#> GSM613645     4  0.5055     0.6638 0.096 0.196 0.004 0.704 0.000
#> GSM613646     5  0.7673     0.3044 0.056 0.168 0.308 0.012 0.456
#> GSM613647     5  0.1518     0.8361 0.016 0.000 0.012 0.020 0.952
#> GSM613648     5  0.2864     0.8233 0.024 0.000 0.112 0.000 0.864
#> GSM613649     5  0.4238     0.7591 0.028 0.000 0.228 0.004 0.740
#> GSM613650     5  0.5067     0.7159 0.072 0.000 0.224 0.008 0.696
#> GSM613651     5  0.1251     0.8423 0.008 0.000 0.036 0.000 0.956
#> GSM613652     5  0.4400     0.5423 0.308 0.000 0.020 0.000 0.672
#> GSM613653     2  0.8096    -0.0572 0.100 0.464 0.284 0.028 0.124
#> GSM613654     5  0.4600     0.7671 0.136 0.000 0.104 0.004 0.756
#> GSM613655     1  0.3575     0.5725 0.800 0.180 0.004 0.016 0.000
#> GSM613656     1  0.4653     0.0142 0.516 0.000 0.012 0.000 0.472
#> GSM613657     5  0.1372     0.8447 0.016 0.000 0.024 0.004 0.956
#> GSM613658     1  0.3353     0.5848 0.852 0.004 0.004 0.040 0.100
#> GSM613659     4  0.6479     0.3981 0.004 0.264 0.188 0.540 0.004
#> GSM613660     2  0.7309     0.1026 0.012 0.460 0.036 0.348 0.144
#> GSM613661     2  0.4973     0.6785 0.164 0.720 0.004 0.112 0.000
#> GSM613662     2  0.3093     0.7221 0.000 0.824 0.008 0.168 0.000
#> GSM613663     1  0.4840     0.3926 0.640 0.320 0.000 0.040 0.000
#> GSM613664     2  0.2077     0.7408 0.000 0.920 0.040 0.040 0.000
#> GSM613665     4  0.4446     0.0435 0.004 0.476 0.000 0.520 0.000
#> GSM613666     2  0.3894     0.6988 0.156 0.800 0.008 0.036 0.000
#> GSM613667     2  0.4295     0.6400 0.024 0.724 0.004 0.248 0.000
#> GSM613668     1  0.4926     0.4922 0.676 0.276 0.012 0.036 0.000
#> GSM613669     2  0.1885     0.7364 0.032 0.936 0.012 0.020 0.000
#> GSM613670     2  0.0609     0.7214 0.000 0.980 0.020 0.000 0.000
#> GSM613671     2  0.3078     0.7331 0.016 0.848 0.004 0.132 0.000
#> GSM613672     1  0.3828     0.5692 0.808 0.120 0.000 0.072 0.000
#> GSM613673     2  0.6514     0.4264 0.268 0.548 0.016 0.168 0.000
#> GSM613674     3  0.5681     0.5926 0.000 0.124 0.608 0.268 0.000
#> GSM613675     4  0.3769     0.6888 0.004 0.172 0.028 0.796 0.000
#> GSM613676     4  0.3130     0.5949 0.000 0.048 0.096 0.856 0.000
#> GSM613677     4  0.5530     0.6047 0.156 0.024 0.008 0.712 0.100
#> GSM613678     4  0.3722     0.6703 0.004 0.144 0.040 0.812 0.000
#> GSM613679     2  0.4587     0.5810 0.008 0.692 0.024 0.276 0.000
#> GSM613680     1  0.4860    -0.0159 0.540 0.016 0.004 0.440 0.000
#> GSM613681     1  0.5875    -0.0217 0.512 0.088 0.004 0.396 0.000
#> GSM613682     3  0.7269     0.4843 0.076 0.124 0.484 0.316 0.000
#> GSM613683     1  0.3010     0.5334 0.824 0.004 0.000 0.172 0.000
#> GSM613684     3  0.4888     0.6147 0.000 0.016 0.652 0.312 0.020
#> GSM613685     3  0.4752     0.6080 0.000 0.036 0.648 0.316 0.000
#> GSM613686     2  0.3807     0.6868 0.008 0.776 0.012 0.204 0.000
#> GSM613687     1  0.6574     0.1231 0.492 0.208 0.004 0.296 0.000
#> GSM613688     3  0.6058     0.4638 0.004 0.244 0.588 0.164 0.000
#> GSM613689     5  0.1571     0.8405 0.004 0.000 0.060 0.000 0.936
#> GSM613690     5  0.0579     0.8393 0.000 0.000 0.008 0.008 0.984
#> GSM613691     2  0.6562     0.1060 0.032 0.568 0.308 0.016 0.076
#> GSM613692     5  0.3821     0.6855 0.216 0.000 0.020 0.000 0.764
#> GSM613693     3  0.4978     0.6222 0.000 0.016 0.736 0.092 0.156
#> GSM613694     5  0.3933     0.7758 0.020 0.000 0.196 0.008 0.776
#> GSM613695     5  0.1200     0.8365 0.008 0.000 0.016 0.012 0.964
#> GSM613696     5  0.4863     0.5080 0.016 0.000 0.384 0.008 0.592
#> GSM613697     5  0.1557     0.8424 0.008 0.000 0.052 0.000 0.940
#> GSM613698     5  0.2130     0.8335 0.012 0.000 0.080 0.000 0.908
#> GSM613699     5  0.4541     0.7730 0.020 0.028 0.168 0.012 0.772
#> GSM613700     2  0.1830     0.7438 0.004 0.932 0.012 0.052 0.000
#> GSM613701     2  0.6602     0.2236 0.000 0.456 0.304 0.240 0.000
#> GSM613702     2  0.4227     0.2820 0.000 0.580 0.000 0.420 0.000
#> GSM613703     2  0.0798     0.7212 0.008 0.976 0.016 0.000 0.000
#> GSM613704     2  0.0854     0.7253 0.004 0.976 0.012 0.008 0.000
#> GSM613705     5  0.5655     0.5830 0.088 0.000 0.036 0.192 0.684
#> GSM613706     2  0.5368     0.6460 0.016 0.696 0.064 0.216 0.008
#> GSM613707     3  0.4624     0.5948 0.000 0.024 0.636 0.340 0.000
#> GSM613708     4  0.4116     0.5796 0.248 0.016 0.004 0.732 0.000
#> GSM613709     4  0.6519     0.2205 0.380 0.168 0.004 0.448 0.000
#> GSM613710     4  0.2840     0.7131 0.012 0.108 0.004 0.872 0.004
#> GSM613711     5  0.1954     0.8320 0.008 0.000 0.028 0.032 0.932
#> GSM613712     5  0.0451     0.8411 0.000 0.000 0.004 0.008 0.988
#> GSM613713     3  0.4844     0.6145 0.000 0.000 0.720 0.108 0.172
#> GSM613714     5  0.1153     0.8435 0.004 0.000 0.024 0.008 0.964
#> GSM613715     5  0.1507     0.8421 0.012 0.000 0.024 0.012 0.952
#> GSM613716     5  0.3579     0.8081 0.032 0.000 0.116 0.016 0.836
#> GSM613717     5  0.4089     0.7699 0.024 0.000 0.180 0.016 0.780
#> GSM613718     5  0.0912     0.8374 0.000 0.000 0.016 0.012 0.972
#> GSM613719     5  0.5888     0.6659 0.072 0.012 0.248 0.020 0.648
#> GSM613720     5  0.3241     0.8059 0.024 0.000 0.144 0.000 0.832
#> GSM613721     3  0.8006     0.2291 0.072 0.328 0.436 0.028 0.136
#> GSM613722     2  0.2674     0.7340 0.000 0.856 0.004 0.140 0.000
#> GSM613723     5  0.1399     0.8367 0.028 0.000 0.020 0.000 0.952
#> GSM613724     1  0.2628     0.5803 0.884 0.000 0.000 0.088 0.028
#> GSM613725     2  0.4010     0.7066 0.000 0.784 0.056 0.160 0.000
#> GSM613726     2  0.3675     0.7392 0.032 0.828 0.016 0.124 0.000
#> GSM613727     1  0.4675     0.2884 0.600 0.380 0.000 0.020 0.000
#> GSM613728     2  0.4181     0.6629 0.008 0.736 0.016 0.240 0.000
#> GSM613729     2  0.1921     0.7120 0.044 0.932 0.012 0.012 0.000
#> GSM613730     4  0.4468     0.6969 0.044 0.160 0.008 0.776 0.012
#> GSM613731     4  0.6564     0.4718 0.132 0.292 0.028 0.548 0.000
#> GSM613732     5  0.1074     0.8368 0.004 0.000 0.016 0.012 0.968
#> GSM613733     5  0.5646     0.6878 0.032 0.004 0.164 0.100 0.700
#> GSM613734     1  0.2149     0.5841 0.916 0.000 0.000 0.048 0.036
#> GSM613735     1  0.4659    -0.0416 0.500 0.000 0.012 0.000 0.488
#> GSM613736     3  0.6630     0.4391 0.000 0.000 0.444 0.240 0.316
#> GSM613737     5  0.4694     0.7385 0.040 0.000 0.228 0.012 0.720
#> GSM613738     5  0.3532     0.8189 0.092 0.000 0.076 0.000 0.832
#> GSM613739     5  0.2236     0.8332 0.068 0.000 0.024 0.000 0.908
#> GSM613740     5  0.0609     0.8398 0.000 0.000 0.020 0.000 0.980
#> GSM613741     5  0.8462     0.2518 0.100 0.216 0.248 0.024 0.412
#> GSM613742     5  0.1725     0.8402 0.044 0.000 0.020 0.000 0.936
#> GSM613743     5  0.5223     0.5682 0.000 0.000 0.220 0.108 0.672
#> GSM613744     5  0.0324     0.8408 0.000 0.000 0.004 0.004 0.992
#> GSM613745     5  0.4792     0.7503 0.076 0.000 0.196 0.004 0.724
#> GSM613746     3  0.5098     0.4755 0.060 0.016 0.716 0.004 0.204
#> GSM613747     1  0.3543     0.5352 0.832 0.000 0.008 0.036 0.124
#> GSM613748     4  0.3689     0.7121 0.048 0.128 0.004 0.820 0.000
#> GSM613749     2  0.1569     0.7397 0.008 0.948 0.012 0.032 0.000
#> GSM613750     5  0.1173     0.8368 0.004 0.000 0.020 0.012 0.964
#> GSM613751     5  0.1885     0.8272 0.004 0.000 0.044 0.020 0.932
#> GSM613752     5  0.1364     0.8367 0.000 0.000 0.036 0.012 0.952
#> GSM613753     5  0.1173     0.8368 0.004 0.000 0.020 0.012 0.964

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM613638     4  0.6284    0.21054 0.000 0.008 0.404 0.424 0.020 0.144
#> GSM613639     1  0.3280    0.80780 0.844 0.012 0.000 0.084 0.004 0.056
#> GSM613640     4  0.4314    0.73310 0.096 0.000 0.040 0.772 0.000 0.092
#> GSM613641     1  0.3351    0.76609 0.808 0.000 0.000 0.036 0.152 0.004
#> GSM613642     4  0.3174    0.75051 0.016 0.052 0.016 0.872 0.012 0.032
#> GSM613643     4  0.3281    0.72963 0.004 0.000 0.008 0.832 0.120 0.036
#> GSM613644     4  0.3406    0.73736 0.004 0.016 0.024 0.856 0.048 0.052
#> GSM613645     4  0.3252    0.73014 0.124 0.008 0.000 0.832 0.032 0.004
#> GSM613646     6  0.5961    0.64890 0.104 0.040 0.236 0.008 0.004 0.608
#> GSM613647     3  0.1464    0.66001 0.000 0.000 0.944 0.016 0.004 0.036
#> GSM613648     3  0.3975   -0.14643 0.000 0.000 0.544 0.004 0.000 0.452
#> GSM613649     6  0.3930    0.49450 0.000 0.004 0.420 0.000 0.000 0.576
#> GSM613650     6  0.4157    0.59993 0.004 0.004 0.360 0.000 0.008 0.624
#> GSM613651     3  0.2805    0.61224 0.000 0.000 0.828 0.012 0.000 0.160
#> GSM613652     3  0.4420    0.38939 0.000 0.000 0.620 0.000 0.340 0.040
#> GSM613653     6  0.4682    0.56525 0.176 0.008 0.088 0.004 0.004 0.720
#> GSM613654     3  0.5595    0.17362 0.000 0.000 0.540 0.000 0.192 0.268
#> GSM613655     5  0.1686    0.69681 0.052 0.000 0.004 0.008 0.932 0.004
#> GSM613656     3  0.4335    0.16162 0.000 0.000 0.508 0.000 0.472 0.020
#> GSM613657     3  0.1471    0.66189 0.000 0.000 0.932 0.004 0.000 0.064
#> GSM613658     5  0.2218    0.68963 0.000 0.008 0.028 0.020 0.916 0.028
#> GSM613659     1  0.7767    0.41019 0.468 0.120 0.072 0.248 0.008 0.084
#> GSM613660     1  0.6899    0.47514 0.548 0.008 0.192 0.112 0.008 0.132
#> GSM613661     1  0.4587    0.77412 0.764 0.012 0.000 0.104 0.084 0.036
#> GSM613662     1  0.2673    0.81114 0.856 0.004 0.000 0.128 0.004 0.008
#> GSM613663     1  0.4533    0.33232 0.540 0.000 0.000 0.020 0.432 0.008
#> GSM613664     1  0.1564    0.80813 0.936 0.040 0.000 0.024 0.000 0.000
#> GSM613665     1  0.3905    0.72341 0.712 0.012 0.000 0.264 0.000 0.012
#> GSM613666     1  0.3057    0.80642 0.864 0.012 0.000 0.052 0.064 0.008
#> GSM613667     1  0.3799    0.78218 0.768 0.004 0.000 0.188 0.036 0.004
#> GSM613668     5  0.3533    0.65231 0.128 0.040 0.000 0.012 0.816 0.004
#> GSM613669     1  0.1251    0.79948 0.956 0.000 0.000 0.012 0.024 0.008
#> GSM613670     1  0.1003    0.79129 0.964 0.000 0.000 0.004 0.004 0.028
#> GSM613671     1  0.2906    0.80778 0.844 0.004 0.000 0.132 0.016 0.004
#> GSM613672     5  0.2527    0.68263 0.084 0.000 0.000 0.040 0.876 0.000
#> GSM613673     1  0.4690    0.75822 0.720 0.012 0.000 0.160 0.104 0.004
#> GSM613674     2  0.2230    0.78322 0.084 0.892 0.000 0.024 0.000 0.000
#> GSM613675     4  0.4412    0.70906 0.156 0.036 0.004 0.764 0.012 0.028
#> GSM613676     4  0.3073    0.75258 0.032 0.060 0.008 0.868 0.000 0.032
#> GSM613677     4  0.5502    0.60493 0.008 0.008 0.168 0.688 0.068 0.060
#> GSM613678     4  0.3151    0.74107 0.112 0.040 0.000 0.840 0.004 0.004
#> GSM613679     1  0.3680    0.74586 0.744 0.020 0.000 0.232 0.000 0.004
#> GSM613680     4  0.4262    0.29268 0.012 0.000 0.000 0.560 0.424 0.004
#> GSM613681     5  0.5249   -0.14468 0.068 0.004 0.000 0.460 0.464 0.004
#> GSM613682     2  0.3932    0.72501 0.032 0.800 0.000 0.088 0.080 0.000
#> GSM613683     5  0.3121    0.58779 0.000 0.004 0.000 0.180 0.804 0.012
#> GSM613684     2  0.1769    0.80504 0.012 0.924 0.000 0.060 0.000 0.004
#> GSM613685     2  0.1686    0.80487 0.012 0.924 0.000 0.064 0.000 0.000
#> GSM613686     1  0.3166    0.78269 0.800 0.008 0.000 0.184 0.000 0.008
#> GSM613687     5  0.6034    0.16802 0.208 0.004 0.000 0.296 0.488 0.004
#> GSM613688     2  0.4976    0.39232 0.304 0.624 0.000 0.048 0.000 0.024
#> GSM613689     3  0.3290    0.48703 0.000 0.004 0.744 0.000 0.000 0.252
#> GSM613690     3  0.1010    0.66197 0.000 0.000 0.960 0.004 0.000 0.036
#> GSM613691     6  0.6702    0.31508 0.272 0.168 0.076 0.000 0.000 0.484
#> GSM613692     3  0.4385    0.49002 0.000 0.004 0.704 0.004 0.236 0.052
#> GSM613693     2  0.1562    0.78601 0.004 0.940 0.024 0.000 0.000 0.032
#> GSM613694     3  0.4590   -0.24794 0.000 0.020 0.512 0.004 0.004 0.460
#> GSM613695     3  0.0713    0.65365 0.000 0.000 0.972 0.000 0.000 0.028
#> GSM613696     6  0.6111    0.43520 0.000 0.340 0.296 0.000 0.000 0.364
#> GSM613697     3  0.2357    0.64489 0.000 0.000 0.872 0.012 0.000 0.116
#> GSM613698     3  0.3437    0.53307 0.000 0.000 0.752 0.008 0.004 0.236
#> GSM613699     3  0.4605    0.00379 0.016 0.016 0.552 0.000 0.000 0.416
#> GSM613700     1  0.1333    0.81126 0.944 0.000 0.000 0.048 0.000 0.008
#> GSM613701     1  0.5647    0.54650 0.580 0.280 0.000 0.116 0.000 0.024
#> GSM613702     1  0.4394    0.53605 0.608 0.008 0.000 0.364 0.000 0.020
#> GSM613703     1  0.1116    0.79363 0.960 0.000 0.000 0.008 0.004 0.028
#> GSM613704     1  0.0891    0.79763 0.968 0.000 0.000 0.008 0.000 0.024
#> GSM613705     3  0.5551   -0.05664 0.000 0.004 0.460 0.448 0.016 0.072
#> GSM613706     1  0.5148    0.69515 0.668 0.012 0.004 0.228 0.008 0.080
#> GSM613707     2  0.1967    0.79857 0.012 0.904 0.000 0.084 0.000 0.000
#> GSM613708     4  0.3037    0.73147 0.016 0.016 0.000 0.848 0.116 0.004
#> GSM613709     4  0.5314    0.51402 0.164 0.000 0.000 0.612 0.220 0.004
#> GSM613710     4  0.1934    0.75936 0.040 0.000 0.000 0.916 0.000 0.044
#> GSM613711     3  0.2544    0.64325 0.000 0.008 0.888 0.028 0.004 0.072
#> GSM613712     3  0.1536    0.65954 0.000 0.004 0.940 0.016 0.000 0.040
#> GSM613713     2  0.1644    0.77493 0.000 0.932 0.028 0.000 0.000 0.040
#> GSM613714     3  0.4221    0.56029 0.000 0.008 0.744 0.056 0.004 0.188
#> GSM613715     3  0.2678    0.64300 0.000 0.004 0.860 0.020 0.000 0.116
#> GSM613716     3  0.4463   -0.24949 0.000 0.004 0.508 0.020 0.000 0.468
#> GSM613717     6  0.5348    0.55802 0.004 0.024 0.352 0.044 0.004 0.572
#> GSM613718     3  0.1226    0.66006 0.000 0.004 0.952 0.004 0.000 0.040
#> GSM613719     6  0.3721    0.64496 0.000 0.000 0.308 0.004 0.004 0.684
#> GSM613720     3  0.3810    0.02684 0.000 0.000 0.572 0.000 0.000 0.428
#> GSM613721     6  0.5761    0.38814 0.060 0.256 0.084 0.000 0.000 0.600
#> GSM613722     1  0.2191    0.80705 0.876 0.000 0.000 0.120 0.000 0.004
#> GSM613723     3  0.2106    0.66294 0.000 0.000 0.904 0.000 0.032 0.064
#> GSM613724     5  0.1225    0.69024 0.000 0.000 0.012 0.036 0.952 0.000
#> GSM613725     1  0.3839    0.79468 0.796 0.032 0.000 0.132 0.000 0.040
#> GSM613726     1  0.3818    0.80482 0.812 0.004 0.000 0.104 0.040 0.040
#> GSM613727     5  0.4150    0.24007 0.368 0.000 0.000 0.008 0.616 0.008
#> GSM613728     1  0.4635    0.61756 0.648 0.004 0.000 0.288 0.000 0.060
#> GSM613729     1  0.2228    0.79621 0.912 0.004 0.000 0.024 0.044 0.016
#> GSM613730     4  0.4297    0.71059 0.076 0.008 0.020 0.792 0.012 0.092
#> GSM613731     4  0.5965    0.40983 0.284 0.004 0.000 0.560 0.120 0.032
#> GSM613732     3  0.0806    0.66007 0.000 0.000 0.972 0.008 0.000 0.020
#> GSM613733     6  0.6157    0.49876 0.012 0.012 0.268 0.144 0.008 0.556
#> GSM613734     5  0.0951    0.68278 0.000 0.000 0.020 0.004 0.968 0.008
#> GSM613735     5  0.4175   -0.12173 0.000 0.000 0.464 0.000 0.524 0.012
#> GSM613736     3  0.7217    0.05080 0.004 0.324 0.428 0.124 0.008 0.112
#> GSM613737     6  0.3830    0.57360 0.000 0.000 0.376 0.000 0.004 0.620
#> GSM613738     3  0.5124    0.24242 0.000 0.004 0.596 0.012 0.060 0.328
#> GSM613739     3  0.4016    0.59539 0.000 0.000 0.772 0.008 0.088 0.132
#> GSM613740     3  0.2308    0.64327 0.000 0.008 0.880 0.004 0.000 0.108
#> GSM613741     6  0.4769    0.65781 0.040 0.008 0.284 0.000 0.012 0.656
#> GSM613742     3  0.3694    0.60335 0.000 0.000 0.788 0.008 0.048 0.156
#> GSM613743     3  0.5626    0.41228 0.000 0.164 0.644 0.036 0.004 0.152
#> GSM613744     3  0.2445    0.63637 0.000 0.000 0.868 0.008 0.004 0.120
#> GSM613745     6  0.4513    0.58800 0.000 0.000 0.372 0.016 0.016 0.596
#> GSM613746     2  0.4878    0.03825 0.000 0.516 0.060 0.000 0.000 0.424
#> GSM613747     5  0.2697    0.63906 0.000 0.000 0.068 0.008 0.876 0.048
#> GSM613748     4  0.3167    0.74039 0.052 0.004 0.000 0.852 0.012 0.080
#> GSM613749     1  0.1349    0.81243 0.940 0.000 0.000 0.056 0.000 0.004
#> GSM613750     3  0.2113    0.61773 0.000 0.008 0.896 0.004 0.000 0.092
#> GSM613751     3  0.2803    0.58902 0.000 0.016 0.856 0.012 0.000 0.116
#> GSM613752     3  0.2301    0.62238 0.000 0.020 0.884 0.000 0.000 0.096
#> GSM613753     3  0.2009    0.62793 0.000 0.008 0.904 0.004 0.000 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-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 disease.state(p) k
#> ATC:NMF 115          0.00706 2
#> ATC:NMF 104          0.15393 3
#> ATC:NMF 102          0.40694 4
#> ATC:NMF  90          0.11451 5
#> ATC:NMF  85          0.02302 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