cola Report for GDS2106

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

Document is loading...


Summary

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

res_list
#> A 'ConsensusPartitionList' object with 24 methods.
#>   On a matrix with 8353 rows and 100 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] 8353  100

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
CV:skmeans 2 0.958 0.958 0.982 **
CV:NMF 2 0.956 0.929 0.972 **
CV:kmeans 2 0.938 0.960 0.982 *
ATC:skmeans 3 0.910 0.917 0.961 * 2
ATC:NMF 2 0.898 0.905 0.962
MAD:skmeans 2 0.843 0.914 0.962
MAD:kmeans 2 0.840 0.891 0.955
SD:NMF 2 0.837 0.888 0.956
MAD:NMF 2 0.816 0.884 0.952
SD:kmeans 2 0.807 0.889 0.949
CV:mclust 2 0.802 0.907 0.956
ATC:pam 2 0.802 0.875 0.950
SD:skmeans 2 0.801 0.897 0.956
SD:mclust 2 0.720 0.896 0.920
ATC:kmeans 2 0.684 0.912 0.944
ATC:mclust 5 0.684 0.758 0.843
MAD:mclust 2 0.471 0.891 0.894
MAD:pam 2 0.461 0.819 0.903
ATC:hclust 3 0.406 0.657 0.813
SD:pam 2 0.251 0.748 0.848
CV:pam 2 0.141 0.629 0.801
CV:hclust 4 0.111 0.484 0.683
SD:hclust 3 0.102 0.613 0.734
MAD:hclust 2 0.084 0.711 0.802

**: 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.8374           0.888       0.956          0.502 0.495   0.495
#> CV:NMF      2 0.9563           0.929       0.972          0.503 0.496   0.496
#> MAD:NMF     2 0.8157           0.884       0.952          0.503 0.495   0.495
#> ATC:NMF     2 0.8976           0.905       0.962          0.473 0.515   0.515
#> SD:skmeans  2 0.8009           0.897       0.956          0.505 0.495   0.495
#> CV:skmeans  2 0.9581           0.958       0.982          0.505 0.495   0.495
#> MAD:skmeans 2 0.8432           0.914       0.962          0.505 0.495   0.495
#> ATC:skmeans 2 0.9574           0.939       0.975          0.504 0.496   0.496
#> SD:mclust   2 0.7205           0.896       0.920          0.477 0.495   0.495
#> CV:mclust   2 0.8018           0.907       0.956          0.499 0.495   0.495
#> MAD:mclust  2 0.4710           0.891       0.894          0.469 0.495   0.495
#> ATC:mclust  2 0.7765           0.915       0.954          0.366 0.665   0.665
#> SD:kmeans   2 0.8070           0.889       0.949          0.503 0.497   0.497
#> CV:kmeans   2 0.9380           0.960       0.982          0.505 0.495   0.495
#> MAD:kmeans  2 0.8396           0.891       0.955          0.504 0.496   0.496
#> ATC:kmeans  2 0.6840           0.912       0.944          0.481 0.508   0.508
#> SD:pam      2 0.2508           0.748       0.848          0.459 0.553   0.553
#> CV:pam      2 0.1409           0.629       0.801          0.475 0.519   0.519
#> MAD:pam     2 0.4611           0.819       0.903          0.462 0.535   0.535
#> ATC:pam     2 0.8018           0.875       0.950          0.489 0.515   0.515
#> SD:hclust   2 0.0708           0.468       0.674          0.381 0.515   0.515
#> CV:hclust   2 0.1196           0.608       0.797          0.292 0.904   0.904
#> MAD:hclust  2 0.0844           0.711       0.802          0.434 0.502   0.502
#> ATC:hclust  2 0.3724           0.727       0.860          0.351 0.642   0.642
get_stats(res_list, k = 3)
#>             k  1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.4719           0.519       0.773          0.323 0.736   0.518
#> CV:NMF      3 0.3978           0.501       0.722          0.309 0.736   0.516
#> MAD:NMF     3 0.4918           0.587       0.802          0.320 0.767   0.561
#> ATC:NMF     3 0.8323           0.889       0.944          0.402 0.708   0.490
#> SD:skmeans  3 0.5624           0.730       0.831          0.306 0.800   0.614
#> CV:skmeans  3 0.5039           0.694       0.823          0.294 0.805   0.625
#> MAD:skmeans 3 0.7380           0.777       0.891          0.300 0.817   0.645
#> ATC:skmeans 3 0.9097           0.917       0.961          0.308 0.762   0.555
#> SD:mclust   3 0.4177           0.608       0.741          0.245 0.867   0.736
#> CV:mclust   3 0.5115           0.740       0.846          0.225 0.870   0.739
#> MAD:mclust  3 0.4943           0.713       0.819          0.282 0.838   0.680
#> ATC:mclust  3 0.3838           0.732       0.845          0.669 0.666   0.512
#> SD:kmeans   3 0.5471           0.651       0.792          0.268 0.829   0.664
#> CV:kmeans   3 0.6414           0.742       0.836          0.257 0.857   0.717
#> MAD:kmeans  3 0.6226           0.760       0.828          0.263 0.847   0.697
#> ATC:kmeans  3 0.4383           0.654       0.787          0.300 0.712   0.501
#> SD:pam      3 0.3828           0.673       0.801          0.428 0.728   0.529
#> CV:pam      3 0.2795           0.596       0.715          0.380 0.714   0.495
#> MAD:pam     3 0.3953           0.714       0.824          0.430 0.746   0.544
#> ATC:pam     3 0.7539           0.824       0.929          0.177 0.916   0.837
#> SD:hclust   3 0.1019           0.613       0.734          0.351 0.666   0.498
#> CV:hclust   3 0.0831           0.458       0.705          0.656 0.594   0.563
#> MAD:hclust  3 0.1149           0.657       0.736          0.211 0.937   0.879
#> ATC:hclust  3 0.4058           0.657       0.813          0.656 0.638   0.477
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.436          0.4354       0.693         0.1119 0.776   0.455
#> CV:NMF      4 0.436          0.4340       0.693         0.1202 0.802   0.492
#> MAD:NMF     4 0.420          0.3959       0.617         0.1115 0.858   0.620
#> ATC:NMF     4 0.759          0.8176       0.896         0.1328 0.845   0.580
#> SD:skmeans  4 0.457          0.4764       0.686         0.1263 0.877   0.671
#> CV:skmeans  4 0.442          0.3540       0.615         0.1301 0.858   0.619
#> MAD:skmeans 4 0.495          0.4730       0.698         0.1301 0.961   0.888
#> ATC:skmeans 4 0.803          0.8459       0.915         0.1324 0.828   0.546
#> SD:mclust   4 0.508          0.7015       0.801         0.1577 0.897   0.748
#> CV:mclust   4 0.537          0.5828       0.780         0.1071 0.972   0.924
#> MAD:mclust  4 0.670          0.8186       0.869         0.1206 0.895   0.729
#> ATC:mclust  4 0.817          0.8476       0.934         0.0689 0.704   0.418
#> SD:kmeans   4 0.561          0.7386       0.800         0.1196 0.897   0.728
#> CV:kmeans   4 0.511          0.5823       0.750         0.1161 0.941   0.845
#> MAD:kmeans  4 0.549          0.7028       0.742         0.1256 0.936   0.825
#> ATC:kmeans  4 0.598          0.7177       0.809         0.1528 0.838   0.597
#> SD:pam      4 0.473          0.5743       0.764         0.1201 0.848   0.589
#> CV:pam      4 0.404          0.4900       0.724         0.1130 0.838   0.564
#> MAD:pam     4 0.487          0.6446       0.776         0.1178 0.893   0.692
#> ATC:pam     4 0.593          0.6898       0.848         0.1960 0.858   0.685
#> SD:hclust   4 0.131          0.0731       0.482         0.1195 0.571   0.386
#> CV:hclust   4 0.111          0.4841       0.683         0.1561 0.951   0.911
#> MAD:hclust  4 0.187          0.5660       0.700         0.1400 0.958   0.914
#> ATC:hclust  4 0.412          0.4517       0.703         0.1753 0.864   0.681
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.468           0.428       0.617         0.0693 0.821   0.453
#> CV:NMF      5 0.481           0.414       0.633         0.0713 0.852   0.510
#> MAD:NMF     5 0.477           0.439       0.640         0.0712 0.803   0.422
#> ATC:NMF     5 0.666           0.631       0.788         0.0577 0.915   0.682
#> SD:skmeans  5 0.489           0.433       0.643         0.0696 0.894   0.652
#> CV:skmeans  5 0.455           0.403       0.605         0.0700 0.863   0.564
#> MAD:skmeans 5 0.489           0.372       0.585         0.0715 0.867   0.600
#> ATC:skmeans 5 0.842           0.810       0.894         0.0685 0.888   0.598
#> SD:mclust   5 0.746           0.730       0.864         0.1348 0.854   0.574
#> CV:mclust   5 0.641           0.706       0.816         0.1464 0.797   0.467
#> MAD:mclust  5 0.639           0.692       0.806         0.1333 0.885   0.641
#> ATC:mclust  5 0.684           0.758       0.843         0.1152 0.922   0.787
#> SD:kmeans   5 0.584           0.482       0.693         0.0719 0.921   0.743
#> CV:kmeans   5 0.563           0.451       0.703         0.0684 0.942   0.830
#> MAD:kmeans  5 0.607           0.592       0.703         0.0758 0.902   0.685
#> ATC:kmeans  5 0.646           0.616       0.753         0.0831 0.916   0.715
#> SD:pam      5 0.492           0.357       0.672         0.0417 0.896   0.668
#> CV:pam      5 0.443           0.413       0.704         0.0265 0.988   0.952
#> MAD:pam     5 0.530           0.480       0.745         0.0484 0.964   0.868
#> ATC:pam     5 0.831           0.828       0.919         0.1225 0.818   0.508
#> SD:hclust   5 0.186           0.514       0.674         0.0675 0.575   0.379
#> CV:hclust   5 0.160           0.416       0.667         0.0746 0.923   0.853
#> MAD:hclust  5 0.228           0.506       0.680         0.0792 0.957   0.906
#> ATC:hclust  5 0.451           0.405       0.667         0.0744 0.839   0.574
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.524           0.385       0.628         0.0445 0.844   0.420
#> CV:NMF      6 0.516           0.359       0.605         0.0434 0.908   0.622
#> MAD:NMF     6 0.527           0.392       0.598         0.0431 0.892   0.564
#> ATC:NMF     6 0.680           0.568       0.755         0.0452 0.903   0.583
#> SD:skmeans  6 0.503           0.324       0.577         0.0420 0.898   0.597
#> CV:skmeans  6 0.485           0.240       0.500         0.0446 0.856   0.484
#> MAD:skmeans 6 0.518           0.293       0.596         0.0413 0.889   0.581
#> ATC:skmeans 6 0.827           0.728       0.864         0.0380 0.940   0.722
#> SD:mclust   6 0.709           0.677       0.816         0.0399 0.922   0.672
#> CV:mclust   6 0.641           0.603       0.766         0.0405 0.943   0.753
#> MAD:mclust  6 0.683           0.628       0.764         0.0596 0.901   0.586
#> ATC:mclust  6 0.685           0.625       0.787         0.0625 0.829   0.500
#> SD:kmeans   6 0.605           0.444       0.650         0.0452 0.921   0.695
#> CV:kmeans   6 0.581           0.413       0.622         0.0421 0.901   0.676
#> MAD:kmeans  6 0.616           0.552       0.715         0.0448 0.983   0.922
#> ATC:kmeans  6 0.709           0.595       0.746         0.0465 0.921   0.678
#> SD:pam      6 0.555           0.446       0.738         0.0239 0.858   0.538
#> CV:pam      6 0.459           0.444       0.698         0.0131 0.972   0.894
#> MAD:pam     6 0.559           0.543       0.746         0.0281 0.921   0.692
#> ATC:pam     6 0.817           0.760       0.887         0.0443 0.954   0.802
#> SD:hclust   6 0.252           0.460       0.640         0.0920 0.886   0.764
#> CV:hclust   6 0.245           0.385       0.656         0.0800 0.953   0.896
#> MAD:hclust  6 0.310           0.358       0.660         0.0691 0.916   0.808
#> ATC:hclust  6 0.525           0.556       0.719         0.0565 0.920   0.710

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 = 835, method = "euler")

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

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

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

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

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

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

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

top_rows_overlap(res_list, top_n = 4176, 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 = 835, method = "correspondance")

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

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

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

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

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

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

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

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

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

Heatmaps of the top rows:

top_rows_heatmap(res_list, top_n = 835)

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

top_rows_heatmap(res_list, top_n = 1670)

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

top_rows_heatmap(res_list, top_n = 2506)

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

top_rows_heatmap(res_list, top_n = 3341)

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

top_rows_heatmap(res_list, top_n = 4176)

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 genotype/variation(p) k
#> SD:NMF       93              1.61e-04 2
#> CV:NMF       96              9.23e-05 2
#> MAD:NMF      94              5.70e-05 2
#> ATC:NMF      93              7.87e-05 2
#> SD:skmeans   95              1.56e-05 2
#> CV:skmeans   98              2.90e-05 2
#> MAD:skmeans  97              1.29e-05 2
#> ATC:skmeans  96              1.32e-04 2
#> SD:mclust    97              5.16e-06 2
#> CV:mclust    97              3.40e-06 2
#> MAD:mclust   97              5.16e-06 2
#> ATC:mclust   99              3.10e-08 2
#> SD:kmeans    94              3.38e-05 2
#> CV:kmeans   100              7.47e-05 2
#> MAD:kmeans   94              2.03e-05 2
#> ATC:kmeans  100              1.21e-04 2
#> SD:pam       91              1.05e-04 2
#> CV:pam       78              4.69e-04 2
#> MAD:pam      94              1.39e-04 2
#> ATC:pam      94              2.43e-06 2
#> SD:hclust    74              1.08e-04 2
#> CV:hclust    81              2.79e-02 2
#> MAD:hclust   92              6.92e-05 2
#> ATC:hclust   96              6.13e-02 2
test_to_known_factors(res_list, k = 3)
#>              n genotype/variation(p) k
#> SD:NMF      65              1.51e-03 3
#> CV:NMF      62              2.60e-04 3
#> MAD:NMF     74              6.19e-04 3
#> ATC:NMF     97              4.24e-06 3
#> SD:skmeans  88              1.77e-05 3
#> CV:skmeans  81              3.48e-05 3
#> MAD:skmeans 89              2.70e-05 3
#> ATC:skmeans 98              9.99e-06 3
#> SD:mclust   77              1.14e-03 3
#> CV:mclust   94              2.57e-04 3
#> MAD:mclust  92              3.78e-04 3
#> ATC:mclust  89              1.82e-12 3
#> SD:kmeans   81              1.87e-03 3
#> CV:kmeans   90              1.40e-03 3
#> MAD:kmeans  95              2.34e-04 3
#> ATC:kmeans  86              6.61e-04 3
#> SD:pam      83              1.92e-07 3
#> CV:pam      79              3.84e-06 3
#> MAD:pam     89              1.66e-07 3
#> ATC:pam     89              2.91e-06 3
#> SD:hclust   82              1.31e-03 3
#> CV:hclust   60              1.18e-03 3
#> MAD:hclust  90              2.73e-04 3
#> ATC:hclust  79              2.43e-03 3
test_to_known_factors(res_list, k = 4)
#>              n genotype/variation(p) k
#> SD:NMF      43              2.60e-02 4
#> CV:NMF      45              4.06e-02 4
#> MAD:NMF     40              2.47e-02 4
#> ATC:NMF     91              2.02e-10 4
#> SD:skmeans  50              3.54e-05 4
#> CV:skmeans  39              5.81e-01 4
#> MAD:skmeans 50              1.06e-05 4
#> ATC:skmeans 93              8.62e-11 4
#> SD:mclust   90              8.84e-06 4
#> CV:mclust   74              8.01e-03 4
#> MAD:mclust  94              1.13e-05 4
#> ATC:mclust  94              4.94e-12 4
#> SD:kmeans   91              1.35e-06 4
#> CV:kmeans   74              3.85e-06 4
#> MAD:kmeans  90              2.55e-07 4
#> ATC:kmeans  86              9.88e-09 4
#> SD:pam      71              3.86e-06 4
#> CV:pam      55              6.51e-03 4
#> MAD:pam     79              1.69e-05 4
#> ATC:pam     82              3.25e-08 4
#> SD:hclust   30              1.06e-02 4
#> CV:hclust   62              1.33e-02 4
#> MAD:hclust  75              2.36e-03 4
#> ATC:hclust  58              5.60e-07 4
test_to_known_factors(res_list, k = 5)
#>              n genotype/variation(p) k
#> SD:NMF      53              3.79e-04 5
#> CV:NMF      52              1.00e-02 5
#> MAD:NMF     51              2.55e-03 5
#> ATC:NMF     79              1.26e-11 5
#> SD:skmeans  48              5.90e-07 5
#> CV:skmeans  36              6.53e-05 5
#> MAD:skmeans 37              1.35e-03 5
#> ATC:skmeans 90              5.14e-14 5
#> SD:mclust   85              1.05e-06 5
#> CV:mclust   88              1.97e-07 5
#> MAD:mclust  85              1.61e-06 5
#> ATC:mclust  91              2.60e-13 5
#> SD:kmeans   44              6.46e-03 5
#> CV:kmeans   60              7.39e-10 5
#> MAD:kmeans  70              7.12e-12 5
#> ATC:kmeans  74              1.24e-10 5
#> SD:pam      37              1.81e-01 5
#> CV:pam      45              9.88e-03 5
#> MAD:pam     59              7.29e-03 5
#> ATC:pam     93              7.44e-12 5
#> SD:hclust   64              2.65e-03 5
#> CV:hclust   54              9.59e-03 5
#> MAD:hclust  69              2.86e-03 5
#> ATC:hclust  44              3.87e-06 5
test_to_known_factors(res_list, k = 6)
#>              n genotype/variation(p) k
#> SD:NMF      36              1.70e-03 6
#> CV:NMF      33              1.18e-03 6
#> MAD:NMF     41              2.62e-02 6
#> ATC:NMF     71              5.36e-07 6
#> SD:skmeans  30              5.55e-02 6
#> CV:skmeans   3                    NA 6
#> MAD:skmeans 27              8.71e-02 6
#> ATC:skmeans 83              1.99e-14 6
#> SD:mclust   73              2.83e-09 6
#> CV:mclust   78              4.07e-05 6
#> MAD:mclust  75              4.67e-09 6
#> ATC:mclust  75              4.12e-13 6
#> SD:kmeans   49              5.34e-08 6
#> CV:kmeans   54              6.55e-06 6
#> MAD:kmeans  68              7.05e-12 6
#> ATC:kmeans  75              2.57e-16 6
#> SD:pam      45              1.72e-01 6
#> CV:pam      45              9.88e-03 6
#> MAD:pam     62              7.42e-04 6
#> ATC:pam     87              8.79e-17 6
#> SD:hclust   58              6.39e-04 6
#> CV:hclust   44              1.90e-03 6
#> MAD:hclust  33              9.63e-03 6
#> ATC:hclust  69              5.43e-13 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk 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.0708          0.4681       0.674         0.3807 0.515   0.515
#> 3 3 0.1019          0.6131       0.734         0.3508 0.666   0.498
#> 4 4 0.1306          0.0731       0.482         0.1195 0.571   0.386
#> 5 5 0.1859          0.5141       0.674         0.0675 0.575   0.379
#> 6 6 0.2524          0.4598       0.640         0.0920 0.886   0.764

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

suggest_best_k(res)
#> [1] 3

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM25548     1   0.952     0.1252 0.628 0.372
#> GSM25549     1   0.952     0.1379 0.628 0.372
#> GSM25550     1   0.955     0.1244 0.624 0.376
#> GSM25551     1   0.998    -0.3704 0.524 0.476
#> GSM25570     1   0.966     0.0693 0.608 0.392
#> GSM25571     1   0.966     0.0693 0.608 0.392
#> GSM25358     1   0.995    -0.2356 0.540 0.460
#> GSM25359     1   0.995    -0.2356 0.540 0.460
#> GSM25360     1   0.595     0.5915 0.856 0.144
#> GSM25361     1   0.595     0.5915 0.856 0.144
#> GSM25377     2   0.987    -0.1364 0.432 0.568
#> GSM25378     1   0.971     0.3599 0.600 0.400
#> GSM25401     2   0.876     0.6349 0.296 0.704
#> GSM25402     2   0.855     0.6560 0.280 0.720
#> GSM25349     2   0.795     0.6890 0.240 0.760
#> GSM25350     2   0.795     0.6890 0.240 0.760
#> GSM25356     2   0.936     0.5319 0.352 0.648
#> GSM25357     2   0.936     0.5319 0.352 0.648
#> GSM25385     1   0.430     0.6404 0.912 0.088
#> GSM25386     1   0.327     0.6265 0.940 0.060
#> GSM25399     2   0.995    -0.1848 0.460 0.540
#> GSM25400     1   0.861     0.5511 0.716 0.284
#> GSM48659     2   0.958     0.6729 0.380 0.620
#> GSM48660     2   0.833     0.7037 0.264 0.736
#> GSM25409     2   0.996     0.4734 0.464 0.536
#> GSM25410     1   0.327     0.6265 0.940 0.060
#> GSM25426     2   0.988     0.5965 0.436 0.564
#> GSM25427     2   0.998     0.0542 0.472 0.528
#> GSM25540     1   0.988    -0.2147 0.564 0.436
#> GSM25541     1   0.988    -0.2147 0.564 0.436
#> GSM25542     2   0.999     0.5030 0.480 0.520
#> GSM25543     2   0.999     0.4965 0.484 0.516
#> GSM25479     1   0.644     0.6394 0.836 0.164
#> GSM25480     1   0.644     0.6394 0.836 0.164
#> GSM25481     2   0.839     0.6342 0.268 0.732
#> GSM25482     2   0.839     0.6342 0.268 0.732
#> GSM48654     2   0.966     0.6590 0.392 0.608
#> GSM48650     2   0.781     0.6881 0.232 0.768
#> GSM48651     2   0.921     0.6993 0.336 0.664
#> GSM48652     2   0.921     0.6993 0.336 0.664
#> GSM48653     2   0.936     0.6919 0.352 0.648
#> GSM48662     2   0.943     0.6947 0.360 0.640
#> GSM48663     2   0.767     0.6789 0.224 0.776
#> GSM25524     1   0.163     0.6189 0.976 0.024
#> GSM25525     1   0.518     0.6429 0.884 0.116
#> GSM25526     1   0.866     0.5097 0.712 0.288
#> GSM25527     1   0.697     0.6257 0.812 0.188
#> GSM25528     1   0.184     0.6211 0.972 0.028
#> GSM25529     1   0.518     0.6437 0.884 0.116
#> GSM25530     1   0.184     0.6240 0.972 0.028
#> GSM25531     1   0.224     0.6301 0.964 0.036
#> GSM48661     2   0.998     0.5241 0.472 0.528
#> GSM25561     1   0.358     0.6435 0.932 0.068
#> GSM25562     1   0.456     0.6489 0.904 0.096
#> GSM25563     1   0.141     0.6315 0.980 0.020
#> GSM25564     1   0.814     0.5179 0.748 0.252
#> GSM25565     2   0.966     0.6574 0.392 0.608
#> GSM25566     2   0.997     0.5064 0.468 0.532
#> GSM25568     2   0.971     0.6399 0.400 0.600
#> GSM25569     2   0.973     0.6351 0.404 0.596
#> GSM25552     1   0.932     0.2059 0.652 0.348
#> GSM25553     1   0.932     0.2059 0.652 0.348
#> GSM25578     1   0.625     0.6279 0.844 0.156
#> GSM25579     1   0.615     0.6371 0.848 0.152
#> GSM25580     1   0.760     0.5869 0.780 0.220
#> GSM25581     1   0.760     0.5869 0.780 0.220
#> GSM48655     2   0.844     0.7071 0.272 0.728
#> GSM48656     2   0.998     0.5154 0.476 0.524
#> GSM48657     2   0.795     0.6943 0.240 0.760
#> GSM48658     2   0.998     0.5154 0.476 0.524
#> GSM25624     1   0.844     0.5698 0.728 0.272
#> GSM25625     1   0.653     0.6360 0.832 0.168
#> GSM25626     1   0.327     0.6265 0.940 0.060
#> GSM25627     1   0.978     0.0645 0.588 0.412
#> GSM25628     1   0.327     0.6265 0.940 0.060
#> GSM25629     1   1.000    -0.4154 0.508 0.492
#> GSM25630     1   0.204     0.6169 0.968 0.032
#> GSM25631     1   0.939     0.1572 0.644 0.356
#> GSM25632     1   0.456     0.6477 0.904 0.096
#> GSM25633     1   0.722     0.6139 0.800 0.200
#> GSM25634     1   0.781     0.5958 0.768 0.232
#> GSM25635     1   0.714     0.6150 0.804 0.196
#> GSM25656     1   0.373     0.6332 0.928 0.072
#> GSM25657     1   0.634     0.6287 0.840 0.160
#> GSM25658     1   0.781     0.6010 0.768 0.232
#> GSM25659     1   0.775     0.5411 0.772 0.228
#> GSM25660     1   0.730     0.6150 0.796 0.204
#> GSM25661     1   0.671     0.6183 0.824 0.176
#> GSM25662     1   0.987    -0.1419 0.568 0.432
#> GSM25663     1   0.987    -0.1419 0.568 0.432
#> GSM25680     1   0.929     0.1927 0.656 0.344
#> GSM25681     1   0.929     0.1927 0.656 0.344
#> GSM25682     2   0.861     0.7094 0.284 0.716
#> GSM25683     2   0.861     0.7094 0.284 0.716
#> GSM25684     2   0.958     0.6729 0.380 0.620
#> GSM25685     2   0.958     0.6729 0.380 0.620
#> GSM25686     2   0.861     0.7094 0.284 0.716
#> GSM25687     2   0.861     0.7094 0.284 0.716
#> GSM48664     2   0.995    -0.1848 0.460 0.540
#> GSM48665     1   0.730     0.6030 0.796 0.204

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2   0.754      0.363 0.432 0.528 0.040
#> GSM25549     2   0.763      0.344 0.432 0.524 0.044
#> GSM25550     2   0.745      0.346 0.436 0.528 0.036
#> GSM25551     2   0.637      0.656 0.268 0.704 0.028
#> GSM25570     2   0.742      0.382 0.420 0.544 0.036
#> GSM25571     2   0.742      0.382 0.420 0.544 0.036
#> GSM25358     2   0.738      0.537 0.320 0.628 0.052
#> GSM25359     2   0.738      0.537 0.320 0.628 0.052
#> GSM25360     1   0.558      0.531 0.736 0.256 0.008
#> GSM25361     1   0.558      0.531 0.736 0.256 0.008
#> GSM25377     3   0.426      0.883 0.012 0.140 0.848
#> GSM25378     2   0.999     -0.355 0.332 0.356 0.312
#> GSM25401     2   0.523      0.650 0.068 0.828 0.104
#> GSM25402     2   0.477      0.663 0.052 0.848 0.100
#> GSM25349     2   0.188      0.681 0.004 0.952 0.044
#> GSM25350     2   0.188      0.681 0.004 0.952 0.044
#> GSM25356     2   0.577      0.569 0.024 0.756 0.220
#> GSM25357     2   0.577      0.569 0.024 0.756 0.220
#> GSM25385     1   0.594      0.718 0.788 0.140 0.072
#> GSM25386     1   0.392      0.688 0.856 0.140 0.004
#> GSM25399     3   0.228      0.924 0.008 0.052 0.940
#> GSM25400     1   0.976      0.527 0.428 0.240 0.332
#> GSM48659     2   0.364      0.717 0.124 0.872 0.004
#> GSM48660     2   0.164      0.693 0.016 0.964 0.020
#> GSM25409     2   0.648      0.632 0.244 0.716 0.040
#> GSM25410     1   0.392      0.688 0.856 0.140 0.004
#> GSM25426     2   0.502      0.702 0.192 0.796 0.012
#> GSM25427     2   0.905      0.215 0.160 0.528 0.312
#> GSM25540     2   0.661      0.559 0.356 0.628 0.016
#> GSM25541     2   0.661      0.559 0.356 0.628 0.016
#> GSM25542     2   0.566      0.662 0.264 0.728 0.008
#> GSM25543     2   0.576      0.650 0.276 0.716 0.008
#> GSM25479     1   0.831      0.724 0.632 0.176 0.192
#> GSM25480     1   0.831      0.724 0.632 0.176 0.192
#> GSM25481     2   0.481      0.618 0.028 0.832 0.140
#> GSM25482     2   0.481      0.618 0.028 0.832 0.140
#> GSM48654     2   0.398      0.716 0.144 0.852 0.004
#> GSM48650     2   0.153      0.677 0.004 0.964 0.032
#> GSM48651     2   0.268      0.715 0.076 0.920 0.004
#> GSM48652     2   0.268      0.715 0.076 0.920 0.004
#> GSM48653     2   0.303      0.716 0.092 0.904 0.004
#> GSM48662     2   0.344      0.720 0.088 0.896 0.016
#> GSM48663     2   0.176      0.675 0.004 0.956 0.040
#> GSM25524     1   0.158      0.672 0.964 0.028 0.008
#> GSM25525     1   0.645      0.746 0.764 0.132 0.104
#> GSM25526     1   0.941      0.300 0.448 0.376 0.176
#> GSM25527     1   0.870      0.711 0.588 0.168 0.244
#> GSM25528     1   0.203      0.678 0.952 0.032 0.016
#> GSM25529     1   0.637      0.744 0.768 0.132 0.100
#> GSM25530     1   0.304      0.688 0.920 0.044 0.036
#> GSM25531     1   0.336      0.704 0.908 0.056 0.036
#> GSM48661     2   0.529      0.689 0.228 0.764 0.008
#> GSM25561     1   0.554      0.728 0.808 0.132 0.060
#> GSM25562     1   0.751      0.728 0.696 0.160 0.144
#> GSM25563     1   0.321      0.700 0.900 0.092 0.008
#> GSM25564     1   0.898      0.317 0.496 0.368 0.136
#> GSM25565     2   0.433      0.718 0.144 0.844 0.012
#> GSM25566     2   0.554      0.678 0.236 0.752 0.012
#> GSM25568     2   0.397      0.718 0.132 0.860 0.008
#> GSM25569     2   0.416      0.717 0.144 0.848 0.008
#> GSM25552     2   0.766      0.289 0.452 0.504 0.044
#> GSM25553     2   0.766      0.289 0.452 0.504 0.044
#> GSM25578     1   0.821      0.711 0.628 0.132 0.240
#> GSM25579     1   0.850      0.659 0.612 0.216 0.172
#> GSM25580     1   0.889      0.635 0.532 0.140 0.328
#> GSM25581     1   0.889      0.635 0.532 0.140 0.328
#> GSM48655     2   0.177      0.698 0.024 0.960 0.016
#> GSM48656     2   0.534      0.688 0.232 0.760 0.008
#> GSM48657     2   0.158      0.683 0.008 0.964 0.028
#> GSM48658     2   0.534      0.688 0.232 0.760 0.008
#> GSM25624     1   0.963      0.583 0.460 0.228 0.312
#> GSM25625     1   0.830      0.708 0.632 0.196 0.172
#> GSM25626     1   0.378      0.691 0.864 0.132 0.004
#> GSM25627     2   0.797      0.366 0.372 0.560 0.068
#> GSM25628     1   0.403      0.689 0.856 0.136 0.008
#> GSM25629     2   0.634      0.647 0.264 0.708 0.028
#> GSM25630     1   0.195      0.612 0.952 0.008 0.040
#> GSM25631     2   0.704      0.377 0.444 0.536 0.020
#> GSM25632     1   0.588      0.733 0.788 0.148 0.064
#> GSM25633     1   0.879      0.672 0.552 0.140 0.308
#> GSM25634     1   0.915      0.609 0.496 0.156 0.348
#> GSM25635     1   0.892      0.675 0.548 0.156 0.296
#> GSM25656     1   0.417      0.653 0.872 0.092 0.036
#> GSM25657     1   0.791      0.715 0.656 0.124 0.220
#> GSM25658     1   0.887      0.577 0.560 0.280 0.160
#> GSM25659     1   0.835      0.423 0.568 0.332 0.100
#> GSM25660     1   0.898      0.681 0.548 0.168 0.284
#> GSM25661     1   0.855      0.691 0.588 0.136 0.276
#> GSM25662     2   0.650      0.487 0.396 0.596 0.008
#> GSM25663     2   0.650      0.487 0.396 0.596 0.008
#> GSM25680     2   0.706      0.342 0.464 0.516 0.020
#> GSM25681     2   0.706      0.342 0.464 0.516 0.020
#> GSM25682     2   0.218      0.703 0.032 0.948 0.020
#> GSM25683     2   0.218      0.703 0.032 0.948 0.020
#> GSM25684     2   0.364      0.717 0.124 0.872 0.004
#> GSM25685     2   0.364      0.717 0.124 0.872 0.004
#> GSM25686     2   0.218      0.703 0.032 0.948 0.020
#> GSM25687     2   0.218      0.703 0.032 0.948 0.020
#> GSM48664     3   0.285      0.935 0.012 0.068 0.920
#> GSM48665     1   0.882      0.660 0.552 0.144 0.304

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2   0.180     0.2854 0.016 0.948 0.004 0.032
#> GSM25549     2   0.171     0.2943 0.020 0.952 0.004 0.024
#> GSM25550     2   0.151     0.2961 0.012 0.960 0.008 0.020
#> GSM25551     2   0.567    -0.2138 0.004 0.676 0.048 0.272
#> GSM25570     2   0.192     0.2819 0.012 0.944 0.008 0.036
#> GSM25571     2   0.192     0.2819 0.012 0.944 0.008 0.036
#> GSM25358     2   0.611     0.0745 0.028 0.696 0.056 0.220
#> GSM25359     2   0.611     0.0745 0.028 0.696 0.056 0.220
#> GSM25360     2   0.558    -0.2998 0.012 0.652 0.316 0.020
#> GSM25361     2   0.558    -0.2998 0.012 0.652 0.316 0.020
#> GSM25377     1   0.428     0.6125 0.800 0.024 0.004 0.172
#> GSM25378     2   0.966    -0.0115 0.280 0.352 0.148 0.220
#> GSM25401     4   0.730     0.7126 0.056 0.400 0.044 0.500
#> GSM25402     4   0.702     0.7389 0.052 0.404 0.032 0.512
#> GSM25349     4   0.543     0.8308 0.016 0.416 0.000 0.568
#> GSM25350     4   0.543     0.8308 0.016 0.416 0.000 0.568
#> GSM25356     4   0.750     0.6004 0.128 0.396 0.012 0.464
#> GSM25357     4   0.750     0.6004 0.128 0.396 0.012 0.464
#> GSM25385     2   0.726    -0.6006 0.060 0.460 0.444 0.036
#> GSM25386     2   0.594    -0.6140 0.000 0.484 0.480 0.036
#> GSM25399     1   0.259     0.6156 0.900 0.004 0.004 0.092
#> GSM25400     2   0.951    -0.1641 0.312 0.364 0.184 0.140
#> GSM48659     2   0.531    -0.5743 0.000 0.576 0.012 0.412
#> GSM48660     4   0.512     0.8149 0.004 0.440 0.000 0.556
#> GSM25409     2   0.492    -0.1205 0.024 0.732 0.004 0.240
#> GSM25410     2   0.594    -0.6140 0.000 0.484 0.480 0.036
#> GSM25426     2   0.620    -0.4797 0.000 0.564 0.060 0.376
#> GSM25427     2   0.923    -0.1043 0.268 0.336 0.076 0.320
#> GSM25540     2   0.479     0.0745 0.008 0.776 0.036 0.180
#> GSM25541     2   0.479     0.0745 0.008 0.776 0.036 0.180
#> GSM25542     2   0.609    -0.3344 0.004 0.608 0.052 0.336
#> GSM25543     2   0.628    -0.3130 0.004 0.600 0.064 0.332
#> GSM25479     2   0.829    -0.3258 0.200 0.484 0.280 0.036
#> GSM25480     2   0.829    -0.3258 0.200 0.484 0.280 0.036
#> GSM25481     4   0.734     0.7171 0.092 0.364 0.024 0.520
#> GSM25482     4   0.734     0.7171 0.092 0.364 0.024 0.520
#> GSM48654     2   0.514    -0.5336 0.000 0.600 0.008 0.392
#> GSM48650     4   0.514     0.8278 0.008 0.392 0.000 0.600
#> GSM48651     2   0.498    -0.6692 0.000 0.536 0.000 0.464
#> GSM48652     2   0.498    -0.6617 0.000 0.540 0.000 0.460
#> GSM48653     2   0.495    -0.6343 0.000 0.556 0.000 0.444
#> GSM48662     2   0.495    -0.6554 0.000 0.560 0.000 0.440
#> GSM48663     4   0.545     0.8279 0.012 0.400 0.004 0.584
#> GSM25524     3   0.546     0.7087 0.004 0.344 0.632 0.020
#> GSM25525     3   0.782     0.5051 0.124 0.396 0.452 0.028
#> GSM25526     2   0.890     0.1187 0.168 0.508 0.168 0.156
#> GSM25527     2   0.885    -0.3010 0.240 0.432 0.268 0.060
#> GSM25528     3   0.560     0.7070 0.012 0.340 0.632 0.016
#> GSM25529     3   0.771     0.5091 0.120 0.408 0.448 0.024
#> GSM25530     3   0.584     0.7130 0.028 0.356 0.608 0.008
#> GSM25531     3   0.597     0.7050 0.032 0.368 0.592 0.008
#> GSM48661     2   0.508    -0.3472 0.000 0.676 0.020 0.304
#> GSM25561     3   0.700     0.6330 0.044 0.444 0.476 0.036
#> GSM25562     2   0.854    -0.4774 0.136 0.476 0.312 0.076
#> GSM25563     3   0.612     0.6618 0.000 0.396 0.552 0.052
#> GSM25564     2   0.784     0.0948 0.124 0.616 0.140 0.120
#> GSM25565     2   0.496    -0.5102 0.000 0.616 0.004 0.380
#> GSM25566     2   0.469    -0.2719 0.000 0.712 0.012 0.276
#> GSM25568     2   0.514    -0.5463 0.000 0.600 0.008 0.392
#> GSM25569     2   0.507    -0.4985 0.000 0.620 0.008 0.372
#> GSM25552     2   0.200     0.3128 0.020 0.944 0.020 0.016
#> GSM25553     2   0.200     0.3128 0.020 0.944 0.020 0.016
#> GSM25578     2   0.861    -0.3557 0.248 0.408 0.308 0.036
#> GSM25579     2   0.747    -0.2338 0.176 0.580 0.224 0.020
#> GSM25580     2   0.895    -0.2814 0.328 0.368 0.248 0.056
#> GSM25581     2   0.895    -0.2814 0.328 0.368 0.248 0.056
#> GSM48655     4   0.510     0.8180 0.004 0.432 0.000 0.564
#> GSM48656     2   0.536    -0.3422 0.004 0.668 0.024 0.304
#> GSM48657     4   0.517     0.8316 0.008 0.404 0.000 0.588
#> GSM48658     2   0.536    -0.3422 0.004 0.668 0.024 0.304
#> GSM25624     2   0.946    -0.1755 0.296 0.376 0.204 0.124
#> GSM25625     2   0.900    -0.3853 0.160 0.436 0.304 0.100
#> GSM25626     3   0.594     0.5888 0.000 0.476 0.488 0.036
#> GSM25627     2   0.797     0.0904 0.052 0.556 0.144 0.248
#> GSM25628     3   0.594     0.5846 0.000 0.476 0.488 0.036
#> GSM25629     2   0.651    -0.2786 0.004 0.588 0.080 0.328
#> GSM25630     3   0.559     0.1319 0.004 0.096 0.732 0.168
#> GSM25631     2   0.396     0.2665 0.012 0.852 0.048 0.088
#> GSM25632     2   0.743    -0.6176 0.072 0.448 0.444 0.036
#> GSM25633     2   0.873    -0.3067 0.312 0.388 0.260 0.040
#> GSM25634     1   0.910    -0.3767 0.348 0.340 0.244 0.068
#> GSM25635     2   0.888    -0.2724 0.288 0.408 0.248 0.056
#> GSM25656     3   0.764     0.3440 0.012 0.256 0.532 0.200
#> GSM25657     2   0.867    -0.4003 0.232 0.392 0.336 0.040
#> GSM25658     2   0.895    -0.1511 0.156 0.480 0.244 0.120
#> GSM25659     2   0.760    -0.0114 0.092 0.608 0.224 0.076
#> GSM25660     2   0.881    -0.2637 0.272 0.432 0.240 0.056
#> GSM25661     2   0.865    -0.3202 0.280 0.404 0.280 0.036
#> GSM25662     2   0.345     0.1771 0.000 0.852 0.020 0.128
#> GSM25663     2   0.345     0.1771 0.000 0.852 0.020 0.128
#> GSM25680     2   0.275     0.2885 0.000 0.904 0.056 0.040
#> GSM25681     2   0.275     0.2885 0.000 0.904 0.056 0.040
#> GSM25682     4   0.497     0.8131 0.000 0.452 0.000 0.548
#> GSM25683     4   0.497     0.8131 0.000 0.452 0.000 0.548
#> GSM25684     2   0.531    -0.5743 0.000 0.576 0.012 0.412
#> GSM25685     2   0.531    -0.5743 0.000 0.576 0.012 0.412
#> GSM25686     4   0.497     0.8131 0.000 0.452 0.000 0.548
#> GSM25687     4   0.497     0.8131 0.000 0.452 0.000 0.548
#> GSM48664     1   0.293     0.6408 0.880 0.012 0.000 0.108
#> GSM48665     2   0.891    -0.2907 0.304 0.380 0.264 0.052

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     2   0.674     0.2803 0.400 0.476 0.044 0.072 0.008
#> GSM25549     2   0.680     0.2478 0.412 0.460 0.044 0.076 0.008
#> GSM25550     2   0.668     0.2387 0.420 0.460 0.036 0.076 0.008
#> GSM25551     2   0.518     0.6273 0.196 0.720 0.048 0.032 0.004
#> GSM25570     2   0.667     0.2809 0.404 0.476 0.036 0.076 0.008
#> GSM25571     2   0.667     0.2809 0.404 0.476 0.036 0.076 0.008
#> GSM25358     2   0.656     0.4619 0.312 0.564 0.036 0.076 0.012
#> GSM25359     2   0.656     0.4619 0.312 0.564 0.036 0.076 0.012
#> GSM25360     1   0.760     0.4787 0.504 0.192 0.236 0.052 0.016
#> GSM25361     1   0.760     0.4787 0.504 0.192 0.236 0.052 0.016
#> GSM25377     5   0.456     0.7656 0.096 0.080 0.000 0.036 0.788
#> GSM25378     1   0.762     0.3996 0.516 0.240 0.008 0.120 0.116
#> GSM25401     2   0.636     0.5634 0.088 0.664 0.016 0.172 0.060
#> GSM25402     2   0.612     0.5787 0.072 0.680 0.016 0.176 0.056
#> GSM25349     2   0.369     0.6440 0.012 0.824 0.012 0.140 0.012
#> GSM25350     2   0.369     0.6440 0.012 0.824 0.012 0.140 0.012
#> GSM25356     2   0.735     0.4841 0.100 0.552 0.012 0.236 0.100
#> GSM25357     2   0.735     0.4841 0.100 0.552 0.012 0.236 0.100
#> GSM25385     1   0.649     0.4917 0.576 0.108 0.284 0.024 0.008
#> GSM25386     1   0.645     0.3995 0.500 0.136 0.352 0.012 0.000
#> GSM25399     5   0.252     0.7525 0.064 0.004 0.008 0.020 0.904
#> GSM25400     1   0.675     0.5087 0.620 0.144 0.004 0.080 0.152
#> GSM48659     2   0.235     0.6889 0.056 0.912 0.016 0.016 0.000
#> GSM48660     2   0.303     0.6571 0.008 0.848 0.000 0.136 0.008
#> GSM25409     2   0.608     0.5572 0.272 0.612 0.008 0.092 0.016
#> GSM25410     1   0.645     0.3995 0.500 0.136 0.352 0.012 0.000
#> GSM25426     2   0.418     0.6768 0.092 0.816 0.064 0.024 0.004
#> GSM25427     2   0.802     0.0634 0.324 0.416 0.008 0.120 0.132
#> GSM25540     2   0.619     0.5120 0.264 0.612 0.068 0.056 0.000
#> GSM25541     2   0.619     0.5120 0.264 0.612 0.068 0.056 0.000
#> GSM25542     2   0.559     0.6227 0.136 0.720 0.084 0.056 0.004
#> GSM25543     2   0.581     0.6096 0.136 0.708 0.092 0.056 0.008
#> GSM25479     1   0.364     0.6396 0.848 0.092 0.008 0.020 0.032
#> GSM25480     1   0.364     0.6396 0.848 0.092 0.008 0.020 0.032
#> GSM25481     2   0.655     0.5281 0.096 0.628 0.004 0.196 0.076
#> GSM25482     2   0.655     0.5281 0.096 0.628 0.004 0.196 0.076
#> GSM48654     2   0.286     0.6871 0.076 0.884 0.016 0.024 0.000
#> GSM48650     2   0.341     0.6201 0.008 0.812 0.000 0.172 0.008
#> GSM48651     2   0.181     0.6886 0.040 0.936 0.000 0.020 0.004
#> GSM48652     2   0.171     0.6886 0.040 0.940 0.000 0.016 0.004
#> GSM48653     2   0.165     0.6885 0.040 0.940 0.000 0.020 0.000
#> GSM48662     2   0.190     0.6920 0.040 0.932 0.004 0.024 0.000
#> GSM48663     2   0.382     0.6177 0.008 0.796 0.004 0.176 0.016
#> GSM25524     1   0.606     0.3375 0.576 0.020 0.340 0.048 0.016
#> GSM25525     1   0.518     0.5935 0.740 0.056 0.164 0.012 0.028
#> GSM25526     1   0.732     0.2986 0.512 0.324 0.072 0.036 0.056
#> GSM25527     1   0.450     0.6349 0.808 0.080 0.024 0.020 0.068
#> GSM25528     1   0.567     0.3764 0.604 0.012 0.332 0.032 0.020
#> GSM25529     1   0.501     0.5949 0.748 0.052 0.164 0.008 0.028
#> GSM25530     1   0.592     0.3969 0.596 0.020 0.328 0.028 0.028
#> GSM25531     1   0.559     0.4352 0.628 0.016 0.308 0.024 0.024
#> GSM48661     2   0.457     0.6563 0.132 0.780 0.048 0.040 0.000
#> GSM25561     1   0.622     0.5152 0.660 0.048 0.208 0.064 0.020
#> GSM25562     1   0.590     0.5933 0.728 0.072 0.088 0.076 0.036
#> GSM25563     1   0.694     0.3225 0.488 0.076 0.376 0.044 0.016
#> GSM25564     1   0.715     0.3270 0.540 0.296 0.072 0.072 0.020
#> GSM25565     2   0.391     0.6882 0.100 0.820 0.012 0.068 0.000
#> GSM25566     2   0.464     0.6423 0.188 0.748 0.020 0.044 0.000
#> GSM25568     2   0.384     0.6790 0.064 0.824 0.012 0.100 0.000
#> GSM25569     2   0.420     0.6758 0.088 0.800 0.012 0.100 0.000
#> GSM25552     1   0.667    -0.2007 0.448 0.436 0.044 0.064 0.008
#> GSM25553     1   0.667    -0.1881 0.452 0.432 0.044 0.064 0.008
#> GSM25578     1   0.328     0.6181 0.868 0.052 0.012 0.004 0.064
#> GSM25579     1   0.432     0.6233 0.788 0.152 0.024 0.004 0.032
#> GSM25580     1   0.439     0.5847 0.796 0.056 0.008 0.016 0.124
#> GSM25581     1   0.439     0.5847 0.796 0.056 0.008 0.016 0.124
#> GSM48655     2   0.315     0.6562 0.012 0.844 0.000 0.136 0.008
#> GSM48656     2   0.477     0.6545 0.136 0.772 0.048 0.040 0.004
#> GSM48657     2   0.344     0.6294 0.012 0.816 0.000 0.164 0.008
#> GSM48658     2   0.477     0.6545 0.136 0.772 0.048 0.040 0.004
#> GSM25624     1   0.621     0.5511 0.684 0.132 0.012 0.072 0.100
#> GSM25625     1   0.680     0.5937 0.656 0.124 0.112 0.060 0.048
#> GSM25626     1   0.639     0.4008 0.508 0.128 0.352 0.012 0.000
#> GSM25627     2   0.703     0.3090 0.308 0.536 0.096 0.032 0.028
#> GSM25628     1   0.636     0.3897 0.504 0.136 0.352 0.008 0.000
#> GSM25629     2   0.510     0.6287 0.172 0.732 0.072 0.020 0.004
#> GSM25630     4   0.625     0.0000 0.080 0.008 0.396 0.504 0.012
#> GSM25631     2   0.674     0.3268 0.360 0.508 0.068 0.060 0.004
#> GSM25632     1   0.627     0.5224 0.592 0.096 0.284 0.020 0.008
#> GSM25633     1   0.414     0.6046 0.820 0.056 0.008 0.020 0.096
#> GSM25634     1   0.540     0.5493 0.744 0.064 0.012 0.056 0.124
#> GSM25635     1   0.430     0.6158 0.816 0.064 0.012 0.024 0.084
#> GSM25656     3   0.479     0.0000 0.036 0.024 0.780 0.132 0.028
#> GSM25657     1   0.438     0.6174 0.820 0.048 0.056 0.016 0.060
#> GSM25658     1   0.702     0.5474 0.596 0.224 0.096 0.028 0.056
#> GSM25659     1   0.647     0.4307 0.600 0.264 0.092 0.032 0.012
#> GSM25660     1   0.449     0.6223 0.804 0.076 0.012 0.024 0.084
#> GSM25661     1   0.354     0.6163 0.852 0.052 0.008 0.008 0.080
#> GSM25662     2   0.619     0.4447 0.328 0.576 0.044 0.044 0.008
#> GSM25663     2   0.619     0.4447 0.328 0.576 0.044 0.044 0.008
#> GSM25680     2   0.711     0.2402 0.380 0.460 0.072 0.084 0.004
#> GSM25681     2   0.711     0.2402 0.380 0.460 0.072 0.084 0.004
#> GSM25682     2   0.326     0.6636 0.020 0.836 0.000 0.140 0.004
#> GSM25683     2   0.326     0.6636 0.020 0.836 0.000 0.140 0.004
#> GSM25684     2   0.235     0.6889 0.056 0.912 0.016 0.016 0.000
#> GSM25685     2   0.235     0.6889 0.056 0.912 0.016 0.016 0.000
#> GSM25686     2   0.326     0.6636 0.020 0.836 0.000 0.140 0.004
#> GSM25687     2   0.326     0.6636 0.020 0.836 0.000 0.140 0.004
#> GSM48664     5   0.304     0.8277 0.100 0.032 0.000 0.004 0.864
#> GSM48665     1   0.410     0.6009 0.820 0.056 0.008 0.016 0.100

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1 p2    p3    p4    p5    p6
#> GSM25548     5   0.744     0.3020 0.300 NA 0.144 0.000 0.436 0.040
#> GSM25549     5   0.751     0.2716 0.316 NA 0.144 0.000 0.416 0.040
#> GSM25550     5   0.743     0.2625 0.324 NA 0.144 0.000 0.416 0.036
#> GSM25551     5   0.512     0.6028 0.152 NA 0.084 0.000 0.712 0.012
#> GSM25570     5   0.736     0.3003 0.312 NA 0.140 0.000 0.436 0.040
#> GSM25571     5   0.736     0.3003 0.312 NA 0.140 0.000 0.436 0.040
#> GSM25358     5   0.697     0.4642 0.248 NA 0.092 0.016 0.544 0.024
#> GSM25359     5   0.697     0.4642 0.248 NA 0.092 0.016 0.544 0.024
#> GSM25360     1   0.767    -0.0527 0.360 NA 0.356 0.000 0.144 0.100
#> GSM25361     1   0.767    -0.0527 0.360 NA 0.356 0.000 0.144 0.100
#> GSM25377     4   0.424     0.7440 0.128 NA 0.004 0.772 0.020 0.000
#> GSM25378     1   0.733     0.3756 0.552 NA 0.024 0.076 0.160 0.036
#> GSM25401     5   0.689     0.4228 0.120 NA 0.024 0.036 0.508 0.016
#> GSM25402     5   0.670     0.4399 0.104 NA 0.024 0.032 0.524 0.016
#> GSM25349     5   0.380     0.5658 0.016 NA 0.000 0.000 0.740 0.012
#> GSM25350     5   0.380     0.5658 0.016 NA 0.000 0.000 0.740 0.012
#> GSM25356     5   0.766     0.3575 0.104 NA 0.008 0.068 0.448 0.076
#> GSM25357     5   0.766     0.3575 0.104 NA 0.008 0.068 0.448 0.076
#> GSM25385     3   0.631     0.4938 0.372 NA 0.492 0.008 0.080 0.036
#> GSM25386     3   0.605     0.6293 0.260 NA 0.576 0.004 0.108 0.052
#> GSM25399     4   0.240     0.6387 0.024 NA 0.000 0.896 0.000 0.016
#> GSM25400     1   0.622     0.4878 0.664 NA 0.016 0.120 0.084 0.028
#> GSM48659     5   0.201     0.6507 0.040 NA 0.008 0.000 0.924 0.012
#> GSM48660     5   0.333     0.5853 0.012 NA 0.000 0.000 0.788 0.008
#> GSM25409     5   0.653     0.5300 0.216 NA 0.072 0.008 0.576 0.008
#> GSM25410     3   0.609     0.6231 0.268 NA 0.568 0.004 0.108 0.052
#> GSM25426     5   0.420     0.6367 0.080 NA 0.068 0.000 0.800 0.024
#> GSM25427     1   0.792     0.0513 0.356 NA 0.008 0.084 0.340 0.044
#> GSM25540     5   0.631     0.5042 0.192 NA 0.136 0.000 0.600 0.024
#> GSM25541     5   0.631     0.5042 0.192 NA 0.136 0.000 0.600 0.024
#> GSM25542     5   0.594     0.5650 0.064 NA 0.128 0.004 0.676 0.036
#> GSM25543     5   0.612     0.5449 0.064 NA 0.140 0.004 0.660 0.040
#> GSM25479     1   0.341     0.5481 0.856 NA 0.040 0.004 0.052 0.036
#> GSM25480     1   0.341     0.5481 0.856 NA 0.040 0.004 0.052 0.036
#> GSM25481     5   0.658     0.3738 0.132 NA 0.004 0.052 0.492 0.004
#> GSM25482     5   0.658     0.3738 0.132 NA 0.004 0.052 0.492 0.004
#> GSM48654     5   0.264     0.6502 0.044 NA 0.040 0.000 0.892 0.008
#> GSM48650     5   0.367     0.5447 0.012 NA 0.000 0.000 0.740 0.008
#> GSM48651     5   0.186     0.6457 0.032 NA 0.000 0.000 0.920 0.000
#> GSM48652     5   0.179     0.6464 0.032 NA 0.000 0.000 0.924 0.000
#> GSM48653     5   0.172     0.6476 0.032 NA 0.000 0.000 0.932 0.004
#> GSM48662     5   0.243     0.6495 0.040 NA 0.004 0.000 0.900 0.012
#> GSM48663     5   0.396     0.5079 0.012 NA 0.000 0.000 0.668 0.004
#> GSM25524     3   0.578     0.5321 0.296 NA 0.588 0.000 0.016 0.060
#> GSM25525     1   0.392     0.3890 0.760 NA 0.196 0.000 0.012 0.028
#> GSM25526     1   0.717     0.3003 0.508 NA 0.088 0.032 0.292 0.036
#> GSM25527     1   0.389     0.5765 0.836 NA 0.040 0.040 0.048 0.020
#> GSM25528     3   0.594     0.4912 0.372 NA 0.516 0.000 0.016 0.060
#> GSM25529     1   0.398     0.3842 0.752 NA 0.200 0.000 0.016 0.032
#> GSM25530     3   0.591     0.5299 0.380 NA 0.524 0.016 0.016 0.032
#> GSM25531     3   0.587     0.4864 0.412 NA 0.496 0.012 0.016 0.036
#> GSM48661     5   0.432     0.6269 0.092 NA 0.084 0.000 0.784 0.020
#> GSM25561     1   0.663    -0.1274 0.476 NA 0.368 0.004 0.056 0.068
#> GSM25562     1   0.638     0.3336 0.608 NA 0.176 0.000 0.076 0.116
#> GSM25563     3   0.635     0.5817 0.272 NA 0.528 0.000 0.064 0.136
#> GSM25564     1   0.706     0.2863 0.492 NA 0.088 0.000 0.284 0.104
#> GSM25565     5   0.412     0.6513 0.060 NA 0.048 0.000 0.804 0.012
#> GSM25566     5   0.480     0.6115 0.136 NA 0.072 0.000 0.740 0.008
#> GSM25568     5   0.468     0.6134 0.012 NA 0.100 0.000 0.752 0.028
#> GSM25569     5   0.500     0.6165 0.028 NA 0.104 0.000 0.736 0.028
#> GSM25552     5   0.759     0.1881 0.340 NA 0.152 0.000 0.384 0.044
#> GSM25553     5   0.759     0.1760 0.344 NA 0.152 0.000 0.380 0.044
#> GSM25578     1   0.213     0.5505 0.920 NA 0.032 0.020 0.008 0.020
#> GSM25579     1   0.462     0.4757 0.744 NA 0.092 0.008 0.136 0.020
#> GSM25580     1   0.242     0.5648 0.900 NA 0.004 0.064 0.004 0.012
#> GSM25581     1   0.242     0.5648 0.900 NA 0.004 0.064 0.004 0.012
#> GSM48655     5   0.344     0.5914 0.020 NA 0.000 0.000 0.788 0.008
#> GSM48656     5   0.448     0.6254 0.092 NA 0.084 0.000 0.776 0.028
#> GSM48657     5   0.370     0.5544 0.016 NA 0.000 0.000 0.744 0.008
#> GSM48658     5   0.448     0.6254 0.092 NA 0.084 0.000 0.776 0.028
#> GSM25624     1   0.534     0.5322 0.740 NA 0.020 0.060 0.076 0.024
#> GSM25625     1   0.683     0.3207 0.596 NA 0.196 0.040 0.088 0.028
#> GSM25626     3   0.603     0.6279 0.268 NA 0.572 0.004 0.108 0.048
#> GSM25627     5   0.727     0.2416 0.292 NA 0.112 0.016 0.488 0.040
#> GSM25628     3   0.602     0.6262 0.256 NA 0.580 0.004 0.112 0.048
#> GSM25629     5   0.511     0.5856 0.160 NA 0.080 0.000 0.712 0.024
#> GSM25630     3   0.545    -0.5176 0.012 NA 0.500 0.004 0.000 0.072
#> GSM25631     5   0.703     0.3391 0.284 NA 0.152 0.000 0.480 0.032
#> GSM25632     1   0.597    -0.3617 0.472 NA 0.420 0.004 0.056 0.040
#> GSM25633     1   0.253     0.5628 0.904 NA 0.016 0.044 0.008 0.016
#> GSM25634     1   0.478     0.5120 0.784 NA 0.028 0.060 0.024 0.052
#> GSM25635     1   0.316     0.5826 0.876 NA 0.016 0.036 0.036 0.020
#> GSM25656     6   0.334     0.0000 0.000 NA 0.196 0.000 0.016 0.784
#> GSM25657     1   0.302     0.5323 0.872 NA 0.068 0.028 0.008 0.020
#> GSM25658     1   0.691     0.4168 0.596 NA 0.108 0.028 0.176 0.048
#> GSM25659     1   0.684     0.3025 0.524 NA 0.148 0.000 0.248 0.040
#> GSM25660     1   0.342     0.5836 0.864 NA 0.020 0.036 0.032 0.024
#> GSM25661     1   0.173     0.5622 0.940 NA 0.012 0.028 0.008 0.008
#> GSM25662     5   0.666     0.4430 0.244 NA 0.136 0.000 0.544 0.028
#> GSM25663     5   0.666     0.4430 0.244 NA 0.136 0.000 0.544 0.028
#> GSM25680     5   0.783     0.2642 0.264 NA 0.188 0.000 0.408 0.060
#> GSM25681     5   0.783     0.2642 0.264 NA 0.188 0.000 0.408 0.060
#> GSM25682     5   0.359     0.5990 0.032 NA 0.000 0.000 0.776 0.004
#> GSM25683     5   0.359     0.5990 0.032 NA 0.000 0.000 0.776 0.004
#> GSM25684     5   0.201     0.6507 0.040 NA 0.008 0.000 0.924 0.012
#> GSM25685     5   0.201     0.6507 0.040 NA 0.008 0.000 0.924 0.012
#> GSM25686     5   0.359     0.5990 0.032 NA 0.000 0.000 0.776 0.004
#> GSM25687     5   0.359     0.5990 0.032 NA 0.000 0.000 0.776 0.004
#> GSM48664     4   0.268     0.7772 0.132 NA 0.000 0.852 0.008 0.000
#> GSM48665     1   0.231     0.5659 0.912 NA 0.008 0.048 0.008 0.012

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 genotype/variation(p) k
#> SD:hclust 74              0.000108 2
#> SD:hclust 82              0.001313 3
#> SD:hclust 30              0.010635 4
#> SD:hclust 64              0.002647 5
#> SD:hclust 58              0.000639 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.807           0.889       0.949         0.5035 0.497   0.497
#> 3 3 0.547           0.651       0.792         0.2681 0.829   0.664
#> 4 4 0.561           0.739       0.800         0.1196 0.897   0.728
#> 5 5 0.584           0.482       0.693         0.0719 0.921   0.743
#> 6 6 0.605           0.444       0.650         0.0452 0.921   0.695

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
#> GSM25548     2  0.1414      0.964 0.020 0.980
#> GSM25549     2  0.1414      0.964 0.020 0.980
#> GSM25550     2  0.1414      0.964 0.020 0.980
#> GSM25551     2  0.0000      0.962 0.000 1.000
#> GSM25570     2  0.1414      0.964 0.020 0.980
#> GSM25571     2  0.1414      0.964 0.020 0.980
#> GSM25358     1  0.5737      0.837 0.864 0.136
#> GSM25359     2  0.3431      0.912 0.064 0.936
#> GSM25360     1  0.0000      0.930 1.000 0.000
#> GSM25361     1  0.6801      0.761 0.820 0.180
#> GSM25377     1  0.1414      0.919 0.980 0.020
#> GSM25378     1  0.4022      0.884 0.920 0.080
#> GSM25401     1  0.8608      0.648 0.716 0.284
#> GSM25402     1  0.6531      0.801 0.832 0.168
#> GSM25349     2  0.0000      0.962 0.000 1.000
#> GSM25350     2  0.0000      0.962 0.000 1.000
#> GSM25356     1  0.4690      0.868 0.900 0.100
#> GSM25357     2  0.0000      0.962 0.000 1.000
#> GSM25385     1  0.0000      0.930 1.000 0.000
#> GSM25386     1  0.0000      0.930 1.000 0.000
#> GSM25399     1  0.1414      0.919 0.980 0.020
#> GSM25400     1  0.0938      0.923 0.988 0.012
#> GSM48659     2  0.1414      0.964 0.020 0.980
#> GSM48660     2  0.0000      0.962 0.000 1.000
#> GSM25409     2  0.0000      0.962 0.000 1.000
#> GSM25410     1  0.0376      0.928 0.996 0.004
#> GSM25426     2  0.0000      0.962 0.000 1.000
#> GSM25427     1  0.4022      0.884 0.920 0.080
#> GSM25540     2  0.9552      0.399 0.376 0.624
#> GSM25541     1  0.9710      0.333 0.600 0.400
#> GSM25542     2  0.0376      0.963 0.004 0.996
#> GSM25543     2  0.0376      0.963 0.004 0.996
#> GSM25479     1  0.0000      0.930 1.000 0.000
#> GSM25480     1  0.0000      0.930 1.000 0.000
#> GSM25481     1  0.9732      0.402 0.596 0.404
#> GSM25482     1  0.9732      0.402 0.596 0.404
#> GSM48654     2  0.1414      0.964 0.020 0.980
#> GSM48650     2  0.0000      0.962 0.000 1.000
#> GSM48651     2  0.0938      0.964 0.012 0.988
#> GSM48652     2  0.1414      0.964 0.020 0.980
#> GSM48653     2  0.1414      0.964 0.020 0.980
#> GSM48662     2  0.1414      0.964 0.020 0.980
#> GSM48663     2  0.0000      0.962 0.000 1.000
#> GSM25524     1  0.0000      0.930 1.000 0.000
#> GSM25525     1  0.0000      0.930 1.000 0.000
#> GSM25526     1  0.0000      0.930 1.000 0.000
#> GSM25527     1  0.0000      0.930 1.000 0.000
#> GSM25528     1  0.0000      0.930 1.000 0.000
#> GSM25529     1  0.0000      0.930 1.000 0.000
#> GSM25530     1  0.0000      0.930 1.000 0.000
#> GSM25531     1  0.0000      0.930 1.000 0.000
#> GSM48661     2  0.1633      0.962 0.024 0.976
#> GSM25561     1  0.0000      0.930 1.000 0.000
#> GSM25562     1  0.0000      0.930 1.000 0.000
#> GSM25563     1  0.0000      0.930 1.000 0.000
#> GSM25564     1  0.8327      0.654 0.736 0.264
#> GSM25565     2  0.0000      0.962 0.000 1.000
#> GSM25566     2  0.0000      0.962 0.000 1.000
#> GSM25568     2  0.8955      0.526 0.312 0.688
#> GSM25569     2  0.1414      0.964 0.020 0.980
#> GSM25552     2  0.1414      0.964 0.020 0.980
#> GSM25553     2  0.4161      0.909 0.084 0.916
#> GSM25578     1  0.0000      0.930 1.000 0.000
#> GSM25579     1  0.0000      0.930 1.000 0.000
#> GSM25580     1  0.0000      0.930 1.000 0.000
#> GSM25581     1  0.0000      0.930 1.000 0.000
#> GSM48655     2  0.0000      0.962 0.000 1.000
#> GSM48656     2  0.1414      0.964 0.020 0.980
#> GSM48657     2  0.0000      0.962 0.000 1.000
#> GSM48658     2  0.1633      0.962 0.024 0.976
#> GSM25624     1  0.0000      0.930 1.000 0.000
#> GSM25625     1  0.0000      0.930 1.000 0.000
#> GSM25626     1  0.0000      0.930 1.000 0.000
#> GSM25627     1  0.9963      0.168 0.536 0.464
#> GSM25628     1  0.2948      0.895 0.948 0.052
#> GSM25629     2  0.7815      0.702 0.232 0.768
#> GSM25630     1  0.0000      0.930 1.000 0.000
#> GSM25631     2  0.4562      0.895 0.096 0.904
#> GSM25632     1  0.0000      0.930 1.000 0.000
#> GSM25633     1  0.0000      0.930 1.000 0.000
#> GSM25634     1  0.0000      0.930 1.000 0.000
#> GSM25635     1  0.0000      0.930 1.000 0.000
#> GSM25656     1  0.9732      0.326 0.596 0.404
#> GSM25657     1  0.0000      0.930 1.000 0.000
#> GSM25658     1  0.0000      0.930 1.000 0.000
#> GSM25659     1  0.0000      0.930 1.000 0.000
#> GSM25660     1  0.0000      0.930 1.000 0.000
#> GSM25661     1  0.0000      0.930 1.000 0.000
#> GSM25662     2  0.1414      0.964 0.020 0.980
#> GSM25663     2  0.1414      0.964 0.020 0.980
#> GSM25680     2  0.1414      0.964 0.020 0.980
#> GSM25681     2  0.1633      0.962 0.024 0.976
#> GSM25682     2  0.0000      0.962 0.000 1.000
#> GSM25683     2  0.0000      0.962 0.000 1.000
#> GSM25684     2  0.1414      0.964 0.020 0.980
#> GSM25685     2  0.1414      0.964 0.020 0.980
#> GSM25686     2  0.0000      0.962 0.000 1.000
#> GSM25687     2  0.0000      0.962 0.000 1.000
#> GSM48664     1  0.1414      0.919 0.980 0.020
#> GSM48665     1  0.1414      0.919 0.980 0.020

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.2152     0.9196 0.036 0.948 0.016
#> GSM25549     2  0.2152     0.9196 0.036 0.948 0.016
#> GSM25550     2  0.2269     0.9201 0.040 0.944 0.016
#> GSM25551     2  0.1647     0.9241 0.036 0.960 0.004
#> GSM25570     2  0.2152     0.9196 0.036 0.948 0.016
#> GSM25571     2  0.2152     0.9196 0.036 0.948 0.016
#> GSM25358     1  0.7533     0.4011 0.668 0.088 0.244
#> GSM25359     2  0.7124     0.7258 0.088 0.708 0.204
#> GSM25360     3  0.0424     0.6559 0.008 0.000 0.992
#> GSM25361     3  0.4280     0.5830 0.020 0.124 0.856
#> GSM25377     1  0.3619     0.6451 0.864 0.000 0.136
#> GSM25378     1  0.3193     0.6331 0.896 0.004 0.100
#> GSM25401     1  0.6012     0.4466 0.788 0.088 0.124
#> GSM25402     1  0.4413     0.5606 0.852 0.024 0.124
#> GSM25349     2  0.3551     0.9001 0.132 0.868 0.000
#> GSM25350     2  0.3412     0.9034 0.124 0.876 0.000
#> GSM25356     1  0.2599     0.6034 0.932 0.016 0.052
#> GSM25357     2  0.4750     0.8311 0.216 0.784 0.000
#> GSM25385     3  0.2261     0.6280 0.068 0.000 0.932
#> GSM25386     3  0.0892     0.6536 0.020 0.000 0.980
#> GSM25399     1  0.4121     0.6472 0.832 0.000 0.168
#> GSM25400     1  0.4121     0.6472 0.832 0.000 0.168
#> GSM48659     2  0.1765     0.9198 0.040 0.956 0.004
#> GSM48660     2  0.3619     0.9021 0.136 0.864 0.000
#> GSM25409     2  0.3267     0.9064 0.116 0.884 0.000
#> GSM25410     3  0.1163     0.6505 0.028 0.000 0.972
#> GSM25426     2  0.3272     0.9106 0.104 0.892 0.004
#> GSM25427     1  0.3193     0.6331 0.896 0.004 0.100
#> GSM25540     3  0.5356     0.5198 0.020 0.196 0.784
#> GSM25541     3  0.4679     0.5666 0.020 0.148 0.832
#> GSM25542     2  0.5094     0.8521 0.056 0.832 0.112
#> GSM25543     2  0.6192     0.7783 0.060 0.764 0.176
#> GSM25479     1  0.6305     0.4472 0.516 0.000 0.484
#> GSM25480     1  0.6305     0.4472 0.516 0.000 0.484
#> GSM25481     1  0.3039     0.5855 0.920 0.036 0.044
#> GSM25482     1  0.3039     0.5855 0.920 0.036 0.044
#> GSM48654     2  0.1753     0.9201 0.048 0.952 0.000
#> GSM48650     2  0.3619     0.9021 0.136 0.864 0.000
#> GSM48651     2  0.1643     0.9214 0.044 0.956 0.000
#> GSM48652     2  0.1753     0.9209 0.048 0.952 0.000
#> GSM48653     2  0.1989     0.9201 0.048 0.948 0.004
#> GSM48662     2  0.1643     0.9219 0.044 0.956 0.000
#> GSM48663     2  0.3752     0.9006 0.144 0.856 0.000
#> GSM25524     3  0.0892     0.6526 0.020 0.000 0.980
#> GSM25525     3  0.6215    -0.2027 0.428 0.000 0.572
#> GSM25526     3  0.1643     0.6412 0.044 0.000 0.956
#> GSM25527     3  0.6235    -0.2374 0.436 0.000 0.564
#> GSM25528     3  0.4346     0.4834 0.184 0.000 0.816
#> GSM25529     3  0.6168    -0.1489 0.412 0.000 0.588
#> GSM25530     3  0.3941     0.5246 0.156 0.000 0.844
#> GSM25531     3  0.6168    -0.1491 0.412 0.000 0.588
#> GSM48661     2  0.2434     0.9166 0.036 0.940 0.024
#> GSM25561     3  0.1529     0.6445 0.040 0.000 0.960
#> GSM25562     3  0.6308    -0.4225 0.492 0.000 0.508
#> GSM25563     3  0.0592     0.6558 0.012 0.000 0.988
#> GSM25564     3  0.9588     0.0476 0.284 0.240 0.476
#> GSM25565     2  0.0892     0.9261 0.020 0.980 0.000
#> GSM25566     2  0.1411     0.9242 0.036 0.964 0.000
#> GSM25568     2  0.7076     0.6350 0.060 0.684 0.256
#> GSM25569     2  0.1643     0.9213 0.044 0.956 0.000
#> GSM25552     2  0.2152     0.9196 0.036 0.948 0.016
#> GSM25553     2  0.4137     0.8763 0.096 0.872 0.032
#> GSM25578     1  0.6309     0.4138 0.504 0.000 0.496
#> GSM25579     1  0.6305     0.4322 0.516 0.000 0.484
#> GSM25580     1  0.6215     0.5370 0.572 0.000 0.428
#> GSM25581     1  0.6260     0.5183 0.552 0.000 0.448
#> GSM48655     2  0.3267     0.9055 0.116 0.884 0.000
#> GSM48656     2  0.2063     0.9214 0.044 0.948 0.008
#> GSM48657     2  0.3619     0.9021 0.136 0.864 0.000
#> GSM48658     2  0.2152     0.9182 0.036 0.948 0.016
#> GSM25624     1  0.6235     0.5306 0.564 0.000 0.436
#> GSM25625     3  0.1031     0.6534 0.024 0.000 0.976
#> GSM25626     3  0.0592     0.6554 0.012 0.000 0.988
#> GSM25627     3  0.6800     0.4140 0.032 0.308 0.660
#> GSM25628     3  0.3752     0.6006 0.020 0.096 0.884
#> GSM25629     3  0.6717     0.3751 0.020 0.352 0.628
#> GSM25630     3  0.0424     0.6558 0.008 0.000 0.992
#> GSM25631     2  0.5292     0.7527 0.028 0.800 0.172
#> GSM25632     3  0.0892     0.6541 0.020 0.000 0.980
#> GSM25633     1  0.6280     0.4993 0.540 0.000 0.460
#> GSM25634     1  0.6274     0.5069 0.544 0.000 0.456
#> GSM25635     1  0.6267     0.5132 0.548 0.000 0.452
#> GSM25656     3  0.4679     0.5668 0.020 0.148 0.832
#> GSM25657     3  0.6286    -0.3310 0.464 0.000 0.536
#> GSM25658     3  0.4931     0.3885 0.232 0.000 0.768
#> GSM25659     3  0.6282    -0.0287 0.384 0.004 0.612
#> GSM25660     1  0.6274     0.5069 0.544 0.000 0.456
#> GSM25661     1  0.6235     0.5306 0.564 0.000 0.436
#> GSM25662     2  0.1129     0.9235 0.020 0.976 0.004
#> GSM25663     2  0.1491     0.9205 0.016 0.968 0.016
#> GSM25680     2  0.2176     0.9146 0.032 0.948 0.020
#> GSM25681     2  0.2689     0.9084 0.032 0.932 0.036
#> GSM25682     2  0.3192     0.9055 0.112 0.888 0.000
#> GSM25683     2  0.3192     0.9055 0.112 0.888 0.000
#> GSM25684     2  0.1129     0.9235 0.020 0.976 0.004
#> GSM25685     2  0.1453     0.9239 0.024 0.968 0.008
#> GSM25686     2  0.3192     0.9055 0.112 0.888 0.000
#> GSM25687     2  0.3192     0.9055 0.112 0.888 0.000
#> GSM48664     1  0.3816     0.6472 0.852 0.000 0.148
#> GSM48665     1  0.4178     0.6470 0.828 0.000 0.172

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.3647     0.8158 0.000 0.852 0.040 0.108
#> GSM25549     2  0.3647     0.8158 0.000 0.852 0.040 0.108
#> GSM25550     2  0.3647     0.8158 0.000 0.852 0.040 0.108
#> GSM25551     2  0.3182     0.8387 0.000 0.876 0.028 0.096
#> GSM25570     2  0.3647     0.8158 0.000 0.852 0.040 0.108
#> GSM25571     2  0.3647     0.8158 0.000 0.852 0.040 0.108
#> GSM25358     4  0.8440     0.4515 0.144 0.124 0.176 0.556
#> GSM25359     2  0.7519     0.5684 0.016 0.564 0.232 0.188
#> GSM25360     3  0.3208     0.8250 0.148 0.000 0.848 0.004
#> GSM25361     3  0.6053     0.7361 0.076 0.100 0.748 0.076
#> GSM25377     4  0.5007     0.7620 0.356 0.000 0.008 0.636
#> GSM25378     4  0.4920     0.7702 0.368 0.000 0.004 0.628
#> GSM25401     4  0.5899     0.6358 0.104 0.080 0.060 0.756
#> GSM25402     4  0.5358     0.7337 0.208 0.012 0.044 0.736
#> GSM25349     2  0.5497     0.7296 0.000 0.672 0.044 0.284
#> GSM25350     2  0.5446     0.7380 0.000 0.680 0.044 0.276
#> GSM25356     4  0.4621     0.7838 0.284 0.000 0.008 0.708
#> GSM25357     2  0.5784     0.4765 0.000 0.556 0.032 0.412
#> GSM25385     3  0.3271     0.8272 0.132 0.000 0.856 0.012
#> GSM25386     3  0.3161     0.8289 0.124 0.000 0.864 0.012
#> GSM25399     4  0.5378     0.6542 0.448 0.000 0.012 0.540
#> GSM25400     4  0.5161     0.6278 0.476 0.000 0.004 0.520
#> GSM48659     2  0.3004     0.8372 0.000 0.892 0.048 0.060
#> GSM48660     2  0.4452     0.8197 0.000 0.796 0.048 0.156
#> GSM25409     2  0.4590     0.8048 0.000 0.772 0.036 0.192
#> GSM25410     3  0.3335     0.8289 0.120 0.000 0.860 0.020
#> GSM25426     2  0.5102     0.7940 0.000 0.748 0.064 0.188
#> GSM25427     4  0.4920     0.7702 0.368 0.000 0.004 0.628
#> GSM25540     3  0.5743     0.7139 0.044 0.136 0.756 0.064
#> GSM25541     3  0.6002     0.7178 0.060 0.132 0.744 0.064
#> GSM25542     2  0.6013     0.7130 0.000 0.684 0.196 0.120
#> GSM25543     2  0.7061     0.4735 0.000 0.540 0.312 0.148
#> GSM25479     1  0.0927     0.8098 0.976 0.000 0.016 0.008
#> GSM25480     1  0.1174     0.8083 0.968 0.000 0.020 0.012
#> GSM25481     4  0.4718     0.7782 0.272 0.008 0.004 0.716
#> GSM25482     4  0.4718     0.7782 0.272 0.008 0.004 0.716
#> GSM48654     2  0.2919     0.8360 0.000 0.896 0.044 0.060
#> GSM48650     2  0.5254     0.7817 0.000 0.724 0.056 0.220
#> GSM48651     2  0.3216     0.8336 0.000 0.880 0.044 0.076
#> GSM48652     2  0.3216     0.8336 0.000 0.880 0.044 0.076
#> GSM48653     2  0.3056     0.8346 0.000 0.888 0.040 0.072
#> GSM48662     2  0.2739     0.8376 0.000 0.904 0.036 0.060
#> GSM48663     2  0.5861     0.7179 0.000 0.644 0.060 0.296
#> GSM25524     3  0.5229     0.3756 0.428 0.000 0.564 0.008
#> GSM25525     1  0.1890     0.7988 0.936 0.000 0.056 0.008
#> GSM25526     3  0.5277     0.6585 0.304 0.000 0.668 0.028
#> GSM25527     1  0.1389     0.8069 0.952 0.000 0.048 0.000
#> GSM25528     1  0.4401     0.5287 0.724 0.000 0.272 0.004
#> GSM25529     1  0.2048     0.7935 0.928 0.000 0.064 0.008
#> GSM25530     1  0.5285    -0.0991 0.524 0.000 0.468 0.008
#> GSM25531     1  0.2124     0.7919 0.924 0.000 0.068 0.008
#> GSM48661     2  0.3474     0.8340 0.000 0.868 0.068 0.064
#> GSM25561     3  0.4826     0.7044 0.264 0.000 0.716 0.020
#> GSM25562     1  0.2224     0.8038 0.928 0.000 0.032 0.040
#> GSM25563     3  0.3606     0.8255 0.140 0.000 0.840 0.020
#> GSM25564     1  0.7679     0.2688 0.596 0.236 0.092 0.076
#> GSM25565     2  0.3453     0.8452 0.000 0.868 0.052 0.080
#> GSM25566     2  0.2546     0.8395 0.000 0.912 0.028 0.060
#> GSM25568     2  0.7984     0.4792 0.024 0.516 0.236 0.224
#> GSM25569     2  0.3978     0.8280 0.000 0.836 0.056 0.108
#> GSM25552     2  0.4271     0.8081 0.020 0.836 0.040 0.104
#> GSM25553     2  0.6538     0.6790 0.148 0.700 0.040 0.112
#> GSM25578     1  0.0927     0.8109 0.976 0.000 0.016 0.008
#> GSM25579     1  0.2578     0.7654 0.912 0.000 0.036 0.052
#> GSM25580     1  0.1209     0.7954 0.964 0.000 0.004 0.032
#> GSM25581     1  0.1004     0.8007 0.972 0.000 0.004 0.024
#> GSM48655     2  0.3931     0.8233 0.000 0.832 0.040 0.128
#> GSM48656     2  0.2908     0.8385 0.000 0.896 0.040 0.064
#> GSM48657     2  0.4532     0.8149 0.000 0.792 0.052 0.156
#> GSM48658     2  0.3716     0.8325 0.000 0.852 0.052 0.096
#> GSM25624     1  0.1824     0.7689 0.936 0.000 0.004 0.060
#> GSM25625     3  0.3450     0.8197 0.156 0.000 0.836 0.008
#> GSM25626     3  0.2999     0.8300 0.132 0.004 0.864 0.000
#> GSM25627     3  0.7093     0.5766 0.056 0.240 0.632 0.072
#> GSM25628     3  0.3037     0.8179 0.076 0.036 0.888 0.000
#> GSM25629     3  0.6634     0.5578 0.036 0.268 0.640 0.056
#> GSM25630     3  0.3763     0.8238 0.144 0.000 0.832 0.024
#> GSM25631     2  0.5588     0.7803 0.052 0.772 0.064 0.112
#> GSM25632     3  0.2921     0.8277 0.140 0.000 0.860 0.000
#> GSM25633     1  0.1109     0.7985 0.968 0.000 0.004 0.028
#> GSM25634     1  0.1489     0.7854 0.952 0.000 0.004 0.044
#> GSM25635     1  0.1398     0.7896 0.956 0.000 0.004 0.040
#> GSM25656     3  0.3801     0.7943 0.048 0.060 0.868 0.024
#> GSM25657     1  0.1388     0.8110 0.960 0.000 0.028 0.012
#> GSM25658     1  0.5756     0.1388 0.568 0.000 0.400 0.032
#> GSM25659     1  0.3237     0.7712 0.888 0.008 0.064 0.040
#> GSM25660     1  0.1004     0.8010 0.972 0.000 0.004 0.024
#> GSM25661     1  0.1109     0.7985 0.968 0.000 0.004 0.028
#> GSM25662     2  0.2500     0.8410 0.000 0.916 0.040 0.044
#> GSM25663     2  0.2915     0.8292 0.000 0.892 0.028 0.080
#> GSM25680     2  0.4041     0.8123 0.004 0.840 0.056 0.100
#> GSM25681     2  0.4102     0.8108 0.004 0.836 0.056 0.104
#> GSM25682     2  0.3581     0.8208 0.000 0.852 0.032 0.116
#> GSM25683     2  0.3581     0.8208 0.000 0.852 0.032 0.116
#> GSM25684     2  0.2500     0.8410 0.000 0.916 0.040 0.044
#> GSM25685     2  0.3164     0.8379 0.000 0.884 0.052 0.064
#> GSM25686     2  0.3581     0.8208 0.000 0.852 0.032 0.116
#> GSM25687     2  0.3581     0.8208 0.000 0.852 0.032 0.116
#> GSM48664     4  0.5378     0.6572 0.448 0.000 0.012 0.540
#> GSM48665     1  0.4511     0.2194 0.724 0.000 0.008 0.268

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     2  0.0324    0.44879 0.000 0.992 0.000 0.004 0.004
#> GSM25549     2  0.0324    0.44879 0.000 0.992 0.000 0.004 0.004
#> GSM25550     2  0.0613    0.44376 0.004 0.984 0.000 0.004 0.008
#> GSM25551     2  0.5375    0.06067 0.000 0.568 0.008 0.044 0.380
#> GSM25570     2  0.0324    0.44879 0.000 0.992 0.000 0.004 0.004
#> GSM25571     2  0.0324    0.44879 0.000 0.992 0.000 0.004 0.004
#> GSM25358     4  0.7980    0.38358 0.040 0.248 0.104 0.508 0.100
#> GSM25359     2  0.6972    0.00776 0.000 0.576 0.176 0.076 0.172
#> GSM25360     3  0.2408    0.76501 0.092 0.000 0.892 0.000 0.016
#> GSM25361     3  0.6988    0.50336 0.056 0.356 0.500 0.012 0.076
#> GSM25377     4  0.4483    0.77315 0.156 0.000 0.012 0.768 0.064
#> GSM25378     4  0.4323    0.78157 0.200 0.000 0.004 0.752 0.044
#> GSM25401     4  0.4643    0.63069 0.016 0.000 0.032 0.724 0.228
#> GSM25402     4  0.4741    0.71088 0.048 0.000 0.028 0.752 0.172
#> GSM25349     5  0.6720    0.36732 0.000 0.404 0.020 0.140 0.436
#> GSM25350     5  0.6693    0.36227 0.000 0.408 0.020 0.136 0.436
#> GSM25356     4  0.3915    0.79975 0.112 0.008 0.004 0.820 0.056
#> GSM25357     5  0.6779    0.27835 0.000 0.360 0.000 0.276 0.364
#> GSM25385     3  0.1990    0.76920 0.068 0.000 0.920 0.008 0.004
#> GSM25386     3  0.1788    0.77028 0.056 0.000 0.932 0.008 0.004
#> GSM25399     4  0.4925    0.74795 0.180 0.000 0.016 0.732 0.072
#> GSM25400     4  0.3835    0.70416 0.260 0.000 0.008 0.732 0.000
#> GSM48659     2  0.4898    0.31431 0.000 0.592 0.032 0.000 0.376
#> GSM48660     5  0.5149    0.15540 0.000 0.424 0.004 0.032 0.540
#> GSM25409     2  0.4086    0.25624 0.000 0.788 0.004 0.056 0.152
#> GSM25410     3  0.1901    0.76926 0.056 0.000 0.928 0.012 0.004
#> GSM25426     5  0.6110    0.21332 0.000 0.388 0.028 0.064 0.520
#> GSM25427     4  0.4032    0.78290 0.192 0.000 0.004 0.772 0.032
#> GSM25540     3  0.6669    0.49209 0.020 0.340 0.528 0.016 0.096
#> GSM25541     3  0.6748    0.49323 0.024 0.340 0.524 0.016 0.096
#> GSM25542     2  0.7269   -0.11132 0.000 0.436 0.136 0.060 0.368
#> GSM25543     5  0.7766    0.13891 0.000 0.352 0.232 0.064 0.352
#> GSM25479     1  0.1041    0.79642 0.964 0.000 0.004 0.032 0.000
#> GSM25480     1  0.1116    0.79663 0.964 0.004 0.004 0.028 0.000
#> GSM25481     4  0.4929    0.78674 0.132 0.004 0.008 0.744 0.112
#> GSM25482     4  0.4929    0.78674 0.132 0.004 0.008 0.744 0.112
#> GSM48654     2  0.4902    0.27910 0.000 0.564 0.028 0.000 0.408
#> GSM48650     5  0.5506    0.33276 0.000 0.344 0.004 0.068 0.584
#> GSM48651     2  0.4900    0.17801 0.000 0.512 0.024 0.000 0.464
#> GSM48652     2  0.4897    0.18644 0.000 0.516 0.024 0.000 0.460
#> GSM48653     2  0.4897    0.19667 0.000 0.516 0.024 0.000 0.460
#> GSM48662     2  0.4709    0.29987 0.000 0.612 0.024 0.000 0.364
#> GSM48663     5  0.6099    0.42386 0.000 0.256 0.012 0.136 0.596
#> GSM25524     1  0.6030    0.10686 0.516 0.000 0.392 0.016 0.076
#> GSM25525     1  0.1731    0.78594 0.940 0.000 0.012 0.008 0.040
#> GSM25526     3  0.6278    0.40287 0.344 0.000 0.544 0.032 0.080
#> GSM25527     1  0.1804    0.79597 0.940 0.000 0.024 0.024 0.012
#> GSM25528     1  0.4623    0.65773 0.764 0.000 0.148 0.016 0.072
#> GSM25529     1  0.1808    0.78539 0.936 0.000 0.012 0.008 0.044
#> GSM25530     1  0.5553    0.46402 0.648 0.000 0.264 0.020 0.068
#> GSM25531     1  0.2537    0.77443 0.904 0.000 0.024 0.016 0.056
#> GSM48661     2  0.5171    0.34178 0.000 0.616 0.040 0.008 0.336
#> GSM25561     3  0.5328    0.54654 0.256 0.000 0.660 0.008 0.076
#> GSM25562     1  0.3439    0.75705 0.844 0.000 0.004 0.092 0.060
#> GSM25563     3  0.3568    0.74822 0.080 0.000 0.844 0.012 0.064
#> GSM25564     1  0.7620    0.26197 0.504 0.264 0.056 0.020 0.156
#> GSM25565     2  0.5085    0.24288 0.000 0.632 0.012 0.032 0.324
#> GSM25566     2  0.4576    0.27523 0.000 0.712 0.008 0.032 0.248
#> GSM25568     5  0.8218    0.12886 0.008 0.348 0.180 0.108 0.356
#> GSM25569     2  0.6031    0.13134 0.000 0.552 0.044 0.044 0.360
#> GSM25552     2  0.1074    0.43743 0.016 0.968 0.000 0.004 0.012
#> GSM25553     2  0.2395    0.36453 0.072 0.904 0.000 0.008 0.016
#> GSM25578     1  0.1588    0.79642 0.948 0.000 0.008 0.028 0.016
#> GSM25579     1  0.2297    0.77920 0.912 0.060 0.008 0.020 0.000
#> GSM25580     1  0.2230    0.77044 0.884 0.000 0.000 0.116 0.000
#> GSM25581     1  0.2230    0.77044 0.884 0.000 0.000 0.116 0.000
#> GSM48655     2  0.5109   -0.14466 0.000 0.504 0.000 0.036 0.460
#> GSM48656     2  0.4742    0.34808 0.000 0.648 0.020 0.008 0.324
#> GSM48657     5  0.5077    0.18482 0.000 0.428 0.000 0.036 0.536
#> GSM48658     2  0.4622    0.37268 0.000 0.696 0.028 0.008 0.268
#> GSM25624     1  0.2852    0.72597 0.828 0.000 0.000 0.172 0.000
#> GSM25625     3  0.3446    0.75770 0.112 0.000 0.844 0.016 0.028
#> GSM25626     3  0.1914    0.77028 0.056 0.000 0.928 0.008 0.008
#> GSM25627     3  0.7422    0.41845 0.032 0.120 0.528 0.044 0.276
#> GSM25628     3  0.1996    0.76089 0.032 0.004 0.928 0.000 0.036
#> GSM25629     3  0.7503    0.42233 0.032 0.184 0.524 0.032 0.228
#> GSM25630     3  0.4244    0.72801 0.100 0.000 0.800 0.016 0.084
#> GSM25631     2  0.3105    0.39798 0.016 0.872 0.020 0.004 0.088
#> GSM25632     3  0.2403    0.76630 0.072 0.000 0.904 0.012 0.012
#> GSM25633     1  0.1671    0.78808 0.924 0.000 0.000 0.076 0.000
#> GSM25634     1  0.2561    0.75012 0.856 0.000 0.000 0.144 0.000
#> GSM25635     1  0.2516    0.75299 0.860 0.000 0.000 0.140 0.000
#> GSM25656     3  0.3729    0.72960 0.012 0.024 0.844 0.024 0.096
#> GSM25657     1  0.2568    0.78473 0.904 0.000 0.016 0.048 0.032
#> GSM25658     1  0.6672    0.14609 0.516 0.000 0.344 0.048 0.092
#> GSM25659     1  0.3748    0.74552 0.848 0.056 0.012 0.016 0.068
#> GSM25660     1  0.1952    0.78500 0.912 0.004 0.000 0.084 0.000
#> GSM25661     1  0.1851    0.78385 0.912 0.000 0.000 0.088 0.000
#> GSM25662     2  0.5052    0.29297 0.000 0.600 0.028 0.008 0.364
#> GSM25663     2  0.2899    0.44874 0.000 0.872 0.028 0.004 0.096
#> GSM25680     2  0.1843    0.43958 0.000 0.932 0.008 0.008 0.052
#> GSM25681     2  0.1731    0.43635 0.000 0.940 0.012 0.008 0.040
#> GSM25682     2  0.5058   -0.00561 0.000 0.576 0.000 0.040 0.384
#> GSM25683     2  0.5068   -0.01498 0.000 0.572 0.000 0.040 0.388
#> GSM25684     2  0.5064    0.28859 0.000 0.596 0.028 0.008 0.368
#> GSM25685     2  0.5886    0.12558 0.000 0.500 0.044 0.028 0.428
#> GSM25686     2  0.5058   -0.00561 0.000 0.576 0.000 0.040 0.384
#> GSM25687     2  0.5058   -0.00561 0.000 0.576 0.000 0.040 0.384
#> GSM48664     4  0.4743    0.74882 0.184 0.000 0.012 0.740 0.064
#> GSM48665     1  0.4804    0.32384 0.612 0.000 0.016 0.364 0.008

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5 p6
#> GSM25548     5  0.0000     0.5026 0.000 0.000 0.000 0.000 1.000 NA
#> GSM25549     5  0.0000     0.5026 0.000 0.000 0.000 0.000 1.000 NA
#> GSM25550     5  0.0405     0.5009 0.000 0.008 0.000 0.000 0.988 NA
#> GSM25551     5  0.6412     0.0488 0.000 0.304 0.012 0.024 0.496 NA
#> GSM25570     5  0.0146     0.5028 0.000 0.004 0.000 0.000 0.996 NA
#> GSM25571     5  0.0146     0.5028 0.000 0.004 0.000 0.000 0.996 NA
#> GSM25358     4  0.7883     0.3897 0.032 0.068 0.084 0.456 0.284 NA
#> GSM25359     5  0.6922     0.2458 0.000 0.132 0.124 0.044 0.576 NA
#> GSM25360     3  0.2655     0.7061 0.060 0.000 0.876 0.004 0.000 NA
#> GSM25361     5  0.7521    -0.3211 0.076 0.036 0.352 0.004 0.392 NA
#> GSM25377     4  0.4731     0.7214 0.072 0.016 0.008 0.716 0.000 NA
#> GSM25378     4  0.4230     0.7224 0.164 0.020 0.004 0.768 0.008 NA
#> GSM25401     4  0.5694     0.6203 0.004 0.168 0.032 0.644 0.004 NA
#> GSM25402     4  0.4931     0.6799 0.008 0.124 0.028 0.732 0.004 NA
#> GSM25349     2  0.6527     0.2921 0.000 0.500 0.000 0.084 0.296 NA
#> GSM25350     2  0.6468     0.2900 0.000 0.500 0.000 0.076 0.304 NA
#> GSM25356     4  0.4116     0.7614 0.068 0.048 0.004 0.804 0.004 NA
#> GSM25357     2  0.7348     0.1487 0.000 0.360 0.000 0.300 0.220 NA
#> GSM25385     3  0.1007     0.7280 0.016 0.004 0.968 0.008 0.000 NA
#> GSM25386     3  0.0881     0.7289 0.012 0.000 0.972 0.008 0.000 NA
#> GSM25399     4  0.5086     0.6920 0.084 0.016 0.004 0.660 0.000 NA
#> GSM25400     4  0.3883     0.6760 0.200 0.004 0.000 0.752 0.000 NA
#> GSM48659     2  0.5170     0.2411 0.000 0.484 0.008 0.000 0.444 NA
#> GSM48660     2  0.4281     0.4125 0.000 0.688 0.000 0.016 0.272 NA
#> GSM25409     5  0.4200     0.3384 0.000 0.192 0.000 0.020 0.744 NA
#> GSM25410     3  0.0881     0.7289 0.012 0.000 0.972 0.008 0.000 NA
#> GSM25426     2  0.6777     0.1975 0.000 0.488 0.028 0.028 0.276 NA
#> GSM25427     4  0.3918     0.7164 0.160 0.016 0.000 0.776 0.000 NA
#> GSM25540     3  0.6535     0.2738 0.000 0.056 0.432 0.000 0.368 NA
#> GSM25541     3  0.6765     0.2461 0.008 0.056 0.412 0.000 0.380 NA
#> GSM25542     2  0.7171     0.2303 0.000 0.428 0.104 0.004 0.288 NA
#> GSM25543     2  0.7695     0.1925 0.000 0.396 0.188 0.012 0.220 NA
#> GSM25479     1  0.0964     0.7484 0.968 0.000 0.000 0.012 0.004 NA
#> GSM25480     1  0.1078     0.7487 0.964 0.000 0.000 0.012 0.008 NA
#> GSM25481     4  0.5414     0.7419 0.112 0.076 0.004 0.716 0.020 NA
#> GSM25482     4  0.5414     0.7419 0.112 0.076 0.004 0.716 0.020 NA
#> GSM48654     2  0.4945     0.3055 0.000 0.528 0.004 0.000 0.412 NA
#> GSM48650     2  0.4859     0.3899 0.000 0.692 0.000 0.024 0.204 NA
#> GSM48651     2  0.4435     0.3569 0.000 0.580 0.004 0.000 0.392 NA
#> GSM48652     2  0.4426     0.3570 0.000 0.584 0.004 0.000 0.388 NA
#> GSM48653     2  0.4795     0.3363 0.000 0.560 0.008 0.000 0.392 NA
#> GSM48662     2  0.4760     0.3142 0.000 0.520 0.004 0.000 0.436 NA
#> GSM48663     2  0.5574     0.3974 0.000 0.660 0.000 0.068 0.148 NA
#> GSM25524     1  0.5824     0.2729 0.500 0.004 0.312 0.000 0.000 NA
#> GSM25525     1  0.2595     0.7150 0.836 0.000 0.004 0.000 0.000 NA
#> GSM25526     3  0.7442     0.1193 0.336 0.056 0.400 0.048 0.000 NA
#> GSM25527     1  0.2458     0.7469 0.900 0.008 0.028 0.012 0.000 NA
#> GSM25528     1  0.4432     0.6388 0.708 0.000 0.104 0.000 0.000 NA
#> GSM25529     1  0.2706     0.7136 0.832 0.000 0.008 0.000 0.000 NA
#> GSM25530     1  0.5451     0.5332 0.616 0.000 0.176 0.012 0.000 NA
#> GSM25531     1  0.3309     0.6983 0.788 0.000 0.004 0.016 0.000 NA
#> GSM48661     5  0.5850    -0.2103 0.000 0.436 0.028 0.000 0.440 NA
#> GSM25561     3  0.5574     0.5493 0.192 0.028 0.652 0.012 0.000 NA
#> GSM25562     1  0.4895     0.6666 0.728 0.040 0.004 0.112 0.000 NA
#> GSM25563     3  0.3386     0.7065 0.040 0.032 0.848 0.008 0.000 NA
#> GSM25564     1  0.8311     0.2176 0.432 0.176 0.052 0.032 0.208 NA
#> GSM25565     5  0.5101    -0.0362 0.000 0.396 0.004 0.008 0.540 NA
#> GSM25566     5  0.4680     0.2173 0.000 0.280 0.004 0.004 0.656 NA
#> GSM25568     2  0.8175     0.2176 0.004 0.400 0.116 0.064 0.232 NA
#> GSM25569     2  0.5860     0.3027 0.000 0.472 0.004 0.008 0.384 NA
#> GSM25552     5  0.0976     0.4956 0.008 0.008 0.000 0.000 0.968 NA
#> GSM25553     5  0.2063     0.4633 0.044 0.008 0.000 0.008 0.920 NA
#> GSM25578     1  0.1116     0.7479 0.960 0.000 0.004 0.008 0.000 NA
#> GSM25579     1  0.2568     0.7226 0.876 0.000 0.000 0.012 0.096 NA
#> GSM25580     1  0.3344     0.7134 0.828 0.000 0.008 0.104 0.000 NA
#> GSM25581     1  0.3249     0.7174 0.836 0.000 0.008 0.096 0.000 NA
#> GSM48655     2  0.5117     0.1893 0.000 0.532 0.000 0.012 0.400 NA
#> GSM48656     5  0.5174    -0.2419 0.000 0.460 0.008 0.000 0.468 NA
#> GSM48657     2  0.4797     0.3521 0.000 0.648 0.000 0.012 0.280 NA
#> GSM48658     5  0.5507    -0.0230 0.000 0.356 0.012 0.000 0.532 NA
#> GSM25624     1  0.4284     0.6274 0.728 0.000 0.008 0.200 0.000 NA
#> GSM25625     3  0.3257     0.7025 0.064 0.020 0.860 0.024 0.000 NA
#> GSM25626     3  0.0551     0.7301 0.008 0.004 0.984 0.004 0.000 NA
#> GSM25627     3  0.7974     0.2798 0.004 0.256 0.400 0.056 0.084 NA
#> GSM25628     3  0.1425     0.7288 0.008 0.012 0.952 0.000 0.008 NA
#> GSM25629     3  0.7997     0.2524 0.004 0.196 0.388 0.024 0.176 NA
#> GSM25630     3  0.3714     0.6856 0.044 0.020 0.816 0.008 0.000 NA
#> GSM25631     5  0.3407     0.4211 0.004 0.068 0.008 0.000 0.832 NA
#> GSM25632     3  0.1218     0.7267 0.028 0.000 0.956 0.004 0.000 NA
#> GSM25633     1  0.3140     0.7199 0.844 0.000 0.008 0.092 0.000 NA
#> GSM25634     1  0.3686     0.6904 0.796 0.000 0.008 0.136 0.000 NA
#> GSM25635     1  0.3686     0.6904 0.796 0.000 0.008 0.136 0.000 NA
#> GSM25656     3  0.4660     0.6555 0.004 0.056 0.728 0.012 0.012 NA
#> GSM25657     1  0.2126     0.7434 0.904 0.000 0.004 0.020 0.000 NA
#> GSM25658     1  0.7626     0.1444 0.428 0.056 0.264 0.064 0.000 NA
#> GSM25659     1  0.4886     0.6750 0.748 0.044 0.008 0.020 0.040 NA
#> GSM25660     1  0.3258     0.7204 0.836 0.000 0.008 0.092 0.000 NA
#> GSM25661     1  0.3190     0.7210 0.844 0.000 0.012 0.088 0.000 NA
#> GSM25662     5  0.5659    -0.0802 0.000 0.388 0.012 0.004 0.500 NA
#> GSM25663     5  0.3517     0.4320 0.000 0.096 0.012 0.000 0.820 NA
#> GSM25680     5  0.2044     0.4823 0.000 0.040 0.008 0.004 0.920 NA
#> GSM25681     5  0.1819     0.4865 0.000 0.024 0.008 0.004 0.932 NA
#> GSM25682     5  0.5441     0.0354 0.000 0.412 0.004 0.016 0.504 NA
#> GSM25683     5  0.5441     0.0354 0.000 0.412 0.004 0.016 0.504 NA
#> GSM25684     5  0.5696    -0.0849 0.000 0.388 0.012 0.004 0.496 NA
#> GSM25685     2  0.6741     0.1238 0.000 0.396 0.024 0.020 0.384 NA
#> GSM25686     5  0.5441     0.0354 0.000 0.412 0.004 0.016 0.504 NA
#> GSM25687     5  0.5441     0.0354 0.000 0.412 0.004 0.016 0.504 NA
#> GSM48664     4  0.5043     0.6906 0.092 0.012 0.004 0.664 0.000 NA
#> GSM48665     1  0.5194     0.4395 0.612 0.000 0.012 0.284 0.000 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-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 genotype/variation(p) k
#> SD:kmeans 94              3.38e-05 2
#> SD:kmeans 81              1.87e-03 3
#> SD:kmeans 91              1.35e-06 4
#> SD:kmeans 44              6.46e-03 5
#> SD:kmeans 49              5.34e-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.


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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) are extracted by 'SD' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.801           0.897       0.956         0.5052 0.495   0.495
#> 3 3 0.562           0.730       0.831         0.3057 0.800   0.614
#> 4 4 0.457           0.476       0.686         0.1263 0.877   0.671
#> 5 5 0.489           0.433       0.643         0.0696 0.894   0.652
#> 6 6 0.503           0.324       0.577         0.0420 0.898   0.597

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
#> GSM25548     2  0.0000      0.956 0.000 1.000
#> GSM25549     2  0.0000      0.956 0.000 1.000
#> GSM25550     2  0.0000      0.956 0.000 1.000
#> GSM25551     2  0.0000      0.956 0.000 1.000
#> GSM25570     2  0.0000      0.956 0.000 1.000
#> GSM25571     2  0.0000      0.956 0.000 1.000
#> GSM25358     1  0.5294      0.852 0.880 0.120
#> GSM25359     2  0.3733      0.893 0.072 0.928
#> GSM25360     1  0.0000      0.949 1.000 0.000
#> GSM25361     1  0.9795      0.257 0.584 0.416
#> GSM25377     1  0.0000      0.949 1.000 0.000
#> GSM25378     1  0.3114      0.910 0.944 0.056
#> GSM25401     1  0.6343      0.808 0.840 0.160
#> GSM25402     1  0.4161      0.885 0.916 0.084
#> GSM25349     2  0.0000      0.956 0.000 1.000
#> GSM25350     2  0.0000      0.956 0.000 1.000
#> GSM25356     1  0.4690      0.872 0.900 0.100
#> GSM25357     2  0.0000      0.956 0.000 1.000
#> GSM25385     1  0.0000      0.949 1.000 0.000
#> GSM25386     1  0.0000      0.949 1.000 0.000
#> GSM25399     1  0.0000      0.949 1.000 0.000
#> GSM25400     1  0.0000      0.949 1.000 0.000
#> GSM48659     2  0.0000      0.956 0.000 1.000
#> GSM48660     2  0.0000      0.956 0.000 1.000
#> GSM25409     2  0.0000      0.956 0.000 1.000
#> GSM25410     1  0.0000      0.949 1.000 0.000
#> GSM25426     2  0.0000      0.956 0.000 1.000
#> GSM25427     1  0.3733      0.896 0.928 0.072
#> GSM25540     2  0.8555      0.620 0.280 0.720
#> GSM25541     2  0.9522      0.429 0.372 0.628
#> GSM25542     2  0.0000      0.956 0.000 1.000
#> GSM25543     2  0.0000      0.956 0.000 1.000
#> GSM25479     1  0.0000      0.949 1.000 0.000
#> GSM25480     1  0.0000      0.949 1.000 0.000
#> GSM25481     1  0.9044      0.561 0.680 0.320
#> GSM25482     1  0.8861      0.592 0.696 0.304
#> GSM48654     2  0.0000      0.956 0.000 1.000
#> GSM48650     2  0.0000      0.956 0.000 1.000
#> GSM48651     2  0.0000      0.956 0.000 1.000
#> GSM48652     2  0.0000      0.956 0.000 1.000
#> GSM48653     2  0.0000      0.956 0.000 1.000
#> GSM48662     2  0.0000      0.956 0.000 1.000
#> GSM48663     2  0.0000      0.956 0.000 1.000
#> GSM25524     1  0.0000      0.949 1.000 0.000
#> GSM25525     1  0.0000      0.949 1.000 0.000
#> GSM25526     1  0.0000      0.949 1.000 0.000
#> GSM25527     1  0.0000      0.949 1.000 0.000
#> GSM25528     1  0.0000      0.949 1.000 0.000
#> GSM25529     1  0.0000      0.949 1.000 0.000
#> GSM25530     1  0.0000      0.949 1.000 0.000
#> GSM25531     1  0.0000      0.949 1.000 0.000
#> GSM48661     2  0.0000      0.956 0.000 1.000
#> GSM25561     1  0.0000      0.949 1.000 0.000
#> GSM25562     1  0.0000      0.949 1.000 0.000
#> GSM25563     1  0.0000      0.949 1.000 0.000
#> GSM25564     1  0.8661      0.615 0.712 0.288
#> GSM25565     2  0.0000      0.956 0.000 1.000
#> GSM25566     2  0.0000      0.956 0.000 1.000
#> GSM25568     2  0.9580      0.345 0.380 0.620
#> GSM25569     2  0.0000      0.956 0.000 1.000
#> GSM25552     2  0.0000      0.956 0.000 1.000
#> GSM25553     2  0.3274      0.906 0.060 0.940
#> GSM25578     1  0.0000      0.949 1.000 0.000
#> GSM25579     1  0.0000      0.949 1.000 0.000
#> GSM25580     1  0.0000      0.949 1.000 0.000
#> GSM25581     1  0.0000      0.949 1.000 0.000
#> GSM48655     2  0.0000      0.956 0.000 1.000
#> GSM48656     2  0.0000      0.956 0.000 1.000
#> GSM48657     2  0.0000      0.956 0.000 1.000
#> GSM48658     2  0.0000      0.956 0.000 1.000
#> GSM25624     1  0.0000      0.949 1.000 0.000
#> GSM25625     1  0.0000      0.949 1.000 0.000
#> GSM25626     1  0.0000      0.949 1.000 0.000
#> GSM25627     1  0.9427      0.448 0.640 0.360
#> GSM25628     1  0.5294      0.844 0.880 0.120
#> GSM25629     2  0.7602      0.714 0.220 0.780
#> GSM25630     1  0.0000      0.949 1.000 0.000
#> GSM25631     2  0.5059      0.854 0.112 0.888
#> GSM25632     1  0.0000      0.949 1.000 0.000
#> GSM25633     1  0.0000      0.949 1.000 0.000
#> GSM25634     1  0.0000      0.949 1.000 0.000
#> GSM25635     1  0.0000      0.949 1.000 0.000
#> GSM25656     2  0.9954      0.173 0.460 0.540
#> GSM25657     1  0.0000      0.949 1.000 0.000
#> GSM25658     1  0.0000      0.949 1.000 0.000
#> GSM25659     1  0.0000      0.949 1.000 0.000
#> GSM25660     1  0.0000      0.949 1.000 0.000
#> GSM25661     1  0.0000      0.949 1.000 0.000
#> GSM25662     2  0.0000      0.956 0.000 1.000
#> GSM25663     2  0.0000      0.956 0.000 1.000
#> GSM25680     2  0.0000      0.956 0.000 1.000
#> GSM25681     2  0.0672      0.950 0.008 0.992
#> GSM25682     2  0.0000      0.956 0.000 1.000
#> GSM25683     2  0.0000      0.956 0.000 1.000
#> GSM25684     2  0.0000      0.956 0.000 1.000
#> GSM25685     2  0.0000      0.956 0.000 1.000
#> GSM25686     2  0.0000      0.956 0.000 1.000
#> GSM25687     2  0.0000      0.956 0.000 1.000
#> GSM48664     1  0.0000      0.949 1.000 0.000
#> GSM48665     1  0.0000      0.949 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.2537   0.888152 0.000 0.920 0.080
#> GSM25549     2  0.2537   0.888701 0.000 0.920 0.080
#> GSM25550     2  0.3583   0.875322 0.044 0.900 0.056
#> GSM25551     2  0.2116   0.888453 0.012 0.948 0.040
#> GSM25570     2  0.2356   0.888317 0.000 0.928 0.072
#> GSM25571     2  0.2537   0.887987 0.000 0.920 0.080
#> GSM25358     3  0.9071   0.074373 0.432 0.136 0.432
#> GSM25359     3  0.7505   0.287864 0.044 0.384 0.572
#> GSM25360     3  0.3686   0.749067 0.140 0.000 0.860
#> GSM25361     3  0.2318   0.743109 0.028 0.028 0.944
#> GSM25377     1  0.2152   0.785457 0.948 0.036 0.016
#> GSM25378     1  0.3805   0.741807 0.884 0.092 0.024
#> GSM25401     1  0.9713   0.086359 0.444 0.240 0.316
#> GSM25402     1  0.6526   0.663104 0.760 0.112 0.128
#> GSM25349     2  0.2527   0.865263 0.044 0.936 0.020
#> GSM25350     2  0.2176   0.871593 0.032 0.948 0.020
#> GSM25356     1  0.3910   0.731820 0.876 0.104 0.020
#> GSM25357     2  0.3406   0.843994 0.068 0.904 0.028
#> GSM25385     3  0.5327   0.664734 0.272 0.000 0.728
#> GSM25386     3  0.3619   0.754211 0.136 0.000 0.864
#> GSM25399     1  0.0661   0.808120 0.988 0.004 0.008
#> GSM25400     1  0.1585   0.809276 0.964 0.008 0.028
#> GSM48659     2  0.3267   0.880719 0.000 0.884 0.116
#> GSM48660     2  0.1905   0.875825 0.028 0.956 0.016
#> GSM25409     2  0.2313   0.877919 0.032 0.944 0.024
#> GSM25410     3  0.4683   0.738320 0.140 0.024 0.836
#> GSM25426     2  0.2879   0.878419 0.024 0.924 0.052
#> GSM25427     1  0.3502   0.748724 0.896 0.084 0.020
#> GSM25540     3  0.1647   0.731013 0.004 0.036 0.960
#> GSM25541     3  0.1781   0.742921 0.020 0.020 0.960
#> GSM25542     2  0.6713   0.403690 0.012 0.572 0.416
#> GSM25543     3  0.6937   0.162261 0.020 0.404 0.576
#> GSM25479     1  0.2796   0.806000 0.908 0.000 0.092
#> GSM25480     1  0.2448   0.811884 0.924 0.000 0.076
#> GSM25481     1  0.4280   0.713798 0.856 0.124 0.020
#> GSM25482     1  0.4413   0.710139 0.852 0.124 0.024
#> GSM48654     2  0.3192   0.881250 0.000 0.888 0.112
#> GSM48650     2  0.2050   0.873370 0.028 0.952 0.020
#> GSM48651     2  0.2959   0.884579 0.000 0.900 0.100
#> GSM48652     2  0.3192   0.881250 0.000 0.888 0.112
#> GSM48653     2  0.3192   0.881250 0.000 0.888 0.112
#> GSM48662     2  0.3192   0.881890 0.000 0.888 0.112
#> GSM48663     2  0.2527   0.864840 0.044 0.936 0.020
#> GSM25524     3  0.5706   0.554887 0.320 0.000 0.680
#> GSM25525     1  0.4002   0.763116 0.840 0.000 0.160
#> GSM25526     3  0.4346   0.731019 0.184 0.000 0.816
#> GSM25527     1  0.3879   0.773353 0.848 0.000 0.152
#> GSM25528     1  0.6225   0.228286 0.568 0.000 0.432
#> GSM25529     1  0.4796   0.695741 0.780 0.000 0.220
#> GSM25530     1  0.6309  -0.028407 0.504 0.000 0.496
#> GSM25531     1  0.4842   0.693795 0.776 0.000 0.224
#> GSM48661     2  0.4702   0.818181 0.000 0.788 0.212
#> GSM25561     3  0.5835   0.541458 0.340 0.000 0.660
#> GSM25562     1  0.4121   0.752884 0.832 0.000 0.168
#> GSM25563     3  0.4121   0.742168 0.168 0.000 0.832
#> GSM25564     1  0.9744   0.000843 0.428 0.236 0.336
#> GSM25565     2  0.2599   0.886828 0.016 0.932 0.052
#> GSM25566     2  0.1905   0.884260 0.016 0.956 0.028
#> GSM25568     3  0.9355   0.246418 0.188 0.320 0.492
#> GSM25569     2  0.3340   0.879687 0.000 0.880 0.120
#> GSM25552     2  0.3678   0.881213 0.028 0.892 0.080
#> GSM25553     2  0.8587   0.250119 0.400 0.500 0.100
#> GSM25578     1  0.2448   0.811591 0.924 0.000 0.076
#> GSM25579     1  0.3784   0.795234 0.864 0.004 0.132
#> GSM25580     1  0.1529   0.816321 0.960 0.000 0.040
#> GSM25581     1  0.1964   0.816724 0.944 0.000 0.056
#> GSM48655     2  0.1482   0.879654 0.020 0.968 0.012
#> GSM48656     2  0.3038   0.885595 0.000 0.896 0.104
#> GSM48657     2  0.1620   0.878966 0.024 0.964 0.012
#> GSM48658     2  0.4452   0.840155 0.000 0.808 0.192
#> GSM25624     1  0.1643   0.817867 0.956 0.000 0.044
#> GSM25625     3  0.4504   0.727920 0.196 0.000 0.804
#> GSM25626     3  0.3340   0.754223 0.120 0.000 0.880
#> GSM25627     3  0.4725   0.723468 0.060 0.088 0.852
#> GSM25628     3  0.1529   0.752574 0.040 0.000 0.960
#> GSM25629     3  0.2584   0.728518 0.008 0.064 0.928
#> GSM25630     3  0.4062   0.739939 0.164 0.000 0.836
#> GSM25631     2  0.7075   0.239796 0.020 0.496 0.484
#> GSM25632     3  0.4702   0.713565 0.212 0.000 0.788
#> GSM25633     1  0.1964   0.816762 0.944 0.000 0.056
#> GSM25634     1  0.1753   0.817744 0.952 0.000 0.048
#> GSM25635     1  0.1643   0.817302 0.956 0.000 0.044
#> GSM25656     3  0.1832   0.751692 0.036 0.008 0.956
#> GSM25657     1  0.4062   0.762045 0.836 0.000 0.164
#> GSM25658     3  0.6215   0.267636 0.428 0.000 0.572
#> GSM25659     1  0.6282   0.543217 0.664 0.012 0.324
#> GSM25660     1  0.1753   0.816802 0.952 0.000 0.048
#> GSM25661     1  0.1860   0.817912 0.948 0.000 0.052
#> GSM25662     2  0.3192   0.882850 0.000 0.888 0.112
#> GSM25663     2  0.4555   0.829980 0.000 0.800 0.200
#> GSM25680     2  0.3879   0.869367 0.000 0.848 0.152
#> GSM25681     2  0.4346   0.849256 0.000 0.816 0.184
#> GSM25682     2  0.1636   0.878290 0.020 0.964 0.016
#> GSM25683     2  0.1636   0.878290 0.020 0.964 0.016
#> GSM25684     2  0.3267   0.881141 0.000 0.884 0.116
#> GSM25685     2  0.3267   0.881787 0.000 0.884 0.116
#> GSM25686     2  0.1636   0.878290 0.020 0.964 0.016
#> GSM25687     2  0.1636   0.878290 0.020 0.964 0.016
#> GSM48664     1  0.1453   0.796790 0.968 0.024 0.008
#> GSM48665     1  0.0747   0.804384 0.984 0.016 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2   0.530   -0.45407 0.008 0.496 0.000 0.496
#> GSM25549     4   0.528    0.46636 0.008 0.460 0.000 0.532
#> GSM25550     4   0.611    0.47286 0.048 0.428 0.000 0.524
#> GSM25551     2   0.514    0.35539 0.000 0.680 0.024 0.296
#> GSM25570     4   0.527    0.48596 0.008 0.452 0.000 0.540
#> GSM25571     4   0.529    0.43575 0.008 0.480 0.000 0.512
#> GSM25358     1   0.979    0.05760 0.312 0.156 0.252 0.280
#> GSM25359     3   0.871   -0.11690 0.036 0.276 0.368 0.320
#> GSM25360     3   0.365    0.71644 0.108 0.000 0.852 0.040
#> GSM25361     3   0.629    0.59209 0.060 0.016 0.648 0.276
#> GSM25377     1   0.526    0.66565 0.752 0.020 0.036 0.192
#> GSM25378     1   0.623    0.62505 0.696 0.052 0.040 0.212
#> GSM25401     2   0.954    0.03059 0.160 0.368 0.168 0.304
#> GSM25402     1   0.967    0.22688 0.340 0.236 0.140 0.284
#> GSM25349     2   0.469    0.39443 0.012 0.756 0.012 0.220
#> GSM25350     2   0.452    0.37053 0.004 0.728 0.004 0.264
#> GSM25356     1   0.678    0.59594 0.644 0.088 0.028 0.240
#> GSM25357     2   0.563    0.33551 0.028 0.704 0.024 0.244
#> GSM25385     3   0.409    0.68082 0.140 0.000 0.820 0.040
#> GSM25386     3   0.182    0.72394 0.024 0.004 0.948 0.024
#> GSM25399     1   0.376    0.70536 0.848 0.004 0.032 0.116
#> GSM25400     1   0.528    0.68636 0.760 0.004 0.100 0.136
#> GSM48659     2   0.520    0.33311 0.000 0.636 0.016 0.348
#> GSM48660     2   0.302    0.50925 0.000 0.852 0.000 0.148
#> GSM25409     2   0.584    0.11526 0.020 0.592 0.012 0.376
#> GSM25410     3   0.290    0.70953 0.056 0.008 0.904 0.032
#> GSM25426     2   0.484    0.45554 0.000 0.764 0.052 0.184
#> GSM25427     1   0.562    0.64944 0.732 0.040 0.028 0.200
#> GSM25540     3   0.455    0.59910 0.000 0.012 0.732 0.256
#> GSM25541     3   0.568    0.58631 0.032 0.012 0.672 0.284
#> GSM25542     2   0.725    0.15935 0.000 0.536 0.272 0.192
#> GSM25543     2   0.801   -0.05394 0.008 0.388 0.376 0.228
#> GSM25479     1   0.359    0.71850 0.860 0.000 0.088 0.052
#> GSM25480     1   0.395    0.70102 0.840 0.000 0.096 0.064
#> GSM25481     1   0.728    0.55631 0.608 0.120 0.032 0.240
#> GSM25482     1   0.684    0.58353 0.640 0.116 0.020 0.224
#> GSM48654     2   0.472    0.39147 0.000 0.692 0.008 0.300
#> GSM48650     2   0.212    0.51433 0.000 0.924 0.008 0.068
#> GSM48651     2   0.425    0.47571 0.000 0.768 0.012 0.220
#> GSM48652     2   0.460    0.45572 0.000 0.736 0.016 0.248
#> GSM48653     2   0.474    0.43922 0.000 0.704 0.012 0.284
#> GSM48662     2   0.436    0.41142 0.000 0.708 0.000 0.292
#> GSM48663     2   0.324    0.47379 0.004 0.856 0.004 0.136
#> GSM25524     3   0.527    0.52205 0.288 0.000 0.680 0.032
#> GSM25525     1   0.529    0.59842 0.724 0.000 0.216 0.060
#> GSM25526     3   0.436    0.68494 0.136 0.000 0.808 0.056
#> GSM25527     1   0.540    0.57256 0.700 0.000 0.248 0.052
#> GSM25528     3   0.578   -0.00242 0.480 0.000 0.492 0.028
#> GSM25529     1   0.520    0.55829 0.708 0.000 0.252 0.040
#> GSM25530     3   0.566    0.28535 0.396 0.000 0.576 0.028
#> GSM25531     1   0.547    0.45286 0.644 0.000 0.324 0.032
#> GSM48661     2   0.670    0.21251 0.000 0.544 0.100 0.356
#> GSM25561     3   0.531    0.53600 0.280 0.000 0.684 0.036
#> GSM25562     1   0.556    0.65482 0.720 0.000 0.188 0.092
#> GSM25563     3   0.255    0.72697 0.060 0.000 0.912 0.028
#> GSM25564     1   0.975    0.00761 0.360 0.180 0.244 0.216
#> GSM25565     2   0.458    0.48228 0.000 0.768 0.032 0.200
#> GSM25566     2   0.398    0.42899 0.000 0.776 0.004 0.220
#> GSM25568     4   0.960    0.10932 0.124 0.260 0.276 0.340
#> GSM25569     2   0.492    0.28514 0.000 0.628 0.004 0.368
#> GSM25552     4   0.614    0.53150 0.052 0.404 0.000 0.544
#> GSM25553     4   0.816    0.40128 0.220 0.228 0.036 0.516
#> GSM25578     1   0.367    0.70726 0.852 0.000 0.104 0.044
#> GSM25579     1   0.608    0.58501 0.684 0.000 0.164 0.152
#> GSM25580     1   0.289    0.72706 0.896 0.000 0.068 0.036
#> GSM25581     1   0.311    0.72046 0.884 0.000 0.080 0.036
#> GSM48655     2   0.259    0.48903 0.000 0.892 0.004 0.104
#> GSM48656     2   0.469    0.41160 0.004 0.704 0.004 0.288
#> GSM48657     2   0.156    0.51017 0.000 0.944 0.000 0.056
#> GSM48658     2   0.666   -0.02901 0.000 0.464 0.084 0.452
#> GSM25624     1   0.308    0.72665 0.888 0.000 0.064 0.048
#> GSM25625     3   0.376    0.70712 0.144 0.000 0.832 0.024
#> GSM25626     3   0.162    0.72605 0.028 0.000 0.952 0.020
#> GSM25627     3   0.733    0.41960 0.020 0.236 0.592 0.152
#> GSM25628     3   0.229    0.71954 0.004 0.012 0.924 0.060
#> GSM25629     3   0.640    0.52620 0.004 0.132 0.660 0.204
#> GSM25630     3   0.333    0.71013 0.112 0.000 0.864 0.024
#> GSM25631     4   0.772    0.42551 0.052 0.200 0.152 0.596
#> GSM25632     3   0.355    0.70226 0.136 0.000 0.844 0.020
#> GSM25633     1   0.329    0.72068 0.876 0.000 0.080 0.044
#> GSM25634     1   0.249    0.72807 0.912 0.000 0.068 0.020
#> GSM25635     1   0.250    0.72877 0.916 0.000 0.044 0.040
#> GSM25656     3   0.452    0.65468 0.004 0.060 0.808 0.128
#> GSM25657     1   0.444    0.62772 0.764 0.000 0.216 0.020
#> GSM25658     3   0.680    0.29943 0.348 0.004 0.552 0.096
#> GSM25659     1   0.694    0.44178 0.592 0.004 0.260 0.144
#> GSM25660     1   0.332    0.71733 0.876 0.000 0.068 0.056
#> GSM25661     1   0.262    0.72342 0.908 0.000 0.064 0.028
#> GSM25662     2   0.486    0.43556 0.000 0.700 0.016 0.284
#> GSM25663     2   0.661   -0.01192 0.000 0.516 0.084 0.400
#> GSM25680     4   0.545    0.42063 0.000 0.360 0.024 0.616
#> GSM25681     4   0.646    0.51501 0.020 0.276 0.064 0.640
#> GSM25682     2   0.310    0.43372 0.000 0.856 0.004 0.140
#> GSM25683     2   0.289    0.45293 0.000 0.872 0.004 0.124
#> GSM25684     2   0.500    0.35584 0.000 0.660 0.012 0.328
#> GSM25685     2   0.555    0.42924 0.000 0.672 0.048 0.280
#> GSM25686     2   0.305    0.43697 0.000 0.860 0.004 0.136
#> GSM25687     2   0.294    0.44361 0.000 0.868 0.004 0.128
#> GSM48664     1   0.373    0.70211 0.848 0.004 0.028 0.120
#> GSM48665     1   0.324    0.71744 0.880 0.004 0.028 0.088

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     5   0.354    0.62813 0.004 0.176 0.000 0.016 0.804
#> GSM25549     5   0.442    0.64003 0.008 0.168 0.016 0.032 0.776
#> GSM25550     5   0.464    0.62312 0.048 0.132 0.000 0.044 0.776
#> GSM25551     5   0.715   -0.09098 0.000 0.372 0.032 0.180 0.416
#> GSM25570     5   0.293    0.64747 0.004 0.128 0.000 0.012 0.856
#> GSM25571     5   0.342    0.63090 0.004 0.164 0.000 0.016 0.816
#> GSM25358     4   0.878    0.38078 0.176 0.056 0.228 0.428 0.112
#> GSM25359     3   0.865   -0.06496 0.016 0.116 0.304 0.272 0.292
#> GSM25360     3   0.504    0.61594 0.172 0.000 0.736 0.044 0.048
#> GSM25361     3   0.778    0.45241 0.136 0.048 0.504 0.044 0.268
#> GSM25377     4   0.516    0.32979 0.468 0.012 0.008 0.504 0.008
#> GSM25378     4   0.633    0.55258 0.352 0.016 0.036 0.552 0.044
#> GSM25401     4   0.681    0.41289 0.060 0.104 0.140 0.652 0.044
#> GSM25402     4   0.655    0.53697 0.104 0.080 0.116 0.672 0.028
#> GSM25349     2   0.686    0.36496 0.008 0.504 0.008 0.268 0.212
#> GSM25350     2   0.668    0.31054 0.004 0.476 0.000 0.244 0.276
#> GSM25356     4   0.620    0.57862 0.336 0.028 0.016 0.572 0.048
#> GSM25357     2   0.706    0.24762 0.004 0.400 0.012 0.376 0.208
#> GSM25385     3   0.488    0.60739 0.152 0.000 0.736 0.104 0.008
#> GSM25386     3   0.305    0.63840 0.036 0.000 0.876 0.072 0.016
#> GSM25399     1   0.479    0.02036 0.584 0.000 0.024 0.392 0.000
#> GSM25400     1   0.601   -0.23234 0.488 0.000 0.064 0.428 0.020
#> GSM48659     2   0.470    0.39726 0.000 0.720 0.008 0.048 0.224
#> GSM48660     2   0.427    0.52759 0.000 0.784 0.004 0.120 0.092
#> GSM25409     5   0.698    0.00749 0.012 0.348 0.004 0.196 0.440
#> GSM25410     3   0.299    0.62512 0.024 0.000 0.872 0.092 0.012
#> GSM25426     2   0.752    0.35093 0.000 0.468 0.072 0.280 0.180
#> GSM25427     4   0.550    0.45631 0.428 0.004 0.004 0.520 0.044
#> GSM25540     3   0.644    0.51780 0.008 0.084 0.640 0.068 0.200
#> GSM25541     3   0.744    0.51308 0.076 0.056 0.572 0.068 0.228
#> GSM25542     2   0.810    0.18817 0.000 0.420 0.252 0.172 0.156
#> GSM25543     3   0.824   -0.08103 0.000 0.336 0.336 0.160 0.168
#> GSM25479     1   0.384    0.63016 0.832 0.000 0.036 0.096 0.036
#> GSM25480     1   0.469    0.60673 0.776 0.000 0.032 0.112 0.080
#> GSM25481     4   0.638    0.61029 0.272 0.064 0.008 0.604 0.052
#> GSM25482     4   0.628    0.59721 0.324 0.036 0.004 0.568 0.068
#> GSM48654     2   0.303    0.48630 0.000 0.852 0.004 0.016 0.128
#> GSM48650     2   0.450    0.52381 0.000 0.752 0.004 0.176 0.068
#> GSM48651     2   0.277    0.53077 0.000 0.884 0.004 0.036 0.076
#> GSM48652     2   0.230    0.52199 0.000 0.904 0.000 0.024 0.072
#> GSM48653     2   0.362    0.49210 0.000 0.836 0.020 0.032 0.112
#> GSM48662     2   0.422    0.50372 0.000 0.780 0.008 0.052 0.160
#> GSM48663     2   0.532    0.47539 0.000 0.660 0.000 0.228 0.112
#> GSM25524     3   0.547    0.22700 0.428 0.000 0.516 0.052 0.004
#> GSM25525     1   0.424    0.60108 0.792 0.000 0.144 0.040 0.024
#> GSM25526     3   0.673    0.54815 0.188 0.012 0.600 0.168 0.032
#> GSM25527     1   0.528    0.58608 0.724 0.000 0.140 0.108 0.028
#> GSM25528     1   0.528    0.23831 0.584 0.000 0.364 0.048 0.004
#> GSM25529     1   0.391    0.60794 0.812 0.000 0.136 0.032 0.020
#> GSM25530     3   0.579    0.01424 0.460 0.000 0.460 0.076 0.004
#> GSM25531     1   0.538    0.53928 0.672 0.000 0.208 0.116 0.004
#> GSM48661     2   0.597    0.35457 0.000 0.656 0.092 0.044 0.208
#> GSM25561     3   0.625    0.30813 0.372 0.004 0.528 0.072 0.024
#> GSM25562     1   0.625    0.45681 0.596 0.004 0.176 0.216 0.008
#> GSM25563     3   0.434    0.64094 0.104 0.004 0.800 0.076 0.016
#> GSM25564     1   0.970   -0.15614 0.288 0.256 0.128 0.180 0.148
#> GSM25565     2   0.562    0.47656 0.000 0.680 0.024 0.104 0.192
#> GSM25566     2   0.671    0.23422 0.000 0.468 0.020 0.144 0.368
#> GSM25568     2   0.907    0.07670 0.052 0.388 0.188 0.200 0.172
#> GSM25569     2   0.512    0.39290 0.000 0.668 0.004 0.068 0.260
#> GSM25552     5   0.489    0.62866 0.052 0.156 0.004 0.032 0.756
#> GSM25553     5   0.599    0.49827 0.160 0.080 0.012 0.056 0.692
#> GSM25578     1   0.277    0.64042 0.892 0.000 0.052 0.044 0.012
#> GSM25579     1   0.606    0.47079 0.680 0.004 0.084 0.072 0.160
#> GSM25580     1   0.283    0.60092 0.864 0.000 0.012 0.120 0.004
#> GSM25581     1   0.230    0.63211 0.908 0.000 0.020 0.068 0.004
#> GSM48655     2   0.543    0.46001 0.000 0.648 0.000 0.120 0.232
#> GSM48656     2   0.456    0.46131 0.000 0.736 0.004 0.056 0.204
#> GSM48657     2   0.477    0.51228 0.000 0.732 0.000 0.136 0.132
#> GSM48658     2   0.610    0.17618 0.000 0.556 0.060 0.036 0.348
#> GSM25624     1   0.503    0.41035 0.672 0.000 0.060 0.264 0.004
#> GSM25625     3   0.504    0.61242 0.152 0.008 0.732 0.104 0.004
#> GSM25626     3   0.201    0.64269 0.020 0.008 0.932 0.036 0.004
#> GSM25627     3   0.799    0.40352 0.036 0.204 0.488 0.216 0.056
#> GSM25628     3   0.250    0.63649 0.004 0.040 0.912 0.024 0.020
#> GSM25629     3   0.781    0.40120 0.008 0.188 0.508 0.176 0.120
#> GSM25630     3   0.420    0.61599 0.176 0.000 0.776 0.036 0.012
#> GSM25631     5   0.788    0.35830 0.064 0.168 0.176 0.052 0.540
#> GSM25632     3   0.454    0.57426 0.228 0.000 0.724 0.044 0.004
#> GSM25633     1   0.271    0.63657 0.884 0.000 0.044 0.072 0.000
#> GSM25634     1   0.375    0.59585 0.820 0.000 0.036 0.132 0.012
#> GSM25635     1   0.365    0.58814 0.828 0.000 0.020 0.128 0.024
#> GSM25656     3   0.493    0.60931 0.004 0.072 0.776 0.072 0.076
#> GSM25657     1   0.505    0.60231 0.720 0.000 0.160 0.112 0.008
#> GSM25658     3   0.764    0.22246 0.308 0.016 0.404 0.248 0.024
#> GSM25659     1   0.796    0.38989 0.548 0.044 0.136 0.136 0.136
#> GSM25660     1   0.308    0.62224 0.876 0.000 0.024 0.072 0.028
#> GSM25661     1   0.276    0.61691 0.880 0.000 0.024 0.092 0.004
#> GSM25662     2   0.605    0.36967 0.000 0.620 0.036 0.084 0.260
#> GSM25663     5   0.653    0.22597 0.000 0.360 0.076 0.048 0.516
#> GSM25680     5   0.484    0.57331 0.000 0.220 0.024 0.036 0.720
#> GSM25681     5   0.531    0.59546 0.016 0.144 0.056 0.040 0.744
#> GSM25682     2   0.614    0.32319 0.000 0.528 0.000 0.152 0.320
#> GSM25683     2   0.635    0.33750 0.000 0.520 0.004 0.164 0.312
#> GSM25684     2   0.552    0.30550 0.000 0.596 0.008 0.064 0.332
#> GSM25685     2   0.655    0.35296 0.000 0.600 0.052 0.124 0.224
#> GSM25686     2   0.615    0.32575 0.000 0.524 0.000 0.152 0.324
#> GSM25687     2   0.613    0.33703 0.000 0.532 0.000 0.152 0.316
#> GSM48664     1   0.435    0.11764 0.624 0.000 0.008 0.368 0.000
#> GSM48665     1   0.406    0.32000 0.708 0.000 0.000 0.280 0.012

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM25548     5   0.309    0.45553 0.000 0.120 0.000 0.000 0.832 0.048
#> GSM25549     5   0.379    0.46150 0.004 0.132 0.008 0.008 0.804 0.044
#> GSM25550     5   0.411    0.44192 0.020 0.032 0.008 0.056 0.816 0.068
#> GSM25551     5   0.699   -0.14051 0.000 0.236 0.020 0.028 0.384 0.332
#> GSM25570     5   0.274    0.46991 0.000 0.084 0.000 0.012 0.872 0.032
#> GSM25571     5   0.331    0.45844 0.000 0.128 0.000 0.004 0.820 0.048
#> GSM25358     4   0.846    0.09476 0.048 0.032 0.260 0.360 0.088 0.212
#> GSM25359     6   0.844   -0.09351 0.008 0.064 0.284 0.136 0.172 0.336
#> GSM25360     3   0.566    0.56173 0.192 0.012 0.676 0.032 0.028 0.060
#> GSM25361     3   0.862    0.35731 0.156 0.044 0.360 0.036 0.260 0.144
#> GSM25377     4   0.426    0.50988 0.204 0.004 0.012 0.740 0.004 0.036
#> GSM25378     4   0.488    0.56310 0.144 0.000 0.020 0.728 0.016 0.092
#> GSM25401     4   0.779    0.14231 0.028 0.120 0.104 0.416 0.020 0.312
#> GSM25402     4   0.692    0.41931 0.056 0.068 0.068 0.552 0.008 0.248
#> GSM25349     6   0.744    0.18752 0.004 0.336 0.008 0.132 0.136 0.384
#> GSM25350     6   0.738    0.19171 0.004 0.328 0.004 0.088 0.216 0.360
#> GSM25356     4   0.543    0.57195 0.144 0.008 0.008 0.696 0.040 0.104
#> GSM25357     6   0.769    0.32380 0.000 0.212 0.012 0.164 0.220 0.392
#> GSM25385     3   0.523    0.55962 0.120 0.000 0.704 0.128 0.012 0.036
#> GSM25386     3   0.278    0.63478 0.036 0.000 0.884 0.032 0.004 0.044
#> GSM25399     4   0.492    0.14659 0.392 0.000 0.032 0.556 0.000 0.020
#> GSM25400     4   0.557    0.35972 0.312 0.000 0.040 0.584 0.004 0.060
#> GSM48659     2   0.367    0.43188 0.000 0.764 0.008 0.000 0.204 0.024
#> GSM48660     2   0.556    0.24428 0.000 0.628 0.000 0.044 0.100 0.228
#> GSM25409     5   0.797   -0.21449 0.004 0.248 0.016 0.140 0.320 0.272
#> GSM25410     3   0.324    0.63126 0.032 0.000 0.848 0.080 0.000 0.040
#> GSM25426     6   0.693    0.10377 0.000 0.372 0.032 0.040 0.136 0.420
#> GSM25427     4   0.483    0.54578 0.188 0.008 0.004 0.712 0.012 0.076
#> GSM25540     3   0.737    0.51526 0.028 0.068 0.528 0.024 0.168 0.184
#> GSM25541     3   0.850    0.49306 0.104 0.084 0.440 0.036 0.160 0.176
#> GSM25542     2   0.819    0.02474 0.000 0.380 0.184 0.056 0.164 0.216
#> GSM25543     3   0.907   -0.17749 0.024 0.228 0.288 0.092 0.164 0.204
#> GSM25479     1   0.448    0.56753 0.760 0.000 0.024 0.152 0.040 0.024
#> GSM25480     1   0.501    0.55367 0.740 0.000 0.032 0.108 0.088 0.032
#> GSM25481     4   0.525    0.57777 0.076 0.028 0.004 0.716 0.028 0.148
#> GSM25482     4   0.507    0.57787 0.080 0.012 0.000 0.720 0.044 0.144
#> GSM48654     2   0.269    0.47209 0.000 0.868 0.008 0.000 0.100 0.024
#> GSM48650     2   0.558   -0.01192 0.000 0.556 0.000 0.028 0.084 0.332
#> GSM48651     2   0.386    0.42001 0.000 0.788 0.004 0.004 0.076 0.128
#> GSM48652     2   0.307    0.45207 0.000 0.856 0.008 0.004 0.052 0.080
#> GSM48653     2   0.296    0.46181 0.000 0.860 0.012 0.000 0.048 0.080
#> GSM48662     2   0.539    0.40210 0.004 0.672 0.004 0.024 0.156 0.140
#> GSM48663     2   0.661   -0.07014 0.000 0.468 0.000 0.120 0.084 0.328
#> GSM25524     1   0.587    0.10492 0.508 0.000 0.388 0.040 0.016 0.048
#> GSM25525     1   0.352    0.59082 0.844 0.000 0.056 0.060 0.020 0.020
#> GSM25526     3   0.729    0.35171 0.256 0.024 0.452 0.072 0.000 0.196
#> GSM25527     1   0.543    0.55723 0.692 0.000 0.096 0.144 0.012 0.056
#> GSM25528     1   0.493    0.42768 0.668 0.000 0.260 0.028 0.012 0.032
#> GSM25529     1   0.333    0.58381 0.852 0.000 0.076 0.020 0.036 0.016
#> GSM25530     1   0.605    0.40211 0.568 0.000 0.280 0.084 0.004 0.064
#> GSM25531     1   0.479    0.57445 0.744 0.000 0.084 0.120 0.008 0.044
#> GSM48661     2   0.592    0.37447 0.004 0.652 0.096 0.004 0.112 0.132
#> GSM25561     3   0.702    0.21909 0.312 0.008 0.472 0.132 0.016 0.060
#> GSM25562     1   0.721    0.31786 0.488 0.004 0.144 0.256 0.020 0.088
#> GSM25563     3   0.482    0.59688 0.156 0.000 0.724 0.032 0.004 0.084
#> GSM25564     1   0.966    0.00067 0.272 0.196 0.096 0.164 0.104 0.168
#> GSM25565     2   0.693   -0.01390 0.000 0.460 0.020 0.040 0.196 0.284
#> GSM25566     5   0.654   -0.25235 0.000 0.328 0.000 0.020 0.356 0.296
#> GSM25568     2   0.908    0.07354 0.052 0.356 0.184 0.172 0.080 0.156
#> GSM25569     2   0.596    0.34765 0.000 0.612 0.004 0.048 0.168 0.168
#> GSM25552     5   0.421    0.45725 0.024 0.084 0.008 0.016 0.804 0.064
#> GSM25553     5   0.680    0.34101 0.116 0.060 0.036 0.072 0.636 0.080
#> GSM25578     1   0.351    0.57294 0.808 0.000 0.012 0.152 0.008 0.020
#> GSM25579     1   0.664    0.45663 0.612 0.004 0.052 0.124 0.144 0.064
#> GSM25580     1   0.401    0.50612 0.704 0.000 0.016 0.268 0.000 0.012
#> GSM25581     1   0.427    0.54250 0.732 0.000 0.028 0.216 0.008 0.016
#> GSM48655     2   0.644   -0.12946 0.000 0.416 0.000 0.020 0.256 0.308
#> GSM48656     2   0.463    0.43211 0.000 0.716 0.004 0.004 0.144 0.132
#> GSM48657     2   0.594    0.02137 0.000 0.540 0.000 0.024 0.148 0.288
#> GSM48658     2   0.618    0.30446 0.000 0.592 0.052 0.008 0.200 0.148
#> GSM25624     1   0.635    0.07281 0.444 0.000 0.064 0.412 0.012 0.068
#> GSM25625     3   0.628    0.49895 0.168 0.008 0.616 0.104 0.004 0.100
#> GSM25626     3   0.265    0.64236 0.020 0.008 0.892 0.032 0.000 0.048
#> GSM25627     3   0.824    0.30967 0.044 0.164 0.376 0.088 0.028 0.300
#> GSM25628     3   0.361    0.64372 0.036 0.016 0.836 0.008 0.012 0.092
#> GSM25629     3   0.771    0.31907 0.016 0.224 0.388 0.028 0.052 0.292
#> GSM25630     3   0.421    0.60281 0.156 0.000 0.768 0.032 0.004 0.040
#> GSM25631     5   0.824    0.19438 0.096 0.204 0.100 0.012 0.440 0.148
#> GSM25632     3   0.427    0.58720 0.148 0.000 0.768 0.040 0.004 0.040
#> GSM25633     1   0.498    0.54108 0.676 0.000 0.052 0.236 0.004 0.032
#> GSM25634     1   0.541    0.40091 0.584 0.000 0.056 0.320 0.000 0.040
#> GSM25635     1   0.521    0.41893 0.612 0.000 0.040 0.308 0.004 0.036
#> GSM25656     3   0.645    0.59004 0.032 0.104 0.632 0.028 0.036 0.168
#> GSM25657     1   0.521    0.54639 0.684 0.000 0.076 0.196 0.008 0.036
#> GSM25658     1   0.824   -0.11106 0.304 0.040 0.276 0.176 0.000 0.204
#> GSM25659     1   0.793    0.41739 0.532 0.048 0.124 0.120 0.076 0.100
#> GSM25660     1   0.477    0.55649 0.732 0.000 0.032 0.176 0.032 0.028
#> GSM25661     1   0.415    0.51436 0.720 0.000 0.012 0.240 0.004 0.024
#> GSM25662     2   0.587    0.23313 0.000 0.544 0.000 0.012 0.236 0.208
#> GSM25663     5   0.753    0.08912 0.012 0.308 0.052 0.024 0.400 0.204
#> GSM25680     5   0.549    0.36415 0.000 0.236 0.036 0.004 0.636 0.088
#> GSM25681     5   0.571    0.41580 0.020 0.112 0.072 0.012 0.700 0.084
#> GSM25682     5   0.636   -0.24778 0.000 0.272 0.000 0.012 0.388 0.328
#> GSM25683     6   0.660    0.13656 0.000 0.300 0.004 0.016 0.340 0.340
#> GSM25684     2   0.533    0.28010 0.000 0.600 0.004 0.004 0.276 0.116
#> GSM25685     2   0.590    0.22931 0.000 0.596 0.016 0.016 0.144 0.228
#> GSM25686     5   0.654   -0.29547 0.000 0.288 0.000 0.020 0.352 0.340
#> GSM25687     5   0.672   -0.30520 0.000 0.296 0.000 0.032 0.344 0.328
#> GSM48664     4   0.469    0.12758 0.392 0.000 0.020 0.572 0.004 0.012
#> GSM48665     1   0.439    0.18303 0.532 0.000 0.000 0.444 0.000 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-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 genotype/variation(p) k
#> SD:skmeans 95              1.56e-05 2
#> SD:skmeans 88              1.77e-05 3
#> SD:skmeans 50              3.54e-05 4
#> SD:skmeans 48              5.90e-07 5
#> SD:skmeans 30              5.55e-02 6

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


SD: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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.251           0.748       0.848         0.4586 0.553   0.553
#> 3 3 0.383           0.673       0.801         0.4277 0.728   0.529
#> 4 4 0.473           0.574       0.764         0.1201 0.848   0.589
#> 5 5 0.492           0.357       0.672         0.0417 0.896   0.668
#> 6 6 0.555           0.446       0.738         0.0239 0.858   0.538

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
#> GSM25548     2  0.0000      0.837 0.000 1.000
#> GSM25549     2  0.0000      0.837 0.000 1.000
#> GSM25550     2  0.0376      0.836 0.004 0.996
#> GSM25551     2  0.4161      0.822 0.084 0.916
#> GSM25570     2  0.0000      0.837 0.000 1.000
#> GSM25571     2  0.0376      0.838 0.004 0.996
#> GSM25358     2  0.5178      0.836 0.116 0.884
#> GSM25359     2  0.6712      0.776 0.176 0.824
#> GSM25360     1  0.9129      0.573 0.672 0.328
#> GSM25361     2  0.6623      0.814 0.172 0.828
#> GSM25377     2  0.8763      0.490 0.296 0.704
#> GSM25378     2  0.6973      0.684 0.188 0.812
#> GSM25401     1  0.5294      0.803 0.880 0.120
#> GSM25402     2  0.9491      0.510 0.368 0.632
#> GSM25349     2  0.3274      0.849 0.060 0.940
#> GSM25350     2  0.2043      0.848 0.032 0.968
#> GSM25356     2  0.4562      0.779 0.096 0.904
#> GSM25357     2  0.1633      0.846 0.024 0.976
#> GSM25385     1  0.6438      0.804 0.836 0.164
#> GSM25386     1  0.7674      0.677 0.776 0.224
#> GSM25399     1  0.3274      0.823 0.940 0.060
#> GSM25400     1  0.7219      0.766 0.800 0.200
#> GSM48659     2  0.5519      0.832 0.128 0.872
#> GSM48660     2  0.5059      0.838 0.112 0.888
#> GSM25409     2  0.1414      0.845 0.020 0.980
#> GSM25410     1  0.9044      0.592 0.680 0.320
#> GSM25426     2  0.9866      0.360 0.432 0.568
#> GSM25427     2  0.1843      0.826 0.028 0.972
#> GSM25540     2  0.9044      0.644 0.320 0.680
#> GSM25541     2  0.9209      0.608 0.336 0.664
#> GSM25542     2  0.5178      0.841 0.116 0.884
#> GSM25543     2  0.5842      0.831 0.140 0.860
#> GSM25479     2  0.9661      0.204 0.392 0.608
#> GSM25480     2  0.8327      0.576 0.264 0.736
#> GSM25481     2  0.1414      0.838 0.020 0.980
#> GSM25482     2  0.1414      0.831 0.020 0.980
#> GSM48654     2  0.4431      0.844 0.092 0.908
#> GSM48650     2  0.3733      0.848 0.072 0.928
#> GSM48651     2  0.5178      0.835 0.116 0.884
#> GSM48652     2  0.2423      0.848 0.040 0.960
#> GSM48653     2  0.8144      0.734 0.252 0.748
#> GSM48662     2  0.2603      0.849 0.044 0.956
#> GSM48663     2  0.4562      0.843 0.096 0.904
#> GSM25524     1  0.1414      0.818 0.980 0.020
#> GSM25525     1  0.8861      0.680 0.696 0.304
#> GSM25526     1  0.2236      0.820 0.964 0.036
#> GSM25527     1  0.7219      0.782 0.800 0.200
#> GSM25528     1  0.2603      0.822 0.956 0.044
#> GSM25529     1  0.5059      0.792 0.888 0.112
#> GSM25530     1  0.4690      0.802 0.900 0.100
#> GSM25531     1  0.0938      0.817 0.988 0.012
#> GSM48661     2  0.8016      0.743 0.244 0.756
#> GSM25561     1  0.8327      0.654 0.736 0.264
#> GSM25562     1  0.9358      0.428 0.648 0.352
#> GSM25563     1  0.6973      0.699 0.812 0.188
#> GSM25564     2  0.6438      0.820 0.164 0.836
#> GSM25565     2  0.5408      0.834 0.124 0.876
#> GSM25566     2  0.0938      0.837 0.012 0.988
#> GSM25568     2  0.3274      0.850 0.060 0.940
#> GSM25569     2  0.0938      0.841 0.012 0.988
#> GSM25552     2  0.0938      0.840 0.012 0.988
#> GSM25553     2  0.1184      0.842 0.016 0.984
#> GSM25578     2  0.8555      0.538 0.280 0.720
#> GSM25579     2  0.4431      0.794 0.092 0.908
#> GSM25580     1  0.7674      0.748 0.776 0.224
#> GSM25581     1  0.7815      0.750 0.768 0.232
#> GSM48655     2  0.2603      0.848 0.044 0.956
#> GSM48656     2  0.5629      0.832 0.132 0.868
#> GSM48657     2  0.4298      0.845 0.088 0.912
#> GSM48658     2  0.7219      0.777 0.200 0.800
#> GSM25624     1  0.9988      0.294 0.520 0.480
#> GSM25625     1  0.2043      0.820 0.968 0.032
#> GSM25626     1  0.1843      0.819 0.972 0.028
#> GSM25627     1  0.2236      0.820 0.964 0.036
#> GSM25628     1  0.5946      0.749 0.856 0.144
#> GSM25629     1  0.3879      0.817 0.924 0.076
#> GSM25630     1  0.2236      0.821 0.964 0.036
#> GSM25631     2  0.2043      0.837 0.032 0.968
#> GSM25632     1  0.1184      0.818 0.984 0.016
#> GSM25633     1  0.8713      0.706 0.708 0.292
#> GSM25634     1  0.4815      0.819 0.896 0.104
#> GSM25635     2  0.8955      0.464 0.312 0.688
#> GSM25656     2  0.9850      0.426 0.428 0.572
#> GSM25657     1  0.5629      0.803 0.868 0.132
#> GSM25658     1  0.1633      0.820 0.976 0.024
#> GSM25659     2  0.8763      0.693 0.296 0.704
#> GSM25660     2  0.8713      0.497 0.292 0.708
#> GSM25661     1  1.0000      0.249 0.504 0.496
#> GSM25662     2  0.5519      0.833 0.128 0.872
#> GSM25663     2  0.5519      0.833 0.128 0.872
#> GSM25680     2  0.0000      0.837 0.000 1.000
#> GSM25681     2  0.0000      0.837 0.000 1.000
#> GSM25682     2  0.4022      0.847 0.080 0.920
#> GSM25683     2  0.5178      0.836 0.116 0.884
#> GSM25684     2  0.5629      0.832 0.132 0.868
#> GSM25685     2  0.9522      0.553 0.372 0.628
#> GSM25686     2  0.4562      0.842 0.096 0.904
#> GSM25687     2  0.2603      0.849 0.044 0.956
#> GSM48664     2  0.9323      0.595 0.348 0.652
#> GSM48665     2  0.7745      0.624 0.228 0.772

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.0237     0.7962 0.000 0.996 0.004
#> GSM25549     2  0.0237     0.7962 0.000 0.996 0.004
#> GSM25550     2  0.0424     0.7959 0.000 0.992 0.008
#> GSM25551     2  0.3009     0.7734 0.028 0.920 0.052
#> GSM25570     2  0.0237     0.7962 0.000 0.996 0.004
#> GSM25571     2  0.0424     0.7958 0.000 0.992 0.008
#> GSM25358     3  0.4465     0.7746 0.004 0.176 0.820
#> GSM25359     2  0.6294     0.5752 0.020 0.692 0.288
#> GSM25360     1  0.9248     0.1974 0.516 0.188 0.296
#> GSM25361     3  0.6988     0.6367 0.036 0.320 0.644
#> GSM25377     2  0.7214     0.4884 0.324 0.632 0.044
#> GSM25378     2  0.3995     0.7468 0.116 0.868 0.016
#> GSM25401     1  0.7710     0.5750 0.576 0.056 0.368
#> GSM25402     3  0.5180     0.7776 0.032 0.156 0.812
#> GSM25349     2  0.5363     0.5544 0.000 0.724 0.276
#> GSM25350     2  0.3619     0.7404 0.000 0.864 0.136
#> GSM25356     2  0.1315     0.7982 0.008 0.972 0.020
#> GSM25357     2  0.3551     0.7276 0.000 0.868 0.132
#> GSM25385     1  0.2998     0.8188 0.916 0.068 0.016
#> GSM25386     3  0.6452     0.4328 0.264 0.032 0.704
#> GSM25399     1  0.1525     0.8114 0.964 0.004 0.032
#> GSM25400     1  0.6295     0.6490 0.728 0.036 0.236
#> GSM48659     3  0.4452     0.7705 0.000 0.192 0.808
#> GSM48660     3  0.5363     0.7297 0.000 0.276 0.724
#> GSM25409     2  0.2066     0.7857 0.000 0.940 0.060
#> GSM25410     1  0.8915     0.4410 0.572 0.216 0.212
#> GSM25426     3  0.3213     0.7286 0.028 0.060 0.912
#> GSM25427     2  0.2711     0.7586 0.088 0.912 0.000
#> GSM25540     3  0.6192     0.6588 0.060 0.176 0.764
#> GSM25541     3  0.7814     0.5285 0.104 0.244 0.652
#> GSM25542     3  0.5138     0.7329 0.000 0.252 0.748
#> GSM25543     3  0.5810     0.6345 0.000 0.336 0.664
#> GSM25479     2  0.6819     0.0431 0.476 0.512 0.012
#> GSM25480     2  0.2527     0.7867 0.044 0.936 0.020
#> GSM25481     2  0.2804     0.7896 0.016 0.924 0.060
#> GSM25482     2  0.1751     0.7941 0.028 0.960 0.012
#> GSM48654     3  0.4887     0.7583 0.000 0.228 0.772
#> GSM48650     3  0.5835     0.6666 0.000 0.340 0.660
#> GSM48651     3  0.4062     0.7729 0.000 0.164 0.836
#> GSM48652     2  0.5465     0.4955 0.000 0.712 0.288
#> GSM48653     3  0.2063     0.7558 0.008 0.044 0.948
#> GSM48662     2  0.4974     0.6004 0.000 0.764 0.236
#> GSM48663     3  0.4931     0.7569 0.000 0.232 0.768
#> GSM25524     1  0.4235     0.8031 0.824 0.000 0.176
#> GSM25525     1  0.5223     0.7591 0.800 0.176 0.024
#> GSM25526     1  0.5008     0.7961 0.804 0.016 0.180
#> GSM25527     1  0.4551     0.7872 0.844 0.132 0.024
#> GSM25528     1  0.1765     0.8211 0.956 0.004 0.040
#> GSM25529     1  0.2056     0.8211 0.952 0.024 0.024
#> GSM25530     1  0.2446     0.8245 0.936 0.012 0.052
#> GSM25531     1  0.2066     0.8215 0.940 0.000 0.060
#> GSM48661     3  0.1711     0.7480 0.008 0.032 0.960
#> GSM25561     1  0.6757     0.6608 0.736 0.180 0.084
#> GSM25562     3  0.8352     0.1183 0.332 0.100 0.568
#> GSM25563     3  0.3412     0.6527 0.124 0.000 0.876
#> GSM25564     3  0.6682     0.1575 0.008 0.488 0.504
#> GSM25565     3  0.4654     0.7652 0.000 0.208 0.792
#> GSM25566     2  0.0983     0.7948 0.004 0.980 0.016
#> GSM25568     2  0.5621     0.4740 0.000 0.692 0.308
#> GSM25569     2  0.1529     0.7942 0.000 0.960 0.040
#> GSM25552     2  0.1860     0.7877 0.000 0.948 0.052
#> GSM25553     2  0.2356     0.7825 0.000 0.928 0.072
#> GSM25578     2  0.5698     0.6229 0.252 0.736 0.012
#> GSM25579     2  0.1877     0.7946 0.012 0.956 0.032
#> GSM25580     1  0.2173     0.8092 0.944 0.048 0.008
#> GSM25581     1  0.1643     0.8105 0.956 0.044 0.000
#> GSM48655     2  0.6309    -0.2445 0.000 0.504 0.496
#> GSM48656     3  0.4834     0.7697 0.004 0.204 0.792
#> GSM48657     3  0.5760     0.6836 0.000 0.328 0.672
#> GSM48658     3  0.4473     0.7666 0.008 0.164 0.828
#> GSM25624     1  0.5706     0.5087 0.680 0.320 0.000
#> GSM25625     1  0.4805     0.7983 0.812 0.012 0.176
#> GSM25626     1  0.4733     0.7943 0.800 0.004 0.196
#> GSM25627     1  0.5115     0.7936 0.796 0.016 0.188
#> GSM25628     3  0.5785     0.2579 0.332 0.000 0.668
#> GSM25629     1  0.6007     0.7866 0.768 0.048 0.184
#> GSM25630     1  0.3349     0.8239 0.888 0.004 0.108
#> GSM25631     2  0.2414     0.7901 0.020 0.940 0.040
#> GSM25632     1  0.4002     0.8080 0.840 0.000 0.160
#> GSM25633     1  0.3879     0.7507 0.848 0.152 0.000
#> GSM25634     1  0.1905     0.8157 0.956 0.016 0.028
#> GSM25635     2  0.7251     0.4698 0.348 0.612 0.040
#> GSM25656     3  0.1999     0.7180 0.036 0.012 0.952
#> GSM25657     1  0.4477     0.8165 0.864 0.068 0.068
#> GSM25658     1  0.4755     0.7962 0.808 0.008 0.184
#> GSM25659     3  0.7816     0.6323 0.084 0.288 0.628
#> GSM25660     2  0.6252     0.4740 0.344 0.648 0.008
#> GSM25661     1  0.5815     0.5167 0.692 0.304 0.004
#> GSM25662     3  0.3686     0.7737 0.000 0.140 0.860
#> GSM25663     3  0.3816     0.7722 0.000 0.148 0.852
#> GSM25680     2  0.0237     0.7962 0.000 0.996 0.004
#> GSM25681     2  0.0237     0.7962 0.000 0.996 0.004
#> GSM25682     2  0.5905     0.3274 0.000 0.648 0.352
#> GSM25683     3  0.3879     0.7723 0.000 0.152 0.848
#> GSM25684     3  0.4047     0.7736 0.004 0.148 0.848
#> GSM25685     3  0.0424     0.7274 0.008 0.000 0.992
#> GSM25686     3  0.5785     0.6638 0.000 0.332 0.668
#> GSM25687     2  0.5591     0.4481 0.000 0.696 0.304
#> GSM48664     3  0.9083     0.4021 0.320 0.160 0.520
#> GSM48665     2  0.6359     0.4659 0.364 0.628 0.008

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.0000   0.821028 0.000 1.000 0.000 0.000
#> GSM25549     2  0.0000   0.821028 0.000 1.000 0.000 0.000
#> GSM25550     2  0.0712   0.819621 0.004 0.984 0.004 0.008
#> GSM25551     2  0.4464   0.658825 0.004 0.760 0.224 0.012
#> GSM25570     2  0.0000   0.821028 0.000 1.000 0.000 0.000
#> GSM25571     2  0.0000   0.821028 0.000 1.000 0.000 0.000
#> GSM25358     4  0.2382   0.766400 0.004 0.080 0.004 0.912
#> GSM25359     2  0.7407   0.269563 0.004 0.496 0.344 0.156
#> GSM25360     4  0.7924   0.120145 0.016 0.176 0.356 0.452
#> GSM25361     4  0.7159   0.541035 0.004 0.272 0.160 0.564
#> GSM25377     1  0.3760   0.693690 0.828 0.156 0.012 0.004
#> GSM25378     2  0.4283   0.757336 0.068 0.836 0.084 0.012
#> GSM25401     3  0.6349   0.291979 0.028 0.024 0.564 0.384
#> GSM25402     4  0.2089   0.746764 0.012 0.020 0.028 0.940
#> GSM25349     2  0.5769   0.566742 0.056 0.652 0.000 0.292
#> GSM25350     2  0.4257   0.754874 0.048 0.812 0.000 0.140
#> GSM25356     2  0.2774   0.801147 0.044 0.908 0.004 0.044
#> GSM25357     2  0.4796   0.734228 0.064 0.788 0.004 0.144
#> GSM25385     3  0.6216  -0.005742 0.408 0.028 0.548 0.016
#> GSM25386     4  0.5391   0.373593 0.004 0.012 0.380 0.604
#> GSM25399     1  0.3893   0.681361 0.796 0.000 0.196 0.008
#> GSM25400     1  0.8829   0.064245 0.372 0.060 0.372 0.196
#> GSM48659     4  0.2831   0.765847 0.004 0.120 0.000 0.876
#> GSM48660     4  0.3401   0.753903 0.008 0.152 0.000 0.840
#> GSM25409     2  0.2310   0.809757 0.008 0.920 0.004 0.068
#> GSM25410     3  0.7921   0.092626 0.016 0.172 0.440 0.372
#> GSM25426     4  0.5976   0.214009 0.008 0.024 0.452 0.516
#> GSM25427     2  0.4679   0.340559 0.352 0.648 0.000 0.000
#> GSM25540     3  0.6817  -0.087505 0.000 0.100 0.492 0.408
#> GSM25541     3  0.7307   0.107971 0.004 0.160 0.532 0.304
#> GSM25542     4  0.3172   0.748094 0.000 0.160 0.000 0.840
#> GSM25543     4  0.4360   0.666230 0.008 0.248 0.000 0.744
#> GSM25479     2  0.8141  -0.090083 0.268 0.428 0.292 0.012
#> GSM25480     2  0.1151   0.818734 0.008 0.968 0.024 0.000
#> GSM25481     2  0.2142   0.818501 0.016 0.928 0.000 0.056
#> GSM25482     2  0.3876   0.776794 0.124 0.836 0.000 0.040
#> GSM48654     4  0.3024   0.756778 0.000 0.148 0.000 0.852
#> GSM48650     4  0.5144   0.692131 0.068 0.168 0.004 0.760
#> GSM48651     4  0.1302   0.763541 0.000 0.044 0.000 0.956
#> GSM48652     2  0.4746   0.551726 0.004 0.712 0.008 0.276
#> GSM48653     4  0.2088   0.739606 0.004 0.004 0.064 0.928
#> GSM48662     2  0.3873   0.643837 0.000 0.772 0.000 0.228
#> GSM48663     4  0.3471   0.744111 0.060 0.072 0.000 0.868
#> GSM25524     3  0.1624   0.616776 0.028 0.000 0.952 0.020
#> GSM25525     3  0.6964   0.257906 0.228 0.188 0.584 0.000
#> GSM25526     3  0.0707   0.616888 0.020 0.000 0.980 0.000
#> GSM25527     3  0.6610   0.391372 0.124 0.196 0.664 0.016
#> GSM25528     3  0.6028  -0.197559 0.476 0.004 0.488 0.032
#> GSM25529     1  0.5602   0.209903 0.508 0.020 0.472 0.000
#> GSM25530     3  0.4661   0.326570 0.284 0.004 0.708 0.004
#> GSM25531     1  0.5760   0.248895 0.524 0.000 0.448 0.028
#> GSM48661     4  0.2443   0.747313 0.000 0.024 0.060 0.916
#> GSM25561     1  0.4704   0.677728 0.764 0.028 0.204 0.004
#> GSM25562     3  0.5949   0.397485 0.004 0.068 0.668 0.260
#> GSM25563     4  0.4804   0.390526 0.000 0.000 0.384 0.616
#> GSM25564     4  0.5774   0.107129 0.000 0.464 0.028 0.508
#> GSM25565     4  0.2831   0.767407 0.000 0.120 0.004 0.876
#> GSM25566     2  0.2555   0.809421 0.032 0.920 0.008 0.040
#> GSM25568     2  0.5045   0.529784 0.004 0.680 0.012 0.304
#> GSM25569     2  0.1118   0.819780 0.000 0.964 0.000 0.036
#> GSM25552     2  0.0817   0.818027 0.000 0.976 0.000 0.024
#> GSM25553     2  0.1557   0.813606 0.000 0.944 0.000 0.056
#> GSM25578     1  0.5949   0.564469 0.644 0.288 0.068 0.000
#> GSM25579     2  0.1271   0.821073 0.008 0.968 0.012 0.012
#> GSM25580     1  0.2281   0.737111 0.904 0.000 0.096 0.000
#> GSM25581     1  0.2053   0.742330 0.924 0.004 0.072 0.000
#> GSM48655     4  0.5980   0.262538 0.044 0.396 0.000 0.560
#> GSM48656     4  0.3047   0.767086 0.000 0.116 0.012 0.872
#> GSM48657     4  0.5055   0.698240 0.068 0.160 0.004 0.768
#> GSM48658     4  0.4967   0.727980 0.004 0.104 0.108 0.784
#> GSM25624     1  0.7110   0.429204 0.564 0.236 0.200 0.000
#> GSM25625     3  0.0592   0.617254 0.016 0.000 0.984 0.000
#> GSM25626     3  0.1820   0.616893 0.020 0.000 0.944 0.036
#> GSM25627     3  0.0188   0.615788 0.000 0.000 0.996 0.004
#> GSM25628     3  0.4697   0.241095 0.000 0.000 0.644 0.356
#> GSM25629     3  0.0927   0.612273 0.008 0.016 0.976 0.000
#> GSM25630     3  0.6064   0.400281 0.220 0.000 0.672 0.108
#> GSM25631     2  0.0779   0.819631 0.004 0.980 0.000 0.016
#> GSM25632     3  0.1209   0.613671 0.032 0.000 0.964 0.004
#> GSM25633     1  0.2142   0.745566 0.928 0.016 0.056 0.000
#> GSM25634     1  0.2125   0.742523 0.920 0.004 0.076 0.000
#> GSM25635     1  0.2443   0.739335 0.916 0.060 0.024 0.000
#> GSM25656     4  0.5451   0.205223 0.004 0.008 0.464 0.524
#> GSM25657     3  0.5576  -0.000931 0.444 0.020 0.536 0.000
#> GSM25658     3  0.0707   0.616888 0.020 0.000 0.980 0.000
#> GSM25659     4  0.6028   0.644659 0.004 0.236 0.084 0.676
#> GSM25660     1  0.5520   0.679447 0.744 0.172 0.072 0.012
#> GSM25661     1  0.4514   0.729843 0.812 0.072 0.112 0.004
#> GSM25662     4  0.1296   0.757878 0.004 0.028 0.004 0.964
#> GSM25663     4  0.1557   0.760858 0.000 0.056 0.000 0.944
#> GSM25680     2  0.0188   0.821062 0.000 0.996 0.000 0.004
#> GSM25681     2  0.0000   0.821028 0.000 1.000 0.000 0.000
#> GSM25682     2  0.6576   0.255851 0.068 0.516 0.004 0.412
#> GSM25683     4  0.2088   0.737581 0.064 0.004 0.004 0.928
#> GSM25684     4  0.2156   0.759274 0.004 0.060 0.008 0.928
#> GSM25685     4  0.1978   0.737032 0.004 0.000 0.068 0.928
#> GSM25686     4  0.5540   0.636018 0.068 0.208 0.004 0.720
#> GSM25687     2  0.6343   0.455554 0.068 0.596 0.004 0.332
#> GSM48664     1  0.4535   0.661865 0.816 0.024 0.032 0.128
#> GSM48665     1  0.2494   0.743163 0.916 0.048 0.036 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
#> GSM25548     5  0.0000     0.7541 0.000 0.000 0.000 0.000 1.000
#> GSM25549     5  0.0000     0.7541 0.000 0.000 0.000 0.000 1.000
#> GSM25550     5  0.0404     0.7517 0.000 0.000 0.000 0.012 0.988
#> GSM25551     5  0.5314     0.4721 0.000 0.048 0.224 0.036 0.692
#> GSM25570     5  0.0000     0.7541 0.000 0.000 0.000 0.000 1.000
#> GSM25571     5  0.0000     0.7541 0.000 0.000 0.000 0.000 1.000
#> GSM25358     2  0.2166     0.6362 0.000 0.912 0.004 0.012 0.072
#> GSM25359     5  0.7176    -0.0226 0.000 0.176 0.352 0.036 0.436
#> GSM25360     2  0.7176     0.0726 0.340 0.468 0.056 0.000 0.136
#> GSM25361     2  0.6167     0.3216 0.004 0.576 0.140 0.004 0.276
#> GSM25377     1  0.6754     0.4755 0.472 0.000 0.388 0.048 0.092
#> GSM25378     5  0.3778     0.6589 0.124 0.000 0.024 0.028 0.824
#> GSM25401     1  0.7191    -0.3235 0.420 0.384 0.160 0.032 0.004
#> GSM25402     2  0.2830     0.6001 0.044 0.876 0.000 0.080 0.000
#> GSM25349     5  0.5873    -0.0159 0.000 0.112 0.000 0.348 0.540
#> GSM25350     5  0.4455     0.5601 0.000 0.068 0.000 0.188 0.744
#> GSM25356     5  0.3730     0.4515 0.000 0.000 0.000 0.288 0.712
#> GSM25357     5  0.5143     0.0746 0.000 0.048 0.000 0.368 0.584
#> GSM25385     1  0.4685     0.2864 0.724 0.012 0.232 0.024 0.008
#> GSM25386     2  0.5981     0.2199 0.180 0.628 0.180 0.012 0.000
#> GSM25399     1  0.6385     0.4221 0.556 0.008 0.200 0.236 0.000
#> GSM25400     1  0.5439     0.2424 0.700 0.196 0.060 0.000 0.044
#> GSM48659     2  0.1908     0.6308 0.000 0.908 0.000 0.000 0.092
#> GSM48660     2  0.4104     0.5566 0.000 0.788 0.000 0.088 0.124
#> GSM25409     5  0.3011     0.6770 0.000 0.016 0.000 0.140 0.844
#> GSM25410     1  0.7533    -0.1780 0.408 0.384 0.056 0.008 0.144
#> GSM25426     2  0.5251    -0.2988 0.000 0.504 0.456 0.036 0.004
#> GSM25427     5  0.5706     0.3427 0.204 0.000 0.152 0.004 0.640
#> GSM25540     3  0.6739     0.3278 0.024 0.412 0.460 0.012 0.092
#> GSM25541     3  0.7759     0.4580 0.060 0.308 0.464 0.020 0.148
#> GSM25542     2  0.3327     0.5858 0.000 0.828 0.000 0.028 0.144
#> GSM25543     2  0.4755     0.4359 0.000 0.696 0.000 0.060 0.244
#> GSM25479     1  0.6826     0.0416 0.440 0.004 0.116 0.028 0.412
#> GSM25480     5  0.0451     0.7527 0.000 0.008 0.004 0.000 0.988
#> GSM25481     5  0.2840     0.7012 0.004 0.012 0.004 0.108 0.872
#> GSM25482     5  0.5129     0.3195 0.020 0.000 0.024 0.328 0.628
#> GSM48654     2  0.2732     0.5961 0.000 0.840 0.000 0.000 0.160
#> GSM48650     2  0.5238    -0.3252 0.000 0.480 0.000 0.476 0.044
#> GSM48651     2  0.1915     0.6311 0.000 0.928 0.000 0.032 0.040
#> GSM48652     5  0.3661     0.4200 0.000 0.276 0.000 0.000 0.724
#> GSM48653     2  0.0162     0.6280 0.000 0.996 0.000 0.000 0.004
#> GSM48662     5  0.3305     0.5046 0.000 0.224 0.000 0.000 0.776
#> GSM48663     2  0.4897    -0.2307 0.000 0.516 0.000 0.460 0.024
#> GSM25524     1  0.5238    -0.4840 0.484 0.044 0.472 0.000 0.000
#> GSM25525     1  0.5334     0.1007 0.672 0.000 0.148 0.000 0.180
#> GSM25526     1  0.4450    -0.4559 0.508 0.004 0.488 0.000 0.000
#> GSM25527     1  0.6258    -0.0902 0.596 0.004 0.208 0.008 0.184
#> GSM25528     1  0.4489     0.3502 0.768 0.040 0.172 0.016 0.004
#> GSM25529     1  0.4626     0.3493 0.724 0.008 0.236 0.012 0.020
#> GSM25530     1  0.3491     0.0828 0.768 0.000 0.228 0.004 0.000
#> GSM25531     1  0.4010     0.3726 0.784 0.032 0.176 0.008 0.000
#> GSM48661     2  0.1582     0.6344 0.000 0.944 0.028 0.000 0.028
#> GSM25561     1  0.5223     0.4636 0.504 0.008 0.464 0.004 0.020
#> GSM25562     3  0.7909     0.5831 0.200 0.292 0.432 0.012 0.064
#> GSM25563     2  0.5388     0.0831 0.060 0.620 0.312 0.008 0.000
#> GSM25564     2  0.4437     0.0403 0.000 0.532 0.004 0.000 0.464
#> GSM25565     2  0.2536     0.6169 0.000 0.868 0.000 0.004 0.128
#> GSM25566     5  0.3491     0.5800 0.000 0.000 0.004 0.228 0.768
#> GSM25568     5  0.4492     0.3876 0.000 0.296 0.004 0.020 0.680
#> GSM25569     5  0.1211     0.7469 0.000 0.016 0.000 0.024 0.960
#> GSM25552     5  0.0162     0.7534 0.000 0.004 0.000 0.000 0.996
#> GSM25553     5  0.1197     0.7399 0.000 0.048 0.000 0.000 0.952
#> GSM25578     1  0.7136     0.4044 0.436 0.000 0.272 0.020 0.272
#> GSM25579     5  0.0960     0.7500 0.008 0.004 0.016 0.000 0.972
#> GSM25580     1  0.4708     0.4889 0.548 0.000 0.436 0.016 0.000
#> GSM25581     1  0.4897     0.4856 0.516 0.000 0.460 0.024 0.000
#> GSM48655     2  0.6707    -0.4709 0.000 0.388 0.000 0.368 0.244
#> GSM48656     2  0.2230     0.6249 0.000 0.884 0.000 0.000 0.116
#> GSM48657     4  0.5351     0.1511 0.000 0.464 0.000 0.484 0.052
#> GSM48658     2  0.4280     0.5840 0.000 0.796 0.076 0.016 0.112
#> GSM25624     1  0.6493     0.3697 0.520 0.000 0.248 0.004 0.228
#> GSM25625     3  0.4748     0.3746 0.492 0.016 0.492 0.000 0.000
#> GSM25626     1  0.5109    -0.4520 0.504 0.036 0.460 0.000 0.000
#> GSM25627     3  0.5546     0.4743 0.416 0.044 0.528 0.012 0.000
#> GSM25628     3  0.6553     0.5483 0.148 0.356 0.484 0.012 0.000
#> GSM25629     3  0.6092     0.4846 0.388 0.052 0.528 0.028 0.004
#> GSM25630     1  0.7176    -0.0781 0.556 0.116 0.116 0.212 0.000
#> GSM25631     5  0.0162     0.7534 0.000 0.004 0.000 0.000 0.996
#> GSM25632     1  0.4557    -0.4454 0.516 0.008 0.476 0.000 0.000
#> GSM25633     1  0.4897     0.4856 0.516 0.000 0.460 0.024 0.000
#> GSM25634     1  0.4897     0.4856 0.516 0.000 0.460 0.024 0.000
#> GSM25635     1  0.5153     0.4844 0.508 0.000 0.460 0.024 0.008
#> GSM25656     2  0.4735    -0.2825 0.000 0.524 0.460 0.016 0.000
#> GSM25657     1  0.4620     0.2520 0.612 0.000 0.372 0.004 0.012
#> GSM25658     1  0.4450    -0.4559 0.508 0.004 0.488 0.000 0.000
#> GSM25659     2  0.5257     0.4474 0.084 0.680 0.008 0.000 0.228
#> GSM25660     1  0.6908     0.4712 0.480 0.000 0.352 0.040 0.128
#> GSM25661     1  0.6095     0.4885 0.528 0.000 0.380 0.028 0.064
#> GSM25662     2  0.1168     0.6333 0.000 0.960 0.000 0.008 0.032
#> GSM25663     2  0.1628     0.6339 0.000 0.936 0.000 0.008 0.056
#> GSM25680     5  0.0000     0.7541 0.000 0.000 0.000 0.000 1.000
#> GSM25681     5  0.0000     0.7541 0.000 0.000 0.000 0.000 1.000
#> GSM25682     4  0.5736     0.3742 0.000 0.088 0.000 0.512 0.400
#> GSM25683     2  0.4307    -0.2579 0.000 0.504 0.000 0.496 0.000
#> GSM25684     2  0.1043     0.6347 0.000 0.960 0.000 0.000 0.040
#> GSM25685     2  0.0162     0.6264 0.000 0.996 0.004 0.000 0.000
#> GSM25686     4  0.6075     0.4307 0.000 0.356 0.000 0.512 0.132
#> GSM25687     4  0.5808     0.3959 0.000 0.096 0.000 0.512 0.392
#> GSM48664     1  0.6983     0.4488 0.444 0.100 0.412 0.024 0.020
#> GSM48665     1  0.5340     0.4827 0.500 0.000 0.460 0.024 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
#> GSM25548     4  0.0000     0.7712 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25549     4  0.0000     0.7712 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25550     4  0.0291     0.7700 0.000 0.004 0.000 0.992 0.000 0.004
#> GSM25551     4  0.4428     0.3797 0.000 0.004 0.388 0.588 0.012 0.008
#> GSM25570     4  0.0000     0.7712 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25571     4  0.0000     0.7712 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25358     5  0.0790     0.6888 0.000 0.000 0.000 0.032 0.968 0.000
#> GSM25359     3  0.5808     0.0978 0.000 0.004 0.496 0.372 0.116 0.012
#> GSM25360     5  0.7120     0.1866 0.000 0.000 0.216 0.132 0.456 0.196
#> GSM25361     5  0.5771     0.2551 0.000 0.000 0.248 0.244 0.508 0.000
#> GSM25377     1  0.2373     0.5112 0.888 0.004 0.000 0.084 0.000 0.024
#> GSM25378     4  0.3798     0.6947 0.072 0.004 0.044 0.820 0.000 0.060
#> GSM25401     5  0.6437    -0.2014 0.004 0.012 0.368 0.000 0.376 0.240
#> GSM25402     5  0.2197     0.6496 0.000 0.044 0.000 0.000 0.900 0.056
#> GSM25349     4  0.5516     0.2220 0.000 0.368 0.000 0.516 0.108 0.008
#> GSM25350     4  0.4195     0.6292 0.000 0.188 0.000 0.740 0.064 0.008
#> GSM25356     4  0.3563     0.4791 0.000 0.336 0.000 0.664 0.000 0.000
#> GSM25357     4  0.4936     0.2021 0.000 0.408 0.000 0.536 0.048 0.008
#> GSM25385     1  0.6370     0.0780 0.420 0.004 0.356 0.008 0.004 0.208
#> GSM25386     5  0.5153     0.3186 0.000 0.000 0.288 0.000 0.592 0.120
#> GSM25399     6  0.4398     0.0000 0.228 0.028 0.024 0.000 0.004 0.716
#> GSM25400     1  0.7911    -0.0498 0.336 0.000 0.184 0.020 0.172 0.288
#> GSM48659     5  0.1387     0.6838 0.000 0.000 0.000 0.068 0.932 0.000
#> GSM48660     5  0.3324     0.6067 0.000 0.060 0.000 0.112 0.824 0.004
#> GSM25409     4  0.2976     0.7170 0.000 0.124 0.000 0.844 0.020 0.012
#> GSM25410     5  0.7593    -0.0345 0.004 0.000 0.232 0.144 0.352 0.268
#> GSM25426     3  0.3955     0.3821 0.000 0.004 0.668 0.000 0.316 0.012
#> GSM25427     4  0.3807     0.3105 0.368 0.000 0.000 0.628 0.000 0.004
#> GSM25540     3  0.4328     0.4054 0.000 0.000 0.672 0.040 0.284 0.004
#> GSM25541     3  0.4449     0.4277 0.000 0.004 0.712 0.088 0.196 0.000
#> GSM25542     5  0.2623     0.6264 0.000 0.016 0.000 0.132 0.852 0.000
#> GSM25543     5  0.4354     0.4549 0.000 0.052 0.000 0.236 0.704 0.008
#> GSM25479     4  0.7474    -0.1383 0.252 0.004 0.152 0.400 0.000 0.192
#> GSM25480     4  0.0363     0.7695 0.000 0.000 0.012 0.988 0.000 0.000
#> GSM25481     4  0.3768     0.6874 0.008 0.104 0.000 0.796 0.000 0.092
#> GSM25482     4  0.5764     0.4110 0.040 0.292 0.000 0.572 0.000 0.096
#> GSM48654     5  0.2219     0.6427 0.000 0.000 0.000 0.136 0.864 0.000
#> GSM48650     2  0.4860     0.4748 0.000 0.516 0.000 0.040 0.436 0.008
#> GSM48651     5  0.0909     0.6863 0.000 0.012 0.000 0.020 0.968 0.000
#> GSM48652     4  0.3330     0.4832 0.000 0.000 0.000 0.716 0.284 0.000
#> GSM48653     5  0.0291     0.6809 0.000 0.000 0.004 0.004 0.992 0.000
#> GSM48662     4  0.3050     0.5543 0.000 0.000 0.000 0.764 0.236 0.000
#> GSM48663     2  0.4356     0.4768 0.000 0.548 0.000 0.016 0.432 0.004
#> GSM25524     3  0.2930     0.4616 0.020 0.000 0.856 0.000 0.020 0.104
#> GSM25525     3  0.7563    -0.0792 0.200 0.000 0.332 0.180 0.000 0.288
#> GSM25526     3  0.3448     0.4089 0.004 0.000 0.716 0.000 0.000 0.280
#> GSM25527     3  0.7086     0.0783 0.084 0.000 0.432 0.196 0.004 0.284
#> GSM25528     1  0.6189     0.1423 0.468 0.000 0.256 0.000 0.012 0.264
#> GSM25529     1  0.5671     0.1873 0.500 0.000 0.364 0.008 0.000 0.128
#> GSM25530     3  0.6041    -0.0571 0.272 0.000 0.416 0.000 0.000 0.312
#> GSM25531     1  0.6306     0.1756 0.496 0.000 0.220 0.000 0.028 0.256
#> GSM48661     5  0.1625     0.6712 0.000 0.000 0.060 0.012 0.928 0.000
#> GSM25561     1  0.3649     0.4526 0.784 0.000 0.180 0.016 0.004 0.016
#> GSM25562     3  0.4587     0.4464 0.004 0.000 0.712 0.044 0.216 0.024
#> GSM25563     3  0.3851     0.0493 0.000 0.000 0.540 0.000 0.460 0.000
#> GSM25564     5  0.4083     0.0944 0.000 0.000 0.008 0.460 0.532 0.000
#> GSM25565     5  0.1858     0.6734 0.000 0.000 0.000 0.092 0.904 0.004
#> GSM25566     4  0.3368     0.6341 0.000 0.232 0.000 0.756 0.000 0.012
#> GSM25568     4  0.4087     0.4577 0.000 0.004 0.008 0.668 0.312 0.008
#> GSM25569     4  0.1321     0.7637 0.000 0.024 0.000 0.952 0.020 0.004
#> GSM25552     4  0.0000     0.7712 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25553     4  0.1007     0.7603 0.000 0.000 0.000 0.956 0.044 0.000
#> GSM25578     1  0.4643     0.3063 0.672 0.000 0.012 0.260 0.000 0.056
#> GSM25579     4  0.0976     0.7663 0.008 0.000 0.016 0.968 0.000 0.008
#> GSM25580     1  0.0993     0.5507 0.964 0.000 0.024 0.000 0.000 0.012
#> GSM25581     1  0.0146     0.5518 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM48655     2  0.5971     0.4630 0.000 0.424 0.000 0.232 0.344 0.000
#> GSM48656     5  0.1714     0.6769 0.000 0.000 0.000 0.092 0.908 0.000
#> GSM48657     2  0.4909     0.5282 0.000 0.552 0.000 0.048 0.392 0.008
#> GSM48658     5  0.4222     0.5690 0.000 0.004 0.156 0.084 0.752 0.004
#> GSM25624     1  0.6185     0.1504 0.580 0.000 0.112 0.220 0.000 0.088
#> GSM25625     3  0.3136     0.4391 0.004 0.000 0.768 0.000 0.000 0.228
#> GSM25626     3  0.3833     0.4078 0.004 0.000 0.708 0.000 0.016 0.272
#> GSM25627     3  0.0260     0.4719 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM25628     3  0.2854     0.4623 0.000 0.000 0.792 0.000 0.208 0.000
#> GSM25629     3  0.0551     0.4711 0.000 0.004 0.984 0.000 0.008 0.004
#> GSM25630     2  0.7194    -0.5169 0.008 0.376 0.208 0.000 0.072 0.336
#> GSM25631     4  0.0000     0.7712 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25632     3  0.3629     0.4119 0.016 0.000 0.724 0.000 0.000 0.260
#> GSM25633     1  0.0291     0.5520 0.992 0.000 0.004 0.000 0.000 0.004
#> GSM25634     1  0.0146     0.5518 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM25635     1  0.0146     0.5504 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM25656     3  0.3531     0.3709 0.000 0.000 0.672 0.000 0.328 0.000
#> GSM25657     1  0.5741     0.0331 0.472 0.000 0.396 0.012 0.000 0.120
#> GSM25658     3  0.3383     0.4176 0.004 0.000 0.728 0.000 0.000 0.268
#> GSM25659     5  0.4959     0.4674 0.000 0.000 0.044 0.224 0.680 0.052
#> GSM25660     1  0.3466     0.4764 0.816 0.004 0.000 0.096 0.000 0.084
#> GSM25661     1  0.3133     0.5049 0.852 0.000 0.016 0.064 0.000 0.068
#> GSM25662     5  0.0458     0.6854 0.000 0.000 0.000 0.016 0.984 0.000
#> GSM25663     5  0.0632     0.6866 0.000 0.000 0.000 0.024 0.976 0.000
#> GSM25680     4  0.0000     0.7712 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25681     4  0.0000     0.7712 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25682     2  0.4747     0.2065 0.000 0.584 0.000 0.356 0.060 0.000
#> GSM25683     2  0.3789     0.4947 0.000 0.584 0.000 0.000 0.416 0.000
#> GSM25684     5  0.0458     0.6854 0.000 0.000 0.000 0.016 0.984 0.000
#> GSM25685     5  0.0260     0.6786 0.000 0.000 0.008 0.000 0.992 0.000
#> GSM25686     2  0.5164     0.5648 0.000 0.584 0.000 0.116 0.300 0.000
#> GSM25687     2  0.4786     0.2184 0.000 0.584 0.000 0.352 0.064 0.000
#> GSM48664     1  0.2536     0.4476 0.880 0.004 0.004 0.020 0.092 0.000
#> GSM48665     1  0.0260     0.5482 0.992 0.000 0.000 0.008 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-pam-collect-classes

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

test_to_known_factors(res)
#>         n genotype/variation(p) k
#> SD:pam 91              1.05e-04 2
#> SD:pam 83              1.92e-07 3
#> SD:pam 71              3.86e-06 4
#> SD:pam 37              1.81e-01 5
#> SD:pam 45              1.72e-01 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.720           0.896       0.920         0.4765 0.495   0.495
#> 3 3 0.418           0.608       0.741         0.2448 0.867   0.736
#> 4 4 0.508           0.702       0.801         0.1577 0.897   0.748
#> 5 5 0.746           0.730       0.864         0.1348 0.854   0.574
#> 6 6 0.709           0.677       0.816         0.0399 0.922   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
#> GSM25548     2  0.2948      0.906 0.052 0.948
#> GSM25549     2  0.3431      0.904 0.064 0.936
#> GSM25550     2  0.3584      0.903 0.068 0.932
#> GSM25551     2  0.0672      0.905 0.008 0.992
#> GSM25570     2  0.3584      0.903 0.068 0.932
#> GSM25571     2  0.3274      0.905 0.060 0.940
#> GSM25358     1  0.3274      0.963 0.940 0.060
#> GSM25359     2  0.8713      0.663 0.292 0.708
#> GSM25360     1  0.2778      0.971 0.952 0.048
#> GSM25361     2  0.9833      0.391 0.424 0.576
#> GSM25377     1  0.2778      0.971 0.952 0.048
#> GSM25378     1  0.2778      0.971 0.952 0.048
#> GSM25401     1  0.3879      0.949 0.924 0.076
#> GSM25402     1  0.2778      0.971 0.952 0.048
#> GSM25349     2  0.0376      0.903 0.004 0.996
#> GSM25350     2  0.0000      0.901 0.000 1.000
#> GSM25356     1  0.2948      0.968 0.948 0.052
#> GSM25357     2  0.2778      0.907 0.048 0.952
#> GSM25385     1  0.2778      0.971 0.952 0.048
#> GSM25386     1  0.2778      0.971 0.952 0.048
#> GSM25399     1  0.2778      0.971 0.952 0.048
#> GSM25400     1  0.2778      0.971 0.952 0.048
#> GSM48659     2  0.2043      0.907 0.032 0.968
#> GSM48660     2  0.0000      0.901 0.000 1.000
#> GSM25409     2  0.0938      0.906 0.012 0.988
#> GSM25410     1  0.2778      0.971 0.952 0.048
#> GSM25426     2  0.3584      0.903 0.068 0.932
#> GSM25427     1  0.3114      0.966 0.944 0.056
#> GSM25540     2  0.9522      0.516 0.372 0.628
#> GSM25541     2  0.9944      0.296 0.456 0.544
#> GSM25542     2  0.8327      0.705 0.264 0.736
#> GSM25543     2  0.8555      0.681 0.280 0.720
#> GSM25479     1  0.0000      0.949 1.000 0.000
#> GSM25480     1  0.0672      0.954 0.992 0.008
#> GSM25481     1  0.7453      0.759 0.788 0.212
#> GSM25482     1  0.7528      0.751 0.784 0.216
#> GSM48654     2  0.0938      0.906 0.012 0.988
#> GSM48650     2  0.3584      0.903 0.068 0.932
#> GSM48651     2  0.0672      0.905 0.008 0.992
#> GSM48652     2  0.0672      0.905 0.008 0.992
#> GSM48653     2  0.0672      0.905 0.008 0.992
#> GSM48662     2  0.0672      0.905 0.008 0.992
#> GSM48663     2  0.3274      0.904 0.060 0.940
#> GSM25524     1  0.2778      0.971 0.952 0.048
#> GSM25525     1  0.0376      0.951 0.996 0.004
#> GSM25526     1  0.2778      0.971 0.952 0.048
#> GSM25527     1  0.0376      0.951 0.996 0.004
#> GSM25528     1  0.2778      0.971 0.952 0.048
#> GSM25529     1  0.0376      0.951 0.996 0.004
#> GSM25530     1  0.2778      0.971 0.952 0.048
#> GSM25531     1  0.2603      0.969 0.956 0.044
#> GSM48661     2  0.4815      0.880 0.104 0.896
#> GSM25561     1  0.2778      0.971 0.952 0.048
#> GSM25562     1  0.2778      0.971 0.952 0.048
#> GSM25563     1  0.2778      0.971 0.952 0.048
#> GSM25564     1  0.4690      0.923 0.900 0.100
#> GSM25565     2  0.0672      0.905 0.008 0.992
#> GSM25566     2  0.0672      0.905 0.008 0.992
#> GSM25568     2  0.9129      0.601 0.328 0.672
#> GSM25569     2  0.0672      0.905 0.008 0.992
#> GSM25552     2  0.3584      0.903 0.068 0.932
#> GSM25553     2  0.4298      0.893 0.088 0.912
#> GSM25578     1  0.0000      0.949 1.000 0.000
#> GSM25579     1  0.2948      0.968 0.948 0.052
#> GSM25580     1  0.0000      0.949 1.000 0.000
#> GSM25581     1  0.0000      0.949 1.000 0.000
#> GSM48655     2  0.0000      0.901 0.000 1.000
#> GSM48656     2  0.2778      0.906 0.048 0.952
#> GSM48657     2  0.0000      0.901 0.000 1.000
#> GSM48658     2  0.5408      0.865 0.124 0.876
#> GSM25624     1  0.0000      0.949 1.000 0.000
#> GSM25625     1  0.2778      0.971 0.952 0.048
#> GSM25626     1  0.2778      0.971 0.952 0.048
#> GSM25627     1  0.3879      0.949 0.924 0.076
#> GSM25628     1  0.2778      0.971 0.952 0.048
#> GSM25629     2  0.9909      0.332 0.444 0.556
#> GSM25630     1  0.2778      0.971 0.952 0.048
#> GSM25631     2  0.6623      0.820 0.172 0.828
#> GSM25632     1  0.2778      0.971 0.952 0.048
#> GSM25633     1  0.0000      0.949 1.000 0.000
#> GSM25634     1  0.0000      0.949 1.000 0.000
#> GSM25635     1  0.0000      0.949 1.000 0.000
#> GSM25656     1  0.4431      0.931 0.908 0.092
#> GSM25657     1  0.0938      0.956 0.988 0.012
#> GSM25658     1  0.2778      0.971 0.952 0.048
#> GSM25659     1  0.2948      0.968 0.948 0.052
#> GSM25660     1  0.0000      0.949 1.000 0.000
#> GSM25661     1  0.0000      0.949 1.000 0.000
#> GSM25662     2  0.0672      0.905 0.008 0.992
#> GSM25663     2  0.5946      0.847 0.144 0.856
#> GSM25680     2  0.3584      0.903 0.068 0.932
#> GSM25681     2  0.3733      0.901 0.072 0.928
#> GSM25682     2  0.0000      0.901 0.000 1.000
#> GSM25683     2  0.0672      0.905 0.008 0.992
#> GSM25684     2  0.0672      0.905 0.008 0.992
#> GSM25685     2  0.3584      0.903 0.068 0.932
#> GSM25686     2  0.0000      0.901 0.000 1.000
#> GSM25687     2  0.0000      0.901 0.000 1.000
#> GSM48664     1  0.2778      0.971 0.952 0.048
#> GSM48665     1  0.2778      0.971 0.952 0.048

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.5763      0.765 0.008 0.716 0.276
#> GSM25549     2  0.5956      0.767 0.016 0.720 0.264
#> GSM25550     2  0.5473      0.698 0.052 0.808 0.140
#> GSM25551     2  0.6527      0.764 0.020 0.660 0.320
#> GSM25570     2  0.6662      0.748 0.052 0.716 0.232
#> GSM25571     2  0.5992      0.767 0.016 0.716 0.268
#> GSM25358     1  0.8126      0.412 0.564 0.356 0.080
#> GSM25359     2  0.4269      0.541 0.076 0.872 0.052
#> GSM25360     3  0.9951      0.916 0.296 0.324 0.380
#> GSM25361     2  0.4351      0.333 0.168 0.828 0.004
#> GSM25377     1  0.9133      0.443 0.508 0.332 0.160
#> GSM25378     1  0.9133      0.442 0.508 0.332 0.160
#> GSM25401     3  0.8628      0.664 0.116 0.340 0.544
#> GSM25402     1  0.9765      0.238 0.424 0.336 0.240
#> GSM25349     2  0.6905      0.732 0.016 0.544 0.440
#> GSM25350     2  0.6476      0.735 0.004 0.548 0.448
#> GSM25356     1  0.9229      0.437 0.496 0.336 0.168
#> GSM25357     2  0.6875      0.631 0.056 0.700 0.244
#> GSM25385     3  0.9888      0.944 0.272 0.328 0.400
#> GSM25386     3  0.9806      0.939 0.252 0.328 0.420
#> GSM25399     1  0.9133      0.439 0.508 0.332 0.160
#> GSM25400     1  0.6726      0.413 0.644 0.332 0.024
#> GSM48659     2  0.5327      0.765 0.000 0.728 0.272
#> GSM48660     2  0.6215      0.741 0.000 0.572 0.428
#> GSM25409     2  0.7425      0.763 0.052 0.620 0.328
#> GSM25410     3  0.9858      0.945 0.264 0.328 0.408
#> GSM25426     2  0.4642      0.511 0.060 0.856 0.084
#> GSM25427     1  0.9106      0.443 0.508 0.336 0.156
#> GSM25540     2  0.4139      0.420 0.124 0.860 0.016
#> GSM25541     2  0.4293      0.348 0.164 0.832 0.004
#> GSM25542     2  0.4269      0.643 0.052 0.872 0.076
#> GSM25543     2  0.3325      0.529 0.076 0.904 0.020
#> GSM25479     1  0.0661      0.575 0.988 0.004 0.008
#> GSM25480     1  0.2280      0.580 0.940 0.052 0.008
#> GSM25481     1  0.9318      0.413 0.476 0.352 0.172
#> GSM25482     1  0.9318      0.413 0.476 0.352 0.172
#> GSM48654     2  0.5397      0.764 0.000 0.720 0.280
#> GSM48650     2  0.4725      0.509 0.060 0.852 0.088
#> GSM48651     2  0.5678      0.754 0.000 0.684 0.316
#> GSM48652     2  0.5678      0.754 0.000 0.684 0.316
#> GSM48653     2  0.5902      0.756 0.004 0.680 0.316
#> GSM48662     2  0.5678      0.754 0.000 0.684 0.316
#> GSM48663     2  0.4291      0.553 0.008 0.840 0.152
#> GSM25524     3  0.9894      0.941 0.276 0.324 0.400
#> GSM25525     1  0.2496      0.579 0.928 0.068 0.004
#> GSM25526     3  0.9865      0.945 0.268 0.324 0.408
#> GSM25527     1  0.2486      0.579 0.932 0.060 0.008
#> GSM25528     1  0.9951     -0.717 0.380 0.324 0.296
#> GSM25529     1  0.3349      0.568 0.888 0.108 0.004
#> GSM25530     3  0.9931      0.928 0.288 0.324 0.388
#> GSM25531     1  0.7285      0.305 0.632 0.320 0.048
#> GSM48661     2  0.2200      0.660 0.004 0.940 0.056
#> GSM25561     1  0.9602     -0.450 0.460 0.320 0.220
#> GSM25562     1  0.5591      0.430 0.696 0.304 0.000
#> GSM25563     3  0.9833      0.943 0.260 0.324 0.416
#> GSM25564     2  0.6442     -0.401 0.432 0.564 0.004
#> GSM25565     2  0.7013      0.765 0.036 0.640 0.324
#> GSM25566     2  0.6448      0.762 0.016 0.656 0.328
#> GSM25568     2  0.2774      0.534 0.072 0.920 0.008
#> GSM25569     2  0.5678      0.754 0.000 0.684 0.316
#> GSM25552     2  0.2846      0.571 0.056 0.924 0.020
#> GSM25553     2  0.2590      0.540 0.072 0.924 0.004
#> GSM25578     1  0.1289      0.566 0.968 0.000 0.032
#> GSM25579     1  0.6026      0.375 0.624 0.376 0.000
#> GSM25580     1  0.1289      0.570 0.968 0.000 0.032
#> GSM25581     1  0.1163      0.568 0.972 0.000 0.028
#> GSM48655     2  0.6235      0.739 0.000 0.564 0.436
#> GSM48656     2  0.5812      0.767 0.012 0.724 0.264
#> GSM48657     2  0.6235      0.739 0.000 0.564 0.436
#> GSM48658     2  0.4834      0.752 0.004 0.792 0.204
#> GSM25624     1  0.1031      0.581 0.976 0.024 0.000
#> GSM25625     3  0.9865      0.945 0.268 0.324 0.408
#> GSM25626     3  0.9797      0.938 0.252 0.324 0.424
#> GSM25627     3  0.9789      0.886 0.236 0.368 0.396
#> GSM25628     3  0.9745      0.916 0.232 0.348 0.420
#> GSM25629     2  0.8666     -0.502 0.152 0.584 0.264
#> GSM25630     3  0.9894      0.941 0.276 0.324 0.400
#> GSM25631     2  0.2400      0.550 0.064 0.932 0.004
#> GSM25632     3  0.9880      0.944 0.272 0.324 0.404
#> GSM25633     1  0.1289      0.566 0.968 0.000 0.032
#> GSM25634     1  0.1289      0.566 0.968 0.000 0.032
#> GSM25635     1  0.0592      0.573 0.988 0.000 0.012
#> GSM25656     3  0.9745      0.916 0.232 0.348 0.420
#> GSM25657     1  0.5061      0.513 0.784 0.208 0.008
#> GSM25658     3  0.9901      0.940 0.276 0.328 0.396
#> GSM25659     1  0.6209      0.377 0.628 0.368 0.004
#> GSM25660     1  0.1315      0.579 0.972 0.020 0.008
#> GSM25661     1  0.1163      0.568 0.972 0.000 0.028
#> GSM25662     2  0.5497      0.763 0.000 0.708 0.292
#> GSM25663     2  0.5681      0.762 0.016 0.748 0.236
#> GSM25680     2  0.5216      0.765 0.000 0.740 0.260
#> GSM25681     2  0.1781      0.605 0.020 0.960 0.020
#> GSM25682     2  0.6267      0.733 0.000 0.548 0.452
#> GSM25683     2  0.7121      0.741 0.024 0.548 0.428
#> GSM25684     2  0.5560      0.760 0.000 0.700 0.300
#> GSM25685     2  0.2066      0.556 0.060 0.940 0.000
#> GSM25686     2  0.6274      0.731 0.000 0.544 0.456
#> GSM25687     2  0.6274      0.731 0.000 0.544 0.456
#> GSM48664     1  0.9090      0.446 0.512 0.332 0.156
#> GSM48665     1  0.8013      0.443 0.588 0.332 0.080

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.1743     0.7779 0.000 0.940 0.004 0.056
#> GSM25549     2  0.1970     0.7786 0.000 0.932 0.008 0.060
#> GSM25550     2  0.2773     0.7838 0.000 0.900 0.028 0.072
#> GSM25551     2  0.3037     0.7839 0.000 0.880 0.020 0.100
#> GSM25570     2  0.2335     0.7811 0.000 0.920 0.020 0.060
#> GSM25571     2  0.1824     0.7772 0.000 0.936 0.004 0.060
#> GSM25358     2  0.9425     0.1612 0.236 0.404 0.124 0.236
#> GSM25359     2  0.7456     0.6601 0.096 0.644 0.104 0.156
#> GSM25360     3  0.3743     0.7060 0.160 0.000 0.824 0.016
#> GSM25361     2  0.8207     0.4192 0.136 0.544 0.248 0.072
#> GSM25377     4  0.6157     0.7714 0.232 0.000 0.108 0.660
#> GSM25378     4  0.6877     0.7398 0.280 0.008 0.116 0.596
#> GSM25401     4  0.6904     0.5065 0.008 0.160 0.212 0.620
#> GSM25402     4  0.7445     0.5994 0.052 0.132 0.192 0.624
#> GSM25349     2  0.5696     0.6371 0.012 0.608 0.016 0.364
#> GSM25350     2  0.5285     0.6558 0.012 0.632 0.004 0.352
#> GSM25356     4  0.5857     0.7790 0.172 0.004 0.112 0.712
#> GSM25357     2  0.6936     0.5291 0.012 0.496 0.076 0.416
#> GSM25385     3  0.1022     0.8323 0.032 0.000 0.968 0.000
#> GSM25386     3  0.0000     0.8337 0.000 0.000 1.000 0.000
#> GSM25399     4  0.6248     0.7569 0.252 0.000 0.104 0.644
#> GSM25400     4  0.7088     0.5775 0.392 0.000 0.128 0.480
#> GSM48659     2  0.0937     0.7857 0.000 0.976 0.012 0.012
#> GSM48660     2  0.4978     0.6800 0.012 0.664 0.000 0.324
#> GSM25409     2  0.4946     0.7384 0.012 0.764 0.032 0.192
#> GSM25410     3  0.0188     0.8330 0.000 0.000 0.996 0.004
#> GSM25426     2  0.7293     0.5789 0.016 0.528 0.108 0.348
#> GSM25427     4  0.6333     0.7787 0.232 0.004 0.108 0.656
#> GSM25540     2  0.7972     0.2419 0.100 0.476 0.372 0.052
#> GSM25541     2  0.8028     0.3628 0.120 0.516 0.312 0.052
#> GSM25542     2  0.6455     0.7189 0.060 0.716 0.092 0.132
#> GSM25543     2  0.6760     0.6866 0.084 0.700 0.096 0.120
#> GSM25479     1  0.1109     0.8516 0.968 0.000 0.028 0.004
#> GSM25480     1  0.1576     0.8457 0.948 0.000 0.048 0.004
#> GSM25481     4  0.5602     0.7543 0.104 0.028 0.104 0.764
#> GSM25482     4  0.5714     0.7593 0.112 0.028 0.104 0.756
#> GSM48654     2  0.0657     0.7843 0.000 0.984 0.004 0.012
#> GSM48650     2  0.7173     0.5876 0.016 0.544 0.100 0.340
#> GSM48651     2  0.1716     0.7839 0.000 0.936 0.000 0.064
#> GSM48652     2  0.1474     0.7845 0.000 0.948 0.000 0.052
#> GSM48653     2  0.2021     0.7885 0.000 0.932 0.012 0.056
#> GSM48662     2  0.1022     0.7844 0.000 0.968 0.000 0.032
#> GSM48663     2  0.6744     0.5883 0.012 0.544 0.068 0.376
#> GSM25524     3  0.1302     0.8283 0.044 0.000 0.956 0.000
#> GSM25525     1  0.2888     0.7969 0.872 0.000 0.124 0.004
#> GSM25526     3  0.0000     0.8337 0.000 0.000 1.000 0.000
#> GSM25527     1  0.1940     0.8344 0.924 0.000 0.076 0.000
#> GSM25528     3  0.3444     0.6920 0.184 0.000 0.816 0.000
#> GSM25529     1  0.2888     0.7969 0.872 0.000 0.124 0.004
#> GSM25530     3  0.1557     0.8207 0.056 0.000 0.944 0.000
#> GSM25531     3  0.4972     0.0419 0.456 0.000 0.544 0.000
#> GSM48661     2  0.2830     0.7708 0.000 0.900 0.060 0.040
#> GSM25561     3  0.4543     0.4569 0.324 0.000 0.676 0.000
#> GSM25562     1  0.6212     0.5132 0.684 0.012 0.212 0.092
#> GSM25563     3  0.0592     0.8369 0.016 0.000 0.984 0.000
#> GSM25564     2  0.8068     0.4036 0.228 0.552 0.168 0.052
#> GSM25565     2  0.4137     0.7718 0.008 0.824 0.028 0.140
#> GSM25566     2  0.3366     0.7822 0.008 0.872 0.020 0.100
#> GSM25568     2  0.5223     0.6981 0.088 0.796 0.068 0.048
#> GSM25569     2  0.0592     0.7830 0.000 0.984 0.000 0.016
#> GSM25552     2  0.2623     0.7825 0.000 0.908 0.028 0.064
#> GSM25553     2  0.5298     0.7400 0.060 0.792 0.056 0.092
#> GSM25578     1  0.0817     0.8496 0.976 0.000 0.024 0.000
#> GSM25579     1  0.6135     0.5566 0.724 0.112 0.136 0.028
#> GSM25580     1  0.0921     0.8518 0.972 0.000 0.028 0.000
#> GSM25581     1  0.0817     0.8496 0.976 0.000 0.024 0.000
#> GSM48655     2  0.4914     0.6869 0.012 0.676 0.000 0.312
#> GSM48656     2  0.1297     0.7856 0.000 0.964 0.020 0.016
#> GSM48657     2  0.5018     0.6747 0.012 0.656 0.000 0.332
#> GSM48658     2  0.2224     0.7771 0.000 0.928 0.040 0.032
#> GSM25624     1  0.1302     0.8495 0.956 0.000 0.044 0.000
#> GSM25625     3  0.0592     0.8369 0.016 0.000 0.984 0.000
#> GSM25626     3  0.0000     0.8337 0.000 0.000 1.000 0.000
#> GSM25627     3  0.6037     0.2663 0.000 0.304 0.628 0.068
#> GSM25628     3  0.0188     0.8331 0.000 0.000 0.996 0.004
#> GSM25629     3  0.6320     0.1212 0.008 0.360 0.580 0.052
#> GSM25630     3  0.1022     0.8332 0.032 0.000 0.968 0.000
#> GSM25631     2  0.3169     0.7706 0.004 0.884 0.084 0.028
#> GSM25632     3  0.0817     0.8360 0.024 0.000 0.976 0.000
#> GSM25633     1  0.1022     0.8504 0.968 0.000 0.032 0.000
#> GSM25634     1  0.0817     0.8496 0.976 0.000 0.024 0.000
#> GSM25635     1  0.0921     0.8519 0.972 0.000 0.028 0.000
#> GSM25656     3  0.0524     0.8287 0.000 0.008 0.988 0.004
#> GSM25657     1  0.4356     0.5788 0.708 0.000 0.292 0.000
#> GSM25658     3  0.0524     0.8363 0.008 0.000 0.988 0.004
#> GSM25659     1  0.8424     0.0403 0.452 0.248 0.268 0.032
#> GSM25660     1  0.1305     0.8514 0.960 0.000 0.036 0.004
#> GSM25661     1  0.0817     0.8496 0.976 0.000 0.024 0.000
#> GSM25662     2  0.1722     0.7877 0.000 0.944 0.008 0.048
#> GSM25663     2  0.1677     0.7811 0.000 0.948 0.040 0.012
#> GSM25680     2  0.1452     0.7795 0.000 0.956 0.008 0.036
#> GSM25681     2  0.2021     0.7806 0.000 0.936 0.024 0.040
#> GSM25682     2  0.4999     0.6761 0.012 0.660 0.000 0.328
#> GSM25683     2  0.5662     0.6753 0.012 0.652 0.024 0.312
#> GSM25684     2  0.1022     0.7847 0.000 0.968 0.000 0.032
#> GSM25685     2  0.5976     0.7060 0.004 0.700 0.112 0.184
#> GSM25686     2  0.5057     0.6678 0.012 0.648 0.000 0.340
#> GSM25687     2  0.5018     0.6731 0.012 0.656 0.000 0.332
#> GSM48664     4  0.6375     0.7455 0.272 0.000 0.104 0.624
#> GSM48665     4  0.6735     0.5985 0.388 0.000 0.096 0.516

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     5  0.1082     0.7724 0.000 0.008 0.000 0.028 0.964
#> GSM25549     5  0.0794     0.7699 0.000 0.000 0.000 0.028 0.972
#> GSM25550     5  0.1082     0.7719 0.000 0.000 0.008 0.028 0.964
#> GSM25551     2  0.4416     0.4159 0.000 0.632 0.012 0.000 0.356
#> GSM25570     5  0.0794     0.7699 0.000 0.000 0.000 0.028 0.972
#> GSM25571     5  0.0794     0.7699 0.000 0.000 0.000 0.028 0.972
#> GSM25358     4  0.7589     0.1734 0.056 0.076 0.044 0.452 0.372
#> GSM25359     5  0.4148     0.6383 0.000 0.216 0.028 0.004 0.752
#> GSM25360     3  0.2763     0.8213 0.148 0.000 0.848 0.004 0.000
#> GSM25361     5  0.4181     0.6005 0.016 0.000 0.240 0.008 0.736
#> GSM25377     4  0.1280     0.8643 0.008 0.024 0.008 0.960 0.000
#> GSM25378     4  0.1612     0.8649 0.016 0.024 0.012 0.948 0.000
#> GSM25401     4  0.2859     0.8175 0.000 0.056 0.068 0.876 0.000
#> GSM25402     4  0.2221     0.8396 0.000 0.036 0.052 0.912 0.000
#> GSM25349     2  0.0566     0.8193 0.000 0.984 0.004 0.000 0.012
#> GSM25350     2  0.0404     0.8195 0.000 0.988 0.000 0.000 0.012
#> GSM25356     4  0.1280     0.8643 0.008 0.024 0.008 0.960 0.000
#> GSM25357     2  0.2206     0.7821 0.000 0.912 0.016 0.068 0.004
#> GSM25385     3  0.2011     0.9183 0.088 0.000 0.908 0.004 0.000
#> GSM25386     3  0.1270     0.9300 0.052 0.000 0.948 0.000 0.000
#> GSM25399     4  0.1498     0.8654 0.016 0.024 0.008 0.952 0.000
#> GSM25400     4  0.5560     0.1712 0.440 0.024 0.028 0.508 0.000
#> GSM48659     5  0.3039     0.7024 0.000 0.152 0.012 0.000 0.836
#> GSM48660     2  0.0290     0.8199 0.000 0.992 0.000 0.000 0.008
#> GSM25409     5  0.4883     0.1898 0.000 0.464 0.016 0.004 0.516
#> GSM25410     3  0.1341     0.9285 0.056 0.000 0.944 0.000 0.000
#> GSM25426     2  0.3717     0.7420 0.000 0.836 0.024 0.040 0.100
#> GSM25427     4  0.1393     0.8652 0.012 0.024 0.008 0.956 0.000
#> GSM25540     5  0.4639     0.4692 0.000 0.012 0.344 0.008 0.636
#> GSM25541     5  0.4795     0.5891 0.032 0.008 0.240 0.008 0.712
#> GSM25542     5  0.4589     0.5159 0.000 0.316 0.020 0.004 0.660
#> GSM25543     5  0.3851     0.6957 0.000 0.164 0.036 0.004 0.796
#> GSM25479     1  0.0000     0.8951 1.000 0.000 0.000 0.000 0.000
#> GSM25480     1  0.0955     0.8923 0.968 0.000 0.028 0.000 0.004
#> GSM25481     4  0.1569     0.8586 0.004 0.044 0.008 0.944 0.000
#> GSM25482     4  0.1569     0.8586 0.004 0.044 0.008 0.944 0.000
#> GSM48654     5  0.3171     0.6820 0.000 0.176 0.008 0.000 0.816
#> GSM48650     2  0.1960     0.7935 0.000 0.928 0.020 0.048 0.004
#> GSM48651     2  0.4522     0.2383 0.000 0.552 0.008 0.000 0.440
#> GSM48652     2  0.4538     0.2008 0.000 0.540 0.008 0.000 0.452
#> GSM48653     5  0.4883     0.0197 0.000 0.464 0.016 0.004 0.516
#> GSM48662     5  0.4196     0.3762 0.000 0.356 0.004 0.000 0.640
#> GSM48663     2  0.1205     0.8013 0.000 0.956 0.000 0.040 0.004
#> GSM25524     3  0.2389     0.8612 0.116 0.000 0.880 0.004 0.000
#> GSM25525     1  0.3333     0.8130 0.788 0.000 0.208 0.000 0.004
#> GSM25526     3  0.1205     0.9313 0.040 0.000 0.956 0.004 0.000
#> GSM25527     1  0.1197     0.8932 0.952 0.000 0.048 0.000 0.000
#> GSM25528     1  0.3579     0.7797 0.756 0.000 0.240 0.004 0.000
#> GSM25529     1  0.3333     0.8130 0.788 0.000 0.208 0.000 0.004
#> GSM25530     3  0.4182     0.4518 0.352 0.000 0.644 0.004 0.000
#> GSM25531     1  0.3123     0.8129 0.812 0.000 0.184 0.004 0.000
#> GSM48661     5  0.1503     0.7758 0.000 0.020 0.020 0.008 0.952
#> GSM25561     1  0.3861     0.6834 0.712 0.000 0.284 0.004 0.000
#> GSM25562     1  0.1282     0.8922 0.952 0.000 0.044 0.004 0.000
#> GSM25563     3  0.1197     0.9302 0.048 0.000 0.952 0.000 0.000
#> GSM25564     5  0.5059     0.6270 0.152 0.008 0.096 0.008 0.736
#> GSM25565     2  0.4787     0.1351 0.000 0.548 0.020 0.000 0.432
#> GSM25566     5  0.4655     0.0835 0.000 0.476 0.012 0.000 0.512
#> GSM25568     5  0.1278     0.7752 0.000 0.016 0.020 0.004 0.960
#> GSM25569     5  0.2970     0.6896 0.000 0.168 0.004 0.000 0.828
#> GSM25552     5  0.1082     0.7719 0.000 0.000 0.008 0.028 0.964
#> GSM25553     5  0.2452     0.7481 0.052 0.000 0.012 0.028 0.908
#> GSM25578     1  0.0000     0.8951 1.000 0.000 0.000 0.000 0.000
#> GSM25579     1  0.3545     0.8501 0.832 0.004 0.128 0.004 0.032
#> GSM25580     1  0.0290     0.8935 0.992 0.000 0.000 0.008 0.000
#> GSM25581     1  0.0000     0.8951 1.000 0.000 0.000 0.000 0.000
#> GSM48655     2  0.0290     0.8199 0.000 0.992 0.000 0.000 0.008
#> GSM48656     5  0.0992     0.7739 0.000 0.024 0.008 0.000 0.968
#> GSM48657     2  0.0290     0.8199 0.000 0.992 0.000 0.000 0.008
#> GSM48658     5  0.0981     0.7755 0.000 0.012 0.008 0.008 0.972
#> GSM25624     1  0.0451     0.8964 0.988 0.000 0.008 0.004 0.000
#> GSM25625     3  0.1571     0.9310 0.060 0.000 0.936 0.004 0.000
#> GSM25626     3  0.1043     0.9311 0.040 0.000 0.960 0.000 0.000
#> GSM25627     3  0.1766     0.9229 0.040 0.012 0.940 0.004 0.004
#> GSM25628     3  0.0000     0.9121 0.000 0.000 1.000 0.000 0.000
#> GSM25629     3  0.1492     0.8837 0.000 0.004 0.948 0.008 0.040
#> GSM25630     3  0.1197     0.9207 0.048 0.000 0.952 0.000 0.000
#> GSM25631     5  0.1612     0.7750 0.000 0.012 0.024 0.016 0.948
#> GSM25632     3  0.1544     0.9287 0.068 0.000 0.932 0.000 0.000
#> GSM25633     1  0.0162     0.8958 0.996 0.000 0.000 0.004 0.000
#> GSM25634     1  0.0290     0.8947 0.992 0.000 0.000 0.008 0.000
#> GSM25635     1  0.0404     0.8900 0.988 0.000 0.000 0.012 0.000
#> GSM25656     3  0.0290     0.9171 0.008 0.000 0.992 0.000 0.000
#> GSM25657     1  0.2629     0.8512 0.860 0.000 0.136 0.004 0.000
#> GSM25658     3  0.1282     0.9316 0.044 0.000 0.952 0.004 0.000
#> GSM25659     1  0.4220     0.7947 0.760 0.000 0.200 0.008 0.032
#> GSM25660     1  0.0162     0.8963 0.996 0.000 0.004 0.000 0.000
#> GSM25661     1  0.0000     0.8951 1.000 0.000 0.000 0.000 0.000
#> GSM25662     5  0.4637     0.0778 0.000 0.452 0.012 0.000 0.536
#> GSM25663     5  0.0854     0.7754 0.000 0.012 0.008 0.004 0.976
#> GSM25680     5  0.0854     0.7755 0.000 0.012 0.008 0.004 0.976
#> GSM25681     5  0.0981     0.7762 0.000 0.012 0.008 0.008 0.972
#> GSM25682     2  0.0290     0.8199 0.000 0.992 0.000 0.000 0.008
#> GSM25683     2  0.0693     0.8166 0.000 0.980 0.012 0.000 0.008
#> GSM25684     5  0.4617     0.1405 0.000 0.436 0.012 0.000 0.552
#> GSM25685     2  0.5445     0.3162 0.000 0.564 0.036 0.016 0.384
#> GSM25686     2  0.0290     0.8199 0.000 0.992 0.000 0.000 0.008
#> GSM25687     2  0.0290     0.8199 0.000 0.992 0.000 0.000 0.008
#> GSM48664     4  0.1498     0.8654 0.016 0.024 0.008 0.952 0.000
#> GSM48665     4  0.4692     0.5108 0.320 0.024 0.004 0.652 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
#> GSM25548     5  0.4051    -0.6720 0.000 0.008 0.000 0.000 0.560 0.432
#> GSM25549     6  0.3833     0.8770 0.000 0.000 0.000 0.000 0.444 0.556
#> GSM25550     6  0.3838     0.8755 0.000 0.000 0.000 0.000 0.448 0.552
#> GSM25551     5  0.4211     0.4239 0.000 0.364 0.004 0.000 0.616 0.016
#> GSM25570     6  0.3833     0.8770 0.000 0.000 0.000 0.000 0.444 0.556
#> GSM25571     6  0.3843     0.8715 0.000 0.000 0.000 0.000 0.452 0.548
#> GSM25358     4  0.8011     0.2749 0.200 0.052 0.076 0.432 0.224 0.016
#> GSM25359     5  0.6338     0.3888 0.012 0.204 0.040 0.016 0.604 0.124
#> GSM25360     3  0.3486     0.7968 0.128 0.000 0.812 0.008 0.000 0.052
#> GSM25361     5  0.6297     0.1906 0.068 0.000 0.156 0.000 0.560 0.216
#> GSM25377     4  0.0260     0.8720 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM25378     4  0.0146     0.8744 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM25401     4  0.4931     0.6943 0.000 0.024 0.084 0.700 0.004 0.188
#> GSM25402     4  0.2488     0.8133 0.000 0.000 0.076 0.880 0.000 0.044
#> GSM25349     2  0.0436     0.8777 0.000 0.988 0.004 0.004 0.000 0.004
#> GSM25350     2  0.0000     0.8798 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25356     4  0.0000     0.8743 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25357     2  0.2458     0.8446 0.000 0.900 0.012 0.052 0.008 0.028
#> GSM25385     3  0.1493     0.8926 0.056 0.000 0.936 0.004 0.000 0.004
#> GSM25386     3  0.0622     0.9010 0.012 0.000 0.980 0.000 0.000 0.008
#> GSM25399     4  0.0806     0.8670 0.000 0.000 0.020 0.972 0.000 0.008
#> GSM25400     4  0.4563     0.3904 0.348 0.000 0.048 0.604 0.000 0.000
#> GSM48659     5  0.2993     0.5455 0.000 0.120 0.008 0.000 0.844 0.028
#> GSM48660     2  0.0000     0.8798 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25409     2  0.5295     0.3381 0.000 0.640 0.044 0.012 0.268 0.036
#> GSM25410     3  0.1268     0.8967 0.036 0.000 0.952 0.004 0.000 0.008
#> GSM25426     2  0.7291     0.5040 0.000 0.512 0.064 0.072 0.128 0.224
#> GSM25427     4  0.0000     0.8743 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25540     5  0.5519     0.2918 0.004 0.000 0.176 0.008 0.612 0.200
#> GSM25541     5  0.6707     0.1908 0.084 0.000 0.156 0.008 0.536 0.216
#> GSM25542     5  0.5253     0.5072 0.004 0.152 0.016 0.012 0.692 0.124
#> GSM25543     5  0.6012     0.4476 0.016 0.136 0.056 0.008 0.656 0.128
#> GSM25479     1  0.0000     0.8839 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25480     1  0.0891     0.8836 0.968 0.000 0.024 0.000 0.000 0.008
#> GSM25481     4  0.0146     0.8740 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM25482     4  0.0146     0.8740 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM48654     5  0.2715     0.5424 0.000 0.112 0.004 0.000 0.860 0.024
#> GSM48650     2  0.5732     0.6442 0.000 0.648 0.048 0.100 0.012 0.192
#> GSM48651     5  0.3979     0.4330 0.000 0.360 0.000 0.000 0.628 0.012
#> GSM48652     5  0.3743     0.4893 0.000 0.252 0.000 0.000 0.724 0.024
#> GSM48653     5  0.3385     0.5386 0.000 0.172 0.004 0.000 0.796 0.028
#> GSM48662     5  0.3791     0.4846 0.000 0.236 0.000 0.000 0.732 0.032
#> GSM48663     2  0.3030     0.8000 0.000 0.848 0.000 0.092 0.004 0.056
#> GSM25524     3  0.2367     0.8503 0.088 0.000 0.888 0.008 0.000 0.016
#> GSM25525     1  0.2706     0.8237 0.832 0.000 0.160 0.000 0.000 0.008
#> GSM25526     3  0.0508     0.9015 0.012 0.000 0.984 0.004 0.000 0.000
#> GSM25527     1  0.0937     0.8817 0.960 0.000 0.040 0.000 0.000 0.000
#> GSM25528     1  0.4452     0.3624 0.548 0.000 0.428 0.008 0.000 0.016
#> GSM25529     1  0.2848     0.8101 0.816 0.000 0.176 0.000 0.000 0.008
#> GSM25530     3  0.2958     0.7789 0.160 0.000 0.824 0.008 0.000 0.008
#> GSM25531     1  0.2948     0.7872 0.804 0.000 0.188 0.008 0.000 0.000
#> GSM48661     5  0.3657     0.4684 0.000 0.024 0.012 0.004 0.788 0.172
#> GSM25561     1  0.4184     0.3472 0.556 0.000 0.432 0.008 0.000 0.004
#> GSM25562     1  0.2744     0.8374 0.864 0.000 0.064 0.072 0.000 0.000
#> GSM25563     3  0.0146     0.8979 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM25564     5  0.7073     0.0516 0.356 0.024 0.128 0.016 0.440 0.036
#> GSM25565     5  0.4198     0.4350 0.000 0.344 0.012 0.004 0.636 0.004
#> GSM25566     5  0.4387     0.3885 0.000 0.392 0.008 0.000 0.584 0.016
#> GSM25568     5  0.4843     0.3976 0.064 0.008 0.048 0.008 0.752 0.120
#> GSM25569     5  0.3254     0.5179 0.000 0.136 0.000 0.000 0.816 0.048
#> GSM25552     6  0.3833     0.8770 0.000 0.000 0.000 0.000 0.444 0.556
#> GSM25553     6  0.4931     0.8135 0.004 0.000 0.020 0.020 0.460 0.496
#> GSM25578     1  0.0000     0.8839 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25579     1  0.3172     0.8376 0.852 0.000 0.080 0.000 0.036 0.032
#> GSM25580     1  0.0146     0.8830 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM25581     1  0.0000     0.8839 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM48655     2  0.0937     0.8517 0.000 0.960 0.000 0.000 0.040 0.000
#> GSM48656     5  0.2398     0.3640 0.000 0.020 0.000 0.000 0.876 0.104
#> GSM48657     2  0.0000     0.8798 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48658     5  0.2278     0.4428 0.000 0.000 0.004 0.000 0.868 0.128
#> GSM25624     1  0.0405     0.8846 0.988 0.000 0.004 0.008 0.000 0.000
#> GSM25625     3  0.0622     0.9015 0.012 0.000 0.980 0.008 0.000 0.000
#> GSM25626     3  0.0622     0.9010 0.012 0.000 0.980 0.000 0.000 0.008
#> GSM25627     3  0.6040     0.6424 0.108 0.000 0.656 0.024 0.108 0.104
#> GSM25628     3  0.0713     0.8946 0.000 0.000 0.972 0.000 0.000 0.028
#> GSM25629     3  0.5304     0.5450 0.000 0.000 0.628 0.008 0.172 0.192
#> GSM25630     3  0.0777     0.8980 0.024 0.000 0.972 0.000 0.000 0.004
#> GSM25631     6  0.5027     0.2417 0.000 0.000 0.072 0.000 0.440 0.488
#> GSM25632     3  0.0858     0.9006 0.028 0.000 0.968 0.000 0.000 0.004
#> GSM25633     1  0.0146     0.8844 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM25634     1  0.0146     0.8830 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM25635     1  0.0363     0.8790 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM25656     3  0.0777     0.8948 0.000 0.000 0.972 0.000 0.004 0.024
#> GSM25657     1  0.2020     0.8562 0.896 0.000 0.096 0.008 0.000 0.000
#> GSM25658     3  0.2165     0.8436 0.108 0.000 0.884 0.008 0.000 0.000
#> GSM25659     1  0.4294     0.7697 0.772 0.000 0.116 0.004 0.084 0.024
#> GSM25660     1  0.0146     0.8848 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM25661     1  0.0146     0.8830 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM25662     5  0.2704     0.5454 0.000 0.140 0.000 0.000 0.844 0.016
#> GSM25663     5  0.2051     0.4298 0.000 0.000 0.004 0.004 0.896 0.096
#> GSM25680     5  0.1970     0.3755 0.000 0.000 0.008 0.000 0.900 0.092
#> GSM25681     5  0.4371    -0.2646 0.000 0.000 0.036 0.000 0.620 0.344
#> GSM25682     2  0.0000     0.8798 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25683     2  0.1204     0.8680 0.000 0.960 0.004 0.004 0.016 0.016
#> GSM25684     5  0.3084     0.5459 0.000 0.132 0.004 0.000 0.832 0.032
#> GSM25685     5  0.6083     0.4183 0.000 0.092 0.064 0.020 0.624 0.200
#> GSM25686     2  0.0000     0.8798 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25687     2  0.0000     0.8798 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48664     4  0.0146     0.8737 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM48665     4  0.1141     0.8490 0.052 0.000 0.000 0.948 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 genotype/variation(p) k
#> SD:mclust 97              5.16e-06 2
#> SD:mclust 77              1.14e-03 3
#> SD:mclust 90              8.84e-06 4
#> SD:mclust 85              1.05e-06 5
#> SD:mclust 73              2.83e-09 6

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


SD: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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.837           0.888       0.956         0.5025 0.495   0.495
#> 3 3 0.472           0.519       0.773         0.3227 0.736   0.518
#> 4 4 0.436           0.435       0.693         0.1119 0.776   0.455
#> 5 5 0.468           0.428       0.617         0.0693 0.821   0.453
#> 6 6 0.524           0.385       0.628         0.0445 0.844   0.420

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
#> GSM25548     2  0.0000     0.9669 0.000 1.000
#> GSM25549     2  0.0000     0.9669 0.000 1.000
#> GSM25550     2  0.0000     0.9669 0.000 1.000
#> GSM25551     2  0.0000     0.9669 0.000 1.000
#> GSM25570     2  0.0000     0.9669 0.000 1.000
#> GSM25571     2  0.0000     0.9669 0.000 1.000
#> GSM25358     2  0.9983     0.0292 0.476 0.524
#> GSM25359     2  0.0000     0.9669 0.000 1.000
#> GSM25360     1  0.0000     0.9380 1.000 0.000
#> GSM25361     1  0.6887     0.7550 0.816 0.184
#> GSM25377     1  0.0000     0.9380 1.000 0.000
#> GSM25378     1  0.4022     0.8722 0.920 0.080
#> GSM25401     2  0.6048     0.8139 0.148 0.852
#> GSM25402     1  0.7376     0.7265 0.792 0.208
#> GSM25349     2  0.0000     0.9669 0.000 1.000
#> GSM25350     2  0.0000     0.9669 0.000 1.000
#> GSM25356     1  0.2423     0.9086 0.960 0.040
#> GSM25357     2  0.0000     0.9669 0.000 1.000
#> GSM25385     1  0.0000     0.9380 1.000 0.000
#> GSM25386     1  0.0376     0.9355 0.996 0.004
#> GSM25399     1  0.0000     0.9380 1.000 0.000
#> GSM25400     1  0.0000     0.9380 1.000 0.000
#> GSM48659     2  0.0000     0.9669 0.000 1.000
#> GSM48660     2  0.0000     0.9669 0.000 1.000
#> GSM25409     2  0.0000     0.9669 0.000 1.000
#> GSM25410     1  0.0672     0.9328 0.992 0.008
#> GSM25426     2  0.0000     0.9669 0.000 1.000
#> GSM25427     1  0.2043     0.9154 0.968 0.032
#> GSM25540     2  0.5737     0.8294 0.136 0.864
#> GSM25541     1  0.9977     0.1241 0.528 0.472
#> GSM25542     2  0.0000     0.9669 0.000 1.000
#> GSM25543     2  0.0000     0.9669 0.000 1.000
#> GSM25479     1  0.0000     0.9380 1.000 0.000
#> GSM25480     1  0.0000     0.9380 1.000 0.000
#> GSM25481     1  0.9983     0.1401 0.524 0.476
#> GSM25482     1  0.9833     0.3029 0.576 0.424
#> GSM48654     2  0.0000     0.9669 0.000 1.000
#> GSM48650     2  0.0000     0.9669 0.000 1.000
#> GSM48651     2  0.0000     0.9669 0.000 1.000
#> GSM48652     2  0.0000     0.9669 0.000 1.000
#> GSM48653     2  0.0000     0.9669 0.000 1.000
#> GSM48662     2  0.0000     0.9669 0.000 1.000
#> GSM48663     2  0.0000     0.9669 0.000 1.000
#> GSM25524     1  0.0000     0.9380 1.000 0.000
#> GSM25525     1  0.0000     0.9380 1.000 0.000
#> GSM25526     1  0.0000     0.9380 1.000 0.000
#> GSM25527     1  0.0000     0.9380 1.000 0.000
#> GSM25528     1  0.0000     0.9380 1.000 0.000
#> GSM25529     1  0.0000     0.9380 1.000 0.000
#> GSM25530     1  0.0000     0.9380 1.000 0.000
#> GSM25531     1  0.0000     0.9380 1.000 0.000
#> GSM48661     2  0.0000     0.9669 0.000 1.000
#> GSM25561     1  0.0000     0.9380 1.000 0.000
#> GSM25562     1  0.0000     0.9380 1.000 0.000
#> GSM25563     1  0.0000     0.9380 1.000 0.000
#> GSM25564     1  0.9833     0.2998 0.576 0.424
#> GSM25565     2  0.0000     0.9669 0.000 1.000
#> GSM25566     2  0.0000     0.9669 0.000 1.000
#> GSM25568     2  0.4815     0.8662 0.104 0.896
#> GSM25569     2  0.0000     0.9669 0.000 1.000
#> GSM25552     2  0.0000     0.9669 0.000 1.000
#> GSM25553     2  0.9209     0.4673 0.336 0.664
#> GSM25578     1  0.0000     0.9380 1.000 0.000
#> GSM25579     1  0.0000     0.9380 1.000 0.000
#> GSM25580     1  0.0000     0.9380 1.000 0.000
#> GSM25581     1  0.0000     0.9380 1.000 0.000
#> GSM48655     2  0.0000     0.9669 0.000 1.000
#> GSM48656     2  0.0000     0.9669 0.000 1.000
#> GSM48657     2  0.0000     0.9669 0.000 1.000
#> GSM48658     2  0.0000     0.9669 0.000 1.000
#> GSM25624     1  0.0000     0.9380 1.000 0.000
#> GSM25625     1  0.0000     0.9380 1.000 0.000
#> GSM25626     1  0.0376     0.9355 0.996 0.004
#> GSM25627     2  0.0938     0.9575 0.012 0.988
#> GSM25628     1  0.9998     0.0501 0.508 0.492
#> GSM25629     2  0.0376     0.9638 0.004 0.996
#> GSM25630     1  0.0000     0.9380 1.000 0.000
#> GSM25631     2  0.3584     0.9060 0.068 0.932
#> GSM25632     1  0.0000     0.9380 1.000 0.000
#> GSM25633     1  0.0000     0.9380 1.000 0.000
#> GSM25634     1  0.0000     0.9380 1.000 0.000
#> GSM25635     1  0.0000     0.9380 1.000 0.000
#> GSM25656     2  0.8144     0.6535 0.252 0.748
#> GSM25657     1  0.0000     0.9380 1.000 0.000
#> GSM25658     1  0.0000     0.9380 1.000 0.000
#> GSM25659     1  0.0000     0.9380 1.000 0.000
#> GSM25660     1  0.0000     0.9380 1.000 0.000
#> GSM25661     1  0.0000     0.9380 1.000 0.000
#> GSM25662     2  0.0000     0.9669 0.000 1.000
#> GSM25663     2  0.0000     0.9669 0.000 1.000
#> GSM25680     2  0.0000     0.9669 0.000 1.000
#> GSM25681     2  0.0000     0.9669 0.000 1.000
#> GSM25682     2  0.0000     0.9669 0.000 1.000
#> GSM25683     2  0.0000     0.9669 0.000 1.000
#> GSM25684     2  0.0000     0.9669 0.000 1.000
#> GSM25685     2  0.0000     0.9669 0.000 1.000
#> GSM25686     2  0.0000     0.9669 0.000 1.000
#> GSM25687     2  0.0000     0.9669 0.000 1.000
#> GSM48664     1  0.0000     0.9380 1.000 0.000
#> GSM48665     1  0.0000     0.9380 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.2537    0.75478 0.000 0.920 0.080
#> GSM25549     2  0.0424    0.76160 0.000 0.992 0.008
#> GSM25550     2  0.3752    0.68250 0.144 0.856 0.000
#> GSM25551     2  0.4842    0.67214 0.000 0.776 0.224
#> GSM25570     2  0.1529    0.75276 0.040 0.960 0.000
#> GSM25571     2  0.1031    0.76188 0.000 0.976 0.024
#> GSM25358     2  0.8338    0.00743 0.400 0.516 0.084
#> GSM25359     2  0.6386    0.41289 0.004 0.584 0.412
#> GSM25360     3  0.4178    0.58392 0.172 0.000 0.828
#> GSM25361     3  0.1315    0.62932 0.020 0.008 0.972
#> GSM25377     1  0.5138    0.57184 0.748 0.252 0.000
#> GSM25378     1  0.6079    0.35743 0.612 0.388 0.000
#> GSM25401     2  0.7279    0.49035 0.292 0.652 0.056
#> GSM25402     1  0.6228    0.37591 0.624 0.372 0.004
#> GSM25349     2  0.3038    0.72167 0.104 0.896 0.000
#> GSM25350     2  0.2796    0.72944 0.092 0.908 0.000
#> GSM25356     1  0.6192    0.28479 0.580 0.420 0.000
#> GSM25357     2  0.1989    0.75070 0.048 0.948 0.004
#> GSM25385     3  0.6267    0.19821 0.452 0.000 0.548
#> GSM25386     3  0.2261    0.62013 0.068 0.000 0.932
#> GSM25399     1  0.1163    0.71593 0.972 0.028 0.000
#> GSM25400     1  0.1919    0.72543 0.956 0.024 0.020
#> GSM48659     2  0.6302    0.30120 0.000 0.520 0.480
#> GSM48660     2  0.1529    0.75294 0.040 0.960 0.000
#> GSM25409     2  0.2796    0.72972 0.092 0.908 0.000
#> GSM25410     3  0.4504    0.57085 0.196 0.000 0.804
#> GSM25426     2  0.5948    0.52556 0.000 0.640 0.360
#> GSM25427     1  0.6026    0.37987 0.624 0.376 0.000
#> GSM25540     3  0.2200    0.61368 0.004 0.056 0.940
#> GSM25541     3  0.1453    0.62958 0.008 0.024 0.968
#> GSM25542     3  0.6307   -0.26719 0.000 0.488 0.512
#> GSM25543     3  0.6260   -0.13800 0.000 0.448 0.552
#> GSM25479     1  0.1989    0.73076 0.948 0.004 0.048
#> GSM25480     1  0.2229    0.73209 0.944 0.012 0.044
#> GSM25481     2  0.6513   -0.03813 0.476 0.520 0.004
#> GSM25482     1  0.6309    0.07191 0.504 0.496 0.000
#> GSM48654     2  0.6168    0.44241 0.000 0.588 0.412
#> GSM48650     2  0.2165    0.75945 0.000 0.936 0.064
#> GSM48651     2  0.4121    0.71496 0.000 0.832 0.168
#> GSM48652     2  0.5291    0.63692 0.000 0.732 0.268
#> GSM48653     2  0.6308    0.26816 0.000 0.508 0.492
#> GSM48662     2  0.2165    0.75900 0.000 0.936 0.064
#> GSM48663     2  0.3030    0.72905 0.092 0.904 0.004
#> GSM25524     3  0.5785    0.42368 0.332 0.000 0.668
#> GSM25525     1  0.5621    0.45320 0.692 0.000 0.308
#> GSM25526     3  0.4291    0.58047 0.180 0.000 0.820
#> GSM25527     1  0.5397    0.50698 0.720 0.000 0.280
#> GSM25528     3  0.6308    0.07757 0.492 0.000 0.508
#> GSM25529     1  0.6111    0.23960 0.604 0.000 0.396
#> GSM25530     3  0.6302    0.11547 0.480 0.000 0.520
#> GSM25531     1  0.5706    0.43004 0.680 0.000 0.320
#> GSM48661     3  0.5591    0.24328 0.000 0.304 0.696
#> GSM25561     3  0.6225    0.24395 0.432 0.000 0.568
#> GSM25562     1  0.4235    0.64741 0.824 0.000 0.176
#> GSM25563     3  0.4605    0.56415 0.204 0.000 0.796
#> GSM25564     3  0.9840    0.12849 0.264 0.320 0.416
#> GSM25565     2  0.3752    0.72753 0.000 0.856 0.144
#> GSM25566     2  0.2796    0.75070 0.000 0.908 0.092
#> GSM25568     2  0.7411    0.34053 0.036 0.548 0.416
#> GSM25569     2  0.3686    0.73007 0.000 0.860 0.140
#> GSM25552     2  0.2772    0.73443 0.080 0.916 0.004
#> GSM25553     2  0.6451    0.10291 0.436 0.560 0.004
#> GSM25578     1  0.3340    0.69697 0.880 0.000 0.120
#> GSM25579     1  0.4733    0.62681 0.800 0.004 0.196
#> GSM25580     1  0.0892    0.73078 0.980 0.000 0.020
#> GSM25581     1  0.2356    0.72184 0.928 0.000 0.072
#> GSM48655     2  0.0424    0.76138 0.000 0.992 0.008
#> GSM48656     2  0.2711    0.75256 0.000 0.912 0.088
#> GSM48657     2  0.1411    0.75382 0.036 0.964 0.000
#> GSM48658     3  0.6079    0.02250 0.000 0.388 0.612
#> GSM25624     1  0.1525    0.73177 0.964 0.004 0.032
#> GSM25625     3  0.5397    0.49373 0.280 0.000 0.720
#> GSM25626     3  0.1753    0.62479 0.048 0.000 0.952
#> GSM25627     3  0.3112    0.57978 0.004 0.096 0.900
#> GSM25628     3  0.0829    0.62972 0.004 0.012 0.984
#> GSM25629     3  0.2878    0.57536 0.000 0.096 0.904
#> GSM25630     3  0.5291    0.50785 0.268 0.000 0.732
#> GSM25631     3  0.3715    0.55131 0.004 0.128 0.868
#> GSM25632     3  0.6215    0.25186 0.428 0.000 0.572
#> GSM25633     1  0.3192    0.70192 0.888 0.000 0.112
#> GSM25634     1  0.2959    0.70871 0.900 0.000 0.100
#> GSM25635     1  0.2599    0.73232 0.932 0.016 0.052
#> GSM25656     3  0.1878    0.62275 0.004 0.044 0.952
#> GSM25657     1  0.5138    0.55144 0.748 0.000 0.252
#> GSM25658     3  0.5098    0.52910 0.248 0.000 0.752
#> GSM25659     3  0.6244    0.22135 0.440 0.000 0.560
#> GSM25660     1  0.2066    0.72761 0.940 0.000 0.060
#> GSM25661     1  0.1765    0.73243 0.956 0.004 0.040
#> GSM25662     2  0.6154    0.44704 0.000 0.592 0.408
#> GSM25663     2  0.5397    0.62061 0.000 0.720 0.280
#> GSM25680     2  0.6286    0.33783 0.000 0.536 0.464
#> GSM25681     3  0.6267   -0.15885 0.000 0.452 0.548
#> GSM25682     2  0.0475    0.76059 0.004 0.992 0.004
#> GSM25683     2  0.2261    0.75855 0.000 0.932 0.068
#> GSM25684     2  0.6045    0.49290 0.000 0.620 0.380
#> GSM25685     3  0.6291   -0.21688 0.000 0.468 0.532
#> GSM25686     2  0.0237    0.76099 0.000 0.996 0.004
#> GSM25687     2  0.1031    0.75668 0.024 0.976 0.000
#> GSM48664     1  0.3816    0.65602 0.852 0.148 0.000
#> GSM48665     1  0.3816    0.65593 0.852 0.148 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     4  0.3806     0.6732 0.000 0.156 0.020 0.824
#> GSM25549     4  0.1854     0.6988 0.000 0.048 0.012 0.940
#> GSM25550     4  0.1042     0.6789 0.008 0.020 0.000 0.972
#> GSM25551     2  0.3324     0.5287 0.000 0.852 0.012 0.136
#> GSM25570     4  0.1305     0.6959 0.000 0.036 0.004 0.960
#> GSM25571     4  0.2412     0.6986 0.000 0.084 0.008 0.908
#> GSM25358     1  0.6295     0.2651 0.496 0.460 0.024 0.020
#> GSM25359     2  0.5136     0.4501 0.004 0.752 0.188 0.056
#> GSM25360     3  0.0992     0.5996 0.012 0.008 0.976 0.004
#> GSM25361     3  0.2048     0.5952 0.000 0.008 0.928 0.064
#> GSM25377     1  0.3325     0.6870 0.864 0.112 0.000 0.024
#> GSM25378     1  0.4499     0.6581 0.792 0.160 0.000 0.048
#> GSM25401     2  0.4936     0.2426 0.280 0.700 0.020 0.000
#> GSM25402     1  0.5345     0.4194 0.584 0.404 0.008 0.004
#> GSM25349     2  0.5980     0.2107 0.044 0.560 0.000 0.396
#> GSM25350     4  0.5398     0.2342 0.016 0.404 0.000 0.580
#> GSM25356     1  0.4832     0.6405 0.768 0.176 0.000 0.056
#> GSM25357     2  0.5272     0.4445 0.112 0.752 0.000 0.136
#> GSM25385     1  0.7002     0.2950 0.568 0.164 0.268 0.000
#> GSM25386     3  0.7133     0.4698 0.144 0.344 0.512 0.000
#> GSM25399     1  0.1716     0.7075 0.936 0.064 0.000 0.000
#> GSM25400     1  0.1557     0.7095 0.944 0.056 0.000 0.000
#> GSM48659     2  0.7748     0.2576 0.000 0.436 0.304 0.260
#> GSM48660     2  0.5165     0.0773 0.004 0.512 0.000 0.484
#> GSM25409     4  0.4706     0.5801 0.020 0.248 0.000 0.732
#> GSM25410     2  0.7914    -0.3911 0.332 0.356 0.312 0.000
#> GSM25426     2  0.1510     0.5051 0.000 0.956 0.028 0.016
#> GSM25427     1  0.5392     0.6226 0.724 0.072 0.000 0.204
#> GSM25540     3  0.3271     0.5743 0.000 0.132 0.856 0.012
#> GSM25541     3  0.1724     0.6005 0.000 0.032 0.948 0.020
#> GSM25542     2  0.5218     0.4727 0.000 0.736 0.200 0.064
#> GSM25543     2  0.6943     0.2240 0.004 0.540 0.348 0.108
#> GSM25479     1  0.5982     0.6181 0.684 0.000 0.112 0.204
#> GSM25480     1  0.7646     0.2468 0.408 0.000 0.208 0.384
#> GSM25481     1  0.7390     0.3111 0.512 0.204 0.000 0.284
#> GSM25482     1  0.7120     0.1312 0.436 0.128 0.000 0.436
#> GSM48654     2  0.7536     0.3030 0.000 0.488 0.228 0.284
#> GSM48650     2  0.2654     0.5230 0.004 0.888 0.000 0.108
#> GSM48651     2  0.5517     0.4110 0.000 0.648 0.036 0.316
#> GSM48652     2  0.5907     0.4791 0.000 0.680 0.092 0.228
#> GSM48653     2  0.6675     0.4460 0.000 0.616 0.228 0.156
#> GSM48662     4  0.5203     0.4211 0.000 0.348 0.016 0.636
#> GSM48663     2  0.5931     0.0428 0.036 0.504 0.000 0.460
#> GSM25524     3  0.2530     0.5628 0.112 0.000 0.888 0.000
#> GSM25525     3  0.7002     0.1192 0.352 0.000 0.520 0.128
#> GSM25526     3  0.7910     0.2650 0.332 0.308 0.360 0.000
#> GSM25527     1  0.5144     0.6000 0.732 0.000 0.216 0.052
#> GSM25528     3  0.4608     0.3612 0.304 0.000 0.692 0.004
#> GSM25529     3  0.6701     0.2102 0.328 0.000 0.564 0.108
#> GSM25530     1  0.5913     0.3491 0.600 0.048 0.352 0.000
#> GSM25531     1  0.3047     0.6761 0.872 0.012 0.116 0.000
#> GSM48661     3  0.6238     0.3362 0.000 0.276 0.632 0.092
#> GSM25561     3  0.4051     0.4962 0.208 0.004 0.784 0.004
#> GSM25562     1  0.3432     0.6935 0.860 0.012 0.120 0.008
#> GSM25563     3  0.5963     0.5159 0.196 0.116 0.688 0.000
#> GSM25564     3  0.8951     0.2213 0.116 0.152 0.472 0.260
#> GSM25565     2  0.5272     0.4502 0.000 0.680 0.032 0.288
#> GSM25566     2  0.5444     0.2475 0.000 0.560 0.016 0.424
#> GSM25568     3  0.8256    -0.1909 0.020 0.216 0.384 0.380
#> GSM25569     4  0.5632     0.4108 0.000 0.340 0.036 0.624
#> GSM25552     4  0.0712     0.6680 0.004 0.004 0.008 0.984
#> GSM25553     4  0.1733     0.6205 0.028 0.000 0.024 0.948
#> GSM25578     1  0.4938     0.6621 0.772 0.000 0.148 0.080
#> GSM25579     3  0.7661     0.1872 0.212 0.000 0.412 0.376
#> GSM25580     1  0.2142     0.7220 0.928 0.000 0.016 0.056
#> GSM25581     1  0.3691     0.7089 0.856 0.000 0.076 0.068
#> GSM48655     2  0.4977     0.1575 0.000 0.540 0.000 0.460
#> GSM48656     4  0.5041     0.5959 0.000 0.232 0.040 0.728
#> GSM48657     2  0.5220     0.2245 0.008 0.568 0.000 0.424
#> GSM48658     3  0.6788     0.2558 0.000 0.144 0.592 0.264
#> GSM25624     1  0.2473     0.7215 0.908 0.000 0.012 0.080
#> GSM25625     3  0.6971     0.2330 0.372 0.120 0.508 0.000
#> GSM25626     3  0.7148     0.4596 0.140 0.364 0.496 0.000
#> GSM25627     2  0.4677     0.2648 0.040 0.768 0.192 0.000
#> GSM25628     3  0.4608     0.4998 0.004 0.304 0.692 0.000
#> GSM25629     3  0.4998     0.2603 0.000 0.488 0.512 0.000
#> GSM25630     3  0.4060     0.5728 0.112 0.048 0.836 0.004
#> GSM25631     3  0.4540     0.4847 0.004 0.008 0.740 0.248
#> GSM25632     1  0.6637     0.2938 0.572 0.104 0.324 0.000
#> GSM25633     1  0.2706     0.7135 0.900 0.000 0.080 0.020
#> GSM25634     1  0.2363     0.7187 0.920 0.000 0.056 0.024
#> GSM25635     1  0.4227     0.7008 0.820 0.000 0.060 0.120
#> GSM25656     3  0.4819     0.4635 0.004 0.344 0.652 0.000
#> GSM25657     1  0.2737     0.7007 0.888 0.000 0.104 0.008
#> GSM25658     3  0.7849     0.2279 0.352 0.268 0.380 0.000
#> GSM25659     3  0.5515     0.5143 0.116 0.000 0.732 0.152
#> GSM25660     1  0.6887     0.4890 0.560 0.000 0.132 0.308
#> GSM25661     1  0.2919     0.7200 0.896 0.000 0.044 0.060
#> GSM25662     2  0.5031     0.5244 0.000 0.768 0.092 0.140
#> GSM25663     4  0.7185     0.2757 0.000 0.284 0.176 0.540
#> GSM25680     3  0.7249    -0.0538 0.000 0.144 0.444 0.412
#> GSM25681     3  0.5937     0.0768 0.000 0.036 0.492 0.472
#> GSM25682     2  0.5097     0.2312 0.004 0.568 0.000 0.428
#> GSM25683     2  0.3528     0.5038 0.000 0.808 0.000 0.192
#> GSM25684     2  0.6465     0.4634 0.000 0.636 0.136 0.228
#> GSM25685     2  0.3554     0.4933 0.000 0.844 0.136 0.020
#> GSM25686     2  0.4955     0.1902 0.000 0.556 0.000 0.444
#> GSM25687     2  0.5132     0.1802 0.004 0.548 0.000 0.448
#> GSM48664     1  0.2313     0.7140 0.924 0.044 0.000 0.032
#> GSM48665     1  0.2867     0.7152 0.884 0.012 0.000 0.104

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     5   0.495    0.45955 0.000 0.256 0.000 0.068 0.676
#> GSM25549     5   0.434    0.51059 0.004 0.268 0.000 0.020 0.708
#> GSM25550     5   0.394    0.57263 0.016 0.208 0.000 0.008 0.768
#> GSM25551     4   0.481    0.55521 0.004 0.208 0.004 0.724 0.060
#> GSM25570     5   0.384    0.57944 0.008 0.196 0.000 0.016 0.780
#> GSM25571     5   0.430    0.54710 0.000 0.216 0.000 0.044 0.740
#> GSM25358     4   0.570    0.22885 0.328 0.052 0.000 0.596 0.024
#> GSM25359     4   0.546    0.55128 0.008 0.160 0.064 0.724 0.044
#> GSM25360     3   0.383    0.63728 0.040 0.004 0.844 0.056 0.056
#> GSM25361     3   0.515    0.55544 0.028 0.008 0.720 0.040 0.204
#> GSM25377     1   0.634    0.55432 0.684 0.140 0.032 0.088 0.056
#> GSM25378     1   0.548    0.60645 0.700 0.036 0.004 0.200 0.060
#> GSM25401     4   0.506    0.54281 0.164 0.120 0.000 0.712 0.004
#> GSM25402     1   0.710    0.13543 0.464 0.100 0.020 0.384 0.032
#> GSM25349     2   0.367    0.57813 0.008 0.848 0.012 0.064 0.068
#> GSM25350     2   0.466    0.54407 0.008 0.768 0.012 0.060 0.152
#> GSM25356     1   0.566    0.59475 0.700 0.040 0.004 0.172 0.084
#> GSM25357     4   0.565    0.40741 0.024 0.316 0.000 0.608 0.052
#> GSM25385     1   0.788    0.20480 0.436 0.024 0.216 0.284 0.040
#> GSM25386     3   0.803    0.48862 0.084 0.152 0.532 0.180 0.052
#> GSM25399     1   0.452    0.63113 0.816 0.056 0.028 0.052 0.048
#> GSM25400     1   0.287    0.66329 0.880 0.012 0.008 0.092 0.008
#> GSM48659     2   0.803    0.26977 0.000 0.424 0.256 0.192 0.128
#> GSM48660     2   0.253    0.58181 0.008 0.912 0.020 0.020 0.040
#> GSM25409     2   0.492    0.23452 0.000 0.556 0.000 0.028 0.416
#> GSM25410     3   0.893    0.40551 0.152 0.172 0.420 0.200 0.056
#> GSM25426     4   0.390    0.57368 0.000 0.216 0.012 0.764 0.008
#> GSM25427     1   0.713    0.47983 0.576 0.216 0.016 0.056 0.136
#> GSM25540     3   0.474    0.59707 0.004 0.020 0.760 0.160 0.056
#> GSM25541     3   0.552    0.59724 0.020 0.008 0.712 0.120 0.140
#> GSM25542     2   0.701    0.11816 0.000 0.476 0.332 0.156 0.036
#> GSM25543     2   0.685    0.00524 0.000 0.468 0.376 0.116 0.040
#> GSM25479     1   0.467    0.48829 0.656 0.004 0.016 0.004 0.320
#> GSM25480     5   0.557    0.02246 0.380 0.000 0.044 0.016 0.560
#> GSM25481     1   0.801    0.20452 0.392 0.352 0.012 0.084 0.160
#> GSM25482     1   0.797    0.13107 0.384 0.296 0.008 0.060 0.252
#> GSM48654     2   0.589    0.50341 0.000 0.656 0.224 0.068 0.052
#> GSM48650     2   0.476    0.02347 0.000 0.552 0.012 0.432 0.004
#> GSM48651     2   0.418    0.56680 0.000 0.812 0.052 0.100 0.036
#> GSM48652     2   0.472    0.53313 0.000 0.768 0.072 0.132 0.028
#> GSM48653     2   0.670    0.35484 0.000 0.572 0.188 0.204 0.036
#> GSM48662     2   0.353    0.55746 0.000 0.820 0.016 0.012 0.152
#> GSM48663     2   0.361    0.55481 0.016 0.860 0.020 0.048 0.056
#> GSM25524     3   0.595    0.56104 0.132 0.000 0.688 0.100 0.080
#> GSM25525     1   0.737    0.17793 0.408 0.000 0.256 0.032 0.304
#> GSM25526     4   0.575    0.24550 0.252 0.000 0.124 0.620 0.004
#> GSM25527     1   0.562    0.60214 0.712 0.000 0.060 0.100 0.128
#> GSM25528     3   0.632    0.28786 0.320 0.000 0.560 0.036 0.084
#> GSM25529     1   0.743    0.01157 0.332 0.000 0.320 0.028 0.320
#> GSM25530     1   0.538    0.51080 0.692 0.000 0.196 0.096 0.016
#> GSM25531     1   0.320    0.64965 0.864 0.000 0.052 0.076 0.008
#> GSM48661     3   0.600    0.44253 0.000 0.228 0.636 0.108 0.028
#> GSM25561     3   0.602    0.56487 0.144 0.076 0.704 0.044 0.032
#> GSM25562     1   0.825    0.26551 0.484 0.184 0.212 0.052 0.068
#> GSM25563     3   0.677    0.59002 0.096 0.096 0.664 0.100 0.044
#> GSM25564     2   0.878    0.08388 0.148 0.400 0.280 0.052 0.120
#> GSM25565     2   0.563    0.53279 0.000 0.684 0.052 0.204 0.060
#> GSM25566     2   0.660    0.42410 0.000 0.532 0.012 0.228 0.228
#> GSM25568     2   0.696    0.10032 0.016 0.528 0.328 0.064 0.064
#> GSM25569     2   0.448    0.55290 0.000 0.776 0.068 0.016 0.140
#> GSM25552     5   0.358    0.57781 0.004 0.204 0.000 0.008 0.784
#> GSM25553     5   0.426    0.56157 0.020 0.192 0.016 0.004 0.768
#> GSM25578     1   0.380    0.64427 0.812 0.000 0.032 0.012 0.144
#> GSM25579     5   0.616    0.22993 0.248 0.000 0.128 0.020 0.604
#> GSM25580     1   0.263    0.67404 0.904 0.004 0.024 0.016 0.052
#> GSM25581     1   0.366    0.65975 0.832 0.000 0.044 0.012 0.112
#> GSM48655     2   0.526    0.53349 0.000 0.680 0.000 0.144 0.176
#> GSM48656     2   0.437    0.46074 0.000 0.712 0.024 0.004 0.260
#> GSM48657     2   0.491    0.54317 0.008 0.736 0.000 0.136 0.120
#> GSM48658     3   0.745    0.19337 0.000 0.260 0.496 0.084 0.160
#> GSM25624     1   0.412    0.66442 0.816 0.008 0.024 0.036 0.116
#> GSM25625     1   0.734   -0.13211 0.348 0.004 0.340 0.292 0.016
#> GSM25626     3   0.749    0.40490 0.080 0.072 0.464 0.360 0.024
#> GSM25627     4   0.376    0.59300 0.032 0.096 0.036 0.836 0.000
#> GSM25628     3   0.520    0.57328 0.012 0.060 0.692 0.232 0.004
#> GSM25629     4   0.501    0.50277 0.012 0.072 0.148 0.752 0.016
#> GSM25630     3   0.523    0.61276 0.072 0.092 0.768 0.032 0.036
#> GSM25631     3   0.578    0.24022 0.008 0.052 0.544 0.008 0.388
#> GSM25632     1   0.723    0.23279 0.504 0.008 0.288 0.160 0.040
#> GSM25633     1   0.267    0.66991 0.900 0.000 0.036 0.020 0.044
#> GSM25634     1   0.292    0.67373 0.892 0.004 0.048 0.028 0.028
#> GSM25635     1   0.535    0.59343 0.700 0.012 0.016 0.056 0.216
#> GSM25656     3   0.627    0.35369 0.004 0.092 0.496 0.396 0.012
#> GSM25657     1   0.223    0.66726 0.920 0.000 0.032 0.036 0.012
#> GSM25658     4   0.646    0.13690 0.304 0.008 0.148 0.536 0.004
#> GSM25659     3   0.709    0.41827 0.160 0.016 0.560 0.036 0.228
#> GSM25660     5   0.557   -0.21849 0.464 0.004 0.040 0.008 0.484
#> GSM25661     1   0.280    0.66847 0.880 0.000 0.016 0.012 0.092
#> GSM25662     4   0.593    0.33020 0.000 0.352 0.052 0.564 0.032
#> GSM25663     5   0.750    0.11396 0.000 0.312 0.076 0.156 0.456
#> GSM25680     5   0.788    0.30952 0.000 0.172 0.204 0.152 0.472
#> GSM25681     5   0.606    0.35651 0.004 0.080 0.244 0.036 0.636
#> GSM25682     2   0.643    0.36258 0.000 0.504 0.000 0.272 0.224
#> GSM25683     4   0.574    0.16114 0.000 0.400 0.004 0.520 0.076
#> GSM25684     4   0.668    0.15642 0.000 0.380 0.036 0.480 0.104
#> GSM25685     4   0.416    0.57692 0.000 0.200 0.024 0.764 0.012
#> GSM25686     2   0.618    0.40337 0.000 0.552 0.000 0.252 0.196
#> GSM25687     2   0.620    0.43341 0.000 0.552 0.000 0.212 0.236
#> GSM48664     1   0.441    0.64801 0.820 0.056 0.020 0.056 0.048
#> GSM48665     1   0.406    0.65758 0.832 0.040 0.008 0.044 0.076

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM25548     5   0.168     0.6214 0.004 0.016 0.000 0.040 0.936 0.004
#> GSM25549     5   0.191     0.6160 0.008 0.032 0.004 0.012 0.932 0.012
#> GSM25550     5   0.208     0.5985 0.020 0.040 0.004 0.000 0.920 0.016
#> GSM25551     4   0.305     0.5593 0.000 0.008 0.020 0.856 0.100 0.016
#> GSM25570     5   0.149     0.6125 0.008 0.008 0.000 0.008 0.948 0.028
#> GSM25571     5   0.248     0.6192 0.008 0.008 0.004 0.056 0.900 0.024
#> GSM25358     4   0.800     0.0287 0.152 0.016 0.300 0.364 0.152 0.016
#> GSM25359     3   0.717    -0.0153 0.008 0.028 0.412 0.292 0.240 0.020
#> GSM25360     3   0.529     0.2299 0.036 0.016 0.536 0.004 0.008 0.400
#> GSM25361     6   0.570     0.3169 0.016 0.020 0.200 0.004 0.116 0.644
#> GSM25377     1   0.607     0.4874 0.580 0.228 0.152 0.008 0.000 0.032
#> GSM25378     1   0.695     0.5563 0.596 0.040 0.144 0.120 0.084 0.016
#> GSM25401     4   0.496     0.4499 0.188 0.044 0.052 0.708 0.000 0.008
#> GSM25402     1   0.705     0.1116 0.424 0.096 0.108 0.356 0.000 0.016
#> GSM25349     2   0.634     0.4216 0.004 0.576 0.124 0.084 0.212 0.000
#> GSM25350     2   0.670     0.1216 0.004 0.428 0.144 0.048 0.372 0.004
#> GSM25356     1   0.710     0.5490 0.600 0.048 0.112 0.092 0.120 0.028
#> GSM25357     4   0.554     0.4557 0.012 0.044 0.088 0.688 0.160 0.008
#> GSM25385     3   0.589     0.3961 0.224 0.012 0.624 0.100 0.004 0.036
#> GSM25386     3   0.333     0.5221 0.028 0.032 0.864 0.044 0.004 0.028
#> GSM25399     1   0.492     0.6057 0.712 0.152 0.096 0.000 0.000 0.040
#> GSM25400     1   0.367     0.6704 0.832 0.016 0.052 0.076 0.000 0.024
#> GSM48659     4   0.802    -0.1472 0.000 0.272 0.032 0.336 0.136 0.224
#> GSM48660     2   0.418     0.5428 0.004 0.788 0.036 0.072 0.100 0.000
#> GSM25409     5   0.466     0.4579 0.004 0.236 0.028 0.028 0.700 0.004
#> GSM25410     3   0.367     0.5189 0.048 0.036 0.840 0.060 0.008 0.008
#> GSM25426     4   0.189     0.5624 0.000 0.024 0.044 0.924 0.008 0.000
#> GSM25427     1   0.797     0.2524 0.404 0.264 0.144 0.008 0.148 0.032
#> GSM25540     6   0.628    -0.0678 0.000 0.036 0.384 0.064 0.032 0.484
#> GSM25541     6   0.581     0.1553 0.008 0.016 0.300 0.036 0.048 0.592
#> GSM25542     3   0.531     0.4216 0.000 0.232 0.660 0.068 0.016 0.024
#> GSM25543     3   0.509     0.3917 0.000 0.280 0.644 0.040 0.012 0.024
#> GSM25479     1   0.499     0.6001 0.708 0.020 0.004 0.004 0.100 0.164
#> GSM25480     1   0.699     0.3104 0.476 0.020 0.024 0.012 0.256 0.212
#> GSM25481     2   0.757     0.1281 0.292 0.440 0.108 0.020 0.128 0.012
#> GSM25482     2   0.780     0.0499 0.308 0.352 0.080 0.024 0.228 0.008
#> GSM48654     2   0.713     0.4210 0.000 0.536 0.048 0.208 0.096 0.112
#> GSM48650     4   0.532    -0.0397 0.000 0.392 0.028 0.536 0.040 0.004
#> GSM48651     2   0.584     0.4502 0.000 0.616 0.016 0.244 0.084 0.040
#> GSM48652     2   0.599     0.4099 0.000 0.580 0.028 0.288 0.072 0.032
#> GSM48653     2   0.731     0.1593 0.000 0.392 0.044 0.368 0.056 0.140
#> GSM48662     2   0.536     0.5122 0.000 0.692 0.016 0.088 0.164 0.040
#> GSM48663     2   0.444     0.5282 0.008 0.784 0.060 0.056 0.088 0.004
#> GSM25524     6   0.494     0.3471 0.112 0.016 0.136 0.016 0.000 0.720
#> GSM25525     6   0.571    -0.0644 0.392 0.008 0.008 0.000 0.100 0.492
#> GSM25526     4   0.691     0.1894 0.256 0.008 0.112 0.500 0.000 0.124
#> GSM25527     1   0.486     0.5663 0.680 0.012 0.008 0.024 0.020 0.256
#> GSM25528     6   0.622     0.2481 0.320 0.020 0.148 0.004 0.004 0.504
#> GSM25529     6   0.553     0.0357 0.368 0.000 0.020 0.000 0.084 0.528
#> GSM25530     1   0.566     0.5376 0.668 0.036 0.144 0.020 0.000 0.132
#> GSM25531     1   0.353     0.6769 0.836 0.016 0.036 0.020 0.000 0.092
#> GSM48661     6   0.785     0.0710 0.000 0.228 0.192 0.152 0.028 0.400
#> GSM25561     3   0.644     0.3995 0.080 0.148 0.564 0.004 0.000 0.204
#> GSM25562     2   0.687    -0.1532 0.372 0.408 0.148 0.008 0.000 0.064
#> GSM25563     3   0.594     0.4106 0.036 0.144 0.608 0.008 0.000 0.204
#> GSM25564     2   0.851     0.0849 0.176 0.380 0.040 0.076 0.064 0.264
#> GSM25565     5   0.808    -0.0495 0.000 0.240 0.236 0.208 0.296 0.020
#> GSM25566     5   0.662     0.3709 0.000 0.120 0.068 0.308 0.496 0.008
#> GSM25568     2   0.506     0.2753 0.000 0.644 0.284 0.016 0.028 0.028
#> GSM25569     2   0.627     0.4621 0.000 0.604 0.104 0.052 0.212 0.028
#> GSM25552     5   0.200     0.5957 0.004 0.044 0.004 0.000 0.920 0.028
#> GSM25553     5   0.310     0.5723 0.012 0.064 0.012 0.004 0.868 0.040
#> GSM25578     1   0.442     0.6548 0.772 0.008 0.032 0.004 0.052 0.132
#> GSM25579     5   0.681    -0.2401 0.248 0.008 0.020 0.004 0.368 0.352
#> GSM25580     1   0.294     0.6975 0.876 0.052 0.024 0.000 0.008 0.040
#> GSM25581     1   0.374     0.6846 0.820 0.016 0.028 0.000 0.028 0.108
#> GSM48655     5   0.687     0.0353 0.004 0.316 0.032 0.248 0.396 0.004
#> GSM48656     2   0.665     0.4275 0.008 0.560 0.024 0.088 0.256 0.064
#> GSM48657     2   0.613     0.3484 0.012 0.516 0.008 0.316 0.144 0.004
#> GSM48658     6   0.716     0.2273 0.000 0.164 0.060 0.112 0.112 0.552
#> GSM25624     1   0.563     0.6568 0.712 0.020 0.096 0.016 0.080 0.076
#> GSM25625     3   0.777     0.1940 0.288 0.012 0.340 0.204 0.000 0.156
#> GSM25626     3   0.535     0.4838 0.044 0.012 0.692 0.160 0.000 0.092
#> GSM25627     4   0.379     0.5272 0.020 0.028 0.068 0.828 0.000 0.056
#> GSM25628     3   0.658     0.3466 0.008 0.080 0.520 0.108 0.000 0.284
#> GSM25629     4   0.434     0.4971 0.008 0.012 0.064 0.752 0.000 0.164
#> GSM25630     3   0.626     0.3388 0.036 0.148 0.524 0.004 0.000 0.288
#> GSM25631     6   0.506     0.3833 0.004 0.028 0.056 0.008 0.212 0.692
#> GSM25632     3   0.619     0.2965 0.324 0.012 0.528 0.040 0.000 0.096
#> GSM25633     1   0.351     0.6910 0.840 0.016 0.056 0.000 0.016 0.072
#> GSM25634     1   0.413     0.6738 0.792 0.028 0.108 0.000 0.008 0.064
#> GSM25635     1   0.624     0.6094 0.644 0.020 0.056 0.016 0.160 0.104
#> GSM25656     3   0.723     0.2849 0.012 0.080 0.464 0.252 0.004 0.188
#> GSM25657     1   0.326     0.6821 0.860 0.036 0.040 0.012 0.000 0.052
#> GSM25658     4   0.712     0.1471 0.276 0.028 0.048 0.456 0.000 0.192
#> GSM25659     6   0.587     0.4133 0.116 0.120 0.020 0.024 0.036 0.684
#> GSM25660     1   0.642     0.4339 0.520 0.016 0.020 0.000 0.248 0.196
#> GSM25661     1   0.316     0.6890 0.860 0.020 0.020 0.000 0.020 0.080
#> GSM25662     4   0.478     0.4680 0.000 0.100 0.028 0.756 0.088 0.028
#> GSM25663     5   0.567     0.5482 0.000 0.044 0.044 0.164 0.680 0.068
#> GSM25680     5   0.659     0.4657 0.004 0.028 0.084 0.104 0.600 0.180
#> GSM25681     5   0.577     0.4584 0.008 0.020 0.112 0.028 0.664 0.168
#> GSM25682     5   0.612     0.4323 0.000 0.100 0.048 0.284 0.560 0.008
#> GSM25683     4   0.618     0.1689 0.000 0.064 0.084 0.556 0.288 0.008
#> GSM25684     4   0.607     0.3478 0.000 0.136 0.016 0.636 0.144 0.068
#> GSM25685     4   0.252     0.5543 0.000 0.048 0.020 0.900 0.016 0.016
#> GSM25686     5   0.613     0.4143 0.000 0.140 0.032 0.284 0.540 0.004
#> GSM25687     5   0.602     0.3960 0.000 0.156 0.020 0.280 0.540 0.004
#> GSM48664     1   0.451     0.6392 0.764 0.120 0.072 0.000 0.008 0.036
#> GSM48665     1   0.456     0.6846 0.792 0.068 0.044 0.012 0.060 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-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 genotype/variation(p) k
#> SD:NMF 93              0.000161 2
#> SD:NMF 65              0.001513 3
#> SD:NMF 43              0.026032 4
#> SD:NMF 53              0.000379 5
#> SD:NMF 36              0.001702 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.1196           0.608       0.797         0.2919 0.904   0.904
#> 3 3 0.0831           0.458       0.705         0.6555 0.594   0.563
#> 4 4 0.1106           0.484       0.683         0.1561 0.951   0.911
#> 5 5 0.1597           0.416       0.667         0.0746 0.923   0.853
#> 6 6 0.2446           0.385       0.656         0.0800 0.953   0.896

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
#> GSM25548     2   0.416    0.75855 0.084 0.916
#> GSM25549     2   0.430    0.75930 0.088 0.912
#> GSM25550     2   0.430    0.75883 0.088 0.912
#> GSM25551     2   0.388    0.75996 0.076 0.924
#> GSM25570     2   0.388    0.75839 0.076 0.924
#> GSM25571     2   0.388    0.75839 0.076 0.924
#> GSM25358     2   0.574    0.76026 0.136 0.864
#> GSM25359     2   0.529    0.76348 0.120 0.880
#> GSM25360     2   0.653    0.74517 0.168 0.832
#> GSM25361     2   0.625    0.75523 0.156 0.844
#> GSM25377     1   0.753    0.65256 0.784 0.216
#> GSM25378     2   0.891    0.54894 0.308 0.692
#> GSM25401     2   0.767    0.69313 0.224 0.776
#> GSM25402     2   0.745    0.71365 0.212 0.788
#> GSM25349     2   0.443    0.75329 0.092 0.908
#> GSM25350     2   0.430    0.75407 0.088 0.912
#> GSM25356     2   0.795    0.66180 0.240 0.760
#> GSM25357     2   0.781    0.67075 0.232 0.768
#> GSM25385     2   0.802    0.69494 0.244 0.756
#> GSM25386     2   0.714    0.72306 0.196 0.804
#> GSM25399     1   0.584    0.66524 0.860 0.140
#> GSM25400     2   0.949    0.41916 0.368 0.632
#> GSM48659     2   0.224    0.75598 0.036 0.964
#> GSM48660     2   0.278    0.75020 0.048 0.952
#> GSM25409     2   0.343    0.76408 0.064 0.936
#> GSM25410     2   0.722    0.72643 0.200 0.800
#> GSM25426     2   0.388    0.75996 0.076 0.924
#> GSM25427     2   0.971    0.29253 0.400 0.600
#> GSM25540     2   0.373    0.76432 0.072 0.928
#> GSM25541     2   0.373    0.76432 0.072 0.928
#> GSM25542     2   0.518    0.75125 0.116 0.884
#> GSM25543     2   0.634    0.73751 0.160 0.840
#> GSM25479     2   0.981    0.21055 0.420 0.580
#> GSM25480     2   0.988    0.18073 0.436 0.564
#> GSM25481     2   0.871    0.53552 0.292 0.708
#> GSM25482     2   0.871    0.53552 0.292 0.708
#> GSM48654     2   0.242    0.75253 0.040 0.960
#> GSM48650     2   0.311    0.75329 0.056 0.944
#> GSM48651     2   0.260    0.74974 0.044 0.956
#> GSM48652     2   0.295    0.75114 0.052 0.948
#> GSM48653     2   0.242    0.75218 0.040 0.960
#> GSM48662     2   0.242    0.75197 0.040 0.960
#> GSM48663     2   0.430    0.74875 0.088 0.912
#> GSM25524     2   0.921    0.55100 0.336 0.664
#> GSM25525     2   0.996    0.09594 0.464 0.536
#> GSM25526     2   0.861    0.62484 0.284 0.716
#> GSM25527     2   0.963    0.38155 0.388 0.612
#> GSM25528     2   0.925    0.54790 0.340 0.660
#> GSM25529     2   0.999    0.02589 0.484 0.516
#> GSM25530     2   0.909    0.56270 0.324 0.676
#> GSM25531     2   0.929    0.52149 0.344 0.656
#> GSM48661     2   0.278    0.75754 0.048 0.952
#> GSM25561     2   0.760    0.71994 0.220 0.780
#> GSM25562     2   0.886    0.62064 0.304 0.696
#> GSM25563     2   0.808    0.68663 0.248 0.752
#> GSM25564     2   0.781    0.70280 0.232 0.768
#> GSM25565     2   0.311    0.76284 0.056 0.944
#> GSM25566     2   0.163    0.75616 0.024 0.976
#> GSM25568     2   0.469    0.74006 0.100 0.900
#> GSM25569     2   0.311    0.75734 0.056 0.944
#> GSM25552     2   0.574    0.75467 0.136 0.864
#> GSM25553     2   0.662    0.73945 0.172 0.828
#> GSM25578     2   0.994    0.05658 0.456 0.544
#> GSM25579     2   0.932    0.51237 0.348 0.652
#> GSM25580     2   0.999   -0.09871 0.484 0.516
#> GSM25581     2   0.998   -0.05934 0.476 0.524
#> GSM48655     2   0.295    0.75097 0.052 0.948
#> GSM48656     2   0.260    0.75563 0.044 0.956
#> GSM48657     2   0.295    0.75097 0.052 0.948
#> GSM48658     2   0.242    0.75608 0.040 0.960
#> GSM25624     2   0.966    0.32333 0.392 0.608
#> GSM25625     2   0.876    0.59709 0.296 0.704
#> GSM25626     2   0.689    0.73273 0.184 0.816
#> GSM25627     2   0.855    0.62739 0.280 0.720
#> GSM25628     2   0.671    0.73605 0.176 0.824
#> GSM25629     2   0.388    0.75996 0.076 0.924
#> GSM25630     2   0.876    0.63051 0.296 0.704
#> GSM25631     2   0.388    0.76125 0.076 0.924
#> GSM25632     2   0.980    0.38246 0.416 0.584
#> GSM25633     2   0.995   -0.00802 0.460 0.540
#> GSM25634     2   0.978    0.28765 0.412 0.588
#> GSM25635     2   0.978    0.24352 0.412 0.588
#> GSM25656     2   0.738    0.72138 0.208 0.792
#> GSM25657     1   1.000    0.08240 0.504 0.496
#> GSM25658     2   0.866    0.61832 0.288 0.712
#> GSM25659     2   0.738    0.70611 0.208 0.792
#> GSM25660     2   0.985    0.20530 0.428 0.572
#> GSM25661     2   0.994    0.03749 0.456 0.544
#> GSM25662     2   0.373    0.76061 0.072 0.928
#> GSM25663     2   0.373    0.76061 0.072 0.928
#> GSM25680     2   0.529    0.75951 0.120 0.880
#> GSM25681     2   0.541    0.75990 0.124 0.876
#> GSM25682     2   0.204    0.75327 0.032 0.968
#> GSM25683     2   0.204    0.75327 0.032 0.968
#> GSM25684     2   0.224    0.75644 0.036 0.964
#> GSM25685     2   0.358    0.76388 0.068 0.932
#> GSM25686     2   0.204    0.75327 0.032 0.968
#> GSM25687     2   0.204    0.75327 0.032 0.968
#> GSM48664     1   0.574    0.66479 0.864 0.136
#> GSM48665     1   1.000    0.11134 0.508 0.492

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2   0.585     0.6659 0.140 0.792 0.068
#> GSM25549     2   0.621     0.6636 0.152 0.772 0.076
#> GSM25550     2   0.591     0.6680 0.144 0.788 0.068
#> GSM25551     2   0.475     0.6874 0.076 0.852 0.072
#> GSM25570     2   0.591     0.6635 0.144 0.788 0.068
#> GSM25571     2   0.591     0.6635 0.144 0.788 0.068
#> GSM25358     2   0.670     0.6501 0.164 0.744 0.092
#> GSM25359     2   0.651     0.6664 0.156 0.756 0.088
#> GSM25360     2   0.924     0.1519 0.264 0.528 0.208
#> GSM25361     2   0.866     0.3611 0.244 0.592 0.164
#> GSM25377     1   0.850     0.1190 0.544 0.104 0.352
#> GSM25378     1   0.828     0.2942 0.472 0.452 0.076
#> GSM25401     2   0.811     0.4227 0.272 0.620 0.108
#> GSM25402     2   0.781     0.4931 0.244 0.652 0.104
#> GSM25349     2   0.415     0.6816 0.044 0.876 0.080
#> GSM25350     2   0.425     0.6825 0.048 0.872 0.080
#> GSM25356     2   0.747     0.5152 0.216 0.684 0.100
#> GSM25357     2   0.736     0.5271 0.212 0.692 0.096
#> GSM25385     2   0.914     0.0524 0.360 0.488 0.152
#> GSM25386     2   0.946    -0.0486 0.248 0.500 0.252
#> GSM25399     1   0.753     0.0868 0.564 0.044 0.392
#> GSM25400     1   0.776     0.4140 0.564 0.380 0.056
#> GSM48659     2   0.231     0.7132 0.032 0.944 0.024
#> GSM48660     2   0.253     0.6989 0.020 0.936 0.044
#> GSM25409     2   0.408     0.7162 0.072 0.880 0.048
#> GSM25410     2   0.933     0.0822 0.268 0.516 0.216
#> GSM25426     2   0.475     0.6874 0.076 0.852 0.072
#> GSM25427     1   0.801     0.3678 0.524 0.412 0.064
#> GSM25540     2   0.507     0.7001 0.096 0.836 0.068
#> GSM25541     2   0.507     0.7001 0.096 0.836 0.068
#> GSM25542     2   0.585     0.6551 0.060 0.788 0.152
#> GSM25543     2   0.773     0.5123 0.132 0.676 0.192
#> GSM25479     1   0.644     0.5332 0.696 0.276 0.028
#> GSM25480     1   0.638     0.5336 0.712 0.256 0.032
#> GSM25481     2   0.785     0.1081 0.384 0.556 0.060
#> GSM25482     2   0.785     0.1081 0.384 0.556 0.060
#> GSM48654     2   0.192     0.7082 0.020 0.956 0.024
#> GSM48650     2   0.280     0.6959 0.016 0.924 0.060
#> GSM48651     2   0.227     0.6986 0.016 0.944 0.040
#> GSM48652     2   0.238     0.6983 0.016 0.940 0.044
#> GSM48653     2   0.231     0.7025 0.024 0.944 0.032
#> GSM48662     2   0.243     0.7055 0.024 0.940 0.036
#> GSM48663     2   0.398     0.6807 0.048 0.884 0.068
#> GSM25524     1   0.929    -0.3296 0.476 0.168 0.356
#> GSM25525     1   0.653     0.4553 0.744 0.188 0.068
#> GSM25526     2   0.862     0.0999 0.388 0.508 0.104
#> GSM25527     1   0.768     0.4511 0.608 0.328 0.064
#> GSM25528     1   0.920    -0.2488 0.504 0.168 0.328
#> GSM25529     1   0.639     0.4716 0.752 0.184 0.064
#> GSM25530     1   0.952    -0.0822 0.488 0.232 0.280
#> GSM25531     1   0.892     0.2171 0.560 0.268 0.172
#> GSM48661     2   0.269     0.7160 0.036 0.932 0.032
#> GSM25561     1   0.994    -0.4125 0.364 0.356 0.280
#> GSM25562     1   0.972    -0.0830 0.416 0.360 0.224
#> GSM25563     3   0.996     0.2807 0.292 0.336 0.372
#> GSM25564     2   0.868     0.2254 0.340 0.540 0.120
#> GSM25565     2   0.378     0.7164 0.044 0.892 0.064
#> GSM25566     2   0.218     0.7145 0.032 0.948 0.020
#> GSM25568     2   0.482     0.6916 0.064 0.848 0.088
#> GSM25569     2   0.348     0.7160 0.048 0.904 0.048
#> GSM25552     2   0.680     0.6181 0.204 0.724 0.072
#> GSM25553     2   0.759     0.4645 0.300 0.632 0.068
#> GSM25578     1   0.573     0.5347 0.752 0.228 0.020
#> GSM25579     1   0.798     0.3204 0.536 0.400 0.064
#> GSM25580     1   0.645     0.5253 0.736 0.212 0.052
#> GSM25581     1   0.672     0.5310 0.720 0.220 0.060
#> GSM48655     2   0.266     0.7022 0.024 0.932 0.044
#> GSM48656     2   0.266     0.7161 0.044 0.932 0.024
#> GSM48657     2   0.285     0.6945 0.020 0.924 0.056
#> GSM48658     2   0.253     0.7162 0.044 0.936 0.020
#> GSM25624     1   0.785     0.4662 0.588 0.344 0.068
#> GSM25625     2   0.894    -0.2494 0.432 0.444 0.124
#> GSM25626     2   0.919     0.1521 0.256 0.536 0.208
#> GSM25627     2   0.859     0.1278 0.376 0.520 0.104
#> GSM25628     2   0.911     0.2156 0.244 0.548 0.208
#> GSM25629     2   0.475     0.6874 0.076 0.852 0.072
#> GSM25630     3   0.917     0.3241 0.372 0.152 0.476
#> GSM25631     2   0.560     0.6748 0.136 0.804 0.060
#> GSM25632     1   0.873     0.1852 0.580 0.260 0.160
#> GSM25633     1   0.661     0.5393 0.716 0.236 0.048
#> GSM25634     1   0.873     0.3369 0.568 0.288 0.144
#> GSM25635     1   0.753     0.5152 0.624 0.316 0.060
#> GSM25656     2   0.913    -0.0436 0.168 0.520 0.312
#> GSM25657     1   0.734     0.5032 0.688 0.224 0.088
#> GSM25658     2   0.863     0.0807 0.392 0.504 0.104
#> GSM25659     2   0.784     0.2091 0.380 0.560 0.060
#> GSM25660     1   0.700     0.5275 0.672 0.280 0.048
#> GSM25661     1   0.577     0.5348 0.756 0.220 0.024
#> GSM25662     2   0.560     0.6783 0.136 0.804 0.060
#> GSM25663     2   0.560     0.6783 0.136 0.804 0.060
#> GSM25680     2   0.669     0.6449 0.148 0.748 0.104
#> GSM25681     2   0.688     0.6338 0.156 0.736 0.108
#> GSM25682     2   0.244     0.7079 0.032 0.940 0.028
#> GSM25683     2   0.244     0.7079 0.032 0.940 0.028
#> GSM25684     2   0.219     0.7120 0.028 0.948 0.024
#> GSM25685     2   0.348     0.7082 0.048 0.904 0.048
#> GSM25686     2   0.244     0.7079 0.032 0.940 0.028
#> GSM25687     2   0.244     0.7079 0.032 0.940 0.028
#> GSM48664     1   0.733     0.0911 0.576 0.036 0.388
#> GSM48665     1   0.715     0.5192 0.696 0.228 0.076

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2   0.577    0.62696 0.160 0.732 0.096 0.012
#> GSM25549     2   0.607    0.62244 0.168 0.716 0.096 0.020
#> GSM25550     2   0.575    0.62771 0.164 0.728 0.100 0.008
#> GSM25551     2   0.449    0.64702 0.056 0.820 0.112 0.012
#> GSM25570     2   0.571    0.62551 0.160 0.736 0.092 0.012
#> GSM25571     2   0.571    0.62551 0.160 0.736 0.092 0.012
#> GSM25358     2   0.632    0.61967 0.148 0.696 0.140 0.016
#> GSM25359     2   0.609    0.63416 0.132 0.716 0.136 0.016
#> GSM25360     2   0.880    0.13128 0.260 0.444 0.236 0.060
#> GSM25361     2   0.852    0.30581 0.252 0.496 0.192 0.060
#> GSM25377     4   0.729    0.82538 0.404 0.076 0.028 0.492
#> GSM25378     1   0.739    0.42299 0.524 0.364 0.072 0.040
#> GSM25401     2   0.797    0.33033 0.260 0.540 0.160 0.040
#> GSM25402     2   0.794    0.35980 0.248 0.556 0.148 0.048
#> GSM25349     2   0.462    0.62446 0.024 0.824 0.084 0.068
#> GSM25350     2   0.455    0.62448 0.024 0.828 0.080 0.068
#> GSM25356     2   0.751    0.45620 0.220 0.616 0.080 0.084
#> GSM25357     2   0.743    0.46823 0.216 0.624 0.080 0.080
#> GSM25385     2   0.831   -0.04818 0.352 0.396 0.232 0.020
#> GSM25386     2   0.805   -0.13121 0.212 0.396 0.380 0.012
#> GSM25399     4   0.578    0.90237 0.412 0.032 0.000 0.556
#> GSM25400     1   0.708    0.53601 0.596 0.296 0.044 0.064
#> GSM48659     2   0.209    0.67685 0.020 0.940 0.028 0.012
#> GSM48660     2   0.310    0.64994 0.016 0.896 0.064 0.024
#> GSM25409     2   0.426    0.68435 0.072 0.844 0.060 0.024
#> GSM25410     2   0.800    0.03506 0.232 0.420 0.340 0.008
#> GSM25426     2   0.449    0.64702 0.056 0.820 0.112 0.012
#> GSM25427     1   0.735    0.44082 0.556 0.324 0.036 0.084
#> GSM25540     2   0.462    0.66871 0.096 0.816 0.076 0.012
#> GSM25541     2   0.462    0.66871 0.096 0.816 0.076 0.012
#> GSM25542     2   0.552    0.61825 0.040 0.756 0.164 0.040
#> GSM25543     2   0.723    0.41707 0.080 0.608 0.264 0.048
#> GSM25479     1   0.530    0.59361 0.760 0.176 0.032 0.032
#> GSM25480     1   0.526    0.58572 0.772 0.156 0.032 0.040
#> GSM25481     2   0.751    0.00850 0.396 0.488 0.040 0.076
#> GSM25482     2   0.751    0.00850 0.396 0.488 0.040 0.076
#> GSM48654     2   0.201    0.67011 0.008 0.940 0.040 0.012
#> GSM48650     2   0.320    0.64717 0.008 0.888 0.072 0.032
#> GSM48651     2   0.260    0.65107 0.004 0.912 0.064 0.020
#> GSM48652     2   0.281    0.64985 0.004 0.904 0.064 0.028
#> GSM48653     2   0.241    0.65551 0.004 0.920 0.060 0.016
#> GSM48662     2   0.222    0.66385 0.008 0.932 0.044 0.016
#> GSM48663     2   0.441    0.62602 0.024 0.836 0.076 0.064
#> GSM25524     1   0.862    0.12313 0.488 0.064 0.240 0.208
#> GSM25525     1   0.586    0.47671 0.760 0.092 0.080 0.068
#> GSM25526     2   0.818   -0.01183 0.376 0.432 0.160 0.032
#> GSM25527     1   0.661    0.59517 0.660 0.240 0.052 0.048
#> GSM25528     1   0.858    0.18157 0.500 0.068 0.236 0.196
#> GSM25529     1   0.550    0.49376 0.780 0.092 0.076 0.052
#> GSM25530     1   0.883    0.30735 0.508 0.124 0.204 0.164
#> GSM25531     1   0.782    0.51110 0.608 0.160 0.152 0.080
#> GSM48661     2   0.259    0.68223 0.028 0.920 0.040 0.012
#> GSM25561     1   0.928   -0.00675 0.360 0.236 0.316 0.088
#> GSM25562     1   0.932    0.23664 0.408 0.256 0.228 0.108
#> GSM25563     3   0.863    0.20416 0.220 0.240 0.480 0.060
#> GSM25564     2   0.820   -0.05197 0.372 0.444 0.144 0.040
#> GSM25565     2   0.365    0.68244 0.044 0.872 0.068 0.016
#> GSM25566     2   0.210    0.68101 0.020 0.936 0.040 0.004
#> GSM25568     2   0.528    0.64093 0.056 0.792 0.096 0.056
#> GSM25569     2   0.377    0.68057 0.040 0.864 0.080 0.016
#> GSM25552     2   0.655    0.57808 0.220 0.664 0.096 0.020
#> GSM25553     2   0.739    0.33839 0.336 0.540 0.096 0.028
#> GSM25578     1   0.485    0.55361 0.796 0.140 0.020 0.044
#> GSM25579     1   0.726    0.47286 0.564 0.320 0.084 0.032
#> GSM25580     1   0.488    0.49824 0.796 0.124 0.012 0.068
#> GSM25581     1   0.507    0.51355 0.784 0.128 0.012 0.076
#> GSM48655     2   0.289    0.66600 0.020 0.908 0.048 0.024
#> GSM48656     2   0.256    0.68255 0.036 0.920 0.036 0.008
#> GSM48657     2   0.338    0.64443 0.016 0.884 0.068 0.032
#> GSM48658     2   0.241    0.68258 0.036 0.924 0.036 0.004
#> GSM25624     1   0.674    0.56416 0.640 0.260 0.044 0.056
#> GSM25625     1   0.825    0.27690 0.444 0.364 0.152 0.040
#> GSM25626     2   0.802    0.08639 0.216 0.440 0.332 0.012
#> GSM25627     2   0.816    0.01672 0.364 0.444 0.160 0.032
#> GSM25628     2   0.794    0.12547 0.204 0.456 0.328 0.012
#> GSM25629     2   0.449    0.64702 0.056 0.820 0.112 0.012
#> GSM25630     3   0.742    0.06332 0.164 0.032 0.608 0.196
#> GSM25631     2   0.553    0.64038 0.156 0.752 0.076 0.016
#> GSM25632     1   0.799    0.45961 0.564 0.168 0.216 0.052
#> GSM25633     1   0.514    0.54448 0.784 0.132 0.020 0.064
#> GSM25634     1   0.846    0.45575 0.552 0.176 0.116 0.156
#> GSM25635     1   0.605    0.58547 0.684 0.244 0.024 0.048
#> GSM25656     3   0.716    0.35998 0.024 0.340 0.552 0.084
#> GSM25657     1   0.651    0.48102 0.696 0.156 0.032 0.116
#> GSM25658     2   0.818   -0.03091 0.380 0.428 0.160 0.032
#> GSM25659     2   0.705   -0.07009 0.456 0.460 0.056 0.028
#> GSM25660     1   0.595    0.59656 0.708 0.212 0.024 0.056
#> GSM25661     1   0.405    0.53876 0.836 0.124 0.012 0.028
#> GSM25662     2   0.526    0.64126 0.144 0.760 0.092 0.004
#> GSM25663     2   0.531    0.63903 0.148 0.756 0.092 0.004
#> GSM25680     2   0.647    0.60801 0.152 0.696 0.124 0.028
#> GSM25681     2   0.673    0.59214 0.168 0.676 0.124 0.032
#> GSM25682     2   0.250    0.66855 0.020 0.924 0.040 0.016
#> GSM25683     2   0.250    0.66855 0.020 0.924 0.040 0.016
#> GSM25684     2   0.194    0.67611 0.016 0.944 0.032 0.008
#> GSM25685     2   0.281    0.67407 0.028 0.904 0.064 0.004
#> GSM25686     2   0.250    0.66855 0.020 0.924 0.040 0.016
#> GSM25687     2   0.250    0.66855 0.020 0.924 0.040 0.016
#> GSM48664     4   0.581    0.90073 0.428 0.024 0.004 0.544
#> GSM48665     1   0.594    0.50286 0.720 0.160 0.012 0.108

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     2   0.531     0.5109 0.156 0.676 0.168 0.000 0.000
#> GSM25549     2   0.566     0.4903 0.168 0.648 0.180 0.000 0.004
#> GSM25550     2   0.534     0.5103 0.156 0.672 0.172 0.000 0.000
#> GSM25551     2   0.422     0.5564 0.036 0.780 0.168 0.000 0.016
#> GSM25570     2   0.527     0.5091 0.160 0.680 0.160 0.000 0.000
#> GSM25571     2   0.527     0.5091 0.160 0.680 0.160 0.000 0.000
#> GSM25358     2   0.563     0.4775 0.132 0.644 0.220 0.004 0.000
#> GSM25359     2   0.535     0.5143 0.108 0.672 0.216 0.004 0.000
#> GSM25360     2   0.838    -0.2836 0.232 0.380 0.292 0.068 0.028
#> GSM25361     2   0.811    -0.1088 0.244 0.420 0.260 0.048 0.028
#> GSM25377     5   0.644     0.8345 0.352 0.056 0.032 0.016 0.544
#> GSM25378     1   0.702     0.2995 0.488 0.336 0.124 0.000 0.052
#> GSM25401     2   0.715     0.0805 0.224 0.500 0.236 0.000 0.040
#> GSM25402     2   0.730     0.1370 0.204 0.520 0.224 0.008 0.044
#> GSM25349     2   0.368     0.5845 0.012 0.832 0.120 0.004 0.032
#> GSM25350     2   0.363     0.5850 0.012 0.836 0.116 0.004 0.032
#> GSM25356     2   0.702     0.3319 0.168 0.600 0.136 0.008 0.088
#> GSM25357     2   0.698     0.3413 0.164 0.604 0.140 0.008 0.084
#> GSM25385     2   0.766    -0.3996 0.308 0.328 0.328 0.008 0.028
#> GSM25386     3   0.758     0.5501 0.152 0.324 0.460 0.048 0.016
#> GSM25399     5   0.478     0.8768 0.348 0.016 0.004 0.004 0.628
#> GSM25400     1   0.693     0.4247 0.544 0.280 0.088 0.000 0.088
#> GSM48659     2   0.213     0.6349 0.024 0.920 0.052 0.000 0.004
#> GSM48660     2   0.233     0.6107 0.004 0.904 0.076 0.000 0.016
#> GSM25409     2   0.408     0.6255 0.064 0.800 0.128 0.000 0.008
#> GSM25410     3   0.731     0.5147 0.192 0.352 0.424 0.024 0.008
#> GSM25426     2   0.422     0.5564 0.036 0.780 0.168 0.000 0.016
#> GSM25427     1   0.709     0.3673 0.504 0.316 0.076 0.000 0.104
#> GSM25540     2   0.444     0.5792 0.088 0.756 0.156 0.000 0.000
#> GSM25541     2   0.444     0.5792 0.088 0.756 0.156 0.000 0.000
#> GSM25542     2   0.484     0.5228 0.036 0.720 0.220 0.000 0.024
#> GSM25543     2   0.634     0.1785 0.060 0.556 0.340 0.008 0.036
#> GSM25479     1   0.494     0.5499 0.780 0.112 0.048 0.028 0.032
#> GSM25480     1   0.489     0.5385 0.788 0.096 0.044 0.044 0.028
#> GSM25481     2   0.703     0.0336 0.356 0.488 0.076 0.004 0.076
#> GSM25482     2   0.703     0.0336 0.356 0.488 0.076 0.004 0.076
#> GSM48654     2   0.203     0.6293 0.012 0.924 0.056 0.000 0.008
#> GSM48650     2   0.245     0.6080 0.004 0.896 0.084 0.000 0.016
#> GSM48651     2   0.194     0.6131 0.000 0.920 0.068 0.000 0.012
#> GSM48652     2   0.205     0.6139 0.000 0.916 0.068 0.000 0.016
#> GSM48653     2   0.192     0.6177 0.004 0.924 0.064 0.000 0.008
#> GSM48662     2   0.157     0.6258 0.000 0.936 0.060 0.000 0.004
#> GSM48663     2   0.353     0.5843 0.012 0.844 0.108 0.004 0.032
#> GSM25524     1   0.809     0.1559 0.472 0.036 0.160 0.264 0.068
#> GSM25525     1   0.496     0.4599 0.772 0.064 0.024 0.120 0.020
#> GSM25526     2   0.753    -0.1490 0.332 0.388 0.236 0.000 0.044
#> GSM25527     1   0.640     0.5397 0.652 0.176 0.116 0.016 0.040
#> GSM25528     1   0.799     0.2435 0.496 0.044 0.164 0.240 0.056
#> GSM25529     1   0.462     0.4722 0.792 0.064 0.024 0.108 0.012
#> GSM25530     1   0.825     0.3059 0.520 0.076 0.156 0.168 0.080
#> GSM25531     1   0.711     0.4684 0.624 0.104 0.160 0.064 0.048
#> GSM48661     2   0.252     0.6340 0.024 0.900 0.068 0.000 0.008
#> GSM25561     3   0.931    -0.0344 0.308 0.132 0.312 0.164 0.084
#> GSM25562     1   0.934     0.1041 0.364 0.200 0.200 0.080 0.156
#> GSM25563     3   0.865     0.2930 0.164 0.160 0.472 0.144 0.060
#> GSM25564     2   0.824    -0.1509 0.344 0.404 0.140 0.040 0.072
#> GSM25565     2   0.332     0.6246 0.044 0.848 0.104 0.000 0.004
#> GSM25566     2   0.252     0.6334 0.024 0.896 0.076 0.000 0.004
#> GSM25568     2   0.450     0.5898 0.036 0.784 0.148 0.012 0.020
#> GSM25569     2   0.348     0.6267 0.032 0.844 0.108 0.000 0.016
#> GSM25552     2   0.632     0.3995 0.232 0.592 0.160 0.004 0.012
#> GSM25553     2   0.719     0.1109 0.336 0.464 0.164 0.008 0.028
#> GSM25578     1   0.367     0.5056 0.852 0.080 0.012 0.032 0.024
#> GSM25579     1   0.677     0.3370 0.576 0.260 0.120 0.024 0.020
#> GSM25580     1   0.506     0.4770 0.764 0.096 0.012 0.028 0.100
#> GSM25581     1   0.528     0.4845 0.756 0.096 0.012 0.048 0.088
#> GSM48655     2   0.216     0.6244 0.012 0.916 0.064 0.000 0.008
#> GSM48656     2   0.250     0.6330 0.032 0.900 0.064 0.000 0.004
#> GSM48657     2   0.251     0.6053 0.004 0.892 0.088 0.000 0.016
#> GSM48658     2   0.234     0.6330 0.032 0.904 0.064 0.000 0.000
#> GSM25624     1   0.660     0.5012 0.612 0.240 0.064 0.012 0.072
#> GSM25625     1   0.771    -0.0445 0.420 0.324 0.196 0.008 0.052
#> GSM25626     3   0.744     0.4842 0.180 0.368 0.412 0.024 0.016
#> GSM25627     2   0.752    -0.1410 0.328 0.392 0.236 0.000 0.044
#> GSM25628     3   0.736     0.4525 0.164 0.384 0.412 0.024 0.016
#> GSM25629     2   0.422     0.5564 0.036 0.780 0.168 0.000 0.016
#> GSM25630     4   0.389     0.0000 0.016 0.008 0.160 0.804 0.012
#> GSM25631     2   0.512     0.5317 0.148 0.696 0.156 0.000 0.000
#> GSM25632     1   0.745     0.3844 0.556 0.124 0.224 0.072 0.024
#> GSM25633     1   0.427     0.5090 0.820 0.088 0.020 0.020 0.052
#> GSM25634     1   0.886     0.2817 0.448 0.116 0.096 0.128 0.212
#> GSM25635     1   0.544     0.5544 0.700 0.196 0.044 0.000 0.060
#> GSM25656     3   0.744    -0.3969 0.008 0.128 0.560 0.136 0.168
#> GSM25657     1   0.538     0.4297 0.740 0.100 0.032 0.012 0.116
#> GSM25658     2   0.753    -0.1573 0.336 0.384 0.236 0.000 0.044
#> GSM25659     1   0.688     0.0201 0.452 0.404 0.108 0.012 0.024
#> GSM25660     1   0.554     0.5620 0.720 0.160 0.052 0.008 0.060
#> GSM25661     1   0.334     0.4966 0.868 0.072 0.008 0.016 0.036
#> GSM25662     2   0.504     0.5402 0.136 0.716 0.144 0.000 0.004
#> GSM25663     2   0.508     0.5370 0.140 0.712 0.144 0.000 0.004
#> GSM25680     2   0.616     0.4334 0.152 0.616 0.216 0.004 0.012
#> GSM25681     2   0.632     0.4046 0.168 0.596 0.220 0.004 0.012
#> GSM25682     2   0.196     0.6299 0.012 0.928 0.052 0.000 0.008
#> GSM25683     2   0.196     0.6299 0.012 0.928 0.052 0.000 0.008
#> GSM25684     2   0.203     0.6337 0.020 0.924 0.052 0.000 0.004
#> GSM25685     2   0.268     0.6201 0.028 0.880 0.092 0.000 0.000
#> GSM25686     2   0.188     0.6294 0.012 0.932 0.048 0.000 0.008
#> GSM25687     2   0.188     0.6294 0.012 0.932 0.048 0.000 0.008
#> GSM48664     5   0.476     0.8883 0.380 0.012 0.008 0.000 0.600
#> GSM48665     1   0.489     0.4671 0.748 0.116 0.016 0.000 0.120

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM25548     5   0.515    0.42805 0.132 0.000 0.236 0.000 0.628 0.004
#> GSM25549     5   0.544    0.40475 0.136 0.000 0.248 0.000 0.604 0.012
#> GSM25550     5   0.517    0.42757 0.132 0.000 0.240 0.000 0.624 0.004
#> GSM25551     5   0.392    0.52691 0.020 0.000 0.204 0.016 0.756 0.004
#> GSM25570     5   0.514    0.42692 0.136 0.000 0.228 0.000 0.632 0.004
#> GSM25571     5   0.514    0.42692 0.136 0.000 0.228 0.000 0.632 0.004
#> GSM25358     5   0.548    0.40025 0.108 0.004 0.272 0.004 0.604 0.008
#> GSM25359     5   0.514    0.44554 0.088 0.004 0.272 0.000 0.628 0.008
#> GSM25360     3   0.788    0.41988 0.176 0.052 0.400 0.020 0.304 0.048
#> GSM25361     3   0.758    0.29477 0.188 0.032 0.380 0.024 0.344 0.032
#> GSM25377     4   0.564    0.80485 0.348 0.016 0.024 0.568 0.028 0.016
#> GSM25378     1   0.672    0.25339 0.508 0.000 0.164 0.048 0.264 0.016
#> GSM25401     5   0.691   -0.03770 0.200 0.000 0.288 0.048 0.452 0.012
#> GSM25402     5   0.700    0.00687 0.188 0.008 0.272 0.052 0.472 0.008
#> GSM25349     5   0.401    0.55429 0.012 0.004 0.136 0.024 0.796 0.028
#> GSM25350     5   0.393    0.55654 0.012 0.004 0.136 0.024 0.800 0.024
#> GSM25356     5   0.688    0.25128 0.144 0.004 0.196 0.076 0.556 0.024
#> GSM25357     5   0.679    0.26070 0.136 0.004 0.204 0.076 0.560 0.020
#> GSM25385     3   0.724    0.36075 0.244 0.016 0.436 0.032 0.256 0.016
#> GSM25386     3   0.679    0.50794 0.080 0.060 0.552 0.008 0.260 0.040
#> GSM25399     4   0.424    0.75951 0.264 0.008 0.016 0.700 0.012 0.000
#> GSM25400     1   0.669    0.39586 0.560 0.000 0.124 0.096 0.204 0.016
#> GSM48659     5   0.189    0.62031 0.020 0.000 0.056 0.004 0.920 0.000
#> GSM48660     5   0.255    0.59406 0.008 0.000 0.076 0.008 0.888 0.020
#> GSM25409     5   0.370    0.59895 0.056 0.000 0.144 0.008 0.792 0.000
#> GSM25410     3   0.668    0.55644 0.112 0.048 0.528 0.004 0.284 0.024
#> GSM25426     5   0.392    0.52691 0.020 0.000 0.204 0.016 0.756 0.004
#> GSM25427     1   0.698    0.34594 0.524 0.000 0.096 0.112 0.240 0.028
#> GSM25540     5   0.427    0.52596 0.080 0.000 0.204 0.000 0.716 0.000
#> GSM25541     5   0.427    0.52596 0.080 0.000 0.204 0.000 0.716 0.000
#> GSM25542     5   0.442    0.44989 0.004 0.004 0.276 0.016 0.684 0.016
#> GSM25543     5   0.565    0.05749 0.020 0.008 0.404 0.020 0.516 0.032
#> GSM25479     1   0.398    0.52683 0.828 0.016 0.060 0.032 0.048 0.016
#> GSM25480     1   0.409    0.52015 0.824 0.024 0.064 0.020 0.036 0.032
#> GSM25481     5   0.717   -0.04696 0.372 0.004 0.108 0.072 0.416 0.028
#> GSM25482     5   0.717   -0.04696 0.372 0.004 0.108 0.072 0.416 0.028
#> GSM48654     5   0.175    0.61735 0.016 0.000 0.044 0.004 0.932 0.004
#> GSM48650     5   0.274    0.59082 0.008 0.000 0.084 0.008 0.876 0.024
#> GSM48651     5   0.198    0.60489 0.008 0.000 0.064 0.008 0.916 0.004
#> GSM48652     5   0.246    0.59880 0.008 0.000 0.064 0.008 0.896 0.024
#> GSM48653     5   0.175    0.61003 0.008 0.000 0.056 0.004 0.928 0.004
#> GSM48662     5   0.179    0.61641 0.008 0.000 0.068 0.000 0.920 0.004
#> GSM48663     5   0.394    0.55263 0.016 0.004 0.128 0.024 0.804 0.024
#> GSM25524     1   0.848    0.03041 0.368 0.220 0.208 0.136 0.016 0.052
#> GSM25525     1   0.413    0.45785 0.808 0.104 0.028 0.028 0.016 0.016
#> GSM25526     5   0.723   -0.26770 0.312 0.000 0.296 0.052 0.328 0.012
#> GSM25527     1   0.585    0.51280 0.664 0.008 0.140 0.060 0.120 0.008
#> GSM25528     1   0.792    0.18279 0.444 0.200 0.188 0.124 0.012 0.032
#> GSM25529     1   0.384    0.46802 0.824 0.100 0.028 0.020 0.016 0.012
#> GSM25530     1   0.800    0.22056 0.480 0.116 0.200 0.128 0.028 0.048
#> GSM25531     1   0.713    0.39229 0.564 0.056 0.224 0.064 0.052 0.040
#> GSM48661     5   0.241    0.61304 0.012 0.000 0.108 0.000 0.876 0.004
#> GSM25561     3   0.902   -0.11368 0.204 0.168 0.356 0.064 0.056 0.152
#> GSM25562     3   0.909   -0.01035 0.284 0.052 0.288 0.072 0.132 0.172
#> GSM25563     3   0.761   -0.11739 0.068 0.144 0.516 0.008 0.092 0.172
#> GSM25564     5   0.805   -0.29114 0.332 0.024 0.176 0.028 0.352 0.088
#> GSM25565     5   0.331    0.59187 0.032 0.000 0.140 0.004 0.820 0.004
#> GSM25566     5   0.241    0.61382 0.016 0.000 0.100 0.004 0.880 0.000
#> GSM25568     5   0.478    0.54547 0.020 0.008 0.188 0.016 0.728 0.040
#> GSM25569     5   0.341    0.59788 0.012 0.000 0.160 0.008 0.808 0.012
#> GSM25552     5   0.609    0.28133 0.196 0.000 0.236 0.004 0.544 0.020
#> GSM25553     5   0.693   -0.11037 0.296 0.004 0.260 0.012 0.404 0.024
#> GSM25578     1   0.276    0.49993 0.896 0.028 0.028 0.020 0.020 0.008
#> GSM25579     1   0.634    0.26143 0.580 0.016 0.176 0.024 0.196 0.008
#> GSM25580     1   0.419    0.45931 0.812 0.032 0.020 0.088 0.024 0.024
#> GSM25581     1   0.445    0.46109 0.800 0.044 0.016 0.076 0.028 0.036
#> GSM48655     5   0.226    0.60609 0.008 0.000 0.068 0.000 0.900 0.024
#> GSM48656     5   0.249    0.61163 0.020 0.000 0.100 0.000 0.876 0.004
#> GSM48657     5   0.279    0.58793 0.008 0.000 0.088 0.008 0.872 0.024
#> GSM48658     5   0.235    0.61160 0.020 0.000 0.100 0.000 0.880 0.000
#> GSM25624     1   0.634    0.47570 0.624 0.012 0.108 0.076 0.168 0.012
#> GSM25625     1   0.761   -0.21272 0.360 0.008 0.288 0.060 0.264 0.020
#> GSM25626     3   0.640    0.55337 0.100 0.036 0.544 0.008 0.296 0.016
#> GSM25627     5   0.724   -0.26679 0.308 0.000 0.300 0.052 0.328 0.012
#> GSM25628     3   0.631    0.51870 0.084 0.036 0.536 0.008 0.320 0.016
#> GSM25629     5   0.392    0.52691 0.020 0.000 0.204 0.016 0.756 0.004
#> GSM25630     2   0.193    0.00000 0.000 0.916 0.068 0.008 0.004 0.004
#> GSM25631     5   0.497    0.45989 0.120 0.000 0.224 0.000 0.652 0.004
#> GSM25632     1   0.723    0.37516 0.536 0.080 0.244 0.040 0.076 0.024
#> GSM25633     1   0.361    0.49196 0.848 0.016 0.040 0.060 0.024 0.012
#> GSM25634     1   0.879    0.02738 0.368 0.076 0.132 0.132 0.040 0.252
#> GSM25635     1   0.523    0.52700 0.712 0.000 0.072 0.084 0.124 0.008
#> GSM25656     6   0.576    0.00000 0.000 0.060 0.192 0.008 0.096 0.644
#> GSM25657     1   0.454    0.41079 0.764 0.012 0.044 0.128 0.052 0.000
#> GSM25658     5   0.724   -0.27375 0.316 0.000 0.296 0.052 0.324 0.012
#> GSM25659     1   0.669   -0.12785 0.444 0.004 0.176 0.016 0.340 0.020
#> GSM25660     1   0.531    0.53858 0.728 0.008 0.088 0.068 0.092 0.016
#> GSM25661     1   0.236    0.49375 0.916 0.016 0.016 0.016 0.016 0.020
#> GSM25662     5   0.490    0.46973 0.112 0.000 0.208 0.000 0.672 0.008
#> GSM25663     5   0.494    0.46562 0.116 0.000 0.208 0.000 0.668 0.008
#> GSM25680     5   0.581    0.29996 0.116 0.000 0.308 0.004 0.552 0.020
#> GSM25681     5   0.584    0.24468 0.120 0.000 0.332 0.004 0.528 0.016
#> GSM25682     5   0.194    0.61642 0.016 0.000 0.056 0.004 0.920 0.004
#> GSM25683     5   0.194    0.61642 0.016 0.000 0.056 0.004 0.920 0.004
#> GSM25684     5   0.183    0.61925 0.020 0.000 0.052 0.004 0.924 0.000
#> GSM25685     5   0.262    0.60288 0.024 0.000 0.104 0.004 0.868 0.000
#> GSM25686     5   0.188    0.61619 0.016 0.000 0.052 0.004 0.924 0.004
#> GSM25687     5   0.188    0.61619 0.016 0.000 0.052 0.004 0.924 0.004
#> GSM48664     4   0.420    0.84006 0.344 0.000 0.004 0.636 0.012 0.004
#> GSM48665     1   0.416    0.45560 0.776 0.000 0.024 0.140 0.056 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-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 genotype/variation(p) k
#> CV:hclust 81               0.02792 2
#> CV:hclust 60               0.00118 3
#> CV:hclust 62               0.01331 4
#> CV:hclust 54               0.00959 5
#> CV:hclust 44               0.00190 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.938           0.960       0.982         0.5051 0.495   0.495
#> 3 3 0.641           0.742       0.836         0.2575 0.857   0.717
#> 4 4 0.511           0.582       0.750         0.1161 0.941   0.845
#> 5 5 0.563           0.451       0.703         0.0684 0.942   0.830
#> 6 6 0.581           0.413       0.622         0.0421 0.901   0.676

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
#> GSM25548     2  0.0000      0.979 0.000 1.000
#> GSM25549     2  0.0000      0.979 0.000 1.000
#> GSM25550     2  0.0000      0.979 0.000 1.000
#> GSM25551     2  0.0000      0.979 0.000 1.000
#> GSM25570     2  0.0000      0.979 0.000 1.000
#> GSM25571     2  0.0000      0.979 0.000 1.000
#> GSM25358     1  0.1633      0.963 0.976 0.024
#> GSM25359     2  0.0000      0.979 0.000 1.000
#> GSM25360     1  0.0000      0.984 1.000 0.000
#> GSM25361     2  0.9087      0.540 0.324 0.676
#> GSM25377     1  0.0000      0.984 1.000 0.000
#> GSM25378     1  0.0000      0.984 1.000 0.000
#> GSM25401     1  0.8555      0.621 0.720 0.280
#> GSM25402     1  0.0000      0.984 1.000 0.000
#> GSM25349     2  0.0000      0.979 0.000 1.000
#> GSM25350     2  0.0000      0.979 0.000 1.000
#> GSM25356     1  0.0000      0.984 1.000 0.000
#> GSM25357     2  0.0000      0.979 0.000 1.000
#> GSM25385     1  0.0000      0.984 1.000 0.000
#> GSM25386     1  0.0000      0.984 1.000 0.000
#> GSM25399     1  0.0000      0.984 1.000 0.000
#> GSM25400     1  0.0000      0.984 1.000 0.000
#> GSM48659     2  0.0000      0.979 0.000 1.000
#> GSM48660     2  0.0000      0.979 0.000 1.000
#> GSM25409     2  0.0000      0.979 0.000 1.000
#> GSM25410     1  0.0000      0.984 1.000 0.000
#> GSM25426     2  0.0000      0.979 0.000 1.000
#> GSM25427     1  0.0376      0.980 0.996 0.004
#> GSM25540     2  0.0000      0.979 0.000 1.000
#> GSM25541     2  0.2948      0.935 0.052 0.948
#> GSM25542     2  0.0000      0.979 0.000 1.000
#> GSM25543     2  0.0000      0.979 0.000 1.000
#> GSM25479     1  0.0000      0.984 1.000 0.000
#> GSM25480     1  0.0000      0.984 1.000 0.000
#> GSM25481     1  0.1414      0.967 0.980 0.020
#> GSM25482     1  0.1414      0.967 0.980 0.020
#> GSM48654     2  0.0000      0.979 0.000 1.000
#> GSM48650     2  0.0000      0.979 0.000 1.000
#> GSM48651     2  0.0000      0.979 0.000 1.000
#> GSM48652     2  0.0000      0.979 0.000 1.000
#> GSM48653     2  0.0000      0.979 0.000 1.000
#> GSM48662     2  0.0000      0.979 0.000 1.000
#> GSM48663     2  0.0000      0.979 0.000 1.000
#> GSM25524     1  0.0000      0.984 1.000 0.000
#> GSM25525     1  0.0000      0.984 1.000 0.000
#> GSM25526     1  0.0000      0.984 1.000 0.000
#> GSM25527     1  0.0000      0.984 1.000 0.000
#> GSM25528     1  0.0000      0.984 1.000 0.000
#> GSM25529     1  0.0000      0.984 1.000 0.000
#> GSM25530     1  0.0000      0.984 1.000 0.000
#> GSM25531     1  0.0000      0.984 1.000 0.000
#> GSM48661     2  0.0000      0.979 0.000 1.000
#> GSM25561     1  0.0000      0.984 1.000 0.000
#> GSM25562     1  0.0000      0.984 1.000 0.000
#> GSM25563     1  0.0000      0.984 1.000 0.000
#> GSM25564     1  0.6801      0.778 0.820 0.180
#> GSM25565     2  0.0000      0.979 0.000 1.000
#> GSM25566     2  0.0000      0.979 0.000 1.000
#> GSM25568     1  0.8016      0.682 0.756 0.244
#> GSM25569     2  0.0000      0.979 0.000 1.000
#> GSM25552     2  0.0000      0.979 0.000 1.000
#> GSM25553     2  0.8207      0.668 0.256 0.744
#> GSM25578     1  0.0000      0.984 1.000 0.000
#> GSM25579     1  0.0000      0.984 1.000 0.000
#> GSM25580     1  0.0000      0.984 1.000 0.000
#> GSM25581     1  0.0000      0.984 1.000 0.000
#> GSM48655     2  0.0000      0.979 0.000 1.000
#> GSM48656     2  0.0000      0.979 0.000 1.000
#> GSM48657     2  0.0000      0.979 0.000 1.000
#> GSM48658     2  0.0000      0.979 0.000 1.000
#> GSM25624     1  0.0000      0.984 1.000 0.000
#> GSM25625     1  0.0000      0.984 1.000 0.000
#> GSM25626     1  0.0000      0.984 1.000 0.000
#> GSM25627     2  0.5294      0.863 0.120 0.880
#> GSM25628     2  0.5629      0.850 0.132 0.868
#> GSM25629     2  0.0000      0.979 0.000 1.000
#> GSM25630     1  0.0000      0.984 1.000 0.000
#> GSM25631     2  0.0000      0.979 0.000 1.000
#> GSM25632     1  0.0000      0.984 1.000 0.000
#> GSM25633     1  0.0000      0.984 1.000 0.000
#> GSM25634     1  0.0000      0.984 1.000 0.000
#> GSM25635     1  0.0000      0.984 1.000 0.000
#> GSM25656     2  0.2603      0.941 0.044 0.956
#> GSM25657     1  0.0000      0.984 1.000 0.000
#> GSM25658     1  0.0000      0.984 1.000 0.000
#> GSM25659     1  0.0000      0.984 1.000 0.000
#> GSM25660     1  0.0000      0.984 1.000 0.000
#> GSM25661     1  0.0000      0.984 1.000 0.000
#> GSM25662     2  0.0000      0.979 0.000 1.000
#> GSM25663     2  0.0000      0.979 0.000 1.000
#> GSM25680     2  0.0000      0.979 0.000 1.000
#> GSM25681     2  0.5294      0.863 0.120 0.880
#> GSM25682     2  0.0000      0.979 0.000 1.000
#> GSM25683     2  0.0000      0.979 0.000 1.000
#> GSM25684     2  0.0000      0.979 0.000 1.000
#> GSM25685     2  0.0000      0.979 0.000 1.000
#> GSM25686     2  0.0000      0.979 0.000 1.000
#> GSM25687     2  0.0000      0.979 0.000 1.000
#> GSM48664     1  0.0000      0.984 1.000 0.000
#> GSM48665     1  0.0000      0.984 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.1964     0.9109 0.000 0.944 0.056
#> GSM25549     2  0.2165     0.9090 0.000 0.936 0.064
#> GSM25550     2  0.2165     0.9089 0.000 0.936 0.064
#> GSM25551     2  0.0747     0.9179 0.000 0.984 0.016
#> GSM25570     2  0.1964     0.9109 0.000 0.944 0.056
#> GSM25571     2  0.1964     0.9109 0.000 0.944 0.056
#> GSM25358     1  0.9111     0.0504 0.472 0.144 0.384
#> GSM25359     2  0.4399     0.7893 0.000 0.812 0.188
#> GSM25360     3  0.5254     0.7052 0.264 0.000 0.736
#> GSM25361     3  0.7016     0.6643 0.156 0.116 0.728
#> GSM25377     1  0.4062     0.7519 0.836 0.000 0.164
#> GSM25378     1  0.4504     0.7276 0.804 0.000 0.196
#> GSM25401     3  0.8848     0.1094 0.372 0.124 0.504
#> GSM25402     1  0.6280     0.2928 0.540 0.000 0.460
#> GSM25349     2  0.2796     0.8987 0.000 0.908 0.092
#> GSM25350     2  0.2711     0.9014 0.000 0.912 0.088
#> GSM25356     1  0.4062     0.7471 0.836 0.000 0.164
#> GSM25357     2  0.1315     0.9153 0.008 0.972 0.020
#> GSM25385     3  0.5678     0.6549 0.316 0.000 0.684
#> GSM25386     3  0.4834     0.7121 0.204 0.004 0.792
#> GSM25399     1  0.3551     0.7643 0.868 0.000 0.132
#> GSM25400     1  0.3816     0.7579 0.852 0.000 0.148
#> GSM48659     2  0.1753     0.9201 0.000 0.952 0.048
#> GSM48660     2  0.1643     0.9129 0.000 0.956 0.044
#> GSM25409     2  0.2711     0.9084 0.000 0.912 0.088
#> GSM25410     3  0.5016     0.6903 0.240 0.000 0.760
#> GSM25426     2  0.1529     0.9137 0.000 0.960 0.040
#> GSM25427     1  0.4861     0.7220 0.800 0.008 0.192
#> GSM25540     2  0.5968     0.5168 0.000 0.636 0.364
#> GSM25541     2  0.8028     0.3172 0.072 0.560 0.368
#> GSM25542     2  0.3551     0.8661 0.000 0.868 0.132
#> GSM25543     3  0.6140     0.0802 0.000 0.404 0.596
#> GSM25479     1  0.1643     0.7927 0.956 0.000 0.044
#> GSM25480     1  0.2625     0.7769 0.916 0.000 0.084
#> GSM25481     1  0.5109     0.7087 0.780 0.008 0.212
#> GSM25482     1  0.5109     0.7087 0.780 0.008 0.212
#> GSM48654     2  0.1753     0.9189 0.000 0.952 0.048
#> GSM48650     2  0.1411     0.9153 0.000 0.964 0.036
#> GSM48651     2  0.1411     0.9177 0.000 0.964 0.036
#> GSM48652     2  0.1411     0.9177 0.000 0.964 0.036
#> GSM48653     2  0.1529     0.9177 0.000 0.960 0.040
#> GSM48662     2  0.1289     0.9181 0.000 0.968 0.032
#> GSM48663     2  0.2356     0.8986 0.000 0.928 0.072
#> GSM25524     3  0.5926     0.6326 0.356 0.000 0.644
#> GSM25525     1  0.2711     0.7730 0.912 0.000 0.088
#> GSM25526     1  0.6235    -0.0848 0.564 0.000 0.436
#> GSM25527     1  0.1163     0.7965 0.972 0.000 0.028
#> GSM25528     1  0.5138     0.5581 0.748 0.000 0.252
#> GSM25529     1  0.2878     0.7680 0.904 0.000 0.096
#> GSM25530     1  0.4452     0.6650 0.808 0.000 0.192
#> GSM25531     1  0.3038     0.7656 0.896 0.000 0.104
#> GSM48661     2  0.1753     0.9193 0.000 0.952 0.048
#> GSM25561     3  0.6062     0.5779 0.384 0.000 0.616
#> GSM25562     1  0.3551     0.7516 0.868 0.000 0.132
#> GSM25563     3  0.5363     0.6993 0.276 0.000 0.724
#> GSM25564     1  0.8587     0.2207 0.604 0.220 0.176
#> GSM25565     2  0.1860     0.9193 0.000 0.948 0.052
#> GSM25566     2  0.0892     0.9194 0.000 0.980 0.020
#> GSM25568     3  0.7493     0.6289 0.136 0.168 0.696
#> GSM25569     2  0.2356     0.9152 0.000 0.928 0.072
#> GSM25552     2  0.2356     0.9086 0.000 0.928 0.072
#> GSM25553     2  0.7772     0.5794 0.196 0.672 0.132
#> GSM25578     1  0.2356     0.7810 0.928 0.000 0.072
#> GSM25579     1  0.3116     0.7685 0.892 0.000 0.108
#> GSM25580     1  0.0747     0.7971 0.984 0.000 0.016
#> GSM25581     1  0.1031     0.7973 0.976 0.000 0.024
#> GSM48655     2  0.1289     0.9157 0.000 0.968 0.032
#> GSM48656     2  0.1289     0.9187 0.000 0.968 0.032
#> GSM48657     2  0.1289     0.9157 0.000 0.968 0.032
#> GSM48658     2  0.1753     0.9193 0.000 0.952 0.048
#> GSM25624     1  0.2066     0.7909 0.940 0.000 0.060
#> GSM25625     3  0.6252     0.4475 0.444 0.000 0.556
#> GSM25626     3  0.5365     0.7104 0.252 0.004 0.744
#> GSM25627     2  0.7389     0.1618 0.036 0.556 0.408
#> GSM25628     3  0.7186     0.6150 0.080 0.224 0.696
#> GSM25629     2  0.5497     0.6023 0.000 0.708 0.292
#> GSM25630     3  0.5621     0.6773 0.308 0.000 0.692
#> GSM25631     2  0.2448     0.9097 0.000 0.924 0.076
#> GSM25632     3  0.5497     0.6936 0.292 0.000 0.708
#> GSM25633     1  0.1411     0.7977 0.964 0.000 0.036
#> GSM25634     1  0.1411     0.7980 0.964 0.000 0.036
#> GSM25635     1  0.1289     0.7942 0.968 0.000 0.032
#> GSM25656     3  0.7164     0.5759 0.064 0.256 0.680
#> GSM25657     1  0.1753     0.7968 0.952 0.000 0.048
#> GSM25658     1  0.5988     0.1979 0.632 0.000 0.368
#> GSM25659     1  0.4974     0.6027 0.764 0.000 0.236
#> GSM25660     1  0.1289     0.7969 0.968 0.000 0.032
#> GSM25661     1  0.1031     0.7966 0.976 0.000 0.024
#> GSM25662     2  0.0592     0.9180 0.000 0.988 0.012
#> GSM25663     2  0.1289     0.9174 0.000 0.968 0.032
#> GSM25680     2  0.2448     0.9058 0.000 0.924 0.076
#> GSM25681     2  0.5816     0.7708 0.056 0.788 0.156
#> GSM25682     2  0.0424     0.9180 0.000 0.992 0.008
#> GSM25683     2  0.0424     0.9180 0.000 0.992 0.008
#> GSM25684     2  0.0747     0.9180 0.000 0.984 0.016
#> GSM25685     2  0.1163     0.9163 0.000 0.972 0.028
#> GSM25686     2  0.0592     0.9179 0.000 0.988 0.012
#> GSM25687     2  0.0592     0.9179 0.000 0.988 0.012
#> GSM48664     1  0.3551     0.7643 0.868 0.000 0.132
#> GSM48665     1  0.3412     0.7664 0.876 0.000 0.124

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.4267     0.7920 0.000 0.788 0.024 0.188
#> GSM25549     2  0.4459     0.7908 0.000 0.780 0.032 0.188
#> GSM25550     2  0.4465     0.7882 0.004 0.776 0.020 0.200
#> GSM25551     2  0.3453     0.8023 0.000 0.868 0.052 0.080
#> GSM25570     2  0.4267     0.7920 0.000 0.788 0.024 0.188
#> GSM25571     2  0.4267     0.7920 0.000 0.788 0.024 0.188
#> GSM25358     4  0.9391     0.2608 0.216 0.120 0.260 0.404
#> GSM25359     2  0.7135     0.5797 0.000 0.560 0.240 0.200
#> GSM25360     3  0.3757     0.7479 0.152 0.000 0.828 0.020
#> GSM25361     3  0.7150     0.6109 0.116 0.052 0.652 0.180
#> GSM25377     4  0.5668     0.4193 0.444 0.000 0.024 0.532
#> GSM25378     4  0.5938     0.4561 0.480 0.000 0.036 0.484
#> GSM25401     4  0.9173     0.1460 0.140 0.136 0.300 0.424
#> GSM25402     4  0.8155     0.3538 0.272 0.012 0.292 0.424
#> GSM25349     2  0.4711     0.7698 0.000 0.740 0.024 0.236
#> GSM25350     2  0.4678     0.7727 0.000 0.744 0.024 0.232
#> GSM25356     4  0.5771     0.4655 0.460 0.000 0.028 0.512
#> GSM25357     2  0.3392     0.7974 0.000 0.856 0.020 0.124
#> GSM25385     3  0.4215     0.7018 0.104 0.000 0.824 0.072
#> GSM25386     3  0.2256     0.7578 0.056 0.000 0.924 0.020
#> GSM25399     1  0.5511    -0.3588 0.500 0.000 0.016 0.484
#> GSM25400     1  0.6000    -0.4541 0.508 0.000 0.040 0.452
#> GSM48659     2  0.2483     0.8346 0.000 0.916 0.032 0.052
#> GSM48660     2  0.2737     0.8122 0.000 0.888 0.008 0.104
#> GSM25409     2  0.4353     0.8024 0.000 0.756 0.012 0.232
#> GSM25410     3  0.2928     0.7464 0.052 0.000 0.896 0.052
#> GSM25426     2  0.4419     0.7728 0.000 0.812 0.104 0.084
#> GSM25427     4  0.5392     0.4716 0.460 0.000 0.012 0.528
#> GSM25540     2  0.7558     0.3424 0.000 0.444 0.360 0.196
#> GSM25541     2  0.7799     0.3321 0.008 0.444 0.360 0.188
#> GSM25542     2  0.5979     0.7365 0.000 0.692 0.136 0.172
#> GSM25543     3  0.7173     0.4156 0.000 0.216 0.556 0.228
#> GSM25479     1  0.1706     0.5912 0.948 0.000 0.016 0.036
#> GSM25480     1  0.0804     0.5916 0.980 0.000 0.012 0.008
#> GSM25481     4  0.6046     0.5143 0.420 0.012 0.024 0.544
#> GSM25482     4  0.6046     0.5143 0.420 0.012 0.024 0.544
#> GSM48654     2  0.2699     0.8286 0.000 0.904 0.028 0.068
#> GSM48650     2  0.2799     0.8159 0.000 0.884 0.008 0.108
#> GSM48651     2  0.2271     0.8247 0.000 0.916 0.008 0.076
#> GSM48652     2  0.2271     0.8247 0.000 0.916 0.008 0.076
#> GSM48653     2  0.2965     0.8276 0.000 0.892 0.036 0.072
#> GSM48662     2  0.2610     0.8301 0.000 0.900 0.012 0.088
#> GSM48663     2  0.4019     0.7609 0.000 0.792 0.012 0.196
#> GSM25524     1  0.5511    -0.2576 0.500 0.000 0.484 0.016
#> GSM25525     1  0.1398     0.5877 0.956 0.000 0.040 0.004
#> GSM25526     1  0.7202    -0.0244 0.464 0.000 0.396 0.140
#> GSM25527     1  0.3143     0.5588 0.876 0.000 0.024 0.100
#> GSM25528     1  0.4095     0.4662 0.792 0.000 0.192 0.016
#> GSM25529     1  0.1722     0.5846 0.944 0.000 0.048 0.008
#> GSM25530     1  0.3547     0.5197 0.840 0.000 0.144 0.016
#> GSM25531     1  0.2198     0.5750 0.920 0.000 0.072 0.008
#> GSM48661     2  0.3266     0.8348 0.000 0.876 0.040 0.084
#> GSM25561     3  0.5442     0.5346 0.336 0.000 0.636 0.028
#> GSM25562     1  0.5247     0.4691 0.752 0.000 0.100 0.148
#> GSM25563     3  0.3708     0.7434 0.148 0.000 0.832 0.020
#> GSM25564     1  0.9112    -0.0160 0.472 0.212 0.136 0.180
#> GSM25565     2  0.3308     0.8344 0.000 0.872 0.036 0.092
#> GSM25566     2  0.2722     0.8339 0.000 0.904 0.032 0.064
#> GSM25568     3  0.8252     0.4934 0.064 0.140 0.524 0.272
#> GSM25569     2  0.4281     0.8118 0.000 0.792 0.028 0.180
#> GSM25552     2  0.4527     0.7891 0.008 0.780 0.020 0.192
#> GSM25553     2  0.7955     0.5656 0.160 0.552 0.044 0.244
#> GSM25578     1  0.1059     0.5930 0.972 0.000 0.016 0.012
#> GSM25579     1  0.3674     0.5176 0.848 0.000 0.036 0.116
#> GSM25580     1  0.3895     0.4866 0.804 0.000 0.012 0.184
#> GSM25581     1  0.2999     0.5507 0.864 0.000 0.004 0.132
#> GSM48655     2  0.1902     0.8246 0.000 0.932 0.004 0.064
#> GSM48656     2  0.2675     0.8310 0.000 0.892 0.008 0.100
#> GSM48657     2  0.2266     0.8203 0.000 0.912 0.004 0.084
#> GSM48658     2  0.4088     0.8255 0.000 0.820 0.040 0.140
#> GSM25624     1  0.4599     0.3586 0.736 0.000 0.016 0.248
#> GSM25625     3  0.5732     0.5013 0.264 0.000 0.672 0.064
#> GSM25626     3  0.2363     0.7538 0.056 0.000 0.920 0.024
#> GSM25627     2  0.8016     0.0027 0.040 0.436 0.404 0.120
#> GSM25628     3  0.2495     0.7289 0.012 0.036 0.924 0.028
#> GSM25629     2  0.6585     0.4846 0.000 0.584 0.312 0.104
#> GSM25630     3  0.4706     0.6903 0.224 0.000 0.748 0.028
#> GSM25631     2  0.4881     0.7851 0.000 0.756 0.048 0.196
#> GSM25632     3  0.4010     0.7410 0.156 0.000 0.816 0.028
#> GSM25633     1  0.3048     0.5581 0.876 0.000 0.016 0.108
#> GSM25634     1  0.3852     0.5002 0.808 0.000 0.012 0.180
#> GSM25635     1  0.4472     0.4172 0.760 0.000 0.020 0.220
#> GSM25656     3  0.3485     0.6950 0.004 0.076 0.872 0.048
#> GSM25657     1  0.2773     0.5806 0.900 0.000 0.028 0.072
#> GSM25658     1  0.7072     0.0415 0.524 0.000 0.336 0.140
#> GSM25659     1  0.4106     0.5244 0.832 0.000 0.084 0.084
#> GSM25660     1  0.2714     0.5619 0.884 0.000 0.004 0.112
#> GSM25661     1  0.2714     0.5631 0.884 0.000 0.004 0.112
#> GSM25662     2  0.1520     0.8298 0.000 0.956 0.020 0.024
#> GSM25663     2  0.3245     0.8245 0.000 0.872 0.028 0.100
#> GSM25680     2  0.5035     0.7817 0.000 0.748 0.056 0.196
#> GSM25681     2  0.7638     0.6628 0.076 0.616 0.112 0.196
#> GSM25682     2  0.1004     0.8299 0.000 0.972 0.004 0.024
#> GSM25683     2  0.1004     0.8299 0.000 0.972 0.004 0.024
#> GSM25684     2  0.1724     0.8296 0.000 0.948 0.032 0.020
#> GSM25685     2  0.3691     0.7948 0.000 0.856 0.076 0.068
#> GSM25686     2  0.1004     0.8299 0.000 0.972 0.004 0.024
#> GSM25687     2  0.1004     0.8299 0.000 0.972 0.004 0.024
#> GSM48664     1  0.5604    -0.3423 0.504 0.000 0.020 0.476
#> GSM48665     1  0.5452    -0.2912 0.556 0.000 0.016 0.428

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     2  0.4286    0.30946 0.000 0.652 0.004 0.004 0.340
#> GSM25549     2  0.4389    0.27525 0.000 0.624 0.004 0.004 0.368
#> GSM25550     2  0.4402    0.26754 0.000 0.620 0.004 0.004 0.372
#> GSM25551     2  0.3367    0.51768 0.000 0.840 0.016 0.016 0.128
#> GSM25570     2  0.4302    0.30614 0.000 0.648 0.004 0.004 0.344
#> GSM25571     2  0.4286    0.30946 0.000 0.652 0.004 0.004 0.340
#> GSM25358     4  0.8806    0.18254 0.064 0.076 0.252 0.392 0.216
#> GSM25359     2  0.6797   -0.70974 0.000 0.404 0.200 0.008 0.388
#> GSM25360     3  0.4017    0.67975 0.116 0.000 0.812 0.016 0.056
#> GSM25361     3  0.7528    0.01774 0.136 0.060 0.412 0.008 0.384
#> GSM25377     4  0.4845    0.54878 0.124 0.000 0.016 0.752 0.108
#> GSM25378     4  0.5314    0.58226 0.256 0.000 0.036 0.672 0.036
#> GSM25401     4  0.8732    0.16770 0.072 0.096 0.276 0.420 0.136
#> GSM25402     4  0.7542    0.32568 0.116 0.004 0.284 0.492 0.104
#> GSM25349     2  0.5973    0.38450 0.000 0.588 0.020 0.084 0.308
#> GSM25350     2  0.5902    0.38748 0.000 0.588 0.016 0.084 0.312
#> GSM25356     4  0.4626    0.60663 0.224 0.000 0.020 0.728 0.028
#> GSM25357     2  0.5293    0.39142 0.000 0.720 0.024 0.136 0.120
#> GSM25385     3  0.3452    0.66927 0.056 0.000 0.856 0.068 0.020
#> GSM25386     3  0.1300    0.69093 0.028 0.000 0.956 0.016 0.000
#> GSM25399     4  0.5341    0.49806 0.204 0.000 0.012 0.688 0.096
#> GSM25400     4  0.4992    0.51441 0.320 0.000 0.028 0.640 0.012
#> GSM48659     2  0.2806    0.61833 0.000 0.844 0.004 0.000 0.152
#> GSM48660     2  0.2921    0.59749 0.000 0.844 0.004 0.004 0.148
#> GSM25409     2  0.4419    0.35030 0.000 0.644 0.004 0.008 0.344
#> GSM25410     3  0.2178    0.68722 0.024 0.000 0.920 0.048 0.008
#> GSM25426     2  0.4560    0.41094 0.000 0.764 0.060 0.016 0.160
#> GSM25427     4  0.4874    0.57635 0.244 0.000 0.012 0.700 0.044
#> GSM25540     5  0.7193    0.96479 0.012 0.312 0.268 0.004 0.404
#> GSM25541     5  0.7241    0.96523 0.016 0.304 0.260 0.004 0.416
#> GSM25542     2  0.6616    0.19360 0.000 0.564 0.124 0.040 0.272
#> GSM25543     3  0.7121    0.11971 0.000 0.120 0.468 0.060 0.352
#> GSM25479     1  0.2866    0.62733 0.872 0.000 0.004 0.100 0.024
#> GSM25480     1  0.2494    0.63180 0.904 0.000 0.008 0.056 0.032
#> GSM25481     4  0.5654    0.59327 0.212 0.008 0.020 0.680 0.080
#> GSM25482     4  0.5654    0.59327 0.212 0.008 0.020 0.680 0.080
#> GSM48654     2  0.2763    0.61248 0.000 0.848 0.004 0.000 0.148
#> GSM48650     2  0.3044    0.58798 0.000 0.840 0.004 0.008 0.148
#> GSM48651     2  0.2471    0.61276 0.000 0.864 0.000 0.000 0.136
#> GSM48652     2  0.2583    0.61409 0.000 0.864 0.004 0.000 0.132
#> GSM48653     2  0.2806    0.61137 0.000 0.844 0.004 0.000 0.152
#> GSM48662     2  0.3048    0.61936 0.000 0.820 0.004 0.000 0.176
#> GSM48663     2  0.5620    0.41323 0.000 0.664 0.016 0.104 0.216
#> GSM25524     1  0.5223    0.26728 0.628 0.000 0.316 0.008 0.048
#> GSM25525     1  0.0955    0.62639 0.968 0.000 0.004 0.000 0.028
#> GSM25526     1  0.7777    0.00745 0.400 0.000 0.352 0.128 0.120
#> GSM25527     1  0.3694    0.58479 0.796 0.000 0.000 0.172 0.032
#> GSM25528     1  0.3925    0.55268 0.816 0.000 0.124 0.020 0.040
#> GSM25529     1  0.1082    0.62554 0.964 0.000 0.008 0.000 0.028
#> GSM25530     1  0.3623    0.57858 0.848 0.000 0.072 0.052 0.028
#> GSM25531     1  0.2196    0.61704 0.916 0.000 0.004 0.056 0.024
#> GSM48661     2  0.3171    0.61389 0.000 0.816 0.008 0.000 0.176
#> GSM25561     3  0.6392    0.52693 0.264 0.000 0.588 0.036 0.112
#> GSM25562     1  0.6483    0.37858 0.596 0.000 0.040 0.232 0.132
#> GSM25563     3  0.4640    0.67335 0.100 0.000 0.776 0.024 0.100
#> GSM25564     1  0.9226    0.03207 0.356 0.152 0.072 0.156 0.264
#> GSM25565     2  0.3757    0.56708 0.000 0.772 0.020 0.000 0.208
#> GSM25566     2  0.2806    0.57262 0.000 0.844 0.004 0.000 0.152
#> GSM25568     3  0.8763    0.24096 0.044 0.100 0.360 0.184 0.312
#> GSM25569     2  0.5174    0.48344 0.000 0.624 0.012 0.036 0.328
#> GSM25552     2  0.4900    0.25386 0.020 0.616 0.004 0.004 0.356
#> GSM25553     2  0.6984   -0.28344 0.096 0.432 0.012 0.036 0.424
#> GSM25578     1  0.1591    0.63250 0.940 0.000 0.004 0.052 0.004
#> GSM25579     1  0.3371    0.58395 0.848 0.000 0.008 0.040 0.104
#> GSM25580     1  0.5151    0.44683 0.644 0.000 0.008 0.300 0.048
#> GSM25581     1  0.4284    0.54404 0.736 0.000 0.000 0.224 0.040
#> GSM48655     2  0.1965    0.62185 0.000 0.904 0.000 0.000 0.096
#> GSM48656     2  0.2891    0.61923 0.000 0.824 0.000 0.000 0.176
#> GSM48657     2  0.2127    0.61263 0.000 0.892 0.000 0.000 0.108
#> GSM48658     2  0.3607    0.58372 0.000 0.752 0.004 0.000 0.244
#> GSM25624     1  0.5441    0.19710 0.536 0.000 0.008 0.412 0.044
#> GSM25625     3  0.5469    0.52178 0.184 0.000 0.704 0.064 0.048
#> GSM25626     3  0.1569    0.68934 0.032 0.000 0.948 0.012 0.008
#> GSM25627     3  0.8729   -0.16924 0.048 0.332 0.360 0.104 0.156
#> GSM25628     3  0.3020    0.64685 0.016 0.024 0.880 0.004 0.076
#> GSM25629     2  0.7126   -0.37418 0.008 0.484 0.292 0.020 0.196
#> GSM25630     3  0.5858    0.61990 0.180 0.000 0.668 0.032 0.120
#> GSM25631     2  0.5022    0.17512 0.004 0.584 0.016 0.008 0.388
#> GSM25632     3  0.2756    0.69725 0.092 0.000 0.880 0.004 0.024
#> GSM25633     1  0.3977    0.56568 0.764 0.000 0.000 0.204 0.032
#> GSM25634     1  0.5257    0.44067 0.640 0.000 0.008 0.296 0.056
#> GSM25635     1  0.5016    0.35549 0.608 0.000 0.000 0.348 0.044
#> GSM25656     3  0.4444    0.61436 0.008 0.028 0.780 0.024 0.160
#> GSM25657     1  0.4579    0.55479 0.744 0.000 0.008 0.192 0.056
#> GSM25658     1  0.7718    0.05898 0.440 0.000 0.312 0.128 0.120
#> GSM25659     1  0.4185    0.56827 0.812 0.004 0.020 0.060 0.104
#> GSM25660     1  0.4193    0.55511 0.748 0.000 0.000 0.212 0.040
#> GSM25661     1  0.4134    0.54913 0.744 0.000 0.000 0.224 0.032
#> GSM25662     2  0.1026    0.61544 0.000 0.968 0.004 0.004 0.024
#> GSM25663     2  0.3171    0.52986 0.000 0.816 0.008 0.000 0.176
#> GSM25680     2  0.4995    0.17645 0.000 0.584 0.028 0.004 0.384
#> GSM25681     2  0.6598   -0.16331 0.080 0.484 0.036 0.004 0.396
#> GSM25682     2  0.1116    0.61822 0.000 0.964 0.004 0.004 0.028
#> GSM25683     2  0.0932    0.61781 0.000 0.972 0.004 0.004 0.020
#> GSM25684     2  0.1788    0.60712 0.000 0.932 0.008 0.004 0.056
#> GSM25685     2  0.4112    0.45155 0.000 0.800 0.048 0.016 0.136
#> GSM25686     2  0.1116    0.61822 0.000 0.964 0.004 0.004 0.028
#> GSM25687     2  0.1202    0.61910 0.000 0.960 0.004 0.004 0.032
#> GSM48664     4  0.5419    0.48908 0.208 0.000 0.012 0.680 0.100
#> GSM48665     4  0.5516    0.20658 0.388 0.000 0.008 0.552 0.052

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM25548     5  0.4097    -0.1045 0.000 0.008 0.000 0.000 0.500 0.492
#> GSM25549     6  0.3993     0.0406 0.000 0.004 0.000 0.000 0.476 0.520
#> GSM25550     6  0.4227     0.0334 0.000 0.004 0.000 0.008 0.488 0.500
#> GSM25551     5  0.5340     0.3949 0.000 0.268 0.008 0.000 0.600 0.124
#> GSM25570     5  0.4096    -0.0899 0.000 0.008 0.000 0.000 0.508 0.484
#> GSM25571     5  0.4095    -0.0815 0.000 0.008 0.000 0.000 0.512 0.480
#> GSM25358     4  0.7999    -0.1351 0.044 0.148 0.168 0.444 0.008 0.188
#> GSM25359     6  0.7286     0.3430 0.000 0.148 0.156 0.004 0.256 0.436
#> GSM25360     3  0.3166     0.6971 0.060 0.036 0.856 0.000 0.000 0.048
#> GSM25361     6  0.7317    -0.0831 0.076 0.088 0.316 0.012 0.040 0.468
#> GSM25377     4  0.6005     0.5149 0.132 0.228 0.012 0.596 0.000 0.032
#> GSM25378     4  0.4624     0.5900 0.188 0.060 0.024 0.724 0.000 0.004
#> GSM25401     2  0.7627     0.2858 0.020 0.380 0.176 0.348 0.044 0.032
#> GSM25402     4  0.7089    -0.1078 0.048 0.244 0.208 0.476 0.004 0.020
#> GSM25349     5  0.6257     0.2247 0.000 0.092 0.012 0.052 0.540 0.304
#> GSM25350     5  0.6254     0.2183 0.000 0.088 0.012 0.052 0.532 0.316
#> GSM25356     4  0.4484     0.6106 0.148 0.072 0.008 0.752 0.000 0.020
#> GSM25357     5  0.6714     0.2587 0.000 0.172 0.000 0.180 0.528 0.120
#> GSM25385     3  0.3003     0.6569 0.012 0.052 0.864 0.068 0.000 0.004
#> GSM25386     3  0.0924     0.7140 0.004 0.008 0.972 0.008 0.000 0.008
#> GSM25399     4  0.6021     0.4974 0.152 0.240 0.000 0.568 0.000 0.040
#> GSM25400     4  0.4761     0.5818 0.212 0.088 0.012 0.688 0.000 0.000
#> GSM48659     5  0.2821     0.6068 0.000 0.020 0.004 0.004 0.856 0.116
#> GSM48660     5  0.1462     0.6016 0.000 0.008 0.000 0.000 0.936 0.056
#> GSM25409     5  0.4549     0.1039 0.000 0.028 0.000 0.004 0.552 0.416
#> GSM25410     3  0.1693     0.7050 0.004 0.020 0.932 0.044 0.000 0.000
#> GSM25426     5  0.5984     0.3373 0.000 0.280 0.032 0.004 0.560 0.124
#> GSM25427     4  0.3921     0.5844 0.184 0.028 0.004 0.768 0.000 0.016
#> GSM25540     6  0.7133     0.3876 0.000 0.100 0.204 0.004 0.240 0.452
#> GSM25541     6  0.7079     0.3911 0.000 0.088 0.216 0.004 0.240 0.452
#> GSM25542     5  0.6957     0.0332 0.000 0.096 0.112 0.012 0.456 0.324
#> GSM25543     6  0.7674    -0.2311 0.000 0.160 0.316 0.028 0.116 0.380
#> GSM25479     1  0.3040     0.6329 0.868 0.028 0.016 0.072 0.000 0.016
#> GSM25480     1  0.2713     0.6372 0.888 0.012 0.012 0.048 0.000 0.040
#> GSM25481     4  0.5880     0.5659 0.140 0.076 0.012 0.664 0.004 0.104
#> GSM25482     4  0.5880     0.5659 0.140 0.076 0.012 0.664 0.004 0.104
#> GSM48654     5  0.1913     0.6120 0.000 0.012 0.004 0.004 0.920 0.060
#> GSM48650     5  0.2691     0.5954 0.000 0.088 0.000 0.008 0.872 0.032
#> GSM48651     5  0.1225     0.6159 0.000 0.012 0.000 0.000 0.952 0.036
#> GSM48652     5  0.1225     0.6161 0.000 0.012 0.000 0.000 0.952 0.036
#> GSM48653     5  0.1862     0.6143 0.000 0.016 0.008 0.004 0.928 0.044
#> GSM48662     5  0.1444     0.6117 0.000 0.000 0.000 0.000 0.928 0.072
#> GSM48663     5  0.5535     0.2869 0.000 0.096 0.000 0.048 0.636 0.220
#> GSM25524     1  0.5472     0.3478 0.616 0.064 0.276 0.004 0.000 0.040
#> GSM25525     1  0.1965     0.6325 0.924 0.040 0.008 0.004 0.000 0.024
#> GSM25526     2  0.8007     0.3940 0.232 0.296 0.284 0.168 0.000 0.020
#> GSM25527     1  0.4179     0.5548 0.748 0.044 0.008 0.192 0.000 0.008
#> GSM25528     1  0.4434     0.5601 0.772 0.060 0.116 0.008 0.000 0.044
#> GSM25529     1  0.2239     0.6306 0.912 0.040 0.016 0.004 0.000 0.028
#> GSM25530     1  0.3981     0.5942 0.820 0.064 0.048 0.028 0.000 0.040
#> GSM25531     1  0.3131     0.6177 0.868 0.052 0.024 0.016 0.000 0.040
#> GSM48661     5  0.2698     0.6061 0.000 0.020 0.008 0.004 0.872 0.096
#> GSM25561     3  0.6968     0.5131 0.188 0.152 0.536 0.020 0.000 0.104
#> GSM25562     1  0.8014     0.1218 0.396 0.200 0.052 0.232 0.000 0.120
#> GSM25563     3  0.5668     0.6274 0.040 0.156 0.672 0.024 0.000 0.108
#> GSM25564     1  0.9460    -0.0302 0.264 0.176 0.044 0.132 0.204 0.180
#> GSM25565     5  0.3958     0.5389 0.000 0.024 0.008 0.012 0.760 0.196
#> GSM25566     5  0.3834     0.5165 0.000 0.024 0.004 0.000 0.728 0.244
#> GSM25568     6  0.8564    -0.3165 0.012 0.176 0.256 0.112 0.088 0.356
#> GSM25569     5  0.5137     0.3258 0.000 0.068 0.004 0.012 0.612 0.304
#> GSM25552     5  0.4357    -0.1432 0.004 0.004 0.000 0.008 0.492 0.492
#> GSM25553     6  0.6602     0.3179 0.076 0.040 0.020 0.028 0.276 0.560
#> GSM25578     1  0.1332     0.6405 0.952 0.012 0.000 0.028 0.000 0.008
#> GSM25579     1  0.3346     0.5797 0.816 0.008 0.000 0.036 0.000 0.140
#> GSM25580     1  0.5358     0.4139 0.604 0.072 0.016 0.300 0.000 0.008
#> GSM25581     1  0.4748     0.5051 0.676 0.056 0.008 0.252 0.000 0.008
#> GSM48655     5  0.1151     0.6202 0.000 0.012 0.000 0.000 0.956 0.032
#> GSM48656     5  0.1471     0.6120 0.000 0.000 0.000 0.004 0.932 0.064
#> GSM48657     5  0.1176     0.6181 0.000 0.024 0.000 0.000 0.956 0.020
#> GSM48658     5  0.3130     0.5489 0.000 0.008 0.004 0.004 0.808 0.176
#> GSM25624     4  0.5632     0.1086 0.408 0.072 0.012 0.496 0.000 0.012
#> GSM25625     3  0.5942     0.3400 0.076 0.132 0.648 0.132 0.000 0.012
#> GSM25626     3  0.2118     0.6928 0.004 0.048 0.916 0.012 0.000 0.020
#> GSM25627     2  0.8417     0.4332 0.008 0.356 0.272 0.092 0.180 0.092
#> GSM25628     3  0.3473     0.6189 0.000 0.092 0.832 0.004 0.016 0.056
#> GSM25629     2  0.7703     0.1935 0.000 0.332 0.232 0.008 0.284 0.144
#> GSM25630     3  0.6555     0.5811 0.068 0.196 0.588 0.032 0.000 0.116
#> GSM25631     6  0.4534     0.1335 0.000 0.004 0.008 0.012 0.460 0.516
#> GSM25632     3  0.2190     0.7091 0.032 0.032 0.916 0.008 0.000 0.012
#> GSM25633     1  0.4486     0.5349 0.712 0.052 0.004 0.220 0.000 0.012
#> GSM25634     1  0.5463     0.3487 0.572 0.080 0.008 0.328 0.000 0.012
#> GSM25635     1  0.5278     0.3071 0.560 0.056 0.008 0.364 0.000 0.012
#> GSM25656     3  0.5935     0.4949 0.000 0.228 0.596 0.024 0.012 0.140
#> GSM25657     1  0.5054     0.5524 0.720 0.104 0.016 0.132 0.000 0.028
#> GSM25658     2  0.8043     0.3632 0.256 0.300 0.244 0.180 0.000 0.020
#> GSM25659     1  0.5362     0.5137 0.700 0.072 0.012 0.072 0.000 0.144
#> GSM25660     1  0.4329     0.5357 0.720 0.040 0.004 0.224 0.000 0.012
#> GSM25661     1  0.4233     0.5369 0.724 0.040 0.004 0.224 0.000 0.008
#> GSM25662     5  0.3448     0.5954 0.000 0.072 0.004 0.000 0.816 0.108
#> GSM25663     5  0.4053     0.3797 0.000 0.020 0.004 0.000 0.676 0.300
#> GSM25680     6  0.4080     0.1270 0.000 0.008 0.000 0.000 0.456 0.536
#> GSM25681     6  0.5607     0.2561 0.060 0.016 0.016 0.000 0.376 0.532
#> GSM25682     5  0.3356     0.5894 0.000 0.052 0.000 0.000 0.808 0.140
#> GSM25683     5  0.3395     0.5899 0.000 0.060 0.000 0.000 0.808 0.132
#> GSM25684     5  0.3703     0.5871 0.000 0.072 0.004 0.000 0.792 0.132
#> GSM25685     5  0.5350     0.3931 0.000 0.264 0.016 0.000 0.612 0.108
#> GSM25686     5  0.3356     0.5894 0.000 0.052 0.000 0.000 0.808 0.140
#> GSM25687     5  0.3316     0.5914 0.000 0.052 0.000 0.000 0.812 0.136
#> GSM48664     4  0.5880     0.4976 0.144 0.236 0.000 0.584 0.000 0.036
#> GSM48665     4  0.5705     0.1847 0.368 0.088 0.004 0.520 0.000 0.020

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 genotype/variation(p) k
#> CV:kmeans 100              7.47e-05 2
#> CV:kmeans  90              1.40e-03 3
#> CV:kmeans  74              3.85e-06 4
#> CV:kmeans  60              7.39e-10 5
#> CV:kmeans  54              6.55e-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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.958           0.958       0.982         0.5054 0.495   0.495
#> 3 3 0.504           0.694       0.823         0.2937 0.805   0.625
#> 4 4 0.442           0.354       0.615         0.1301 0.858   0.619
#> 5 5 0.455           0.403       0.605         0.0700 0.863   0.564
#> 6 6 0.485           0.240       0.500         0.0446 0.856   0.484

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
#> GSM25548     2  0.0000      0.972 0.000 1.000
#> GSM25549     2  0.0000      0.972 0.000 1.000
#> GSM25550     2  0.0672      0.967 0.008 0.992
#> GSM25551     2  0.0000      0.972 0.000 1.000
#> GSM25570     2  0.0000      0.972 0.000 1.000
#> GSM25571     2  0.0000      0.972 0.000 1.000
#> GSM25358     1  0.1633      0.967 0.976 0.024
#> GSM25359     2  0.0000      0.972 0.000 1.000
#> GSM25360     1  0.0000      0.989 1.000 0.000
#> GSM25361     2  0.9393      0.471 0.356 0.644
#> GSM25377     1  0.0000      0.989 1.000 0.000
#> GSM25378     1  0.0000      0.989 1.000 0.000
#> GSM25401     1  0.6887      0.774 0.816 0.184
#> GSM25402     1  0.0000      0.989 1.000 0.000
#> GSM25349     2  0.0000      0.972 0.000 1.000
#> GSM25350     2  0.0000      0.972 0.000 1.000
#> GSM25356     1  0.0000      0.989 1.000 0.000
#> GSM25357     2  0.0376      0.970 0.004 0.996
#> GSM25385     1  0.0000      0.989 1.000 0.000
#> GSM25386     1  0.0000      0.989 1.000 0.000
#> GSM25399     1  0.0000      0.989 1.000 0.000
#> GSM25400     1  0.0000      0.989 1.000 0.000
#> GSM48659     2  0.0000      0.972 0.000 1.000
#> GSM48660     2  0.0000      0.972 0.000 1.000
#> GSM25409     2  0.0000      0.972 0.000 1.000
#> GSM25410     1  0.0000      0.989 1.000 0.000
#> GSM25426     2  0.0000      0.972 0.000 1.000
#> GSM25427     1  0.0000      0.989 1.000 0.000
#> GSM25540     2  0.0000      0.972 0.000 1.000
#> GSM25541     2  0.1633      0.953 0.024 0.976
#> GSM25542     2  0.0000      0.972 0.000 1.000
#> GSM25543     2  0.0000      0.972 0.000 1.000
#> GSM25479     1  0.0000      0.989 1.000 0.000
#> GSM25480     1  0.0000      0.989 1.000 0.000
#> GSM25481     1  0.0000      0.989 1.000 0.000
#> GSM25482     1  0.0000      0.989 1.000 0.000
#> GSM48654     2  0.0000      0.972 0.000 1.000
#> GSM48650     2  0.0000      0.972 0.000 1.000
#> GSM48651     2  0.0000      0.972 0.000 1.000
#> GSM48652     2  0.0000      0.972 0.000 1.000
#> GSM48653     2  0.0000      0.972 0.000 1.000
#> GSM48662     2  0.0000      0.972 0.000 1.000
#> GSM48663     2  0.0000      0.972 0.000 1.000
#> GSM25524     1  0.0000      0.989 1.000 0.000
#> GSM25525     1  0.0000      0.989 1.000 0.000
#> GSM25526     1  0.0000      0.989 1.000 0.000
#> GSM25527     1  0.0000      0.989 1.000 0.000
#> GSM25528     1  0.0000      0.989 1.000 0.000
#> GSM25529     1  0.0000      0.989 1.000 0.000
#> GSM25530     1  0.0000      0.989 1.000 0.000
#> GSM25531     1  0.0000      0.989 1.000 0.000
#> GSM48661     2  0.0000      0.972 0.000 1.000
#> GSM25561     1  0.0000      0.989 1.000 0.000
#> GSM25562     1  0.0000      0.989 1.000 0.000
#> GSM25563     1  0.0000      0.989 1.000 0.000
#> GSM25564     1  0.3733      0.917 0.928 0.072
#> GSM25565     2  0.0000      0.972 0.000 1.000
#> GSM25566     2  0.0000      0.972 0.000 1.000
#> GSM25568     1  0.7528      0.723 0.784 0.216
#> GSM25569     2  0.0000      0.972 0.000 1.000
#> GSM25552     2  0.0000      0.972 0.000 1.000
#> GSM25553     2  0.9358      0.478 0.352 0.648
#> GSM25578     1  0.0000      0.989 1.000 0.000
#> GSM25579     1  0.0000      0.989 1.000 0.000
#> GSM25580     1  0.0000      0.989 1.000 0.000
#> GSM25581     1  0.0000      0.989 1.000 0.000
#> GSM48655     2  0.0000      0.972 0.000 1.000
#> GSM48656     2  0.0000      0.972 0.000 1.000
#> GSM48657     2  0.0000      0.972 0.000 1.000
#> GSM48658     2  0.0000      0.972 0.000 1.000
#> GSM25624     1  0.0000      0.989 1.000 0.000
#> GSM25625     1  0.0000      0.989 1.000 0.000
#> GSM25626     1  0.0000      0.989 1.000 0.000
#> GSM25627     2  0.9000      0.546 0.316 0.684
#> GSM25628     2  0.6343      0.808 0.160 0.840
#> GSM25629     2  0.0000      0.972 0.000 1.000
#> GSM25630     1  0.0000      0.989 1.000 0.000
#> GSM25631     2  0.0000      0.972 0.000 1.000
#> GSM25632     1  0.0000      0.989 1.000 0.000
#> GSM25633     1  0.0000      0.989 1.000 0.000
#> GSM25634     1  0.0000      0.989 1.000 0.000
#> GSM25635     1  0.0000      0.989 1.000 0.000
#> GSM25656     2  0.1633      0.953 0.024 0.976
#> GSM25657     1  0.0000      0.989 1.000 0.000
#> GSM25658     1  0.0000      0.989 1.000 0.000
#> GSM25659     1  0.0000      0.989 1.000 0.000
#> GSM25660     1  0.0000      0.989 1.000 0.000
#> GSM25661     1  0.0000      0.989 1.000 0.000
#> GSM25662     2  0.0000      0.972 0.000 1.000
#> GSM25663     2  0.0000      0.972 0.000 1.000
#> GSM25680     2  0.0000      0.972 0.000 1.000
#> GSM25681     2  0.4939      0.870 0.108 0.892
#> GSM25682     2  0.0000      0.972 0.000 1.000
#> GSM25683     2  0.0000      0.972 0.000 1.000
#> GSM25684     2  0.0000      0.972 0.000 1.000
#> GSM25685     2  0.0000      0.972 0.000 1.000
#> GSM25686     2  0.0000      0.972 0.000 1.000
#> GSM25687     2  0.0000      0.972 0.000 1.000
#> GSM48664     1  0.0000      0.989 1.000 0.000
#> GSM48665     1  0.0000      0.989 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.2772    0.87240 0.004 0.916 0.080
#> GSM25549     2  0.3349    0.86820 0.004 0.888 0.108
#> GSM25550     2  0.4749    0.83699 0.040 0.844 0.116
#> GSM25551     2  0.4062    0.81167 0.000 0.836 0.164
#> GSM25570     2  0.3129    0.86817 0.008 0.904 0.088
#> GSM25571     2  0.3112    0.86972 0.004 0.900 0.096
#> GSM25358     3  0.9059    0.33610 0.408 0.136 0.456
#> GSM25359     3  0.6912   -0.01080 0.016 0.444 0.540
#> GSM25360     3  0.5733    0.44249 0.324 0.000 0.676
#> GSM25361     3  0.7661    0.57928 0.172 0.144 0.684
#> GSM25377     1  0.2356    0.83315 0.928 0.000 0.072
#> GSM25378     1  0.2945    0.80195 0.908 0.004 0.088
#> GSM25401     3  0.8693    0.53809 0.232 0.176 0.592
#> GSM25402     1  0.7656    0.23975 0.572 0.052 0.376
#> GSM25349     2  0.3375    0.87340 0.008 0.892 0.100
#> GSM25350     2  0.3459    0.87526 0.012 0.892 0.096
#> GSM25356     1  0.3043    0.80689 0.908 0.008 0.084
#> GSM25357     2  0.5521    0.76076 0.032 0.788 0.180
#> GSM25385     3  0.6062    0.39254 0.384 0.000 0.616
#> GSM25386     3  0.4413    0.59185 0.160 0.008 0.832
#> GSM25399     1  0.1529    0.83257 0.960 0.000 0.040
#> GSM25400     1  0.2878    0.80575 0.904 0.000 0.096
#> GSM48659     2  0.2537    0.88320 0.000 0.920 0.080
#> GSM48660     2  0.1753    0.88332 0.000 0.952 0.048
#> GSM25409     2  0.4540    0.84942 0.028 0.848 0.124
#> GSM25410     3  0.5325    0.56236 0.248 0.004 0.748
#> GSM25426     2  0.5058    0.71872 0.000 0.756 0.244
#> GSM25427     1  0.2492    0.81172 0.936 0.016 0.048
#> GSM25540     3  0.5502    0.50058 0.008 0.248 0.744
#> GSM25541     3  0.5891    0.61612 0.052 0.168 0.780
#> GSM25542     2  0.5948    0.52909 0.000 0.640 0.360
#> GSM25543     3  0.6881    0.20613 0.020 0.388 0.592
#> GSM25479     1  0.2066    0.83736 0.940 0.000 0.060
#> GSM25480     1  0.2448    0.83180 0.924 0.000 0.076
#> GSM25481     1  0.4994    0.71672 0.836 0.052 0.112
#> GSM25482     1  0.3356    0.78903 0.908 0.036 0.056
#> GSM48654     2  0.2711    0.88181 0.000 0.912 0.088
#> GSM48650     2  0.2165    0.88172 0.000 0.936 0.064
#> GSM48651     2  0.1964    0.88298 0.000 0.944 0.056
#> GSM48652     2  0.1529    0.88391 0.000 0.960 0.040
#> GSM48653     2  0.2448    0.88090 0.000 0.924 0.076
#> GSM48662     2  0.1860    0.88812 0.000 0.948 0.052
#> GSM48663     2  0.2200    0.88166 0.004 0.940 0.056
#> GSM25524     1  0.6154    0.30680 0.592 0.000 0.408
#> GSM25525     1  0.3038    0.81961 0.896 0.000 0.104
#> GSM25526     3  0.6189    0.43948 0.364 0.004 0.632
#> GSM25527     1  0.2959    0.82586 0.900 0.000 0.100
#> GSM25528     1  0.5058    0.68586 0.756 0.000 0.244
#> GSM25529     1  0.3340    0.81200 0.880 0.000 0.120
#> GSM25530     1  0.5058    0.68181 0.756 0.000 0.244
#> GSM25531     1  0.3551    0.80860 0.868 0.000 0.132
#> GSM48661     2  0.3340    0.87017 0.000 0.880 0.120
#> GSM25561     1  0.5988    0.41907 0.632 0.000 0.368
#> GSM25562     1  0.3941    0.79057 0.844 0.000 0.156
#> GSM25563     3  0.5882    0.40145 0.348 0.000 0.652
#> GSM25564     1  0.9678   -0.16598 0.444 0.228 0.328
#> GSM25565     2  0.3340    0.87786 0.000 0.880 0.120
#> GSM25566     2  0.2165    0.88881 0.000 0.936 0.064
#> GSM25568     3  0.9233    0.45926 0.268 0.204 0.528
#> GSM25569     2  0.2959    0.88551 0.000 0.900 0.100
#> GSM25552     2  0.4519    0.84203 0.032 0.852 0.116
#> GSM25553     2  0.9707   -0.09075 0.352 0.424 0.224
#> GSM25578     1  0.1860    0.83562 0.948 0.000 0.052
#> GSM25579     1  0.4235    0.77279 0.824 0.000 0.176
#> GSM25580     1  0.0747    0.83513 0.984 0.000 0.016
#> GSM25581     1  0.1411    0.83643 0.964 0.000 0.036
#> GSM48655     2  0.0592    0.88385 0.000 0.988 0.012
#> GSM48656     2  0.2066    0.88730 0.000 0.940 0.060
#> GSM48657     2  0.1529    0.88286 0.000 0.960 0.040
#> GSM48658     2  0.2959    0.88152 0.000 0.900 0.100
#> GSM25624     1  0.0424    0.83239 0.992 0.000 0.008
#> GSM25625     3  0.6192    0.34378 0.420 0.000 0.580
#> GSM25626     3  0.4539    0.60242 0.148 0.016 0.836
#> GSM25627     3  0.6388    0.50521 0.024 0.284 0.692
#> GSM25628     3  0.3845    0.63337 0.012 0.116 0.872
#> GSM25629     3  0.5929    0.42568 0.004 0.320 0.676
#> GSM25630     3  0.6252    0.17904 0.444 0.000 0.556
#> GSM25631     2  0.6849    0.47395 0.020 0.600 0.380
#> GSM25632     3  0.6307    0.02807 0.488 0.000 0.512
#> GSM25633     1  0.2448    0.83345 0.924 0.000 0.076
#> GSM25634     1  0.1643    0.83782 0.956 0.000 0.044
#> GSM25635     1  0.1163    0.83393 0.972 0.000 0.028
#> GSM25656     3  0.3682    0.63088 0.008 0.116 0.876
#> GSM25657     1  0.2878    0.83311 0.904 0.000 0.096
#> GSM25658     1  0.6500    0.00126 0.532 0.004 0.464
#> GSM25659     1  0.5404    0.68317 0.740 0.004 0.256
#> GSM25660     1  0.1411    0.83699 0.964 0.000 0.036
#> GSM25661     1  0.1289    0.83597 0.968 0.000 0.032
#> GSM25662     2  0.1529    0.88445 0.000 0.960 0.040
#> GSM25663     2  0.2796    0.87904 0.000 0.908 0.092
#> GSM25680     2  0.4784    0.82180 0.004 0.796 0.200
#> GSM25681     2  0.7491    0.53639 0.056 0.620 0.324
#> GSM25682     2  0.1031    0.88364 0.000 0.976 0.024
#> GSM25683     2  0.1163    0.88374 0.000 0.972 0.028
#> GSM25684     2  0.2165    0.88275 0.000 0.936 0.064
#> GSM25685     2  0.4605    0.77343 0.000 0.796 0.204
#> GSM25686     2  0.0892    0.88354 0.000 0.980 0.020
#> GSM25687     2  0.1289    0.88281 0.000 0.968 0.032
#> GSM48664     1  0.1031    0.83053 0.976 0.000 0.024
#> GSM48665     1  0.0892    0.82663 0.980 0.000 0.020

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2   0.281    0.36339 0.000 0.868 0.000 0.132
#> GSM25549     2   0.339    0.36438 0.000 0.852 0.016 0.132
#> GSM25550     2   0.424    0.33734 0.052 0.844 0.024 0.080
#> GSM25551     2   0.614   -0.00231 0.000 0.496 0.048 0.456
#> GSM25570     2   0.182    0.37021 0.000 0.936 0.004 0.060
#> GSM25571     2   0.227    0.36805 0.000 0.912 0.004 0.084
#> GSM25358     3   0.943    0.30362 0.288 0.108 0.368 0.236
#> GSM25359     2   0.820    0.03856 0.012 0.400 0.268 0.320
#> GSM25360     3   0.616    0.54343 0.196 0.040 0.708 0.056
#> GSM25361     3   0.914    0.41906 0.148 0.304 0.424 0.124
#> GSM25377     1   0.430    0.76403 0.824 0.004 0.112 0.060
#> GSM25378     1   0.674    0.61658 0.684 0.040 0.152 0.124
#> GSM25401     3   0.806    0.28135 0.104 0.052 0.424 0.420
#> GSM25402     3   0.815    0.11636 0.376 0.012 0.376 0.236
#> GSM25349     4   0.642   -0.05337 0.004 0.432 0.056 0.508
#> GSM25350     2   0.578    0.13176 0.000 0.560 0.032 0.408
#> GSM25356     1   0.543    0.71327 0.760 0.016 0.148 0.076
#> GSM25357     4   0.687    0.04434 0.016 0.420 0.064 0.500
#> GSM25385     3   0.525    0.52444 0.236 0.004 0.720 0.040
#> GSM25386     3   0.401    0.60571 0.080 0.008 0.848 0.064
#> GSM25399     1   0.371    0.76995 0.848 0.000 0.112 0.040
#> GSM25400     1   0.543    0.69028 0.728 0.000 0.188 0.084
#> GSM48659     2   0.515   -0.03563 0.000 0.536 0.004 0.460
#> GSM48660     4   0.534    0.15987 0.000 0.424 0.012 0.564
#> GSM25409     2   0.639    0.23110 0.028 0.624 0.040 0.308
#> GSM25410     3   0.430    0.60541 0.092 0.032 0.840 0.036
#> GSM25426     4   0.655    0.16155 0.000 0.304 0.104 0.592
#> GSM25427     1   0.546    0.71156 0.776 0.032 0.100 0.092
#> GSM25540     3   0.790    0.22665 0.004 0.312 0.432 0.252
#> GSM25541     3   0.829    0.34475 0.032 0.300 0.468 0.200
#> GSM25542     4   0.761    0.06533 0.000 0.276 0.248 0.476
#> GSM25543     4   0.837   -0.12007 0.024 0.224 0.372 0.380
#> GSM25479     1   0.300    0.78160 0.892 0.004 0.080 0.024
#> GSM25480     1   0.406    0.76586 0.848 0.036 0.096 0.020
#> GSM25481     1   0.782    0.51267 0.612 0.088 0.148 0.152
#> GSM25482     1   0.614    0.66815 0.740 0.064 0.116 0.080
#> GSM48654     4   0.541    0.07932 0.000 0.480 0.012 0.508
#> GSM48650     4   0.530    0.20822 0.000 0.372 0.016 0.612
#> GSM48651     4   0.508    0.17539 0.000 0.420 0.004 0.576
#> GSM48652     4   0.487    0.20234 0.000 0.404 0.000 0.596
#> GSM48653     4   0.505    0.18891 0.000 0.408 0.004 0.588
#> GSM48662     2   0.499   -0.09181 0.000 0.520 0.000 0.480
#> GSM48663     4   0.545    0.16707 0.000 0.388 0.020 0.592
#> GSM25524     1   0.595    0.02269 0.488 0.004 0.480 0.028
#> GSM25525     1   0.418    0.73661 0.824 0.016 0.140 0.020
#> GSM25526     3   0.663    0.51484 0.252 0.000 0.612 0.136
#> GSM25527     1   0.369    0.76685 0.860 0.004 0.088 0.048
#> GSM25528     1   0.513    0.55478 0.680 0.004 0.300 0.016
#> GSM25529     1   0.425    0.71606 0.800 0.008 0.176 0.016
#> GSM25530     1   0.499    0.52476 0.672 0.004 0.316 0.008
#> GSM25531     1   0.385    0.73100 0.820 0.000 0.160 0.020
#> GSM48661     4   0.621    0.02287 0.000 0.472 0.052 0.476
#> GSM25561     3   0.634    0.01697 0.468 0.012 0.484 0.036
#> GSM25562     1   0.552    0.60440 0.684 0.000 0.264 0.052
#> GSM25563     3   0.558    0.50242 0.248 0.004 0.696 0.052
#> GSM25564     1   0.943   -0.14371 0.392 0.140 0.176 0.292
#> GSM25565     2   0.585   -0.02091 0.000 0.508 0.032 0.460
#> GSM25566     2   0.532    0.08170 0.000 0.572 0.012 0.416
#> GSM25568     4   0.969   -0.31699 0.220 0.148 0.304 0.328
#> GSM25569     2   0.544    0.08874 0.000 0.560 0.016 0.424
#> GSM25552     2   0.484    0.33057 0.040 0.808 0.036 0.116
#> GSM25553     2   0.828    0.14436 0.212 0.556 0.088 0.144
#> GSM25578     1   0.238    0.77538 0.916 0.004 0.072 0.008
#> GSM25579     1   0.653    0.59945 0.696 0.132 0.140 0.032
#> GSM25580     1   0.234    0.78072 0.920 0.000 0.060 0.020
#> GSM25581     1   0.206    0.77805 0.932 0.000 0.052 0.016
#> GSM48655     2   0.516   -0.10533 0.000 0.516 0.004 0.480
#> GSM48656     2   0.516   -0.08560 0.000 0.524 0.004 0.472
#> GSM48657     4   0.498    0.11857 0.000 0.464 0.000 0.536
#> GSM48658     2   0.562    0.10060 0.000 0.560 0.024 0.416
#> GSM25624     1   0.432    0.75712 0.824 0.008 0.120 0.048
#> GSM25625     3   0.582    0.48361 0.296 0.004 0.652 0.048
#> GSM25626     3   0.395    0.60927 0.072 0.004 0.848 0.076
#> GSM25627     3   0.706    0.25993 0.024 0.064 0.488 0.424
#> GSM25628     3   0.592    0.52067 0.016 0.064 0.704 0.216
#> GSM25629     4   0.725    0.06644 0.000 0.160 0.336 0.504
#> GSM25630     3   0.565    0.43841 0.296 0.000 0.656 0.048
#> GSM25631     2   0.744    0.20175 0.044 0.616 0.136 0.204
#> GSM25632     3   0.551    0.32811 0.352 0.000 0.620 0.028
#> GSM25633     1   0.310    0.78013 0.876 0.000 0.104 0.020
#> GSM25634     1   0.273    0.78112 0.900 0.004 0.084 0.012
#> GSM25635     1   0.283    0.77376 0.900 0.000 0.060 0.040
#> GSM25656     3   0.699    0.45540 0.024 0.080 0.584 0.312
#> GSM25657     1   0.420    0.74235 0.808 0.000 0.156 0.036
#> GSM25658     3   0.758    0.21113 0.384 0.008 0.456 0.152
#> GSM25659     1   0.715    0.53414 0.632 0.052 0.232 0.084
#> GSM25660     1   0.222    0.78067 0.924 0.000 0.060 0.016
#> GSM25661     1   0.226    0.77806 0.924 0.000 0.056 0.020
#> GSM25662     4   0.569    0.08467 0.000 0.460 0.024 0.516
#> GSM25663     2   0.602    0.23404 0.000 0.632 0.068 0.300
#> GSM25680     2   0.508    0.31903 0.004 0.740 0.040 0.216
#> GSM25681     2   0.702    0.23867 0.056 0.668 0.112 0.164
#> GSM25682     2   0.502    0.07087 0.000 0.600 0.004 0.396
#> GSM25683     2   0.524   -0.00584 0.000 0.556 0.008 0.436
#> GSM25684     2   0.538   -0.04697 0.000 0.540 0.012 0.448
#> GSM25685     4   0.610    0.15705 0.000 0.364 0.056 0.580
#> GSM25686     2   0.503    0.06982 0.000 0.596 0.004 0.400
#> GSM25687     2   0.504    0.07276 0.000 0.592 0.004 0.404
#> GSM48664     1   0.322    0.77016 0.880 0.000 0.076 0.044
#> GSM48665     1   0.241    0.77040 0.916 0.000 0.064 0.020

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     5   0.507    0.39151 0.000 0.296 0.008 0.044 0.652
#> GSM25549     5   0.528    0.49663 0.008 0.224 0.024 0.044 0.700
#> GSM25550     5   0.532    0.50148 0.016 0.200 0.028 0.040 0.716
#> GSM25551     2   0.722    0.11401 0.000 0.356 0.016 0.316 0.312
#> GSM25570     5   0.448    0.48897 0.000 0.224 0.008 0.036 0.732
#> GSM25571     5   0.511    0.42729 0.000 0.268 0.008 0.056 0.668
#> GSM25358     4   0.887    0.10857 0.180 0.036 0.256 0.380 0.148
#> GSM25359     5   0.893   -0.03461 0.020 0.176 0.224 0.284 0.296
#> GSM25360     3   0.554    0.46235 0.160 0.004 0.716 0.056 0.064
#> GSM25361     3   0.847    0.17264 0.100 0.064 0.404 0.096 0.336
#> GSM25377     1   0.627    0.63423 0.636 0.008 0.124 0.204 0.028
#> GSM25378     1   0.677    0.52138 0.584 0.004 0.124 0.236 0.052
#> GSM25401     4   0.689    0.36896 0.056 0.140 0.176 0.612 0.016
#> GSM25402     4   0.849    0.08382 0.220 0.088 0.244 0.416 0.032
#> GSM25349     2   0.668    0.37420 0.012 0.584 0.024 0.140 0.240
#> GSM25350     2   0.674    0.30630 0.004 0.536 0.024 0.144 0.292
#> GSM25356     1   0.601    0.58030 0.612 0.008 0.060 0.292 0.028
#> GSM25357     2   0.756    0.25530 0.016 0.424 0.032 0.348 0.180
#> GSM25385     3   0.597    0.36075 0.156 0.000 0.644 0.180 0.020
#> GSM25386     3   0.391    0.42743 0.048 0.004 0.832 0.092 0.024
#> GSM25399     1   0.501    0.66577 0.728 0.000 0.096 0.164 0.012
#> GSM25400     1   0.633    0.57176 0.616 0.004 0.128 0.224 0.028
#> GSM48659     2   0.585    0.41235 0.000 0.596 0.012 0.092 0.300
#> GSM48660     2   0.334    0.54801 0.000 0.856 0.008 0.064 0.072
#> GSM25409     2   0.726    0.05096 0.016 0.432 0.032 0.128 0.392
#> GSM25410     3   0.546    0.40452 0.100 0.004 0.720 0.144 0.032
#> GSM25426     4   0.680   -0.32940 0.000 0.408 0.024 0.428 0.140
#> GSM25427     1   0.610    0.61802 0.680 0.036 0.064 0.188 0.032
#> GSM25540     5   0.840    0.02982 0.008 0.108 0.300 0.244 0.340
#> GSM25541     3   0.861   -0.01519 0.032 0.084 0.332 0.224 0.328
#> GSM25542     2   0.798    0.25865 0.004 0.476 0.152 0.188 0.180
#> GSM25543     3   0.849   -0.02190 0.008 0.244 0.368 0.136 0.244
#> GSM25479     1   0.492    0.68209 0.764 0.000 0.104 0.088 0.044
#> GSM25480     1   0.620    0.63049 0.660 0.000 0.164 0.088 0.088
#> GSM25481     1   0.777    0.44553 0.532 0.080 0.072 0.252 0.064
#> GSM25482     1   0.745    0.49595 0.564 0.060 0.064 0.240 0.072
#> GSM48654     2   0.467    0.51397 0.000 0.748 0.012 0.064 0.176
#> GSM48650     2   0.407    0.55735 0.000 0.784 0.004 0.164 0.048
#> GSM48651     2   0.372    0.56823 0.000 0.828 0.008 0.060 0.104
#> GSM48652     2   0.323    0.55536 0.000 0.852 0.000 0.060 0.088
#> GSM48653     2   0.500    0.52100 0.000 0.732 0.012 0.108 0.148
#> GSM48662     2   0.392    0.52134 0.000 0.796 0.004 0.044 0.156
#> GSM48663     2   0.437    0.51052 0.008 0.796 0.008 0.092 0.096
#> GSM25524     3   0.571    0.04710 0.368 0.000 0.564 0.040 0.028
#> GSM25525     1   0.547    0.59548 0.684 0.000 0.216 0.072 0.028
#> GSM25526     4   0.712   -0.00702 0.152 0.008 0.404 0.412 0.024
#> GSM25527     1   0.557    0.63246 0.696 0.000 0.156 0.120 0.028
#> GSM25528     1   0.561    0.32130 0.524 0.000 0.416 0.048 0.012
#> GSM25529     1   0.546    0.62296 0.692 0.000 0.200 0.080 0.028
#> GSM25530     1   0.615    0.39313 0.512 0.000 0.384 0.088 0.016
#> GSM25531     1   0.568    0.60423 0.660 0.000 0.212 0.112 0.016
#> GSM48661     2   0.651    0.40234 0.000 0.616 0.068 0.108 0.208
#> GSM25561     3   0.603    0.18647 0.336 0.000 0.556 0.096 0.012
#> GSM25562     1   0.624    0.55282 0.624 0.016 0.248 0.092 0.020
#> GSM25563     3   0.533    0.45284 0.212 0.000 0.692 0.076 0.020
#> GSM25564     1   0.963   -0.04373 0.316 0.204 0.156 0.216 0.108
#> GSM25565     2   0.659    0.43881 0.000 0.576 0.036 0.144 0.244
#> GSM25566     2   0.676    0.30996 0.000 0.492 0.024 0.148 0.336
#> GSM25568     3   0.974    0.03103 0.132 0.224 0.300 0.188 0.156
#> GSM25569     2   0.611    0.36622 0.000 0.604 0.028 0.096 0.272
#> GSM25552     5   0.541    0.49570 0.032 0.208 0.024 0.028 0.708
#> GSM25553     5   0.734    0.42017 0.128 0.132 0.072 0.056 0.612
#> GSM25578     1   0.470    0.67500 0.768 0.000 0.136 0.068 0.028
#> GSM25579     1   0.760    0.41375 0.508 0.004 0.216 0.088 0.184
#> GSM25580     1   0.311    0.69090 0.872 0.000 0.076 0.036 0.016
#> GSM25581     1   0.344    0.69273 0.852 0.000 0.076 0.060 0.012
#> GSM48655     2   0.442    0.53798 0.000 0.756 0.004 0.060 0.180
#> GSM48656     2   0.457    0.49383 0.004 0.752 0.008 0.048 0.188
#> GSM48657     2   0.381    0.55668 0.000 0.816 0.004 0.064 0.116
#> GSM48658     2   0.652    0.23271 0.000 0.524 0.024 0.120 0.332
#> GSM25624     1   0.526    0.66085 0.732 0.000 0.108 0.124 0.036
#> GSM25625     3   0.670    0.28538 0.216 0.004 0.560 0.200 0.020
#> GSM25626     3   0.564    0.33101 0.052 0.024 0.704 0.192 0.028
#> GSM25627     4   0.746    0.35429 0.012 0.140 0.228 0.540 0.080
#> GSM25628     3   0.683    0.12296 0.004 0.080 0.576 0.256 0.084
#> GSM25629     4   0.787    0.21963 0.000 0.176 0.204 0.472 0.148
#> GSM25630     3   0.530    0.44617 0.228 0.004 0.692 0.056 0.020
#> GSM25631     5   0.720    0.42191 0.020 0.176 0.124 0.084 0.596
#> GSM25632     3   0.571    0.41605 0.252 0.000 0.640 0.092 0.016
#> GSM25633     1   0.405    0.68330 0.800 0.000 0.144 0.040 0.016
#> GSM25634     1   0.424    0.68765 0.804 0.000 0.104 0.068 0.024
#> GSM25635     1   0.468    0.68001 0.772 0.000 0.092 0.112 0.024
#> GSM25656     3   0.803    0.07686 0.016 0.108 0.472 0.256 0.148
#> GSM25657     1   0.556    0.65263 0.680 0.000 0.184 0.120 0.016
#> GSM25658     4   0.767    0.04062 0.268 0.016 0.292 0.400 0.024
#> GSM25659     1   0.842    0.21247 0.416 0.020 0.276 0.160 0.128
#> GSM25660     1   0.544    0.66949 0.724 0.000 0.136 0.060 0.080
#> GSM25661     1   0.418    0.69071 0.804 0.000 0.116 0.060 0.020
#> GSM25662     2   0.630    0.46358 0.000 0.584 0.012 0.200 0.204
#> GSM25663     5   0.696   -0.04730 0.000 0.412 0.056 0.100 0.432
#> GSM25680     5   0.611    0.42892 0.000 0.232 0.040 0.096 0.632
#> GSM25681     5   0.638    0.49765 0.012 0.108 0.152 0.064 0.664
#> GSM25682     2   0.577    0.44131 0.000 0.608 0.004 0.116 0.272
#> GSM25683     2   0.573    0.47172 0.000 0.632 0.004 0.140 0.224
#> GSM25684     2   0.593    0.44017 0.000 0.592 0.004 0.132 0.272
#> GSM25685     2   0.676    0.29008 0.000 0.436 0.016 0.388 0.160
#> GSM25686     2   0.560    0.45054 0.000 0.620 0.000 0.120 0.260
#> GSM25687     2   0.542    0.47034 0.000 0.644 0.000 0.112 0.244
#> GSM48664     1   0.451    0.67440 0.776 0.000 0.064 0.140 0.020
#> GSM48665     1   0.386    0.67835 0.832 0.000 0.052 0.088 0.028

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM25548     6   0.510    0.27789 0.000 0.052 0.000 0.012 0.424 0.512
#> GSM25549     6   0.637    0.39674 0.012 0.108 0.020 0.036 0.232 0.592
#> GSM25550     6   0.635    0.44823 0.020 0.072 0.016 0.068 0.204 0.620
#> GSM25551     5   0.676    0.23435 0.000 0.232 0.060 0.028 0.544 0.136
#> GSM25570     6   0.534    0.36083 0.004 0.052 0.008 0.012 0.356 0.568
#> GSM25571     6   0.488    0.25325 0.000 0.048 0.004 0.000 0.448 0.500
#> GSM25358     4   0.933    0.00170 0.068 0.140 0.232 0.312 0.152 0.096
#> GSM25359     6   0.893    0.12122 0.016 0.192 0.204 0.076 0.252 0.260
#> GSM25360     3   0.725    0.43528 0.212 0.068 0.524 0.072 0.000 0.124
#> GSM25361     6   0.914   -0.14401 0.192 0.140 0.248 0.080 0.044 0.296
#> GSM25377     4   0.569    0.05764 0.400 0.008 0.060 0.504 0.000 0.028
#> GSM25378     4   0.677    0.33705 0.248 0.020 0.072 0.556 0.012 0.092
#> GSM25401     4   0.870   -0.10764 0.032 0.164 0.276 0.300 0.192 0.036
#> GSM25402     4   0.795    0.20008 0.120 0.096 0.224 0.480 0.044 0.036
#> GSM25349     5   0.809    0.10795 0.000 0.236 0.060 0.148 0.400 0.156
#> GSM25350     5   0.776    0.07959 0.000 0.260 0.036 0.084 0.376 0.244
#> GSM25356     4   0.696    0.33946 0.264 0.032 0.052 0.548 0.036 0.068
#> GSM25357     5   0.722    0.27448 0.012 0.172 0.040 0.092 0.556 0.128
#> GSM25385     3   0.642    0.37698 0.192 0.032 0.576 0.176 0.004 0.020
#> GSM25386     3   0.507    0.48497 0.080 0.060 0.744 0.084 0.000 0.032
#> GSM25399     1   0.562    0.16619 0.492 0.004 0.076 0.412 0.004 0.012
#> GSM25400     4   0.691    0.12698 0.352 0.044 0.148 0.436 0.004 0.016
#> GSM48659     2   0.636    0.09708 0.000 0.412 0.008 0.012 0.380 0.188
#> GSM48660     5   0.633    0.01504 0.000 0.352 0.028 0.048 0.508 0.064
#> GSM25409     6   0.812    0.01115 0.020 0.152 0.044 0.092 0.336 0.356
#> GSM25410     3   0.543    0.46002 0.072 0.040 0.724 0.120 0.016 0.028
#> GSM25426     5   0.654    0.21300 0.000 0.268 0.096 0.040 0.552 0.044
#> GSM25427     4   0.680    0.31699 0.260 0.040 0.068 0.560 0.020 0.052
#> GSM25540     2   0.812   -0.11193 0.016 0.320 0.260 0.020 0.108 0.276
#> GSM25541     6   0.862    0.03221 0.040 0.252 0.268 0.068 0.060 0.312
#> GSM25542     5   0.796   -0.00389 0.000 0.280 0.132 0.048 0.384 0.156
#> GSM25543     3   0.907   -0.03480 0.048 0.272 0.296 0.076 0.120 0.188
#> GSM25479     1   0.514    0.46229 0.684 0.000 0.056 0.192 0.000 0.068
#> GSM25480     1   0.582    0.41156 0.648 0.012 0.052 0.168 0.000 0.120
#> GSM25481     4   0.836    0.35244 0.196 0.072 0.084 0.472 0.076 0.100
#> GSM25482     4   0.713    0.32537 0.268 0.060 0.036 0.532 0.032 0.072
#> GSM48654     2   0.589    0.16726 0.000 0.484 0.020 0.000 0.372 0.124
#> GSM48650     5   0.497    0.29039 0.000 0.280 0.016 0.032 0.652 0.020
#> GSM48651     5   0.532   -0.06169 0.000 0.440 0.016 0.008 0.492 0.044
#> GSM48652     5   0.496   -0.09011 0.000 0.456 0.012 0.000 0.492 0.040
#> GSM48653     2   0.529    0.13807 0.000 0.540 0.020 0.000 0.380 0.060
#> GSM48662     2   0.650    0.12430 0.000 0.452 0.008 0.032 0.352 0.156
#> GSM48663     5   0.715    0.06994 0.000 0.312 0.028 0.092 0.460 0.108
#> GSM25524     1   0.666    0.06824 0.480 0.032 0.336 0.120 0.000 0.032
#> GSM25525     1   0.392    0.51092 0.804 0.004 0.080 0.088 0.000 0.024
#> GSM25526     3   0.828    0.24807 0.208 0.132 0.424 0.168 0.024 0.044
#> GSM25527     1   0.550    0.44435 0.684 0.020 0.096 0.160 0.000 0.040
#> GSM25528     1   0.515    0.44335 0.660 0.004 0.224 0.096 0.000 0.016
#> GSM25529     1   0.377    0.51039 0.820 0.008 0.080 0.068 0.000 0.024
#> GSM25530     1   0.555    0.44851 0.644 0.012 0.180 0.148 0.000 0.016
#> GSM25531     1   0.555    0.47739 0.660 0.012 0.136 0.164 0.000 0.028
#> GSM48661     2   0.633    0.23072 0.000 0.508 0.032 0.008 0.308 0.144
#> GSM25561     1   0.742    0.02908 0.376 0.036 0.344 0.188 0.000 0.056
#> GSM25562     1   0.697    0.30267 0.516 0.056 0.124 0.260 0.000 0.044
#> GSM25563     3   0.723    0.36848 0.224 0.060 0.512 0.144 0.000 0.060
#> GSM25564     1   0.982   -0.17192 0.252 0.164 0.116 0.184 0.144 0.140
#> GSM25565     5   0.680    0.06616 0.000 0.336 0.044 0.044 0.480 0.096
#> GSM25566     5   0.648    0.26946 0.000 0.160 0.036 0.032 0.576 0.196
#> GSM25568     2   0.955   -0.16266 0.124 0.252 0.248 0.152 0.068 0.156
#> GSM25569     2   0.721    0.04806 0.000 0.360 0.024 0.036 0.316 0.264
#> GSM25552     6   0.646    0.42201 0.048 0.092 0.012 0.040 0.188 0.620
#> GSM25553     6   0.795    0.35445 0.140 0.092 0.044 0.104 0.092 0.528
#> GSM25578     1   0.417    0.50109 0.772 0.004 0.036 0.152 0.000 0.036
#> GSM25579     1   0.691    0.30794 0.572 0.056 0.080 0.116 0.000 0.176
#> GSM25580     1   0.449    0.43953 0.680 0.004 0.048 0.264 0.000 0.004
#> GSM25581     1   0.478    0.46198 0.712 0.012 0.056 0.200 0.000 0.020
#> GSM48655     5   0.470    0.33500 0.000 0.140 0.004 0.028 0.736 0.092
#> GSM48656     2   0.655    0.11682 0.000 0.404 0.016 0.020 0.396 0.164
#> GSM48657     5   0.495    0.29651 0.000 0.196 0.000 0.048 0.696 0.060
#> GSM48658     2   0.686    0.20391 0.004 0.460 0.028 0.016 0.288 0.204
#> GSM25624     4   0.658    0.01731 0.388 0.016 0.092 0.452 0.004 0.048
#> GSM25625     3   0.726    0.31025 0.236 0.060 0.492 0.164 0.000 0.048
#> GSM25626     3   0.507    0.48727 0.084 0.052 0.760 0.056 0.016 0.032
#> GSM25627     3   0.871    0.16848 0.036 0.276 0.344 0.132 0.156 0.056
#> GSM25628     3   0.668    0.36546 0.020 0.256 0.568 0.028 0.048 0.080
#> GSM25629     2   0.804    0.01517 0.004 0.388 0.204 0.060 0.260 0.084
#> GSM25630     3   0.666    0.29309 0.292 0.040 0.520 0.112 0.000 0.036
#> GSM25631     6   0.788    0.23634 0.080 0.260 0.080 0.040 0.064 0.476
#> GSM25632     3   0.610    0.21586 0.356 0.020 0.504 0.104 0.000 0.016
#> GSM25633     1   0.466    0.45969 0.688 0.004 0.064 0.236 0.000 0.008
#> GSM25634     1   0.563    0.37317 0.584 0.012 0.080 0.304 0.000 0.020
#> GSM25635     1   0.576    0.34060 0.580 0.016 0.052 0.316 0.004 0.032
#> GSM25656     3   0.844    0.13880 0.040 0.336 0.344 0.056 0.096 0.128
#> GSM25657     1   0.551    0.43682 0.632 0.012 0.124 0.220 0.000 0.012
#> GSM25658     3   0.818    0.06176 0.268 0.152 0.312 0.236 0.004 0.028
#> GSM25659     1   0.791    0.21132 0.496 0.132 0.092 0.180 0.016 0.084
#> GSM25660     1   0.514    0.44977 0.700 0.012 0.036 0.180 0.000 0.072
#> GSM25661     1   0.404    0.47750 0.744 0.004 0.028 0.212 0.000 0.012
#> GSM25662     5   0.555    0.27387 0.000 0.228 0.028 0.008 0.636 0.100
#> GSM25663     5   0.698    0.12077 0.008 0.184 0.036 0.016 0.468 0.288
#> GSM25680     6   0.712    0.26771 0.012 0.204 0.052 0.008 0.260 0.464
#> GSM25681     6   0.712    0.39935 0.044 0.116 0.076 0.044 0.116 0.604
#> GSM25682     5   0.312    0.39610 0.000 0.040 0.008 0.000 0.840 0.112
#> GSM25683     5   0.303    0.40058 0.000 0.052 0.008 0.000 0.852 0.088
#> GSM25684     5   0.575    0.21539 0.000 0.232 0.036 0.004 0.612 0.116
#> GSM25685     5   0.620    0.18613 0.000 0.312 0.068 0.024 0.548 0.048
#> GSM25686     5   0.235    0.39606 0.000 0.008 0.000 0.000 0.868 0.124
#> GSM25687     5   0.307    0.39316 0.000 0.032 0.000 0.008 0.840 0.120
#> GSM48664     1   0.503    0.09049 0.480 0.016 0.024 0.472 0.000 0.008
#> GSM48665     1   0.511    0.18751 0.536 0.008 0.016 0.412 0.004 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-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 genotype/variation(p) k
#> CV:skmeans 98              2.90e-05 2
#> CV:skmeans 81              3.48e-05 3
#> CV:skmeans 39              5.81e-01 4
#> CV:skmeans 36              6.53e-05 5
#> CV:skmeans  3                    NA 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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 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-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.141           0.629       0.801         0.4750 0.519   0.519
#> 3 3 0.280           0.596       0.715         0.3798 0.714   0.495
#> 4 4 0.404           0.490       0.724         0.1130 0.838   0.564
#> 5 5 0.443           0.413       0.704         0.0265 0.988   0.952
#> 6 6 0.459           0.444       0.698         0.0131 0.972   0.894

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
#> GSM25548     2  0.4161    0.77409 0.084 0.916
#> GSM25549     2  0.5059    0.77295 0.112 0.888
#> GSM25550     2  0.3431    0.76931 0.064 0.936
#> GSM25551     2  0.9970    0.37705 0.468 0.532
#> GSM25570     2  0.3431    0.76931 0.064 0.936
#> GSM25571     2  0.3733    0.77143 0.072 0.928
#> GSM25358     2  0.5178    0.75815 0.116 0.884
#> GSM25359     2  0.9944    0.40872 0.456 0.544
#> GSM25360     2  0.9248    0.28603 0.340 0.660
#> GSM25361     2  0.9209    0.53837 0.336 0.664
#> GSM25377     1  0.9635    0.49328 0.612 0.388
#> GSM25378     2  1.0000   -0.03854 0.500 0.500
#> GSM25401     1  0.4690    0.72970 0.900 0.100
#> GSM25402     2  0.9881    0.23816 0.436 0.564
#> GSM25349     2  0.4431    0.77864 0.092 0.908
#> GSM25350     2  0.4298    0.77960 0.088 0.912
#> GSM25356     2  0.9993   -0.00792 0.484 0.516
#> GSM25357     2  0.6343    0.77792 0.160 0.840
#> GSM25385     1  0.6048    0.73634 0.852 0.148
#> GSM25386     1  0.9922    0.20483 0.552 0.448
#> GSM25399     1  0.7453    0.69679 0.788 0.212
#> GSM25400     1  0.8955    0.62857 0.688 0.312
#> GSM48659     2  0.2423    0.78965 0.040 0.960
#> GSM48660     2  0.0672    0.78145 0.008 0.992
#> GSM25409     2  0.4939    0.77324 0.108 0.892
#> GSM25410     1  0.9996    0.33290 0.512 0.488
#> GSM25426     2  1.0000    0.11657 0.496 0.504
#> GSM25427     2  0.6801    0.74568 0.180 0.820
#> GSM25540     2  0.9933    0.29641 0.452 0.548
#> GSM25541     2  0.9993    0.20315 0.484 0.516
#> GSM25542     2  0.3584    0.78061 0.068 0.932
#> GSM25543     2  0.7453    0.72331 0.212 0.788
#> GSM25479     1  0.8763    0.54952 0.704 0.296
#> GSM25480     1  0.9686    0.32536 0.604 0.396
#> GSM25481     2  0.4022    0.77323 0.080 0.920
#> GSM25482     2  0.8144    0.53496 0.252 0.748
#> GSM48654     2  0.0672    0.78097 0.008 0.992
#> GSM48650     2  0.5178    0.77163 0.116 0.884
#> GSM48651     2  0.1184    0.78319 0.016 0.984
#> GSM48652     2  0.5842    0.76846 0.140 0.860
#> GSM48653     2  0.7745    0.63587 0.228 0.772
#> GSM48662     2  0.4939    0.79136 0.108 0.892
#> GSM48663     2  0.2043    0.78579 0.032 0.968
#> GSM25524     1  0.4161    0.72454 0.916 0.084
#> GSM25525     1  0.6048    0.71348 0.852 0.148
#> GSM25526     1  0.3733    0.72359 0.928 0.072
#> GSM25527     1  0.5629    0.73863 0.868 0.132
#> GSM25528     1  0.4431    0.73565 0.908 0.092
#> GSM25529     1  0.0938    0.72705 0.988 0.012
#> GSM25530     1  0.0938    0.72597 0.988 0.012
#> GSM25531     1  0.5294    0.74032 0.880 0.120
#> GSM48661     2  0.5178    0.75264 0.116 0.884
#> GSM25561     1  0.7139    0.68473 0.804 0.196
#> GSM25562     1  0.8499    0.57467 0.724 0.276
#> GSM25563     1  0.9460    0.36073 0.636 0.364
#> GSM25564     2  0.3879    0.78470 0.076 0.924
#> GSM25565     2  0.2603    0.78522 0.044 0.956
#> GSM25566     2  0.9170    0.60520 0.332 0.668
#> GSM25568     2  0.6048    0.77048 0.148 0.852
#> GSM25569     2  0.6048    0.78344 0.148 0.852
#> GSM25552     2  0.3431    0.76931 0.064 0.936
#> GSM25553     2  0.3584    0.77001 0.068 0.932
#> GSM25578     1  0.9775    0.32219 0.588 0.412
#> GSM25579     2  0.9209    0.53948 0.336 0.664
#> GSM25580     1  0.8327    0.64238 0.736 0.264
#> GSM25581     1  0.6343    0.71259 0.840 0.160
#> GSM48655     2  0.1414    0.78357 0.020 0.980
#> GSM48656     2  0.1633    0.78514 0.024 0.976
#> GSM48657     2  0.2236    0.78553 0.036 0.964
#> GSM48658     2  0.7602    0.68995 0.220 0.780
#> GSM25624     1  0.9209    0.55951 0.664 0.336
#> GSM25625     1  0.2778    0.73073 0.952 0.048
#> GSM25626     1  0.6438    0.71487 0.836 0.164
#> GSM25627     1  0.4298    0.72489 0.912 0.088
#> GSM25628     1  0.9358    0.38681 0.648 0.352
#> GSM25629     1  0.4690    0.72444 0.900 0.100
#> GSM25630     1  0.9358    0.59282 0.648 0.352
#> GSM25631     2  0.7602    0.71635 0.220 0.780
#> GSM25632     1  0.3431    0.72128 0.936 0.064
#> GSM25633     1  0.7219    0.68986 0.800 0.200
#> GSM25634     1  0.7299    0.71832 0.796 0.204
#> GSM25635     1  0.9963    0.25364 0.536 0.464
#> GSM25656     2  0.9732    0.39714 0.404 0.596
#> GSM25657     1  0.2423    0.73421 0.960 0.040
#> GSM25658     1  0.3584    0.72187 0.932 0.068
#> GSM25659     2  0.6438    0.75150 0.164 0.836
#> GSM25660     1  0.9881    0.29556 0.564 0.436
#> GSM25661     1  0.8861    0.58877 0.696 0.304
#> GSM25662     2  0.4298    0.77076 0.088 0.912
#> GSM25663     2  0.3431    0.78202 0.064 0.936
#> GSM25680     2  0.6048    0.76248 0.148 0.852
#> GSM25681     2  0.6712    0.74317 0.176 0.824
#> GSM25682     2  0.2423    0.78044 0.040 0.960
#> GSM25683     2  0.0376    0.77980 0.004 0.996
#> GSM25684     2  0.3431    0.77904 0.064 0.936
#> GSM25685     2  0.9608    0.43570 0.384 0.616
#> GSM25686     2  0.0000    0.78006 0.000 1.000
#> GSM25687     2  0.2778    0.77887 0.048 0.952
#> GSM48664     2  0.9963    0.01176 0.464 0.536
#> GSM48665     1  0.9087    0.48310 0.676 0.324

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.2878     0.7405 0.000 0.904 0.096
#> GSM25549     2  0.3112     0.7442 0.004 0.900 0.096
#> GSM25550     2  0.3116     0.7387 0.000 0.892 0.108
#> GSM25551     2  0.8984     0.4060 0.212 0.564 0.224
#> GSM25570     2  0.2959     0.7389 0.000 0.900 0.100
#> GSM25571     2  0.3112     0.7411 0.004 0.900 0.096
#> GSM25358     3  0.5408     0.7078 0.052 0.136 0.812
#> GSM25359     2  0.7610     0.5377 0.216 0.676 0.108
#> GSM25360     3  1.0000     0.0431 0.332 0.332 0.336
#> GSM25361     3  0.8810     0.5688 0.172 0.252 0.576
#> GSM25377     1  0.6597     0.6157 0.664 0.312 0.024
#> GSM25378     2  0.6836     0.6378 0.240 0.704 0.056
#> GSM25401     1  0.5012     0.7034 0.788 0.008 0.204
#> GSM25402     3  0.7139     0.6242 0.244 0.068 0.688
#> GSM25349     2  0.6396     0.5368 0.016 0.664 0.320
#> GSM25350     2  0.5269     0.6912 0.016 0.784 0.200
#> GSM25356     2  0.7816     0.5665 0.288 0.628 0.084
#> GSM25357     2  0.7410     0.4111 0.040 0.576 0.384
#> GSM25385     1  0.4708     0.7574 0.844 0.120 0.036
#> GSM25386     3  0.5680     0.6032 0.212 0.024 0.764
#> GSM25399     1  0.5442     0.7185 0.812 0.056 0.132
#> GSM25400     1  0.6448     0.3934 0.636 0.012 0.352
#> GSM48659     3  0.4663     0.6990 0.016 0.156 0.828
#> GSM48660     3  0.5138     0.6377 0.000 0.252 0.748
#> GSM25409     2  0.3678     0.7493 0.028 0.892 0.080
#> GSM25410     1  0.9294     0.2251 0.484 0.172 0.344
#> GSM25426     3  0.6586     0.5426 0.216 0.056 0.728
#> GSM25427     2  0.2550     0.7319 0.024 0.936 0.040
#> GSM25540     3  0.9537     0.3012 0.224 0.296 0.480
#> GSM25541     3  0.9461     0.3660 0.280 0.224 0.496
#> GSM25542     3  0.4645     0.7036 0.008 0.176 0.816
#> GSM25543     3  0.7266     0.6359 0.080 0.232 0.688
#> GSM25479     1  0.6686     0.3568 0.612 0.372 0.016
#> GSM25480     2  0.5315     0.6542 0.216 0.772 0.012
#> GSM25481     2  0.6275     0.4835 0.008 0.644 0.348
#> GSM25482     2  0.4848     0.7360 0.036 0.836 0.128
#> GSM48654     3  0.2625     0.7053 0.000 0.084 0.916
#> GSM48650     3  0.6447     0.6708 0.060 0.196 0.744
#> GSM48651     3  0.3941     0.7008 0.000 0.156 0.844
#> GSM48652     3  0.7722     0.1568 0.048 0.432 0.520
#> GSM48653     3  0.0475     0.6922 0.004 0.004 0.992
#> GSM48662     2  0.7274     0.1015 0.028 0.520 0.452
#> GSM48663     3  0.4399     0.6855 0.000 0.188 0.812
#> GSM25524     1  0.5159     0.7182 0.820 0.040 0.140
#> GSM25525     1  0.3644     0.7550 0.872 0.124 0.004
#> GSM25526     1  0.2301     0.7602 0.936 0.004 0.060
#> GSM25527     1  0.4172     0.7635 0.868 0.104 0.028
#> GSM25528     1  0.2945     0.7654 0.908 0.088 0.004
#> GSM25529     1  0.2339     0.7653 0.940 0.048 0.012
#> GSM25530     1  0.1411     0.7604 0.964 0.036 0.000
#> GSM25531     1  0.3310     0.7633 0.908 0.028 0.064
#> GSM48661     3  0.3918     0.7106 0.004 0.140 0.856
#> GSM25561     1  0.6154     0.6357 0.752 0.204 0.044
#> GSM25562     1  0.7708     0.1392 0.528 0.048 0.424
#> GSM25563     3  0.7246     0.4782 0.300 0.052 0.648
#> GSM25564     3  0.6507     0.6033 0.028 0.284 0.688
#> GSM25565     3  0.3941     0.7013 0.000 0.156 0.844
#> GSM25566     2  0.7031     0.5961 0.196 0.716 0.088
#> GSM25568     3  0.7694     0.5476 0.068 0.316 0.616
#> GSM25569     2  0.5692     0.7136 0.040 0.784 0.176
#> GSM25552     2  0.3879     0.7231 0.000 0.848 0.152
#> GSM25553     2  0.3686     0.7295 0.000 0.860 0.140
#> GSM25578     2  0.4555     0.6290 0.200 0.800 0.000
#> GSM25579     2  0.3528     0.7189 0.092 0.892 0.016
#> GSM25580     1  0.5105     0.7402 0.828 0.124 0.048
#> GSM25581     1  0.4002     0.7352 0.840 0.160 0.000
#> GSM48655     3  0.5733     0.5255 0.000 0.324 0.676
#> GSM48656     3  0.5138     0.6447 0.000 0.252 0.748
#> GSM48657     3  0.3715     0.7113 0.004 0.128 0.868
#> GSM48658     3  0.7330     0.6603 0.092 0.216 0.692
#> GSM25624     1  0.5810     0.5526 0.664 0.336 0.000
#> GSM25625     1  0.3590     0.7568 0.896 0.028 0.076
#> GSM25626     1  0.4399     0.7441 0.812 0.000 0.188
#> GSM25627     1  0.6106     0.6669 0.756 0.044 0.200
#> GSM25628     3  0.6834     0.4931 0.260 0.048 0.692
#> GSM25629     1  0.6722     0.6375 0.720 0.060 0.220
#> GSM25630     1  0.6297     0.6908 0.756 0.060 0.184
#> GSM25631     2  0.4253     0.7408 0.048 0.872 0.080
#> GSM25632     1  0.2400     0.7591 0.932 0.004 0.064
#> GSM25633     1  0.4702     0.7112 0.788 0.212 0.000
#> GSM25634     1  0.4836     0.7432 0.848 0.072 0.080
#> GSM25635     2  0.6835     0.4352 0.284 0.676 0.040
#> GSM25656     3  0.6633     0.5519 0.212 0.060 0.728
#> GSM25657     1  0.3875     0.7642 0.888 0.044 0.068
#> GSM25658     1  0.2584     0.7586 0.928 0.008 0.064
#> GSM25659     3  0.8886     0.3526 0.132 0.352 0.516
#> GSM25660     2  0.6168     0.1014 0.412 0.588 0.000
#> GSM25661     1  0.6057     0.5511 0.656 0.340 0.004
#> GSM25662     3  0.2261     0.7056 0.000 0.068 0.932
#> GSM25663     3  0.4555     0.6768 0.000 0.200 0.800
#> GSM25680     2  0.4324     0.7342 0.028 0.860 0.112
#> GSM25681     2  0.3045     0.7447 0.020 0.916 0.064
#> GSM25682     3  0.6295     0.0572 0.000 0.472 0.528
#> GSM25683     3  0.3038     0.7060 0.000 0.104 0.896
#> GSM25684     3  0.1964     0.7048 0.000 0.056 0.944
#> GSM25685     3  0.5402     0.6089 0.180 0.028 0.792
#> GSM25686     3  0.4399     0.6926 0.000 0.188 0.812
#> GSM25687     2  0.6309     0.0535 0.000 0.504 0.496
#> GSM48664     1  0.9566    -0.0432 0.424 0.196 0.380
#> GSM48665     1  0.6495     0.1694 0.536 0.460 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.0000    0.78506 0.000 1.000 0.000 0.000
#> GSM25549     2  0.0000    0.78506 0.000 1.000 0.000 0.000
#> GSM25550     2  0.0657    0.78681 0.000 0.984 0.004 0.012
#> GSM25551     3  0.5511    0.30866 0.004 0.284 0.676 0.036
#> GSM25570     2  0.0000    0.78506 0.000 1.000 0.000 0.000
#> GSM25571     2  0.0000    0.78506 0.000 1.000 0.000 0.000
#> GSM25358     4  0.3885    0.73407 0.056 0.056 0.024 0.864
#> GSM25359     3  0.5746    0.16419 0.004 0.368 0.600 0.028
#> GSM25360     4  0.8882    0.19633 0.224 0.304 0.060 0.412
#> GSM25361     4  0.7397    0.27014 0.004 0.144 0.392 0.460
#> GSM25377     1  0.3791    0.59609 0.848 0.120 0.012 0.020
#> GSM25378     2  0.6415    0.63251 0.120 0.716 0.116 0.048
#> GSM25401     3  0.5904    0.23923 0.344 0.004 0.612 0.040
#> GSM25402     4  0.5200    0.60610 0.072 0.000 0.184 0.744
#> GSM25349     2  0.5669    0.45282 0.004 0.600 0.024 0.372
#> GSM25350     2  0.4225    0.71522 0.000 0.792 0.024 0.184
#> GSM25356     2  0.7016    0.58725 0.164 0.672 0.072 0.092
#> GSM25357     2  0.7135    0.48741 0.020 0.592 0.112 0.276
#> GSM25385     3  0.7768   -0.00127 0.388 0.076 0.480 0.056
#> GSM25386     4  0.6597    0.27686 0.060 0.008 0.420 0.512
#> GSM25399     1  0.2542    0.59716 0.904 0.000 0.084 0.012
#> GSM25400     1  0.7092    0.19153 0.528 0.012 0.096 0.364
#> GSM48659     4  0.5159    0.69237 0.000 0.088 0.156 0.756
#> GSM48660     4  0.2654    0.72133 0.000 0.108 0.004 0.888
#> GSM25409     2  0.1059    0.78707 0.000 0.972 0.012 0.016
#> GSM25410     4  0.9317   -0.19354 0.352 0.128 0.160 0.360
#> GSM25426     3  0.4331    0.32482 0.000 0.000 0.712 0.288
#> GSM25427     2  0.3997    0.66850 0.164 0.816 0.012 0.008
#> GSM25540     3  0.6066    0.39019 0.004 0.116 0.692 0.188
#> GSM25541     3  0.6586    0.41638 0.032 0.088 0.676 0.204
#> GSM25542     4  0.4106    0.73689 0.000 0.084 0.084 0.832
#> GSM25543     4  0.6555    0.61721 0.000 0.156 0.212 0.632
#> GSM25479     1  0.8223    0.20850 0.428 0.296 0.260 0.016
#> GSM25480     2  0.4540    0.66175 0.032 0.772 0.196 0.000
#> GSM25481     2  0.4905    0.45197 0.004 0.632 0.000 0.364
#> GSM25482     2  0.3221    0.77264 0.020 0.876 0.004 0.100
#> GSM48654     4  0.1792    0.72769 0.000 0.000 0.068 0.932
#> GSM48650     4  0.6472    0.61968 0.000 0.148 0.212 0.640
#> GSM48651     4  0.1798    0.73899 0.000 0.040 0.016 0.944
#> GSM48652     2  0.7621   -0.10950 0.000 0.420 0.204 0.376
#> GSM48653     4  0.2281    0.72363 0.000 0.000 0.096 0.904
#> GSM48662     2  0.6878    0.09016 0.004 0.504 0.092 0.400
#> GSM48663     4  0.1042    0.73439 0.000 0.020 0.008 0.972
#> GSM25524     3  0.5062    0.32878 0.284 0.000 0.692 0.024
#> GSM25525     1  0.7220    0.37145 0.532 0.176 0.292 0.000
#> GSM25526     1  0.5000   -0.05860 0.500 0.000 0.500 0.000
#> GSM25527     1  0.7265    0.25656 0.524 0.128 0.340 0.008
#> GSM25528     1  0.5022    0.48423 0.708 0.028 0.264 0.000
#> GSM25529     1  0.5212    0.22981 0.572 0.008 0.420 0.000
#> GSM25530     1  0.4746    0.41551 0.688 0.008 0.304 0.000
#> GSM25531     1  0.4994    0.51711 0.744 0.000 0.208 0.048
#> GSM48661     4  0.2500    0.74236 0.000 0.044 0.040 0.916
#> GSM25561     1  0.6614    0.36788 0.608 0.056 0.312 0.024
#> GSM25562     3  0.7471    0.40252 0.184 0.008 0.540 0.268
#> GSM25563     4  0.6292    0.23023 0.060 0.000 0.416 0.524
#> GSM25564     4  0.5101    0.64757 0.004 0.228 0.036 0.732
#> GSM25565     4  0.2699    0.74498 0.000 0.068 0.028 0.904
#> GSM25566     2  0.5961    0.52255 0.004 0.636 0.308 0.052
#> GSM25568     4  0.6716    0.56236 0.004 0.252 0.128 0.616
#> GSM25569     2  0.4213    0.75750 0.004 0.832 0.072 0.092
#> GSM25552     2  0.1940    0.77738 0.000 0.924 0.000 0.076
#> GSM25553     2  0.1637    0.78562 0.000 0.940 0.000 0.060
#> GSM25578     2  0.5842    0.07045 0.448 0.520 0.032 0.000
#> GSM25579     2  0.2266    0.76794 0.000 0.912 0.084 0.004
#> GSM25580     1  0.0188    0.59885 0.996 0.000 0.004 0.000
#> GSM25581     1  0.0895    0.60512 0.976 0.020 0.004 0.000
#> GSM48655     4  0.5528    0.60639 0.000 0.236 0.064 0.700
#> GSM48656     4  0.3105    0.72411 0.000 0.140 0.004 0.856
#> GSM48657     4  0.2578    0.73901 0.000 0.036 0.052 0.912
#> GSM48658     4  0.6502    0.61723 0.004 0.124 0.228 0.644
#> GSM25624     1  0.6522    0.45706 0.608 0.280 0.112 0.000
#> GSM25625     3  0.5311    0.17900 0.392 0.008 0.596 0.004
#> GSM25626     3  0.6275   -0.00791 0.460 0.000 0.484 0.056
#> GSM25627     3  0.2988    0.45855 0.112 0.000 0.876 0.012
#> GSM25628     3  0.4401    0.35061 0.004 0.000 0.724 0.272
#> GSM25629     3  0.2662    0.46568 0.084 0.000 0.900 0.016
#> GSM25630     1  0.8119    0.34245 0.540 0.080 0.276 0.104
#> GSM25631     2  0.0707    0.78284 0.000 0.980 0.020 0.000
#> GSM25632     3  0.4998   -0.00662 0.488 0.000 0.512 0.000
#> GSM25633     1  0.2413    0.61351 0.916 0.064 0.020 0.000
#> GSM25634     1  0.1674    0.60453 0.952 0.004 0.012 0.032
#> GSM25635     1  0.6439    0.37315 0.628 0.300 0.036 0.036
#> GSM25656     3  0.4356    0.31246 0.000 0.000 0.708 0.292
#> GSM25657     3  0.6224    0.01910 0.436 0.044 0.516 0.004
#> GSM25658     3  0.4996    0.00145 0.484 0.000 0.516 0.000
#> GSM25659     4  0.7842    0.44771 0.088 0.284 0.072 0.556
#> GSM25660     1  0.4542    0.53146 0.768 0.208 0.020 0.004
#> GSM25661     1  0.2125    0.61086 0.932 0.052 0.012 0.004
#> GSM25662     4  0.1474    0.72918 0.000 0.000 0.052 0.948
#> GSM25663     4  0.1854    0.73852 0.000 0.048 0.012 0.940
#> GSM25680     2  0.1938    0.78016 0.000 0.936 0.052 0.012
#> GSM25681     2  0.0000    0.78506 0.000 1.000 0.000 0.000
#> GSM25682     4  0.4920    0.27393 0.000 0.368 0.004 0.628
#> GSM25683     4  0.1297    0.73588 0.000 0.016 0.020 0.964
#> GSM25684     4  0.2868    0.71061 0.000 0.000 0.136 0.864
#> GSM25685     4  0.4713    0.51194 0.000 0.000 0.360 0.640
#> GSM25686     4  0.1970    0.74092 0.000 0.060 0.008 0.932
#> GSM25687     4  0.5472    0.01591 0.000 0.440 0.016 0.544
#> GSM48664     1  0.7895    0.31226 0.572 0.092 0.084 0.252
#> GSM48665     1  0.4825    0.55346 0.800 0.120 0.068 0.012

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     5  0.0000    0.76294 0.000 0.000 0.000 0.000 1.000
#> GSM25549     5  0.0000    0.76294 0.000 0.000 0.000 0.000 1.000
#> GSM25550     5  0.1106    0.76543 0.000 0.012 0.000 0.024 0.964
#> GSM25551     3  0.5241    0.29415 0.000 0.016 0.672 0.056 0.256
#> GSM25570     5  0.0000    0.76294 0.000 0.000 0.000 0.000 1.000
#> GSM25571     5  0.0000    0.76294 0.000 0.000 0.000 0.000 1.000
#> GSM25358     2  0.3514    0.72479 0.044 0.868 0.024 0.020 0.044
#> GSM25359     3  0.5136    0.20186 0.000 0.016 0.624 0.028 0.332
#> GSM25360     2  0.7712    0.07966 0.216 0.412 0.068 0.000 0.304
#> GSM25361     2  0.6062    0.28468 0.000 0.464 0.416 0.000 0.120
#> GSM25377     1  0.4631    0.34706 0.780 0.012 0.008 0.108 0.092
#> GSM25378     5  0.6183    0.59093 0.116 0.028 0.140 0.032 0.684
#> GSM25401     3  0.6147    0.17571 0.324 0.040 0.572 0.064 0.000
#> GSM25402     2  0.4400    0.62055 0.060 0.744 0.196 0.000 0.000
#> GSM25349     5  0.5867    0.47520 0.008 0.336 0.024 0.044 0.588
#> GSM25350     5  0.4806    0.70391 0.000 0.144 0.016 0.088 0.752
#> GSM25356     5  0.7180    0.52478 0.164 0.072 0.092 0.052 0.620
#> GSM25357     5  0.7124    0.47037 0.008 0.232 0.068 0.128 0.564
#> GSM25385     3  0.7040    0.02468 0.360 0.044 0.504 0.040 0.052
#> GSM25386     2  0.6414    0.32170 0.040 0.508 0.392 0.052 0.008
#> GSM25399     1  0.4955    0.11934 0.720 0.008 0.084 0.188 0.000
#> GSM25400     1  0.6321   -0.16974 0.524 0.340 0.124 0.000 0.012
#> GSM48659     2  0.5196    0.68053 0.000 0.744 0.120 0.084 0.052
#> GSM48660     2  0.2616    0.71010 0.000 0.880 0.000 0.020 0.100
#> GSM25409     5  0.1442    0.76522 0.000 0.012 0.004 0.032 0.952
#> GSM25410     2  0.8097   -0.35800 0.336 0.360 0.176 0.000 0.128
#> GSM25426     3  0.5203    0.27972 0.000 0.272 0.648 0.080 0.000
#> GSM25427     5  0.4092    0.62006 0.164 0.008 0.008 0.028 0.792
#> GSM25540     3  0.5690    0.37623 0.004 0.188 0.684 0.024 0.100
#> GSM25541     3  0.5736    0.40080 0.016 0.192 0.692 0.024 0.076
#> GSM25542     2  0.4124    0.72966 0.000 0.820 0.068 0.040 0.072
#> GSM25543     2  0.6277    0.62541 0.000 0.632 0.180 0.040 0.148
#> GSM25479     1  0.7424   -0.01203 0.412 0.008 0.272 0.020 0.288
#> GSM25480     5  0.3710    0.66110 0.024 0.000 0.192 0.000 0.784
#> GSM25481     5  0.4747    0.46238 0.000 0.352 0.000 0.028 0.620
#> GSM25482     5  0.4244    0.72905 0.016 0.084 0.000 0.100 0.800
#> GSM48654     2  0.1934    0.71791 0.000 0.928 0.052 0.016 0.004
#> GSM48650     2  0.6690    0.62282 0.000 0.620 0.148 0.100 0.132
#> GSM48651     2  0.1651    0.72031 0.000 0.944 0.012 0.008 0.036
#> GSM48652     5  0.7526   -0.15082 0.000 0.376 0.140 0.080 0.404
#> GSM48653     2  0.2754    0.71053 0.000 0.880 0.080 0.040 0.000
#> GSM48662     5  0.6552    0.08090 0.000 0.392 0.064 0.056 0.488
#> GSM48663     2  0.1408    0.71399 0.000 0.948 0.000 0.044 0.008
#> GSM25524     3  0.4241    0.30529 0.264 0.008 0.716 0.012 0.000
#> GSM25525     1  0.6484   -0.10790 0.504 0.000 0.304 0.004 0.188
#> GSM25526     3  0.4305    0.03497 0.488 0.000 0.512 0.000 0.000
#> GSM25527     1  0.6227   -0.16299 0.516 0.008 0.356 0.000 0.120
#> GSM25528     1  0.5104    0.15814 0.672 0.000 0.272 0.028 0.028
#> GSM25529     1  0.4895    0.08579 0.528 0.000 0.452 0.012 0.008
#> GSM25530     1  0.4127    0.03475 0.680 0.000 0.312 0.000 0.008
#> GSM25531     1  0.4384    0.19196 0.728 0.044 0.228 0.000 0.000
#> GSM48661     2  0.2237    0.72615 0.000 0.916 0.040 0.004 0.040
#> GSM25561     1  0.6528    0.20441 0.580 0.024 0.304 0.044 0.048
#> GSM25562     3  0.6027    0.35490 0.144 0.248 0.600 0.000 0.008
#> GSM25563     2  0.5472    0.25259 0.044 0.512 0.436 0.008 0.000
#> GSM25564     2  0.4593    0.64263 0.004 0.728 0.040 0.004 0.224
#> GSM25565     2  0.2437    0.72810 0.000 0.904 0.032 0.004 0.060
#> GSM25566     5  0.6110    0.56381 0.000 0.044 0.264 0.076 0.616
#> GSM25568     2  0.5946    0.56906 0.000 0.612 0.140 0.008 0.240
#> GSM25569     5  0.4303    0.73949 0.000 0.072 0.080 0.040 0.808
#> GSM25552     5  0.1638    0.76012 0.000 0.064 0.000 0.004 0.932
#> GSM25553     5  0.1357    0.76465 0.000 0.048 0.000 0.004 0.948
#> GSM25578     5  0.6187   -0.12299 0.444 0.000 0.032 0.060 0.464
#> GSM25579     5  0.1671    0.74961 0.000 0.000 0.076 0.000 0.924
#> GSM25580     1  0.2179    0.37687 0.896 0.000 0.004 0.100 0.000
#> GSM25581     1  0.2305    0.38191 0.896 0.000 0.000 0.092 0.012
#> GSM48655     2  0.6080    0.59498 0.000 0.648 0.048 0.096 0.208
#> GSM48656     2  0.2674    0.71084 0.000 0.856 0.000 0.004 0.140
#> GSM48657     2  0.3965    0.70409 0.000 0.784 0.028 0.180 0.008
#> GSM48658     2  0.6259    0.60690 0.000 0.620 0.228 0.040 0.112
#> GSM25624     1  0.6047   -0.00875 0.596 0.000 0.124 0.012 0.268
#> GSM25625     3  0.4088    0.21983 0.368 0.000 0.632 0.000 0.000
#> GSM25626     3  0.5750   -0.02726 0.448 0.056 0.484 0.012 0.000
#> GSM25627     3  0.2349    0.39978 0.084 0.004 0.900 0.012 0.000
#> GSM25628     3  0.3934    0.35426 0.000 0.244 0.740 0.016 0.000
#> GSM25629     3  0.2456    0.40105 0.064 0.008 0.904 0.024 0.000
#> GSM25630     4  0.8020    0.00000 0.376 0.068 0.128 0.396 0.032
#> GSM25631     5  0.0404    0.76301 0.000 0.000 0.012 0.000 0.988
#> GSM25632     3  0.4300    0.06071 0.476 0.000 0.524 0.000 0.000
#> GSM25633     1  0.3523    0.39041 0.844 0.000 0.012 0.096 0.048
#> GSM25634     1  0.2756    0.37229 0.880 0.024 0.004 0.092 0.000
#> GSM25635     1  0.6580    0.22064 0.600 0.028 0.016 0.108 0.248
#> GSM25656     3  0.5096    0.28030 0.000 0.272 0.656 0.072 0.000
#> GSM25657     3  0.6071    0.03630 0.400 0.004 0.520 0.036 0.040
#> GSM25658     3  0.4297    0.06625 0.472 0.000 0.528 0.000 0.000
#> GSM25659     2  0.6773    0.45462 0.084 0.560 0.080 0.000 0.276
#> GSM25660     1  0.5123    0.32719 0.728 0.004 0.012 0.096 0.160
#> GSM25661     1  0.3108    0.39042 0.876 0.004 0.012 0.072 0.036
#> GSM25662     2  0.1444    0.71618 0.000 0.948 0.040 0.012 0.000
#> GSM25663     2  0.1787    0.72053 0.000 0.940 0.016 0.012 0.032
#> GSM25680     5  0.2390    0.75251 0.000 0.012 0.044 0.032 0.912
#> GSM25681     5  0.0000    0.76294 0.000 0.000 0.000 0.000 1.000
#> GSM25682     2  0.6090    0.16687 0.000 0.516 0.000 0.136 0.348
#> GSM25683     2  0.3250    0.70338 0.000 0.820 0.008 0.168 0.004
#> GSM25684     2  0.3749    0.68869 0.000 0.816 0.104 0.080 0.000
#> GSM25685     2  0.5265    0.54733 0.000 0.636 0.284 0.080 0.000
#> GSM25686     2  0.3366    0.70226 0.000 0.828 0.000 0.140 0.032
#> GSM25687     2  0.6487   -0.05898 0.000 0.432 0.004 0.160 0.404
#> GSM48664     1  0.8128    0.01543 0.516 0.228 0.080 0.092 0.084
#> GSM48665     1  0.5417    0.35552 0.740 0.004 0.068 0.100 0.088

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM25548     2  0.0000     0.7719 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25549     2  0.0000     0.7719 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25550     2  0.0993     0.7747 0.000 0.964 0.000 0.000 0.012 0.024
#> GSM25551     3  0.5037     0.3164 0.000 0.228 0.660 0.000 0.016 0.096
#> GSM25570     2  0.0000     0.7719 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25571     2  0.0000     0.7719 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25358     5  0.3156     0.7202 0.044 0.044 0.020 0.000 0.868 0.024
#> GSM25359     3  0.5037     0.2676 0.000 0.304 0.616 0.000 0.016 0.064
#> GSM25360     5  0.7278     0.1906 0.160 0.304 0.096 0.004 0.428 0.008
#> GSM25361     5  0.5756     0.2765 0.000 0.120 0.416 0.000 0.452 0.012
#> GSM25377     1  0.4820     0.2741 0.768 0.088 0.020 0.060 0.008 0.056
#> GSM25378     2  0.5654     0.6017 0.088 0.680 0.164 0.004 0.024 0.040
#> GSM25401     3  0.5574     0.3836 0.188 0.000 0.668 0.020 0.040 0.084
#> GSM25402     5  0.4006     0.6304 0.052 0.000 0.200 0.000 0.744 0.004
#> GSM25349     2  0.5413     0.4837 0.004 0.580 0.024 0.004 0.336 0.052
#> GSM25350     2  0.4410     0.7077 0.000 0.744 0.016 0.000 0.144 0.096
#> GSM25356     2  0.6697     0.5550 0.108 0.624 0.120 0.008 0.072 0.068
#> GSM25357     2  0.6398     0.4801 0.008 0.560 0.060 0.000 0.232 0.140
#> GSM25385     3  0.6451     0.2315 0.264 0.048 0.584 0.020 0.044 0.040
#> GSM25386     5  0.5933     0.3169 0.028 0.008 0.388 0.000 0.492 0.084
#> GSM25399     4  0.4353     0.0000 0.384 0.000 0.028 0.588 0.000 0.000
#> GSM25400     1  0.6842    -0.0321 0.448 0.012 0.160 0.028 0.340 0.012
#> GSM48659     5  0.4711     0.6786 0.000 0.048 0.112 0.000 0.740 0.100
#> GSM48660     5  0.2263     0.7038 0.000 0.100 0.000 0.000 0.884 0.016
#> GSM25409     2  0.1514     0.7737 0.000 0.944 0.004 0.004 0.012 0.036
#> GSM25410     5  0.7632    -0.1502 0.256 0.136 0.236 0.008 0.364 0.000
#> GSM25426     3  0.4999     0.3143 0.000 0.000 0.632 0.000 0.240 0.128
#> GSM25427     2  0.3433     0.5933 0.200 0.780 0.008 0.008 0.004 0.000
#> GSM25540     3  0.5417     0.3958 0.004 0.080 0.676 0.000 0.176 0.064
#> GSM25541     3  0.5422     0.4096 0.012 0.076 0.688 0.000 0.164 0.060
#> GSM25542     5  0.3779     0.7225 0.000 0.072 0.064 0.000 0.816 0.048
#> GSM25543     5  0.5782     0.6326 0.000 0.148 0.168 0.000 0.628 0.056
#> GSM25479     1  0.7213     0.0602 0.340 0.296 0.312 0.012 0.008 0.032
#> GSM25480     2  0.3284     0.6721 0.020 0.784 0.196 0.000 0.000 0.000
#> GSM25481     2  0.4822     0.4887 0.000 0.608 0.000 0.016 0.336 0.040
#> GSM25482     2  0.4370     0.7243 0.008 0.776 0.004 0.020 0.080 0.112
#> GSM48654     5  0.1826     0.7113 0.000 0.004 0.052 0.000 0.924 0.020
#> GSM48650     5  0.6065     0.6275 0.000 0.128 0.140 0.000 0.616 0.116
#> GSM48651     5  0.1370     0.7137 0.000 0.036 0.012 0.000 0.948 0.004
#> GSM48652     2  0.6821    -0.1445 0.000 0.404 0.128 0.000 0.372 0.096
#> GSM48653     5  0.2554     0.7053 0.000 0.000 0.076 0.000 0.876 0.048
#> GSM48662     2  0.5968     0.0976 0.000 0.488 0.060 0.000 0.384 0.068
#> GSM48663     5  0.1196     0.7069 0.000 0.008 0.000 0.000 0.952 0.040
#> GSM25524     3  0.3393     0.4565 0.140 0.000 0.820 0.020 0.008 0.012
#> GSM25525     1  0.6750     0.0786 0.396 0.180 0.380 0.028 0.000 0.016
#> GSM25526     3  0.4607     0.2965 0.356 0.000 0.604 0.028 0.000 0.012
#> GSM25527     3  0.6636     0.0057 0.388 0.132 0.432 0.028 0.008 0.012
#> GSM25528     1  0.5098     0.1761 0.596 0.024 0.340 0.032 0.000 0.008
#> GSM25529     3  0.4540    -0.0493 0.452 0.008 0.524 0.008 0.000 0.008
#> GSM25530     1  0.4906     0.1196 0.572 0.008 0.380 0.028 0.000 0.012
#> GSM25531     1  0.5233     0.2220 0.620 0.000 0.300 0.024 0.044 0.012
#> GSM48661     5  0.2009     0.7201 0.000 0.040 0.040 0.000 0.916 0.004
#> GSM25561     1  0.6702     0.1224 0.528 0.028 0.296 0.104 0.024 0.020
#> GSM25562     3  0.5557     0.4058 0.108 0.008 0.636 0.008 0.228 0.012
#> GSM25563     5  0.5299     0.2451 0.040 0.000 0.432 0.004 0.500 0.024
#> GSM25564     5  0.3987     0.6411 0.004 0.224 0.040 0.000 0.732 0.000
#> GSM25565     5  0.2046     0.7219 0.000 0.060 0.032 0.000 0.908 0.000
#> GSM25566     2  0.5627     0.5689 0.000 0.608 0.256 0.000 0.044 0.092
#> GSM25568     5  0.5534     0.5659 0.000 0.240 0.136 0.004 0.608 0.012
#> GSM25569     2  0.4020     0.7480 0.000 0.804 0.076 0.004 0.072 0.044
#> GSM25552     2  0.1387     0.7691 0.000 0.932 0.000 0.000 0.068 0.000
#> GSM25553     2  0.1141     0.7737 0.000 0.948 0.000 0.000 0.052 0.000
#> GSM25578     1  0.4917     0.1086 0.548 0.404 0.032 0.012 0.000 0.004
#> GSM25579     2  0.1556     0.7577 0.000 0.920 0.080 0.000 0.000 0.000
#> GSM25580     1  0.1890     0.3351 0.916 0.000 0.024 0.060 0.000 0.000
#> GSM25581     1  0.1858     0.3397 0.924 0.012 0.012 0.052 0.000 0.000
#> GSM48655     5  0.5552     0.5972 0.000 0.200 0.044 0.000 0.640 0.116
#> GSM48656     5  0.2260     0.7045 0.000 0.140 0.000 0.000 0.860 0.000
#> GSM48657     5  0.3720     0.6899 0.000 0.008 0.020 0.008 0.776 0.188
#> GSM48658     5  0.5736     0.6088 0.000 0.108 0.224 0.000 0.616 0.052
#> GSM25624     1  0.6645     0.0747 0.496 0.276 0.176 0.040 0.000 0.012
#> GSM25625     3  0.3987     0.4134 0.236 0.000 0.728 0.024 0.000 0.012
#> GSM25626     3  0.5669     0.2940 0.316 0.000 0.584 0.028 0.044 0.028
#> GSM25627     3  0.1442     0.4657 0.012 0.000 0.944 0.000 0.004 0.040
#> GSM25628     3  0.4007     0.3787 0.000 0.000 0.728 0.000 0.220 0.052
#> GSM25629     3  0.1524     0.4552 0.000 0.000 0.932 0.000 0.008 0.060
#> GSM25630     6  0.6101     0.0000 0.232 0.008 0.036 0.072 0.032 0.620
#> GSM25631     2  0.0363     0.7720 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM25632     3  0.4634     0.3152 0.344 0.000 0.616 0.024 0.004 0.012
#> GSM25633     1  0.2771     0.3540 0.888 0.040 0.024 0.036 0.000 0.012
#> GSM25634     1  0.3325     0.3089 0.832 0.000 0.028 0.120 0.016 0.004
#> GSM25635     1  0.4986     0.2203 0.704 0.188 0.012 0.072 0.024 0.000
#> GSM25656     3  0.4888     0.3178 0.000 0.000 0.644 0.000 0.240 0.116
#> GSM25657     3  0.5724     0.2681 0.284 0.036 0.604 0.060 0.004 0.012
#> GSM25658     3  0.4543     0.3224 0.336 0.000 0.624 0.028 0.000 0.012
#> GSM25659     5  0.6173     0.4560 0.076 0.276 0.084 0.004 0.560 0.000
#> GSM25660     1  0.3536     0.3164 0.836 0.100 0.012 0.028 0.004 0.020
#> GSM25661     1  0.1508     0.3378 0.948 0.012 0.016 0.020 0.004 0.000
#> GSM25662     5  0.1196     0.7095 0.000 0.000 0.040 0.000 0.952 0.008
#> GSM25663     5  0.1503     0.7141 0.000 0.032 0.016 0.000 0.944 0.008
#> GSM25680     2  0.2122     0.7610 0.000 0.912 0.040 0.000 0.008 0.040
#> GSM25681     2  0.0000     0.7719 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25682     5  0.5686     0.1425 0.000 0.348 0.000 0.004 0.500 0.148
#> GSM25683     5  0.3206     0.6891 0.000 0.004 0.008 0.008 0.808 0.172
#> GSM25684     5  0.3473     0.6836 0.000 0.000 0.096 0.000 0.808 0.096
#> GSM25685     5  0.4851     0.5634 0.000 0.000 0.272 0.000 0.632 0.096
#> GSM25686     5  0.3352     0.6871 0.000 0.032 0.000 0.008 0.812 0.148
#> GSM25687     5  0.6091    -0.0886 0.000 0.404 0.004 0.008 0.416 0.168
#> GSM48664     1  0.7679    -0.0259 0.496 0.060 0.080 0.140 0.212 0.012
#> GSM48665     1  0.3818     0.3312 0.824 0.040 0.060 0.068 0.004 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-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 genotype/variation(p) k
#> CV:pam 78              4.69e-04 2
#> CV:pam 79              3.84e-06 3
#> CV:pam 55              6.51e-03 4
#> CV:pam 45              9.88e-03 5
#> CV:pam 45              9.88e-03 6

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


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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.802           0.907       0.956         0.4988 0.495   0.495
#> 3 3 0.512           0.740       0.846         0.2247 0.870   0.739
#> 4 4 0.537           0.583       0.780         0.1071 0.972   0.924
#> 5 5 0.641           0.706       0.816         0.1464 0.797   0.467
#> 6 6 0.641           0.603       0.766         0.0405 0.943   0.753

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
#> GSM25548     2  0.0000      0.932 0.000 1.000
#> GSM25549     2  0.0000      0.932 0.000 1.000
#> GSM25550     2  0.2778      0.914 0.048 0.952
#> GSM25551     2  0.0938      0.929 0.012 0.988
#> GSM25570     2  0.1414      0.926 0.020 0.980
#> GSM25571     2  0.0000      0.932 0.000 1.000
#> GSM25358     1  0.2236      0.942 0.964 0.036
#> GSM25359     2  0.6801      0.803 0.180 0.820
#> GSM25360     1  0.0000      0.974 1.000 0.000
#> GSM25361     2  0.9909      0.307 0.444 0.556
#> GSM25377     1  0.0000      0.974 1.000 0.000
#> GSM25378     1  0.0000      0.974 1.000 0.000
#> GSM25401     1  0.7528      0.710 0.784 0.216
#> GSM25402     1  0.0000      0.974 1.000 0.000
#> GSM25349     2  0.0376      0.931 0.004 0.996
#> GSM25350     2  0.0000      0.932 0.000 1.000
#> GSM25356     1  0.0000      0.974 1.000 0.000
#> GSM25357     2  0.4939      0.874 0.108 0.892
#> GSM25385     1  0.0000      0.974 1.000 0.000
#> GSM25386     1  0.0000      0.974 1.000 0.000
#> GSM25399     1  0.0000      0.974 1.000 0.000
#> GSM25400     1  0.0000      0.974 1.000 0.000
#> GSM48659     2  0.0000      0.932 0.000 1.000
#> GSM48660     2  0.0000      0.932 0.000 1.000
#> GSM25409     2  0.0376      0.931 0.004 0.996
#> GSM25410     1  0.0000      0.974 1.000 0.000
#> GSM25426     2  0.3733      0.901 0.072 0.928
#> GSM25427     1  0.0376      0.971 0.996 0.004
#> GSM25540     2  0.6973      0.793 0.188 0.812
#> GSM25541     2  0.7883      0.736 0.236 0.764
#> GSM25542     2  0.6247      0.827 0.156 0.844
#> GSM25543     2  0.7056      0.790 0.192 0.808
#> GSM25479     1  0.0000      0.974 1.000 0.000
#> GSM25480     1  0.0000      0.974 1.000 0.000
#> GSM25481     1  0.0376      0.971 0.996 0.004
#> GSM25482     1  0.0000      0.974 1.000 0.000
#> GSM48654     2  0.0000      0.932 0.000 1.000
#> GSM48650     2  0.2603      0.916 0.044 0.956
#> GSM48651     2  0.0000      0.932 0.000 1.000
#> GSM48652     2  0.0000      0.932 0.000 1.000
#> GSM48653     2  0.0000      0.932 0.000 1.000
#> GSM48662     2  0.0000      0.932 0.000 1.000
#> GSM48663     2  0.2603      0.916 0.044 0.956
#> GSM25524     1  0.0000      0.974 1.000 0.000
#> GSM25525     1  0.0000      0.974 1.000 0.000
#> GSM25526     1  0.0000      0.974 1.000 0.000
#> GSM25527     1  0.0000      0.974 1.000 0.000
#> GSM25528     1  0.0000      0.974 1.000 0.000
#> GSM25529     1  0.0000      0.974 1.000 0.000
#> GSM25530     1  0.0000      0.974 1.000 0.000
#> GSM25531     1  0.0000      0.974 1.000 0.000
#> GSM48661     2  0.0376      0.931 0.004 0.996
#> GSM25561     1  0.0000      0.974 1.000 0.000
#> GSM25562     1  0.0000      0.974 1.000 0.000
#> GSM25563     1  0.0000      0.974 1.000 0.000
#> GSM25564     1  0.3733      0.904 0.928 0.072
#> GSM25565     2  0.0000      0.932 0.000 1.000
#> GSM25566     2  0.0000      0.932 0.000 1.000
#> GSM25568     2  0.9988      0.152 0.480 0.520
#> GSM25569     2  0.0000      0.932 0.000 1.000
#> GSM25552     2  0.2948      0.912 0.052 0.948
#> GSM25553     2  0.7674      0.743 0.224 0.776
#> GSM25578     1  0.0000      0.974 1.000 0.000
#> GSM25579     1  0.0938      0.964 0.988 0.012
#> GSM25580     1  0.0000      0.974 1.000 0.000
#> GSM25581     1  0.0000      0.974 1.000 0.000
#> GSM48655     2  0.0000      0.932 0.000 1.000
#> GSM48656     2  0.0000      0.932 0.000 1.000
#> GSM48657     2  0.0000      0.932 0.000 1.000
#> GSM48658     2  0.0000      0.932 0.000 1.000
#> GSM25624     1  0.0000      0.974 1.000 0.000
#> GSM25625     1  0.0000      0.974 1.000 0.000
#> GSM25626     1  0.0000      0.974 1.000 0.000
#> GSM25627     1  0.8386      0.618 0.732 0.268
#> GSM25628     1  0.8207      0.641 0.744 0.256
#> GSM25629     2  0.9686      0.413 0.396 0.604
#> GSM25630     1  0.0000      0.974 1.000 0.000
#> GSM25631     2  0.3584      0.903 0.068 0.932
#> GSM25632     1  0.0000      0.974 1.000 0.000
#> GSM25633     1  0.0000      0.974 1.000 0.000
#> GSM25634     1  0.0000      0.974 1.000 0.000
#> GSM25635     1  0.0000      0.974 1.000 0.000
#> GSM25656     1  0.8499      0.602 0.724 0.276
#> GSM25657     1  0.0000      0.974 1.000 0.000
#> GSM25658     1  0.0000      0.974 1.000 0.000
#> GSM25659     1  0.1414      0.957 0.980 0.020
#> GSM25660     1  0.0000      0.974 1.000 0.000
#> GSM25661     1  0.0000      0.974 1.000 0.000
#> GSM25662     2  0.0000      0.932 0.000 1.000
#> GSM25663     2  0.0000      0.932 0.000 1.000
#> GSM25680     2  0.0672      0.930 0.008 0.992
#> GSM25681     2  0.6048      0.837 0.148 0.852
#> GSM25682     2  0.0000      0.932 0.000 1.000
#> GSM25683     2  0.0000      0.932 0.000 1.000
#> GSM25684     2  0.0000      0.932 0.000 1.000
#> GSM25685     2  0.3431      0.906 0.064 0.936
#> GSM25686     2  0.0000      0.932 0.000 1.000
#> GSM25687     2  0.0000      0.932 0.000 1.000
#> GSM48664     1  0.0000      0.974 1.000 0.000
#> GSM48665     1  0.0000      0.974 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.0592     0.8816 0.000 0.988 0.012
#> GSM25549     2  0.0983     0.8804 0.004 0.980 0.016
#> GSM25550     2  0.4475     0.8082 0.144 0.840 0.016
#> GSM25551     2  0.0000     0.8830 0.000 1.000 0.000
#> GSM25570     2  0.1170     0.8797 0.008 0.976 0.016
#> GSM25571     2  0.0983     0.8804 0.004 0.980 0.016
#> GSM25358     1  0.2955     0.6304 0.912 0.080 0.008
#> GSM25359     2  0.5219     0.7627 0.196 0.788 0.016
#> GSM25360     3  0.6228     0.7763 0.372 0.004 0.624
#> GSM25361     2  0.8597     0.4207 0.292 0.576 0.132
#> GSM25377     1  0.0424     0.7211 0.992 0.000 0.008
#> GSM25378     1  0.0000     0.7202 1.000 0.000 0.000
#> GSM25401     3  0.8379     0.7659 0.352 0.096 0.552
#> GSM25402     1  0.4233     0.5079 0.836 0.004 0.160
#> GSM25349     2  0.0983     0.8809 0.004 0.980 0.016
#> GSM25350     2  0.0237     0.8824 0.000 0.996 0.004
#> GSM25356     1  0.0424     0.7211 0.992 0.000 0.008
#> GSM25357     2  0.5610     0.7586 0.196 0.776 0.028
#> GSM25385     3  0.6244     0.7714 0.440 0.000 0.560
#> GSM25386     3  0.5896     0.8186 0.292 0.008 0.700
#> GSM25399     1  0.0424     0.7211 0.992 0.000 0.008
#> GSM25400     1  0.0237     0.7193 0.996 0.000 0.004
#> GSM48659     2  0.0237     0.8829 0.000 0.996 0.004
#> GSM48660     2  0.0475     0.8832 0.004 0.992 0.004
#> GSM25409     2  0.1170     0.8791 0.016 0.976 0.008
#> GSM25410     3  0.6192     0.7979 0.420 0.000 0.580
#> GSM25426     2  0.5318     0.7489 0.204 0.780 0.016
#> GSM25427     1  0.0237     0.7202 0.996 0.000 0.004
#> GSM25540     2  0.5939     0.7165 0.224 0.748 0.028
#> GSM25541     2  0.6490     0.6718 0.256 0.708 0.036
#> GSM25542     2  0.4723     0.7903 0.160 0.824 0.016
#> GSM25543     2  0.6264     0.6920 0.244 0.724 0.032
#> GSM25479     1  0.5138     0.7156 0.748 0.000 0.252
#> GSM25480     1  0.5621     0.6955 0.692 0.000 0.308
#> GSM25481     1  0.0661     0.7197 0.988 0.004 0.008
#> GSM25482     1  0.0829     0.7189 0.984 0.004 0.012
#> GSM48654     2  0.0237     0.8832 0.004 0.996 0.000
#> GSM48650     2  0.4605     0.7585 0.204 0.796 0.000
#> GSM48651     2  0.0000     0.8830 0.000 1.000 0.000
#> GSM48652     2  0.0000     0.8830 0.000 1.000 0.000
#> GSM48653     2  0.0237     0.8832 0.004 0.996 0.000
#> GSM48662     2  0.0000     0.8830 0.000 1.000 0.000
#> GSM48663     2  0.4883     0.7574 0.208 0.788 0.004
#> GSM25524     3  0.5760     0.8156 0.328 0.000 0.672
#> GSM25525     1  0.5810     0.6777 0.664 0.000 0.336
#> GSM25526     3  0.6373     0.8022 0.408 0.004 0.588
#> GSM25527     1  0.4504     0.7311 0.804 0.000 0.196
#> GSM25528     1  0.6180    -0.2314 0.584 0.000 0.416
#> GSM25529     1  0.5988     0.6514 0.632 0.000 0.368
#> GSM25530     3  0.6244     0.6946 0.440 0.000 0.560
#> GSM25531     1  0.4178     0.5673 0.828 0.000 0.172
#> GSM48661     2  0.0747     0.8813 0.016 0.984 0.000
#> GSM25561     1  0.6079    -0.1296 0.612 0.000 0.388
#> GSM25562     1  0.3038     0.6996 0.896 0.000 0.104
#> GSM25563     3  0.5621     0.8193 0.308 0.000 0.692
#> GSM25564     1  0.8160     0.0931 0.608 0.288 0.104
#> GSM25565     2  0.0237     0.8829 0.000 0.996 0.004
#> GSM25566     2  0.0000     0.8830 0.000 1.000 0.000
#> GSM25568     2  0.6597     0.5937 0.312 0.664 0.024
#> GSM25569     2  0.0000     0.8830 0.000 1.000 0.000
#> GSM25552     2  0.5551     0.7349 0.224 0.760 0.016
#> GSM25553     2  0.7509     0.5439 0.300 0.636 0.064
#> GSM25578     1  0.5431     0.7046 0.716 0.000 0.284
#> GSM25579     1  0.6157     0.5398 0.780 0.092 0.128
#> GSM25580     1  0.4750     0.7104 0.784 0.000 0.216
#> GSM25581     1  0.5098     0.7133 0.752 0.000 0.248
#> GSM48655     2  0.0592     0.8810 0.000 0.988 0.012
#> GSM48656     2  0.0000     0.8830 0.000 1.000 0.000
#> GSM48657     2  0.0424     0.8819 0.000 0.992 0.008
#> GSM48658     2  0.0000     0.8830 0.000 1.000 0.000
#> GSM25624     1  0.4605     0.7255 0.796 0.000 0.204
#> GSM25625     3  0.6154     0.7967 0.408 0.000 0.592
#> GSM25626     3  0.6527     0.8285 0.320 0.020 0.660
#> GSM25627     3  0.8614     0.7027 0.228 0.172 0.600
#> GSM25628     3  0.8221     0.7509 0.248 0.128 0.624
#> GSM25629     3  0.9561     0.4958 0.216 0.316 0.468
#> GSM25630     3  0.5835     0.8103 0.340 0.000 0.660
#> GSM25631     2  0.5360     0.7409 0.220 0.768 0.012
#> GSM25632     3  0.5926     0.8146 0.356 0.000 0.644
#> GSM25633     1  0.5098     0.7157 0.752 0.000 0.248
#> GSM25634     1  0.5098     0.7160 0.752 0.000 0.248
#> GSM25635     1  0.4654     0.7116 0.792 0.000 0.208
#> GSM25656     3  0.7979     0.7604 0.248 0.112 0.640
#> GSM25657     1  0.2796     0.7099 0.908 0.000 0.092
#> GSM25658     3  0.6783     0.8100 0.396 0.016 0.588
#> GSM25659     1  0.6662     0.4597 0.736 0.072 0.192
#> GSM25660     1  0.5291     0.7121 0.732 0.000 0.268
#> GSM25661     1  0.5178     0.7127 0.744 0.000 0.256
#> GSM25662     2  0.0000     0.8830 0.000 1.000 0.000
#> GSM25663     2  0.0000     0.8830 0.000 1.000 0.000
#> GSM25680     2  0.1015     0.8820 0.012 0.980 0.008
#> GSM25681     2  0.6927     0.6627 0.240 0.700 0.060
#> GSM25682     2  0.1643     0.8686 0.000 0.956 0.044
#> GSM25683     2  0.1529     0.8703 0.000 0.960 0.040
#> GSM25684     2  0.0000     0.8830 0.000 1.000 0.000
#> GSM25685     2  0.4834     0.7562 0.204 0.792 0.004
#> GSM25686     2  0.1643     0.8686 0.000 0.956 0.044
#> GSM25687     2  0.1643     0.8686 0.000 0.956 0.044
#> GSM48664     1  0.0424     0.7211 0.992 0.000 0.008
#> GSM48665     1  0.0237     0.7229 0.996 0.000 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.2714     0.8677 0.004 0.884 0.000 0.112
#> GSM25549     2  0.2999     0.8578 0.004 0.864 0.000 0.132
#> GSM25550     2  0.4213     0.8423 0.028 0.824 0.012 0.136
#> GSM25551     2  0.2593     0.8797 0.000 0.904 0.016 0.080
#> GSM25570     2  0.3182     0.8566 0.004 0.860 0.004 0.132
#> GSM25571     2  0.3128     0.8585 0.004 0.864 0.004 0.128
#> GSM25358     1  0.8514    -0.0895 0.432 0.376 0.096 0.096
#> GSM25359     2  0.3943     0.8561 0.032 0.856 0.024 0.088
#> GSM25360     3  0.6775     0.5240 0.328 0.004 0.568 0.100
#> GSM25361     2  0.9649    -0.0109 0.252 0.356 0.140 0.252
#> GSM25377     4  0.5756     0.6640 0.400 0.000 0.032 0.568
#> GSM25378     1  0.6411    -0.2774 0.584 0.020 0.040 0.356
#> GSM25401     3  0.7997     0.1853 0.056 0.104 0.504 0.336
#> GSM25402     4  0.8719     0.4347 0.308 0.036 0.288 0.368
#> GSM25349     2  0.1396     0.8887 0.004 0.960 0.004 0.032
#> GSM25350     2  0.1296     0.8879 0.004 0.964 0.004 0.028
#> GSM25356     1  0.5842    -0.4561 0.520 0.000 0.032 0.448
#> GSM25357     2  0.4447     0.8390 0.016 0.820 0.040 0.124
#> GSM25385     3  0.5696     0.6103 0.232 0.000 0.692 0.076
#> GSM25386     3  0.2021     0.6551 0.056 0.000 0.932 0.012
#> GSM25399     4  0.5969     0.6776 0.392 0.000 0.044 0.564
#> GSM25400     1  0.5531     0.1791 0.716 0.008 0.052 0.224
#> GSM48659     2  0.1743     0.8889 0.000 0.940 0.004 0.056
#> GSM48660     2  0.1109     0.8870 0.000 0.968 0.004 0.028
#> GSM25409     2  0.2099     0.8860 0.020 0.936 0.004 0.040
#> GSM25410     3  0.4786     0.6279 0.132 0.008 0.796 0.064
#> GSM25426     2  0.6439     0.6313 0.000 0.648 0.180 0.172
#> GSM25427     1  0.5800    -0.3850 0.548 0.000 0.032 0.420
#> GSM25540     2  0.6788     0.7245 0.040 0.680 0.132 0.148
#> GSM25541     2  0.7110     0.7118 0.072 0.668 0.108 0.152
#> GSM25542     2  0.4233     0.8498 0.040 0.848 0.040 0.072
#> GSM25543     2  0.5719     0.8022 0.044 0.764 0.092 0.100
#> GSM25479     1  0.1118     0.5316 0.964 0.000 0.000 0.036
#> GSM25480     1  0.2635     0.5087 0.904 0.000 0.020 0.076
#> GSM25481     1  0.6215    -0.4700 0.512 0.008 0.036 0.444
#> GSM25482     1  0.5838    -0.4493 0.524 0.000 0.032 0.444
#> GSM48654     2  0.0779     0.8901 0.000 0.980 0.004 0.016
#> GSM48650     2  0.3450     0.8659 0.004 0.872 0.040 0.084
#> GSM48651     2  0.1209     0.8894 0.000 0.964 0.004 0.032
#> GSM48652     2  0.1109     0.8883 0.000 0.968 0.004 0.028
#> GSM48653     2  0.1890     0.8886 0.000 0.936 0.008 0.056
#> GSM48662     2  0.0336     0.8904 0.000 0.992 0.000 0.008
#> GSM48663     2  0.1909     0.8871 0.004 0.940 0.008 0.048
#> GSM25524     3  0.6015     0.6055 0.268 0.000 0.652 0.080
#> GSM25525     1  0.3796     0.4807 0.848 0.000 0.056 0.096
#> GSM25526     3  0.3709     0.6240 0.100 0.004 0.856 0.040
#> GSM25527     1  0.2002     0.5186 0.936 0.000 0.020 0.044
#> GSM25528     3  0.6605     0.3213 0.440 0.000 0.480 0.080
#> GSM25529     1  0.4424     0.4542 0.812 0.000 0.088 0.100
#> GSM25530     3  0.6592     0.4549 0.392 0.000 0.524 0.084
#> GSM25531     1  0.5511     0.3401 0.720 0.000 0.196 0.084
#> GSM48661     2  0.1635     0.8889 0.000 0.948 0.008 0.044
#> GSM25561     1  0.6412     0.0199 0.572 0.000 0.348 0.080
#> GSM25562     1  0.3497     0.5059 0.876 0.008 0.060 0.056
#> GSM25563     3  0.5327     0.6419 0.220 0.000 0.720 0.060
#> GSM25564     1  0.8523    -0.0240 0.404 0.404 0.104 0.088
#> GSM25565     2  0.1004     0.8905 0.000 0.972 0.004 0.024
#> GSM25566     2  0.0000     0.8894 0.000 1.000 0.000 0.000
#> GSM25568     2  0.7072     0.6998 0.132 0.672 0.068 0.128
#> GSM25569     2  0.1109     0.8904 0.000 0.968 0.004 0.028
#> GSM25552     2  0.4777     0.8257 0.036 0.796 0.020 0.148
#> GSM25553     2  0.7126     0.6287 0.192 0.644 0.040 0.124
#> GSM25578     1  0.1970     0.5213 0.932 0.000 0.008 0.060
#> GSM25579     1  0.6535     0.3638 0.708 0.068 0.076 0.148
#> GSM25580     1  0.2345     0.4695 0.900 0.000 0.000 0.100
#> GSM25581     1  0.1022     0.5275 0.968 0.000 0.000 0.032
#> GSM48655     2  0.1209     0.8873 0.000 0.964 0.004 0.032
#> GSM48656     2  0.0707     0.8905 0.000 0.980 0.000 0.020
#> GSM48657     2  0.1305     0.8861 0.000 0.960 0.004 0.036
#> GSM48658     2  0.2198     0.8868 0.000 0.920 0.008 0.072
#> GSM25624     1  0.2271     0.4886 0.916 0.000 0.008 0.076
#> GSM25625     3  0.5435     0.6400 0.204 0.004 0.728 0.064
#> GSM25626     3  0.2510     0.6477 0.064 0.008 0.916 0.012
#> GSM25627     3  0.5361     0.5032 0.012 0.184 0.748 0.056
#> GSM25628     3  0.3602     0.6134 0.012 0.072 0.872 0.044
#> GSM25629     3  0.6634     0.2054 0.004 0.384 0.536 0.076
#> GSM25630     3  0.6040     0.6022 0.272 0.000 0.648 0.080
#> GSM25631     2  0.4574     0.8426 0.012 0.808 0.044 0.136
#> GSM25632     3  0.5267     0.6405 0.240 0.000 0.712 0.048
#> GSM25633     1  0.1004     0.5271 0.972 0.000 0.004 0.024
#> GSM25634     1  0.2179     0.5044 0.924 0.000 0.012 0.064
#> GSM25635     1  0.3047     0.4375 0.872 0.000 0.012 0.116
#> GSM25656     3  0.3529     0.6148 0.012 0.068 0.876 0.044
#> GSM25657     1  0.3840     0.4611 0.844 0.000 0.104 0.052
#> GSM25658     3  0.3463     0.6292 0.096 0.004 0.868 0.032
#> GSM25659     1  0.6695     0.3575 0.696 0.056 0.104 0.144
#> GSM25660     1  0.1584     0.5277 0.952 0.000 0.012 0.036
#> GSM25661     1  0.1211     0.5248 0.960 0.000 0.000 0.040
#> GSM25662     2  0.1398     0.8887 0.000 0.956 0.004 0.040
#> GSM25663     2  0.1732     0.8899 0.008 0.948 0.004 0.040
#> GSM25680     2  0.3102     0.8671 0.004 0.872 0.008 0.116
#> GSM25681     2  0.5558     0.7863 0.088 0.748 0.012 0.152
#> GSM25682     2  0.2131     0.8828 0.000 0.932 0.032 0.036
#> GSM25683     2  0.2319     0.8824 0.000 0.924 0.040 0.036
#> GSM25684     2  0.0895     0.8896 0.000 0.976 0.004 0.020
#> GSM25685     2  0.6284     0.6543 0.000 0.664 0.172 0.164
#> GSM25686     2  0.2224     0.8814 0.000 0.928 0.032 0.040
#> GSM25687     2  0.2131     0.8828 0.000 0.932 0.032 0.036
#> GSM48664     1  0.5850    -0.5017 0.512 0.000 0.032 0.456
#> GSM48665     1  0.5600    -0.2577 0.596 0.000 0.028 0.376

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     5  0.1571     0.8083 0.000 0.060 0.000 0.004 0.936
#> GSM25549     5  0.1205     0.8071 0.000 0.040 0.000 0.004 0.956
#> GSM25550     5  0.1604     0.8066 0.004 0.044 0.004 0.004 0.944
#> GSM25551     2  0.2300     0.8866 0.000 0.904 0.024 0.000 0.072
#> GSM25570     5  0.1430     0.8065 0.000 0.052 0.000 0.004 0.944
#> GSM25571     5  0.1502     0.8075 0.000 0.056 0.000 0.004 0.940
#> GSM25358     4  0.9033     0.1194 0.076 0.144 0.116 0.364 0.300
#> GSM25359     5  0.5272     0.3720 0.000 0.396 0.052 0.000 0.552
#> GSM25360     1  0.4597     0.0645 0.564 0.000 0.424 0.000 0.012
#> GSM25361     5  0.3639     0.7403 0.128 0.016 0.028 0.000 0.828
#> GSM25377     4  0.1357     0.8374 0.048 0.000 0.004 0.948 0.000
#> GSM25378     4  0.1697     0.8352 0.060 0.000 0.008 0.932 0.000
#> GSM25401     3  0.6199     0.2574 0.024 0.044 0.528 0.388 0.016
#> GSM25402     4  0.4713     0.4213 0.044 0.000 0.280 0.676 0.000
#> GSM25349     2  0.1956     0.8912 0.000 0.916 0.008 0.000 0.076
#> GSM25350     2  0.2488     0.8717 0.000 0.872 0.004 0.000 0.124
#> GSM25356     4  0.1282     0.8397 0.044 0.000 0.004 0.952 0.000
#> GSM25357     2  0.2740     0.8739 0.000 0.888 0.044 0.004 0.064
#> GSM25385     3  0.4457     0.7409 0.116 0.000 0.760 0.124 0.000
#> GSM25386     3  0.2148     0.8126 0.048 0.004 0.924 0.008 0.016
#> GSM25399     4  0.1357     0.8374 0.048 0.000 0.004 0.948 0.000
#> GSM25400     4  0.4622    -0.0614 0.440 0.000 0.012 0.548 0.000
#> GSM48659     5  0.3630     0.7112 0.000 0.204 0.016 0.000 0.780
#> GSM48660     2  0.1892     0.8904 0.000 0.916 0.004 0.000 0.080
#> GSM25409     5  0.4491     0.5052 0.008 0.364 0.004 0.000 0.624
#> GSM25410     3  0.3446     0.7930 0.048 0.000 0.840 0.108 0.004
#> GSM25426     2  0.3692     0.8119 0.000 0.840 0.084 0.020 0.056
#> GSM25427     4  0.2330     0.8119 0.088 0.004 0.004 0.900 0.004
#> GSM25540     5  0.3340     0.7778 0.004 0.032 0.124 0.000 0.840
#> GSM25541     5  0.2861     0.7973 0.016 0.024 0.076 0.000 0.884
#> GSM25542     5  0.5961    -0.0528 0.000 0.452 0.092 0.004 0.452
#> GSM25543     5  0.4975     0.7391 0.012 0.100 0.140 0.004 0.744
#> GSM25479     1  0.3132     0.7536 0.820 0.000 0.008 0.172 0.000
#> GSM25480     1  0.2331     0.7632 0.900 0.000 0.000 0.080 0.020
#> GSM25481     4  0.1443     0.8393 0.044 0.000 0.004 0.948 0.004
#> GSM25482     4  0.1443     0.8393 0.044 0.000 0.004 0.948 0.004
#> GSM48654     5  0.4981     0.2667 0.000 0.412 0.024 0.004 0.560
#> GSM48650     2  0.2313     0.8635 0.000 0.916 0.040 0.012 0.032
#> GSM48651     2  0.2848     0.8658 0.000 0.840 0.004 0.000 0.156
#> GSM48652     2  0.3039     0.8665 0.000 0.836 0.012 0.000 0.152
#> GSM48653     2  0.3890     0.8424 0.000 0.792 0.036 0.004 0.168
#> GSM48662     2  0.4383     0.2571 0.000 0.572 0.004 0.000 0.424
#> GSM48663     2  0.1831     0.8906 0.000 0.920 0.004 0.000 0.076
#> GSM25524     1  0.4449    -0.1099 0.512 0.000 0.484 0.004 0.000
#> GSM25525     1  0.0579     0.7456 0.984 0.000 0.008 0.000 0.008
#> GSM25526     3  0.2735     0.8051 0.036 0.000 0.880 0.084 0.000
#> GSM25527     1  0.3635     0.7140 0.748 0.000 0.004 0.248 0.000
#> GSM25528     1  0.2179     0.7090 0.896 0.000 0.100 0.004 0.000
#> GSM25529     1  0.0693     0.7458 0.980 0.000 0.008 0.000 0.012
#> GSM25530     1  0.2953     0.6843 0.844 0.000 0.144 0.012 0.000
#> GSM25531     1  0.3214     0.7523 0.844 0.000 0.036 0.120 0.000
#> GSM48661     5  0.3897     0.7274 0.000 0.204 0.028 0.000 0.768
#> GSM25561     1  0.1831     0.7283 0.920 0.000 0.076 0.004 0.000
#> GSM25562     1  0.3810     0.7544 0.788 0.000 0.036 0.176 0.000
#> GSM25563     3  0.4183     0.5087 0.324 0.000 0.668 0.008 0.000
#> GSM25564     5  0.6523     0.5406 0.196 0.016 0.052 0.096 0.640
#> GSM25565     2  0.4016     0.6785 0.000 0.716 0.012 0.000 0.272
#> GSM25566     2  0.3550     0.7323 0.000 0.760 0.004 0.000 0.236
#> GSM25568     5  0.3646     0.7998 0.040 0.072 0.040 0.000 0.848
#> GSM25569     5  0.3550     0.7161 0.000 0.236 0.004 0.000 0.760
#> GSM25552     5  0.1925     0.8050 0.012 0.036 0.012 0.004 0.936
#> GSM25553     5  0.3126     0.7697 0.088 0.028 0.016 0.000 0.868
#> GSM25578     1  0.2477     0.7648 0.892 0.000 0.008 0.092 0.008
#> GSM25579     1  0.1921     0.7460 0.932 0.000 0.012 0.012 0.044
#> GSM25580     1  0.3906     0.6625 0.704 0.000 0.004 0.292 0.000
#> GSM25581     1  0.3318     0.7451 0.800 0.000 0.008 0.192 0.000
#> GSM48655     2  0.1638     0.8888 0.000 0.932 0.000 0.004 0.064
#> GSM48656     5  0.3861     0.6787 0.000 0.284 0.004 0.000 0.712
#> GSM48657     2  0.1768     0.8897 0.000 0.924 0.000 0.004 0.072
#> GSM48658     5  0.2806     0.7809 0.000 0.152 0.004 0.000 0.844
#> GSM25624     1  0.3684     0.6828 0.720 0.000 0.000 0.280 0.000
#> GSM25625     3  0.3802     0.7943 0.096 0.000 0.820 0.080 0.004
#> GSM25626     3  0.2429     0.8181 0.028 0.004 0.916 0.032 0.020
#> GSM25627     3  0.2674     0.7875 0.004 0.044 0.900 0.008 0.044
#> GSM25628     3  0.1883     0.7977 0.000 0.012 0.932 0.008 0.048
#> GSM25629     3  0.3457     0.7488 0.000 0.064 0.848 0.008 0.080
#> GSM25630     1  0.4451    -0.1432 0.504 0.000 0.492 0.004 0.000
#> GSM25631     5  0.1673     0.8081 0.008 0.032 0.016 0.000 0.944
#> GSM25632     3  0.4366     0.4961 0.320 0.000 0.664 0.016 0.000
#> GSM25633     1  0.3231     0.7478 0.800 0.000 0.004 0.196 0.000
#> GSM25634     1  0.3934     0.6925 0.716 0.000 0.008 0.276 0.000
#> GSM25635     1  0.4166     0.5768 0.648 0.000 0.004 0.348 0.000
#> GSM25656     3  0.2171     0.7986 0.004 0.020 0.924 0.008 0.044
#> GSM25657     1  0.3461     0.7311 0.772 0.000 0.004 0.224 0.000
#> GSM25658     3  0.2835     0.8069 0.036 0.000 0.880 0.080 0.004
#> GSM25659     1  0.1780     0.7452 0.940 0.000 0.024 0.008 0.028
#> GSM25660     1  0.3209     0.7506 0.812 0.000 0.000 0.180 0.008
#> GSM25661     1  0.3455     0.7350 0.784 0.000 0.008 0.208 0.000
#> GSM25662     2  0.2462     0.8847 0.000 0.880 0.008 0.000 0.112
#> GSM25663     5  0.3366     0.7489 0.000 0.212 0.004 0.000 0.784
#> GSM25680     5  0.1168     0.8074 0.000 0.032 0.008 0.000 0.960
#> GSM25681     5  0.1653     0.8055 0.028 0.024 0.004 0.000 0.944
#> GSM25682     2  0.1205     0.8780 0.000 0.956 0.000 0.004 0.040
#> GSM25683     2  0.1644     0.8859 0.000 0.940 0.008 0.004 0.048
#> GSM25684     2  0.3209     0.8417 0.000 0.812 0.008 0.000 0.180
#> GSM25685     2  0.4003     0.8042 0.000 0.820 0.088 0.020 0.072
#> GSM25686     2  0.1205     0.8780 0.000 0.956 0.000 0.004 0.040
#> GSM25687     2  0.1205     0.8780 0.000 0.956 0.000 0.004 0.040
#> GSM48664     4  0.1270     0.8395 0.052 0.000 0.000 0.948 0.000
#> GSM48665     4  0.1478     0.8325 0.064 0.000 0.000 0.936 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
#> GSM25548     5  0.2925     0.6793 0.000 0.148 0.004 0.000 0.832 0.016
#> GSM25549     5  0.1390     0.7109 0.000 0.032 0.004 0.000 0.948 0.016
#> GSM25550     5  0.1341     0.7042 0.000 0.024 0.000 0.000 0.948 0.028
#> GSM25551     2  0.4070     0.6182 0.000 0.776 0.016 0.004 0.148 0.056
#> GSM25570     5  0.1564     0.7070 0.000 0.040 0.000 0.000 0.936 0.024
#> GSM25571     5  0.2715     0.6941 0.000 0.112 0.004 0.000 0.860 0.024
#> GSM25358     4  0.8553    -0.0097 0.132 0.228 0.120 0.380 0.132 0.008
#> GSM25359     2  0.6206    -0.0723 0.000 0.424 0.036 0.000 0.412 0.128
#> GSM25360     3  0.6401     0.3211 0.292 0.000 0.452 0.000 0.024 0.232
#> GSM25361     5  0.4593     0.6121 0.060 0.004 0.024 0.000 0.728 0.184
#> GSM25377     4  0.0547     0.8478 0.020 0.000 0.000 0.980 0.000 0.000
#> GSM25378     4  0.0458     0.8476 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM25401     3  0.6529     0.0732 0.004 0.016 0.444 0.228 0.004 0.304
#> GSM25402     4  0.4281     0.4766 0.016 0.000 0.272 0.688 0.000 0.024
#> GSM25349     2  0.0603     0.6542 0.000 0.980 0.004 0.000 0.016 0.000
#> GSM25350     2  0.1075     0.6586 0.000 0.952 0.000 0.000 0.048 0.000
#> GSM25356     4  0.0260     0.8493 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM25357     2  0.2763     0.5963 0.008 0.892 0.048 0.012 0.016 0.024
#> GSM25385     3  0.3792     0.6576 0.052 0.000 0.780 0.160 0.000 0.008
#> GSM25386     3  0.1015     0.6690 0.012 0.000 0.968 0.004 0.004 0.012
#> GSM25399     4  0.0458     0.8474 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM25400     4  0.4127     0.1913 0.364 0.000 0.012 0.620 0.000 0.004
#> GSM48659     5  0.4949     0.4767 0.000 0.248 0.004 0.000 0.644 0.104
#> GSM48660     2  0.0458     0.6552 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM25409     2  0.3841     0.4520 0.000 0.616 0.000 0.000 0.380 0.004
#> GSM25410     3  0.2876     0.6705 0.016 0.000 0.844 0.132 0.000 0.008
#> GSM25426     6  0.5815     0.7166 0.000 0.304 0.080 0.008 0.036 0.572
#> GSM25427     4  0.0508     0.8446 0.012 0.004 0.000 0.984 0.000 0.000
#> GSM25540     5  0.4754     0.6179 0.000 0.020 0.052 0.000 0.668 0.260
#> GSM25541     5  0.4070     0.6721 0.008 0.016 0.032 0.000 0.764 0.180
#> GSM25542     2  0.7062     0.1499 0.000 0.412 0.088 0.000 0.292 0.208
#> GSM25543     5  0.6511     0.5568 0.004 0.116 0.112 0.004 0.580 0.184
#> GSM25479     1  0.2020     0.8008 0.896 0.000 0.000 0.096 0.000 0.008
#> GSM25480     1  0.1693     0.7965 0.936 0.000 0.000 0.032 0.020 0.012
#> GSM25481     4  0.0260     0.8481 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM25482     4  0.0260     0.8481 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM48654     5  0.5765     0.1098 0.000 0.352 0.008 0.000 0.496 0.144
#> GSM48650     2  0.5274    -0.4004 0.000 0.548 0.036 0.008 0.024 0.384
#> GSM48651     2  0.3857     0.6180 0.000 0.768 0.000 0.000 0.152 0.080
#> GSM48652     2  0.4923     0.5656 0.000 0.660 0.008 0.000 0.232 0.100
#> GSM48653     2  0.6176     0.3916 0.000 0.516 0.032 0.000 0.288 0.164
#> GSM48662     2  0.3899     0.4986 0.000 0.628 0.000 0.000 0.364 0.008
#> GSM48663     2  0.1218     0.6402 0.000 0.956 0.000 0.004 0.012 0.028
#> GSM25524     3  0.5731     0.3750 0.288 0.000 0.508 0.000 0.000 0.204
#> GSM25525     1  0.2604     0.7448 0.872 0.000 0.028 0.000 0.004 0.096
#> GSM25526     3  0.2662     0.6720 0.012 0.000 0.868 0.108 0.004 0.008
#> GSM25527     1  0.3488     0.7552 0.764 0.000 0.016 0.216 0.000 0.004
#> GSM25528     1  0.5529     0.4021 0.560 0.000 0.228 0.000 0.000 0.212
#> GSM25529     1  0.2798     0.7328 0.852 0.000 0.036 0.000 0.000 0.112
#> GSM25530     1  0.5842     0.2756 0.520 0.000 0.292 0.008 0.000 0.180
#> GSM25531     1  0.4327     0.7537 0.772 0.000 0.072 0.108 0.000 0.048
#> GSM48661     5  0.5965     0.5646 0.000 0.180 0.028 0.000 0.564 0.228
#> GSM25561     1  0.5330     0.4718 0.612 0.000 0.208 0.004 0.000 0.176
#> GSM25562     1  0.3910     0.7790 0.784 0.000 0.044 0.148 0.000 0.024
#> GSM25563     3  0.4840     0.5685 0.152 0.000 0.680 0.004 0.000 0.164
#> GSM25564     5  0.7421     0.3044 0.276 0.076 0.064 0.088 0.488 0.008
#> GSM25565     2  0.4564     0.5626 0.000 0.656 0.012 0.000 0.292 0.040
#> GSM25566     2  0.3975     0.6063 0.000 0.716 0.000 0.000 0.244 0.040
#> GSM25568     5  0.4725     0.6605 0.096 0.040 0.040 0.000 0.768 0.056
#> GSM25569     5  0.4535     0.4454 0.000 0.296 0.000 0.000 0.644 0.060
#> GSM25552     5  0.1485     0.7039 0.000 0.024 0.004 0.000 0.944 0.028
#> GSM25553     5  0.3348     0.6544 0.112 0.016 0.008 0.000 0.836 0.028
#> GSM25578     1  0.1265     0.8001 0.948 0.000 0.000 0.044 0.000 0.008
#> GSM25579     1  0.4001     0.7223 0.800 0.000 0.020 0.008 0.092 0.080
#> GSM25580     1  0.2664     0.7718 0.816 0.000 0.000 0.184 0.000 0.000
#> GSM25581     1  0.2053     0.7984 0.888 0.000 0.000 0.108 0.000 0.004
#> GSM48655     2  0.0603     0.6526 0.000 0.980 0.000 0.000 0.016 0.004
#> GSM48656     5  0.3804     0.2087 0.000 0.424 0.000 0.000 0.576 0.000
#> GSM48657     2  0.0363     0.6532 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM48658     5  0.4184     0.6904 0.000 0.124 0.004 0.000 0.752 0.120
#> GSM25624     1  0.2854     0.7551 0.792 0.000 0.000 0.208 0.000 0.000
#> GSM25625     3  0.3175     0.6812 0.032 0.000 0.844 0.108 0.004 0.012
#> GSM25626     3  0.1843     0.6770 0.016 0.000 0.932 0.032 0.004 0.016
#> GSM25627     3  0.4103     0.5647 0.084 0.000 0.768 0.000 0.012 0.136
#> GSM25628     3  0.2346     0.6238 0.000 0.000 0.868 0.000 0.008 0.124
#> GSM25629     3  0.4316     0.4322 0.000 0.016 0.700 0.000 0.032 0.252
#> GSM25630     3  0.5731     0.3901 0.276 0.000 0.512 0.000 0.000 0.212
#> GSM25631     5  0.2611     0.6861 0.000 0.008 0.012 0.000 0.864 0.116
#> GSM25632     3  0.4635     0.5929 0.148 0.000 0.712 0.008 0.000 0.132
#> GSM25633     1  0.2300     0.7953 0.856 0.000 0.000 0.144 0.000 0.000
#> GSM25634     1  0.3471     0.7716 0.784 0.000 0.020 0.188 0.000 0.008
#> GSM25635     1  0.3288     0.6850 0.724 0.000 0.000 0.276 0.000 0.000
#> GSM25656     3  0.2212     0.6253 0.000 0.000 0.880 0.000 0.008 0.112
#> GSM25657     1  0.3947     0.7607 0.756 0.000 0.032 0.196 0.000 0.016
#> GSM25658     3  0.3957     0.6274 0.100 0.000 0.788 0.100 0.004 0.008
#> GSM25659     1  0.3508     0.7324 0.832 0.000 0.032 0.000 0.064 0.072
#> GSM25660     1  0.2255     0.8009 0.892 0.000 0.000 0.088 0.016 0.004
#> GSM25661     1  0.2191     0.7941 0.876 0.000 0.000 0.120 0.000 0.004
#> GSM25662     2  0.4506     0.5971 0.000 0.704 0.004 0.000 0.204 0.088
#> GSM25663     5  0.4215     0.6026 0.000 0.244 0.000 0.000 0.700 0.056
#> GSM25680     5  0.2563     0.7197 0.000 0.040 0.004 0.000 0.880 0.076
#> GSM25681     5  0.2418     0.6948 0.008 0.004 0.008 0.000 0.884 0.096
#> GSM25682     2  0.0260     0.6386 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM25683     2  0.1679     0.6412 0.000 0.936 0.008 0.000 0.028 0.028
#> GSM25684     2  0.4948     0.5469 0.000 0.636 0.004 0.000 0.264 0.096
#> GSM25685     6  0.6047     0.7315 0.000 0.160 0.092 0.004 0.120 0.624
#> GSM25686     2  0.0260     0.6386 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM25687     2  0.0260     0.6386 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM48664     4  0.0458     0.8492 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM48665     4  0.0363     0.8498 0.012 0.000 0.000 0.988 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-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 genotype/variation(p) k
#> CV:mclust 97              3.40e-06 2
#> CV:mclust 94              2.57e-04 3
#> CV:mclust 74              8.01e-03 4
#> CV:mclust 88              1.97e-07 5
#> CV:mclust 78              4.07e-05 6

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


CV: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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.956           0.929       0.972         0.5032 0.496   0.496
#> 3 3 0.398           0.501       0.722         0.3085 0.736   0.516
#> 4 4 0.436           0.434       0.693         0.1202 0.802   0.492
#> 5 5 0.481           0.414       0.633         0.0713 0.852   0.510
#> 6 6 0.516           0.359       0.605         0.0434 0.908   0.622

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
#> GSM25548     2  0.0000      0.973 0.000 1.000
#> GSM25549     2  0.0000      0.973 0.000 1.000
#> GSM25550     2  0.0000      0.973 0.000 1.000
#> GSM25551     2  0.0000      0.973 0.000 1.000
#> GSM25570     2  0.0000      0.973 0.000 1.000
#> GSM25571     2  0.0000      0.973 0.000 1.000
#> GSM25358     1  0.9427      0.441 0.640 0.360
#> GSM25359     2  0.0000      0.973 0.000 1.000
#> GSM25360     1  0.0000      0.967 1.000 0.000
#> GSM25361     2  0.9896      0.199 0.440 0.560
#> GSM25377     1  0.0000      0.967 1.000 0.000
#> GSM25378     1  0.0672      0.962 0.992 0.008
#> GSM25401     2  0.7299      0.732 0.204 0.796
#> GSM25402     1  0.3114      0.921 0.944 0.056
#> GSM25349     2  0.0000      0.973 0.000 1.000
#> GSM25350     2  0.0000      0.973 0.000 1.000
#> GSM25356     1  0.0000      0.967 1.000 0.000
#> GSM25357     2  0.0000      0.973 0.000 1.000
#> GSM25385     1  0.0000      0.967 1.000 0.000
#> GSM25386     1  0.4815      0.871 0.896 0.104
#> GSM25399     1  0.0000      0.967 1.000 0.000
#> GSM25400     1  0.0000      0.967 1.000 0.000
#> GSM48659     2  0.0000      0.973 0.000 1.000
#> GSM48660     2  0.0000      0.973 0.000 1.000
#> GSM25409     2  0.0000      0.973 0.000 1.000
#> GSM25410     1  0.2236      0.940 0.964 0.036
#> GSM25426     2  0.0000      0.973 0.000 1.000
#> GSM25427     1  0.0938      0.960 0.988 0.012
#> GSM25540     2  0.0000      0.973 0.000 1.000
#> GSM25541     2  0.4022      0.898 0.080 0.920
#> GSM25542     2  0.0000      0.973 0.000 1.000
#> GSM25543     2  0.0000      0.973 0.000 1.000
#> GSM25479     1  0.0000      0.967 1.000 0.000
#> GSM25480     1  0.0000      0.967 1.000 0.000
#> GSM25481     1  0.3114      0.923 0.944 0.056
#> GSM25482     1  0.0938      0.960 0.988 0.012
#> GSM48654     2  0.0000      0.973 0.000 1.000
#> GSM48650     2  0.0000      0.973 0.000 1.000
#> GSM48651     2  0.0000      0.973 0.000 1.000
#> GSM48652     2  0.0000      0.973 0.000 1.000
#> GSM48653     2  0.0000      0.973 0.000 1.000
#> GSM48662     2  0.0000      0.973 0.000 1.000
#> GSM48663     2  0.0000      0.973 0.000 1.000
#> GSM25524     1  0.0000      0.967 1.000 0.000
#> GSM25525     1  0.0000      0.967 1.000 0.000
#> GSM25526     1  0.0000      0.967 1.000 0.000
#> GSM25527     1  0.0000      0.967 1.000 0.000
#> GSM25528     1  0.0000      0.967 1.000 0.000
#> GSM25529     1  0.0000      0.967 1.000 0.000
#> GSM25530     1  0.0000      0.967 1.000 0.000
#> GSM25531     1  0.0000      0.967 1.000 0.000
#> GSM48661     2  0.0000      0.973 0.000 1.000
#> GSM25561     1  0.0000      0.967 1.000 0.000
#> GSM25562     1  0.0000      0.967 1.000 0.000
#> GSM25563     1  0.0000      0.967 1.000 0.000
#> GSM25564     1  0.9087      0.523 0.676 0.324
#> GSM25565     2  0.0000      0.973 0.000 1.000
#> GSM25566     2  0.0000      0.973 0.000 1.000
#> GSM25568     2  0.9922      0.170 0.448 0.552
#> GSM25569     2  0.0000      0.973 0.000 1.000
#> GSM25552     2  0.0672      0.967 0.008 0.992
#> GSM25553     1  0.9983      0.087 0.524 0.476
#> GSM25578     1  0.0000      0.967 1.000 0.000
#> GSM25579     1  0.0000      0.967 1.000 0.000
#> GSM25580     1  0.0000      0.967 1.000 0.000
#> GSM25581     1  0.0000      0.967 1.000 0.000
#> GSM48655     2  0.0000      0.973 0.000 1.000
#> GSM48656     2  0.0000      0.973 0.000 1.000
#> GSM48657     2  0.0000      0.973 0.000 1.000
#> GSM48658     2  0.0000      0.973 0.000 1.000
#> GSM25624     1  0.0000      0.967 1.000 0.000
#> GSM25625     1  0.0000      0.967 1.000 0.000
#> GSM25626     1  0.1633      0.951 0.976 0.024
#> GSM25627     2  0.0000      0.973 0.000 1.000
#> GSM25628     2  0.4022      0.898 0.080 0.920
#> GSM25629     2  0.0000      0.973 0.000 1.000
#> GSM25630     1  0.0000      0.967 1.000 0.000
#> GSM25631     2  0.0376      0.970 0.004 0.996
#> GSM25632     1  0.0000      0.967 1.000 0.000
#> GSM25633     1  0.0000      0.967 1.000 0.000
#> GSM25634     1  0.0000      0.967 1.000 0.000
#> GSM25635     1  0.0000      0.967 1.000 0.000
#> GSM25656     2  0.1843      0.949 0.028 0.972
#> GSM25657     1  0.0000      0.967 1.000 0.000
#> GSM25658     1  0.0000      0.967 1.000 0.000
#> GSM25659     1  0.0376      0.965 0.996 0.004
#> GSM25660     1  0.0000      0.967 1.000 0.000
#> GSM25661     1  0.0000      0.967 1.000 0.000
#> GSM25662     2  0.0000      0.973 0.000 1.000
#> GSM25663     2  0.0000      0.973 0.000 1.000
#> GSM25680     2  0.0000      0.973 0.000 1.000
#> GSM25681     2  0.2236      0.942 0.036 0.964
#> GSM25682     2  0.0000      0.973 0.000 1.000
#> GSM25683     2  0.0000      0.973 0.000 1.000
#> GSM25684     2  0.0000      0.973 0.000 1.000
#> GSM25685     2  0.0000      0.973 0.000 1.000
#> GSM25686     2  0.0000      0.973 0.000 1.000
#> GSM25687     2  0.0000      0.973 0.000 1.000
#> GSM48664     1  0.0000      0.967 1.000 0.000
#> GSM48665     1  0.0000      0.967 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2   0.518     0.6254 0.000 0.744 0.256
#> GSM25549     2   0.418     0.6843 0.000 0.828 0.172
#> GSM25550     2   0.429     0.5912 0.064 0.872 0.064
#> GSM25551     2   0.631     0.0327 0.000 0.504 0.496
#> GSM25570     2   0.176     0.6722 0.004 0.956 0.040
#> GSM25571     2   0.378     0.6953 0.004 0.864 0.132
#> GSM25358     1   0.906     0.3463 0.544 0.276 0.180
#> GSM25359     3   0.559     0.4014 0.000 0.304 0.696
#> GSM25360     3   0.631    -0.3684 0.488 0.000 0.512
#> GSM25361     3   0.385     0.5105 0.108 0.016 0.876
#> GSM25377     1   0.503     0.7009 0.828 0.132 0.040
#> GSM25378     1   0.703     0.5288 0.660 0.296 0.044
#> GSM25401     3   0.929     0.3142 0.184 0.312 0.504
#> GSM25402     1   0.702     0.6716 0.728 0.156 0.116
#> GSM25349     2   0.295     0.6800 0.020 0.920 0.060
#> GSM25350     2   0.177     0.6654 0.016 0.960 0.024
#> GSM25356     1   0.731     0.5259 0.648 0.296 0.056
#> GSM25357     2   0.550     0.5720 0.000 0.708 0.292
#> GSM25385     1   0.642     0.4649 0.572 0.004 0.424
#> GSM25386     3   0.516     0.3660 0.216 0.008 0.776
#> GSM25399     1   0.231     0.7615 0.944 0.032 0.024
#> GSM25400     1   0.219     0.7698 0.948 0.024 0.028
#> GSM48659     3   0.628     0.0519 0.000 0.460 0.540
#> GSM48660     2   0.220     0.6853 0.004 0.940 0.056
#> GSM25409     2   0.113     0.6727 0.004 0.976 0.020
#> GSM25410     3   0.623     0.1243 0.340 0.008 0.652
#> GSM25426     3   0.611     0.2426 0.000 0.396 0.604
#> GSM25427     1   0.783     0.2180 0.500 0.448 0.052
#> GSM25540     3   0.311     0.5355 0.004 0.096 0.900
#> GSM25541     3   0.287     0.5393 0.008 0.076 0.916
#> GSM25542     3   0.593     0.3388 0.000 0.356 0.644
#> GSM25543     3   0.550     0.4145 0.000 0.292 0.708
#> GSM25479     1   0.177     0.7710 0.960 0.016 0.024
#> GSM25480     1   0.437     0.7641 0.860 0.032 0.108
#> GSM25481     2   0.776     0.1439 0.360 0.580 0.060
#> GSM25482     2   0.764     0.1130 0.372 0.576 0.052
#> GSM48654     2   0.625     0.2422 0.000 0.556 0.444
#> GSM48650     2   0.571     0.5398 0.000 0.680 0.320
#> GSM48651     2   0.573     0.5328 0.000 0.676 0.324
#> GSM48652     2   0.586     0.4884 0.000 0.656 0.344
#> GSM48653     3   0.625     0.0934 0.000 0.444 0.556
#> GSM48662     2   0.388     0.6921 0.000 0.848 0.152
#> GSM48663     2   0.253     0.6443 0.020 0.936 0.044
#> GSM25524     1   0.626     0.4644 0.552 0.000 0.448
#> GSM25525     1   0.412     0.7495 0.832 0.000 0.168
#> GSM25526     3   0.631     0.1449 0.328 0.012 0.660
#> GSM25527     1   0.319     0.7631 0.888 0.000 0.112
#> GSM25528     1   0.556     0.6556 0.700 0.000 0.300
#> GSM25529     1   0.445     0.7385 0.808 0.000 0.192
#> GSM25530     1   0.543     0.6616 0.716 0.000 0.284
#> GSM25531     1   0.394     0.7454 0.844 0.000 0.156
#> GSM48661     3   0.571     0.3787 0.000 0.320 0.680
#> GSM25561     1   0.579     0.6187 0.668 0.000 0.332
#> GSM25562     1   0.327     0.7659 0.884 0.000 0.116
#> GSM25563     3   0.622    -0.2169 0.432 0.000 0.568
#> GSM25564     1   0.930     0.4561 0.512 0.292 0.196
#> GSM25565     2   0.586     0.4914 0.000 0.656 0.344
#> GSM25566     2   0.586     0.4911 0.000 0.656 0.344
#> GSM25568     2   0.941     0.0971 0.240 0.508 0.252
#> GSM25569     2   0.489     0.6448 0.000 0.772 0.228
#> GSM25552     2   0.445     0.5922 0.040 0.860 0.100
#> GSM25553     2   0.754     0.4036 0.216 0.680 0.104
#> GSM25578     1   0.245     0.7716 0.924 0.000 0.076
#> GSM25579     1   0.566     0.7398 0.772 0.028 0.200
#> GSM25580     1   0.269     0.7544 0.932 0.036 0.032
#> GSM25581     1   0.140     0.7700 0.968 0.004 0.028
#> GSM48655     2   0.375     0.6943 0.000 0.856 0.144
#> GSM48656     2   0.304     0.7006 0.000 0.896 0.104
#> GSM48657     2   0.263     0.7004 0.000 0.916 0.084
#> GSM48658     3   0.629     0.0502 0.000 0.464 0.536
#> GSM25624     1   0.231     0.7657 0.944 0.024 0.032
#> GSM25625     1   0.630     0.3691 0.520 0.000 0.480
#> GSM25626     3   0.540     0.3036 0.256 0.004 0.740
#> GSM25627     3   0.479     0.5383 0.056 0.096 0.848
#> GSM25628     3   0.414     0.5397 0.096 0.032 0.872
#> GSM25629     3   0.392     0.5190 0.004 0.140 0.856
#> GSM25630     1   0.623     0.4753 0.564 0.000 0.436
#> GSM25631     3   0.628     0.2593 0.004 0.384 0.612
#> GSM25632     1   0.603     0.5579 0.624 0.000 0.376
#> GSM25633     1   0.226     0.7707 0.932 0.000 0.068
#> GSM25634     1   0.175     0.7703 0.952 0.000 0.048
#> GSM25635     1   0.232     0.7631 0.944 0.028 0.028
#> GSM25656     3   0.347     0.5443 0.056 0.040 0.904
#> GSM25657     1   0.304     0.7660 0.896 0.000 0.104
#> GSM25658     3   0.623    -0.1756 0.436 0.000 0.564
#> GSM25659     1   0.613     0.6744 0.700 0.016 0.284
#> GSM25660     1   0.378     0.7535 0.892 0.044 0.064
#> GSM25661     1   0.132     0.7703 0.972 0.008 0.020
#> GSM25662     3   0.630    -0.0264 0.000 0.484 0.516
#> GSM25663     2   0.565     0.5306 0.000 0.688 0.312
#> GSM25680     3   0.621     0.1363 0.000 0.428 0.572
#> GSM25681     3   0.638     0.3138 0.012 0.340 0.648
#> GSM25682     2   0.355     0.6976 0.000 0.868 0.132
#> GSM25683     2   0.529     0.5984 0.000 0.732 0.268
#> GSM25684     3   0.631    -0.0977 0.000 0.500 0.500
#> GSM25685     3   0.597     0.3102 0.000 0.364 0.636
#> GSM25686     2   0.355     0.6981 0.000 0.868 0.132
#> GSM25687     2   0.304     0.7000 0.000 0.896 0.104
#> GSM48664     1   0.531     0.6930 0.816 0.136 0.048
#> GSM48665     1   0.590     0.6617 0.776 0.176 0.048

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2   0.578     0.6288 0.000 0.704 0.108 0.188
#> GSM25549     2   0.480     0.6085 0.000 0.776 0.160 0.064
#> GSM25550     2   0.169     0.6370 0.008 0.952 0.032 0.008
#> GSM25551     4   0.279     0.4931 0.004 0.088 0.012 0.896
#> GSM25570     2   0.326     0.6492 0.004 0.884 0.068 0.044
#> GSM25571     2   0.479     0.6687 0.004 0.792 0.072 0.132
#> GSM25358     1   0.609     0.2376 0.508 0.036 0.004 0.452
#> GSM25359     4   0.476     0.4817 0.000 0.064 0.156 0.780
#> GSM25360     3   0.304     0.5590 0.100 0.000 0.880 0.020
#> GSM25361     3   0.239     0.5364 0.008 0.016 0.924 0.052
#> GSM25377     1   0.435     0.7082 0.844 0.060 0.044 0.052
#> GSM25378     1   0.440     0.6727 0.812 0.112 0.000 0.076
#> GSM25401     4   0.474     0.2881 0.240 0.008 0.012 0.740
#> GSM25402     1   0.648     0.4230 0.572 0.028 0.032 0.368
#> GSM25349     2   0.609     0.5341 0.052 0.608 0.004 0.336
#> GSM25350     2   0.444     0.6811 0.020 0.788 0.008 0.184
#> GSM25356     1   0.443     0.6753 0.824 0.084 0.008 0.084
#> GSM25357     4   0.486     0.3782 0.060 0.172 0.000 0.768
#> GSM25385     1   0.690     0.3962 0.592 0.000 0.224 0.184
#> GSM25386     3   0.643     0.4159 0.072 0.008 0.612 0.308
#> GSM25399     1   0.345     0.7161 0.884 0.048 0.020 0.048
#> GSM25400     1   0.249     0.7193 0.916 0.016 0.004 0.064
#> GSM48659     4   0.785     0.1306 0.000 0.300 0.296 0.404
#> GSM48660     2   0.545     0.6233 0.012 0.676 0.020 0.292
#> GSM25409     2   0.307     0.6909 0.004 0.868 0.004 0.124
#> GSM25410     3   0.804     0.1893 0.340 0.004 0.368 0.288
#> GSM25426     4   0.111     0.5050 0.004 0.028 0.000 0.968
#> GSM25427     1   0.573     0.4211 0.564 0.412 0.012 0.012
#> GSM25540     3   0.457     0.4148 0.000 0.008 0.716 0.276
#> GSM25541     3   0.358     0.4882 0.000 0.004 0.816 0.180
#> GSM25542     4   0.659     0.4464 0.000 0.160 0.212 0.628
#> GSM25543     3   0.694     0.1179 0.000 0.128 0.540 0.332
#> GSM25479     1   0.441     0.7116 0.812 0.080 0.108 0.000
#> GSM25480     1   0.701     0.4640 0.560 0.156 0.284 0.000
#> GSM25481     1   0.648     0.3909 0.552 0.368 0.000 0.080
#> GSM25482     1   0.612     0.3127 0.516 0.436 0.000 0.048
#> GSM48654     4   0.780     0.1087 0.000 0.320 0.264 0.416
#> GSM48650     4   0.454     0.3946 0.016 0.204 0.008 0.772
#> GSM48651     4   0.693    -0.0452 0.000 0.396 0.112 0.492
#> GSM48652     4   0.688     0.1499 0.000 0.340 0.120 0.540
#> GSM48653     4   0.705     0.3846 0.000 0.196 0.232 0.572
#> GSM48662     2   0.502     0.6821 0.004 0.760 0.052 0.184
#> GSM48663     2   0.512     0.6486 0.032 0.736 0.008 0.224
#> GSM25524     3   0.496     0.4762 0.204 0.000 0.748 0.048
#> GSM25525     1   0.619     0.2873 0.516 0.052 0.432 0.000
#> GSM25526     4   0.703    -0.0749 0.364 0.000 0.128 0.508
#> GSM25527     1   0.280     0.7241 0.892 0.004 0.096 0.008
#> GSM25528     3   0.487     0.1786 0.356 0.004 0.640 0.000
#> GSM25529     1   0.578     0.2295 0.500 0.028 0.472 0.000
#> GSM25530     1   0.499     0.6249 0.744 0.000 0.208 0.048
#> GSM25531     1   0.295     0.7119 0.888 0.000 0.088 0.024
#> GSM48661     3   0.724    -0.0947 0.000 0.144 0.456 0.400
#> GSM25561     3   0.506     0.3600 0.288 0.004 0.692 0.016
#> GSM25562     1   0.470     0.6628 0.764 0.016 0.208 0.012
#> GSM25563     3   0.591     0.4727 0.208 0.000 0.688 0.104
#> GSM25564     3   0.926     0.1060 0.240 0.336 0.340 0.084
#> GSM25565     4   0.685     0.0321 0.000 0.376 0.108 0.516
#> GSM25566     4   0.628     0.0606 0.000 0.360 0.068 0.572
#> GSM25568     2   0.705    -0.0123 0.028 0.460 0.456 0.056
#> GSM25569     2   0.613     0.6193 0.000 0.668 0.116 0.216
#> GSM25552     2   0.259     0.6269 0.012 0.908 0.076 0.004
#> GSM25553     2   0.384     0.5538 0.036 0.836 0.128 0.000
#> GSM25578     1   0.370     0.6972 0.828 0.016 0.156 0.000
#> GSM25579     3   0.713     0.2501 0.256 0.152 0.584 0.008
#> GSM25580     1   0.276     0.7338 0.904 0.048 0.048 0.000
#> GSM25581     1   0.320     0.7278 0.880 0.040 0.080 0.000
#> GSM48655     2   0.506     0.4909 0.004 0.584 0.000 0.412
#> GSM48656     2   0.352     0.6933 0.000 0.856 0.032 0.112
#> GSM48657     2   0.539     0.5859 0.012 0.636 0.008 0.344
#> GSM48658     3   0.789    -0.2444 0.000 0.292 0.368 0.340
#> GSM25624     1   0.250     0.7341 0.916 0.040 0.044 0.000
#> GSM25625     1   0.737     0.2518 0.524 0.000 0.244 0.232
#> GSM25626     4   0.745    -0.2190 0.184 0.000 0.344 0.472
#> GSM25627     4   0.324     0.4168 0.052 0.000 0.068 0.880
#> GSM25628     3   0.546     0.1597 0.008 0.004 0.504 0.484
#> GSM25629     4   0.327     0.3916 0.000 0.000 0.168 0.832
#> GSM25630     3   0.443     0.5103 0.168 0.004 0.796 0.032
#> GSM25631     3   0.556     0.4032 0.004 0.236 0.704 0.056
#> GSM25632     1   0.619     0.4985 0.652 0.000 0.244 0.104
#> GSM25633     1   0.240     0.7280 0.904 0.004 0.092 0.000
#> GSM25634     1   0.187     0.7305 0.928 0.000 0.072 0.000
#> GSM25635     1   0.300     0.7347 0.896 0.064 0.036 0.004
#> GSM25656     4   0.544    -0.1136 0.004 0.008 0.456 0.532
#> GSM25657     1   0.225     0.7283 0.920 0.000 0.068 0.012
#> GSM25658     4   0.671    -0.2456 0.444 0.000 0.088 0.468
#> GSM25659     3   0.517     0.4215 0.216 0.044 0.736 0.004
#> GSM25660     1   0.692     0.5323 0.588 0.232 0.180 0.000
#> GSM25661     1   0.297     0.7317 0.892 0.036 0.072 0.000
#> GSM25662     4   0.492     0.4487 0.000 0.164 0.068 0.768
#> GSM25663     2   0.712     0.4218 0.004 0.552 0.140 0.304
#> GSM25680     3   0.771    -0.0643 0.000 0.300 0.448 0.252
#> GSM25681     3   0.624     0.3459 0.004 0.220 0.668 0.108
#> GSM25682     2   0.504     0.5141 0.000 0.592 0.004 0.404
#> GSM25683     4   0.494     0.1450 0.000 0.340 0.008 0.652
#> GSM25684     4   0.605     0.3576 0.000 0.240 0.096 0.664
#> GSM25685     4   0.247     0.5196 0.000 0.028 0.056 0.916
#> GSM25686     2   0.508     0.4831 0.000 0.576 0.004 0.420
#> GSM25687     2   0.468     0.5853 0.000 0.648 0.000 0.352
#> GSM48664     1   0.320     0.7173 0.892 0.064 0.016 0.028
#> GSM48665     1   0.252     0.7173 0.904 0.088 0.004 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
#> GSM25548     5   0.497    0.48396 0.000 0.196 0.020 0.060 0.724
#> GSM25549     5   0.445    0.52730 0.000 0.196 0.040 0.012 0.752
#> GSM25550     5   0.414    0.49725 0.012 0.244 0.004 0.004 0.736
#> GSM25551     4   0.289    0.54790 0.004 0.068 0.004 0.884 0.040
#> GSM25570     5   0.351    0.53334 0.004 0.196 0.000 0.008 0.792
#> GSM25571     5   0.430    0.52362 0.004 0.188 0.004 0.040 0.764
#> GSM25358     4   0.546    0.04772 0.380 0.012 0.008 0.572 0.028
#> GSM25359     4   0.477    0.50541 0.000 0.068 0.068 0.780 0.084
#> GSM25360     3   0.444    0.59802 0.064 0.008 0.808 0.036 0.084
#> GSM25361     3   0.468    0.48734 0.004 0.004 0.716 0.040 0.236
#> GSM25377     1   0.564    0.55206 0.672 0.236 0.056 0.008 0.028
#> GSM25378     1   0.463    0.65778 0.764 0.028 0.000 0.160 0.048
#> GSM25401     4   0.403    0.50424 0.168 0.024 0.004 0.792 0.012
#> GSM25402     1   0.638    0.45711 0.592 0.080 0.024 0.288 0.016
#> GSM25349     2   0.495    0.56007 0.032 0.780 0.020 0.096 0.072
#> GSM25350     2   0.472    0.53270 0.024 0.784 0.020 0.044 0.128
#> GSM25356     1   0.412    0.68608 0.820 0.060 0.004 0.092 0.024
#> GSM25357     4   0.533    0.43196 0.044 0.216 0.012 0.704 0.024
#> GSM25385     4   0.729   -0.20178 0.360 0.000 0.228 0.384 0.028
#> GSM25386     3   0.563    0.60122 0.040 0.148 0.724 0.068 0.020
#> GSM25399     1   0.416    0.64880 0.800 0.144 0.028 0.004 0.024
#> GSM25400     1   0.320    0.69374 0.848 0.020 0.000 0.124 0.008
#> GSM48659     2   0.840    0.31514 0.000 0.304 0.144 0.284 0.268
#> GSM48660     2   0.256    0.55797 0.008 0.908 0.052 0.016 0.016
#> GSM25409     2   0.550    0.13104 0.008 0.500 0.004 0.036 0.452
#> GSM25410     3   0.754    0.52317 0.192 0.128 0.560 0.100 0.020
#> GSM25426     4   0.223    0.53583 0.000 0.104 0.000 0.892 0.004
#> GSM25427     1   0.589    0.47638 0.592 0.308 0.004 0.008 0.088
#> GSM25540     3   0.574    0.52972 0.000 0.020 0.664 0.196 0.120
#> GSM25541     3   0.602    0.46369 0.004 0.012 0.624 0.124 0.236
#> GSM25542     2   0.644    0.20361 0.000 0.520 0.336 0.128 0.016
#> GSM25543     3   0.518    0.11663 0.000 0.472 0.496 0.012 0.020
#> GSM25479     1   0.402    0.65980 0.772 0.000 0.024 0.008 0.196
#> GSM25480     5   0.656   -0.18254 0.400 0.004 0.112 0.016 0.468
#> GSM25481     1   0.676    0.41852 0.540 0.324 0.012 0.040 0.084
#> GSM25482     1   0.673    0.42773 0.552 0.280 0.008 0.024 0.136
#> GSM48654     2   0.726    0.53376 0.000 0.544 0.220 0.124 0.112
#> GSM48650     4   0.500   -0.10568 0.000 0.476 0.016 0.500 0.008
#> GSM48651     2   0.583    0.55127 0.000 0.676 0.096 0.184 0.044
#> GSM48652     2   0.595    0.51448 0.000 0.644 0.108 0.220 0.028
#> GSM48653     2   0.715    0.38320 0.000 0.488 0.188 0.284 0.040
#> GSM48662     2   0.481    0.59487 0.000 0.772 0.068 0.048 0.112
#> GSM48663     2   0.275    0.53029 0.024 0.904 0.016 0.016 0.040
#> GSM25524     3   0.624    0.54696 0.124 0.004 0.672 0.080 0.120
#> GSM25525     1   0.743    0.25992 0.424 0.000 0.244 0.040 0.292
#> GSM25526     4   0.519    0.36088 0.208 0.000 0.052 0.708 0.032
#> GSM25527     1   0.512    0.66337 0.740 0.000 0.036 0.144 0.080
#> GSM25528     3   0.592    0.43753 0.240 0.004 0.640 0.020 0.096
#> GSM25529     1   0.756    0.16802 0.368 0.000 0.284 0.040 0.308
#> GSM25530     1   0.565    0.50656 0.652 0.000 0.244 0.084 0.020
#> GSM25531     1   0.425    0.67783 0.808 0.000 0.068 0.092 0.032
#> GSM48661     3   0.739   -0.22474 0.000 0.396 0.400 0.132 0.072
#> GSM25561     3   0.498    0.57604 0.156 0.088 0.740 0.004 0.012
#> GSM25562     1   0.736   -0.02862 0.392 0.272 0.308 0.000 0.028
#> GSM25563     3   0.589    0.59551 0.092 0.156 0.700 0.024 0.028
#> GSM25564     2   0.757   -0.01392 0.128 0.496 0.288 0.012 0.076
#> GSM25565     2   0.696    0.51101 0.000 0.552 0.080 0.260 0.108
#> GSM25566     4   0.702   -0.30612 0.000 0.376 0.016 0.396 0.212
#> GSM25568     2   0.578   -0.10052 0.008 0.516 0.424 0.016 0.036
#> GSM25569     2   0.692    0.53506 0.000 0.564 0.132 0.068 0.236
#> GSM25552     5   0.335    0.54001 0.004 0.192 0.000 0.004 0.800
#> GSM25553     5   0.407    0.52155 0.012 0.204 0.012 0.004 0.768
#> GSM25578     1   0.542    0.62522 0.700 0.000 0.096 0.024 0.180
#> GSM25579     5   0.615    0.26767 0.120 0.000 0.220 0.032 0.628
#> GSM25580     1   0.242    0.70703 0.912 0.036 0.016 0.000 0.036
#> GSM25581     1   0.346    0.70012 0.844 0.004 0.040 0.004 0.108
#> GSM48655     2   0.563    0.56121 0.000 0.660 0.008 0.188 0.144
#> GSM48656     2   0.507    0.45585 0.000 0.668 0.028 0.024 0.280
#> GSM48657     2   0.473    0.57655 0.004 0.744 0.000 0.144 0.108
#> GSM48658     2   0.842    0.33517 0.000 0.332 0.232 0.164 0.272
#> GSM25624     1   0.362    0.69996 0.836 0.004 0.016 0.024 0.120
#> GSM25625     1   0.726    0.10546 0.372 0.000 0.240 0.364 0.024
#> GSM25626     3   0.712    0.26257 0.120 0.056 0.420 0.404 0.000
#> GSM25627     4   0.190    0.55781 0.020 0.028 0.016 0.936 0.000
#> GSM25628     3   0.585    0.47682 0.004 0.104 0.604 0.284 0.004
#> GSM25629     4   0.241    0.52200 0.000 0.008 0.056 0.908 0.028
#> GSM25630     3   0.487    0.59723 0.072 0.148 0.756 0.004 0.020
#> GSM25631     5   0.606    0.17180 0.000 0.064 0.400 0.024 0.512
#> GSM25632     1   0.664    0.19256 0.492 0.000 0.356 0.128 0.024
#> GSM25633     1   0.318    0.69605 0.872 0.000 0.068 0.024 0.036
#> GSM25634     1   0.316    0.69073 0.872 0.024 0.084 0.008 0.012
#> GSM25635     1   0.427    0.68695 0.792 0.024 0.000 0.044 0.140
#> GSM25656     3   0.632    0.44761 0.004 0.200 0.588 0.200 0.008
#> GSM25657     1   0.336    0.68664 0.856 0.016 0.100 0.024 0.004
#> GSM25658     4   0.520    0.22247 0.296 0.000 0.040 0.648 0.016
#> GSM25659     3   0.681    0.47180 0.124 0.020 0.600 0.036 0.220
#> GSM25660     5   0.534   -0.15736 0.424 0.004 0.028 0.008 0.536
#> GSM25661     1   0.314    0.70178 0.856 0.000 0.032 0.004 0.108
#> GSM25662     4   0.621    0.12653 0.000 0.300 0.040 0.584 0.076
#> GSM25663     5   0.692   -0.06708 0.000 0.324 0.020 0.188 0.468
#> GSM25680     5   0.746    0.33416 0.000 0.120 0.200 0.152 0.528
#> GSM25681     5   0.578    0.34306 0.000 0.044 0.292 0.044 0.620
#> GSM25682     2   0.665    0.43719 0.000 0.484 0.004 0.256 0.256
#> GSM25683     4   0.592   -0.00532 0.000 0.364 0.008 0.540 0.088
#> GSM25684     4   0.695    0.02221 0.000 0.272 0.044 0.528 0.156
#> GSM25685     4   0.334    0.52547 0.000 0.104 0.028 0.852 0.016
#> GSM25686     2   0.674    0.41385 0.000 0.460 0.004 0.284 0.252
#> GSM25687     2   0.662    0.39213 0.000 0.484 0.004 0.220 0.292
#> GSM48664     1   0.360    0.66327 0.824 0.144 0.012 0.004 0.016
#> GSM48665     1   0.307    0.69429 0.872 0.088 0.004 0.008 0.028

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM25548     6   0.370    0.60562 0.000 0.128 0.000 0.020 0.048 0.804
#> GSM25549     6   0.337    0.63940 0.000 0.080 0.012 0.036 0.024 0.848
#> GSM25550     6   0.308    0.62292 0.012 0.100 0.004 0.032 0.000 0.852
#> GSM25551     5   0.249    0.56077 0.000 0.068 0.000 0.008 0.888 0.036
#> GSM25570     6   0.262    0.64553 0.004 0.092 0.000 0.024 0.004 0.876
#> GSM25571     6   0.316    0.64097 0.000 0.092 0.000 0.020 0.040 0.848
#> GSM25358     5   0.738    0.21777 0.248 0.012 0.136 0.064 0.500 0.040
#> GSM25359     5   0.750    0.21609 0.008 0.048 0.220 0.072 0.496 0.156
#> GSM25360     3   0.558    0.27995 0.032 0.012 0.692 0.172 0.032 0.060
#> GSM25361     4   0.711    0.31375 0.012 0.040 0.308 0.460 0.020 0.160
#> GSM25377     1   0.708    0.39520 0.492 0.224 0.132 0.144 0.008 0.000
#> GSM25378     1   0.604    0.57878 0.656 0.012 0.020 0.076 0.172 0.064
#> GSM25401     5   0.441    0.47994 0.192 0.036 0.012 0.020 0.740 0.000
#> GSM25402     1   0.726    0.29149 0.460 0.064 0.080 0.080 0.316 0.000
#> GSM25349     2   0.652    0.41606 0.008 0.628 0.068 0.072 0.060 0.164
#> GSM25350     2   0.710    0.29299 0.008 0.516 0.112 0.076 0.028 0.260
#> GSM25356     1   0.642    0.58128 0.648 0.024 0.052 0.104 0.136 0.036
#> GSM25357     5   0.642    0.41494 0.016 0.188 0.044 0.080 0.628 0.044
#> GSM25385     3   0.696    0.24640 0.244 0.004 0.420 0.056 0.276 0.000
#> GSM25386     3   0.339    0.47447 0.012 0.040 0.852 0.020 0.072 0.004
#> GSM25399     1   0.611    0.54693 0.636 0.148 0.084 0.116 0.016 0.000
#> GSM25400     1   0.439    0.61329 0.764 0.000 0.032 0.052 0.144 0.008
#> GSM48659     2   0.839    0.15846 0.000 0.304 0.060 0.228 0.256 0.152
#> GSM48660     2   0.342    0.49240 0.000 0.840 0.056 0.064 0.000 0.040
#> GSM25409     6   0.523    0.18730 0.004 0.384 0.000 0.040 0.024 0.548
#> GSM25410     3   0.539    0.44728 0.076 0.028 0.724 0.072 0.096 0.004
#> GSM25426     5   0.229    0.56064 0.000 0.076 0.000 0.020 0.896 0.008
#> GSM25427     1   0.844    0.35810 0.404 0.200 0.092 0.152 0.008 0.144
#> GSM25540     3   0.774   -0.08608 0.000 0.080 0.380 0.304 0.192 0.044
#> GSM25541     4   0.786    0.19385 0.012 0.052 0.304 0.420 0.108 0.104
#> GSM25542     3   0.654    0.29550 0.000 0.300 0.532 0.060 0.076 0.032
#> GSM25543     3   0.508    0.38913 0.000 0.244 0.668 0.052 0.012 0.024
#> GSM25479     1   0.561    0.58036 0.684 0.008 0.040 0.112 0.012 0.144
#> GSM25480     1   0.704    0.21855 0.404 0.004 0.036 0.152 0.028 0.376
#> GSM25481     1   0.877    0.16001 0.328 0.308 0.080 0.128 0.040 0.116
#> GSM25482     1   0.858    0.31937 0.396 0.216 0.060 0.120 0.032 0.176
#> GSM48654     2   0.728    0.42750 0.000 0.544 0.136 0.128 0.128 0.064
#> GSM48650     2   0.483    0.12360 0.000 0.524 0.012 0.024 0.436 0.004
#> GSM48651     2   0.473    0.50086 0.000 0.756 0.036 0.052 0.128 0.028
#> GSM48652     2   0.494    0.47768 0.000 0.724 0.028 0.064 0.164 0.020
#> GSM48653     2   0.685    0.34702 0.000 0.540 0.080 0.160 0.200 0.020
#> GSM48662     2   0.421    0.50563 0.000 0.792 0.020 0.056 0.024 0.108
#> GSM48663     2   0.465    0.45848 0.008 0.768 0.056 0.096 0.004 0.068
#> GSM25524     4   0.672    0.21898 0.152 0.004 0.332 0.464 0.036 0.012
#> GSM25525     1   0.693    0.18112 0.444 0.000 0.040 0.312 0.020 0.184
#> GSM25526     5   0.502    0.36789 0.236 0.000 0.020 0.072 0.668 0.004
#> GSM25527     1   0.408    0.61621 0.796 0.000 0.012 0.112 0.056 0.024
#> GSM25528     4   0.688    0.11271 0.284 0.000 0.332 0.348 0.012 0.024
#> GSM25529     1   0.709    0.21581 0.456 0.000 0.052 0.284 0.024 0.184
#> GSM25530     1   0.522    0.53520 0.684 0.000 0.144 0.132 0.040 0.000
#> GSM25531     1   0.343    0.62724 0.840 0.000 0.024 0.080 0.052 0.004
#> GSM48661     2   0.815   -0.00886 0.000 0.340 0.228 0.252 0.136 0.044
#> GSM25561     3   0.521    0.38459 0.072 0.060 0.708 0.152 0.004 0.004
#> GSM25562     2   0.796   -0.20798 0.260 0.272 0.260 0.196 0.012 0.000
#> GSM25563     3   0.494    0.40805 0.036 0.096 0.736 0.120 0.008 0.004
#> GSM25564     2   0.815    0.02975 0.096 0.432 0.144 0.252 0.028 0.048
#> GSM25565     2   0.848    0.28821 0.004 0.360 0.148 0.076 0.216 0.196
#> GSM25566     5   0.697   -0.16629 0.000 0.296 0.024 0.016 0.340 0.324
#> GSM25568     2   0.709    0.01647 0.024 0.440 0.348 0.140 0.016 0.032
#> GSM25569     2   0.656    0.39305 0.000 0.580 0.108 0.060 0.036 0.216
#> GSM25552     6   0.208    0.62622 0.008 0.056 0.000 0.024 0.000 0.912
#> GSM25553     6   0.299    0.59697 0.024 0.060 0.008 0.036 0.000 0.872
#> GSM25578     1   0.462    0.59549 0.764 0.000 0.032 0.072 0.020 0.112
#> GSM25579     6   0.655   -0.02615 0.204 0.000 0.032 0.240 0.012 0.512
#> GSM25580     1   0.423    0.64238 0.808 0.036 0.032 0.076 0.004 0.044
#> GSM25581     1   0.384    0.63537 0.824 0.016 0.036 0.052 0.000 0.072
#> GSM48655     2   0.606    0.39879 0.000 0.592 0.012 0.028 0.168 0.200
#> GSM48656     2   0.463    0.41955 0.000 0.708 0.004 0.052 0.020 0.216
#> GSM48657     2   0.515    0.48798 0.000 0.704 0.004 0.048 0.148 0.096
#> GSM48658     4   0.840   -0.11058 0.000 0.300 0.092 0.316 0.136 0.156
#> GSM25624     1   0.456    0.63488 0.772 0.004 0.064 0.048 0.008 0.104
#> GSM25625     1   0.703    0.02500 0.372 0.000 0.192 0.084 0.352 0.000
#> GSM25626     3   0.634    0.36334 0.088 0.020 0.556 0.056 0.280 0.000
#> GSM25627     5   0.313    0.54526 0.056 0.028 0.016 0.032 0.868 0.000
#> GSM25628     3   0.682    0.30869 0.008 0.080 0.516 0.132 0.260 0.004
#> GSM25629     5   0.349    0.53705 0.012 0.044 0.016 0.092 0.836 0.000
#> GSM25630     3   0.518    0.33137 0.024 0.112 0.664 0.200 0.000 0.000
#> GSM25631     4   0.689    0.26287 0.004 0.064 0.132 0.428 0.008 0.364
#> GSM25632     3   0.609    0.16647 0.340 0.000 0.512 0.056 0.092 0.000
#> GSM25633     1   0.316    0.63109 0.860 0.004 0.056 0.064 0.008 0.008
#> GSM25634     1   0.486    0.61439 0.732 0.016 0.144 0.092 0.008 0.008
#> GSM25635     1   0.526    0.61444 0.716 0.008 0.032 0.064 0.024 0.156
#> GSM25656     3   0.710    0.30037 0.000 0.156 0.508 0.188 0.136 0.012
#> GSM25657     1   0.450    0.61915 0.760 0.032 0.096 0.108 0.004 0.000
#> GSM25658     5   0.595    0.25197 0.284 0.008 0.016 0.124 0.564 0.004
#> GSM25659     4   0.765    0.34146 0.176 0.088 0.104 0.532 0.020 0.080
#> GSM25660     1   0.577    0.33384 0.488 0.000 0.016 0.116 0.000 0.380
#> GSM25661     1   0.361    0.63441 0.832 0.012 0.020 0.052 0.000 0.084
#> GSM25662     5   0.555    0.22139 0.000 0.332 0.012 0.044 0.576 0.036
#> GSM25663     6   0.655    0.27430 0.000 0.268 0.016 0.044 0.144 0.528
#> GSM25680     6   0.745    0.30736 0.000 0.096 0.056 0.192 0.152 0.504
#> GSM25681     6   0.727    0.16823 0.012 0.048 0.176 0.180 0.052 0.532
#> GSM25682     2   0.666    0.03394 0.000 0.380 0.012 0.020 0.208 0.380
#> GSM25683     5   0.664    0.04298 0.000 0.336 0.024 0.028 0.468 0.144
#> GSM25684     5   0.629    0.13686 0.000 0.328 0.012 0.052 0.520 0.088
#> GSM25685     5   0.304    0.53047 0.000 0.128 0.000 0.032 0.836 0.004
#> GSM25686     2   0.675    0.05539 0.000 0.392 0.012 0.028 0.200 0.368
#> GSM25687     6   0.659   -0.09406 0.000 0.400 0.016 0.028 0.148 0.408
#> GSM48664     1   0.643    0.55491 0.620 0.128 0.072 0.152 0.020 0.008
#> GSM48665     1   0.443    0.63704 0.792 0.024 0.024 0.104 0.016 0.040

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 genotype/variation(p) k
#> CV:NMF 96              9.23e-05 2
#> CV:NMF 62              2.60e-04 3
#> CV:NMF 45              4.06e-02 4
#> CV:NMF 52              1.00e-02 5
#> CV:NMF 33              1.18e-03 6

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


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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.0844           0.711       0.802         0.4339 0.502   0.502
#> 3 3 0.1149           0.657       0.736         0.2112 0.937   0.879
#> 4 4 0.1875           0.566       0.700         0.1400 0.958   0.914
#> 5 5 0.2282           0.506       0.680         0.0792 0.957   0.906
#> 6 6 0.3097           0.358       0.660         0.0691 0.916   0.808

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
#> GSM25548     2   0.767     0.7119 0.224 0.776
#> GSM25549     2   0.767     0.7061 0.224 0.776
#> GSM25550     2   0.795     0.7039 0.240 0.760
#> GSM25551     2   0.482     0.7969 0.104 0.896
#> GSM25570     2   0.767     0.7061 0.224 0.776
#> GSM25571     2   0.767     0.7061 0.224 0.776
#> GSM25358     2   0.844     0.6565 0.272 0.728
#> GSM25359     2   0.844     0.6565 0.272 0.728
#> GSM25360     1   0.998     0.4079 0.524 0.476
#> GSM25361     1   0.998     0.4079 0.524 0.476
#> GSM25377     1   0.373     0.6920 0.928 0.072
#> GSM25378     1   1.000     0.0528 0.504 0.496
#> GSM25401     2   0.753     0.6801 0.216 0.784
#> GSM25402     2   0.844     0.6025 0.272 0.728
#> GSM25349     2   0.358     0.7745 0.068 0.932
#> GSM25350     2   0.358     0.7745 0.068 0.932
#> GSM25356     2   0.753     0.6894 0.216 0.784
#> GSM25357     2   0.753     0.6894 0.216 0.784
#> GSM25385     1   0.827     0.7912 0.740 0.260
#> GSM25386     1   0.891     0.7455 0.692 0.308
#> GSM25399     1   0.311     0.6813 0.944 0.056
#> GSM25400     1   0.886     0.6545 0.696 0.304
#> GSM48659     2   0.358     0.8010 0.068 0.932
#> GSM48660     2   0.278     0.7880 0.048 0.952
#> GSM25409     2   0.644     0.7884 0.164 0.836
#> GSM25410     1   0.895     0.7405 0.688 0.312
#> GSM25426     2   0.456     0.7884 0.096 0.904
#> GSM25427     2   0.992     0.1762 0.448 0.552
#> GSM25540     2   0.781     0.6894 0.232 0.768
#> GSM25541     2   0.781     0.6894 0.232 0.768
#> GSM25542     2   0.680     0.7373 0.180 0.820
#> GSM25543     2   0.689     0.7339 0.184 0.816
#> GSM25479     1   0.760     0.8091 0.780 0.220
#> GSM25480     1   0.760     0.8091 0.780 0.220
#> GSM25481     2   0.850     0.5912 0.276 0.724
#> GSM25482     2   0.850     0.5912 0.276 0.724
#> GSM48654     2   0.416     0.8033 0.084 0.916
#> GSM48650     2   0.343     0.7778 0.064 0.936
#> GSM48651     2   0.204     0.7899 0.032 0.968
#> GSM48652     2   0.224     0.7901 0.036 0.964
#> GSM48653     2   0.184     0.7930 0.028 0.972
#> GSM48662     2   0.242     0.7946 0.040 0.960
#> GSM48663     2   0.373     0.7751 0.072 0.928
#> GSM25524     1   0.730     0.7874 0.796 0.204
#> GSM25525     1   0.775     0.8098 0.772 0.228
#> GSM25526     1   0.978     0.5376 0.588 0.412
#> GSM25527     1   0.745     0.8075 0.788 0.212
#> GSM25528     1   0.745     0.7932 0.788 0.212
#> GSM25529     1   0.760     0.8125 0.780 0.220
#> GSM25530     1   0.529     0.7643 0.880 0.120
#> GSM25531     1   0.584     0.7946 0.860 0.140
#> GSM48661     2   0.430     0.7995 0.088 0.912
#> GSM25561     1   0.861     0.7811 0.716 0.284
#> GSM25562     1   0.909     0.7305 0.676 0.324
#> GSM25563     1   0.850     0.7799 0.724 0.276
#> GSM25564     1   0.997     0.3534 0.532 0.468
#> GSM25565     2   0.506     0.7893 0.112 0.888
#> GSM25566     2   0.469     0.8014 0.100 0.900
#> GSM25568     2   0.311     0.7994 0.056 0.944
#> GSM25569     2   0.295     0.8001 0.052 0.948
#> GSM25552     2   0.802     0.6905 0.244 0.756
#> GSM25553     2   0.802     0.6905 0.244 0.756
#> GSM25578     1   0.680     0.8102 0.820 0.180
#> GSM25579     1   0.788     0.7988 0.764 0.236
#> GSM25580     1   0.615     0.7917 0.848 0.152
#> GSM25581     1   0.615     0.7917 0.848 0.152
#> GSM48655     2   0.278     0.7872 0.048 0.952
#> GSM48656     2   0.482     0.8016 0.104 0.896
#> GSM48657     2   0.343     0.7778 0.064 0.936
#> GSM48658     2   0.443     0.7975 0.092 0.908
#> GSM25624     1   0.808     0.7516 0.752 0.248
#> GSM25625     1   0.900     0.7383 0.684 0.316
#> GSM25626     1   0.881     0.7538 0.700 0.300
#> GSM25627     2   1.000    -0.2993 0.500 0.500
#> GSM25628     1   0.886     0.7500 0.696 0.304
#> GSM25629     2   0.952     0.2575 0.372 0.628
#> GSM25630     1   0.760     0.7884 0.780 0.220
#> GSM25631     2   0.753     0.7164 0.216 0.784
#> GSM25632     1   0.760     0.8137 0.780 0.220
#> GSM25633     1   0.653     0.8084 0.832 0.168
#> GSM25634     1   0.662     0.8051 0.828 0.172
#> GSM25635     1   0.680     0.8002 0.820 0.180
#> GSM25656     1   0.827     0.7700 0.740 0.260
#> GSM25657     1   0.563     0.7965 0.868 0.132
#> GSM25658     1   0.929     0.6713 0.656 0.344
#> GSM25659     1   0.985     0.4908 0.572 0.428
#> GSM25660     1   0.697     0.8082 0.812 0.188
#> GSM25661     1   0.625     0.8028 0.844 0.156
#> GSM25662     2   0.722     0.7390 0.200 0.800
#> GSM25663     2   0.722     0.7390 0.200 0.800
#> GSM25680     2   0.767     0.6940 0.224 0.776
#> GSM25681     2   0.767     0.6940 0.224 0.776
#> GSM25682     2   0.327     0.7904 0.060 0.940
#> GSM25683     2   0.327     0.7904 0.060 0.940
#> GSM25684     2   0.343     0.8014 0.064 0.936
#> GSM25685     2   0.358     0.8021 0.068 0.932
#> GSM25686     2   0.327     0.7904 0.060 0.940
#> GSM25687     2   0.327     0.7904 0.060 0.940
#> GSM48664     1   0.311     0.6813 0.944 0.056
#> GSM48665     1   0.563     0.7845 0.868 0.132

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2   0.568     0.7103 0.212 0.764 0.024
#> GSM25549     2   0.576     0.7043 0.208 0.764 0.028
#> GSM25550     2   0.606     0.7019 0.224 0.744 0.032
#> GSM25551     2   0.482     0.7771 0.088 0.848 0.064
#> GSM25570     2   0.580     0.7030 0.212 0.760 0.028
#> GSM25571     2   0.580     0.7030 0.212 0.760 0.028
#> GSM25358     2   0.710     0.6327 0.240 0.692 0.068
#> GSM25359     2   0.710     0.6327 0.240 0.692 0.068
#> GSM25360     1   0.906     0.3329 0.452 0.412 0.136
#> GSM25361     1   0.910     0.3435 0.452 0.408 0.140
#> GSM25377     3   0.706     0.9569 0.352 0.032 0.616
#> GSM25378     2   0.858    -0.0763 0.444 0.460 0.096
#> GSM25401     2   0.718     0.6077 0.184 0.712 0.104
#> GSM25402     2   0.780     0.5318 0.216 0.664 0.120
#> GSM25349     2   0.315     0.7699 0.040 0.916 0.044
#> GSM25350     2   0.315     0.7699 0.040 0.916 0.044
#> GSM25356     2   0.651     0.6685 0.156 0.756 0.088
#> GSM25357     2   0.651     0.6685 0.156 0.756 0.088
#> GSM25385     1   0.803     0.6601 0.656 0.176 0.168
#> GSM25386     1   0.895     0.6199 0.568 0.220 0.212
#> GSM25399     3   0.678     0.9739 0.364 0.020 0.616
#> GSM25400     1   0.811     0.4725 0.624 0.264 0.112
#> GSM48659     2   0.309     0.7927 0.072 0.912 0.016
#> GSM48660     2   0.206     0.7810 0.024 0.952 0.024
#> GSM25409     2   0.475     0.7853 0.144 0.832 0.024
#> GSM25410     1   0.891     0.6224 0.572 0.220 0.208
#> GSM25426     2   0.457     0.7608 0.072 0.860 0.068
#> GSM25427     2   0.870     0.2019 0.360 0.524 0.116
#> GSM25540     2   0.635     0.6908 0.212 0.740 0.048
#> GSM25541     2   0.635     0.6908 0.212 0.740 0.048
#> GSM25542     2   0.547     0.7348 0.168 0.796 0.036
#> GSM25543     2   0.541     0.7329 0.172 0.796 0.032
#> GSM25479     1   0.560     0.6597 0.800 0.148 0.052
#> GSM25480     1   0.560     0.6597 0.800 0.148 0.052
#> GSM25481     2   0.732     0.5810 0.184 0.704 0.112
#> GSM25482     2   0.732     0.5810 0.184 0.704 0.112
#> GSM48654     2   0.344     0.7962 0.088 0.896 0.016
#> GSM48650     2   0.269     0.7707 0.032 0.932 0.036
#> GSM48651     2   0.164     0.7836 0.020 0.964 0.016
#> GSM48652     2   0.178     0.7833 0.020 0.960 0.020
#> GSM48653     2   0.205     0.7881 0.028 0.952 0.020
#> GSM48662     2   0.218     0.7885 0.032 0.948 0.020
#> GSM48663     2   0.304     0.7700 0.040 0.920 0.040
#> GSM25524     1   0.701     0.5214 0.652 0.040 0.308
#> GSM25525     1   0.589     0.6525 0.796 0.104 0.100
#> GSM25526     1   0.865     0.5367 0.556 0.320 0.124
#> GSM25527     1   0.658     0.6433 0.756 0.136 0.108
#> GSM25528     1   0.709     0.5587 0.676 0.056 0.268
#> GSM25529     1   0.596     0.6437 0.792 0.096 0.112
#> GSM25530     1   0.634     0.5307 0.716 0.032 0.252
#> GSM25531     1   0.567     0.5993 0.800 0.060 0.140
#> GSM48661     2   0.367     0.7926 0.092 0.888 0.020
#> GSM25561     1   0.876     0.6498 0.588 0.196 0.216
#> GSM25562     1   0.813     0.6510 0.632 0.244 0.124
#> GSM25563     1   0.849     0.5880 0.592 0.132 0.276
#> GSM25564     1   0.877     0.3721 0.500 0.384 0.116
#> GSM25565     2   0.420     0.7841 0.112 0.864 0.024
#> GSM25566     2   0.393     0.7955 0.092 0.880 0.028
#> GSM25568     2   0.378     0.7966 0.064 0.892 0.044
#> GSM25569     2   0.308     0.7977 0.060 0.916 0.024
#> GSM25552     2   0.614     0.6863 0.232 0.736 0.032
#> GSM25553     2   0.614     0.6863 0.232 0.736 0.032
#> GSM25578     1   0.542     0.6255 0.820 0.100 0.080
#> GSM25579     1   0.632     0.6487 0.764 0.160 0.076
#> GSM25580     1   0.604     0.5610 0.788 0.100 0.112
#> GSM25581     1   0.604     0.5610 0.788 0.100 0.112
#> GSM48655     2   0.192     0.7822 0.024 0.956 0.020
#> GSM48656     2   0.385     0.7945 0.108 0.876 0.016
#> GSM48657     2   0.256     0.7737 0.036 0.936 0.028
#> GSM48658     2   0.369     0.7909 0.100 0.884 0.016
#> GSM25624     1   0.679     0.5777 0.728 0.196 0.076
#> GSM25625     1   0.834     0.6552 0.620 0.236 0.144
#> GSM25626     1   0.891     0.6238 0.572 0.204 0.224
#> GSM25627     1   0.874     0.2758 0.464 0.428 0.108
#> GSM25628     1   0.884     0.6201 0.580 0.204 0.216
#> GSM25629     2   0.805     0.2335 0.340 0.580 0.080
#> GSM25630     1   0.769     0.4828 0.596 0.060 0.344
#> GSM25631     2   0.580     0.7095 0.212 0.760 0.028
#> GSM25632     1   0.639     0.6610 0.768 0.120 0.112
#> GSM25633     1   0.524     0.6120 0.828 0.100 0.072
#> GSM25634     1   0.625     0.6116 0.776 0.116 0.108
#> GSM25635     1   0.586     0.6010 0.796 0.120 0.084
#> GSM25656     1   0.880     0.5288 0.564 0.152 0.284
#> GSM25657     1   0.561     0.5768 0.808 0.072 0.120
#> GSM25658     1   0.823     0.6101 0.620 0.256 0.124
#> GSM25659     1   0.807     0.4898 0.564 0.360 0.076
#> GSM25660     1   0.571     0.6211 0.804 0.116 0.080
#> GSM25661     1   0.490     0.5975 0.844 0.092 0.064
#> GSM25662     2   0.544     0.7386 0.192 0.784 0.024
#> GSM25663     2   0.544     0.7386 0.192 0.784 0.024
#> GSM25680     2   0.620     0.6978 0.208 0.748 0.044
#> GSM25681     2   0.630     0.6903 0.208 0.744 0.048
#> GSM25682     2   0.231     0.7846 0.032 0.944 0.024
#> GSM25683     2   0.231     0.7846 0.032 0.944 0.024
#> GSM25684     2   0.300     0.7930 0.068 0.916 0.016
#> GSM25685     2   0.371     0.7920 0.076 0.892 0.032
#> GSM25686     2   0.231     0.7846 0.032 0.944 0.024
#> GSM25687     2   0.231     0.7846 0.032 0.944 0.024
#> GSM48664     3   0.678     0.9751 0.364 0.020 0.616
#> GSM48665     1   0.610     0.5611 0.784 0.096 0.120

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2   0.591     0.6562 0.236 0.696 0.044 0.024
#> GSM25549     2   0.617     0.6422 0.244 0.680 0.040 0.036
#> GSM25550     2   0.641     0.6408 0.244 0.668 0.044 0.044
#> GSM25551     2   0.566     0.7362 0.092 0.768 0.096 0.044
#> GSM25570     2   0.625     0.6404 0.244 0.676 0.044 0.036
#> GSM25571     2   0.625     0.6404 0.244 0.676 0.044 0.036
#> GSM25358     2   0.716     0.5851 0.228 0.616 0.132 0.024
#> GSM25359     2   0.716     0.5851 0.228 0.616 0.132 0.024
#> GSM25360     1   0.876     0.2824 0.444 0.300 0.192 0.064
#> GSM25361     1   0.877     0.2825 0.444 0.296 0.196 0.064
#> GSM25377     4   0.507     0.9213 0.308 0.012 0.004 0.676
#> GSM25378     1   0.738     0.1580 0.492 0.384 0.016 0.108
#> GSM25401     2   0.776     0.5116 0.196 0.608 0.112 0.084
#> GSM25402     2   0.804     0.4561 0.220 0.576 0.088 0.116
#> GSM25349     2   0.381     0.7213 0.016 0.864 0.048 0.072
#> GSM25350     2   0.381     0.7213 0.016 0.864 0.048 0.072
#> GSM25356     2   0.738     0.5648 0.148 0.640 0.060 0.152
#> GSM25357     2   0.738     0.5648 0.148 0.640 0.060 0.152
#> GSM25385     1   0.764     0.2219 0.536 0.108 0.320 0.036
#> GSM25386     1   0.758     0.0645 0.432 0.136 0.420 0.012
#> GSM25399     4   0.443     0.9464 0.304 0.000 0.000 0.696
#> GSM25400     1   0.665     0.4759 0.676 0.192 0.032 0.100
#> GSM48659     2   0.366     0.7604 0.064 0.872 0.048 0.016
#> GSM48660     2   0.247     0.7451 0.008 0.920 0.016 0.056
#> GSM25409     2   0.524     0.7494 0.144 0.776 0.024 0.056
#> GSM25410     1   0.751     0.0819 0.436 0.140 0.416 0.008
#> GSM25426     2   0.568     0.7209 0.076 0.768 0.104 0.052
#> GSM25427     2   0.811     0.0658 0.392 0.432 0.036 0.140
#> GSM25540     2   0.647     0.6433 0.204 0.668 0.116 0.012
#> GSM25541     2   0.647     0.6433 0.204 0.668 0.116 0.012
#> GSM25542     2   0.599     0.7018 0.148 0.732 0.092 0.028
#> GSM25543     2   0.607     0.6989 0.152 0.728 0.088 0.032
#> GSM25479     1   0.473     0.5964 0.824 0.064 0.044 0.068
#> GSM25480     1   0.473     0.5964 0.824 0.064 0.044 0.068
#> GSM25481     2   0.727     0.5142 0.216 0.624 0.040 0.120
#> GSM25482     2   0.727     0.5142 0.216 0.624 0.040 0.120
#> GSM48654     2   0.374     0.7631 0.076 0.868 0.028 0.028
#> GSM48650     2   0.289     0.7306 0.008 0.900 0.020 0.072
#> GSM48651     2   0.195     0.7509 0.012 0.940 0.004 0.044
#> GSM48652     2   0.197     0.7491 0.008 0.940 0.008 0.044
#> GSM48653     2   0.262     0.7555 0.016 0.920 0.028 0.036
#> GSM48662     2   0.293     0.7544 0.024 0.908 0.028 0.040
#> GSM48663     2   0.390     0.7214 0.020 0.860 0.044 0.076
#> GSM25524     1   0.669     0.0666 0.532 0.004 0.384 0.080
#> GSM25525     1   0.512     0.5476 0.780 0.032 0.152 0.036
#> GSM25526     1   0.784     0.4529 0.580 0.236 0.120 0.064
#> GSM25527     1   0.503     0.5956 0.808 0.068 0.048 0.076
#> GSM25528     1   0.647     0.1707 0.576 0.004 0.348 0.072
#> GSM25529     1   0.455     0.5520 0.808 0.024 0.144 0.024
#> GSM25530     1   0.657     0.2364 0.604 0.000 0.280 0.116
#> GSM25531     1   0.559     0.4703 0.740 0.012 0.172 0.076
#> GSM48661     2   0.388     0.7573 0.096 0.852 0.044 0.008
#> GSM25561     1   0.775     0.2457 0.552 0.076 0.300 0.072
#> GSM25562     1   0.696     0.5282 0.680 0.140 0.112 0.068
#> GSM25563     3   0.734    -0.1549 0.440 0.052 0.460 0.048
#> GSM25564     1   0.839     0.3765 0.500 0.288 0.148 0.064
#> GSM25565     2   0.470     0.7495 0.116 0.812 0.052 0.020
#> GSM25566     2   0.425     0.7624 0.104 0.836 0.044 0.016
#> GSM25568     2   0.579     0.7452 0.092 0.764 0.084 0.060
#> GSM25569     2   0.509     0.7581 0.084 0.804 0.060 0.052
#> GSM25552     2   0.667     0.6175 0.260 0.644 0.048 0.048
#> GSM25553     2   0.667     0.6175 0.260 0.644 0.048 0.048
#> GSM25578     1   0.393     0.5861 0.864 0.040 0.056 0.040
#> GSM25579     1   0.506     0.5982 0.804 0.092 0.056 0.048
#> GSM25580     1   0.333     0.5702 0.876 0.032 0.004 0.088
#> GSM25581     1   0.333     0.5702 0.876 0.032 0.004 0.088
#> GSM48655     2   0.222     0.7465 0.008 0.928 0.008 0.056
#> GSM48656     2   0.403     0.7614 0.100 0.848 0.032 0.020
#> GSM48657     2   0.295     0.7330 0.012 0.900 0.020 0.068
#> GSM48658     2   0.402     0.7553 0.104 0.840 0.052 0.004
#> GSM25624     1   0.498     0.5622 0.792 0.128 0.016 0.064
#> GSM25625     1   0.746     0.4817 0.608 0.160 0.196 0.036
#> GSM25626     1   0.767     0.0782 0.440 0.124 0.416 0.020
#> GSM25627     1   0.830     0.3286 0.480 0.332 0.128 0.060
#> GSM25628     1   0.744     0.0415 0.436 0.120 0.432 0.012
#> GSM25629     2   0.802     0.1956 0.344 0.492 0.116 0.048
#> GSM25630     3   0.491     0.4352 0.116 0.012 0.796 0.076
#> GSM25631     2   0.638     0.6534 0.236 0.672 0.064 0.028
#> GSM25632     1   0.552     0.5390 0.756 0.036 0.164 0.044
#> GSM25633     1   0.347     0.5813 0.884 0.024 0.040 0.052
#> GSM25634     1   0.374     0.5812 0.864 0.028 0.020 0.088
#> GSM25635     1   0.346     0.5887 0.880 0.048 0.012 0.060
#> GSM25656     3   0.649     0.4139 0.092 0.088 0.720 0.100
#> GSM25657     1   0.448     0.5671 0.828 0.020 0.056 0.096
#> GSM25658     1   0.755     0.5112 0.628 0.180 0.116 0.076
#> GSM25659     1   0.753     0.4529 0.588 0.260 0.104 0.048
#> GSM25660     1   0.416     0.5987 0.852 0.052 0.032 0.064
#> GSM25661     1   0.319     0.5810 0.896 0.024 0.028 0.052
#> GSM25662     2   0.565     0.7110 0.188 0.736 0.052 0.024
#> GSM25663     2   0.565     0.7110 0.188 0.736 0.052 0.024
#> GSM25680     2   0.678     0.6384 0.228 0.656 0.072 0.044
#> GSM25681     2   0.699     0.6192 0.236 0.640 0.072 0.052
#> GSM25682     2   0.255     0.7487 0.016 0.916 0.008 0.060
#> GSM25683     2   0.255     0.7487 0.016 0.916 0.008 0.060
#> GSM25684     2   0.358     0.7607 0.060 0.876 0.048 0.016
#> GSM25685     2   0.431     0.7595 0.068 0.840 0.072 0.020
#> GSM25686     2   0.255     0.7487 0.016 0.916 0.008 0.060
#> GSM25687     2   0.255     0.7487 0.016 0.916 0.008 0.060
#> GSM48664     4   0.450     0.9510 0.316 0.000 0.000 0.684
#> GSM48665     1   0.389     0.5739 0.852 0.036 0.012 0.100

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     2   0.614     0.6144 0.188 0.656 0.080 0.076 0.000
#> GSM25549     2   0.636     0.5981 0.196 0.636 0.084 0.084 0.000
#> GSM25550     2   0.652     0.5951 0.192 0.624 0.080 0.104 0.000
#> GSM25551     2   0.556     0.7011 0.068 0.740 0.108 0.068 0.016
#> GSM25570     2   0.641     0.5957 0.196 0.632 0.084 0.088 0.000
#> GSM25571     2   0.641     0.5957 0.196 0.632 0.084 0.088 0.000
#> GSM25358     2   0.682     0.5158 0.164 0.592 0.188 0.052 0.004
#> GSM25359     2   0.682     0.5158 0.164 0.592 0.188 0.052 0.004
#> GSM25360     1   0.848    -0.1209 0.348 0.264 0.268 0.108 0.012
#> GSM25361     1   0.848    -0.1228 0.348 0.260 0.272 0.108 0.012
#> GSM25377     5   0.480     0.8716 0.244 0.012 0.000 0.040 0.704
#> GSM25378     1   0.742     0.1855 0.484 0.340 0.020 0.084 0.072
#> GSM25401     2   0.807     0.4245 0.180 0.520 0.096 0.164 0.040
#> GSM25402     2   0.831     0.3610 0.208 0.484 0.068 0.180 0.060
#> GSM25349     2   0.379     0.6441 0.004 0.784 0.008 0.196 0.008
#> GSM25350     2   0.379     0.6441 0.004 0.784 0.008 0.196 0.008
#> GSM25356     2   0.677     0.4250 0.072 0.536 0.008 0.328 0.056
#> GSM25357     2   0.677     0.4250 0.072 0.536 0.008 0.328 0.056
#> GSM25385     3   0.670     0.4872 0.416 0.104 0.452 0.012 0.016
#> GSM25386     3   0.628     0.6338 0.304 0.132 0.552 0.012 0.000
#> GSM25399     5   0.378     0.8865 0.236 0.000 0.000 0.012 0.752
#> GSM25400     1   0.671     0.4019 0.648 0.176 0.052 0.044 0.080
#> GSM48659     2   0.301     0.7222 0.028 0.880 0.068 0.024 0.000
#> GSM48660     2   0.207     0.7006 0.000 0.896 0.000 0.104 0.000
#> GSM25409     2   0.526     0.7149 0.104 0.748 0.036 0.104 0.008
#> GSM25410     3   0.655     0.6246 0.304 0.136 0.540 0.016 0.004
#> GSM25426     2   0.554     0.6839 0.052 0.740 0.120 0.068 0.020
#> GSM25427     2   0.803     0.0118 0.376 0.384 0.020 0.136 0.084
#> GSM25540     2   0.599     0.6159 0.136 0.656 0.176 0.032 0.000
#> GSM25541     2   0.599     0.6159 0.136 0.656 0.176 0.032 0.000
#> GSM25542     2   0.559     0.6653 0.100 0.716 0.120 0.064 0.000
#> GSM25543     2   0.565     0.6611 0.100 0.712 0.120 0.068 0.000
#> GSM25479     1   0.440     0.5344 0.824 0.044 0.040 0.052 0.040
#> GSM25480     1   0.440     0.5344 0.824 0.044 0.040 0.052 0.040
#> GSM25481     2   0.726     0.4372 0.200 0.540 0.000 0.176 0.084
#> GSM25482     2   0.726     0.4372 0.200 0.540 0.000 0.176 0.084
#> GSM48654     2   0.324     0.7244 0.032 0.872 0.044 0.052 0.000
#> GSM48650     2   0.289     0.6676 0.000 0.836 0.000 0.160 0.004
#> GSM48651     2   0.205     0.7081 0.004 0.912 0.004 0.080 0.000
#> GSM48652     2   0.173     0.7062 0.000 0.920 0.000 0.080 0.000
#> GSM48653     2   0.243     0.7120 0.004 0.900 0.020 0.076 0.000
#> GSM48662     2   0.284     0.7103 0.012 0.880 0.020 0.088 0.000
#> GSM48663     2   0.355     0.6366 0.000 0.772 0.000 0.220 0.008
#> GSM25524     3   0.672     0.2778 0.404 0.000 0.464 0.064 0.068
#> GSM25525     1   0.491     0.4497 0.764 0.020 0.152 0.036 0.028
#> GSM25526     1   0.772     0.2450 0.528 0.216 0.168 0.044 0.044
#> GSM25527     1   0.470     0.5273 0.804 0.044 0.072 0.028 0.052
#> GSM25528     1   0.662    -0.2779 0.464 0.000 0.412 0.056 0.068
#> GSM25529     1   0.443     0.4701 0.800 0.016 0.124 0.024 0.036
#> GSM25530     1   0.705    -0.1605 0.480 0.000 0.332 0.044 0.144
#> GSM25531     1   0.624     0.2151 0.632 0.008 0.240 0.044 0.076
#> GSM48661     2   0.357     0.7210 0.052 0.848 0.080 0.020 0.000
#> GSM25561     1   0.769    -0.2466 0.464 0.060 0.348 0.084 0.044
#> GSM25562     1   0.714     0.3474 0.624 0.104 0.124 0.116 0.032
#> GSM25563     3   0.714     0.5109 0.332 0.032 0.512 0.092 0.032
#> GSM25564     1   0.821     0.1496 0.444 0.260 0.168 0.112 0.016
#> GSM25565     2   0.445     0.7168 0.064 0.800 0.084 0.052 0.000
#> GSM25566     2   0.421     0.7297 0.064 0.816 0.072 0.048 0.000
#> GSM25568     2   0.564     0.6781 0.044 0.724 0.064 0.148 0.020
#> GSM25569     2   0.499     0.6999 0.036 0.760 0.056 0.140 0.008
#> GSM25552     2   0.667     0.5709 0.216 0.600 0.076 0.108 0.000
#> GSM25553     2   0.667     0.5709 0.216 0.600 0.076 0.108 0.000
#> GSM25578     1   0.319     0.5329 0.884 0.028 0.040 0.016 0.032
#> GSM25579     1   0.442     0.5283 0.820 0.072 0.040 0.036 0.032
#> GSM25580     1   0.259     0.5438 0.900 0.020 0.004 0.008 0.068
#> GSM25581     1   0.259     0.5438 0.900 0.020 0.004 0.008 0.068
#> GSM48655     2   0.218     0.6994 0.000 0.896 0.000 0.100 0.004
#> GSM48656     2   0.371     0.7272 0.056 0.844 0.068 0.032 0.000
#> GSM48657     2   0.301     0.6666 0.000 0.836 0.004 0.156 0.004
#> GSM48658     2   0.372     0.7202 0.060 0.836 0.088 0.016 0.000
#> GSM25624     1   0.496     0.4949 0.776 0.120 0.036 0.024 0.044
#> GSM25625     1   0.696     0.1564 0.556 0.160 0.244 0.024 0.016
#> GSM25626     3   0.639     0.6269 0.316 0.124 0.544 0.004 0.012
#> GSM25627     1   0.807     0.1033 0.420 0.324 0.172 0.044 0.040
#> GSM25628     3   0.640     0.6355 0.312 0.116 0.552 0.016 0.004
#> GSM25629     2   0.756     0.2171 0.288 0.488 0.160 0.044 0.020
#> GSM25630     3   0.590    -0.5071 0.056 0.000 0.660 0.216 0.068
#> GSM25631     2   0.644     0.6149 0.180 0.632 0.120 0.068 0.000
#> GSM25632     1   0.522     0.3753 0.704 0.024 0.228 0.028 0.016
#> GSM25633     1   0.335     0.5347 0.872 0.020 0.064 0.016 0.028
#> GSM25634     1   0.374     0.5299 0.852 0.016 0.048 0.020 0.064
#> GSM25635     1   0.295     0.5474 0.892 0.032 0.020 0.008 0.048
#> GSM25656     4   0.764     0.0000 0.040 0.056 0.304 0.500 0.100
#> GSM25657     1   0.409     0.5250 0.824 0.016 0.052 0.012 0.096
#> GSM25658     1   0.746     0.3429 0.584 0.160 0.152 0.056 0.048
#> GSM25659     1   0.728     0.2671 0.556 0.240 0.120 0.068 0.016
#> GSM25660     1   0.318     0.5520 0.884 0.032 0.036 0.012 0.036
#> GSM25661     1   0.228     0.5399 0.920 0.012 0.020 0.004 0.044
#> GSM25662     2   0.526     0.6805 0.144 0.732 0.080 0.044 0.000
#> GSM25663     2   0.526     0.6805 0.144 0.732 0.080 0.044 0.000
#> GSM25680     2   0.665     0.5888 0.184 0.616 0.108 0.092 0.000
#> GSM25681     2   0.679     0.5678 0.192 0.600 0.112 0.096 0.000
#> GSM25682     2   0.257     0.7028 0.008 0.880 0.000 0.108 0.004
#> GSM25683     2   0.257     0.7028 0.008 0.880 0.000 0.108 0.004
#> GSM25684     2   0.283     0.7212 0.020 0.888 0.068 0.024 0.000
#> GSM25685     2   0.340     0.7196 0.024 0.848 0.108 0.020 0.000
#> GSM25686     2   0.257     0.7028 0.008 0.880 0.000 0.108 0.004
#> GSM25687     2   0.257     0.7028 0.008 0.880 0.000 0.108 0.004
#> GSM48664     5   0.393     0.9015 0.276 0.000 0.000 0.008 0.716
#> GSM48665     1   0.322     0.5442 0.864 0.024 0.008 0.008 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
#> GSM25548     5   0.604    0.45381 0.152 0.140 0.072 0.000 0.628 0.008
#> GSM25549     5   0.615    0.44485 0.156 0.144 0.076 0.000 0.616 0.008
#> GSM25550     5   0.648    0.42574 0.156 0.184 0.072 0.000 0.576 0.012
#> GSM25551     5   0.482    0.42418 0.036 0.100 0.104 0.008 0.748 0.004
#> GSM25570     5   0.618    0.44191 0.156 0.148 0.076 0.000 0.612 0.008
#> GSM25571     5   0.618    0.44191 0.156 0.148 0.076 0.000 0.612 0.008
#> GSM25358     5   0.623    0.35751 0.072 0.092 0.256 0.000 0.572 0.008
#> GSM25359     5   0.623    0.35751 0.072 0.092 0.256 0.000 0.572 0.008
#> GSM25360     3   0.843    0.22439 0.264 0.136 0.280 0.016 0.272 0.032
#> GSM25361     3   0.847    0.22582 0.264 0.136 0.280 0.016 0.268 0.036
#> GSM25377     4   0.417    0.82924 0.168 0.072 0.000 0.752 0.004 0.004
#> GSM25378     1   0.694   -0.01148 0.488 0.180 0.016 0.048 0.264 0.004
#> GSM25401     5   0.793   -0.58095 0.140 0.276 0.104 0.060 0.416 0.004
#> GSM25402     5   0.816   -0.63167 0.172 0.292 0.068 0.076 0.380 0.012
#> GSM25349     5   0.400   -0.14455 0.004 0.328 0.000 0.000 0.656 0.012
#> GSM25350     5   0.400   -0.14455 0.004 0.328 0.000 0.000 0.656 0.012
#> GSM25356     2   0.615    1.00000 0.052 0.496 0.008 0.040 0.388 0.016
#> GSM25357     2   0.615    1.00000 0.052 0.496 0.008 0.040 0.388 0.016
#> GSM25385     3   0.590    0.49140 0.268 0.016 0.584 0.020 0.112 0.000
#> GSM25386     3   0.484    0.55121 0.164 0.008 0.688 0.000 0.140 0.000
#> GSM25399     4   0.296    0.81645 0.132 0.020 0.008 0.840 0.000 0.000
#> GSM25400     1   0.662    0.46963 0.624 0.084 0.048 0.092 0.144 0.008
#> GSM48659     5   0.250    0.49926 0.016 0.044 0.032 0.000 0.900 0.008
#> GSM48660     5   0.270    0.31721 0.000 0.188 0.000 0.000 0.812 0.000
#> GSM25409     5   0.497    0.47221 0.072 0.180 0.024 0.004 0.712 0.008
#> GSM25410     3   0.514    0.54998 0.168 0.012 0.672 0.000 0.144 0.004
#> GSM25426     5   0.475    0.38202 0.020 0.100 0.116 0.012 0.748 0.004
#> GSM25427     1   0.748   -0.35931 0.376 0.252 0.016 0.056 0.292 0.008
#> GSM25540     5   0.549    0.48122 0.080 0.088 0.148 0.000 0.680 0.004
#> GSM25541     5   0.549    0.48122 0.080 0.088 0.148 0.000 0.680 0.004
#> GSM25542     5   0.515    0.47217 0.068 0.108 0.096 0.000 0.720 0.008
#> GSM25543     5   0.519    0.47129 0.068 0.112 0.096 0.000 0.716 0.008
#> GSM25479     1   0.404    0.60780 0.828 0.044 0.040 0.036 0.040 0.012
#> GSM25480     1   0.404    0.60780 0.828 0.044 0.040 0.036 0.040 0.012
#> GSM25481     5   0.703   -0.67471 0.184 0.320 0.004 0.076 0.416 0.000
#> GSM25482     5   0.703   -0.67471 0.184 0.320 0.004 0.076 0.416 0.000
#> GSM48654     5   0.266    0.47732 0.016 0.076 0.012 0.000 0.884 0.012
#> GSM48650     5   0.324    0.09941 0.000 0.268 0.000 0.000 0.732 0.000
#> GSM48651     5   0.252    0.36928 0.000 0.152 0.004 0.000 0.844 0.000
#> GSM48652     5   0.242    0.36351 0.000 0.156 0.000 0.000 0.844 0.000
#> GSM48653     5   0.250    0.39946 0.000 0.116 0.004 0.000 0.868 0.012
#> GSM48662     5   0.267    0.37861 0.008 0.156 0.000 0.000 0.836 0.000
#> GSM48663     5   0.367   -0.23106 0.000 0.368 0.000 0.000 0.632 0.000
#> GSM25524     3   0.703    0.37722 0.224 0.092 0.548 0.048 0.004 0.084
#> GSM25525     1   0.467    0.54197 0.748 0.020 0.168 0.032 0.012 0.020
#> GSM25526     1   0.790    0.17149 0.440 0.080 0.196 0.056 0.220 0.008
#> GSM25527     1   0.441    0.60368 0.800 0.028 0.064 0.060 0.040 0.008
#> GSM25528     3   0.697    0.29283 0.320 0.076 0.484 0.052 0.000 0.068
#> GSM25529     1   0.435    0.56113 0.784 0.016 0.128 0.040 0.012 0.020
#> GSM25530     3   0.777    0.23947 0.324 0.068 0.392 0.152 0.004 0.060
#> GSM25531     1   0.721    0.00937 0.484 0.068 0.300 0.108 0.016 0.024
#> GSM48661     5   0.271    0.51259 0.020 0.052 0.032 0.000 0.888 0.008
#> GSM25561     1   0.787   -0.14880 0.396 0.068 0.344 0.036 0.036 0.120
#> GSM25562     1   0.727    0.40882 0.588 0.096 0.132 0.032 0.092 0.060
#> GSM25563     3   0.688    0.43437 0.224 0.036 0.560 0.016 0.040 0.124
#> GSM25564     1   0.805    0.13282 0.424 0.116 0.128 0.016 0.268 0.048
#> GSM25565     5   0.361    0.52236 0.040 0.092 0.036 0.000 0.828 0.004
#> GSM25566     5   0.382    0.51058 0.044 0.084 0.044 0.000 0.820 0.008
#> GSM25568     5   0.555    0.33554 0.028 0.244 0.032 0.004 0.648 0.044
#> GSM25569     5   0.480    0.40850 0.024 0.232 0.024 0.000 0.696 0.024
#> GSM25552     5   0.650    0.40780 0.172 0.176 0.068 0.000 0.572 0.012
#> GSM25553     5   0.650    0.40780 0.172 0.176 0.068 0.000 0.572 0.012
#> GSM25578     1   0.275    0.61151 0.892 0.012 0.044 0.028 0.020 0.004
#> GSM25579     1   0.401    0.59378 0.820 0.028 0.052 0.024 0.072 0.004
#> GSM25580     1   0.226    0.62151 0.908 0.020 0.008 0.056 0.008 0.000
#> GSM25581     1   0.226    0.62151 0.908 0.020 0.008 0.056 0.008 0.000
#> GSM48655     5   0.270    0.31024 0.000 0.188 0.000 0.000 0.812 0.000
#> GSM48656     5   0.279    0.51311 0.028 0.064 0.024 0.000 0.880 0.004
#> GSM48657     5   0.329    0.08024 0.000 0.276 0.000 0.000 0.724 0.000
#> GSM48658     5   0.290    0.51487 0.028 0.056 0.036 0.000 0.876 0.004
#> GSM25624     1   0.490    0.56757 0.760 0.056 0.032 0.048 0.100 0.004
#> GSM25625     1   0.675    0.23131 0.504 0.040 0.276 0.024 0.156 0.000
#> GSM25626     3   0.503    0.55384 0.176 0.000 0.672 0.012 0.140 0.000
#> GSM25627     5   0.793   -0.20472 0.332 0.080 0.208 0.044 0.332 0.004
#> GSM25628     3   0.549    0.54470 0.168 0.016 0.664 0.000 0.132 0.020
#> GSM25629     5   0.702    0.19168 0.212 0.076 0.188 0.012 0.508 0.004
#> GSM25630     3   0.694   -0.38670 0.024 0.196 0.504 0.040 0.004 0.232
#> GSM25631     5   0.608    0.47076 0.144 0.136 0.076 0.000 0.632 0.012
#> GSM25632     1   0.584    0.30822 0.604 0.044 0.284 0.024 0.008 0.036
#> GSM25633     1   0.382    0.60929 0.840 0.036 0.044 0.044 0.012 0.024
#> GSM25634     1   0.399    0.60429 0.820 0.020 0.044 0.084 0.008 0.024
#> GSM25635     1   0.277    0.62391 0.892 0.020 0.020 0.044 0.020 0.004
#> GSM25656     6   0.387    0.00000 0.008 0.032 0.100 0.000 0.048 0.812
#> GSM25657     1   0.408    0.59992 0.804 0.024 0.052 0.104 0.008 0.008
#> GSM25658     1   0.753    0.35243 0.532 0.096 0.128 0.060 0.172 0.012
#> GSM25659     1   0.717    0.26758 0.536 0.088 0.092 0.016 0.236 0.032
#> GSM25660     1   0.309    0.62920 0.876 0.024 0.040 0.036 0.020 0.004
#> GSM25661     1   0.245    0.62121 0.904 0.008 0.020 0.052 0.008 0.008
#> GSM25662     5   0.483    0.50809 0.116 0.100 0.044 0.000 0.736 0.004
#> GSM25663     5   0.483    0.50809 0.116 0.100 0.044 0.000 0.736 0.004
#> GSM25680     5   0.629    0.44937 0.144 0.140 0.084 0.000 0.616 0.016
#> GSM25681     5   0.655    0.42691 0.152 0.144 0.092 0.000 0.592 0.020
#> GSM25682     5   0.284    0.32806 0.004 0.188 0.000 0.000 0.808 0.000
#> GSM25683     5   0.284    0.32806 0.004 0.188 0.000 0.000 0.808 0.000
#> GSM25684     5   0.230    0.49643 0.008 0.044 0.032 0.000 0.908 0.008
#> GSM25685     5   0.298    0.48175 0.012 0.044 0.068 0.000 0.868 0.008
#> GSM25686     5   0.284    0.32806 0.004 0.188 0.000 0.000 0.808 0.000
#> GSM25687     5   0.284    0.32806 0.004 0.188 0.000 0.000 0.808 0.000
#> GSM48664     4   0.311    0.85932 0.196 0.012 0.000 0.792 0.000 0.000
#> GSM48665     1   0.298    0.62402 0.868 0.024 0.016 0.080 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-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 genotype/variation(p) k
#> MAD:hclust 92              6.92e-05 2
#> MAD:hclust 90              2.73e-04 3
#> MAD:hclust 75              2.36e-03 4
#> MAD:hclust 69              2.86e-03 5
#> MAD:hclust 33              9.63e-03 6

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


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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.840           0.891       0.955         0.5042 0.496   0.496
#> 3 3 0.623           0.760       0.828         0.2632 0.847   0.697
#> 4 4 0.549           0.703       0.742         0.1256 0.936   0.825
#> 5 5 0.607           0.592       0.703         0.0758 0.902   0.685
#> 6 6 0.616           0.552       0.715         0.0448 0.983   0.922

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
#> GSM25548     2  0.0000     0.9580 0.000 1.000
#> GSM25549     2  0.0000     0.9580 0.000 1.000
#> GSM25550     2  0.0000     0.9580 0.000 1.000
#> GSM25551     2  0.0000     0.9580 0.000 1.000
#> GSM25570     2  0.0000     0.9580 0.000 1.000
#> GSM25571     2  0.0000     0.9580 0.000 1.000
#> GSM25358     1  0.2423     0.9227 0.960 0.040
#> GSM25359     2  0.6887     0.7595 0.184 0.816
#> GSM25360     1  0.0000     0.9444 1.000 0.000
#> GSM25361     1  0.9608     0.3550 0.616 0.384
#> GSM25377     1  0.0376     0.9446 0.996 0.004
#> GSM25378     1  0.2043     0.9270 0.968 0.032
#> GSM25401     1  0.5737     0.8290 0.864 0.136
#> GSM25402     1  0.4562     0.8713 0.904 0.096
#> GSM25349     2  0.0000     0.9580 0.000 1.000
#> GSM25350     2  0.0000     0.9580 0.000 1.000
#> GSM25356     1  0.4298     0.8791 0.912 0.088
#> GSM25357     2  0.0376     0.9553 0.004 0.996
#> GSM25385     1  0.0000     0.9444 1.000 0.000
#> GSM25386     1  0.0000     0.9444 1.000 0.000
#> GSM25399     1  0.0376     0.9446 0.996 0.004
#> GSM25400     1  0.0376     0.9446 0.996 0.004
#> GSM48659     2  0.0376     0.9568 0.004 0.996
#> GSM48660     2  0.0000     0.9580 0.000 1.000
#> GSM25409     2  0.0000     0.9580 0.000 1.000
#> GSM25410     1  0.0000     0.9444 1.000 0.000
#> GSM25426     2  0.0376     0.9568 0.004 0.996
#> GSM25427     1  0.2043     0.9270 0.968 0.032
#> GSM25540     2  0.9286     0.4882 0.344 0.656
#> GSM25541     2  0.9970     0.1344 0.468 0.532
#> GSM25542     2  0.0376     0.9568 0.004 0.996
#> GSM25543     2  0.0376     0.9568 0.004 0.996
#> GSM25479     1  0.0376     0.9446 0.996 0.004
#> GSM25480     1  0.0376     0.9446 0.996 0.004
#> GSM25481     1  0.8555     0.6283 0.720 0.280
#> GSM25482     1  0.8555     0.6283 0.720 0.280
#> GSM48654     2  0.0376     0.9568 0.004 0.996
#> GSM48650     2  0.0000     0.9580 0.000 1.000
#> GSM48651     2  0.0000     0.9580 0.000 1.000
#> GSM48652     2  0.0376     0.9568 0.004 0.996
#> GSM48653     2  0.0376     0.9568 0.004 0.996
#> GSM48662     2  0.0000     0.9580 0.000 1.000
#> GSM48663     2  0.0000     0.9580 0.000 1.000
#> GSM25524     1  0.0000     0.9444 1.000 0.000
#> GSM25525     1  0.0376     0.9446 0.996 0.004
#> GSM25526     1  0.0000     0.9444 1.000 0.000
#> GSM25527     1  0.0376     0.9446 0.996 0.004
#> GSM25528     1  0.0000     0.9444 1.000 0.000
#> GSM25529     1  0.0000     0.9444 1.000 0.000
#> GSM25530     1  0.0000     0.9444 1.000 0.000
#> GSM25531     1  0.0000     0.9444 1.000 0.000
#> GSM48661     2  0.0376     0.9568 0.004 0.996
#> GSM25561     1  0.0000     0.9444 1.000 0.000
#> GSM25562     1  0.0376     0.9446 0.996 0.004
#> GSM25563     1  0.0000     0.9444 1.000 0.000
#> GSM25564     1  0.8909     0.5805 0.692 0.308
#> GSM25565     2  0.0000     0.9580 0.000 1.000
#> GSM25566     2  0.0000     0.9580 0.000 1.000
#> GSM25568     2  0.9170     0.4629 0.332 0.668
#> GSM25569     2  0.0000     0.9580 0.000 1.000
#> GSM25552     2  0.0000     0.9580 0.000 1.000
#> GSM25553     2  0.0000     0.9580 0.000 1.000
#> GSM25578     1  0.0376     0.9446 0.996 0.004
#> GSM25579     1  0.0376     0.9446 0.996 0.004
#> GSM25580     1  0.0376     0.9446 0.996 0.004
#> GSM25581     1  0.0376     0.9446 0.996 0.004
#> GSM48655     2  0.0000     0.9580 0.000 1.000
#> GSM48656     2  0.0000     0.9580 0.000 1.000
#> GSM48657     2  0.0000     0.9580 0.000 1.000
#> GSM48658     2  0.0376     0.9568 0.004 0.996
#> GSM25624     1  0.0376     0.9446 0.996 0.004
#> GSM25625     1  0.0000     0.9444 1.000 0.000
#> GSM25626     1  0.0000     0.9444 1.000 0.000
#> GSM25627     1  0.2603     0.9153 0.956 0.044
#> GSM25628     1  0.9460     0.4067 0.636 0.364
#> GSM25629     2  0.9000     0.5471 0.316 0.684
#> GSM25630     1  0.0000     0.9444 1.000 0.000
#> GSM25631     2  0.5737     0.8253 0.136 0.864
#> GSM25632     1  0.0000     0.9444 1.000 0.000
#> GSM25633     1  0.0376     0.9446 0.996 0.004
#> GSM25634     1  0.0376     0.9446 0.996 0.004
#> GSM25635     1  0.0376     0.9446 0.996 0.004
#> GSM25656     1  1.0000    -0.0317 0.504 0.496
#> GSM25657     1  0.0000     0.9444 1.000 0.000
#> GSM25658     1  0.0000     0.9444 1.000 0.000
#> GSM25659     1  0.0000     0.9444 1.000 0.000
#> GSM25660     1  0.0376     0.9446 0.996 0.004
#> GSM25661     1  0.0376     0.9446 0.996 0.004
#> GSM25662     2  0.0376     0.9568 0.004 0.996
#> GSM25663     2  0.0376     0.9568 0.004 0.996
#> GSM25680     2  0.0376     0.9568 0.004 0.996
#> GSM25681     2  0.0000     0.9580 0.000 1.000
#> GSM25682     2  0.0000     0.9580 0.000 1.000
#> GSM25683     2  0.0000     0.9580 0.000 1.000
#> GSM25684     2  0.0376     0.9568 0.004 0.996
#> GSM25685     2  0.0376     0.9568 0.004 0.996
#> GSM25686     2  0.0000     0.9580 0.000 1.000
#> GSM25687     2  0.0000     0.9580 0.000 1.000
#> GSM48664     1  0.0376     0.9446 0.996 0.004
#> GSM48665     1  0.0376     0.9446 0.996 0.004

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.2711      0.927 0.000 0.912 0.088
#> GSM25549     2  0.2796      0.926 0.000 0.908 0.092
#> GSM25550     2  0.2537      0.928 0.000 0.920 0.080
#> GSM25551     2  0.1860      0.936 0.000 0.948 0.052
#> GSM25570     2  0.2711      0.927 0.000 0.912 0.088
#> GSM25571     2  0.2711      0.927 0.000 0.912 0.088
#> GSM25358     1  0.7015      0.604 0.696 0.064 0.240
#> GSM25359     2  0.6882      0.719 0.096 0.732 0.172
#> GSM25360     3  0.6282      0.849 0.384 0.004 0.612
#> GSM25361     3  0.7637      0.777 0.284 0.076 0.640
#> GSM25377     1  0.5291      0.651 0.732 0.000 0.268
#> GSM25378     1  0.5797      0.639 0.712 0.008 0.280
#> GSM25401     1  0.7178      0.508 0.512 0.024 0.464
#> GSM25402     1  0.6950      0.565 0.572 0.020 0.408
#> GSM25349     2  0.2448      0.934 0.000 0.924 0.076
#> GSM25350     2  0.2356      0.935 0.000 0.928 0.072
#> GSM25356     1  0.6284      0.619 0.680 0.016 0.304
#> GSM25357     2  0.3340      0.912 0.000 0.880 0.120
#> GSM25385     3  0.6291      0.793 0.468 0.000 0.532
#> GSM25386     3  0.6330      0.854 0.396 0.004 0.600
#> GSM25399     1  0.5216      0.654 0.740 0.000 0.260
#> GSM25400     1  0.5216      0.654 0.740 0.000 0.260
#> GSM48659     2  0.2261      0.933 0.000 0.932 0.068
#> GSM48660     2  0.1753      0.932 0.000 0.952 0.048
#> GSM25409     2  0.2261      0.933 0.000 0.932 0.068
#> GSM25410     3  0.6359      0.853 0.404 0.004 0.592
#> GSM25426     2  0.1860      0.939 0.000 0.948 0.052
#> GSM25427     1  0.5797      0.639 0.712 0.008 0.280
#> GSM25540     3  0.7810      0.760 0.268 0.092 0.640
#> GSM25541     3  0.7637      0.780 0.284 0.076 0.640
#> GSM25542     2  0.3192      0.912 0.000 0.888 0.112
#> GSM25543     2  0.3941      0.875 0.000 0.844 0.156
#> GSM25479     1  0.0747      0.691 0.984 0.000 0.016
#> GSM25480     1  0.0747      0.691 0.984 0.000 0.016
#> GSM25481     1  0.6823      0.610 0.668 0.036 0.296
#> GSM25482     1  0.6823      0.610 0.668 0.036 0.296
#> GSM48654     2  0.2356      0.932 0.000 0.928 0.072
#> GSM48650     2  0.2066      0.930 0.000 0.940 0.060
#> GSM48651     2  0.1753      0.936 0.000 0.952 0.048
#> GSM48652     2  0.2261      0.933 0.000 0.932 0.068
#> GSM48653     2  0.2448      0.931 0.000 0.924 0.076
#> GSM48662     2  0.1643      0.935 0.000 0.956 0.044
#> GSM48663     2  0.1860      0.931 0.000 0.948 0.052
#> GSM25524     3  0.6260      0.832 0.448 0.000 0.552
#> GSM25525     1  0.3412      0.558 0.876 0.000 0.124
#> GSM25526     3  0.6260      0.828 0.448 0.000 0.552
#> GSM25527     1  0.2261      0.638 0.932 0.000 0.068
#> GSM25528     1  0.6026     -0.419 0.624 0.000 0.376
#> GSM25529     1  0.3482      0.551 0.872 0.000 0.128
#> GSM25530     1  0.6295     -0.693 0.528 0.000 0.472
#> GSM25531     1  0.3192      0.575 0.888 0.000 0.112
#> GSM48661     2  0.2537      0.930 0.000 0.920 0.080
#> GSM25561     3  0.6308      0.765 0.492 0.000 0.508
#> GSM25562     1  0.2066      0.658 0.940 0.000 0.060
#> GSM25563     3  0.6168      0.852 0.412 0.000 0.588
#> GSM25564     1  0.8804      0.193 0.584 0.204 0.212
#> GSM25565     2  0.1529      0.940 0.000 0.960 0.040
#> GSM25566     2  0.0892      0.939 0.000 0.980 0.020
#> GSM25568     2  0.7298      0.669 0.088 0.692 0.220
#> GSM25569     2  0.2165      0.936 0.000 0.936 0.064
#> GSM25552     2  0.2796      0.926 0.000 0.908 0.092
#> GSM25553     2  0.3670      0.919 0.020 0.888 0.092
#> GSM25578     1  0.0747      0.689 0.984 0.000 0.016
#> GSM25579     1  0.2066      0.657 0.940 0.000 0.060
#> GSM25580     1  0.0424      0.698 0.992 0.000 0.008
#> GSM25581     1  0.0424      0.698 0.992 0.000 0.008
#> GSM48655     2  0.1529      0.934 0.000 0.960 0.040
#> GSM48656     2  0.1964      0.936 0.000 0.944 0.056
#> GSM48657     2  0.1860      0.932 0.000 0.948 0.052
#> GSM48658     2  0.2165      0.934 0.000 0.936 0.064
#> GSM25624     1  0.0237      0.697 0.996 0.000 0.004
#> GSM25625     3  0.6280      0.812 0.460 0.000 0.540
#> GSM25626     3  0.6386      0.852 0.412 0.004 0.584
#> GSM25627     3  0.7406      0.833 0.360 0.044 0.596
#> GSM25628     3  0.7588      0.808 0.312 0.064 0.624
#> GSM25629     3  0.8311      0.730 0.252 0.132 0.616
#> GSM25630     3  0.6244      0.837 0.440 0.000 0.560
#> GSM25631     2  0.7245      0.695 0.168 0.712 0.120
#> GSM25632     3  0.6267      0.831 0.452 0.000 0.548
#> GSM25633     1  0.0000      0.696 1.000 0.000 0.000
#> GSM25634     1  0.0000      0.696 1.000 0.000 0.000
#> GSM25635     1  0.0237      0.697 0.996 0.000 0.004
#> GSM25656     3  0.7902      0.779 0.280 0.092 0.628
#> GSM25657     1  0.1860      0.659 0.948 0.000 0.052
#> GSM25658     1  0.5621     -0.055 0.692 0.000 0.308
#> GSM25659     1  0.4399      0.440 0.812 0.000 0.188
#> GSM25660     1  0.0000      0.696 1.000 0.000 0.000
#> GSM25661     1  0.0000      0.696 1.000 0.000 0.000
#> GSM25662     2  0.1753      0.938 0.000 0.952 0.048
#> GSM25663     2  0.2261      0.938 0.000 0.932 0.068
#> GSM25680     2  0.3340      0.922 0.000 0.880 0.120
#> GSM25681     2  0.3267      0.924 0.000 0.884 0.116
#> GSM25682     2  0.1753      0.934 0.000 0.952 0.048
#> GSM25683     2  0.1753      0.934 0.000 0.952 0.048
#> GSM25684     2  0.2066      0.936 0.000 0.940 0.060
#> GSM25685     2  0.2356      0.935 0.000 0.928 0.072
#> GSM25686     2  0.1860      0.933 0.000 0.948 0.052
#> GSM25687     2  0.1860      0.933 0.000 0.948 0.052
#> GSM48664     1  0.5216      0.653 0.740 0.000 0.260
#> GSM48665     1  0.5216      0.654 0.740 0.000 0.260

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.3679      0.805 0.000 0.856 0.060 0.084
#> GSM25549     2  0.3679      0.805 0.000 0.856 0.060 0.084
#> GSM25550     2  0.3828      0.804 0.000 0.848 0.068 0.084
#> GSM25551     2  0.3182      0.819 0.000 0.876 0.028 0.096
#> GSM25570     2  0.3679      0.805 0.000 0.856 0.060 0.084
#> GSM25571     2  0.3679      0.805 0.000 0.856 0.060 0.084
#> GSM25358     4  0.9386      0.487 0.320 0.120 0.188 0.372
#> GSM25359     2  0.7316      0.445 0.012 0.556 0.292 0.140
#> GSM25360     3  0.3249      0.858 0.140 0.000 0.852 0.008
#> GSM25361     3  0.6367      0.746 0.084 0.084 0.728 0.104
#> GSM25377     4  0.5372      0.771 0.444 0.000 0.012 0.544
#> GSM25378     4  0.5415      0.790 0.436 0.004 0.008 0.552
#> GSM25401     4  0.7455      0.576 0.196 0.024 0.188 0.592
#> GSM25402     4  0.7422      0.659 0.276 0.016 0.148 0.560
#> GSM25349     2  0.4880      0.801 0.000 0.760 0.052 0.188
#> GSM25350     2  0.4920      0.800 0.000 0.756 0.052 0.192
#> GSM25356     4  0.5573      0.796 0.396 0.012 0.008 0.584
#> GSM25357     2  0.4283      0.729 0.000 0.740 0.004 0.256
#> GSM25385     3  0.3969      0.846 0.180 0.000 0.804 0.016
#> GSM25386     3  0.3377      0.860 0.140 0.000 0.848 0.012
#> GSM25399     4  0.5396      0.742 0.464 0.000 0.012 0.524
#> GSM25400     1  0.5409     -0.728 0.496 0.000 0.012 0.492
#> GSM48659     2  0.4964      0.811 0.000 0.764 0.068 0.168
#> GSM48660     2  0.4957      0.807 0.000 0.748 0.048 0.204
#> GSM25409     2  0.4070      0.809 0.000 0.824 0.044 0.132
#> GSM25410     3  0.3711      0.858 0.140 0.000 0.836 0.024
#> GSM25426     2  0.3659      0.817 0.000 0.840 0.024 0.136
#> GSM25427     4  0.5427      0.784 0.444 0.004 0.008 0.544
#> GSM25540     3  0.6310      0.763 0.084 0.084 0.732 0.100
#> GSM25541     3  0.6433      0.758 0.088 0.088 0.724 0.100
#> GSM25542     2  0.7507      0.473 0.000 0.480 0.316 0.204
#> GSM25543     2  0.7613      0.365 0.000 0.428 0.368 0.204
#> GSM25479     1  0.1004      0.710 0.972 0.000 0.024 0.004
#> GSM25480     1  0.0817      0.711 0.976 0.000 0.024 0.000
#> GSM25481     4  0.5883      0.787 0.388 0.016 0.016 0.580
#> GSM25482     4  0.5883      0.787 0.388 0.016 0.016 0.580
#> GSM48654     2  0.4893      0.809 0.000 0.768 0.064 0.168
#> GSM48650     2  0.5102      0.799 0.000 0.732 0.048 0.220
#> GSM48651     2  0.4789      0.811 0.000 0.772 0.056 0.172
#> GSM48652     2  0.4789      0.811 0.000 0.772 0.056 0.172
#> GSM48653     2  0.4937      0.810 0.000 0.764 0.064 0.172
#> GSM48662     2  0.4370      0.818 0.000 0.800 0.044 0.156
#> GSM48663     2  0.5608      0.782 0.000 0.684 0.060 0.256
#> GSM25524     1  0.5604     -0.199 0.504 0.000 0.476 0.020
#> GSM25525     1  0.2255      0.707 0.920 0.000 0.068 0.012
#> GSM25526     3  0.5957      0.529 0.364 0.000 0.588 0.048
#> GSM25527     1  0.2739      0.711 0.904 0.000 0.060 0.036
#> GSM25528     1  0.4737      0.517 0.728 0.000 0.252 0.020
#> GSM25529     1  0.2473      0.700 0.908 0.000 0.080 0.012
#> GSM25530     1  0.5587      0.201 0.600 0.000 0.372 0.028
#> GSM25531     1  0.2773      0.699 0.900 0.000 0.072 0.028
#> GSM48661     2  0.5355      0.797 0.000 0.736 0.084 0.180
#> GSM25561     3  0.4983      0.751 0.272 0.000 0.704 0.024
#> GSM25562     1  0.2759      0.700 0.904 0.000 0.044 0.052
#> GSM25563     3  0.3853      0.854 0.160 0.000 0.820 0.020
#> GSM25564     1  0.8330      0.198 0.544 0.224 0.152 0.080
#> GSM25565     2  0.4070      0.832 0.000 0.824 0.044 0.132
#> GSM25566     2  0.1389      0.828 0.000 0.952 0.000 0.048
#> GSM25568     2  0.7968      0.551 0.012 0.472 0.280 0.236
#> GSM25569     2  0.5496      0.803 0.000 0.724 0.088 0.188
#> GSM25552     2  0.3966      0.806 0.000 0.840 0.072 0.088
#> GSM25553     2  0.4346      0.801 0.004 0.824 0.076 0.096
#> GSM25578     1  0.0469      0.713 0.988 0.000 0.012 0.000
#> GSM25579     1  0.2750      0.689 0.908 0.004 0.056 0.032
#> GSM25580     1  0.1661      0.690 0.944 0.000 0.004 0.052
#> GSM25581     1  0.1743      0.688 0.940 0.000 0.004 0.056
#> GSM48655     2  0.3856      0.819 0.000 0.832 0.032 0.136
#> GSM48656     2  0.4746      0.814 0.000 0.776 0.056 0.168
#> GSM48657     2  0.4881      0.806 0.000 0.756 0.048 0.196
#> GSM48658     2  0.5535      0.797 0.000 0.720 0.088 0.192
#> GSM25624     1  0.1902      0.680 0.932 0.000 0.004 0.064
#> GSM25625     3  0.3895      0.846 0.184 0.000 0.804 0.012
#> GSM25626     3  0.3300      0.859 0.144 0.000 0.848 0.008
#> GSM25627     3  0.6903      0.795 0.132 0.080 0.688 0.100
#> GSM25628     3  0.3981      0.844 0.100 0.040 0.848 0.012
#> GSM25629     3  0.6545      0.769 0.088 0.108 0.716 0.088
#> GSM25630     3  0.4004      0.850 0.164 0.000 0.812 0.024
#> GSM25631     2  0.7246      0.708 0.068 0.656 0.124 0.152
#> GSM25632     3  0.3937      0.841 0.188 0.000 0.800 0.012
#> GSM25633     1  0.1576      0.696 0.948 0.000 0.004 0.048
#> GSM25634     1  0.2048      0.681 0.928 0.000 0.008 0.064
#> GSM25635     1  0.2542      0.659 0.904 0.000 0.012 0.084
#> GSM25656     3  0.4858      0.828 0.084 0.052 0.816 0.048
#> GSM25657     1  0.2224      0.709 0.928 0.000 0.040 0.032
#> GSM25658     1  0.5599      0.437 0.664 0.000 0.288 0.048
#> GSM25659     1  0.3974      0.659 0.844 0.008 0.108 0.040
#> GSM25660     1  0.1576      0.693 0.948 0.000 0.004 0.048
#> GSM25661     1  0.1489      0.689 0.952 0.000 0.004 0.044
#> GSM25662     2  0.3856      0.830 0.000 0.832 0.032 0.136
#> GSM25663     2  0.3754      0.821 0.000 0.852 0.064 0.084
#> GSM25680     2  0.4469      0.801 0.000 0.808 0.080 0.112
#> GSM25681     2  0.4411      0.802 0.000 0.812 0.080 0.108
#> GSM25682     2  0.2888      0.808 0.000 0.872 0.004 0.124
#> GSM25683     2  0.2888      0.808 0.000 0.872 0.004 0.124
#> GSM25684     2  0.3984      0.828 0.000 0.828 0.040 0.132
#> GSM25685     2  0.4322      0.821 0.000 0.804 0.044 0.152
#> GSM25686     2  0.2888      0.808 0.000 0.872 0.004 0.124
#> GSM25687     2  0.2888      0.808 0.000 0.872 0.004 0.124
#> GSM48664     4  0.5399      0.741 0.468 0.000 0.012 0.520
#> GSM48665     1  0.5300     -0.544 0.580 0.000 0.012 0.408

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     5  0.4367     0.7966 0.000 0.416 0.000 0.004 0.580
#> GSM25549     5  0.4367     0.7966 0.000 0.416 0.000 0.004 0.580
#> GSM25550     5  0.4341     0.7918 0.000 0.404 0.000 0.004 0.592
#> GSM25551     2  0.6048    -0.2373 0.000 0.516 0.036 0.048 0.400
#> GSM25570     5  0.4367     0.7966 0.000 0.416 0.000 0.004 0.580
#> GSM25571     5  0.4359     0.7947 0.000 0.412 0.000 0.004 0.584
#> GSM25358     4  0.7689     0.5744 0.100 0.024 0.136 0.548 0.192
#> GSM25359     5  0.6917     0.2726 0.000 0.204 0.192 0.048 0.556
#> GSM25360     3  0.2206     0.8366 0.068 0.000 0.912 0.004 0.016
#> GSM25361     3  0.5980     0.6761 0.044 0.028 0.616 0.016 0.296
#> GSM25377     4  0.4289     0.8348 0.176 0.000 0.000 0.760 0.064
#> GSM25378     4  0.3850     0.8431 0.172 0.000 0.004 0.792 0.032
#> GSM25401     4  0.5562     0.6851 0.056 0.020 0.116 0.740 0.068
#> GSM25402     4  0.5353     0.7709 0.120 0.000 0.096 0.732 0.052
#> GSM25349     2  0.5763     0.2581 0.000 0.600 0.004 0.108 0.288
#> GSM25350     2  0.5798     0.2463 0.000 0.592 0.004 0.108 0.296
#> GSM25356     4  0.3368     0.8452 0.156 0.000 0.000 0.820 0.024
#> GSM25357     2  0.6824    -0.1159 0.000 0.428 0.012 0.188 0.372
#> GSM25385     3  0.2060     0.8359 0.052 0.000 0.924 0.008 0.016
#> GSM25386     3  0.1412     0.8377 0.036 0.000 0.952 0.004 0.008
#> GSM25399     4  0.4725     0.8195 0.200 0.000 0.000 0.720 0.080
#> GSM25400     4  0.4173     0.8131 0.224 0.000 0.012 0.748 0.016
#> GSM48659     2  0.2824     0.4792 0.000 0.880 0.024 0.008 0.088
#> GSM48660     2  0.1628     0.5246 0.000 0.936 0.000 0.008 0.056
#> GSM25409     5  0.5039     0.5565 0.000 0.456 0.000 0.032 0.512
#> GSM25410     3  0.1455     0.8375 0.032 0.000 0.952 0.008 0.008
#> GSM25426     2  0.6298     0.1867 0.000 0.580 0.052 0.068 0.300
#> GSM25427     4  0.3888     0.8429 0.176 0.000 0.004 0.788 0.032
#> GSM25540     3  0.5079     0.7314 0.012 0.028 0.696 0.016 0.248
#> GSM25541     3  0.5129     0.7265 0.012 0.028 0.688 0.016 0.256
#> GSM25542     2  0.7169     0.2210 0.000 0.536 0.204 0.064 0.196
#> GSM25543     2  0.7732     0.0975 0.000 0.408 0.276 0.064 0.252
#> GSM25479     1  0.1498     0.8135 0.952 0.000 0.008 0.024 0.016
#> GSM25480     1  0.1405     0.8133 0.956 0.000 0.008 0.020 0.016
#> GSM25481     4  0.4060     0.8428 0.156 0.000 0.004 0.788 0.052
#> GSM25482     4  0.4060     0.8428 0.156 0.000 0.004 0.788 0.052
#> GSM48654     2  0.2027     0.5109 0.000 0.928 0.024 0.008 0.040
#> GSM48650     2  0.3086     0.5142 0.000 0.864 0.004 0.040 0.092
#> GSM48651     2  0.0579     0.5284 0.000 0.984 0.008 0.008 0.000
#> GSM48652     2  0.0693     0.5280 0.000 0.980 0.012 0.008 0.000
#> GSM48653     2  0.1597     0.5193 0.000 0.948 0.020 0.008 0.024
#> GSM48662     2  0.1492     0.5207 0.000 0.948 0.008 0.004 0.040
#> GSM48663     2  0.3946     0.4783 0.000 0.800 0.000 0.080 0.120
#> GSM25524     1  0.5792     0.3006 0.568 0.000 0.356 0.024 0.052
#> GSM25525     1  0.2305     0.8004 0.916 0.000 0.028 0.012 0.044
#> GSM25526     3  0.6289     0.4178 0.320 0.000 0.564 0.040 0.076
#> GSM25527     1  0.2263     0.8090 0.920 0.000 0.020 0.024 0.036
#> GSM25528     1  0.4249     0.7172 0.800 0.000 0.120 0.024 0.056
#> GSM25529     1  0.2305     0.8004 0.916 0.000 0.028 0.012 0.044
#> GSM25530     1  0.5576     0.6161 0.688 0.000 0.200 0.040 0.072
#> GSM25531     1  0.3071     0.7929 0.880 0.000 0.032 0.032 0.056
#> GSM48661     2  0.3525     0.4542 0.000 0.836 0.032 0.012 0.120
#> GSM25561     3  0.5111     0.6993 0.200 0.000 0.716 0.028 0.056
#> GSM25562     1  0.3434     0.7936 0.860 0.000 0.028 0.056 0.056
#> GSM25563     3  0.3152     0.8263 0.052 0.000 0.876 0.028 0.044
#> GSM25564     1  0.7115     0.4255 0.588 0.212 0.064 0.020 0.116
#> GSM25565     2  0.4460     0.3323 0.000 0.748 0.016 0.032 0.204
#> GSM25566     2  0.5033    -0.2346 0.000 0.568 0.004 0.028 0.400
#> GSM25568     2  0.7497     0.2014 0.000 0.512 0.152 0.108 0.228
#> GSM25569     2  0.3921     0.4465 0.000 0.812 0.012 0.048 0.128
#> GSM25552     5  0.4350     0.7945 0.000 0.408 0.000 0.004 0.588
#> GSM25553     5  0.4460     0.7853 0.004 0.392 0.000 0.004 0.600
#> GSM25578     1  0.0740     0.8128 0.980 0.000 0.004 0.008 0.008
#> GSM25579     1  0.1651     0.8109 0.944 0.000 0.012 0.008 0.036
#> GSM25580     1  0.3099     0.7594 0.848 0.000 0.000 0.124 0.028
#> GSM25581     1  0.2964     0.7616 0.856 0.000 0.000 0.120 0.024
#> GSM48655     2  0.3807     0.4316 0.000 0.792 0.004 0.028 0.176
#> GSM48656     2  0.2796     0.4936 0.000 0.868 0.008 0.008 0.116
#> GSM48657     2  0.2953     0.5094 0.000 0.868 0.004 0.028 0.100
#> GSM48658     2  0.3900     0.3938 0.000 0.788 0.020 0.012 0.180
#> GSM25624     1  0.3730     0.7045 0.800 0.000 0.004 0.168 0.028
#> GSM25625     3  0.2466     0.8307 0.076 0.000 0.900 0.012 0.012
#> GSM25626     3  0.1329     0.8367 0.032 0.000 0.956 0.008 0.004
#> GSM25627     3  0.6727     0.7019 0.064 0.100 0.664 0.048 0.124
#> GSM25628     3  0.2127     0.8290 0.016 0.016 0.932 0.016 0.020
#> GSM25629     3  0.5952     0.7229 0.012 0.092 0.692 0.044 0.160
#> GSM25630     3  0.3581     0.8189 0.068 0.000 0.852 0.036 0.044
#> GSM25631     5  0.6346     0.4666 0.040 0.368 0.044 0.012 0.536
#> GSM25632     3  0.2409     0.8317 0.060 0.000 0.908 0.020 0.012
#> GSM25633     1  0.2388     0.7892 0.900 0.000 0.000 0.072 0.028
#> GSM25634     1  0.3409     0.7329 0.824 0.000 0.000 0.144 0.032
#> GSM25635     1  0.3574     0.7103 0.804 0.000 0.000 0.168 0.028
#> GSM25656     3  0.4366     0.7954 0.012 0.028 0.804 0.036 0.120
#> GSM25657     1  0.1498     0.8140 0.952 0.000 0.008 0.024 0.016
#> GSM25658     1  0.5884     0.5557 0.640 0.000 0.248 0.036 0.076
#> GSM25659     1  0.2912     0.7864 0.876 0.000 0.028 0.008 0.088
#> GSM25660     1  0.2540     0.7809 0.888 0.000 0.000 0.088 0.024
#> GSM25661     1  0.2597     0.7779 0.884 0.000 0.000 0.092 0.024
#> GSM25662     2  0.4932     0.2382 0.000 0.708 0.032 0.028 0.232
#> GSM25663     5  0.4800     0.5295 0.000 0.476 0.004 0.012 0.508
#> GSM25680     5  0.4262     0.7475 0.000 0.440 0.000 0.000 0.560
#> GSM25681     5  0.4390     0.7455 0.000 0.428 0.004 0.000 0.568
#> GSM25682     2  0.5303     0.0387 0.000 0.604 0.012 0.040 0.344
#> GSM25683     2  0.5303     0.0387 0.000 0.604 0.012 0.040 0.344
#> GSM25684     2  0.4892     0.2544 0.000 0.720 0.036 0.028 0.216
#> GSM25685     2  0.5537     0.2827 0.000 0.672 0.048 0.044 0.236
#> GSM25686     2  0.5303     0.0387 0.000 0.604 0.012 0.040 0.344
#> GSM25687     2  0.5303     0.0387 0.000 0.604 0.012 0.040 0.344
#> GSM48664     4  0.4707     0.8162 0.212 0.000 0.000 0.716 0.072
#> GSM48665     4  0.5171     0.3343 0.456 0.000 0.000 0.504 0.040

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5 p6
#> GSM25548     5  0.3309     0.7311 0.000 0.280 0.000 0.000 0.720 NA
#> GSM25549     5  0.3288     0.7310 0.000 0.276 0.000 0.000 0.724 NA
#> GSM25550     5  0.3565     0.7301 0.000 0.276 0.000 0.004 0.716 NA
#> GSM25551     5  0.5790     0.2223 0.000 0.376 0.012 0.012 0.508 NA
#> GSM25570     5  0.3309     0.7311 0.000 0.280 0.000 0.000 0.720 NA
#> GSM25571     5  0.3309     0.7311 0.000 0.280 0.000 0.000 0.720 NA
#> GSM25358     4  0.7032     0.5322 0.048 0.008 0.104 0.556 0.216 NA
#> GSM25359     5  0.6071     0.3932 0.000 0.100 0.152 0.012 0.636 NA
#> GSM25360     3  0.2557     0.7582 0.036 0.000 0.892 0.004 0.012 NA
#> GSM25361     3  0.6758     0.5348 0.024 0.028 0.480 0.004 0.316 NA
#> GSM25377     4  0.4203     0.7801 0.072 0.000 0.000 0.768 0.024 NA
#> GSM25378     4  0.3029     0.7955 0.104 0.000 0.004 0.852 0.008 NA
#> GSM25401     4  0.6040     0.6259 0.032 0.004 0.124 0.660 0.052 NA
#> GSM25402     4  0.5439     0.7080 0.044 0.004 0.104 0.716 0.032 NA
#> GSM25349     2  0.6968     0.2088 0.000 0.452 0.008 0.068 0.292 NA
#> GSM25350     2  0.6904     0.2176 0.000 0.468 0.008 0.068 0.284 NA
#> GSM25356     4  0.2981     0.8003 0.064 0.000 0.000 0.864 0.020 NA
#> GSM25357     5  0.7110     0.1537 0.000 0.276 0.000 0.212 0.416 NA
#> GSM25385     3  0.1483     0.7590 0.036 0.000 0.944 0.008 0.000 NA
#> GSM25386     3  0.0520     0.7636 0.008 0.000 0.984 0.000 0.000 NA
#> GSM25399     4  0.4668     0.7575 0.080 0.000 0.000 0.712 0.020 NA
#> GSM25400     4  0.3800     0.7599 0.160 0.000 0.004 0.776 0.000 NA
#> GSM48659     2  0.3138     0.4996 0.000 0.840 0.004 0.000 0.096 NA
#> GSM48660     2  0.1890     0.5288 0.000 0.924 0.000 0.008 0.044 NA
#> GSM25409     5  0.5077     0.5803 0.000 0.328 0.000 0.028 0.600 NA
#> GSM25410     3  0.0622     0.7637 0.012 0.000 0.980 0.000 0.000 NA
#> GSM25426     2  0.6385    -0.0075 0.000 0.432 0.020 0.020 0.404 NA
#> GSM25427     4  0.3200     0.7960 0.104 0.000 0.004 0.844 0.012 NA
#> GSM25540     3  0.6376     0.5811 0.008 0.036 0.536 0.004 0.280 NA
#> GSM25541     3  0.6376     0.5811 0.008 0.036 0.536 0.004 0.280 NA
#> GSM25542     2  0.7235     0.2775 0.000 0.448 0.116 0.008 0.164 NA
#> GSM25543     2  0.7556     0.2118 0.000 0.372 0.176 0.004 0.172 NA
#> GSM25479     1  0.1851     0.7834 0.928 0.000 0.000 0.036 0.012 NA
#> GSM25480     1  0.1857     0.7834 0.928 0.000 0.000 0.032 0.012 NA
#> GSM25481     4  0.3875     0.7912 0.064 0.004 0.004 0.820 0.040 NA
#> GSM25482     4  0.3875     0.7912 0.064 0.004 0.004 0.820 0.040 NA
#> GSM48654     2  0.2134     0.5250 0.000 0.904 0.000 0.000 0.052 NA
#> GSM48650     2  0.3659     0.5119 0.000 0.820 0.000 0.032 0.088 NA
#> GSM48651     2  0.0665     0.5386 0.000 0.980 0.000 0.004 0.008 NA
#> GSM48652     2  0.0653     0.5383 0.000 0.980 0.000 0.004 0.004 NA
#> GSM48653     2  0.1901     0.5310 0.000 0.924 0.008 0.000 0.028 NA
#> GSM48662     2  0.1666     0.5329 0.000 0.936 0.000 0.008 0.036 NA
#> GSM48663     2  0.5290     0.4577 0.000 0.704 0.004 0.092 0.088 NA
#> GSM25524     1  0.5803     0.3125 0.536 0.000 0.304 0.008 0.004 NA
#> GSM25525     1  0.2339     0.7557 0.880 0.000 0.004 0.004 0.004 NA
#> GSM25526     3  0.6722     0.2447 0.328 0.000 0.472 0.024 0.036 NA
#> GSM25527     1  0.3255     0.7727 0.844 0.000 0.020 0.052 0.000 NA
#> GSM25528     1  0.3491     0.7212 0.804 0.000 0.036 0.004 0.004 NA
#> GSM25529     1  0.2689     0.7504 0.864 0.000 0.016 0.004 0.004 NA
#> GSM25530     1  0.5153     0.6221 0.660 0.000 0.088 0.028 0.000 NA
#> GSM25531     1  0.4158     0.7021 0.740 0.000 0.020 0.036 0.000 NA
#> GSM48661     2  0.3690     0.4834 0.000 0.804 0.012 0.000 0.116 NA
#> GSM25561     3  0.5365     0.6152 0.192 0.000 0.656 0.008 0.016 NA
#> GSM25562     1  0.4441     0.7094 0.752 0.000 0.004 0.080 0.020 NA
#> GSM25563     3  0.3123     0.7420 0.020 0.000 0.844 0.004 0.016 NA
#> GSM25564     1  0.7896     0.3101 0.464 0.248 0.056 0.028 0.064 NA
#> GSM25565     2  0.5040     0.2942 0.000 0.656 0.004 0.008 0.236 NA
#> GSM25566     2  0.5052    -0.2244 0.000 0.500 0.004 0.008 0.444 NA
#> GSM25568     2  0.7489     0.2744 0.004 0.448 0.056 0.048 0.164 NA
#> GSM25569     2  0.4888     0.4275 0.000 0.676 0.004 0.004 0.108 NA
#> GSM25552     5  0.4083     0.7174 0.000 0.284 0.000 0.008 0.688 NA
#> GSM25553     5  0.4194     0.7087 0.004 0.264 0.000 0.008 0.700 NA
#> GSM25578     1  0.1218     0.7838 0.956 0.000 0.000 0.028 0.004 NA
#> GSM25579     1  0.1630     0.7850 0.940 0.000 0.000 0.020 0.016 NA
#> GSM25580     1  0.3594     0.7375 0.804 0.000 0.008 0.144 0.004 NA
#> GSM25581     1  0.3594     0.7375 0.804 0.000 0.008 0.144 0.004 NA
#> GSM48655     2  0.4159     0.3782 0.000 0.732 0.000 0.016 0.216 NA
#> GSM48656     2  0.2445     0.5194 0.000 0.872 0.000 0.000 0.108 NA
#> GSM48657     2  0.3453     0.4982 0.000 0.828 0.000 0.024 0.104 NA
#> GSM48658     2  0.4056     0.4341 0.000 0.748 0.004 0.000 0.184 NA
#> GSM25624     1  0.4100     0.7017 0.752 0.000 0.008 0.176 0.000 NA
#> GSM25625     3  0.3253     0.7317 0.088 0.000 0.848 0.012 0.008 NA
#> GSM25626     3  0.1026     0.7621 0.012 0.000 0.968 0.008 0.004 NA
#> GSM25627     3  0.7652     0.5477 0.048 0.104 0.536 0.036 0.100 NA
#> GSM25628     3  0.2107     0.7603 0.004 0.016 0.920 0.004 0.012 NA
#> GSM25629     3  0.7214     0.5652 0.020 0.116 0.520 0.004 0.164 NA
#> GSM25630     3  0.3684     0.7293 0.052 0.000 0.808 0.004 0.012 NA
#> GSM25631     5  0.5916     0.4185 0.032 0.260 0.016 0.000 0.596 NA
#> GSM25632     3  0.1480     0.7607 0.040 0.000 0.940 0.000 0.000 NA
#> GSM25633     1  0.3025     0.7662 0.856 0.000 0.008 0.092 0.004 NA
#> GSM25634     1  0.3922     0.7315 0.784 0.000 0.008 0.140 0.004 NA
#> GSM25635     1  0.3954     0.7122 0.764 0.000 0.008 0.172 0.000 NA
#> GSM25656     3  0.5164     0.7073 0.008 0.024 0.704 0.004 0.112 NA
#> GSM25657     1  0.2521     0.7766 0.896 0.000 0.008 0.028 0.012 NA
#> GSM25658     1  0.6292     0.4292 0.552 0.000 0.256 0.024 0.020 NA
#> GSM25659     1  0.3363     0.7453 0.828 0.000 0.008 0.008 0.032 NA
#> GSM25660     1  0.2904     0.7599 0.852 0.000 0.008 0.112 0.000 NA
#> GSM25661     1  0.3046     0.7589 0.848 0.000 0.008 0.112 0.004 NA
#> GSM25662     2  0.5155     0.1855 0.000 0.588 0.004 0.004 0.324 NA
#> GSM25663     5  0.4648     0.4136 0.000 0.408 0.000 0.000 0.548 NA
#> GSM25680     5  0.3695     0.6894 0.000 0.244 0.000 0.000 0.732 NA
#> GSM25681     5  0.3731     0.6978 0.000 0.240 0.004 0.000 0.736 NA
#> GSM25682     2  0.5232    -0.0834 0.000 0.500 0.000 0.016 0.428 NA
#> GSM25683     2  0.5232    -0.0834 0.000 0.500 0.000 0.016 0.428 NA
#> GSM25684     2  0.5259     0.1417 0.000 0.564 0.004 0.004 0.344 NA
#> GSM25685     2  0.5865     0.1445 0.000 0.524 0.016 0.008 0.344 NA
#> GSM25686     2  0.5298    -0.0659 0.000 0.504 0.000 0.020 0.420 NA
#> GSM25687     2  0.5302    -0.0665 0.000 0.500 0.000 0.020 0.424 NA
#> GSM48664     4  0.4861     0.7428 0.108 0.000 0.000 0.700 0.020 NA
#> GSM48665     4  0.5290     0.2720 0.392 0.000 0.000 0.520 0.008 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-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 genotype/variation(p) k
#> MAD:kmeans 94              2.03e-05 2
#> MAD:kmeans 95              2.34e-04 3
#> MAD:kmeans 90              2.55e-07 4
#> MAD:kmeans 70              7.12e-12 5
#> MAD:kmeans 68              7.05e-12 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) are extracted by 'MAD' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.843           0.914       0.962         0.5052 0.495   0.495
#> 3 3 0.738           0.777       0.891         0.2996 0.817   0.645
#> 4 4 0.495           0.473       0.698         0.1301 0.961   0.888
#> 5 5 0.489           0.372       0.585         0.0715 0.867   0.600
#> 6 6 0.518           0.293       0.596         0.0413 0.889   0.581

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
#> GSM25548     2  0.0000      0.955 0.000 1.000
#> GSM25549     2  0.0000      0.955 0.000 1.000
#> GSM25550     2  0.0000      0.955 0.000 1.000
#> GSM25551     2  0.0000      0.955 0.000 1.000
#> GSM25570     2  0.0000      0.955 0.000 1.000
#> GSM25571     2  0.0000      0.955 0.000 1.000
#> GSM25358     1  0.0672      0.959 0.992 0.008
#> GSM25359     2  0.6887      0.778 0.184 0.816
#> GSM25360     1  0.0000      0.964 1.000 0.000
#> GSM25361     2  0.9881      0.286 0.436 0.564
#> GSM25377     1  0.0000      0.964 1.000 0.000
#> GSM25378     1  0.0672      0.958 0.992 0.008
#> GSM25401     1  0.6343      0.806 0.840 0.160
#> GSM25402     1  0.4562      0.880 0.904 0.096
#> GSM25349     2  0.0000      0.955 0.000 1.000
#> GSM25350     2  0.0000      0.955 0.000 1.000
#> GSM25356     1  0.4562      0.880 0.904 0.096
#> GSM25357     2  0.0000      0.955 0.000 1.000
#> GSM25385     1  0.0000      0.964 1.000 0.000
#> GSM25386     1  0.0000      0.964 1.000 0.000
#> GSM25399     1  0.0000      0.964 1.000 0.000
#> GSM25400     1  0.0000      0.964 1.000 0.000
#> GSM48659     2  0.0000      0.955 0.000 1.000
#> GSM48660     2  0.0000      0.955 0.000 1.000
#> GSM25409     2  0.0000      0.955 0.000 1.000
#> GSM25410     1  0.0000      0.964 1.000 0.000
#> GSM25426     2  0.0000      0.955 0.000 1.000
#> GSM25427     1  0.0938      0.955 0.988 0.012
#> GSM25540     2  0.7674      0.726 0.224 0.776
#> GSM25541     2  0.8763      0.615 0.296 0.704
#> GSM25542     2  0.0000      0.955 0.000 1.000
#> GSM25543     2  0.0672      0.949 0.008 0.992
#> GSM25479     1  0.0000      0.964 1.000 0.000
#> GSM25480     1  0.0000      0.964 1.000 0.000
#> GSM25481     1  0.7815      0.708 0.768 0.232
#> GSM25482     1  0.7815      0.708 0.768 0.232
#> GSM48654     2  0.0000      0.955 0.000 1.000
#> GSM48650     2  0.0000      0.955 0.000 1.000
#> GSM48651     2  0.0000      0.955 0.000 1.000
#> GSM48652     2  0.0000      0.955 0.000 1.000
#> GSM48653     2  0.0000      0.955 0.000 1.000
#> GSM48662     2  0.0000      0.955 0.000 1.000
#> GSM48663     2  0.0000      0.955 0.000 1.000
#> GSM25524     1  0.0000      0.964 1.000 0.000
#> GSM25525     1  0.0000      0.964 1.000 0.000
#> GSM25526     1  0.0000      0.964 1.000 0.000
#> GSM25527     1  0.0000      0.964 1.000 0.000
#> GSM25528     1  0.0000      0.964 1.000 0.000
#> GSM25529     1  0.0000      0.964 1.000 0.000
#> GSM25530     1  0.0000      0.964 1.000 0.000
#> GSM25531     1  0.0000      0.964 1.000 0.000
#> GSM48661     2  0.0000      0.955 0.000 1.000
#> GSM25561     1  0.0000      0.964 1.000 0.000
#> GSM25562     1  0.0000      0.964 1.000 0.000
#> GSM25563     1  0.0000      0.964 1.000 0.000
#> GSM25564     1  0.9323      0.495 0.652 0.348
#> GSM25565     2  0.0000      0.955 0.000 1.000
#> GSM25566     2  0.0000      0.955 0.000 1.000
#> GSM25568     2  0.8955      0.528 0.312 0.688
#> GSM25569     2  0.0000      0.955 0.000 1.000
#> GSM25552     2  0.0000      0.955 0.000 1.000
#> GSM25553     2  0.0000      0.955 0.000 1.000
#> GSM25578     1  0.0000      0.964 1.000 0.000
#> GSM25579     1  0.0000      0.964 1.000 0.000
#> GSM25580     1  0.0000      0.964 1.000 0.000
#> GSM25581     1  0.0000      0.964 1.000 0.000
#> GSM48655     2  0.0000      0.955 0.000 1.000
#> GSM48656     2  0.0000      0.955 0.000 1.000
#> GSM48657     2  0.0000      0.955 0.000 1.000
#> GSM48658     2  0.0000      0.955 0.000 1.000
#> GSM25624     1  0.0000      0.964 1.000 0.000
#> GSM25625     1  0.0000      0.964 1.000 0.000
#> GSM25626     1  0.0000      0.964 1.000 0.000
#> GSM25627     1  0.3733      0.904 0.928 0.072
#> GSM25628     1  0.9635      0.314 0.612 0.388
#> GSM25629     2  0.7453      0.743 0.212 0.788
#> GSM25630     1  0.0000      0.964 1.000 0.000
#> GSM25631     2  0.5294      0.848 0.120 0.880
#> GSM25632     1  0.0000      0.964 1.000 0.000
#> GSM25633     1  0.0000      0.964 1.000 0.000
#> GSM25634     1  0.0000      0.964 1.000 0.000
#> GSM25635     1  0.0000      0.964 1.000 0.000
#> GSM25656     2  0.9000      0.578 0.316 0.684
#> GSM25657     1  0.0000      0.964 1.000 0.000
#> GSM25658     1  0.0000      0.964 1.000 0.000
#> GSM25659     1  0.0000      0.964 1.000 0.000
#> GSM25660     1  0.0000      0.964 1.000 0.000
#> GSM25661     1  0.0000      0.964 1.000 0.000
#> GSM25662     2  0.0000      0.955 0.000 1.000
#> GSM25663     2  0.0000      0.955 0.000 1.000
#> GSM25680     2  0.0000      0.955 0.000 1.000
#> GSM25681     2  0.0000      0.955 0.000 1.000
#> GSM25682     2  0.0000      0.955 0.000 1.000
#> GSM25683     2  0.0000      0.955 0.000 1.000
#> GSM25684     2  0.0000      0.955 0.000 1.000
#> GSM25685     2  0.0000      0.955 0.000 1.000
#> GSM25686     2  0.0000      0.955 0.000 1.000
#> GSM25687     2  0.0000      0.955 0.000 1.000
#> GSM48664     1  0.0000      0.964 1.000 0.000
#> GSM48665     1  0.0000      0.964 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.0424    0.91946 0.000 0.992 0.008
#> GSM25549     2  0.0424    0.91946 0.000 0.992 0.008
#> GSM25550     2  0.1453    0.91107 0.024 0.968 0.008
#> GSM25551     2  0.0592    0.92009 0.000 0.988 0.012
#> GSM25570     2  0.0424    0.91946 0.000 0.992 0.008
#> GSM25571     2  0.0424    0.91946 0.000 0.992 0.008
#> GSM25358     1  0.8010    0.15668 0.548 0.068 0.384
#> GSM25359     3  0.7187   -0.09290 0.024 0.480 0.496
#> GSM25360     3  0.1529    0.83121 0.040 0.000 0.960
#> GSM25361     3  0.2879    0.80878 0.024 0.052 0.924
#> GSM25377     1  0.0237    0.86208 0.996 0.000 0.004
#> GSM25378     1  0.0848    0.85749 0.984 0.008 0.008
#> GSM25401     1  0.7260    0.46158 0.636 0.048 0.316
#> GSM25402     1  0.4953    0.74383 0.808 0.016 0.176
#> GSM25349     2  0.1774    0.91766 0.016 0.960 0.024
#> GSM25350     2  0.1015    0.91910 0.008 0.980 0.012
#> GSM25356     1  0.1267    0.85062 0.972 0.024 0.004
#> GSM25357     2  0.2063    0.89882 0.044 0.948 0.008
#> GSM25385     3  0.4702    0.73182 0.212 0.000 0.788
#> GSM25386     3  0.1643    0.83207 0.044 0.000 0.956
#> GSM25399     1  0.0000    0.86278 1.000 0.000 0.000
#> GSM25400     1  0.0747    0.86698 0.984 0.000 0.016
#> GSM48659     2  0.1753    0.91480 0.000 0.952 0.048
#> GSM48660     2  0.0661    0.92084 0.004 0.988 0.008
#> GSM25409     2  0.1170    0.91886 0.008 0.976 0.016
#> GSM25410     3  0.1964    0.82943 0.056 0.000 0.944
#> GSM25426     2  0.2448    0.89536 0.000 0.924 0.076
#> GSM25427     1  0.0848    0.85719 0.984 0.008 0.008
#> GSM25540     3  0.0983    0.82320 0.004 0.016 0.980
#> GSM25541     3  0.1129    0.82191 0.004 0.020 0.976
#> GSM25542     2  0.6754    0.34756 0.012 0.556 0.432
#> GSM25543     2  0.6682    0.16936 0.008 0.504 0.488
#> GSM25479     1  0.1529    0.86715 0.960 0.000 0.040
#> GSM25480     1  0.1289    0.86833 0.968 0.000 0.032
#> GSM25481     1  0.1453    0.84875 0.968 0.024 0.008
#> GSM25482     1  0.1453    0.84875 0.968 0.024 0.008
#> GSM48654     2  0.1964    0.91169 0.000 0.944 0.056
#> GSM48650     2  0.0829    0.92109 0.004 0.984 0.012
#> GSM48651     2  0.1289    0.91908 0.000 0.968 0.032
#> GSM48652     2  0.1753    0.91482 0.000 0.952 0.048
#> GSM48653     2  0.1860    0.91361 0.000 0.948 0.052
#> GSM48662     2  0.0424    0.92048 0.000 0.992 0.008
#> GSM48663     2  0.0983    0.91864 0.016 0.980 0.004
#> GSM25524     3  0.5397    0.59727 0.280 0.000 0.720
#> GSM25525     1  0.4178    0.78634 0.828 0.000 0.172
#> GSM25526     3  0.3192    0.80063 0.112 0.000 0.888
#> GSM25527     1  0.3686    0.81607 0.860 0.000 0.140
#> GSM25528     1  0.6244    0.21592 0.560 0.000 0.440
#> GSM25529     1  0.4555    0.75415 0.800 0.000 0.200
#> GSM25530     3  0.6309   -0.05676 0.500 0.000 0.500
#> GSM25531     1  0.4605    0.75021 0.796 0.000 0.204
#> GSM48661     2  0.4842    0.75432 0.000 0.776 0.224
#> GSM25561     3  0.5650    0.56143 0.312 0.000 0.688
#> GSM25562     1  0.3816    0.80002 0.852 0.000 0.148
#> GSM25563     3  0.1643    0.83078 0.044 0.000 0.956
#> GSM25564     1  0.9901    0.02424 0.404 0.296 0.300
#> GSM25565     2  0.1643    0.91737 0.000 0.956 0.044
#> GSM25566     2  0.0424    0.92100 0.000 0.992 0.008
#> GSM25568     2  0.8984   -0.00646 0.128 0.436 0.436
#> GSM25569     2  0.1643    0.91853 0.000 0.956 0.044
#> GSM25552     2  0.1015    0.91687 0.012 0.980 0.008
#> GSM25553     2  0.5643    0.67834 0.220 0.760 0.020
#> GSM25578     1  0.1529    0.86745 0.960 0.000 0.040
#> GSM25579     1  0.3551    0.82754 0.868 0.000 0.132
#> GSM25580     1  0.0892    0.86651 0.980 0.000 0.020
#> GSM25581     1  0.1289    0.86818 0.968 0.000 0.032
#> GSM48655     2  0.0000    0.91987 0.000 1.000 0.000
#> GSM48656     2  0.1529    0.91847 0.000 0.960 0.040
#> GSM48657     2  0.0475    0.92015 0.004 0.992 0.004
#> GSM48658     2  0.4178    0.82060 0.000 0.828 0.172
#> GSM25624     1  0.1411    0.86866 0.964 0.000 0.036
#> GSM25625     3  0.4504    0.74332 0.196 0.000 0.804
#> GSM25626     3  0.1163    0.83142 0.028 0.000 0.972
#> GSM25627     3  0.1751    0.82913 0.028 0.012 0.960
#> GSM25628     3  0.0848    0.82723 0.008 0.008 0.984
#> GSM25629     3  0.0829    0.82586 0.004 0.012 0.984
#> GSM25630     3  0.2165    0.82525 0.064 0.000 0.936
#> GSM25631     2  0.6540    0.39567 0.008 0.584 0.408
#> GSM25632     3  0.4605    0.73234 0.204 0.000 0.796
#> GSM25633     1  0.2066    0.86096 0.940 0.000 0.060
#> GSM25634     1  0.1411    0.86872 0.964 0.000 0.036
#> GSM25635     1  0.1289    0.86834 0.968 0.000 0.032
#> GSM25656     3  0.0983    0.82268 0.004 0.016 0.980
#> GSM25657     1  0.3551    0.81926 0.868 0.000 0.132
#> GSM25658     3  0.6260    0.14991 0.448 0.000 0.552
#> GSM25659     1  0.5882    0.51864 0.652 0.000 0.348
#> GSM25660     1  0.1529    0.86791 0.960 0.000 0.040
#> GSM25661     1  0.1163    0.86764 0.972 0.000 0.028
#> GSM25662     2  0.1529    0.91690 0.000 0.960 0.040
#> GSM25663     2  0.2711    0.87478 0.000 0.912 0.088
#> GSM25680     2  0.1643    0.91752 0.000 0.956 0.044
#> GSM25681     2  0.1643    0.91775 0.000 0.956 0.044
#> GSM25682     2  0.0000    0.91987 0.000 1.000 0.000
#> GSM25683     2  0.0000    0.91987 0.000 1.000 0.000
#> GSM25684     2  0.1411    0.91767 0.000 0.964 0.036
#> GSM25685     2  0.2356    0.90429 0.000 0.928 0.072
#> GSM25686     2  0.0000    0.91987 0.000 1.000 0.000
#> GSM25687     2  0.0000    0.91987 0.000 1.000 0.000
#> GSM48664     1  0.0237    0.86208 0.996 0.000 0.004
#> GSM48665     1  0.0000    0.86278 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.4677     0.3821 0.000 0.680 0.004 0.316
#> GSM25549     2  0.4819     0.3661 0.000 0.652 0.004 0.344
#> GSM25550     2  0.5628     0.3246 0.032 0.644 0.004 0.320
#> GSM25551     2  0.3812     0.4695 0.000 0.832 0.028 0.140
#> GSM25570     2  0.4608     0.3739 0.000 0.692 0.004 0.304
#> GSM25571     2  0.4560     0.3848 0.000 0.700 0.004 0.296
#> GSM25358     1  0.9701     0.0511 0.360 0.184 0.272 0.184
#> GSM25359     3  0.8047    -0.2212 0.012 0.368 0.408 0.212
#> GSM25360     3  0.2586     0.7185 0.040 0.000 0.912 0.048
#> GSM25361     3  0.6784     0.4491 0.040 0.052 0.616 0.292
#> GSM25377     1  0.4244     0.7273 0.800 0.000 0.032 0.168
#> GSM25378     1  0.4719     0.7193 0.792 0.016 0.032 0.160
#> GSM25401     1  0.9832     0.1065 0.312 0.168 0.272 0.248
#> GSM25402     1  0.8709     0.4153 0.480 0.068 0.228 0.224
#> GSM25349     2  0.5701     0.3307 0.020 0.628 0.012 0.340
#> GSM25350     2  0.4917     0.3932 0.008 0.656 0.000 0.336
#> GSM25356     1  0.5504     0.7011 0.756 0.060 0.024 0.160
#> GSM25357     2  0.4954     0.3970 0.028 0.772 0.020 0.180
#> GSM25385     3  0.5221     0.6321 0.208 0.000 0.732 0.060
#> GSM25386     3  0.1545     0.7060 0.008 0.000 0.952 0.040
#> GSM25399     1  0.3793     0.7531 0.844 0.000 0.044 0.112
#> GSM25400     1  0.4499     0.7419 0.804 0.000 0.072 0.124
#> GSM48659     2  0.5594     0.1762 0.000 0.520 0.020 0.460
#> GSM48660     2  0.4720     0.3436 0.004 0.672 0.000 0.324
#> GSM25409     2  0.4648     0.4403 0.016 0.748 0.004 0.232
#> GSM25410     3  0.1575     0.7091 0.012 0.004 0.956 0.028
#> GSM25426     2  0.4919     0.4129 0.000 0.752 0.048 0.200
#> GSM25427     1  0.4224     0.7272 0.808 0.008 0.020 0.164
#> GSM25540     3  0.4290     0.5799 0.000 0.016 0.772 0.212
#> GSM25541     3  0.5438     0.5850 0.024 0.028 0.728 0.220
#> GSM25542     2  0.7888    -0.4355 0.000 0.368 0.288 0.344
#> GSM25543     4  0.7971     0.3911 0.004 0.252 0.364 0.380
#> GSM25479     1  0.2751     0.7596 0.904 0.000 0.056 0.040
#> GSM25480     1  0.3903     0.7545 0.844 0.000 0.076 0.080
#> GSM25481     1  0.6540     0.6224 0.660 0.080 0.024 0.236
#> GSM25482     1  0.6056     0.6588 0.700 0.068 0.020 0.212
#> GSM48654     2  0.5673     0.1469 0.000 0.528 0.024 0.448
#> GSM48650     2  0.4406     0.3729 0.000 0.700 0.000 0.300
#> GSM48651     2  0.4746     0.3206 0.000 0.632 0.000 0.368
#> GSM48652     2  0.4830     0.2622 0.000 0.608 0.000 0.392
#> GSM48653     2  0.5673     0.1713 0.000 0.528 0.024 0.448
#> GSM48662     2  0.5178     0.2693 0.004 0.600 0.004 0.392
#> GSM48663     2  0.5024     0.3163 0.008 0.632 0.000 0.360
#> GSM25524     3  0.5537     0.5653 0.256 0.000 0.688 0.056
#> GSM25525     1  0.4938     0.6914 0.772 0.000 0.148 0.080
#> GSM25526     3  0.4781     0.6475 0.212 0.000 0.752 0.036
#> GSM25527     1  0.4312     0.7241 0.812 0.000 0.132 0.056
#> GSM25528     1  0.6207     0.0796 0.496 0.000 0.452 0.052
#> GSM25529     1  0.5254     0.6312 0.724 0.000 0.220 0.056
#> GSM25530     3  0.6247     0.0900 0.428 0.000 0.516 0.056
#> GSM25531     1  0.4994     0.6624 0.744 0.000 0.208 0.048
#> GSM48661     4  0.7151     0.1455 0.000 0.420 0.132 0.448
#> GSM25561     3  0.5732     0.5585 0.264 0.000 0.672 0.064
#> GSM25562     1  0.5905     0.6848 0.700 0.000 0.156 0.144
#> GSM25563     3  0.2500     0.7213 0.044 0.000 0.916 0.040
#> GSM25564     1  0.9769    -0.2220 0.320 0.212 0.168 0.300
#> GSM25565     2  0.4673     0.4242 0.000 0.700 0.008 0.292
#> GSM25566     2  0.3751     0.4994 0.000 0.800 0.004 0.196
#> GSM25568     4  0.8455     0.3696 0.068 0.224 0.188 0.520
#> GSM25569     2  0.5126     0.2443 0.000 0.552 0.004 0.444
#> GSM25552     2  0.6034     0.2808 0.036 0.592 0.008 0.364
#> GSM25553     2  0.7531     0.0772 0.120 0.460 0.016 0.404
#> GSM25578     1  0.2983     0.7556 0.892 0.000 0.068 0.040
#> GSM25579     1  0.6392     0.6250 0.676 0.008 0.152 0.164
#> GSM25580     1  0.1733     0.7637 0.948 0.000 0.024 0.028
#> GSM25581     1  0.2222     0.7607 0.924 0.000 0.060 0.016
#> GSM48655     2  0.3400     0.4813 0.000 0.820 0.000 0.180
#> GSM48656     2  0.5435     0.1968 0.000 0.564 0.016 0.420
#> GSM48657     2  0.3764     0.4377 0.000 0.784 0.000 0.216
#> GSM48658     4  0.6624     0.0287 0.008 0.400 0.064 0.528
#> GSM25624     1  0.3004     0.7639 0.892 0.000 0.048 0.060
#> GSM25625     3  0.4365     0.6943 0.188 0.000 0.784 0.028
#> GSM25626     3  0.1624     0.7133 0.020 0.000 0.952 0.028
#> GSM25627     3  0.6667     0.5415 0.060 0.072 0.688 0.180
#> GSM25628     3  0.2662     0.6823 0.000 0.016 0.900 0.084
#> GSM25629     3  0.5298     0.5550 0.004 0.072 0.748 0.176
#> GSM25630     3  0.2644     0.7224 0.060 0.000 0.908 0.032
#> GSM25631     4  0.8475     0.2865 0.060 0.216 0.216 0.508
#> GSM25632     3  0.4194     0.6901 0.172 0.000 0.800 0.028
#> GSM25633     1  0.2843     0.7528 0.892 0.000 0.088 0.020
#> GSM25634     1  0.2256     0.7634 0.924 0.000 0.056 0.020
#> GSM25635     1  0.1837     0.7639 0.944 0.000 0.028 0.028
#> GSM25656     3  0.4274     0.6220 0.000 0.044 0.808 0.148
#> GSM25657     1  0.4880     0.6907 0.760 0.000 0.188 0.052
#> GSM25658     3  0.6327     0.0205 0.444 0.000 0.496 0.060
#> GSM25659     1  0.7054     0.4751 0.572 0.000 0.232 0.196
#> GSM25660     1  0.2739     0.7604 0.904 0.000 0.060 0.036
#> GSM25661     1  0.2408     0.7641 0.920 0.000 0.044 0.036
#> GSM25662     2  0.4220     0.4342 0.000 0.748 0.004 0.248
#> GSM25663     2  0.5596     0.3445 0.000 0.696 0.068 0.236
#> GSM25680     2  0.5487     0.2976 0.000 0.580 0.020 0.400
#> GSM25681     2  0.6347     0.2168 0.000 0.524 0.064 0.412
#> GSM25682     2  0.0817     0.5070 0.000 0.976 0.000 0.024
#> GSM25683     2  0.1022     0.5064 0.000 0.968 0.000 0.032
#> GSM25684     2  0.4222     0.4232 0.000 0.728 0.000 0.272
#> GSM25685     2  0.5446     0.3586 0.000 0.680 0.044 0.276
#> GSM25686     2  0.0707     0.5043 0.000 0.980 0.000 0.020
#> GSM25687     2  0.1022     0.5079 0.000 0.968 0.000 0.032
#> GSM48664     1  0.2741     0.7509 0.892 0.000 0.012 0.096
#> GSM48665     1  0.2101     0.7571 0.928 0.000 0.012 0.060

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     5   0.559     0.4000 0.000 0.280 0.004 0.096 0.620
#> GSM25549     5   0.619     0.3754 0.000 0.328 0.008 0.124 0.540
#> GSM25550     5   0.681     0.3597 0.008 0.284 0.008 0.192 0.508
#> GSM25551     5   0.447     0.4096 0.000 0.132 0.012 0.080 0.776
#> GSM25570     5   0.590     0.3811 0.000 0.312 0.004 0.112 0.572
#> GSM25571     5   0.553     0.4006 0.000 0.268 0.004 0.096 0.632
#> GSM25358     4   0.901     0.3207 0.180 0.064 0.204 0.412 0.140
#> GSM25359     3   0.827     0.0510 0.000 0.176 0.364 0.164 0.296
#> GSM25360     3   0.389     0.6682 0.100 0.032 0.828 0.040 0.000
#> GSM25361     3   0.771     0.5524 0.104 0.184 0.568 0.092 0.052
#> GSM25377     4   0.499     0.4946 0.452 0.008 0.016 0.524 0.000
#> GSM25378     4   0.512     0.5891 0.380 0.008 0.012 0.588 0.012
#> GSM25401     4   0.718     0.4384 0.088 0.036 0.140 0.620 0.116
#> GSM25402     4   0.693     0.5406 0.168 0.032 0.144 0.616 0.040
#> GSM25349     5   0.687     0.0114 0.000 0.352 0.016 0.184 0.448
#> GSM25350     5   0.638     0.1096 0.000 0.384 0.012 0.120 0.484
#> GSM25356     4   0.565     0.6283 0.332 0.024 0.000 0.596 0.048
#> GSM25357     5   0.565     0.2903 0.004 0.104 0.020 0.188 0.684
#> GSM25385     3   0.599     0.5326 0.188 0.020 0.640 0.152 0.000
#> GSM25386     3   0.300     0.6640 0.040 0.016 0.880 0.064 0.000
#> GSM25399     1   0.497    -0.1824 0.564 0.000 0.032 0.404 0.000
#> GSM25400     4   0.574     0.3319 0.432 0.004 0.072 0.492 0.000
#> GSM48659     2   0.518     0.4104 0.000 0.588 0.028 0.012 0.372
#> GSM48660     5   0.544    -0.3612 0.000 0.468 0.004 0.048 0.480
#> GSM25409     5   0.672     0.2740 0.004 0.300 0.020 0.148 0.528
#> GSM25410     3   0.297     0.6633 0.032 0.016 0.880 0.072 0.000
#> GSM25426     5   0.631     0.2114 0.000 0.200 0.052 0.116 0.632
#> GSM25427     4   0.529     0.5549 0.428 0.020 0.004 0.536 0.012
#> GSM25540     3   0.528     0.6133 0.008 0.136 0.744 0.068 0.044
#> GSM25541     3   0.569     0.6243 0.040 0.160 0.716 0.064 0.020
#> GSM25542     2   0.790     0.2870 0.000 0.364 0.284 0.072 0.280
#> GSM25543     3   0.817    -0.2080 0.004 0.312 0.368 0.100 0.216
#> GSM25479     1   0.371     0.5915 0.816 0.004 0.044 0.136 0.000
#> GSM25480     1   0.450     0.5889 0.772 0.016 0.064 0.148 0.000
#> GSM25481     4   0.611     0.6308 0.320 0.044 0.004 0.584 0.048
#> GSM25482     4   0.565     0.6237 0.368 0.036 0.000 0.568 0.028
#> GSM48654     2   0.483     0.5279 0.000 0.644 0.024 0.008 0.324
#> GSM48650     5   0.524    -0.1830 0.000 0.372 0.004 0.044 0.580
#> GSM48651     2   0.508     0.3557 0.000 0.496 0.008 0.020 0.476
#> GSM48652     2   0.487     0.4740 0.000 0.588 0.016 0.008 0.388
#> GSM48653     2   0.561     0.5237 0.000 0.612 0.040 0.032 0.316
#> GSM48662     2   0.519     0.4355 0.000 0.596 0.008 0.036 0.360
#> GSM48663     5   0.609    -0.2368 0.000 0.416 0.000 0.124 0.460
#> GSM25524     3   0.589     0.0956 0.432 0.008 0.484 0.076 0.000
#> GSM25525     1   0.422     0.5828 0.796 0.012 0.120 0.072 0.000
#> GSM25526     3   0.701     0.3233 0.296 0.020 0.488 0.192 0.004
#> GSM25527     1   0.413     0.5916 0.804 0.012 0.108 0.076 0.000
#> GSM25528     1   0.522     0.4390 0.644 0.004 0.288 0.064 0.000
#> GSM25529     1   0.377     0.5970 0.828 0.012 0.104 0.056 0.000
#> GSM25530     1   0.627     0.2565 0.520 0.008 0.344 0.128 0.000
#> GSM25531     1   0.508     0.5472 0.712 0.004 0.144 0.140 0.000
#> GSM48661     2   0.626     0.4934 0.000 0.632 0.136 0.040 0.192
#> GSM25561     3   0.631     0.3185 0.360 0.020 0.520 0.100 0.000
#> GSM25562     1   0.642     0.2922 0.596 0.036 0.128 0.240 0.000
#> GSM25563     3   0.390     0.6666 0.096 0.028 0.828 0.048 0.000
#> GSM25564     1   0.977    -0.1018 0.292 0.232 0.176 0.156 0.144
#> GSM25565     5   0.606    -0.1902 0.000 0.408 0.036 0.048 0.508
#> GSM25566     5   0.509     0.3167 0.000 0.288 0.008 0.048 0.656
#> GSM25568     2   0.814     0.3019 0.048 0.516 0.168 0.180 0.088
#> GSM25569     2   0.530     0.4198 0.000 0.660 0.020 0.048 0.272
#> GSM25552     5   0.660     0.3415 0.004 0.352 0.004 0.164 0.476
#> GSM25553     5   0.833     0.2410 0.076 0.316 0.020 0.224 0.364
#> GSM25578     1   0.230     0.6010 0.908 0.000 0.040 0.052 0.000
#> GSM25579     1   0.608     0.4889 0.692 0.064 0.076 0.152 0.016
#> GSM25580     1   0.249     0.5512 0.872 0.000 0.004 0.124 0.000
#> GSM25581     1   0.319     0.5754 0.852 0.004 0.032 0.112 0.000
#> GSM48655     5   0.480     0.1421 0.000 0.272 0.000 0.052 0.676
#> GSM48656     2   0.543     0.5109 0.004 0.644 0.024 0.036 0.292
#> GSM48657     5   0.548    -0.1395 0.000 0.352 0.004 0.064 0.580
#> GSM48658     2   0.653     0.4641 0.008 0.624 0.096 0.056 0.216
#> GSM25624     1   0.535     0.3644 0.660 0.016 0.060 0.264 0.000
#> GSM25625     3   0.601     0.4837 0.252 0.008 0.600 0.140 0.000
#> GSM25626     3   0.302     0.6634 0.036 0.008 0.872 0.084 0.000
#> GSM25627     3   0.855     0.4130 0.080 0.124 0.468 0.236 0.092
#> GSM25628     3   0.321     0.6632 0.012 0.076 0.872 0.032 0.008
#> GSM25629     3   0.776     0.4099 0.020 0.232 0.520 0.132 0.096
#> GSM25630     3   0.409     0.6602 0.104 0.020 0.812 0.064 0.000
#> GSM25631     2   0.847    -0.0150 0.068 0.492 0.144 0.104 0.192
#> GSM25632     3   0.556     0.5287 0.236 0.012 0.656 0.096 0.000
#> GSM25633     1   0.339     0.5974 0.852 0.008 0.060 0.080 0.000
#> GSM25634     1   0.389     0.5591 0.804 0.008 0.040 0.148 0.000
#> GSM25635     1   0.401     0.5294 0.788 0.016 0.024 0.172 0.000
#> GSM25656     3   0.569     0.6320 0.024 0.136 0.724 0.080 0.036
#> GSM25657     1   0.427     0.5838 0.784 0.004 0.116 0.096 0.000
#> GSM25658     1   0.724     0.1177 0.416 0.012 0.320 0.244 0.008
#> GSM25659     1   0.751     0.3778 0.560 0.096 0.176 0.152 0.016
#> GSM25660     1   0.312     0.5897 0.860 0.016 0.016 0.108 0.000
#> GSM25661     1   0.284     0.5621 0.868 0.004 0.016 0.112 0.000
#> GSM25662     5   0.515     0.1670 0.000 0.268 0.024 0.036 0.672
#> GSM25663     5   0.669     0.2885 0.004 0.216 0.116 0.060 0.604
#> GSM25680     5   0.667     0.3120 0.000 0.352 0.036 0.108 0.504
#> GSM25681     5   0.728     0.2996 0.000 0.336 0.076 0.120 0.468
#> GSM25682     5   0.208     0.4017 0.000 0.032 0.004 0.040 0.924
#> GSM25683     5   0.183     0.3918 0.000 0.028 0.004 0.032 0.936
#> GSM25684     5   0.484     0.1355 0.000 0.304 0.024 0.012 0.660
#> GSM25685     5   0.588     0.0880 0.000 0.288 0.040 0.056 0.616
#> GSM25686     5   0.175     0.3994 0.000 0.028 0.000 0.036 0.936
#> GSM25687     5   0.280     0.3910 0.000 0.068 0.004 0.044 0.884
#> GSM48664     1   0.425    -0.1091 0.624 0.004 0.000 0.372 0.000
#> GSM48665     1   0.380     0.2195 0.700 0.000 0.000 0.300 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
#> GSM25548     5   0.282     0.4186 0.000 0.096 0.004 0.004 0.864 0.032
#> GSM25549     5   0.421     0.4269 0.004 0.132 0.000 0.028 0.776 0.060
#> GSM25550     5   0.433     0.4269 0.020 0.056 0.008 0.032 0.800 0.084
#> GSM25551     5   0.699    -0.4109 0.000 0.232 0.032 0.028 0.460 0.248
#> GSM25570     5   0.245     0.4399 0.004 0.068 0.000 0.004 0.892 0.032
#> GSM25571     5   0.270     0.4284 0.000 0.092 0.004 0.004 0.872 0.028
#> GSM25358     4   0.864     0.1265 0.088 0.020 0.216 0.376 0.108 0.192
#> GSM25359     3   0.853    -0.0568 0.004 0.108 0.284 0.084 0.276 0.244
#> GSM25360     3   0.574     0.5567 0.168 0.004 0.672 0.032 0.032 0.092
#> GSM25361     3   0.852     0.3905 0.108 0.056 0.368 0.024 0.220 0.224
#> GSM25377     4   0.452     0.5321 0.200 0.004 0.020 0.724 0.000 0.052
#> GSM25378     4   0.560     0.5396 0.196 0.004 0.040 0.664 0.012 0.084
#> GSM25401     4   0.731     0.2691 0.048 0.032 0.164 0.496 0.016 0.244
#> GSM25402     4   0.634     0.4433 0.072 0.008 0.136 0.620 0.012 0.152
#> GSM25349     2   0.774     0.0917 0.004 0.416 0.016 0.140 0.208 0.216
#> GSM25350     2   0.721     0.1001 0.000 0.444 0.004 0.116 0.248 0.188
#> GSM25356     4   0.409     0.5700 0.144 0.000 0.028 0.784 0.032 0.012
#> GSM25357     5   0.815    -0.3704 0.004 0.268 0.024 0.200 0.324 0.180
#> GSM25385     3   0.661     0.4509 0.172 0.000 0.568 0.160 0.012 0.088
#> GSM25386     3   0.403     0.6031 0.064 0.004 0.812 0.036 0.008 0.076
#> GSM25399     4   0.452     0.3449 0.336 0.000 0.032 0.624 0.000 0.008
#> GSM25400     4   0.630     0.2816 0.344 0.000 0.064 0.504 0.008 0.080
#> GSM48659     2   0.607     0.2813 0.000 0.592 0.020 0.020 0.204 0.164
#> GSM48660     2   0.335     0.3982 0.000 0.844 0.000 0.036 0.064 0.056
#> GSM25409     5   0.788    -0.0318 0.020 0.272 0.020 0.108 0.416 0.164
#> GSM25410     3   0.390     0.6083 0.036 0.000 0.820 0.052 0.016 0.076
#> GSM25426     6   0.759     0.0000 0.000 0.332 0.044 0.048 0.244 0.332
#> GSM25427     4   0.511     0.5527 0.176 0.008 0.028 0.712 0.012 0.064
#> GSM25540     3   0.641     0.5227 0.020 0.064 0.576 0.000 0.104 0.236
#> GSM25541     3   0.703     0.5363 0.068 0.052 0.528 0.004 0.088 0.260
#> GSM25542     2   0.761     0.0558 0.000 0.404 0.220 0.032 0.080 0.264
#> GSM25543     3   0.864     0.0123 0.016 0.268 0.316 0.072 0.112 0.216
#> GSM25479     1   0.466     0.5192 0.716 0.000 0.032 0.208 0.008 0.036
#> GSM25480     1   0.566     0.5281 0.684 0.000 0.048 0.152 0.036 0.080
#> GSM25481     4   0.557     0.5477 0.112 0.044 0.020 0.716 0.024 0.084
#> GSM25482     4   0.573     0.5496 0.156 0.032 0.012 0.688 0.036 0.076
#> GSM48654     2   0.436     0.4169 0.000 0.760 0.016 0.004 0.100 0.120
#> GSM48650     2   0.456     0.2448 0.000 0.752 0.000 0.044 0.096 0.108
#> GSM48651     2   0.347     0.3841 0.000 0.820 0.000 0.012 0.112 0.056
#> GSM48652     2   0.314     0.4207 0.000 0.848 0.004 0.004 0.072 0.072
#> GSM48653     2   0.425     0.3939 0.000 0.768 0.008 0.012 0.076 0.136
#> GSM48662     2   0.418     0.4135 0.000 0.752 0.000 0.008 0.160 0.080
#> GSM48663     2   0.600     0.2758 0.000 0.632 0.004 0.120 0.096 0.148
#> GSM25524     1   0.589     0.0907 0.508 0.000 0.368 0.052 0.000 0.072
#> GSM25525     1   0.385     0.5700 0.816 0.000 0.088 0.032 0.008 0.056
#> GSM25526     3   0.697     0.2523 0.304 0.004 0.428 0.068 0.000 0.196
#> GSM25527     1   0.464     0.5545 0.752 0.000 0.076 0.092 0.000 0.080
#> GSM25528     1   0.478     0.5095 0.692 0.000 0.224 0.040 0.000 0.044
#> GSM25529     1   0.358     0.5682 0.832 0.000 0.080 0.032 0.004 0.052
#> GSM25530     1   0.591     0.3759 0.572 0.000 0.272 0.108 0.000 0.048
#> GSM25531     1   0.473     0.5359 0.736 0.000 0.100 0.120 0.000 0.044
#> GSM48661     2   0.594     0.2961 0.004 0.612 0.072 0.012 0.052 0.248
#> GSM25561     3   0.674     0.1432 0.344 0.000 0.452 0.108 0.004 0.092
#> GSM25562     1   0.740     0.2045 0.460 0.012 0.132 0.276 0.012 0.108
#> GSM25563     3   0.531     0.5650 0.128 0.000 0.692 0.084 0.000 0.096
#> GSM25564     1   0.959    -0.0732 0.244 0.204 0.092 0.144 0.088 0.228
#> GSM25565     2   0.670     0.1514 0.000 0.496 0.024 0.024 0.220 0.236
#> GSM25566     2   0.639    -0.2777 0.000 0.416 0.000 0.036 0.388 0.160
#> GSM25568     2   0.919     0.1175 0.060 0.332 0.152 0.160 0.080 0.216
#> GSM25569     2   0.574     0.3773 0.000 0.640 0.016 0.024 0.164 0.156
#> GSM25552     5   0.497     0.4134 0.020 0.092 0.000 0.024 0.728 0.136
#> GSM25553     5   0.606     0.3650 0.064 0.048 0.004 0.080 0.668 0.136
#> GSM25578     1   0.391     0.5518 0.776 0.000 0.040 0.164 0.000 0.020
#> GSM25579     1   0.644     0.4620 0.644 0.004 0.068 0.072 0.100 0.112
#> GSM25580     1   0.408     0.4233 0.688 0.000 0.008 0.284 0.000 0.020
#> GSM25581     1   0.392     0.5037 0.748 0.000 0.020 0.212 0.000 0.020
#> GSM48655     2   0.551     0.0580 0.000 0.600 0.000 0.016 0.252 0.132
#> GSM48656     2   0.484     0.4191 0.004 0.736 0.024 0.008 0.096 0.132
#> GSM48657     2   0.505     0.1960 0.000 0.692 0.000 0.032 0.168 0.108
#> GSM48658     2   0.708     0.2712 0.024 0.524 0.080 0.004 0.148 0.220
#> GSM25624     1   0.635     0.0196 0.468 0.004 0.048 0.388 0.008 0.084
#> GSM25625     3   0.614     0.4441 0.248 0.004 0.580 0.084 0.000 0.084
#> GSM25626     3   0.343     0.6088 0.060 0.000 0.832 0.020 0.000 0.088
#> GSM25627     3   0.823     0.2891 0.096 0.100 0.368 0.092 0.016 0.328
#> GSM25628     3   0.417     0.6073 0.016 0.028 0.776 0.008 0.012 0.160
#> GSM25629     3   0.695     0.3126 0.028 0.124 0.424 0.016 0.024 0.384
#> GSM25630     3   0.450     0.5645 0.148 0.000 0.748 0.056 0.000 0.048
#> GSM25631     5   0.835     0.1883 0.084 0.168 0.108 0.020 0.440 0.180
#> GSM25632     3   0.542     0.3819 0.296 0.000 0.596 0.080 0.000 0.028
#> GSM25633     1   0.452     0.5115 0.724 0.000 0.048 0.196 0.000 0.032
#> GSM25634     1   0.533     0.3903 0.624 0.000 0.040 0.280 0.004 0.052
#> GSM25635     1   0.498     0.3470 0.608 0.000 0.020 0.324 0.000 0.048
#> GSM25656     3   0.611     0.5476 0.020 0.060 0.600 0.020 0.032 0.268
#> GSM25657     1   0.530     0.4658 0.632 0.000 0.096 0.248 0.000 0.024
#> GSM25658     1   0.771     0.1072 0.376 0.004 0.244 0.180 0.004 0.192
#> GSM25659     1   0.765     0.3738 0.540 0.024 0.136 0.120 0.060 0.120
#> GSM25660     1   0.412     0.5279 0.768 0.000 0.020 0.168 0.008 0.036
#> GSM25661     1   0.454     0.4665 0.696 0.000 0.016 0.236 0.000 0.052
#> GSM25662     2   0.662    -0.2415 0.000 0.468 0.020 0.020 0.308 0.184
#> GSM25663     5   0.720    -0.0699 0.004 0.288 0.056 0.008 0.404 0.240
#> GSM25680     5   0.483     0.3571 0.004 0.160 0.016 0.004 0.720 0.096
#> GSM25681     5   0.515     0.3843 0.016 0.080 0.044 0.016 0.744 0.100
#> GSM25682     5   0.585    -0.1920 0.000 0.400 0.000 0.016 0.460 0.124
#> GSM25683     5   0.591    -0.2268 0.000 0.424 0.000 0.020 0.436 0.120
#> GSM25684     2   0.622    -0.2173 0.000 0.476 0.008 0.012 0.332 0.172
#> GSM25685     2   0.697    -0.5126 0.000 0.416 0.028 0.020 0.260 0.276
#> GSM25686     5   0.596    -0.1904 0.000 0.416 0.000 0.020 0.436 0.128
#> GSM25687     5   0.593    -0.1841 0.000 0.408 0.000 0.020 0.448 0.124
#> GSM48664     4   0.433     0.3310 0.336 0.000 0.004 0.636 0.004 0.020
#> GSM48665     4   0.433     0.0522 0.464 0.000 0.000 0.516 0.000 0.020

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-skmeans-collect-classes

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

test_to_known_factors(res)
#>              n genotype/variation(p) k
#> MAD:skmeans 97              1.29e-05 2
#> MAD:skmeans 89              2.70e-05 3
#> MAD:skmeans 50              1.06e-05 4
#> MAD:skmeans 37              1.35e-03 5
#> MAD:skmeans 27              8.71e-02 6

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


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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.461           0.819       0.903         0.4615 0.535   0.535
#> 3 3 0.395           0.714       0.824         0.4297 0.746   0.544
#> 4 4 0.487           0.645       0.776         0.1178 0.893   0.692
#> 5 5 0.530           0.480       0.745         0.0484 0.964   0.868
#> 6 6 0.559           0.543       0.746         0.0281 0.921   0.692

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
#> GSM25548     2  0.0000      0.912 0.000 1.000
#> GSM25549     2  0.0000      0.912 0.000 1.000
#> GSM25550     2  0.0000      0.912 0.000 1.000
#> GSM25551     2  0.7139      0.767 0.196 0.804
#> GSM25570     2  0.0000      0.912 0.000 1.000
#> GSM25571     2  0.0000      0.912 0.000 1.000
#> GSM25358     2  0.0938      0.912 0.012 0.988
#> GSM25359     2  0.3733      0.879 0.072 0.928
#> GSM25360     1  0.9286      0.622 0.656 0.344
#> GSM25361     2  0.4939      0.855 0.108 0.892
#> GSM25377     2  0.8267      0.659 0.260 0.740
#> GSM25378     2  0.7219      0.742 0.200 0.800
#> GSM25401     1  0.3274      0.859 0.940 0.060
#> GSM25402     1  0.9732      0.401 0.596 0.404
#> GSM25349     2  0.0672      0.913 0.008 0.992
#> GSM25350     2  0.0000      0.912 0.000 1.000
#> GSM25356     2  0.5946      0.809 0.144 0.856
#> GSM25357     2  0.0376      0.912 0.004 0.996
#> GSM25385     1  0.2236      0.859 0.964 0.036
#> GSM25386     1  0.7745      0.749 0.772 0.228
#> GSM25399     1  0.2948      0.856 0.948 0.052
#> GSM25400     1  0.6531      0.814 0.832 0.168
#> GSM48659     2  0.1414      0.910 0.020 0.980
#> GSM48660     2  0.0672      0.912 0.008 0.992
#> GSM25409     2  0.0376      0.912 0.004 0.996
#> GSM25410     1  0.6343      0.832 0.840 0.160
#> GSM25426     2  0.9491      0.413 0.368 0.632
#> GSM25427     2  0.3431      0.876 0.064 0.936
#> GSM25540     2  0.8207      0.691 0.256 0.744
#> GSM25541     2  0.9896      0.164 0.440 0.560
#> GSM25542     2  0.1843      0.907 0.028 0.972
#> GSM25543     2  0.0938      0.913 0.012 0.988
#> GSM25479     1  0.9129      0.543 0.672 0.328
#> GSM25480     2  0.7815      0.707 0.232 0.768
#> GSM25481     2  0.0672      0.910 0.008 0.992
#> GSM25482     2  0.6048      0.806 0.148 0.852
#> GSM48654     2  0.0938      0.912 0.012 0.988
#> GSM48650     2  0.0376      0.912 0.004 0.996
#> GSM48651     2  0.1184      0.912 0.016 0.984
#> GSM48652     2  0.1843      0.906 0.028 0.972
#> GSM48653     2  0.5519      0.834 0.128 0.872
#> GSM48662     2  0.0000      0.912 0.000 1.000
#> GSM48663     2  0.0672      0.912 0.008 0.992
#> GSM25524     1  0.5842      0.820 0.860 0.140
#> GSM25525     1  0.7815      0.733 0.768 0.232
#> GSM25526     1  0.3114      0.860 0.944 0.056
#> GSM25527     1  0.3584      0.851 0.932 0.068
#> GSM25528     1  0.0672      0.853 0.992 0.008
#> GSM25529     1  0.1414      0.857 0.980 0.020
#> GSM25530     1  0.0000      0.851 1.000 0.000
#> GSM25531     1  0.0000      0.851 1.000 0.000
#> GSM48661     2  0.4298      0.870 0.088 0.912
#> GSM25561     1  0.6712      0.791 0.824 0.176
#> GSM25562     1  0.9866      0.335 0.568 0.432
#> GSM25563     1  0.7745      0.740 0.772 0.228
#> GSM25564     2  0.2236      0.903 0.036 0.964
#> GSM25565     2  0.0672      0.912 0.008 0.992
#> GSM25566     2  0.1184      0.911 0.016 0.984
#> GSM25568     2  0.1184      0.912 0.016 0.984
#> GSM25569     2  0.0376      0.913 0.004 0.996
#> GSM25552     2  0.0000      0.912 0.000 1.000
#> GSM25553     2  0.0376      0.911 0.004 0.996
#> GSM25578     2  0.7883      0.697 0.236 0.764
#> GSM25579     2  0.5059      0.857 0.112 0.888
#> GSM25580     1  0.3879      0.851 0.924 0.076
#> GSM25581     1  0.2043      0.856 0.968 0.032
#> GSM48655     2  0.0376      0.912 0.004 0.996
#> GSM48656     2  0.0938      0.912 0.012 0.988
#> GSM48657     2  0.1633      0.909 0.024 0.976
#> GSM48658     2  0.5059      0.850 0.112 0.888
#> GSM25624     1  0.8763      0.629 0.704 0.296
#> GSM25625     1  0.3114      0.860 0.944 0.056
#> GSM25626     1  0.3114      0.860 0.944 0.056
#> GSM25627     1  0.3114      0.860 0.944 0.056
#> GSM25628     1  0.4815      0.844 0.896 0.104
#> GSM25629     1  0.3114      0.860 0.944 0.056
#> GSM25630     1  0.0938      0.855 0.988 0.012
#> GSM25631     2  0.0938      0.911 0.012 0.988
#> GSM25632     1  0.0376      0.853 0.996 0.004
#> GSM25633     1  0.5842      0.827 0.860 0.140
#> GSM25634     1  0.1184      0.856 0.984 0.016
#> GSM25635     1  0.8608      0.676 0.716 0.284
#> GSM25656     2  0.8016      0.690 0.244 0.756
#> GSM25657     1  0.3114      0.858 0.944 0.056
#> GSM25658     1  0.2948      0.860 0.948 0.052
#> GSM25659     2  0.6148      0.808 0.152 0.848
#> GSM25660     2  0.9491      0.413 0.368 0.632
#> GSM25661     1  0.9209      0.564 0.664 0.336
#> GSM25662     2  0.0672      0.912 0.008 0.992
#> GSM25663     2  0.0672      0.912 0.008 0.992
#> GSM25680     2  0.0672      0.912 0.008 0.992
#> GSM25681     2  0.0376      0.912 0.004 0.996
#> GSM25682     2  0.0376      0.912 0.004 0.996
#> GSM25683     2  0.0672      0.912 0.008 0.992
#> GSM25684     2  0.0672      0.912 0.008 0.992
#> GSM25685     2  0.6048      0.816 0.148 0.852
#> GSM25686     2  0.0672      0.912 0.008 0.992
#> GSM25687     2  0.0376      0.912 0.004 0.996
#> GSM48664     2  0.4690      0.857 0.100 0.900
#> GSM48665     2  0.9522      0.439 0.372 0.628

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.2356      0.825 0.000 0.928 0.072
#> GSM25549     2  0.0892      0.828 0.000 0.980 0.020
#> GSM25550     2  0.2165      0.826 0.000 0.936 0.064
#> GSM25551     2  0.4807      0.762 0.092 0.848 0.060
#> GSM25570     2  0.0747      0.827 0.000 0.984 0.016
#> GSM25571     2  0.0592      0.826 0.000 0.988 0.012
#> GSM25358     3  0.4654      0.773 0.000 0.208 0.792
#> GSM25359     2  0.3618      0.804 0.012 0.884 0.104
#> GSM25360     1  0.9030      0.118 0.492 0.140 0.368
#> GSM25361     3  0.6090      0.700 0.020 0.264 0.716
#> GSM25377     2  0.6699      0.641 0.256 0.700 0.044
#> GSM25378     2  0.3116      0.794 0.108 0.892 0.000
#> GSM25401     1  0.6113      0.676 0.688 0.012 0.300
#> GSM25402     3  0.7451      0.237 0.396 0.040 0.564
#> GSM25349     2  0.3941      0.768 0.000 0.844 0.156
#> GSM25350     2  0.2261      0.829 0.000 0.932 0.068
#> GSM25356     2  0.1636      0.824 0.020 0.964 0.016
#> GSM25357     2  0.2711      0.808 0.000 0.912 0.088
#> GSM25385     1  0.0475      0.830 0.992 0.004 0.004
#> GSM25386     3  0.5881      0.534 0.256 0.016 0.728
#> GSM25399     1  0.1832      0.827 0.956 0.008 0.036
#> GSM25400     1  0.7363      0.516 0.656 0.064 0.280
#> GSM48659     3  0.4978      0.747 0.004 0.216 0.780
#> GSM48660     3  0.5363      0.729 0.000 0.276 0.724
#> GSM25409     2  0.1964      0.825 0.000 0.944 0.056
#> GSM25410     1  0.6644      0.752 0.752 0.108 0.140
#> GSM25426     3  0.2806      0.755 0.040 0.032 0.928
#> GSM25427     2  0.4137      0.788 0.096 0.872 0.032
#> GSM25540     3  0.7043      0.665 0.136 0.136 0.728
#> GSM25541     3  0.6374      0.681 0.132 0.100 0.768
#> GSM25542     3  0.4291      0.786 0.000 0.180 0.820
#> GSM25543     3  0.6126      0.617 0.004 0.352 0.644
#> GSM25479     1  0.6180      0.479 0.660 0.332 0.008
#> GSM25480     2  0.2492      0.819 0.048 0.936 0.016
#> GSM25481     2  0.2496      0.828 0.004 0.928 0.068
#> GSM25482     2  0.1905      0.822 0.028 0.956 0.016
#> GSM48654     3  0.3816      0.791 0.000 0.148 0.852
#> GSM48650     3  0.6291      0.382 0.000 0.468 0.532
#> GSM48651     3  0.3551      0.788 0.000 0.132 0.868
#> GSM48652     2  0.6252      0.496 0.008 0.648 0.344
#> GSM48653     3  0.1129      0.776 0.004 0.020 0.976
#> GSM48662     2  0.6126      0.258 0.000 0.600 0.400
#> GSM48663     3  0.4504      0.775 0.000 0.196 0.804
#> GSM25524     1  0.5958      0.662 0.692 0.008 0.300
#> GSM25525     1  0.5219      0.737 0.788 0.196 0.016
#> GSM25526     1  0.4261      0.811 0.848 0.012 0.140
#> GSM25527     1  0.1411      0.833 0.964 0.036 0.000
#> GSM25528     1  0.0475      0.830 0.992 0.004 0.004
#> GSM25529     1  0.3263      0.835 0.912 0.048 0.040
#> GSM25530     1  0.2063      0.833 0.948 0.008 0.044
#> GSM25531     1  0.0475      0.830 0.992 0.004 0.004
#> GSM48661     3  0.1964      0.783 0.000 0.056 0.944
#> GSM25561     1  0.6981      0.723 0.732 0.132 0.136
#> GSM25562     3  0.7821      0.520 0.224 0.116 0.660
#> GSM25563     3  0.3349      0.709 0.108 0.004 0.888
#> GSM25564     3  0.6696      0.526 0.020 0.348 0.632
#> GSM25565     3  0.4887      0.750 0.000 0.228 0.772
#> GSM25566     2  0.2682      0.819 0.004 0.920 0.076
#> GSM25568     2  0.5431      0.589 0.000 0.716 0.284
#> GSM25569     2  0.2356      0.819 0.000 0.928 0.072
#> GSM25552     2  0.2878      0.818 0.000 0.904 0.096
#> GSM25553     2  0.2625      0.821 0.000 0.916 0.084
#> GSM25578     2  0.4702      0.706 0.212 0.788 0.000
#> GSM25579     2  0.3481      0.826 0.044 0.904 0.052
#> GSM25580     1  0.0661      0.829 0.988 0.008 0.004
#> GSM25581     1  0.0424      0.830 0.992 0.008 0.000
#> GSM48655     2  0.5948      0.284 0.000 0.640 0.360
#> GSM48656     3  0.4504      0.780 0.000 0.196 0.804
#> GSM48657     3  0.4654      0.769 0.000 0.208 0.792
#> GSM48658     3  0.1989      0.780 0.004 0.048 0.948
#> GSM25624     1  0.5848      0.604 0.720 0.268 0.012
#> GSM25625     1  0.4261      0.811 0.848 0.012 0.140
#> GSM25626     1  0.4110      0.809 0.844 0.004 0.152
#> GSM25627     1  0.4261      0.811 0.848 0.012 0.140
#> GSM25628     1  0.6404      0.610 0.644 0.012 0.344
#> GSM25629     1  0.4805      0.797 0.812 0.012 0.176
#> GSM25630     1  0.2066      0.837 0.940 0.000 0.060
#> GSM25631     2  0.2400      0.825 0.004 0.932 0.064
#> GSM25632     1  0.3030      0.827 0.904 0.004 0.092
#> GSM25633     1  0.2651      0.819 0.928 0.060 0.012
#> GSM25634     1  0.0829      0.831 0.984 0.004 0.012
#> GSM25635     1  0.4733      0.705 0.800 0.196 0.004
#> GSM25656     3  0.3009      0.763 0.028 0.052 0.920
#> GSM25657     1  0.2806      0.838 0.928 0.032 0.040
#> GSM25658     1  0.4195      0.813 0.852 0.012 0.136
#> GSM25659     3  0.8223      0.551 0.108 0.288 0.604
#> GSM25660     2  0.6247      0.430 0.376 0.620 0.004
#> GSM25661     1  0.5178      0.625 0.744 0.256 0.000
#> GSM25662     3  0.3116      0.786 0.000 0.108 0.892
#> GSM25663     3  0.3482      0.786 0.000 0.128 0.872
#> GSM25680     2  0.1964      0.831 0.000 0.944 0.056
#> GSM25681     2  0.0592      0.826 0.000 0.988 0.012
#> GSM25682     2  0.4887      0.661 0.000 0.772 0.228
#> GSM25683     3  0.4504      0.774 0.000 0.196 0.804
#> GSM25684     3  0.3192      0.786 0.000 0.112 0.888
#> GSM25685     3  0.0475      0.767 0.004 0.004 0.992
#> GSM25686     3  0.5835      0.638 0.000 0.340 0.660
#> GSM25687     2  0.5882      0.376 0.000 0.652 0.348
#> GSM48664     3  0.9241      0.339 0.164 0.352 0.484
#> GSM48665     2  0.6154      0.378 0.408 0.592 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.0817     0.8252 0.000 0.976 0.000 0.024
#> GSM25549     2  0.0000     0.8264 0.000 1.000 0.000 0.000
#> GSM25550     2  0.0817     0.8252 0.000 0.976 0.000 0.024
#> GSM25551     2  0.4253     0.7184 0.016 0.776 0.208 0.000
#> GSM25570     2  0.0000     0.8264 0.000 1.000 0.000 0.000
#> GSM25571     2  0.0000     0.8264 0.000 1.000 0.000 0.000
#> GSM25358     4  0.3400     0.7276 0.000 0.180 0.000 0.820
#> GSM25359     2  0.5522     0.7089 0.000 0.716 0.204 0.080
#> GSM25360     4  0.8389    -0.0385 0.108 0.076 0.364 0.452
#> GSM25361     4  0.6357     0.6414 0.000 0.232 0.124 0.644
#> GSM25377     1  0.3819     0.6889 0.816 0.172 0.004 0.008
#> GSM25378     2  0.2335     0.8101 0.060 0.920 0.020 0.000
#> GSM25401     3  0.6635     0.6046 0.152 0.000 0.620 0.228
#> GSM25402     4  0.6634     0.4237 0.164 0.000 0.212 0.624
#> GSM25349     2  0.4307     0.7617 0.000 0.784 0.024 0.192
#> GSM25350     2  0.1661     0.8281 0.000 0.944 0.004 0.052
#> GSM25356     2  0.3396     0.8135 0.016 0.884 0.036 0.064
#> GSM25357     2  0.4633     0.7626 0.000 0.780 0.048 0.172
#> GSM25385     3  0.5168     0.3057 0.492 0.000 0.504 0.004
#> GSM25386     4  0.6467     0.5308 0.080 0.008 0.292 0.620
#> GSM25399     1  0.1474     0.7169 0.948 0.000 0.052 0.000
#> GSM25400     1  0.7545     0.3953 0.616 0.060 0.204 0.120
#> GSM48659     4  0.5140     0.7245 0.000 0.144 0.096 0.760
#> GSM48660     4  0.3706     0.7079 0.000 0.112 0.040 0.848
#> GSM25409     2  0.3399     0.8016 0.000 0.868 0.040 0.092
#> GSM25410     3  0.8010     0.6109 0.136 0.116 0.600 0.148
#> GSM25426     4  0.5415     0.5246 0.004 0.008 0.436 0.552
#> GSM25427     2  0.5004     0.2446 0.392 0.604 0.000 0.004
#> GSM25540     4  0.8145     0.3982 0.060 0.104 0.376 0.460
#> GSM25541     4  0.6744     0.4221 0.008 0.068 0.456 0.468
#> GSM25542     4  0.1940     0.7595 0.000 0.076 0.000 0.924
#> GSM25543     4  0.5113     0.5817 0.000 0.264 0.032 0.704
#> GSM25479     1  0.6750     0.4048 0.612 0.208 0.180 0.000
#> GSM25480     2  0.2837     0.8194 0.028 0.912 0.036 0.024
#> GSM25481     2  0.2335     0.8202 0.020 0.920 0.000 0.060
#> GSM25482     2  0.6338     0.7319 0.140 0.716 0.040 0.104
#> GSM48654     4  0.3486     0.7607 0.000 0.044 0.092 0.864
#> GSM48650     4  0.6619     0.4406 0.000 0.332 0.100 0.568
#> GSM48651     4  0.1854     0.7582 0.000 0.048 0.012 0.940
#> GSM48652     2  0.6378     0.5297 0.000 0.628 0.108 0.264
#> GSM48653     4  0.2530     0.7465 0.000 0.000 0.112 0.888
#> GSM48662     2  0.5352     0.3981 0.000 0.596 0.016 0.388
#> GSM48663     4  0.1913     0.7406 0.000 0.020 0.040 0.940
#> GSM25524     3  0.6071     0.6511 0.144 0.000 0.684 0.172
#> GSM25525     3  0.7529     0.3540 0.344 0.196 0.460 0.000
#> GSM25526     3  0.3074     0.7527 0.152 0.000 0.848 0.000
#> GSM25527     3  0.6188     0.4799 0.396 0.056 0.548 0.000
#> GSM25528     1  0.4991     0.0429 0.608 0.000 0.388 0.004
#> GSM25529     1  0.5755     0.3719 0.624 0.044 0.332 0.000
#> GSM25530     3  0.4713     0.5951 0.360 0.000 0.640 0.000
#> GSM25531     1  0.4134     0.4605 0.740 0.000 0.260 0.000
#> GSM48661     4  0.3056     0.7586 0.000 0.072 0.040 0.888
#> GSM25561     1  0.5937     0.6124 0.712 0.088 0.188 0.012
#> GSM25562     4  0.8018     0.3017 0.036 0.128 0.404 0.432
#> GSM25563     4  0.5364     0.5954 0.028 0.000 0.320 0.652
#> GSM25564     4  0.6066     0.5009 0.028 0.312 0.024 0.636
#> GSM25565     4  0.4050     0.7197 0.000 0.168 0.024 0.808
#> GSM25566     2  0.4171     0.7867 0.000 0.824 0.060 0.116
#> GSM25568     2  0.4456     0.6125 0.000 0.716 0.004 0.280
#> GSM25569     2  0.3612     0.8040 0.000 0.856 0.044 0.100
#> GSM25552     2  0.1389     0.8249 0.000 0.952 0.000 0.048
#> GSM25553     2  0.0921     0.8254 0.000 0.972 0.000 0.028
#> GSM25578     1  0.5078     0.6092 0.700 0.272 0.028 0.000
#> GSM25579     2  0.4242     0.8043 0.068 0.848 0.036 0.048
#> GSM25580     1  0.0000     0.7391 1.000 0.000 0.000 0.000
#> GSM25581     1  0.0000     0.7391 1.000 0.000 0.000 0.000
#> GSM48655     2  0.6044     0.2933 0.000 0.528 0.044 0.428
#> GSM48656     4  0.3047     0.7531 0.000 0.116 0.012 0.872
#> GSM48657     4  0.3071     0.7255 0.000 0.068 0.044 0.888
#> GSM48658     4  0.3501     0.7528 0.000 0.020 0.132 0.848
#> GSM25624     1  0.6193     0.4354 0.672 0.148 0.180 0.000
#> GSM25625     3  0.2868     0.7487 0.136 0.000 0.864 0.000
#> GSM25626     3  0.3597     0.7542 0.148 0.000 0.836 0.016
#> GSM25627     3  0.3024     0.7525 0.148 0.000 0.852 0.000
#> GSM25628     3  0.4583     0.6433 0.076 0.004 0.808 0.112
#> GSM25629     3  0.1302     0.6940 0.044 0.000 0.956 0.000
#> GSM25630     3  0.5558     0.6324 0.324 0.000 0.640 0.036
#> GSM25631     2  0.0817     0.8252 0.000 0.976 0.000 0.024
#> GSM25632     3  0.3448     0.7521 0.168 0.000 0.828 0.004
#> GSM25633     1  0.1661     0.7418 0.944 0.052 0.000 0.004
#> GSM25634     1  0.1938     0.7217 0.936 0.000 0.052 0.012
#> GSM25635     1  0.0000     0.7391 1.000 0.000 0.000 0.000
#> GSM25656     4  0.5636     0.5316 0.000 0.024 0.424 0.552
#> GSM25657     3  0.5535     0.4917 0.420 0.020 0.560 0.000
#> GSM25658     3  0.3123     0.7527 0.156 0.000 0.844 0.000
#> GSM25659     4  0.7499     0.4887 0.124 0.268 0.032 0.576
#> GSM25660     1  0.3672     0.6918 0.824 0.164 0.012 0.000
#> GSM25661     1  0.1474     0.7426 0.948 0.052 0.000 0.000
#> GSM25662     4  0.2843     0.7529 0.000 0.020 0.088 0.892
#> GSM25663     4  0.0707     0.7569 0.000 0.020 0.000 0.980
#> GSM25680     2  0.0592     0.8263 0.000 0.984 0.000 0.016
#> GSM25681     2  0.0000     0.8264 0.000 1.000 0.000 0.000
#> GSM25682     2  0.5717     0.5997 0.000 0.632 0.044 0.324
#> GSM25683     4  0.2111     0.7376 0.000 0.024 0.044 0.932
#> GSM25684     4  0.2949     0.7527 0.000 0.024 0.088 0.888
#> GSM25685     4  0.2704     0.7456 0.000 0.000 0.124 0.876
#> GSM25686     4  0.4552     0.6337 0.000 0.172 0.044 0.784
#> GSM25687     2  0.6055     0.3328 0.000 0.520 0.044 0.436
#> GSM48664     1  0.4245     0.6921 0.832 0.104 0.008 0.056
#> GSM48665     1  0.0336     0.7418 0.992 0.008 0.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
#> GSM25548     5  0.0162     0.7186 0.000 0.004 0.000 0.000 0.996
#> GSM25549     5  0.0000     0.7186 0.000 0.000 0.000 0.000 1.000
#> GSM25550     5  0.0162     0.7186 0.000 0.004 0.000 0.000 0.996
#> GSM25551     5  0.5701     0.4834 0.000 0.060 0.100 0.136 0.704
#> GSM25570     5  0.0000     0.7186 0.000 0.000 0.000 0.000 1.000
#> GSM25571     5  0.0000     0.7186 0.000 0.000 0.000 0.000 1.000
#> GSM25358     2  0.3243     0.5273 0.000 0.812 0.004 0.004 0.180
#> GSM25359     5  0.6062     0.3249 0.000 0.012 0.116 0.288 0.584
#> GSM25360     3  0.5501     0.1072 0.000 0.444 0.492 0.000 0.064
#> GSM25361     2  0.6190     0.4471 0.000 0.636 0.056 0.088 0.220
#> GSM25377     1  0.3357     0.7170 0.836 0.000 0.016 0.012 0.136
#> GSM25378     5  0.2214     0.6980 0.052 0.000 0.028 0.004 0.916
#> GSM25401     3  0.3966     0.5747 0.008 0.224 0.756 0.012 0.000
#> GSM25402     2  0.5732     0.2676 0.020 0.544 0.388 0.048 0.000
#> GSM25349     5  0.5358     0.3954 0.000 0.092 0.008 0.228 0.672
#> GSM25350     5  0.1981     0.7061 0.000 0.028 0.000 0.048 0.924
#> GSM25356     5  0.4518     0.3383 0.016 0.000 0.004 0.320 0.660
#> GSM25357     5  0.5310    -0.2412 0.000 0.040 0.004 0.448 0.508
#> GSM25385     3  0.4507     0.2800 0.412 0.004 0.580 0.004 0.000
#> GSM25386     2  0.5532     0.4670 0.000 0.644 0.256 0.092 0.008
#> GSM25399     1  0.5109     0.6226 0.696 0.000 0.132 0.172 0.000
#> GSM25400     1  0.7298     0.2060 0.476 0.116 0.336 0.004 0.068
#> GSM48659     2  0.2694     0.5231 0.004 0.864 0.000 0.004 0.128
#> GSM48660     2  0.4959     0.3327 0.000 0.684 0.000 0.240 0.076
#> GSM25409     5  0.2648     0.6332 0.000 0.000 0.000 0.152 0.848
#> GSM25410     3  0.5632     0.6202 0.012 0.152 0.712 0.028 0.096
#> GSM25426     2  0.6600     0.3122 0.004 0.496 0.264 0.236 0.000
#> GSM25427     5  0.4630     0.2156 0.416 0.004 0.000 0.008 0.572
#> GSM25540     2  0.8008     0.1733 0.004 0.360 0.332 0.228 0.076
#> GSM25541     2  0.7607     0.2739 0.004 0.436 0.284 0.228 0.048
#> GSM25542     2  0.3558     0.5412 0.000 0.828 0.000 0.108 0.064
#> GSM25543     2  0.5779     0.2703 0.000 0.624 0.008 0.116 0.252
#> GSM25479     1  0.7146     0.2824 0.476 0.004 0.288 0.024 0.208
#> GSM25480     5  0.2656     0.6985 0.028 0.000 0.012 0.064 0.896
#> GSM25481     5  0.3757     0.6134 0.008 0.040 0.000 0.136 0.816
#> GSM25482     5  0.6030     0.3198 0.196 0.000 0.000 0.224 0.580
#> GSM48654     2  0.1787     0.5800 0.004 0.936 0.000 0.044 0.016
#> GSM48650     2  0.6646    -0.3107 0.004 0.444 0.000 0.356 0.196
#> GSM48651     2  0.3003     0.5474 0.000 0.864 0.000 0.092 0.044
#> GSM48652     5  0.4614     0.2707 0.004 0.356 0.008 0.004 0.628
#> GSM48653     2  0.0000     0.5828 0.000 1.000 0.000 0.000 0.000
#> GSM48662     5  0.5300     0.1217 0.000 0.328 0.000 0.068 0.604
#> GSM48663     2  0.4341     0.0918 0.000 0.592 0.000 0.404 0.004
#> GSM25524     3  0.5398     0.6396 0.032 0.144 0.716 0.108 0.000
#> GSM25525     3  0.5541     0.4684 0.164 0.000 0.648 0.000 0.188
#> GSM25526     3  0.0404     0.7031 0.012 0.000 0.988 0.000 0.000
#> GSM25527     3  0.4303     0.5788 0.192 0.000 0.752 0.000 0.056
#> GSM25528     3  0.4420     0.1183 0.448 0.004 0.548 0.000 0.000
#> GSM25529     1  0.7051     0.3075 0.524 0.008 0.300 0.124 0.044
#> GSM25530     3  0.3231     0.6047 0.196 0.000 0.800 0.004 0.000
#> GSM25531     1  0.4437     0.1439 0.532 0.000 0.464 0.004 0.000
#> GSM48661     2  0.1831     0.5776 0.000 0.920 0.000 0.004 0.076
#> GSM25561     1  0.4788     0.6033 0.748 0.004 0.100 0.144 0.004
#> GSM25562     2  0.8183     0.2206 0.000 0.352 0.316 0.208 0.124
#> GSM25563     2  0.5476     0.4785 0.004 0.664 0.204 0.128 0.000
#> GSM25564     2  0.4552     0.2318 0.004 0.668 0.020 0.000 0.308
#> GSM25565     2  0.4049     0.4895 0.000 0.780 0.000 0.056 0.164
#> GSM25566     5  0.3873     0.5507 0.000 0.012 0.008 0.212 0.768
#> GSM25568     5  0.4016     0.3960 0.000 0.272 0.000 0.012 0.716
#> GSM25569     5  0.3387     0.6363 0.000 0.032 0.004 0.128 0.836
#> GSM25552     5  0.1121     0.7094 0.000 0.044 0.000 0.000 0.956
#> GSM25553     5  0.0404     0.7179 0.000 0.012 0.000 0.000 0.988
#> GSM25578     1  0.4025     0.5939 0.700 0.000 0.008 0.000 0.292
#> GSM25579     5  0.3759     0.6733 0.072 0.024 0.024 0.028 0.852
#> GSM25580     1  0.0290     0.7612 0.992 0.000 0.008 0.000 0.000
#> GSM25581     1  0.0290     0.7615 0.992 0.000 0.008 0.000 0.000
#> GSM48655     5  0.6673    -0.4820 0.000 0.244 0.000 0.332 0.424
#> GSM48656     2  0.3575     0.5463 0.000 0.824 0.000 0.056 0.120
#> GSM48657     2  0.5175    -0.1952 0.000 0.496 0.000 0.464 0.040
#> GSM48658     2  0.2597     0.5872 0.000 0.904 0.040 0.036 0.020
#> GSM25624     1  0.5772     0.5029 0.652 0.000 0.188 0.012 0.148
#> GSM25625     3  0.2642     0.6777 0.008 0.008 0.880 0.104 0.000
#> GSM25626     3  0.0968     0.7050 0.012 0.012 0.972 0.004 0.000
#> GSM25627     3  0.2857     0.6762 0.008 0.012 0.868 0.112 0.000
#> GSM25628     3  0.5932     0.4821 0.004 0.140 0.620 0.232 0.004
#> GSM25629     3  0.5499     0.5352 0.004 0.112 0.652 0.232 0.000
#> GSM25630     3  0.4588     0.6333 0.128 0.012 0.768 0.092 0.000
#> GSM25631     5  0.0162     0.7186 0.000 0.004 0.000 0.000 0.996
#> GSM25632     3  0.1082     0.7031 0.028 0.000 0.964 0.008 0.000
#> GSM25633     1  0.0451     0.7626 0.988 0.000 0.004 0.000 0.008
#> GSM25634     1  0.1341     0.7465 0.944 0.000 0.056 0.000 0.000
#> GSM25635     1  0.0162     0.7606 0.996 0.000 0.004 0.000 0.000
#> GSM25656     2  0.6785     0.3265 0.004 0.504 0.256 0.228 0.008
#> GSM25657     3  0.4218     0.4635 0.324 0.000 0.668 0.004 0.004
#> GSM25658     3  0.0404     0.7031 0.012 0.000 0.988 0.000 0.000
#> GSM25659     2  0.6904     0.2033 0.088 0.568 0.060 0.012 0.272
#> GSM25660     1  0.3106     0.7131 0.840 0.000 0.020 0.000 0.140
#> GSM25661     1  0.0486     0.7616 0.988 0.000 0.004 0.004 0.004
#> GSM25662     2  0.0451     0.5819 0.000 0.988 0.000 0.008 0.004
#> GSM25663     2  0.2416     0.5511 0.000 0.888 0.000 0.100 0.012
#> GSM25680     5  0.0162     0.7185 0.000 0.000 0.000 0.004 0.996
#> GSM25681     5  0.0000     0.7186 0.000 0.000 0.000 0.000 1.000
#> GSM25682     4  0.6118     0.4050 0.000 0.128 0.000 0.468 0.404
#> GSM25683     2  0.4440    -0.0732 0.000 0.528 0.000 0.468 0.004
#> GSM25684     2  0.0727     0.5830 0.004 0.980 0.000 0.004 0.012
#> GSM25685     2  0.1026     0.5845 0.004 0.968 0.024 0.004 0.000
#> GSM25686     4  0.5816     0.1171 0.000 0.440 0.000 0.468 0.092
#> GSM25687     4  0.6469     0.5722 0.000 0.196 0.000 0.468 0.336
#> GSM48664     1  0.1059     0.7565 0.968 0.020 0.000 0.004 0.008
#> GSM48665     1  0.0609     0.7606 0.980 0.000 0.020 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
#> GSM25548     4  0.0000    0.75083 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25549     4  0.0000    0.75083 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25550     4  0.0146    0.75089 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM25551     4  0.4230    0.51813 0.000 0.004 0.024 0.676 0.004 0.292
#> GSM25570     4  0.0000    0.75083 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25571     4  0.0000    0.75083 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25358     5  0.2656    0.66655 0.000 0.008 0.000 0.120 0.860 0.012
#> GSM25359     4  0.6513    0.31771 0.000 0.124 0.056 0.528 0.012 0.280
#> GSM25360     5  0.4974    0.04130 0.000 0.000 0.440 0.056 0.500 0.004
#> GSM25361     5  0.4914    0.47183 0.000 0.000 0.008 0.152 0.680 0.160
#> GSM25377     1  0.3235    0.71612 0.836 0.016 0.016 0.124 0.000 0.008
#> GSM25378     4  0.2495    0.72827 0.048 0.008 0.024 0.900 0.000 0.020
#> GSM25401     3  0.3370    0.49299 0.000 0.004 0.772 0.000 0.212 0.012
#> GSM25402     5  0.5222    0.18732 0.000 0.052 0.400 0.000 0.528 0.020
#> GSM25349     4  0.5466    0.44578 0.000 0.212 0.000 0.640 0.112 0.036
#> GSM25350     4  0.2186    0.73517 0.000 0.056 0.000 0.908 0.024 0.012
#> GSM25356     4  0.4646    0.19957 0.016 0.396 0.000 0.568 0.000 0.020
#> GSM25357     2  0.4841    0.38843 0.000 0.576 0.000 0.372 0.040 0.012
#> GSM25385     3  0.4658    0.37165 0.384 0.000 0.568 0.000 0.000 0.048
#> GSM25386     5  0.5521    0.23336 0.000 0.000 0.188 0.004 0.580 0.228
#> GSM25399     1  0.6552    0.35649 0.468 0.056 0.160 0.000 0.000 0.316
#> GSM25400     1  0.6576    0.00774 0.440 0.008 0.392 0.052 0.104 0.004
#> GSM48659     5  0.4003    0.60145 0.000 0.000 0.000 0.124 0.760 0.116
#> GSM48660     5  0.4516    0.38642 0.000 0.260 0.000 0.072 0.668 0.000
#> GSM25409     4  0.2558    0.67280 0.000 0.156 0.000 0.840 0.004 0.000
#> GSM25410     3  0.4536    0.56567 0.000 0.000 0.748 0.068 0.140 0.044
#> GSM25426     6  0.5411    0.70817 0.000 0.000 0.148 0.000 0.296 0.556
#> GSM25427     4  0.4668    0.20727 0.412 0.012 0.000 0.556 0.008 0.012
#> GSM25540     6  0.6676    0.71795 0.000 0.000 0.208 0.056 0.268 0.468
#> GSM25541     6  0.6123    0.72158 0.000 0.000 0.156 0.032 0.288 0.524
#> GSM25542     5  0.3107    0.64259 0.000 0.116 0.000 0.052 0.832 0.000
#> GSM25543     5  0.5084    0.38231 0.000 0.116 0.000 0.232 0.644 0.008
#> GSM25479     1  0.6773    0.26736 0.468 0.000 0.256 0.208 0.000 0.068
#> GSM25480     4  0.2811    0.73017 0.028 0.048 0.008 0.884 0.000 0.032
#> GSM25481     4  0.5125    0.49098 0.004 0.228 0.000 0.668 0.028 0.072
#> GSM25482     4  0.6746    0.13872 0.156 0.340 0.000 0.432 0.000 0.072
#> GSM48654     5  0.2593    0.67870 0.000 0.036 0.000 0.012 0.884 0.068
#> GSM48650     2  0.6591    0.41922 0.000 0.452 0.000 0.124 0.348 0.076
#> GSM48651     5  0.1320    0.69006 0.000 0.016 0.000 0.036 0.948 0.000
#> GSM48652     4  0.5046    0.38199 0.000 0.000 0.000 0.620 0.256 0.124
#> GSM48653     5  0.0146    0.68694 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM48662     4  0.4798    0.15978 0.000 0.060 0.000 0.564 0.376 0.000
#> GSM48663     5  0.3868   -0.21177 0.000 0.492 0.000 0.000 0.508 0.000
#> GSM25524     3  0.5598    0.29571 0.024 0.000 0.616 0.000 0.160 0.200
#> GSM25525     3  0.4416    0.57785 0.124 0.000 0.716 0.160 0.000 0.000
#> GSM25526     3  0.0000    0.67509 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25527     3  0.2837    0.68591 0.088 0.000 0.856 0.056 0.000 0.000
#> GSM25528     3  0.3782    0.30681 0.412 0.000 0.588 0.000 0.000 0.000
#> GSM25529     1  0.6525    0.23141 0.484 0.000 0.252 0.044 0.000 0.220
#> GSM25530     3  0.2482    0.68305 0.148 0.000 0.848 0.000 0.000 0.004
#> GSM25531     3  0.3982    0.11462 0.460 0.000 0.536 0.000 0.000 0.004
#> GSM48661     5  0.0547    0.68962 0.000 0.000 0.000 0.020 0.980 0.000
#> GSM25561     1  0.3695    0.58929 0.732 0.000 0.024 0.000 0.000 0.244
#> GSM25562     6  0.7278    0.61352 0.000 0.000 0.232 0.104 0.304 0.360
#> GSM25563     5  0.5068    0.12303 0.004 0.000 0.104 0.000 0.620 0.272
#> GSM25564     5  0.3543    0.39955 0.004 0.000 0.004 0.272 0.720 0.000
#> GSM25565     5  0.3045    0.64195 0.000 0.060 0.000 0.100 0.840 0.000
#> GSM25566     4  0.3838    0.56654 0.000 0.240 0.000 0.732 0.008 0.020
#> GSM25568     4  0.3606    0.47878 0.000 0.004 0.000 0.708 0.284 0.004
#> GSM25569     4  0.3235    0.67315 0.000 0.136 0.000 0.824 0.032 0.008
#> GSM25552     4  0.1387    0.73583 0.000 0.000 0.000 0.932 0.068 0.000
#> GSM25553     4  0.0260    0.75062 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM25578     1  0.3528    0.59108 0.700 0.000 0.004 0.296 0.000 0.000
#> GSM25579     4  0.3790    0.70199 0.072 0.016 0.004 0.832 0.040 0.036
#> GSM25580     1  0.0146    0.75853 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM25581     1  0.0260    0.75914 0.992 0.000 0.008 0.000 0.000 0.000
#> GSM48655     2  0.5941    0.40684 0.000 0.408 0.000 0.376 0.216 0.000
#> GSM48656     5  0.2672    0.67461 0.000 0.052 0.000 0.080 0.868 0.000
#> GSM48657     2  0.4312    0.46036 0.000 0.604 0.000 0.028 0.368 0.000
#> GSM48658     5  0.2469    0.66330 0.000 0.012 0.028 0.004 0.896 0.060
#> GSM25624     1  0.5386    0.47443 0.640 0.008 0.196 0.148 0.000 0.008
#> GSM25625     3  0.2491    0.53127 0.000 0.000 0.836 0.000 0.000 0.164
#> GSM25626     3  0.0363    0.67162 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM25627     3  0.3126    0.38930 0.000 0.000 0.752 0.000 0.000 0.248
#> GSM25628     6  0.4899    0.49137 0.000 0.000 0.404 0.000 0.064 0.532
#> GSM25629     6  0.4205    0.40303 0.000 0.000 0.420 0.000 0.016 0.564
#> GSM25630     3  0.5029    0.62228 0.056 0.208 0.692 0.000 0.008 0.036
#> GSM25631     4  0.0146    0.75082 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM25632     3  0.0806    0.67492 0.008 0.000 0.972 0.000 0.000 0.020
#> GSM25633     1  0.0291    0.75978 0.992 0.000 0.004 0.004 0.000 0.000
#> GSM25634     1  0.1387    0.73325 0.932 0.000 0.068 0.000 0.000 0.000
#> GSM25635     1  0.0000    0.75771 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25656     6  0.5475    0.70651 0.000 0.000 0.148 0.000 0.316 0.536
#> GSM25657     3  0.3452    0.60521 0.256 0.000 0.736 0.004 0.000 0.004
#> GSM25658     3  0.0000    0.67509 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25659     5  0.5419    0.39702 0.084 0.000 0.040 0.220 0.652 0.004
#> GSM25660     1  0.2846    0.70876 0.840 0.000 0.004 0.140 0.000 0.016
#> GSM25661     1  0.0260    0.75886 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM25662     5  0.0000    0.68708 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25663     5  0.0692    0.68706 0.000 0.020 0.000 0.004 0.976 0.000
#> GSM25680     4  0.0000    0.75083 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25681     4  0.0146    0.75083 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM25682     2  0.4433    0.42348 0.000 0.616 0.000 0.344 0.040 0.000
#> GSM25683     2  0.3717    0.41173 0.000 0.616 0.000 0.000 0.384 0.000
#> GSM25684     5  0.2003    0.65414 0.000 0.000 0.000 0.000 0.884 0.116
#> GSM25685     5  0.2454    0.63071 0.000 0.000 0.000 0.000 0.840 0.160
#> GSM25686     2  0.4814    0.55730 0.000 0.616 0.000 0.080 0.304 0.000
#> GSM25687     2  0.5048    0.58199 0.000 0.616 0.000 0.264 0.120 0.000
#> GSM48664     1  0.0717    0.75559 0.976 0.008 0.000 0.000 0.016 0.000
#> GSM48665     1  0.0692    0.75711 0.976 0.004 0.020 0.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-pam-collect-classes

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

test_to_known_factors(res)
#>          n genotype/variation(p) k
#> MAD:pam 94              1.39e-04 2
#> MAD:pam 89              1.66e-07 3
#> MAD:pam 79              1.69e-05 4
#> MAD:pam 59              7.29e-03 5
#> MAD:pam 62              7.42e-04 6

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


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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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 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-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.471           0.891       0.894         0.4688 0.495   0.495
#> 3 3 0.494           0.713       0.819         0.2822 0.838   0.680
#> 4 4 0.670           0.819       0.869         0.1206 0.895   0.729
#> 5 5 0.639           0.692       0.806         0.1333 0.885   0.641
#> 6 6 0.683           0.628       0.764         0.0596 0.901   0.586

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
#> GSM25548     2  0.0672      0.943 0.008 0.992
#> GSM25549     2  0.0938      0.943 0.012 0.988
#> GSM25550     2  0.1633      0.939 0.024 0.976
#> GSM25551     2  0.0000      0.942 0.000 1.000
#> GSM25570     2  0.1414      0.941 0.020 0.980
#> GSM25571     2  0.0938      0.943 0.012 0.988
#> GSM25358     1  0.5842      0.918 0.860 0.140
#> GSM25359     2  0.5408      0.852 0.124 0.876
#> GSM25360     1  0.5519      0.927 0.872 0.128
#> GSM25361     2  0.9358      0.429 0.352 0.648
#> GSM25377     1  0.5408      0.929 0.876 0.124
#> GSM25378     1  0.5408      0.929 0.876 0.124
#> GSM25401     1  0.7528      0.846 0.784 0.216
#> GSM25402     1  0.6148      0.910 0.848 0.152
#> GSM25349     2  0.0000      0.942 0.000 1.000
#> GSM25350     2  0.0000      0.942 0.000 1.000
#> GSM25356     1  0.5842      0.919 0.860 0.140
#> GSM25357     2  0.0000      0.942 0.000 1.000
#> GSM25385     1  0.5408      0.929 0.876 0.124
#> GSM25386     1  0.5519      0.927 0.872 0.128
#> GSM25399     1  0.5408      0.929 0.876 0.124
#> GSM25400     1  0.5408      0.929 0.876 0.124
#> GSM48659     2  0.0672      0.943 0.008 0.992
#> GSM48660     2  0.0000      0.942 0.000 1.000
#> GSM25409     2  0.0672      0.943 0.008 0.992
#> GSM25410     1  0.5408      0.929 0.876 0.124
#> GSM25426     2  0.1184      0.942 0.016 0.984
#> GSM25427     1  0.5408      0.929 0.876 0.124
#> GSM25540     2  0.7815      0.696 0.232 0.768
#> GSM25541     2  0.9427      0.406 0.360 0.640
#> GSM25542     2  0.3431      0.911 0.064 0.936
#> GSM25543     2  0.3879      0.900 0.076 0.924
#> GSM25479     1  0.0000      0.878 1.000 0.000
#> GSM25480     1  0.1184      0.887 0.984 0.016
#> GSM25481     1  0.8499      0.762 0.724 0.276
#> GSM25482     1  0.8144      0.799 0.748 0.252
#> GSM48654     2  0.0672      0.943 0.008 0.992
#> GSM48650     2  0.1414      0.941 0.020 0.980
#> GSM48651     2  0.0000      0.942 0.000 1.000
#> GSM48652     2  0.0000      0.942 0.000 1.000
#> GSM48653     2  0.0000      0.942 0.000 1.000
#> GSM48662     2  0.0000      0.942 0.000 1.000
#> GSM48663     2  0.1414      0.941 0.020 0.980
#> GSM25524     1  0.5408      0.929 0.876 0.124
#> GSM25525     1  0.0672      0.883 0.992 0.008
#> GSM25526     1  0.5408      0.929 0.876 0.124
#> GSM25527     1  0.0376      0.880 0.996 0.004
#> GSM25528     1  0.5408      0.929 0.876 0.124
#> GSM25529     1  0.0672      0.883 0.992 0.008
#> GSM25530     1  0.5408      0.929 0.876 0.124
#> GSM25531     1  0.4431      0.919 0.908 0.092
#> GSM48661     2  0.2778      0.925 0.048 0.952
#> GSM25561     1  0.5408      0.929 0.876 0.124
#> GSM25562     1  0.5178      0.927 0.884 0.116
#> GSM25563     1  0.5408      0.929 0.876 0.124
#> GSM25564     1  0.9286      0.634 0.656 0.344
#> GSM25565     2  0.0000      0.942 0.000 1.000
#> GSM25566     2  0.0000      0.942 0.000 1.000
#> GSM25568     2  0.7376      0.727 0.208 0.792
#> GSM25569     2  0.0000      0.942 0.000 1.000
#> GSM25552     2  0.2236      0.933 0.036 0.964
#> GSM25553     2  0.2948      0.922 0.052 0.948
#> GSM25578     1  0.0000      0.878 1.000 0.000
#> GSM25579     1  0.5178      0.927 0.884 0.116
#> GSM25580     1  0.0000      0.878 1.000 0.000
#> GSM25581     1  0.0000      0.878 1.000 0.000
#> GSM48655     2  0.0000      0.942 0.000 1.000
#> GSM48656     2  0.1633      0.939 0.024 0.976
#> GSM48657     2  0.0000      0.942 0.000 1.000
#> GSM48658     2  0.2778      0.925 0.048 0.952
#> GSM25624     1  0.1843      0.893 0.972 0.028
#> GSM25625     1  0.5408      0.929 0.876 0.124
#> GSM25626     1  0.5408      0.929 0.876 0.124
#> GSM25627     1  0.7745      0.832 0.772 0.228
#> GSM25628     1  0.8016      0.801 0.756 0.244
#> GSM25629     2  0.9833      0.156 0.424 0.576
#> GSM25630     1  0.5408      0.929 0.876 0.124
#> GSM25631     2  0.5737      0.837 0.136 0.864
#> GSM25632     1  0.5408      0.929 0.876 0.124
#> GSM25633     1  0.0000      0.878 1.000 0.000
#> GSM25634     1  0.0000      0.878 1.000 0.000
#> GSM25635     1  0.0000      0.878 1.000 0.000
#> GSM25656     1  0.8207      0.783 0.744 0.256
#> GSM25657     1  0.1633      0.891 0.976 0.024
#> GSM25658     1  0.5408      0.929 0.876 0.124
#> GSM25659     1  0.5629      0.924 0.868 0.132
#> GSM25660     1  0.0000      0.878 1.000 0.000
#> GSM25661     1  0.0000      0.878 1.000 0.000
#> GSM25662     2  0.0376      0.943 0.004 0.996
#> GSM25663     2  0.2603      0.928 0.044 0.956
#> GSM25680     2  0.1414      0.941 0.020 0.980
#> GSM25681     2  0.2236      0.933 0.036 0.964
#> GSM25682     2  0.0000      0.942 0.000 1.000
#> GSM25683     2  0.0000      0.942 0.000 1.000
#> GSM25684     2  0.0376      0.943 0.004 0.996
#> GSM25685     2  0.0938      0.943 0.012 0.988
#> GSM25686     2  0.0000      0.942 0.000 1.000
#> GSM25687     2  0.0000      0.942 0.000 1.000
#> GSM48664     1  0.5408      0.929 0.876 0.124
#> GSM48665     1  0.5408      0.929 0.876 0.124

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.1643     0.8937 0.000 0.956 0.044
#> GSM25549     2  0.1753     0.8932 0.000 0.952 0.048
#> GSM25550     2  0.2066     0.8907 0.000 0.940 0.060
#> GSM25551     2  0.0000     0.8908 0.000 1.000 0.000
#> GSM25570     2  0.2066     0.8902 0.000 0.940 0.060
#> GSM25571     2  0.1753     0.8932 0.000 0.952 0.048
#> GSM25358     1  0.9385     0.3622 0.484 0.188 0.328
#> GSM25359     2  0.4605     0.7696 0.000 0.796 0.204
#> GSM25360     3  0.3805     0.7074 0.092 0.024 0.884
#> GSM25361     3  0.7043     0.1014 0.020 0.448 0.532
#> GSM25377     1  0.7222     0.6187 0.696 0.084 0.220
#> GSM25378     1  0.7263     0.6199 0.692 0.084 0.224
#> GSM25401     3  0.8399     0.5026 0.188 0.188 0.624
#> GSM25402     1  0.8291     0.5194 0.580 0.100 0.320
#> GSM25349     2  0.0892     0.8936 0.000 0.980 0.020
#> GSM25350     2  0.0747     0.8872 0.000 0.984 0.016
#> GSM25356     1  0.7222     0.6187 0.696 0.084 0.220
#> GSM25357     2  0.1399     0.8868 0.004 0.968 0.028
#> GSM25385     3  0.5493     0.6049 0.232 0.012 0.756
#> GSM25386     3  0.1620     0.7067 0.024 0.012 0.964
#> GSM25399     1  0.7569     0.6184 0.664 0.088 0.248
#> GSM25400     1  0.7782     0.6073 0.648 0.096 0.256
#> GSM48659     2  0.1289     0.8943 0.000 0.968 0.032
#> GSM48660     2  0.0747     0.8839 0.000 0.984 0.016
#> GSM25409     2  0.1163     0.8948 0.000 0.972 0.028
#> GSM25410     3  0.2845     0.7175 0.068 0.012 0.920
#> GSM25426     2  0.4452     0.7851 0.000 0.808 0.192
#> GSM25427     1  0.7298     0.6183 0.692 0.088 0.220
#> GSM25540     2  0.6489     0.2124 0.004 0.540 0.456
#> GSM25541     3  0.6398     0.2116 0.004 0.416 0.580
#> GSM25542     2  0.4555     0.7704 0.000 0.800 0.200
#> GSM25543     2  0.4750     0.7523 0.000 0.784 0.216
#> GSM25479     1  0.2939     0.7055 0.916 0.012 0.072
#> GSM25480     1  0.3120     0.7089 0.908 0.012 0.080
#> GSM25481     1  0.7263     0.6149 0.692 0.084 0.224
#> GSM25482     1  0.7222     0.6187 0.696 0.084 0.220
#> GSM48654     2  0.1289     0.8943 0.000 0.968 0.032
#> GSM48650     2  0.4452     0.7851 0.000 0.808 0.192
#> GSM48651     2  0.0000     0.8908 0.000 1.000 0.000
#> GSM48652     2  0.0000     0.8908 0.000 1.000 0.000
#> GSM48653     2  0.0237     0.8909 0.000 0.996 0.004
#> GSM48662     2  0.0237     0.8893 0.000 0.996 0.004
#> GSM48663     2  0.4605     0.7884 0.000 0.796 0.204
#> GSM25524     3  0.4805     0.6743 0.176 0.012 0.812
#> GSM25525     1  0.3989     0.6982 0.864 0.012 0.124
#> GSM25526     3  0.4059     0.7034 0.128 0.012 0.860
#> GSM25527     1  0.3459     0.6985 0.892 0.012 0.096
#> GSM25528     1  0.6825     0.2414 0.500 0.012 0.488
#> GSM25529     1  0.4059     0.6956 0.860 0.012 0.128
#> GSM25530     3  0.5775     0.5625 0.260 0.012 0.728
#> GSM25531     1  0.5884     0.6389 0.716 0.012 0.272
#> GSM48661     2  0.4555     0.7750 0.000 0.800 0.200
#> GSM25561     3  0.6675     0.0846 0.404 0.012 0.584
#> GSM25562     1  0.7451     0.6157 0.636 0.060 0.304
#> GSM25563     3  0.2550     0.7160 0.056 0.012 0.932
#> GSM25564     3  0.9364     0.2406 0.172 0.372 0.456
#> GSM25565     2  0.0237     0.8909 0.000 0.996 0.004
#> GSM25566     2  0.0424     0.8874 0.000 0.992 0.008
#> GSM25568     2  0.6016     0.6815 0.020 0.724 0.256
#> GSM25569     2  0.0000     0.8908 0.000 1.000 0.000
#> GSM25552     2  0.3267     0.8611 0.000 0.884 0.116
#> GSM25553     2  0.5536     0.7246 0.012 0.752 0.236
#> GSM25578     1  0.2845     0.7041 0.920 0.012 0.068
#> GSM25579     1  0.8162     0.5510 0.568 0.084 0.348
#> GSM25580     1  0.2339     0.7002 0.940 0.012 0.048
#> GSM25581     1  0.2749     0.7041 0.924 0.012 0.064
#> GSM48655     2  0.0892     0.8826 0.000 0.980 0.020
#> GSM48656     2  0.1411     0.8939 0.000 0.964 0.036
#> GSM48657     2  0.0892     0.8846 0.000 0.980 0.020
#> GSM48658     2  0.4121     0.8099 0.000 0.832 0.168
#> GSM25624     1  0.3377     0.7114 0.896 0.012 0.092
#> GSM25625     3  0.4575     0.6883 0.160 0.012 0.828
#> GSM25626     3  0.2550     0.7170 0.056 0.012 0.932
#> GSM25627     3  0.5094     0.6639 0.040 0.136 0.824
#> GSM25628     3  0.1525     0.7003 0.004 0.032 0.964
#> GSM25629     3  0.3879     0.6474 0.000 0.152 0.848
#> GSM25630     3  0.4692     0.6860 0.168 0.012 0.820
#> GSM25631     2  0.4974     0.7395 0.000 0.764 0.236
#> GSM25632     3  0.4968     0.6678 0.188 0.012 0.800
#> GSM25633     1  0.2845     0.7041 0.920 0.012 0.068
#> GSM25634     1  0.2845     0.7041 0.920 0.012 0.068
#> GSM25635     1  0.2651     0.7050 0.928 0.012 0.060
#> GSM25656     3  0.2165     0.6992 0.000 0.064 0.936
#> GSM25657     1  0.3377     0.7066 0.896 0.012 0.092
#> GSM25658     3  0.6247     0.6183 0.212 0.044 0.744
#> GSM25659     1  0.8786     0.3535 0.464 0.112 0.424
#> GSM25660     1  0.2845     0.7060 0.920 0.012 0.068
#> GSM25661     1  0.2446     0.7016 0.936 0.012 0.052
#> GSM25662     2  0.1163     0.8947 0.000 0.972 0.028
#> GSM25663     2  0.2625     0.8741 0.000 0.916 0.084
#> GSM25680     2  0.1964     0.8884 0.000 0.944 0.056
#> GSM25681     2  0.3686     0.8419 0.000 0.860 0.140
#> GSM25682     2  0.0892     0.8826 0.000 0.980 0.020
#> GSM25683     2  0.0747     0.8840 0.000 0.984 0.016
#> GSM25684     2  0.0747     0.8940 0.000 0.984 0.016
#> GSM25685     2  0.4291     0.7984 0.000 0.820 0.180
#> GSM25686     2  0.0892     0.8826 0.000 0.980 0.020
#> GSM25687     2  0.0892     0.8826 0.000 0.980 0.020
#> GSM48664     1  0.7222     0.6230 0.696 0.084 0.220
#> GSM48665     1  0.7344     0.6235 0.684 0.084 0.232

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.2928     0.9066 0.004 0.896 0.024 0.076
#> GSM25549     2  0.2984     0.9007 0.000 0.888 0.028 0.084
#> GSM25550     2  0.3169     0.9023 0.004 0.884 0.028 0.084
#> GSM25551     2  0.1590     0.9192 0.008 0.956 0.008 0.028
#> GSM25570     2  0.2984     0.9007 0.000 0.888 0.028 0.084
#> GSM25571     2  0.2882     0.9025 0.000 0.892 0.024 0.084
#> GSM25358     2  0.7326     0.5696 0.100 0.640 0.192 0.068
#> GSM25359     2  0.2413     0.9190 0.004 0.924 0.036 0.036
#> GSM25360     3  0.4375     0.7898 0.144 0.036 0.812 0.008
#> GSM25361     2  0.8189     0.0516 0.100 0.472 0.360 0.068
#> GSM25377     4  0.3741     0.8708 0.108 0.004 0.036 0.852
#> GSM25378     4  0.3770     0.8721 0.104 0.004 0.040 0.852
#> GSM25401     4  0.8355     0.2589 0.052 0.144 0.348 0.456
#> GSM25402     4  0.7427     0.5207 0.096 0.036 0.304 0.564
#> GSM25349     2  0.2060     0.9169 0.000 0.932 0.016 0.052
#> GSM25350     2  0.2578     0.9098 0.000 0.912 0.036 0.052
#> GSM25356     4  0.3709     0.8709 0.100 0.004 0.040 0.856
#> GSM25357     2  0.2483     0.9159 0.000 0.916 0.032 0.052
#> GSM25385     3  0.3726     0.7728 0.212 0.000 0.788 0.000
#> GSM25386     3  0.2197     0.7939 0.080 0.004 0.916 0.000
#> GSM25399     4  0.4689     0.8289 0.184 0.004 0.036 0.776
#> GSM25400     4  0.6708     0.6709 0.256 0.016 0.096 0.632
#> GSM48659     2  0.1229     0.9210 0.008 0.968 0.020 0.004
#> GSM48660     2  0.2319     0.9026 0.000 0.924 0.040 0.036
#> GSM25409     2  0.1890     0.9200 0.000 0.936 0.008 0.056
#> GSM25410     3  0.2466     0.8006 0.096 0.004 0.900 0.000
#> GSM25426     2  0.3127     0.9006 0.008 0.892 0.068 0.032
#> GSM25427     4  0.3917     0.8712 0.108 0.004 0.044 0.844
#> GSM25540     3  0.7268     0.3804 0.048 0.356 0.540 0.056
#> GSM25541     3  0.7437     0.4263 0.056 0.328 0.552 0.064
#> GSM25542     2  0.2170     0.9180 0.008 0.936 0.028 0.028
#> GSM25543     2  0.2463     0.9157 0.008 0.924 0.036 0.032
#> GSM25479     1  0.0188     0.8982 0.996 0.000 0.004 0.000
#> GSM25480     1  0.0336     0.8985 0.992 0.000 0.008 0.000
#> GSM25481     4  0.3647     0.8689 0.096 0.004 0.040 0.860
#> GSM25482     4  0.3709     0.8709 0.100 0.004 0.040 0.856
#> GSM48654     2  0.0992     0.9225 0.008 0.976 0.012 0.004
#> GSM48650     2  0.2877     0.9112 0.008 0.904 0.060 0.028
#> GSM48651     2  0.0927     0.9220 0.008 0.976 0.000 0.016
#> GSM48652     2  0.0804     0.9220 0.008 0.980 0.000 0.012
#> GSM48653     2  0.0672     0.9220 0.008 0.984 0.000 0.008
#> GSM48662     2  0.0992     0.9226 0.008 0.976 0.004 0.012
#> GSM48663     2  0.2722     0.9067 0.000 0.904 0.064 0.032
#> GSM25524     3  0.4188     0.7449 0.244 0.004 0.752 0.000
#> GSM25525     1  0.1474     0.8832 0.948 0.000 0.052 0.000
#> GSM25526     3  0.2831     0.8050 0.120 0.004 0.876 0.000
#> GSM25527     1  0.1209     0.8934 0.964 0.000 0.032 0.004
#> GSM25528     1  0.5167    -0.1687 0.508 0.004 0.488 0.000
#> GSM25529     1  0.1474     0.8832 0.948 0.000 0.052 0.000
#> GSM25530     3  0.4134     0.7229 0.260 0.000 0.740 0.000
#> GSM25531     1  0.3311     0.7516 0.828 0.000 0.172 0.000
#> GSM48661     2  0.2261     0.9185 0.008 0.932 0.024 0.036
#> GSM25561     3  0.4697     0.5532 0.356 0.000 0.644 0.000
#> GSM25562     1  0.5932     0.6452 0.728 0.016 0.140 0.116
#> GSM25563     3  0.2831     0.8073 0.120 0.004 0.876 0.000
#> GSM25564     2  0.6538     0.6149 0.100 0.676 0.200 0.024
#> GSM25565     2  0.1229     0.9234 0.008 0.968 0.004 0.020
#> GSM25566     2  0.0927     0.9207 0.000 0.976 0.008 0.016
#> GSM25568     2  0.3574     0.8979 0.008 0.872 0.056 0.064
#> GSM25569     2  0.0927     0.9237 0.008 0.976 0.000 0.016
#> GSM25552     2  0.3082     0.9009 0.000 0.884 0.032 0.084
#> GSM25553     2  0.3886     0.8916 0.020 0.860 0.040 0.080
#> GSM25578     1  0.0188     0.8982 0.996 0.000 0.004 0.000
#> GSM25579     1  0.2198     0.8689 0.920 0.008 0.072 0.000
#> GSM25580     1  0.0469     0.8929 0.988 0.000 0.000 0.012
#> GSM25581     1  0.0188     0.8970 0.996 0.000 0.000 0.004
#> GSM48655     2  0.2500     0.8992 0.000 0.916 0.044 0.040
#> GSM48656     2  0.1854     0.9203 0.008 0.948 0.020 0.024
#> GSM48657     2  0.2319     0.9026 0.000 0.924 0.040 0.036
#> GSM48658     2  0.2153     0.9189 0.008 0.936 0.020 0.036
#> GSM25624     1  0.0336     0.8953 0.992 0.000 0.000 0.008
#> GSM25625     3  0.3052     0.8039 0.136 0.004 0.860 0.000
#> GSM25626     3  0.2530     0.8017 0.100 0.004 0.896 0.000
#> GSM25627     3  0.6492     0.4935 0.088 0.276 0.628 0.008
#> GSM25628     3  0.2670     0.7752 0.052 0.040 0.908 0.000
#> GSM25629     3  0.5285     0.6319 0.052 0.184 0.752 0.012
#> GSM25630     3  0.3626     0.7929 0.184 0.004 0.812 0.000
#> GSM25631     2  0.3450     0.9015 0.016 0.880 0.032 0.072
#> GSM25632     3  0.3569     0.7845 0.196 0.000 0.804 0.000
#> GSM25633     1  0.0188     0.8970 0.996 0.000 0.000 0.004
#> GSM25634     1  0.0188     0.8970 0.996 0.000 0.000 0.004
#> GSM25635     1  0.0921     0.8834 0.972 0.000 0.000 0.028
#> GSM25656     3  0.2466     0.7816 0.056 0.028 0.916 0.000
#> GSM25657     1  0.1576     0.8857 0.948 0.000 0.048 0.004
#> GSM25658     3  0.3351     0.8034 0.148 0.008 0.844 0.000
#> GSM25659     1  0.5527     0.6554 0.740 0.080 0.172 0.008
#> GSM25660     1  0.0336     0.8985 0.992 0.000 0.008 0.000
#> GSM25661     1  0.0336     0.8953 0.992 0.000 0.000 0.008
#> GSM25662     2  0.0859     0.9231 0.008 0.980 0.004 0.008
#> GSM25663     2  0.2505     0.9152 0.008 0.920 0.020 0.052
#> GSM25680     2  0.2528     0.9114 0.008 0.908 0.004 0.080
#> GSM25681     2  0.2803     0.9088 0.012 0.900 0.008 0.080
#> GSM25682     2  0.2675     0.8955 0.000 0.908 0.048 0.044
#> GSM25683     2  0.2670     0.8968 0.000 0.908 0.052 0.040
#> GSM25684     2  0.0672     0.9228 0.008 0.984 0.000 0.008
#> GSM25685     2  0.2546     0.9133 0.008 0.920 0.044 0.028
#> GSM25686     2  0.2675     0.8955 0.000 0.908 0.048 0.044
#> GSM25687     2  0.2675     0.8955 0.000 0.908 0.048 0.044
#> GSM48664     4  0.3725     0.8671 0.120 0.004 0.028 0.848
#> GSM48665     4  0.4419     0.8380 0.176 0.004 0.028 0.792

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     5  0.2612    0.70885 0.000 0.124 0.008 0.000 0.868
#> GSM25549     5  0.0727    0.65974 0.000 0.012 0.004 0.004 0.980
#> GSM25550     5  0.0727    0.65764 0.000 0.012 0.004 0.004 0.980
#> GSM25551     2  0.5300    0.29098 0.000 0.604 0.068 0.000 0.328
#> GSM25570     5  0.0613    0.65780 0.000 0.008 0.004 0.004 0.984
#> GSM25571     5  0.0833    0.66147 0.000 0.016 0.004 0.004 0.976
#> GSM25358     4  0.8993    0.27203 0.100 0.104 0.224 0.424 0.148
#> GSM25359     5  0.5447    0.64522 0.000 0.280 0.084 0.004 0.632
#> GSM25360     3  0.3578    0.69871 0.204 0.008 0.784 0.004 0.000
#> GSM25361     5  0.5030    0.33911 0.016 0.012 0.356 0.004 0.612
#> GSM25377     4  0.0162    0.84642 0.004 0.000 0.000 0.996 0.000
#> GSM25378     4  0.0162    0.84642 0.004 0.000 0.000 0.996 0.000
#> GSM25401     4  0.4643    0.55601 0.012 0.012 0.320 0.656 0.000
#> GSM25402     4  0.4497    0.63235 0.028 0.008 0.248 0.716 0.000
#> GSM25349     2  0.2629    0.78570 0.000 0.860 0.004 0.000 0.136
#> GSM25350     2  0.2074    0.80505 0.000 0.896 0.000 0.000 0.104
#> GSM25356     4  0.0162    0.84642 0.004 0.000 0.000 0.996 0.000
#> GSM25357     2  0.3289    0.80400 0.000 0.860 0.036 0.016 0.088
#> GSM25385     3  0.3768    0.72525 0.228 0.004 0.760 0.008 0.000
#> GSM25386     3  0.1628    0.78052 0.056 0.008 0.936 0.000 0.000
#> GSM25399     4  0.2390    0.81172 0.084 0.000 0.020 0.896 0.000
#> GSM25400     4  0.5714    0.41601 0.312 0.000 0.108 0.580 0.000
#> GSM48659     5  0.4719    0.69658 0.000 0.248 0.056 0.000 0.696
#> GSM48660     2  0.1478    0.81495 0.000 0.936 0.000 0.000 0.064
#> GSM25409     5  0.4262    0.42739 0.000 0.440 0.000 0.000 0.560
#> GSM25410     3  0.2017    0.78604 0.080 0.008 0.912 0.000 0.000
#> GSM25426     2  0.4328    0.71898 0.000 0.780 0.108 0.004 0.108
#> GSM25427     4  0.0290    0.84577 0.008 0.000 0.000 0.992 0.000
#> GSM25540     3  0.4552    0.31941 0.000 0.012 0.632 0.004 0.352
#> GSM25541     3  0.4692    0.00981 0.000 0.008 0.528 0.004 0.460
#> GSM25542     5  0.5596    0.53938 0.000 0.376 0.068 0.004 0.552
#> GSM25543     5  0.5849    0.64067 0.000 0.264 0.128 0.004 0.604
#> GSM25479     1  0.0290    0.90162 0.992 0.000 0.008 0.000 0.000
#> GSM25480     1  0.0771    0.90187 0.976 0.000 0.020 0.004 0.000
#> GSM25481     4  0.0162    0.84642 0.004 0.000 0.000 0.996 0.000
#> GSM25482     4  0.0162    0.84642 0.004 0.000 0.000 0.996 0.000
#> GSM48654     5  0.4927    0.65968 0.000 0.296 0.052 0.000 0.652
#> GSM48650     2  0.3400    0.77610 0.000 0.848 0.076 0.004 0.072
#> GSM48651     2  0.4603    0.45330 0.000 0.668 0.032 0.000 0.300
#> GSM48652     2  0.5236   -0.28288 0.000 0.492 0.044 0.000 0.464
#> GSM48653     5  0.5193    0.56756 0.000 0.364 0.052 0.000 0.584
#> GSM48662     5  0.4497    0.50064 0.000 0.424 0.008 0.000 0.568
#> GSM48663     2  0.1831    0.81552 0.000 0.920 0.000 0.004 0.076
#> GSM25524     3  0.4517    0.49897 0.372 0.008 0.616 0.004 0.000
#> GSM25525     1  0.2753    0.84111 0.856 0.008 0.136 0.000 0.000
#> GSM25526     3  0.2463    0.78817 0.100 0.008 0.888 0.004 0.000
#> GSM25527     1  0.1764    0.89026 0.928 0.000 0.064 0.008 0.000
#> GSM25528     1  0.3937    0.65926 0.736 0.008 0.252 0.004 0.000
#> GSM25529     1  0.2753    0.84111 0.856 0.008 0.136 0.000 0.000
#> GSM25530     3  0.4524    0.40082 0.420 0.004 0.572 0.004 0.000
#> GSM25531     1  0.3044    0.82330 0.840 0.004 0.148 0.008 0.000
#> GSM48661     5  0.4741    0.71282 0.000 0.204 0.068 0.004 0.724
#> GSM25561     3  0.4698    0.21621 0.468 0.008 0.520 0.004 0.000
#> GSM25562     1  0.3536    0.79514 0.812 0.000 0.156 0.032 0.000
#> GSM25563     3  0.2694    0.78489 0.128 0.004 0.864 0.004 0.000
#> GSM25564     5  0.7050    0.52268 0.084 0.116 0.224 0.004 0.572
#> GSM25565     5  0.4968    0.38268 0.000 0.456 0.028 0.000 0.516
#> GSM25566     5  0.4300    0.37745 0.000 0.476 0.000 0.000 0.524
#> GSM25568     5  0.4806    0.71741 0.004 0.156 0.092 0.004 0.744
#> GSM25569     5  0.4777    0.67227 0.000 0.292 0.044 0.000 0.664
#> GSM25552     5  0.0613    0.65780 0.000 0.008 0.004 0.004 0.984
#> GSM25553     5  0.0854    0.66023 0.000 0.012 0.008 0.004 0.976
#> GSM25578     1  0.0451    0.90017 0.988 0.000 0.004 0.008 0.000
#> GSM25579     1  0.3209    0.81725 0.812 0.008 0.180 0.000 0.000
#> GSM25580     1  0.0510    0.89755 0.984 0.000 0.000 0.016 0.000
#> GSM25581     1  0.0290    0.89854 0.992 0.000 0.000 0.008 0.000
#> GSM48655     2  0.1197    0.81156 0.000 0.952 0.000 0.000 0.048
#> GSM48656     5  0.3988    0.70181 0.000 0.252 0.016 0.000 0.732
#> GSM48657     2  0.1544    0.81463 0.000 0.932 0.000 0.000 0.068
#> GSM48658     5  0.4109    0.72445 0.000 0.148 0.060 0.004 0.788
#> GSM25624     1  0.0510    0.89888 0.984 0.000 0.000 0.016 0.000
#> GSM25625     3  0.2338    0.79057 0.112 0.000 0.884 0.004 0.000
#> GSM25626     3  0.2017    0.78604 0.080 0.008 0.912 0.000 0.000
#> GSM25627     3  0.2764    0.77872 0.072 0.020 0.892 0.004 0.012
#> GSM25628     3  0.0451    0.74681 0.000 0.008 0.988 0.000 0.004
#> GSM25629     3  0.1074    0.74226 0.000 0.012 0.968 0.004 0.016
#> GSM25630     3  0.3487    0.73494 0.212 0.008 0.780 0.000 0.000
#> GSM25631     5  0.4049    0.67527 0.004 0.052 0.140 0.004 0.800
#> GSM25632     3  0.3579    0.71744 0.240 0.004 0.756 0.000 0.000
#> GSM25633     1  0.0510    0.89888 0.984 0.000 0.000 0.016 0.000
#> GSM25634     1  0.0693    0.90215 0.980 0.000 0.012 0.008 0.000
#> GSM25635     1  0.1043    0.88355 0.960 0.000 0.000 0.040 0.000
#> GSM25656     3  0.0960    0.74621 0.000 0.016 0.972 0.004 0.008
#> GSM25657     1  0.1857    0.88932 0.928 0.004 0.060 0.008 0.000
#> GSM25658     3  0.2818    0.78628 0.128 0.008 0.860 0.004 0.000
#> GSM25659     1  0.3972    0.75999 0.764 0.008 0.212 0.000 0.016
#> GSM25660     1  0.0898    0.90284 0.972 0.000 0.020 0.008 0.000
#> GSM25661     1  0.0290    0.89854 0.992 0.000 0.000 0.008 0.000
#> GSM25662     5  0.5175    0.49232 0.000 0.408 0.044 0.000 0.548
#> GSM25663     5  0.4077    0.72398 0.000 0.172 0.044 0.004 0.780
#> GSM25680     5  0.3622    0.72242 0.000 0.124 0.056 0.000 0.820
#> GSM25681     5  0.2824    0.71372 0.000 0.096 0.032 0.000 0.872
#> GSM25682     2  0.0510    0.79307 0.000 0.984 0.000 0.000 0.016
#> GSM25683     2  0.1818    0.80684 0.000 0.932 0.024 0.000 0.044
#> GSM25684     5  0.5131    0.57655 0.000 0.364 0.048 0.000 0.588
#> GSM25685     2  0.5543    0.51034 0.000 0.648 0.116 0.004 0.232
#> GSM25686     2  0.0510    0.79307 0.000 0.984 0.000 0.000 0.016
#> GSM25687     2  0.0510    0.79307 0.000 0.984 0.000 0.000 0.016
#> GSM48664     4  0.0290    0.84582 0.008 0.000 0.000 0.992 0.000
#> GSM48665     4  0.2338    0.80042 0.112 0.000 0.004 0.884 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
#> GSM25548     6  0.2920     0.6410 0.000 0.008 0.004 0.000 0.168 0.820
#> GSM25549     6  0.0405     0.7689 0.000 0.008 0.000 0.000 0.004 0.988
#> GSM25550     6  0.0291     0.7667 0.000 0.004 0.004 0.000 0.000 0.992
#> GSM25551     5  0.6051     0.2091 0.000 0.412 0.008 0.004 0.416 0.160
#> GSM25570     6  0.0260     0.7675 0.000 0.008 0.000 0.000 0.000 0.992
#> GSM25571     6  0.0622     0.7692 0.000 0.008 0.000 0.000 0.012 0.980
#> GSM25358     4  0.7475     0.2868 0.060 0.040 0.116 0.444 0.324 0.016
#> GSM25359     5  0.6548     0.4853 0.004 0.216 0.032 0.004 0.504 0.240
#> GSM25360     3  0.4499     0.6829 0.168 0.000 0.716 0.000 0.112 0.004
#> GSM25361     5  0.6100     0.0928 0.016 0.000 0.184 0.000 0.484 0.316
#> GSM25377     4  0.0146     0.8719 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM25378     4  0.0000     0.8728 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25401     4  0.4614     0.6063 0.000 0.000 0.228 0.676 0.096 0.000
#> GSM25402     4  0.4431     0.6456 0.004 0.000 0.200 0.712 0.084 0.000
#> GSM25349     2  0.2356     0.7151 0.000 0.884 0.008 0.004 0.004 0.100
#> GSM25350     2  0.1493     0.7499 0.000 0.936 0.004 0.000 0.004 0.056
#> GSM25356     4  0.0000     0.8728 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25357     2  0.2722     0.7288 0.000 0.876 0.008 0.016 0.088 0.012
#> GSM25385     3  0.1714     0.7888 0.092 0.000 0.908 0.000 0.000 0.000
#> GSM25386     3  0.1267     0.7980 0.000 0.000 0.940 0.000 0.060 0.000
#> GSM25399     4  0.1151     0.8548 0.032 0.000 0.012 0.956 0.000 0.000
#> GSM25400     4  0.4650     0.5861 0.224 0.000 0.080 0.688 0.008 0.000
#> GSM48659     5  0.5525     0.5684 0.000 0.120 0.012 0.000 0.568 0.300
#> GSM48660     2  0.0405     0.7608 0.000 0.988 0.000 0.000 0.004 0.008
#> GSM25409     2  0.4822     0.3936 0.000 0.656 0.012 0.000 0.068 0.264
#> GSM25410     3  0.1387     0.7913 0.000 0.000 0.932 0.000 0.068 0.000
#> GSM25426     5  0.5543    -0.1739 0.000 0.428 0.072 0.004 0.480 0.016
#> GSM25427     4  0.0000     0.8728 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25540     5  0.5046     0.2811 0.000 0.000 0.256 0.000 0.620 0.124
#> GSM25541     5  0.5495     0.2397 0.000 0.000 0.304 0.000 0.540 0.156
#> GSM25542     5  0.5957     0.5502 0.000 0.088 0.068 0.000 0.576 0.268
#> GSM25543     5  0.5557     0.5482 0.004 0.068 0.040 0.000 0.604 0.284
#> GSM25479     1  0.0363     0.8880 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM25480     1  0.0363     0.8880 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM25481     4  0.0000     0.8728 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM25482     4  0.0000     0.8728 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM48654     5  0.5439     0.5699 0.000 0.112 0.012 0.000 0.580 0.296
#> GSM48650     2  0.4464     0.6115 0.000 0.720 0.028 0.032 0.216 0.004
#> GSM48651     2  0.5948    -0.1664 0.000 0.456 0.000 0.000 0.284 0.260
#> GSM48652     5  0.5886     0.4907 0.000 0.236 0.000 0.000 0.472 0.292
#> GSM48653     5  0.5539     0.5681 0.000 0.136 0.008 0.000 0.564 0.292
#> GSM48662     2  0.6083    -0.3837 0.000 0.388 0.000 0.000 0.280 0.332
#> GSM48663     2  0.2739     0.7127 0.000 0.872 0.000 0.084 0.032 0.012
#> GSM25524     3  0.4655     0.5029 0.300 0.000 0.632 0.000 0.068 0.000
#> GSM25525     1  0.3341     0.8053 0.816 0.000 0.116 0.000 0.068 0.000
#> GSM25526     3  0.1471     0.7915 0.004 0.000 0.932 0.000 0.064 0.000
#> GSM25527     1  0.2122     0.8757 0.900 0.000 0.076 0.024 0.000 0.000
#> GSM25528     1  0.4847     0.3930 0.588 0.000 0.340 0.000 0.072 0.000
#> GSM25529     1  0.3341     0.8053 0.816 0.000 0.116 0.000 0.068 0.000
#> GSM25530     3  0.3189     0.6395 0.236 0.000 0.760 0.000 0.004 0.000
#> GSM25531     1  0.2805     0.8248 0.828 0.000 0.160 0.012 0.000 0.000
#> GSM48661     5  0.4308     0.5334 0.000 0.028 0.012 0.000 0.680 0.280
#> GSM25561     3  0.4929     0.1254 0.428 0.000 0.508 0.000 0.064 0.000
#> GSM25562     1  0.3274     0.8017 0.824 0.000 0.080 0.096 0.000 0.000
#> GSM25563     3  0.1498     0.8009 0.028 0.000 0.940 0.000 0.032 0.000
#> GSM25564     5  0.8204     0.1591 0.200 0.028 0.184 0.004 0.328 0.256
#> GSM25565     5  0.5944     0.5081 0.000 0.244 0.000 0.000 0.452 0.304
#> GSM25566     2  0.6100    -0.4082 0.000 0.384 0.000 0.000 0.308 0.308
#> GSM25568     5  0.5254     0.3711 0.004 0.012 0.056 0.000 0.524 0.404
#> GSM25569     5  0.5649     0.4761 0.000 0.132 0.004 0.000 0.464 0.400
#> GSM25552     6  0.0146     0.7613 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM25553     6  0.1411     0.7515 0.000 0.000 0.004 0.000 0.060 0.936
#> GSM25578     1  0.0363     0.8880 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM25579     1  0.3469     0.8023 0.812 0.000 0.120 0.000 0.064 0.004
#> GSM25580     1  0.1444     0.8643 0.928 0.000 0.000 0.072 0.000 0.000
#> GSM25581     1  0.0632     0.8877 0.976 0.000 0.000 0.024 0.000 0.000
#> GSM48655     2  0.0405     0.7605 0.000 0.988 0.000 0.000 0.008 0.004
#> GSM48656     5  0.5700     0.4094 0.000 0.160 0.000 0.000 0.436 0.404
#> GSM48657     2  0.0622     0.7604 0.000 0.980 0.000 0.000 0.008 0.012
#> GSM48658     5  0.4179     0.4967 0.000 0.016 0.008 0.000 0.652 0.324
#> GSM25624     1  0.1124     0.8872 0.956 0.000 0.008 0.036 0.000 0.000
#> GSM25625     3  0.0993     0.8011 0.012 0.000 0.964 0.000 0.024 0.000
#> GSM25626     3  0.1387     0.7907 0.000 0.000 0.932 0.000 0.068 0.000
#> GSM25627     3  0.3769     0.4840 0.004 0.000 0.640 0.000 0.356 0.000
#> GSM25628     3  0.2527     0.7857 0.000 0.000 0.832 0.000 0.168 0.000
#> GSM25629     3  0.3843     0.3944 0.000 0.000 0.548 0.000 0.452 0.000
#> GSM25630     3  0.2745     0.7829 0.068 0.000 0.864 0.000 0.068 0.000
#> GSM25631     6  0.4683     0.2813 0.000 0.000 0.064 0.000 0.320 0.616
#> GSM25632     3  0.1471     0.7966 0.064 0.000 0.932 0.000 0.004 0.000
#> GSM25633     1  0.0632     0.8877 0.976 0.000 0.000 0.024 0.000 0.000
#> GSM25634     1  0.0790     0.8861 0.968 0.000 0.000 0.032 0.000 0.000
#> GSM25635     1  0.1957     0.8333 0.888 0.000 0.000 0.112 0.000 0.000
#> GSM25656     3  0.2597     0.7790 0.000 0.000 0.824 0.000 0.176 0.000
#> GSM25657     1  0.1802     0.8740 0.916 0.000 0.072 0.012 0.000 0.000
#> GSM25658     3  0.2801     0.7859 0.068 0.000 0.860 0.000 0.072 0.000
#> GSM25659     1  0.4357     0.7170 0.732 0.000 0.156 0.000 0.108 0.004
#> GSM25660     1  0.0458     0.8882 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM25661     1  0.0937     0.8825 0.960 0.000 0.000 0.040 0.000 0.000
#> GSM25662     5  0.5422     0.5704 0.000 0.136 0.004 0.000 0.572 0.288
#> GSM25663     5  0.5448     0.4755 0.000 0.092 0.012 0.000 0.532 0.364
#> GSM25680     6  0.4289     0.2509 0.000 0.008 0.020 0.000 0.332 0.640
#> GSM25681     6  0.3541     0.5273 0.000 0.000 0.020 0.000 0.232 0.748
#> GSM25682     2  0.0000     0.7585 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25683     2  0.2417     0.7343 0.000 0.888 0.008 0.004 0.088 0.012
#> GSM25684     5  0.5389     0.5695 0.000 0.132 0.004 0.000 0.576 0.288
#> GSM25685     5  0.5130     0.4330 0.000 0.124 0.080 0.000 0.708 0.088
#> GSM25686     2  0.0146     0.7567 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM25687     2  0.0000     0.7585 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48664     4  0.0000     0.8728 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM48665     4  0.0458     0.8672 0.016 0.000 0.000 0.984 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-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 genotype/variation(p) k
#> MAD:mclust 97              5.16e-06 2
#> MAD:mclust 92              3.78e-04 3
#> MAD:mclust 94              1.13e-05 4
#> MAD:mclust 85              1.61e-06 5
#> MAD:mclust 75              4.67e-09 6

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


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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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.816           0.884       0.952         0.5034 0.495   0.495
#> 3 3 0.492           0.587       0.802         0.3202 0.767   0.561
#> 4 4 0.420           0.396       0.617         0.1115 0.858   0.620
#> 5 5 0.477           0.439       0.640         0.0712 0.803   0.422
#> 6 6 0.527           0.392       0.598         0.0431 0.892   0.564

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

suggest_best_k(res)
#> [1] 2

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM25548     2  0.0000      0.965 0.000 1.000
#> GSM25549     2  0.0000      0.965 0.000 1.000
#> GSM25550     2  0.0000      0.965 0.000 1.000
#> GSM25551     2  0.0000      0.965 0.000 1.000
#> GSM25570     2  0.0000      0.965 0.000 1.000
#> GSM25571     2  0.0000      0.965 0.000 1.000
#> GSM25358     1  0.7056      0.756 0.808 0.192
#> GSM25359     2  0.4161      0.890 0.084 0.916
#> GSM25360     1  0.0672      0.927 0.992 0.008
#> GSM25361     1  0.9170      0.504 0.668 0.332
#> GSM25377     1  0.0000      0.931 1.000 0.000
#> GSM25378     1  0.3733      0.879 0.928 0.072
#> GSM25401     1  0.9732      0.372 0.596 0.404
#> GSM25402     1  0.4161      0.869 0.916 0.084
#> GSM25349     2  0.0000      0.965 0.000 1.000
#> GSM25350     2  0.0000      0.965 0.000 1.000
#> GSM25356     1  0.3879      0.876 0.924 0.076
#> GSM25357     2  0.0000      0.965 0.000 1.000
#> GSM25385     1  0.0000      0.931 1.000 0.000
#> GSM25386     1  0.2236      0.907 0.964 0.036
#> GSM25399     1  0.0000      0.931 1.000 0.000
#> GSM25400     1  0.0000      0.931 1.000 0.000
#> GSM48659     2  0.0000      0.965 0.000 1.000
#> GSM48660     2  0.0000      0.965 0.000 1.000
#> GSM25409     2  0.0000      0.965 0.000 1.000
#> GSM25410     1  0.1633      0.916 0.976 0.024
#> GSM25426     2  0.0000      0.965 0.000 1.000
#> GSM25427     1  0.1633      0.916 0.976 0.024
#> GSM25540     2  0.8443      0.620 0.272 0.728
#> GSM25541     1  0.9954      0.154 0.540 0.460
#> GSM25542     2  0.0000      0.965 0.000 1.000
#> GSM25543     2  0.1184      0.952 0.016 0.984
#> GSM25479     1  0.0000      0.931 1.000 0.000
#> GSM25480     1  0.0000      0.931 1.000 0.000
#> GSM25481     1  0.9427      0.473 0.640 0.360
#> GSM25482     1  0.8713      0.604 0.708 0.292
#> GSM48654     2  0.0000      0.965 0.000 1.000
#> GSM48650     2  0.0000      0.965 0.000 1.000
#> GSM48651     2  0.0000      0.965 0.000 1.000
#> GSM48652     2  0.0000      0.965 0.000 1.000
#> GSM48653     2  0.0000      0.965 0.000 1.000
#> GSM48662     2  0.0000      0.965 0.000 1.000
#> GSM48663     2  0.0000      0.965 0.000 1.000
#> GSM25524     1  0.0000      0.931 1.000 0.000
#> GSM25525     1  0.0000      0.931 1.000 0.000
#> GSM25526     1  0.0000      0.931 1.000 0.000
#> GSM25527     1  0.0000      0.931 1.000 0.000
#> GSM25528     1  0.0000      0.931 1.000 0.000
#> GSM25529     1  0.0000      0.931 1.000 0.000
#> GSM25530     1  0.0000      0.931 1.000 0.000
#> GSM25531     1  0.0000      0.931 1.000 0.000
#> GSM48661     2  0.0000      0.965 0.000 1.000
#> GSM25561     1  0.0000      0.931 1.000 0.000
#> GSM25562     1  0.0000      0.931 1.000 0.000
#> GSM25563     1  0.0672      0.927 0.992 0.008
#> GSM25564     1  0.9866      0.301 0.568 0.432
#> GSM25565     2  0.0000      0.965 0.000 1.000
#> GSM25566     2  0.0000      0.965 0.000 1.000
#> GSM25568     2  0.5629      0.833 0.132 0.868
#> GSM25569     2  0.0000      0.965 0.000 1.000
#> GSM25552     2  0.0000      0.965 0.000 1.000
#> GSM25553     2  0.5059      0.857 0.112 0.888
#> GSM25578     1  0.0000      0.931 1.000 0.000
#> GSM25579     1  0.0000      0.931 1.000 0.000
#> GSM25580     1  0.0000      0.931 1.000 0.000
#> GSM25581     1  0.0000      0.931 1.000 0.000
#> GSM48655     2  0.0000      0.965 0.000 1.000
#> GSM48656     2  0.0000      0.965 0.000 1.000
#> GSM48657     2  0.0000      0.965 0.000 1.000
#> GSM48658     2  0.0000      0.965 0.000 1.000
#> GSM25624     1  0.0000      0.931 1.000 0.000
#> GSM25625     1  0.0000      0.931 1.000 0.000
#> GSM25626     1  0.0672      0.927 0.992 0.008
#> GSM25627     2  0.9000      0.519 0.316 0.684
#> GSM25628     1  0.9944      0.167 0.544 0.456
#> GSM25629     2  0.3733      0.903 0.072 0.928
#> GSM25630     1  0.0000      0.931 1.000 0.000
#> GSM25631     2  0.5408      0.846 0.124 0.876
#> GSM25632     1  0.0000      0.931 1.000 0.000
#> GSM25633     1  0.0000      0.931 1.000 0.000
#> GSM25634     1  0.0000      0.931 1.000 0.000
#> GSM25635     1  0.0000      0.931 1.000 0.000
#> GSM25656     2  0.9833      0.244 0.424 0.576
#> GSM25657     1  0.0000      0.931 1.000 0.000
#> GSM25658     1  0.0000      0.931 1.000 0.000
#> GSM25659     1  0.0000      0.931 1.000 0.000
#> GSM25660     1  0.0000      0.931 1.000 0.000
#> GSM25661     1  0.0000      0.931 1.000 0.000
#> GSM25662     2  0.0000      0.965 0.000 1.000
#> GSM25663     2  0.0000      0.965 0.000 1.000
#> GSM25680     2  0.0000      0.965 0.000 1.000
#> GSM25681     2  0.0000      0.965 0.000 1.000
#> GSM25682     2  0.0000      0.965 0.000 1.000
#> GSM25683     2  0.0000      0.965 0.000 1.000
#> GSM25684     2  0.0000      0.965 0.000 1.000
#> GSM25685     2  0.0000      0.965 0.000 1.000
#> GSM25686     2  0.0000      0.965 0.000 1.000
#> GSM25687     2  0.0000      0.965 0.000 1.000
#> GSM48664     1  0.0000      0.931 1.000 0.000
#> GSM48665     1  0.0000      0.931 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.1860     0.8110 0.000 0.948 0.052
#> GSM25549     2  0.1337     0.8107 0.012 0.972 0.016
#> GSM25550     2  0.3686     0.7114 0.140 0.860 0.000
#> GSM25551     2  0.4399     0.7536 0.000 0.812 0.188
#> GSM25570     2  0.1031     0.8020 0.024 0.976 0.000
#> GSM25571     2  0.1289     0.8131 0.000 0.968 0.032
#> GSM25358     1  0.7970     0.5301 0.596 0.324 0.080
#> GSM25359     2  0.6291     0.2889 0.000 0.532 0.468
#> GSM25360     3  0.3116     0.6545 0.108 0.000 0.892
#> GSM25361     3  0.0829     0.6916 0.012 0.004 0.984
#> GSM25377     1  0.4399     0.6389 0.812 0.188 0.000
#> GSM25378     1  0.5254     0.5881 0.736 0.264 0.000
#> GSM25401     1  0.8538     0.3472 0.520 0.380 0.100
#> GSM25402     1  0.6488     0.6324 0.744 0.192 0.064
#> GSM25349     2  0.2537     0.7717 0.080 0.920 0.000
#> GSM25350     2  0.2165     0.7826 0.064 0.936 0.000
#> GSM25356     1  0.5785     0.4949 0.668 0.332 0.000
#> GSM25357     2  0.1860     0.7898 0.052 0.948 0.000
#> GSM25385     3  0.6215     0.1250 0.428 0.000 0.572
#> GSM25386     3  0.1753     0.6825 0.048 0.000 0.952
#> GSM25399     1  0.1031     0.7120 0.976 0.024 0.000
#> GSM25400     1  0.1411     0.7265 0.964 0.000 0.036
#> GSM48659     2  0.6308     0.2979 0.000 0.508 0.492
#> GSM48660     2  0.1620     0.8065 0.024 0.964 0.012
#> GSM25409     2  0.2261     0.7808 0.068 0.932 0.000
#> GSM25410     3  0.2959     0.6595 0.100 0.000 0.900
#> GSM25426     2  0.5988     0.5586 0.000 0.632 0.368
#> GSM25427     1  0.5529     0.5477 0.704 0.296 0.000
#> GSM25540     3  0.1411     0.6882 0.000 0.036 0.964
#> GSM25541     3  0.0747     0.6933 0.000 0.016 0.984
#> GSM25542     3  0.6095     0.0576 0.000 0.392 0.608
#> GSM25543     3  0.5785     0.2562 0.000 0.332 0.668
#> GSM25479     1  0.1753     0.7271 0.952 0.000 0.048
#> GSM25480     1  0.2096     0.7270 0.944 0.004 0.052
#> GSM25481     1  0.6274     0.2433 0.544 0.456 0.000
#> GSM25482     1  0.6260     0.2637 0.552 0.448 0.000
#> GSM48654     2  0.6045     0.5365 0.000 0.620 0.380
#> GSM48650     2  0.1529     0.8128 0.000 0.960 0.040
#> GSM48651     2  0.3619     0.7855 0.000 0.864 0.136
#> GSM48652     2  0.4555     0.7452 0.000 0.800 0.200
#> GSM48653     2  0.6286     0.3698 0.000 0.536 0.464
#> GSM48662     2  0.1411     0.8132 0.000 0.964 0.036
#> GSM48663     2  0.2356     0.7779 0.072 0.928 0.000
#> GSM25524     3  0.5529     0.4482 0.296 0.000 0.704
#> GSM25525     1  0.4931     0.6244 0.768 0.000 0.232
#> GSM25526     3  0.4555     0.5773 0.200 0.000 0.800
#> GSM25527     1  0.5178     0.6004 0.744 0.000 0.256
#> GSM25528     1  0.6299     0.1585 0.524 0.000 0.476
#> GSM25529     1  0.5621     0.5297 0.692 0.000 0.308
#> GSM25530     1  0.6308     0.1063 0.508 0.000 0.492
#> GSM25531     1  0.5363     0.5755 0.724 0.000 0.276
#> GSM48661     3  0.5291     0.3886 0.000 0.268 0.732
#> GSM25561     3  0.6126     0.2069 0.400 0.000 0.600
#> GSM25562     1  0.4555     0.6558 0.800 0.000 0.200
#> GSM25563     3  0.4235     0.6037 0.176 0.000 0.824
#> GSM25564     1  0.9986     0.0877 0.352 0.308 0.340
#> GSM25565     2  0.4002     0.7714 0.000 0.840 0.160
#> GSM25566     2  0.2878     0.7999 0.000 0.904 0.096
#> GSM25568     3  0.6823    -0.1386 0.012 0.484 0.504
#> GSM25569     2  0.3551     0.7860 0.000 0.868 0.132
#> GSM25552     2  0.2356     0.7778 0.072 0.928 0.000
#> GSM25553     2  0.5465     0.4632 0.288 0.712 0.000
#> GSM25578     1  0.2796     0.7149 0.908 0.000 0.092
#> GSM25579     1  0.5254     0.5896 0.736 0.000 0.264
#> GSM25580     1  0.1289     0.7250 0.968 0.000 0.032
#> GSM25581     1  0.2066     0.7239 0.940 0.000 0.060
#> GSM48655     2  0.0747     0.8117 0.000 0.984 0.016
#> GSM48656     2  0.2796     0.8027 0.000 0.908 0.092
#> GSM48657     2  0.1399     0.8019 0.028 0.968 0.004
#> GSM48658     3  0.5760     0.2573 0.000 0.328 0.672
#> GSM25624     1  0.1753     0.7256 0.952 0.000 0.048
#> GSM25625     3  0.5363     0.4780 0.276 0.000 0.724
#> GSM25626     3  0.1643     0.6836 0.044 0.000 0.956
#> GSM25627     3  0.1877     0.6923 0.012 0.032 0.956
#> GSM25628     3  0.1015     0.6932 0.008 0.012 0.980
#> GSM25629     3  0.1964     0.6791 0.000 0.056 0.944
#> GSM25630     3  0.4931     0.5408 0.232 0.000 0.768
#> GSM25631     3  0.4504     0.5346 0.000 0.196 0.804
#> GSM25632     3  0.6215     0.1201 0.428 0.000 0.572
#> GSM25633     1  0.3192     0.7071 0.888 0.000 0.112
#> GSM25634     1  0.3267     0.7057 0.884 0.000 0.116
#> GSM25635     1  0.1753     0.7263 0.952 0.000 0.048
#> GSM25656     3  0.0747     0.6930 0.000 0.016 0.984
#> GSM25657     1  0.4796     0.6360 0.780 0.000 0.220
#> GSM25658     3  0.5560     0.4432 0.300 0.000 0.700
#> GSM25659     1  0.6442     0.2751 0.564 0.004 0.432
#> GSM25660     1  0.2280     0.7273 0.940 0.008 0.052
#> GSM25661     1  0.1411     0.7261 0.964 0.000 0.036
#> GSM25662     2  0.5968     0.5609 0.000 0.636 0.364
#> GSM25663     2  0.5178     0.6879 0.000 0.744 0.256
#> GSM25680     2  0.6267     0.3950 0.000 0.548 0.452
#> GSM25681     2  0.6252     0.3986 0.000 0.556 0.444
#> GSM25682     2  0.0592     0.8112 0.000 0.988 0.012
#> GSM25683     2  0.1753     0.8115 0.000 0.952 0.048
#> GSM25684     2  0.5465     0.6610 0.000 0.712 0.288
#> GSM25685     3  0.6280    -0.1990 0.000 0.460 0.540
#> GSM25686     2  0.0983     0.8114 0.004 0.980 0.016
#> GSM25687     2  0.1129     0.8046 0.020 0.976 0.004
#> GSM48664     1  0.2959     0.6863 0.900 0.100 0.000
#> GSM48665     1  0.2711     0.6917 0.912 0.088 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2   0.506    0.49992 0.000 0.648 0.012 0.340
#> GSM25549     2   0.524    0.40347 0.004 0.576 0.004 0.416
#> GSM25550     2   0.584    0.30730 0.032 0.520 0.000 0.448
#> GSM25551     2   0.573    0.43868 0.000 0.616 0.344 0.040
#> GSM25570     2   0.513    0.36529 0.004 0.552 0.000 0.444
#> GSM25571     2   0.535    0.43399 0.000 0.596 0.016 0.388
#> GSM25358     1   0.812    0.43178 0.552 0.176 0.216 0.056
#> GSM25359     3   0.604    0.01164 0.004 0.416 0.544 0.036
#> GSM25360     3   0.600   -0.00267 0.040 0.000 0.512 0.448
#> GSM25361     4   0.591   -0.00948 0.012 0.016 0.456 0.516
#> GSM25377     1   0.377    0.65094 0.868 0.064 0.020 0.048
#> GSM25378     1   0.421    0.64030 0.840 0.096 0.016 0.048
#> GSM25401     1   0.903    0.04091 0.356 0.260 0.324 0.060
#> GSM25402     1   0.783    0.46329 0.588 0.156 0.200 0.056
#> GSM25349     2   0.468    0.64498 0.084 0.816 0.016 0.084
#> GSM25350     2   0.411    0.64668 0.032 0.812 0.000 0.156
#> GSM25356     1   0.484    0.60917 0.792 0.136 0.008 0.064
#> GSM25357     2   0.690    0.47847 0.100 0.668 0.184 0.048
#> GSM25385     1   0.671    0.29775 0.528 0.000 0.376 0.096
#> GSM25386     3   0.520    0.36876 0.088 0.000 0.752 0.160
#> GSM25399     1   0.359    0.66047 0.880 0.040 0.044 0.036
#> GSM25400     1   0.335    0.66314 0.888 0.028 0.060 0.024
#> GSM48659     2   0.700    0.33766 0.000 0.508 0.368 0.124
#> GSM48660     2   0.418    0.67598 0.028 0.848 0.044 0.080
#> GSM25409     2   0.440    0.59859 0.016 0.760 0.000 0.224
#> GSM25410     3   0.574    0.33308 0.232 0.008 0.700 0.060
#> GSM25426     3   0.628   -0.17891 0.000 0.464 0.480 0.056
#> GSM25427     1   0.521    0.57169 0.756 0.140 0.000 0.104
#> GSM25540     3   0.517    0.18817 0.000 0.012 0.620 0.368
#> GSM25541     3   0.537    0.11636 0.004 0.008 0.576 0.412
#> GSM25542     3   0.611    0.01203 0.000 0.392 0.556 0.052
#> GSM25543     3   0.688    0.16467 0.000 0.340 0.540 0.120
#> GSM25479     1   0.542    0.50694 0.680 0.004 0.032 0.284
#> GSM25480     1   0.685    0.20236 0.492 0.032 0.040 0.436
#> GSM25481     1   0.683    0.42581 0.604 0.256 0.004 0.136
#> GSM25482     1   0.704    0.39612 0.592 0.224 0.004 0.180
#> GSM48654     2   0.641    0.46588 0.000 0.592 0.320 0.088
#> GSM48650     2   0.649    0.38730 0.016 0.600 0.328 0.056
#> GSM48651     2   0.401    0.65593 0.000 0.816 0.156 0.028
#> GSM48652     2   0.508    0.59559 0.000 0.716 0.248 0.036
#> GSM48653     2   0.621    0.41792 0.000 0.576 0.360 0.064
#> GSM48662     2   0.360    0.68329 0.000 0.848 0.028 0.124
#> GSM48663     2   0.482    0.65611 0.048 0.808 0.028 0.116
#> GSM25524     3   0.711   -0.10082 0.128 0.000 0.456 0.416
#> GSM25525     4   0.712    0.16447 0.368 0.000 0.136 0.496
#> GSM25526     3   0.625    0.15110 0.340 0.004 0.596 0.060
#> GSM25527     1   0.623    0.48921 0.668 0.000 0.148 0.184
#> GSM25528     4   0.788    0.19377 0.332 0.000 0.288 0.380
#> GSM25529     4   0.750    0.21430 0.344 0.000 0.192 0.464
#> GSM25530     1   0.670    0.38577 0.612 0.000 0.232 0.156
#> GSM25531     1   0.460    0.60682 0.796 0.000 0.132 0.072
#> GSM48661     3   0.685    0.33783 0.000 0.204 0.600 0.196
#> GSM25561     4   0.768    0.06720 0.216 0.000 0.384 0.400
#> GSM25562     1   0.509    0.60146 0.772 0.004 0.084 0.140
#> GSM25563     3   0.722    0.10932 0.180 0.000 0.536 0.284
#> GSM25564     4   0.940    0.20877 0.120 0.256 0.220 0.404
#> GSM25565     2   0.435    0.63014 0.000 0.780 0.196 0.024
#> GSM25566     2   0.390    0.67254 0.000 0.832 0.132 0.036
#> GSM25568     2   0.803    0.10423 0.012 0.412 0.368 0.208
#> GSM25569     2   0.471    0.66645 0.000 0.788 0.072 0.140
#> GSM25552     4   0.551   -0.32946 0.016 0.488 0.000 0.496
#> GSM25553     4   0.630   -0.20667 0.060 0.420 0.000 0.520
#> GSM25578     1   0.441    0.59736 0.780 0.000 0.028 0.192
#> GSM25579     4   0.687    0.37077 0.216 0.016 0.132 0.636
#> GSM25580     1   0.241    0.66016 0.896 0.000 0.000 0.104
#> GSM25581     1   0.280    0.65973 0.884 0.000 0.008 0.108
#> GSM48655     2   0.293    0.69196 0.000 0.896 0.056 0.048
#> GSM48656     2   0.476    0.64805 0.000 0.772 0.052 0.176
#> GSM48657     2   0.297    0.68240 0.028 0.904 0.016 0.052
#> GSM48658     3   0.761    0.18385 0.000 0.260 0.476 0.264
#> GSM25624     1   0.310    0.65838 0.872 0.008 0.004 0.116
#> GSM25625     3   0.734    0.03640 0.376 0.000 0.464 0.160
#> GSM25626     3   0.477    0.40030 0.116 0.012 0.804 0.068
#> GSM25627     3   0.695    0.38156 0.104 0.192 0.660 0.044
#> GSM25628     3   0.427    0.41127 0.008 0.036 0.820 0.136
#> GSM25629     3   0.430    0.44138 0.012 0.116 0.828 0.044
#> GSM25630     3   0.726    0.02985 0.152 0.000 0.480 0.368
#> GSM25631     4   0.655    0.15512 0.000 0.096 0.328 0.576
#> GSM25632     1   0.734    0.20015 0.504 0.000 0.316 0.180
#> GSM25633     1   0.398    0.64846 0.836 0.000 0.056 0.108
#> GSM25634     1   0.276    0.66307 0.904 0.000 0.044 0.052
#> GSM25635     1   0.310    0.66058 0.872 0.004 0.008 0.116
#> GSM25656     3   0.379    0.43224 0.012 0.040 0.860 0.088
#> GSM25657     1   0.510    0.60090 0.764 0.000 0.100 0.136
#> GSM25658     1   0.632    0.17356 0.480 0.004 0.468 0.048
#> GSM25659     4   0.708    0.31306 0.168 0.000 0.276 0.556
#> GSM25660     1   0.588    0.37787 0.580 0.020 0.012 0.388
#> GSM25661     1   0.316    0.65472 0.868 0.008 0.004 0.120
#> GSM25662     2   0.531    0.38363 0.000 0.576 0.412 0.012
#> GSM25663     2   0.636    0.59907 0.000 0.656 0.176 0.168
#> GSM25680     2   0.782    0.15897 0.000 0.376 0.256 0.368
#> GSM25681     4   0.766    0.10097 0.000 0.296 0.244 0.460
#> GSM25682     2   0.203    0.69150 0.000 0.936 0.028 0.036
#> GSM25683     2   0.443    0.59869 0.000 0.772 0.204 0.024
#> GSM25684     2   0.567    0.53802 0.000 0.652 0.300 0.048
#> GSM25685     3   0.559   -0.13829 0.000 0.456 0.524 0.020
#> GSM25686     2   0.130    0.69002 0.000 0.964 0.016 0.020
#> GSM25687     2   0.158    0.68963 0.000 0.948 0.004 0.048
#> GSM48664     1   0.258    0.66101 0.912 0.052 0.000 0.036
#> GSM48665     1   0.249    0.66390 0.916 0.036 0.000 0.048

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     5   0.485    0.57371 0.000 0.196 0.000 0.092 0.712
#> GSM25549     5   0.414    0.61864 0.000 0.200 0.008 0.028 0.764
#> GSM25550     5   0.386    0.63708 0.024 0.156 0.000 0.016 0.804
#> GSM25551     4   0.407    0.50560 0.000 0.136 0.000 0.788 0.076
#> GSM25570     5   0.360    0.63876 0.000 0.180 0.000 0.024 0.796
#> GSM25571     5   0.440    0.63070 0.000 0.152 0.008 0.068 0.772
#> GSM25358     4   0.637    0.08630 0.344 0.016 0.016 0.548 0.076
#> GSM25359     4   0.566    0.48511 0.004 0.072 0.084 0.720 0.120
#> GSM25360     3   0.203    0.63967 0.044 0.000 0.928 0.016 0.012
#> GSM25361     3   0.379    0.58776 0.020 0.008 0.824 0.016 0.132
#> GSM25377     1   0.618    0.58896 0.668 0.168 0.004 0.072 0.088
#> GSM25378     1   0.480    0.64887 0.752 0.028 0.000 0.164 0.056
#> GSM25401     4   0.471    0.46195 0.208 0.056 0.000 0.728 0.008
#> GSM25402     1   0.594    0.27886 0.536 0.052 0.004 0.388 0.020
#> GSM25349     2   0.539    0.51904 0.044 0.724 0.000 0.096 0.136
#> GSM25350     2   0.500    0.35963 0.012 0.672 0.000 0.040 0.276
#> GSM25356     1   0.585    0.63025 0.696 0.048 0.004 0.128 0.124
#> GSM25357     4   0.585    0.42928 0.020 0.196 0.004 0.664 0.116
#> GSM25385     1   0.708    0.41208 0.536 0.004 0.168 0.248 0.044
#> GSM25386     3   0.788    0.54571 0.060 0.152 0.532 0.204 0.052
#> GSM25399     1   0.476    0.64652 0.784 0.092 0.004 0.044 0.076
#> GSM25400     1   0.323    0.68000 0.872 0.024 0.004 0.072 0.028
#> GSM48659     2   0.818    0.30759 0.000 0.372 0.300 0.196 0.132
#> GSM48660     2   0.215    0.59683 0.000 0.916 0.000 0.048 0.036
#> GSM25409     5   0.580    0.13514 0.008 0.432 0.000 0.068 0.492
#> GSM25410     3   0.925    0.36533 0.188 0.148 0.344 0.256 0.064
#> GSM25426     4   0.311    0.50898 0.000 0.144 0.004 0.840 0.012
#> GSM25427     1   0.671    0.54907 0.608 0.188 0.004 0.056 0.144
#> GSM25540     3   0.240    0.63171 0.000 0.036 0.912 0.040 0.012
#> GSM25541     3   0.259    0.63555 0.012 0.008 0.908 0.028 0.044
#> GSM25542     2   0.670    0.32327 0.000 0.572 0.228 0.160 0.040
#> GSM25543     2   0.645    0.22068 0.000 0.572 0.292 0.088 0.048
#> GSM25479     1   0.533    0.59244 0.672 0.000 0.052 0.024 0.252
#> GSM25480     5   0.639   -0.26435 0.420 0.000 0.084 0.028 0.468
#> GSM25481     1   0.696    0.43585 0.536 0.288 0.000 0.084 0.092
#> GSM25482     1   0.687    0.41710 0.556 0.236 0.000 0.048 0.160
#> GSM48654     2   0.590    0.54353 0.000 0.652 0.228 0.076 0.044
#> GSM48650     2   0.466    0.20303 0.004 0.556 0.000 0.432 0.008
#> GSM48651     2   0.412    0.58341 0.000 0.804 0.032 0.132 0.032
#> GSM48652     2   0.438    0.58521 0.000 0.792 0.080 0.108 0.020
#> GSM48653     2   0.628    0.50970 0.000 0.616 0.196 0.160 0.028
#> GSM48662     2   0.363    0.58175 0.000 0.836 0.028 0.024 0.112
#> GSM48663     2   0.402    0.53750 0.036 0.824 0.000 0.052 0.088
#> GSM25524     3   0.391    0.58590 0.108 0.000 0.824 0.032 0.036
#> GSM25525     1   0.729    0.22556 0.396 0.000 0.300 0.024 0.280
#> GSM25526     4   0.685    0.03447 0.316 0.008 0.168 0.496 0.012
#> GSM25527     1   0.562    0.62354 0.712 0.000 0.124 0.060 0.104
#> GSM25528     3   0.558    0.27703 0.304 0.000 0.620 0.020 0.056
#> GSM25529     1   0.702    0.21494 0.432 0.000 0.348 0.020 0.200
#> GSM25530     1   0.608    0.48014 0.624 0.000 0.248 0.092 0.036
#> GSM25531     1   0.387    0.66116 0.824 0.000 0.084 0.080 0.012
#> GSM48661     3   0.583    0.01114 0.000 0.440 0.488 0.056 0.016
#> GSM25561     3   0.686    0.60628 0.100 0.132 0.652 0.044 0.072
#> GSM25562     1   0.852    0.28278 0.448 0.272 0.092 0.068 0.120
#> GSM25563     3   0.683    0.60822 0.092 0.144 0.652 0.048 0.064
#> GSM25564     2   0.899   -0.00747 0.124 0.332 0.308 0.048 0.188
#> GSM25565     2   0.576    0.54713 0.000 0.684 0.080 0.184 0.052
#> GSM25566     2   0.681    0.16318 0.000 0.416 0.004 0.340 0.240
#> GSM25568     2   0.627    0.29539 0.004 0.612 0.260 0.040 0.084
#> GSM25569     2   0.515    0.54364 0.000 0.724 0.080 0.024 0.172
#> GSM25552     5   0.377    0.62429 0.008 0.200 0.000 0.012 0.780
#> GSM25553     5   0.405    0.62174 0.016 0.176 0.012 0.008 0.788
#> GSM25578     1   0.549    0.62187 0.696 0.000 0.092 0.028 0.184
#> GSM25579     5   0.683    0.12534 0.204 0.000 0.268 0.020 0.508
#> GSM25580     1   0.262    0.69606 0.900 0.008 0.012 0.012 0.068
#> GSM25581     1   0.281    0.69466 0.896 0.016 0.036 0.004 0.048
#> GSM48655     2   0.576    0.46081 0.000 0.620 0.000 0.200 0.180
#> GSM48656     2   0.466    0.55275 0.000 0.764 0.060 0.024 0.152
#> GSM48657     2   0.562    0.48051 0.004 0.648 0.000 0.208 0.140
#> GSM48658     3   0.661    0.15816 0.004 0.324 0.540 0.036 0.096
#> GSM25624     1   0.283    0.69522 0.892 0.004 0.032 0.012 0.060
#> GSM25625     1   0.702    0.01970 0.396 0.000 0.392 0.192 0.020
#> GSM25626     3   0.814    0.38027 0.132 0.076 0.436 0.320 0.036
#> GSM25627     4   0.460    0.47019 0.072 0.048 0.080 0.796 0.004
#> GSM25628     3   0.625    0.55856 0.008 0.124 0.640 0.200 0.028
#> GSM25629     4   0.582    0.35580 0.024 0.080 0.224 0.664 0.008
#> GSM25630     3   0.658    0.60248 0.080 0.160 0.664 0.044 0.052
#> GSM25631     3   0.483    0.42447 0.004 0.052 0.692 0.000 0.252
#> GSM25632     1   0.732    0.34662 0.512 0.004 0.272 0.148 0.064
#> GSM25633     1   0.303    0.68838 0.880 0.000 0.064 0.024 0.032
#> GSM25634     1   0.274    0.69522 0.900 0.004 0.028 0.048 0.020
#> GSM25635     1   0.439    0.67202 0.796 0.008 0.056 0.016 0.124
#> GSM25656     3   0.729    0.40929 0.008 0.152 0.492 0.304 0.044
#> GSM25657     1   0.310    0.68979 0.884 0.008 0.056 0.028 0.024
#> GSM25658     4   0.651   -0.14933 0.420 0.016 0.084 0.468 0.012
#> GSM25659     3   0.637    0.38821 0.192 0.008 0.612 0.016 0.172
#> GSM25660     1   0.605    0.35848 0.508 0.004 0.080 0.008 0.400
#> GSM25661     1   0.300    0.69165 0.872 0.000 0.032 0.008 0.088
#> GSM25662     4   0.583    0.24484 0.000 0.340 0.020 0.576 0.064
#> GSM25663     5   0.780    0.12689 0.000 0.308 0.092 0.180 0.420
#> GSM25680     5   0.688    0.48080 0.000 0.104 0.180 0.120 0.596
#> GSM25681     5   0.606    0.52217 0.020 0.048 0.180 0.068 0.684
#> GSM25682     4   0.667   -0.00482 0.000 0.336 0.000 0.424 0.240
#> GSM25683     4   0.564    0.31128 0.000 0.276 0.000 0.608 0.116
#> GSM25684     4   0.657    0.23566 0.000 0.304 0.028 0.540 0.128
#> GSM25685     4   0.406    0.48915 0.000 0.176 0.020 0.784 0.020
#> GSM25686     4   0.664    0.01229 0.000 0.340 0.000 0.428 0.232
#> GSM25687     2   0.675    0.04927 0.000 0.380 0.000 0.360 0.260
#> GSM48664     1   0.437    0.65755 0.800 0.104 0.000 0.040 0.056
#> GSM48665     1   0.367    0.67774 0.844 0.080 0.000 0.028 0.048

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM25548     5   0.322     0.6817 0.000 0.060 0.004 0.052 0.856 0.028
#> GSM25549     5   0.226     0.6817 0.000 0.048 0.004 0.008 0.908 0.032
#> GSM25550     5   0.233     0.6732 0.024 0.056 0.000 0.004 0.904 0.012
#> GSM25551     4   0.346     0.4866 0.004 0.032 0.008 0.828 0.120 0.008
#> GSM25570     5   0.250     0.6819 0.004 0.044 0.004 0.004 0.896 0.048
#> GSM25571     5   0.336     0.6712 0.004 0.028 0.000 0.040 0.844 0.084
#> GSM25358     4   0.844     0.2174 0.148 0.024 0.216 0.404 0.156 0.052
#> GSM25359     4   0.751     0.1059 0.012 0.032 0.324 0.344 0.260 0.028
#> GSM25360     3   0.560     0.2696 0.008 0.008 0.516 0.024 0.040 0.404
#> GSM25361     6   0.640     0.0660 0.012 0.012 0.324 0.012 0.140 0.500
#> GSM25377     1   0.731     0.4617 0.540 0.188 0.144 0.032 0.020 0.076
#> GSM25378     1   0.661     0.5245 0.620 0.016 0.072 0.168 0.088 0.036
#> GSM25401     4   0.391     0.4943 0.148 0.024 0.016 0.792 0.000 0.020
#> GSM25402     4   0.738    -0.0904 0.376 0.096 0.084 0.392 0.000 0.052
#> GSM25349     2   0.665     0.4490 0.028 0.584 0.144 0.028 0.196 0.020
#> GSM25350     2   0.623     0.2657 0.012 0.512 0.120 0.004 0.332 0.020
#> GSM25356     1   0.801     0.4306 0.516 0.052 0.104 0.116 0.152 0.060
#> GSM25357     4   0.721     0.1457 0.016 0.128 0.072 0.488 0.280 0.016
#> GSM25385     3   0.749     0.3129 0.248 0.020 0.476 0.156 0.016 0.084
#> GSM25386     3   0.473     0.5703 0.036 0.032 0.780 0.080 0.012 0.060
#> GSM25399     1   0.622     0.5443 0.656 0.136 0.092 0.036 0.008 0.072
#> GSM25400     1   0.460     0.6067 0.788 0.032 0.040 0.068 0.008 0.064
#> GSM48659     2   0.839     0.2646 0.000 0.304 0.092 0.208 0.104 0.292
#> GSM48660     2   0.327     0.5844 0.004 0.848 0.056 0.008 0.080 0.004
#> GSM25409     5   0.506     0.5297 0.016 0.244 0.028 0.032 0.676 0.004
#> GSM25410     3   0.538     0.5456 0.060 0.040 0.724 0.116 0.004 0.056
#> GSM25426     4   0.216     0.5126 0.000 0.056 0.008 0.908 0.028 0.000
#> GSM25427     1   0.787     0.4205 0.492 0.200 0.104 0.016 0.120 0.068
#> GSM25540     3   0.547     0.2651 0.004 0.016 0.500 0.040 0.012 0.428
#> GSM25541     6   0.510    -0.1758 0.016 0.008 0.432 0.012 0.012 0.520
#> GSM25542     3   0.483     0.4155 0.000 0.248 0.676 0.052 0.004 0.020
#> GSM25543     3   0.430     0.4600 0.000 0.220 0.728 0.012 0.028 0.012
#> GSM25479     1   0.542     0.5066 0.668 0.004 0.020 0.008 0.120 0.180
#> GSM25480     1   0.716     0.1741 0.428 0.016 0.044 0.004 0.276 0.232
#> GSM25481     1   0.840     0.1587 0.348 0.348 0.080 0.060 0.112 0.052
#> GSM25482     1   0.799     0.3458 0.436 0.256 0.048 0.032 0.172 0.056
#> GSM48654     2   0.674     0.5309 0.000 0.588 0.156 0.056 0.060 0.140
#> GSM48650     2   0.563     0.3545 0.000 0.548 0.036 0.356 0.052 0.008
#> GSM48651     2   0.511     0.5833 0.000 0.732 0.052 0.120 0.072 0.024
#> GSM48652     2   0.559     0.5830 0.000 0.704 0.072 0.112 0.068 0.044
#> GSM48653     2   0.716     0.4872 0.000 0.532 0.108 0.180 0.036 0.144
#> GSM48662     2   0.381     0.5810 0.000 0.804 0.076 0.004 0.104 0.012
#> GSM48663     2   0.459     0.5356 0.008 0.764 0.068 0.016 0.128 0.016
#> GSM25524     6   0.609     0.1429 0.136 0.000 0.264 0.020 0.016 0.564
#> GSM25525     6   0.632    -0.0927 0.400 0.004 0.024 0.008 0.120 0.444
#> GSM25526     4   0.588     0.2525 0.284 0.004 0.036 0.572 0.000 0.104
#> GSM25527     1   0.460     0.5450 0.720 0.000 0.016 0.040 0.016 0.208
#> GSM25528     6   0.640     0.1285 0.368 0.000 0.220 0.000 0.020 0.392
#> GSM25529     1   0.588     0.0436 0.444 0.000 0.032 0.000 0.092 0.432
#> GSM25530     1   0.656     0.4210 0.584 0.020 0.168 0.056 0.004 0.168
#> GSM25531     1   0.469     0.5974 0.772 0.024 0.040 0.064 0.004 0.096
#> GSM48661     2   0.754     0.0739 0.000 0.324 0.284 0.080 0.016 0.296
#> GSM25561     3   0.540     0.5107 0.068 0.068 0.696 0.004 0.008 0.156
#> GSM25562     2   0.837    -0.1834 0.304 0.356 0.164 0.032 0.040 0.104
#> GSM25563     3   0.485     0.5438 0.036 0.056 0.744 0.016 0.004 0.144
#> GSM25564     2   0.767     0.1262 0.120 0.436 0.032 0.048 0.044 0.320
#> GSM25565     2   0.734     0.3847 0.000 0.456 0.216 0.120 0.196 0.012
#> GSM25566     5   0.681     0.3038 0.000 0.240 0.032 0.272 0.444 0.012
#> GSM25568     2   0.592     0.3024 0.020 0.560 0.328 0.008 0.020 0.064
#> GSM25569     2   0.596     0.5457 0.000 0.632 0.164 0.020 0.148 0.036
#> GSM25552     5   0.295     0.6545 0.008 0.076 0.004 0.000 0.864 0.048
#> GSM25553     5   0.342     0.6348 0.012 0.064 0.024 0.000 0.848 0.052
#> GSM25578     1   0.501     0.5328 0.704 0.004 0.024 0.004 0.084 0.180
#> GSM25579     6   0.672     0.1906 0.224 0.004 0.024 0.004 0.356 0.388
#> GSM25580     1   0.306     0.6268 0.868 0.036 0.004 0.004 0.020 0.068
#> GSM25581     1   0.316     0.6184 0.860 0.012 0.012 0.008 0.020 0.088
#> GSM48655     2   0.637     0.2229 0.000 0.512 0.036 0.144 0.300 0.008
#> GSM48656     2   0.503     0.5845 0.004 0.744 0.072 0.020 0.112 0.048
#> GSM48657     2   0.550     0.4984 0.008 0.656 0.004 0.152 0.164 0.016
#> GSM48658     6   0.723    -0.3006 0.000 0.356 0.144 0.048 0.044 0.408
#> GSM25624     1   0.403     0.6221 0.824 0.020 0.032 0.012 0.048 0.064
#> GSM25625     1   0.773    -0.1627 0.308 0.004 0.248 0.272 0.000 0.168
#> GSM25626     3   0.623     0.4839 0.064 0.020 0.596 0.232 0.000 0.088
#> GSM25627     4   0.465     0.4886 0.052 0.064 0.024 0.772 0.000 0.088
#> GSM25628     3   0.602     0.4911 0.004 0.072 0.608 0.104 0.000 0.212
#> GSM25629     4   0.486     0.4363 0.028 0.028 0.040 0.724 0.000 0.180
#> GSM25630     3   0.552     0.5166 0.048 0.072 0.676 0.012 0.004 0.188
#> GSM25631     6   0.604     0.2768 0.012 0.056 0.132 0.000 0.176 0.624
#> GSM25632     3   0.647     0.2403 0.332 0.004 0.488 0.064 0.000 0.112
#> GSM25633     1   0.327     0.6066 0.844 0.004 0.032 0.012 0.004 0.104
#> GSM25634     1   0.423     0.6165 0.808 0.028 0.084 0.020 0.012 0.048
#> GSM25635     1   0.436     0.6126 0.796 0.012 0.016 0.024 0.084 0.068
#> GSM25656     3   0.662     0.4793 0.004 0.108 0.588 0.144 0.012 0.144
#> GSM25657     1   0.464     0.5981 0.780 0.040 0.076 0.020 0.008 0.076
#> GSM25658     4   0.607     0.0207 0.384 0.020 0.016 0.484 0.000 0.096
#> GSM25659     6   0.584     0.3736 0.200 0.044 0.036 0.008 0.052 0.660
#> GSM25660     1   0.585     0.3679 0.564 0.008 0.008 0.000 0.248 0.172
#> GSM25661     1   0.326     0.6137 0.844 0.008 0.012 0.000 0.036 0.100
#> GSM25662     4   0.616     0.2611 0.000 0.220 0.036 0.600 0.120 0.024
#> GSM25663     5   0.707     0.5092 0.000 0.204 0.076 0.108 0.548 0.064
#> GSM25680     5   0.568     0.5139 0.000 0.016 0.044 0.088 0.652 0.200
#> GSM25681     5   0.573     0.4682 0.012 0.008 0.088 0.048 0.668 0.176
#> GSM25682     5   0.642     0.4140 0.000 0.248 0.024 0.240 0.484 0.004
#> GSM25683     4   0.677    -0.1277 0.000 0.228 0.032 0.424 0.308 0.008
#> GSM25684     4   0.628     0.1821 0.000 0.196 0.004 0.536 0.232 0.032
#> GSM25685     4   0.334     0.4819 0.000 0.088 0.016 0.848 0.020 0.028
#> GSM25686     5   0.640     0.4024 0.000 0.220 0.020 0.288 0.468 0.004
#> GSM25687     5   0.641     0.4028 0.000 0.272 0.016 0.228 0.476 0.008
#> GSM48664     1   0.595     0.5585 0.676 0.156 0.068 0.024 0.020 0.056
#> GSM48665     1   0.410     0.6229 0.820 0.068 0.016 0.016 0.036 0.044

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 genotype/variation(p) k
#> MAD:NMF 94              0.000057 2
#> MAD:NMF 74              0.000619 3
#> MAD:NMF 40              0.024680 4
#> MAD:NMF 51              0.002546 5
#> MAD:NMF 41              0.026226 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk 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.372           0.727       0.860         0.3507 0.642   0.642
#> 3 3 0.406           0.657       0.813         0.6565 0.638   0.477
#> 4 4 0.412           0.452       0.703         0.1753 0.864   0.681
#> 5 5 0.451           0.405       0.667         0.0744 0.839   0.574
#> 6 6 0.525           0.556       0.719         0.0565 0.920   0.710

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

suggest_best_k(res)
#> [1] 3

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM25548     2  0.1184      0.835 0.016 0.984
#> GSM25549     2  0.1184      0.835 0.016 0.984
#> GSM25550     2  0.1184      0.835 0.016 0.984
#> GSM25551     2  0.1184      0.835 0.016 0.984
#> GSM25570     2  0.1184      0.835 0.016 0.984
#> GSM25571     2  0.1184      0.835 0.016 0.984
#> GSM25358     1  0.9522      0.533 0.628 0.372
#> GSM25359     1  0.9522      0.533 0.628 0.372
#> GSM25360     1  0.0938      0.739 0.988 0.012
#> GSM25361     1  0.9248      0.605 0.660 0.340
#> GSM25377     2  0.9393      0.525 0.356 0.644
#> GSM25378     2  0.6887      0.752 0.184 0.816
#> GSM25401     2  0.8016      0.698 0.244 0.756
#> GSM25402     2  0.8016      0.698 0.244 0.756
#> GSM25349     2  0.1414      0.830 0.020 0.980
#> GSM25350     2  0.1414      0.830 0.020 0.980
#> GSM25356     2  0.0672      0.835 0.008 0.992
#> GSM25357     2  0.0376      0.833 0.004 0.996
#> GSM25385     1  0.8144      0.702 0.748 0.252
#> GSM25386     1  0.0938      0.739 0.988 0.012
#> GSM25399     2  0.9393      0.525 0.356 0.644
#> GSM25400     2  0.6887      0.752 0.184 0.816
#> GSM48659     2  0.0000      0.832 0.000 1.000
#> GSM48660     2  0.0938      0.827 0.012 0.988
#> GSM25409     2  0.1414      0.830 0.020 0.980
#> GSM25410     1  0.0938      0.739 0.988 0.012
#> GSM25426     2  0.0376      0.833 0.004 0.996
#> GSM25427     2  0.6887      0.752 0.184 0.816
#> GSM25540     1  0.9248      0.605 0.660 0.340
#> GSM25541     1  0.9248      0.605 0.660 0.340
#> GSM25542     1  0.9970      0.237 0.532 0.468
#> GSM25543     1  0.9970      0.237 0.532 0.468
#> GSM25479     2  0.7602      0.718 0.220 0.780
#> GSM25480     2  0.7602      0.718 0.220 0.780
#> GSM25481     2  0.1633      0.831 0.024 0.976
#> GSM25482     2  0.1633      0.831 0.024 0.976
#> GSM48654     2  0.1633      0.832 0.024 0.976
#> GSM48650     2  0.0938      0.827 0.012 0.988
#> GSM48651     2  0.0938      0.827 0.012 0.988
#> GSM48652     2  0.0938      0.827 0.012 0.988
#> GSM48653     2  0.0938      0.827 0.012 0.988
#> GSM48662     2  0.0938      0.827 0.012 0.988
#> GSM48663     2  0.0938      0.827 0.012 0.988
#> GSM25524     2  0.9710      0.357 0.400 0.600
#> GSM25525     2  0.7815      0.706 0.232 0.768
#> GSM25526     1  0.9833      0.406 0.576 0.424
#> GSM25527     2  0.9129      0.563 0.328 0.672
#> GSM25528     1  0.8443      0.689 0.728 0.272
#> GSM25529     2  0.8763      0.627 0.296 0.704
#> GSM25530     1  0.8386      0.692 0.732 0.268
#> GSM25531     1  0.8386      0.692 0.732 0.268
#> GSM48661     2  0.1633      0.832 0.024 0.976
#> GSM25561     1  0.3274      0.742 0.940 0.060
#> GSM25562     2  0.8608      0.644 0.284 0.716
#> GSM25563     1  0.2423      0.742 0.960 0.040
#> GSM25564     2  0.3733      0.816 0.072 0.928
#> GSM25565     2  0.1414      0.830 0.020 0.980
#> GSM25566     2  0.1414      0.830 0.020 0.980
#> GSM25568     2  0.0376      0.833 0.004 0.996
#> GSM25569     2  0.0000      0.832 0.000 1.000
#> GSM25552     2  0.1414      0.830 0.020 0.980
#> GSM25553     2  0.1414      0.830 0.020 0.980
#> GSM25578     2  0.8763      0.625 0.296 0.704
#> GSM25579     2  0.8763      0.625 0.296 0.704
#> GSM25580     2  0.8763      0.625 0.296 0.704
#> GSM25581     2  0.8763      0.625 0.296 0.704
#> GSM48655     2  0.0000      0.832 0.000 1.000
#> GSM48656     2  0.1633      0.832 0.024 0.976
#> GSM48657     2  0.0000      0.832 0.000 1.000
#> GSM48658     2  0.1633      0.832 0.024 0.976
#> GSM25624     2  0.3584      0.820 0.068 0.932
#> GSM25625     1  0.0938      0.739 0.988 0.012
#> GSM25626     1  0.0938      0.739 0.988 0.012
#> GSM25627     2  0.8081      0.688 0.248 0.752
#> GSM25628     1  0.0938      0.739 0.988 0.012
#> GSM25629     2  0.8608      0.642 0.284 0.716
#> GSM25630     1  0.0938      0.739 0.988 0.012
#> GSM25631     2  0.8555      0.648 0.280 0.720
#> GSM25632     1  0.0938      0.739 0.988 0.012
#> GSM25633     2  0.8608      0.642 0.284 0.716
#> GSM25634     2  0.8608      0.642 0.284 0.716
#> GSM25635     2  0.8608      0.642 0.284 0.716
#> GSM25656     1  0.7376      0.719 0.792 0.208
#> GSM25657     2  0.8713      0.631 0.292 0.708
#> GSM25658     2  0.6973      0.749 0.188 0.812
#> GSM25659     2  0.7528      0.725 0.216 0.784
#> GSM25660     2  0.8661      0.638 0.288 0.712
#> GSM25661     2  0.8661      0.638 0.288 0.712
#> GSM25662     2  0.2603      0.829 0.044 0.956
#> GSM25663     2  0.2603      0.829 0.044 0.956
#> GSM25680     2  0.1184      0.835 0.016 0.984
#> GSM25681     2  0.1184      0.835 0.016 0.984
#> GSM25682     2  0.0376      0.833 0.004 0.996
#> GSM25683     2  0.0376      0.833 0.004 0.996
#> GSM25684     2  0.0000      0.832 0.000 1.000
#> GSM25685     2  0.0000      0.832 0.000 1.000
#> GSM25686     2  0.0376      0.833 0.004 0.996
#> GSM25687     2  0.0376      0.833 0.004 0.996
#> GSM48664     2  0.9393      0.525 0.356 0.644
#> GSM48665     2  0.9393      0.525 0.356 0.644

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.2448     0.8962 0.076 0.924 0.000
#> GSM25549     2  0.2448     0.8962 0.076 0.924 0.000
#> GSM25550     2  0.2448     0.8962 0.076 0.924 0.000
#> GSM25551     2  0.2448     0.8962 0.076 0.924 0.000
#> GSM25570     2  0.2448     0.8962 0.076 0.924 0.000
#> GSM25571     2  0.2448     0.8962 0.076 0.924 0.000
#> GSM25358     1  0.6516    -0.3545 0.516 0.004 0.480
#> GSM25359     1  0.6516    -0.3545 0.516 0.004 0.480
#> GSM25360     3  0.0892     0.8197 0.020 0.000 0.980
#> GSM25361     3  0.7493     0.2969 0.480 0.036 0.484
#> GSM25377     1  0.1491     0.5437 0.968 0.016 0.016
#> GSM25378     1  0.6299     0.2381 0.524 0.476 0.000
#> GSM25401     1  0.6521     0.4637 0.644 0.340 0.016
#> GSM25402     1  0.6521     0.4637 0.644 0.340 0.016
#> GSM25349     2  0.4345     0.8579 0.136 0.848 0.016
#> GSM25350     2  0.4345     0.8579 0.136 0.848 0.016
#> GSM25356     2  0.2261     0.8984 0.068 0.932 0.000
#> GSM25357     2  0.2165     0.8983 0.064 0.936 0.000
#> GSM25385     3  0.5859     0.5946 0.344 0.000 0.656
#> GSM25386     3  0.0892     0.8197 0.020 0.000 0.980
#> GSM25399     1  0.1491     0.5437 0.968 0.016 0.016
#> GSM25400     1  0.6299     0.2381 0.524 0.476 0.000
#> GSM48659     2  0.0661     0.8747 0.008 0.988 0.004
#> GSM48660     2  0.1620     0.8874 0.024 0.964 0.012
#> GSM25409     2  0.4345     0.8579 0.136 0.848 0.016
#> GSM25410     3  0.0892     0.8197 0.020 0.000 0.980
#> GSM25426     2  0.2165     0.8983 0.064 0.936 0.000
#> GSM25427     1  0.6299     0.2381 0.524 0.476 0.000
#> GSM25540     3  0.7493     0.2969 0.480 0.036 0.484
#> GSM25541     3  0.7493     0.2969 0.480 0.036 0.484
#> GSM25542     1  0.9030     0.0331 0.492 0.140 0.368
#> GSM25543     1  0.9030     0.0331 0.492 0.140 0.368
#> GSM25479     1  0.6608     0.4273 0.560 0.432 0.008
#> GSM25480     1  0.6608     0.4273 0.560 0.432 0.008
#> GSM25481     2  0.4539     0.8494 0.148 0.836 0.016
#> GSM25482     2  0.4539     0.8494 0.148 0.836 0.016
#> GSM48654     2  0.3983     0.7583 0.144 0.852 0.004
#> GSM48650     2  0.1620     0.8861 0.024 0.964 0.012
#> GSM48651     2  0.1620     0.8874 0.024 0.964 0.012
#> GSM48652     2  0.1620     0.8874 0.024 0.964 0.012
#> GSM48653     2  0.1620     0.8874 0.024 0.964 0.012
#> GSM48662     2  0.1620     0.8874 0.024 0.964 0.012
#> GSM48663     2  0.2269     0.8870 0.040 0.944 0.016
#> GSM25524     1  0.4586     0.5008 0.856 0.048 0.096
#> GSM25525     1  0.6745     0.4315 0.560 0.428 0.012
#> GSM25526     1  0.7267     0.2277 0.668 0.064 0.268
#> GSM25527     1  0.5402     0.6848 0.792 0.180 0.028
#> GSM25528     1  0.6274    -0.3214 0.544 0.000 0.456
#> GSM25529     1  0.5414     0.6945 0.772 0.212 0.016
#> GSM25530     1  0.6291    -0.3475 0.532 0.000 0.468
#> GSM25531     1  0.6291    -0.3475 0.532 0.000 0.468
#> GSM48661     2  0.3983     0.7583 0.144 0.852 0.004
#> GSM25561     3  0.2537     0.7996 0.080 0.000 0.920
#> GSM25562     1  0.5061     0.7008 0.784 0.208 0.008
#> GSM25563     3  0.1860     0.8113 0.052 0.000 0.948
#> GSM25564     2  0.3686     0.8293 0.140 0.860 0.000
#> GSM25565     2  0.4345     0.8579 0.136 0.848 0.016
#> GSM25566     2  0.4345     0.8579 0.136 0.848 0.016
#> GSM25568     2  0.0983     0.8723 0.016 0.980 0.004
#> GSM25569     2  0.0661     0.8747 0.008 0.988 0.004
#> GSM25552     2  0.4345     0.8579 0.136 0.848 0.016
#> GSM25553     2  0.4345     0.8579 0.136 0.848 0.016
#> GSM25578     1  0.5072     0.6993 0.792 0.196 0.012
#> GSM25579     1  0.5072     0.6993 0.792 0.196 0.012
#> GSM25580     1  0.5072     0.6993 0.792 0.196 0.012
#> GSM25581     1  0.5072     0.6993 0.792 0.196 0.012
#> GSM48655     2  0.0661     0.8747 0.008 0.988 0.004
#> GSM48656     2  0.3983     0.7583 0.144 0.852 0.004
#> GSM48657     2  0.0661     0.8747 0.008 0.988 0.004
#> GSM48658     2  0.3983     0.7583 0.144 0.852 0.004
#> GSM25624     2  0.4978     0.6639 0.216 0.780 0.004
#> GSM25625     3  0.0892     0.8197 0.020 0.000 0.980
#> GSM25626     3  0.0892     0.8197 0.020 0.000 0.980
#> GSM25627     1  0.6082     0.6479 0.692 0.296 0.012
#> GSM25628     3  0.0892     0.8197 0.020 0.000 0.980
#> GSM25629     1  0.5681     0.6957 0.748 0.236 0.016
#> GSM25630     3  0.0892     0.8197 0.020 0.000 0.980
#> GSM25631     1  0.5723     0.6952 0.744 0.240 0.016
#> GSM25632     3  0.0892     0.8197 0.020 0.000 0.980
#> GSM25633     1  0.5681     0.6957 0.748 0.236 0.016
#> GSM25634     1  0.5681     0.6957 0.748 0.236 0.016
#> GSM25635     1  0.5681     0.6957 0.748 0.236 0.016
#> GSM25656     3  0.6381     0.5758 0.340 0.012 0.648
#> GSM25657     1  0.5072     0.6985 0.792 0.196 0.012
#> GSM25658     1  0.6235     0.3709 0.564 0.436 0.000
#> GSM25659     1  0.6192     0.4324 0.580 0.420 0.000
#> GSM25660     1  0.5171     0.7006 0.784 0.204 0.012
#> GSM25661     1  0.4912     0.6994 0.796 0.196 0.008
#> GSM25662     2  0.5325     0.6842 0.248 0.748 0.004
#> GSM25663     2  0.5325     0.6842 0.248 0.748 0.004
#> GSM25680     2  0.2448     0.8962 0.076 0.924 0.000
#> GSM25681     2  0.2448     0.8962 0.076 0.924 0.000
#> GSM25682     2  0.2165     0.8983 0.064 0.936 0.000
#> GSM25683     2  0.2165     0.8983 0.064 0.936 0.000
#> GSM25684     2  0.0661     0.8747 0.008 0.988 0.004
#> GSM25685     2  0.0661     0.8747 0.008 0.988 0.004
#> GSM25686     2  0.2165     0.8983 0.064 0.936 0.000
#> GSM25687     2  0.2165     0.8983 0.064 0.936 0.000
#> GSM48664     1  0.1491     0.5437 0.968 0.016 0.016
#> GSM48665     1  0.1491     0.5437 0.968 0.016 0.016

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.1118      0.562 0.036 0.964 0.000 0.000
#> GSM25549     2  0.1118      0.562 0.036 0.964 0.000 0.000
#> GSM25550     2  0.1118      0.562 0.036 0.964 0.000 0.000
#> GSM25551     2  0.1118      0.562 0.036 0.964 0.000 0.000
#> GSM25570     2  0.1118      0.562 0.036 0.964 0.000 0.000
#> GSM25571     2  0.1118      0.562 0.036 0.964 0.000 0.000
#> GSM25358     3  0.6909      0.336 0.456 0.012 0.460 0.072
#> GSM25359     3  0.6909      0.336 0.456 0.012 0.460 0.072
#> GSM25360     3  0.0000      0.756 0.000 0.000 1.000 0.000
#> GSM25361     3  0.7063      0.288 0.456 0.032 0.460 0.052
#> GSM25377     1  0.5110      0.480 0.656 0.016 0.000 0.328
#> GSM25378     2  0.6840     -0.149 0.432 0.468 0.000 0.100
#> GSM25401     2  0.7906     -0.206 0.348 0.352 0.000 0.300
#> GSM25402     2  0.7906     -0.206 0.348 0.352 0.000 0.300
#> GSM25349     2  0.6084      0.525 0.092 0.656 0.000 0.252
#> GSM25350     2  0.6084      0.525 0.092 0.656 0.000 0.252
#> GSM25356     2  0.0779      0.565 0.016 0.980 0.000 0.004
#> GSM25357     2  0.0592      0.565 0.016 0.984 0.000 0.000
#> GSM25385     3  0.5896      0.563 0.296 0.004 0.648 0.052
#> GSM25386     3  0.0000      0.756 0.000 0.000 1.000 0.000
#> GSM25399     1  0.5110      0.480 0.656 0.016 0.000 0.328
#> GSM25400     2  0.6840     -0.149 0.432 0.468 0.000 0.100
#> GSM48659     2  0.5028     -0.306 0.004 0.596 0.000 0.400
#> GSM48660     2  0.5207      0.487 0.028 0.680 0.000 0.292
#> GSM25409     2  0.6084      0.525 0.092 0.656 0.000 0.252
#> GSM25410     3  0.0000      0.756 0.000 0.000 1.000 0.000
#> GSM25426     2  0.0927      0.560 0.016 0.976 0.000 0.008
#> GSM25427     2  0.6840     -0.149 0.432 0.468 0.000 0.100
#> GSM25540     3  0.7063      0.288 0.456 0.032 0.460 0.052
#> GSM25541     3  0.7063      0.288 0.456 0.032 0.460 0.052
#> GSM25542     1  0.8235     -0.068 0.480 0.084 0.348 0.088
#> GSM25543     1  0.8235     -0.068 0.480 0.084 0.348 0.088
#> GSM25479     1  0.5440      0.421 0.596 0.384 0.000 0.020
#> GSM25480     1  0.5440      0.421 0.596 0.384 0.000 0.020
#> GSM25481     2  0.4562      0.559 0.056 0.792 0.000 0.152
#> GSM25482     2  0.4562      0.559 0.056 0.792 0.000 0.152
#> GSM48654     4  0.7246      0.960 0.144 0.408 0.000 0.448
#> GSM48650     2  0.5384      0.472 0.028 0.648 0.000 0.324
#> GSM48651     2  0.5207      0.487 0.028 0.680 0.000 0.292
#> GSM48652     2  0.5207      0.487 0.028 0.680 0.000 0.292
#> GSM48653     2  0.5207      0.487 0.028 0.680 0.000 0.292
#> GSM48662     2  0.5207      0.487 0.028 0.680 0.000 0.292
#> GSM48663     2  0.5404      0.477 0.028 0.644 0.000 0.328
#> GSM25524     1  0.5233      0.532 0.784 0.032 0.056 0.128
#> GSM25525     1  0.5699      0.422 0.588 0.380 0.000 0.032
#> GSM25526     1  0.6892      0.245 0.648 0.036 0.224 0.092
#> GSM25527     1  0.4107      0.696 0.832 0.128 0.012 0.028
#> GSM25528     1  0.6818     -0.264 0.504 0.008 0.412 0.076
#> GSM25529     1  0.4199      0.685 0.804 0.164 0.000 0.032
#> GSM25530     1  0.6833     -0.293 0.492 0.008 0.424 0.076
#> GSM25531     1  0.6833     -0.293 0.492 0.008 0.424 0.076
#> GSM48661     4  0.7246      0.960 0.144 0.408 0.000 0.448
#> GSM25561     3  0.2282      0.742 0.052 0.000 0.924 0.024
#> GSM25562     1  0.4872      0.691 0.776 0.148 0.000 0.076
#> GSM25563     3  0.1610      0.750 0.032 0.000 0.952 0.016
#> GSM25564     2  0.6429      0.478 0.160 0.648 0.000 0.192
#> GSM25565     2  0.6084      0.525 0.092 0.656 0.000 0.252
#> GSM25566     2  0.6084      0.525 0.092 0.656 0.000 0.252
#> GSM25568     2  0.5475      0.228 0.036 0.656 0.000 0.308
#> GSM25569     2  0.5383      0.270 0.036 0.672 0.000 0.292
#> GSM25552     2  0.6084      0.525 0.092 0.656 0.000 0.252
#> GSM25553     2  0.6084      0.525 0.092 0.656 0.000 0.252
#> GSM25578     1  0.3300      0.703 0.848 0.144 0.000 0.008
#> GSM25579     1  0.3300      0.703 0.848 0.144 0.000 0.008
#> GSM25580     1  0.3249      0.702 0.852 0.140 0.000 0.008
#> GSM25581     1  0.3249      0.702 0.852 0.140 0.000 0.008
#> GSM48655     2  0.5659     -0.409 0.032 0.600 0.000 0.368
#> GSM48656     4  0.7246      0.960 0.144 0.408 0.000 0.448
#> GSM48657     2  0.5659     -0.409 0.032 0.600 0.000 0.368
#> GSM48658     4  0.7246      0.960 0.144 0.408 0.000 0.448
#> GSM25624     4  0.7683      0.836 0.216 0.384 0.000 0.400
#> GSM25625     3  0.0804      0.755 0.012 0.000 0.980 0.008
#> GSM25626     3  0.0000      0.756 0.000 0.000 1.000 0.000
#> GSM25627     1  0.5589      0.640 0.724 0.192 0.004 0.080
#> GSM25628     3  0.0000      0.756 0.000 0.000 1.000 0.000
#> GSM25629     1  0.4239      0.686 0.808 0.160 0.004 0.028
#> GSM25630     3  0.0000      0.756 0.000 0.000 1.000 0.000
#> GSM25631     1  0.4285      0.684 0.804 0.164 0.004 0.028
#> GSM25632     3  0.0000      0.756 0.000 0.000 1.000 0.000
#> GSM25633     1  0.4239      0.686 0.808 0.160 0.004 0.028
#> GSM25634     1  0.4239      0.686 0.808 0.160 0.004 0.028
#> GSM25635     1  0.4239      0.686 0.808 0.160 0.004 0.028
#> GSM25656     3  0.6021      0.544 0.320 0.004 0.624 0.052
#> GSM25657     1  0.3501      0.703 0.848 0.132 0.000 0.020
#> GSM25658     1  0.6783      0.316 0.512 0.388 0.000 0.100
#> GSM25659     1  0.5971      0.410 0.584 0.368 0.000 0.048
#> GSM25660     1  0.3763      0.700 0.832 0.144 0.000 0.024
#> GSM25661     1  0.5722      0.670 0.716 0.136 0.000 0.148
#> GSM25662     2  0.4467      0.299 0.172 0.788 0.000 0.040
#> GSM25663     2  0.4467      0.299 0.172 0.788 0.000 0.040
#> GSM25680     2  0.1118      0.562 0.036 0.964 0.000 0.000
#> GSM25681     2  0.1118      0.562 0.036 0.964 0.000 0.000
#> GSM25682     2  0.0592      0.565 0.016 0.984 0.000 0.000
#> GSM25683     2  0.0592      0.565 0.016 0.984 0.000 0.000
#> GSM25684     2  0.5040     -0.310 0.008 0.628 0.000 0.364
#> GSM25685     2  0.5040     -0.310 0.008 0.628 0.000 0.364
#> GSM25686     2  0.0592      0.565 0.016 0.984 0.000 0.000
#> GSM25687     2  0.0592      0.565 0.016 0.984 0.000 0.000
#> GSM48664     1  0.5110      0.480 0.656 0.016 0.000 0.328
#> GSM48665     1  0.5110      0.480 0.656 0.016 0.000 0.328

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     5  0.0609     0.5532 0.020 0.000 0.000 0.000 0.980
#> GSM25549     5  0.0609     0.5532 0.020 0.000 0.000 0.000 0.980
#> GSM25550     5  0.0609     0.5532 0.020 0.000 0.000 0.000 0.980
#> GSM25551     5  0.0609     0.5532 0.020 0.000 0.000 0.000 0.980
#> GSM25570     5  0.0609     0.5532 0.020 0.000 0.000 0.000 0.980
#> GSM25571     5  0.0609     0.5532 0.020 0.000 0.000 0.000 0.980
#> GSM25358     1  0.6957    -0.0213 0.472 0.044 0.396 0.068 0.020
#> GSM25359     1  0.6957    -0.0213 0.472 0.044 0.396 0.068 0.020
#> GSM25360     3  0.0290     0.8788 0.008 0.000 0.992 0.000 0.000
#> GSM25361     1  0.6952     0.0875 0.476 0.036 0.396 0.060 0.032
#> GSM25377     4  0.3563     0.7650 0.208 0.000 0.000 0.780 0.012
#> GSM25378     5  0.6420    -0.0871 0.400 0.024 0.000 0.096 0.480
#> GSM25401     4  0.6520     0.4563 0.052 0.072 0.000 0.524 0.352
#> GSM25402     4  0.6520     0.4563 0.052 0.072 0.000 0.524 0.352
#> GSM25349     5  0.6596     0.0720 0.072 0.392 0.000 0.052 0.484
#> GSM25350     5  0.6596     0.0720 0.072 0.392 0.000 0.052 0.484
#> GSM25356     5  0.0162     0.5479 0.000 0.000 0.000 0.004 0.996
#> GSM25357     5  0.0000     0.5478 0.000 0.000 0.000 0.000 1.000
#> GSM25385     3  0.5539     0.4401 0.316 0.012 0.616 0.052 0.004
#> GSM25386     3  0.0451     0.8790 0.008 0.004 0.988 0.000 0.000
#> GSM25399     4  0.3563     0.7650 0.208 0.000 0.000 0.780 0.012
#> GSM25400     5  0.6420    -0.0871 0.400 0.024 0.000 0.096 0.480
#> GSM48659     2  0.6437     0.2115 0.024 0.460 0.000 0.096 0.420
#> GSM48660     2  0.4210     0.3806 0.000 0.588 0.000 0.000 0.412
#> GSM25409     5  0.6596     0.0720 0.072 0.392 0.000 0.052 0.484
#> GSM25410     3  0.0451     0.8790 0.008 0.004 0.988 0.000 0.000
#> GSM25426     5  0.0290     0.5457 0.000 0.008 0.000 0.000 0.992
#> GSM25427     5  0.6420    -0.0871 0.400 0.024 0.000 0.096 0.480
#> GSM25540     1  0.6952     0.0875 0.476 0.036 0.396 0.060 0.032
#> GSM25541     1  0.6952     0.0875 0.476 0.036 0.396 0.060 0.032
#> GSM25542     1  0.7656     0.2046 0.496 0.088 0.312 0.048 0.056
#> GSM25543     1  0.7656     0.2046 0.496 0.088 0.312 0.048 0.056
#> GSM25479     1  0.5857     0.3863 0.556 0.040 0.000 0.036 0.368
#> GSM25480     1  0.5857     0.3863 0.556 0.040 0.000 0.036 0.368
#> GSM25481     5  0.4572     0.4004 0.016 0.168 0.000 0.056 0.760
#> GSM25482     5  0.4572     0.4004 0.016 0.168 0.000 0.056 0.760
#> GSM48654     2  0.8319     0.2913 0.168 0.336 0.000 0.180 0.316
#> GSM48650     2  0.4620     0.3604 0.008 0.616 0.000 0.008 0.368
#> GSM48651     2  0.4210     0.3806 0.000 0.588 0.000 0.000 0.412
#> GSM48652     2  0.4210     0.3806 0.000 0.588 0.000 0.000 0.412
#> GSM48653     2  0.4210     0.3806 0.000 0.588 0.000 0.000 0.412
#> GSM48662     2  0.4210     0.3806 0.000 0.588 0.000 0.000 0.412
#> GSM48663     2  0.4723     0.3242 0.008 0.612 0.000 0.012 0.368
#> GSM25524     1  0.4622     0.4495 0.800 0.036 0.028 0.104 0.032
#> GSM25525     1  0.5600     0.3819 0.576 0.044 0.000 0.020 0.360
#> GSM25526     1  0.6471     0.4021 0.668 0.052 0.164 0.080 0.036
#> GSM25527     1  0.3545     0.5959 0.832 0.008 0.004 0.024 0.132
#> GSM25528     1  0.6719     0.0916 0.524 0.048 0.340 0.084 0.004
#> GSM25529     1  0.4071     0.5801 0.788 0.020 0.000 0.024 0.168
#> GSM25530     1  0.6749     0.0577 0.512 0.048 0.352 0.084 0.004
#> GSM25531     1  0.6749     0.0577 0.512 0.048 0.352 0.084 0.004
#> GSM48661     2  0.8319     0.2913 0.168 0.336 0.000 0.180 0.316
#> GSM25561     3  0.3268     0.8181 0.068 0.032 0.868 0.032 0.000
#> GSM25562     1  0.4897     0.5547 0.728 0.004 0.000 0.112 0.156
#> GSM25563     3  0.2511     0.8438 0.044 0.024 0.908 0.024 0.000
#> GSM25564     5  0.6334    -0.0322 0.120 0.360 0.000 0.012 0.508
#> GSM25565     5  0.6596     0.0720 0.072 0.392 0.000 0.052 0.484
#> GSM25566     5  0.6596     0.0720 0.072 0.392 0.000 0.052 0.484
#> GSM25568     2  0.6017     0.3352 0.020 0.480 0.000 0.064 0.436
#> GSM25569     2  0.5974     0.3226 0.020 0.464 0.000 0.060 0.456
#> GSM25552     5  0.6596     0.0720 0.072 0.392 0.000 0.052 0.484
#> GSM25553     5  0.6596     0.0720 0.072 0.392 0.000 0.052 0.484
#> GSM25578     1  0.3730     0.6026 0.808 0.004 0.000 0.036 0.152
#> GSM25579     1  0.3730     0.6026 0.808 0.004 0.000 0.036 0.152
#> GSM25580     1  0.3688     0.6026 0.812 0.004 0.000 0.036 0.148
#> GSM25581     1  0.3688     0.6026 0.812 0.004 0.000 0.036 0.148
#> GSM48655     5  0.7207    -0.2615 0.052 0.380 0.000 0.140 0.428
#> GSM48656     2  0.8319     0.2913 0.168 0.336 0.000 0.180 0.316
#> GSM48657     5  0.7207    -0.2615 0.052 0.380 0.000 0.140 0.428
#> GSM48658     2  0.8319     0.2913 0.168 0.336 0.000 0.180 0.316
#> GSM25624     2  0.8402     0.2346 0.228 0.312 0.000 0.156 0.304
#> GSM25625     3  0.1200     0.8694 0.016 0.012 0.964 0.008 0.000
#> GSM25626     3  0.0162     0.8775 0.000 0.004 0.996 0.000 0.000
#> GSM25627     1  0.5110     0.5646 0.728 0.080 0.000 0.024 0.168
#> GSM25628     3  0.0162     0.8775 0.000 0.004 0.996 0.000 0.000
#> GSM25629     1  0.3421     0.6047 0.816 0.016 0.000 0.004 0.164
#> GSM25630     3  0.0162     0.8775 0.000 0.004 0.996 0.000 0.000
#> GSM25631     1  0.3461     0.6037 0.812 0.016 0.000 0.004 0.168
#> GSM25632     3  0.0162     0.8775 0.000 0.004 0.996 0.000 0.000
#> GSM25633     1  0.3421     0.6047 0.816 0.016 0.000 0.004 0.164
#> GSM25634     1  0.3421     0.6047 0.816 0.016 0.000 0.004 0.164
#> GSM25635     1  0.3421     0.6047 0.816 0.016 0.000 0.004 0.164
#> GSM25656     3  0.6293     0.3292 0.340 0.040 0.556 0.060 0.004
#> GSM25657     1  0.4088     0.5927 0.792 0.004 0.000 0.064 0.140
#> GSM25658     1  0.6420     0.2391 0.480 0.024 0.000 0.096 0.400
#> GSM25659     1  0.6235     0.3545 0.544 0.040 0.000 0.064 0.352
#> GSM25660     1  0.4019     0.5948 0.792 0.004 0.000 0.052 0.152
#> GSM25661     1  0.5544     0.4832 0.660 0.004 0.000 0.192 0.144
#> GSM25662     5  0.3898     0.3996 0.160 0.016 0.000 0.024 0.800
#> GSM25663     5  0.3898     0.3996 0.160 0.016 0.000 0.024 0.800
#> GSM25680     5  0.0609     0.5532 0.020 0.000 0.000 0.000 0.980
#> GSM25681     5  0.0609     0.5532 0.020 0.000 0.000 0.000 0.980
#> GSM25682     5  0.0000     0.5478 0.000 0.000 0.000 0.000 1.000
#> GSM25683     5  0.0000     0.5478 0.000 0.000 0.000 0.000 1.000
#> GSM25684     5  0.6120    -0.0952 0.020 0.336 0.000 0.088 0.556
#> GSM25685     5  0.6120    -0.0952 0.020 0.336 0.000 0.088 0.556
#> GSM25686     5  0.0000     0.5478 0.000 0.000 0.000 0.000 1.000
#> GSM25687     5  0.0000     0.5478 0.000 0.000 0.000 0.000 1.000
#> GSM48664     4  0.3628     0.7637 0.216 0.000 0.000 0.772 0.012
#> GSM48665     4  0.3628     0.7637 0.216 0.000 0.000 0.772 0.012

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM25548     5  0.0806    0.75423 0.020 0.008 0.000 0.000 0.972 0.000
#> GSM25549     5  0.0806    0.75423 0.020 0.008 0.000 0.000 0.972 0.000
#> GSM25550     5  0.0806    0.75423 0.020 0.008 0.000 0.000 0.972 0.000
#> GSM25551     5  0.0692    0.75354 0.020 0.004 0.000 0.000 0.976 0.000
#> GSM25570     5  0.0806    0.75423 0.020 0.008 0.000 0.000 0.972 0.000
#> GSM25571     5  0.0806    0.75423 0.020 0.008 0.000 0.000 0.972 0.000
#> GSM25358     1  0.6806    0.00994 0.460 0.024 0.376 0.064 0.012 0.064
#> GSM25359     1  0.6806    0.00994 0.460 0.024 0.376 0.064 0.012 0.064
#> GSM25360     3  0.0291    0.86083 0.004 0.000 0.992 0.000 0.000 0.004
#> GSM25361     1  0.6736    0.14568 0.480 0.012 0.360 0.056 0.024 0.068
#> GSM25377     4  0.0865    0.74809 0.036 0.000 0.000 0.964 0.000 0.000
#> GSM25378     5  0.6561    0.02773 0.388 0.036 0.000 0.092 0.452 0.032
#> GSM25401     4  0.5861    0.44665 0.012 0.084 0.000 0.540 0.340 0.024
#> GSM25402     4  0.5861    0.44665 0.012 0.084 0.000 0.540 0.340 0.024
#> GSM25349     2  0.6196    0.60619 0.072 0.512 0.000 0.028 0.356 0.032
#> GSM25350     2  0.6196    0.60619 0.072 0.512 0.000 0.028 0.356 0.032
#> GSM25356     5  0.0291    0.74658 0.000 0.004 0.000 0.004 0.992 0.000
#> GSM25357     5  0.0000    0.74791 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25385     3  0.5396    0.42895 0.300 0.016 0.612 0.040 0.000 0.032
#> GSM25386     3  0.0291    0.86133 0.004 0.000 0.992 0.000 0.000 0.004
#> GSM25399     4  0.0865    0.74809 0.036 0.000 0.000 0.964 0.000 0.000
#> GSM25400     5  0.6561    0.02773 0.388 0.036 0.000 0.092 0.452 0.032
#> GSM48659     2  0.6095   -0.24222 0.004 0.392 0.000 0.000 0.224 0.380
#> GSM48660     2  0.3431    0.65621 0.000 0.756 0.000 0.000 0.228 0.016
#> GSM25409     2  0.6196    0.60619 0.072 0.512 0.000 0.028 0.356 0.032
#> GSM25410     3  0.0291    0.86133 0.004 0.000 0.992 0.000 0.000 0.004
#> GSM25426     5  0.0260    0.74608 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM25427     5  0.6561    0.02773 0.388 0.036 0.000 0.092 0.452 0.032
#> GSM25540     1  0.6736    0.14568 0.480 0.012 0.360 0.056 0.024 0.068
#> GSM25541     1  0.6736    0.14568 0.480 0.012 0.360 0.056 0.024 0.068
#> GSM25542     1  0.7043    0.20304 0.492 0.044 0.312 0.012 0.040 0.100
#> GSM25543     1  0.7043    0.20304 0.492 0.044 0.312 0.012 0.040 0.100
#> GSM25479     1  0.5676    0.44937 0.596 0.068 0.000 0.028 0.292 0.016
#> GSM25480     1  0.5676    0.44937 0.596 0.068 0.000 0.028 0.292 0.016
#> GSM25481     5  0.4711    0.42181 0.008 0.188 0.000 0.040 0.724 0.040
#> GSM25482     5  0.4711    0.42181 0.008 0.188 0.000 0.040 0.724 0.040
#> GSM48654     6  0.4276    0.86563 0.104 0.000 0.000 0.000 0.168 0.728
#> GSM48650     2  0.2738    0.64293 0.000 0.820 0.000 0.000 0.176 0.004
#> GSM48651     2  0.3431    0.65621 0.000 0.756 0.000 0.000 0.228 0.016
#> GSM48652     2  0.3431    0.65621 0.000 0.756 0.000 0.000 0.228 0.016
#> GSM48653     2  0.3431    0.65621 0.000 0.756 0.000 0.000 0.228 0.016
#> GSM48662     2  0.3431    0.65621 0.000 0.756 0.000 0.000 0.228 0.016
#> GSM48663     2  0.3333    0.65187 0.000 0.784 0.000 0.000 0.192 0.024
#> GSM25524     1  0.4584    0.53472 0.784 0.036 0.032 0.068 0.004 0.076
#> GSM25525     1  0.5451    0.43917 0.604 0.080 0.000 0.004 0.288 0.024
#> GSM25526     1  0.5972    0.43194 0.676 0.036 0.140 0.064 0.008 0.076
#> GSM25527     1  0.2992    0.64729 0.868 0.020 0.004 0.008 0.084 0.016
#> GSM25528     1  0.6988    0.12208 0.488 0.036 0.300 0.064 0.000 0.112
#> GSM25529     1  0.3701    0.63196 0.816 0.028 0.000 0.012 0.120 0.024
#> GSM25530     1  0.7019    0.08974 0.476 0.036 0.312 0.064 0.000 0.112
#> GSM25531     1  0.7019    0.08974 0.476 0.036 0.312 0.064 0.000 0.112
#> GSM48661     6  0.4276    0.86563 0.104 0.000 0.000 0.000 0.168 0.728
#> GSM25561     3  0.3413    0.79392 0.064 0.008 0.848 0.036 0.000 0.044
#> GSM25562     1  0.4094    0.61672 0.772 0.012 0.000 0.108 0.108 0.000
#> GSM25563     3  0.2677    0.82028 0.040 0.008 0.892 0.028 0.000 0.032
#> GSM25564     2  0.6067    0.35114 0.136 0.440 0.000 0.004 0.404 0.016
#> GSM25565     2  0.6196    0.60619 0.072 0.512 0.000 0.028 0.356 0.032
#> GSM25566     2  0.6196    0.60619 0.072 0.512 0.000 0.028 0.356 0.032
#> GSM25568     2  0.5667    0.34592 0.000 0.532 0.000 0.000 0.240 0.228
#> GSM25569     2  0.5561    0.38199 0.000 0.552 0.000 0.000 0.244 0.204
#> GSM25552     2  0.6196    0.60619 0.072 0.512 0.000 0.028 0.356 0.032
#> GSM25553     2  0.6196    0.60619 0.072 0.512 0.000 0.028 0.356 0.032
#> GSM25578     1  0.3053    0.65229 0.852 0.008 0.000 0.036 0.100 0.004
#> GSM25579     1  0.3053    0.65229 0.852 0.008 0.000 0.036 0.100 0.004
#> GSM25580     1  0.3005    0.65211 0.856 0.008 0.000 0.036 0.096 0.004
#> GSM25581     1  0.3005    0.65211 0.856 0.008 0.000 0.036 0.096 0.004
#> GSM48655     6  0.6109    0.68389 0.036 0.200 0.000 0.000 0.208 0.556
#> GSM48656     6  0.4276    0.86563 0.104 0.000 0.000 0.000 0.168 0.728
#> GSM48657     6  0.6109    0.68389 0.036 0.200 0.000 0.000 0.208 0.556
#> GSM48658     6  0.4276    0.86563 0.104 0.000 0.000 0.000 0.168 0.728
#> GSM25624     6  0.5215    0.75588 0.192 0.008 0.000 0.000 0.160 0.640
#> GSM25625     3  0.1823    0.85311 0.016 0.012 0.932 0.004 0.000 0.036
#> GSM25626     3  0.0777    0.85581 0.000 0.004 0.972 0.000 0.000 0.024
#> GSM25627     1  0.4371    0.58875 0.732 0.004 0.000 0.000 0.116 0.148
#> GSM25628     3  0.0777    0.85581 0.000 0.004 0.972 0.000 0.000 0.024
#> GSM25629     1  0.2678    0.65309 0.860 0.004 0.000 0.000 0.116 0.020
#> GSM25630     3  0.0777    0.85581 0.000 0.004 0.972 0.000 0.000 0.024
#> GSM25631     1  0.2723    0.65245 0.856 0.004 0.000 0.000 0.120 0.020
#> GSM25632     3  0.0777    0.85581 0.000 0.004 0.972 0.000 0.000 0.024
#> GSM25633     1  0.2678    0.65309 0.860 0.004 0.000 0.000 0.116 0.020
#> GSM25634     1  0.2678    0.65309 0.860 0.004 0.000 0.000 0.116 0.020
#> GSM25635     1  0.2678    0.65309 0.860 0.004 0.000 0.000 0.116 0.020
#> GSM25656     3  0.6199    0.26241 0.340 0.012 0.520 0.056 0.000 0.072
#> GSM25657     1  0.3348    0.64597 0.832 0.012 0.000 0.060 0.096 0.000
#> GSM25658     1  0.6539    0.18391 0.472 0.036 0.000 0.092 0.368 0.032
#> GSM25659     1  0.6149    0.40076 0.560 0.060 0.000 0.060 0.300 0.020
#> GSM25660     1  0.3259    0.64716 0.836 0.012 0.000 0.048 0.104 0.000
#> GSM25661     1  0.4742    0.55817 0.696 0.012 0.000 0.196 0.096 0.000
#> GSM25662     5  0.3719    0.59886 0.160 0.004 0.000 0.016 0.792 0.028
#> GSM25663     5  0.3719    0.59886 0.160 0.004 0.000 0.016 0.792 0.028
#> GSM25680     5  0.0806    0.75423 0.020 0.008 0.000 0.000 0.972 0.000
#> GSM25681     5  0.0806    0.75423 0.020 0.008 0.000 0.000 0.972 0.000
#> GSM25682     5  0.0000    0.74791 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25683     5  0.0000    0.74791 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25684     5  0.5988   -0.15971 0.004 0.208 0.000 0.000 0.456 0.332
#> GSM25685     5  0.5988   -0.15971 0.004 0.208 0.000 0.000 0.456 0.332
#> GSM25686     5  0.0000    0.74791 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25687     5  0.0000    0.74791 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM48664     4  0.1219    0.75001 0.048 0.004 0.000 0.948 0.000 0.000
#> GSM48665     4  0.1219    0.75001 0.048 0.004 0.000 0.948 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-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 genotype/variation(p) k
#> ATC:hclust 96              6.13e-02 2
#> ATC:hclust 79              2.43e-03 3
#> ATC:hclust 58              5.60e-07 4
#> ATC:hclust 44              3.87e-06 5
#> ATC:hclust 69              5.43e-13 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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 0.684           0.912       0.944         0.4813 0.508   0.508
#> 3 3 0.438           0.654       0.787         0.2997 0.712   0.501
#> 4 4 0.598           0.718       0.809         0.1528 0.838   0.597
#> 5 5 0.646           0.616       0.753         0.0831 0.916   0.715
#> 6 6 0.709           0.595       0.746         0.0465 0.921   0.678

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
#> GSM25548     2  0.0938      0.945 0.012 0.988
#> GSM25549     2  0.1414      0.944 0.020 0.980
#> GSM25550     2  0.1414      0.944 0.020 0.980
#> GSM25551     2  0.0938      0.945 0.012 0.988
#> GSM25570     2  0.1414      0.944 0.020 0.980
#> GSM25571     2  0.0938      0.945 0.012 0.988
#> GSM25358     1  0.2423      0.946 0.960 0.040
#> GSM25359     1  0.1414      0.945 0.980 0.020
#> GSM25360     1  0.1184      0.944 0.984 0.016
#> GSM25361     1  0.1843      0.946 0.972 0.028
#> GSM25377     2  0.1843      0.942 0.028 0.972
#> GSM25378     2  0.1843      0.942 0.028 0.972
#> GSM25401     2  0.1843      0.942 0.028 0.972
#> GSM25402     2  0.1843      0.942 0.028 0.972
#> GSM25349     2  0.0672      0.942 0.008 0.992
#> GSM25350     2  0.0672      0.942 0.008 0.992
#> GSM25356     2  0.1843      0.942 0.028 0.972
#> GSM25357     2  0.0938      0.945 0.012 0.988
#> GSM25385     1  0.1184      0.944 0.984 0.016
#> GSM25386     1  0.1184      0.944 0.984 0.016
#> GSM25399     1  0.7602      0.756 0.780 0.220
#> GSM25400     1  0.7528      0.763 0.784 0.216
#> GSM48659     2  0.0000      0.942 0.000 1.000
#> GSM48660     2  0.0000      0.942 0.000 1.000
#> GSM25409     2  0.1843      0.942 0.028 0.972
#> GSM25410     1  0.1184      0.944 0.984 0.016
#> GSM25426     2  0.0938      0.945 0.012 0.988
#> GSM25427     2  0.1843      0.942 0.028 0.972
#> GSM25540     1  0.0376      0.943 0.996 0.004
#> GSM25541     1  0.1633      0.945 0.976 0.024
#> GSM25542     1  0.2423      0.946 0.960 0.040
#> GSM25543     1  0.2423      0.946 0.960 0.040
#> GSM25479     2  0.6438      0.831 0.164 0.836
#> GSM25480     2  0.6438      0.831 0.164 0.836
#> GSM25481     2  0.1843      0.942 0.028 0.972
#> GSM25482     2  0.1843      0.942 0.028 0.972
#> GSM48654     2  0.0672      0.940 0.008 0.992
#> GSM48650     2  0.0000      0.942 0.000 1.000
#> GSM48651     2  0.0000      0.942 0.000 1.000
#> GSM48652     2  0.0000      0.942 0.000 1.000
#> GSM48653     2  0.0000      0.942 0.000 1.000
#> GSM48662     2  0.0000      0.942 0.000 1.000
#> GSM48663     2  0.0000      0.942 0.000 1.000
#> GSM25524     1  0.1843      0.944 0.972 0.028
#> GSM25525     2  0.6438      0.831 0.164 0.836
#> GSM25526     1  0.0672      0.943 0.992 0.008
#> GSM25527     1  0.4298      0.924 0.912 0.088
#> GSM25528     1  0.0000      0.941 1.000 0.000
#> GSM25529     1  0.4298      0.924 0.912 0.088
#> GSM25530     1  0.0000      0.941 1.000 0.000
#> GSM25531     1  0.0000      0.941 1.000 0.000
#> GSM48661     1  0.2948      0.943 0.948 0.052
#> GSM25561     1  0.1184      0.944 0.984 0.016
#> GSM25562     2  0.9000      0.599 0.316 0.684
#> GSM25563     1  0.1184      0.944 0.984 0.016
#> GSM25564     2  0.1633      0.942 0.024 0.976
#> GSM25565     2  0.0938      0.945 0.012 0.988
#> GSM25566     2  0.1414      0.944 0.020 0.980
#> GSM25568     2  0.0000      0.942 0.000 1.000
#> GSM25569     2  0.0000      0.942 0.000 1.000
#> GSM25552     2  0.1843      0.942 0.028 0.972
#> GSM25553     2  0.1843      0.942 0.028 0.972
#> GSM25578     1  0.4431      0.921 0.908 0.092
#> GSM25579     2  0.9129      0.575 0.328 0.672
#> GSM25580     1  0.4298      0.924 0.912 0.088
#> GSM25581     1  0.4298      0.924 0.912 0.088
#> GSM48655     2  0.0000      0.942 0.000 1.000
#> GSM48656     2  0.6623      0.795 0.172 0.828
#> GSM48657     2  0.0000      0.942 0.000 1.000
#> GSM48658     1  0.5178      0.922 0.884 0.116
#> GSM25624     2  0.6887      0.796 0.184 0.816
#> GSM25625     1  0.1184      0.944 0.984 0.016
#> GSM25626     1  0.1184      0.944 0.984 0.016
#> GSM25627     1  0.5178      0.922 0.884 0.116
#> GSM25628     1  0.1184      0.944 0.984 0.016
#> GSM25629     1  0.2423      0.946 0.960 0.040
#> GSM25630     1  0.1184      0.944 0.984 0.016
#> GSM25631     1  0.4562      0.923 0.904 0.096
#> GSM25632     1  0.1184      0.944 0.984 0.016
#> GSM25633     1  0.4298      0.924 0.912 0.088
#> GSM25634     1  0.4298      0.924 0.912 0.088
#> GSM25635     1  0.4298      0.924 0.912 0.088
#> GSM25656     1  0.1184      0.944 0.984 0.016
#> GSM25657     1  0.4298      0.924 0.912 0.088
#> GSM25658     2  0.9087      0.583 0.324 0.676
#> GSM25659     2  0.5178      0.878 0.116 0.884
#> GSM25660     1  0.4431      0.921 0.908 0.092
#> GSM25661     2  0.9087      0.583 0.324 0.676
#> GSM25662     2  0.0938      0.945 0.012 0.988
#> GSM25663     1  0.6801      0.828 0.820 0.180
#> GSM25680     2  0.0938      0.945 0.012 0.988
#> GSM25681     2  0.0938      0.945 0.012 0.988
#> GSM25682     2  0.0938      0.945 0.012 0.988
#> GSM25683     2  0.0938      0.945 0.012 0.988
#> GSM25684     2  0.0938      0.945 0.012 0.988
#> GSM25685     2  0.0938      0.945 0.012 0.988
#> GSM25686     2  0.0938      0.945 0.012 0.988
#> GSM25687     2  0.0938      0.945 0.012 0.988
#> GSM48664     2  0.8327      0.693 0.264 0.736
#> GSM48665     2  0.5294      0.874 0.120 0.880

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25549     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25550     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25551     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25570     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25571     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25358     1  0.5785     0.5575 0.668 0.000 0.332
#> GSM25359     1  0.6302     0.1952 0.520 0.000 0.480
#> GSM25360     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25361     1  0.6244     0.3101 0.560 0.000 0.440
#> GSM25377     1  0.5397     0.4293 0.720 0.280 0.000
#> GSM25378     2  0.6308     0.6422 0.492 0.508 0.000
#> GSM25401     1  0.5968     0.1709 0.636 0.364 0.000
#> GSM25402     1  0.3267     0.5182 0.884 0.116 0.000
#> GSM25349     2  0.0892     0.7121 0.020 0.980 0.000
#> GSM25350     2  0.0892     0.7121 0.020 0.980 0.000
#> GSM25356     2  0.6045     0.7925 0.380 0.620 0.000
#> GSM25357     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25385     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25386     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25399     1  0.3755     0.6799 0.872 0.120 0.008
#> GSM25400     1  0.1647     0.6942 0.960 0.004 0.036
#> GSM48659     2  0.3412     0.7219 0.124 0.876 0.000
#> GSM48660     2  0.0892     0.7121 0.020 0.980 0.000
#> GSM25409     2  0.5291     0.7683 0.268 0.732 0.000
#> GSM25410     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25426     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25427     2  0.6299     0.6826 0.476 0.524 0.000
#> GSM25540     3  0.5216     0.5552 0.260 0.000 0.740
#> GSM25541     1  0.6008     0.4550 0.628 0.000 0.372
#> GSM25542     3  0.8230     0.3830 0.280 0.112 0.608
#> GSM25543     3  0.9001     0.2138 0.332 0.148 0.520
#> GSM25479     1  0.1636     0.6973 0.964 0.020 0.016
#> GSM25480     1  0.1636     0.6973 0.964 0.020 0.016
#> GSM25481     2  0.6079     0.7907 0.388 0.612 0.000
#> GSM25482     2  0.6079     0.7907 0.388 0.612 0.000
#> GSM48654     2  0.5595     0.5783 0.228 0.756 0.016
#> GSM48650     2  0.0892     0.7121 0.020 0.980 0.000
#> GSM48651     2  0.0892     0.7121 0.020 0.980 0.000
#> GSM48652     2  0.0892     0.7121 0.020 0.980 0.000
#> GSM48653     2  0.0892     0.7121 0.020 0.980 0.000
#> GSM48662     2  0.0892     0.7121 0.020 0.980 0.000
#> GSM48663     2  0.0892     0.7121 0.020 0.980 0.000
#> GSM25524     1  0.5397     0.6202 0.720 0.000 0.280
#> GSM25525     1  0.1905     0.6795 0.956 0.028 0.016
#> GSM25526     3  0.5859     0.3761 0.344 0.000 0.656
#> GSM25527     1  0.5363     0.6220 0.724 0.000 0.276
#> GSM25528     3  0.5859     0.3761 0.344 0.000 0.656
#> GSM25529     1  0.5397     0.6202 0.720 0.000 0.280
#> GSM25530     3  0.2448     0.7801 0.076 0.000 0.924
#> GSM25531     1  0.6291     0.2212 0.532 0.000 0.468
#> GSM48661     3  0.9904     0.0971 0.316 0.284 0.400
#> GSM25561     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25562     1  0.3482     0.6764 0.872 0.128 0.000
#> GSM25563     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25564     2  0.5291     0.7683 0.268 0.732 0.000
#> GSM25565     2  0.5291     0.7683 0.268 0.732 0.000
#> GSM25566     2  0.5291     0.7683 0.268 0.732 0.000
#> GSM25568     2  0.1964     0.7179 0.056 0.944 0.000
#> GSM25569     2  0.0592     0.7128 0.012 0.988 0.000
#> GSM25552     2  0.5291     0.7683 0.268 0.732 0.000
#> GSM25553     2  0.5291     0.7683 0.268 0.732 0.000
#> GSM25578     1  0.3038     0.7085 0.896 0.000 0.104
#> GSM25579     1  0.3028     0.7090 0.920 0.032 0.048
#> GSM25580     1  0.3340     0.7059 0.880 0.000 0.120
#> GSM25581     1  0.5397     0.6202 0.720 0.000 0.280
#> GSM48655     2  0.3482     0.7198 0.128 0.872 0.000
#> GSM48656     2  0.6095    -0.0487 0.392 0.608 0.000
#> GSM48657     2  0.1031     0.7091 0.024 0.976 0.000
#> GSM48658     1  0.8171     0.5223 0.644 0.172 0.184
#> GSM25624     1  0.4802     0.6412 0.824 0.156 0.020
#> GSM25625     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25626     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25627     1  0.8125     0.5280 0.648 0.172 0.180
#> GSM25628     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25629     1  0.5988     0.4577 0.632 0.000 0.368
#> GSM25630     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25631     1  0.4605     0.6726 0.796 0.000 0.204
#> GSM25632     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25633     1  0.5363     0.6220 0.724 0.000 0.276
#> GSM25634     1  0.5363     0.6220 0.724 0.000 0.276
#> GSM25635     1  0.5363     0.6220 0.724 0.000 0.276
#> GSM25656     3  0.0000     0.8338 0.000 0.000 1.000
#> GSM25657     1  0.6294     0.5999 0.692 0.020 0.288
#> GSM25658     1  0.1337     0.6947 0.972 0.012 0.016
#> GSM25659     1  0.1711     0.6958 0.960 0.032 0.008
#> GSM25660     1  0.3116     0.7078 0.892 0.000 0.108
#> GSM25661     1  0.3454     0.6892 0.888 0.104 0.008
#> GSM25662     1  0.6309    -0.6249 0.504 0.496 0.000
#> GSM25663     1  0.3116     0.7078 0.892 0.000 0.108
#> GSM25680     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25681     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25682     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25683     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25684     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25685     2  0.6008     0.7941 0.372 0.628 0.000
#> GSM25686     2  0.5988     0.7943 0.368 0.632 0.000
#> GSM25687     2  0.5988     0.7943 0.368 0.632 0.000
#> GSM48664     1  0.3482     0.6764 0.872 0.128 0.000
#> GSM48665     1  0.3482     0.6764 0.872 0.128 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25549     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25550     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25551     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25570     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25571     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25358     1  0.7347    0.61705 0.616 0.232 0.048 0.104
#> GSM25359     1  0.7943    0.60959 0.604 0.156 0.136 0.104
#> GSM25360     3  0.0000    0.96980 0.000 0.000 1.000 0.000
#> GSM25361     1  0.4484    0.76618 0.812 0.004 0.064 0.120
#> GSM25377     1  0.6595    0.51115 0.608 0.124 0.000 0.268
#> GSM25378     2  0.5277    0.65196 0.132 0.752 0.000 0.116
#> GSM25401     1  0.7834   -0.13749 0.372 0.368 0.000 0.260
#> GSM25402     2  0.6823    0.46099 0.244 0.596 0.000 0.160
#> GSM25349     4  0.4868    0.71196 0.012 0.304 0.000 0.684
#> GSM25350     4  0.4868    0.71196 0.012 0.304 0.000 0.684
#> GSM25356     2  0.2589    0.77640 0.000 0.884 0.000 0.116
#> GSM25357     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25385     3  0.0921    0.96133 0.000 0.000 0.972 0.028
#> GSM25386     3  0.0000    0.96980 0.000 0.000 1.000 0.000
#> GSM25399     1  0.4059    0.71798 0.788 0.012 0.000 0.200
#> GSM25400     1  0.3958    0.77542 0.836 0.052 0.000 0.112
#> GSM48659     4  0.5236    0.62590 0.008 0.432 0.000 0.560
#> GSM48660     4  0.4973    0.73194 0.008 0.348 0.000 0.644
#> GSM25409     2  0.5969    0.43882 0.044 0.564 0.000 0.392
#> GSM25410     3  0.0000    0.96980 0.000 0.000 1.000 0.000
#> GSM25426     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25427     2  0.5452    0.64822 0.108 0.736 0.000 0.156
#> GSM25540     1  0.6616    0.49265 0.584 0.000 0.308 0.108
#> GSM25541     1  0.4254    0.77175 0.824 0.004 0.052 0.120
#> GSM25542     4  0.8735   -0.00735 0.296 0.044 0.252 0.408
#> GSM25543     4  0.8181   -0.05675 0.344 0.044 0.140 0.472
#> GSM25479     1  0.3009    0.79156 0.892 0.056 0.000 0.052
#> GSM25480     1  0.3009    0.79156 0.892 0.056 0.000 0.052
#> GSM25481     2  0.2611    0.78771 0.008 0.896 0.000 0.096
#> GSM25482     2  0.2342    0.79682 0.008 0.912 0.000 0.080
#> GSM48654     4  0.5811    0.62470 0.116 0.180 0.000 0.704
#> GSM48650     4  0.4955    0.73184 0.008 0.344 0.000 0.648
#> GSM48651     4  0.4973    0.73194 0.008 0.348 0.000 0.644
#> GSM48652     4  0.4837    0.73209 0.004 0.348 0.000 0.648
#> GSM48653     4  0.4973    0.73194 0.008 0.348 0.000 0.644
#> GSM48662     4  0.4955    0.73184 0.008 0.344 0.000 0.648
#> GSM48663     4  0.4955    0.73184 0.008 0.344 0.000 0.648
#> GSM25524     1  0.2686    0.80248 0.916 0.040 0.012 0.032
#> GSM25525     1  0.4467    0.72386 0.788 0.172 0.000 0.040
#> GSM25526     1  0.6684    0.43998 0.560 0.000 0.336 0.104
#> GSM25527     1  0.2689    0.79973 0.916 0.036 0.012 0.036
#> GSM25528     1  0.5897    0.41378 0.588 0.000 0.368 0.044
#> GSM25529     1  0.2484    0.80103 0.924 0.040 0.012 0.024
#> GSM25530     3  0.4365    0.71792 0.188 0.000 0.784 0.028
#> GSM25531     1  0.3745    0.77442 0.852 0.000 0.088 0.060
#> GSM48661     4  0.5578    0.30283 0.312 0.040 0.000 0.648
#> GSM25561     3  0.1022    0.95937 0.000 0.000 0.968 0.032
#> GSM25562     1  0.4059    0.71798 0.788 0.012 0.000 0.200
#> GSM25563     3  0.0921    0.96139 0.000 0.000 0.972 0.028
#> GSM25564     2  0.6488    0.43410 0.104 0.604 0.000 0.292
#> GSM25565     2  0.5013    0.45279 0.020 0.688 0.000 0.292
#> GSM25566     2  0.5038    0.44882 0.020 0.684 0.000 0.296
#> GSM25568     4  0.4453    0.69863 0.012 0.244 0.000 0.744
#> GSM25569     4  0.5018    0.73335 0.012 0.332 0.000 0.656
#> GSM25552     2  0.5663    0.62272 0.060 0.676 0.000 0.264
#> GSM25553     2  0.5989    0.60000 0.080 0.656 0.000 0.264
#> GSM25578     1  0.1909    0.80026 0.940 0.048 0.004 0.008
#> GSM25579     1  0.1854    0.79973 0.940 0.048 0.000 0.012
#> GSM25580     1  0.1677    0.80130 0.948 0.040 0.012 0.000
#> GSM25581     1  0.2484    0.80103 0.924 0.040 0.012 0.024
#> GSM48655     4  0.5582    0.64603 0.024 0.400 0.000 0.576
#> GSM48656     4  0.5219    0.47185 0.244 0.044 0.000 0.712
#> GSM48657     4  0.5137    0.72677 0.024 0.296 0.000 0.680
#> GSM48658     1  0.4948    0.34527 0.560 0.000 0.000 0.440
#> GSM25624     1  0.4327    0.70305 0.768 0.016 0.000 0.216
#> GSM25625     3  0.0000    0.96980 0.000 0.000 1.000 0.000
#> GSM25626     3  0.0000    0.96980 0.000 0.000 1.000 0.000
#> GSM25627     1  0.4564    0.56921 0.672 0.000 0.000 0.328
#> GSM25628     3  0.0000    0.96980 0.000 0.000 1.000 0.000
#> GSM25629     1  0.4335    0.74655 0.796 0.000 0.036 0.168
#> GSM25630     3  0.0000    0.96980 0.000 0.000 1.000 0.000
#> GSM25631     1  0.3708    0.76162 0.832 0.020 0.000 0.148
#> GSM25632     3  0.0000    0.96980 0.000 0.000 1.000 0.000
#> GSM25633     1  0.3367    0.78345 0.876 0.020 0.012 0.092
#> GSM25634     1  0.3734    0.77552 0.852 0.020 0.012 0.116
#> GSM25635     1  0.4008    0.76690 0.832 0.020 0.012 0.136
#> GSM25656     3  0.1022    0.95937 0.000 0.000 0.968 0.032
#> GSM25657     1  0.1953    0.80045 0.944 0.012 0.012 0.032
#> GSM25658     1  0.3521    0.78282 0.864 0.052 0.000 0.084
#> GSM25659     1  0.4780    0.74152 0.788 0.116 0.000 0.096
#> GSM25660     1  0.1909    0.80026 0.940 0.048 0.004 0.008
#> GSM25661     1  0.3625    0.74529 0.828 0.012 0.000 0.160
#> GSM25662     2  0.2589    0.76631 0.044 0.912 0.000 0.044
#> GSM25663     1  0.5354    0.73813 0.752 0.152 0.004 0.092
#> GSM25680     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25681     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25682     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25683     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25684     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25685     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25686     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM25687     2  0.0000    0.83619 0.000 1.000 0.000 0.000
#> GSM48664     1  0.4059    0.71798 0.788 0.012 0.000 0.200
#> GSM48665     1  0.4253    0.70855 0.776 0.016 0.000 0.208

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     4  0.0324     0.9230 0.000 0.004 0.000 0.992 0.004
#> GSM25549     4  0.0324     0.9230 0.000 0.004 0.000 0.992 0.004
#> GSM25550     4  0.0324     0.9230 0.000 0.004 0.000 0.992 0.004
#> GSM25551     4  0.0162     0.9235 0.000 0.004 0.000 0.996 0.000
#> GSM25570     4  0.0324     0.9230 0.000 0.004 0.000 0.992 0.004
#> GSM25571     4  0.0324     0.9230 0.000 0.004 0.000 0.992 0.004
#> GSM25358     1  0.5864     0.6015 0.708 0.040 0.016 0.116 0.120
#> GSM25359     1  0.6093     0.6176 0.708 0.040 0.056 0.068 0.128
#> GSM25360     3  0.0324     0.9319 0.004 0.000 0.992 0.000 0.004
#> GSM25361     1  0.4792     0.6391 0.724 0.048 0.008 0.004 0.216
#> GSM25377     5  0.6776     0.3632 0.320 0.156 0.000 0.024 0.500
#> GSM25378     4  0.4891     0.6009 0.068 0.004 0.000 0.704 0.224
#> GSM25401     5  0.7170     0.4046 0.276 0.160 0.000 0.056 0.508
#> GSM25402     5  0.7018     0.2374 0.284 0.008 0.000 0.328 0.380
#> GSM25349     2  0.3946     0.6208 0.000 0.800 0.000 0.120 0.080
#> GSM25350     2  0.3946     0.6208 0.000 0.800 0.000 0.120 0.080
#> GSM25356     4  0.2848     0.7956 0.000 0.004 0.000 0.840 0.156
#> GSM25357     4  0.0404     0.9230 0.000 0.012 0.000 0.988 0.000
#> GSM25385     3  0.2204     0.9078 0.008 0.036 0.920 0.000 0.036
#> GSM25386     3  0.0162     0.9322 0.004 0.000 0.996 0.000 0.000
#> GSM25399     5  0.4829     0.0470 0.480 0.020 0.000 0.000 0.500
#> GSM25400     1  0.4189     0.5381 0.736 0.012 0.000 0.012 0.240
#> GSM48659     2  0.5751     0.4928 0.000 0.540 0.000 0.364 0.096
#> GSM48660     2  0.2471     0.7160 0.000 0.864 0.000 0.136 0.000
#> GSM25409     5  0.6686     0.2541 0.004 0.376 0.000 0.200 0.420
#> GSM25410     3  0.0162     0.9322 0.004 0.000 0.996 0.000 0.000
#> GSM25426     4  0.0404     0.9230 0.000 0.012 0.000 0.988 0.000
#> GSM25427     4  0.5125     0.5450 0.060 0.008 0.000 0.672 0.260
#> GSM25540     1  0.6180     0.5666 0.644 0.040 0.168 0.000 0.148
#> GSM25541     1  0.3804     0.6716 0.796 0.044 0.000 0.000 0.160
#> GSM25542     5  0.8520    -0.0428 0.196 0.240 0.196 0.004 0.364
#> GSM25543     5  0.7324    -0.0185 0.212 0.324 0.028 0.004 0.432
#> GSM25479     1  0.2672     0.6334 0.872 0.004 0.000 0.008 0.116
#> GSM25480     1  0.2672     0.6334 0.872 0.004 0.000 0.008 0.116
#> GSM25481     4  0.3631     0.7743 0.012 0.024 0.000 0.820 0.144
#> GSM25482     4  0.3629     0.7842 0.012 0.028 0.000 0.824 0.136
#> GSM48654     2  0.5816     0.3742 0.040 0.512 0.000 0.028 0.420
#> GSM48650     2  0.2471     0.7160 0.000 0.864 0.000 0.136 0.000
#> GSM48651     2  0.2471     0.7160 0.000 0.864 0.000 0.136 0.000
#> GSM48652     2  0.2864     0.7146 0.000 0.852 0.000 0.136 0.012
#> GSM48653     2  0.2471     0.7160 0.000 0.864 0.000 0.136 0.000
#> GSM48662     2  0.2471     0.7160 0.000 0.864 0.000 0.136 0.000
#> GSM48663     2  0.2471     0.7160 0.000 0.864 0.000 0.136 0.000
#> GSM25524     1  0.2676     0.6901 0.884 0.036 0.000 0.000 0.080
#> GSM25525     1  0.3359     0.6289 0.848 0.004 0.000 0.052 0.096
#> GSM25526     1  0.5916     0.5769 0.664 0.032 0.172 0.000 0.132
#> GSM25527     1  0.0404     0.7000 0.988 0.000 0.000 0.000 0.012
#> GSM25528     1  0.5559     0.5722 0.688 0.036 0.200 0.000 0.076
#> GSM25529     1  0.0324     0.6995 0.992 0.004 0.000 0.000 0.004
#> GSM25530     3  0.5796     0.4572 0.284 0.036 0.624 0.000 0.056
#> GSM25531     1  0.3643     0.6807 0.848 0.036 0.044 0.000 0.072
#> GSM48661     5  0.6626    -0.2707 0.144 0.396 0.004 0.008 0.448
#> GSM25561     3  0.2791     0.8891 0.016 0.036 0.892 0.000 0.056
#> GSM25562     1  0.4907    -0.1302 0.488 0.024 0.000 0.000 0.488
#> GSM25563     3  0.2036     0.9113 0.008 0.028 0.928 0.000 0.036
#> GSM25564     5  0.7554     0.2343 0.052 0.360 0.000 0.208 0.380
#> GSM25565     2  0.6815    -0.1975 0.004 0.424 0.000 0.248 0.324
#> GSM25566     5  0.6844     0.2201 0.004 0.364 0.000 0.244 0.388
#> GSM25568     2  0.5006     0.4889 0.000 0.624 0.000 0.048 0.328
#> GSM25569     2  0.4255     0.6881 0.000 0.776 0.000 0.128 0.096
#> GSM25552     5  0.7346     0.3156 0.036 0.324 0.000 0.220 0.420
#> GSM25553     5  0.7389     0.3186 0.040 0.324 0.000 0.216 0.420
#> GSM25578     1  0.0880     0.6908 0.968 0.000 0.000 0.000 0.032
#> GSM25579     1  0.1341     0.6803 0.944 0.000 0.000 0.000 0.056
#> GSM25580     1  0.0794     0.6920 0.972 0.000 0.000 0.000 0.028
#> GSM25581     1  0.0290     0.6994 0.992 0.000 0.000 0.000 0.008
#> GSM48655     2  0.6128     0.5395 0.000 0.564 0.000 0.204 0.232
#> GSM48656     2  0.5880     0.3371 0.064 0.504 0.004 0.008 0.420
#> GSM48657     2  0.5032     0.6136 0.000 0.688 0.000 0.092 0.220
#> GSM48658     1  0.6242     0.3021 0.444 0.124 0.004 0.000 0.428
#> GSM25624     1  0.6103     0.3402 0.456 0.092 0.004 0.004 0.444
#> GSM25625     3  0.0000     0.9320 0.000 0.000 1.000 0.000 0.000
#> GSM25626     3  0.0000     0.9320 0.000 0.000 1.000 0.000 0.000
#> GSM25627     1  0.6030     0.3364 0.472 0.100 0.004 0.000 0.424
#> GSM25628     3  0.0000     0.9320 0.000 0.000 1.000 0.000 0.000
#> GSM25629     1  0.5024     0.5511 0.628 0.040 0.004 0.000 0.328
#> GSM25630     3  0.0000     0.9320 0.000 0.000 1.000 0.000 0.000
#> GSM25631     1  0.4550     0.5899 0.692 0.028 0.004 0.000 0.276
#> GSM25632     3  0.0000     0.9320 0.000 0.000 1.000 0.000 0.000
#> GSM25633     1  0.3006     0.6728 0.836 0.004 0.004 0.000 0.156
#> GSM25634     1  0.3611     0.6430 0.780 0.008 0.004 0.000 0.208
#> GSM25635     1  0.4311     0.5998 0.712 0.020 0.004 0.000 0.264
#> GSM25656     3  0.2494     0.8976 0.008 0.032 0.904 0.000 0.056
#> GSM25657     1  0.0404     0.6973 0.988 0.000 0.000 0.000 0.012
#> GSM25658     1  0.3250     0.5906 0.820 0.004 0.000 0.008 0.168
#> GSM25659     1  0.4067     0.4782 0.748 0.004 0.000 0.020 0.228
#> GSM25660     1  0.0880     0.6908 0.968 0.000 0.000 0.000 0.032
#> GSM25661     1  0.4341     0.1530 0.592 0.004 0.000 0.000 0.404
#> GSM25662     4  0.2082     0.8686 0.016 0.032 0.000 0.928 0.024
#> GSM25663     1  0.3629     0.6842 0.824 0.028 0.000 0.012 0.136
#> GSM25680     4  0.0162     0.9228 0.000 0.000 0.000 0.996 0.004
#> GSM25681     4  0.0162     0.9228 0.000 0.000 0.000 0.996 0.004
#> GSM25682     4  0.0510     0.9226 0.000 0.016 0.000 0.984 0.000
#> GSM25683     4  0.0404     0.9230 0.000 0.012 0.000 0.988 0.000
#> GSM25684     4  0.0510     0.9226 0.000 0.016 0.000 0.984 0.000
#> GSM25685     4  0.0404     0.9230 0.000 0.012 0.000 0.988 0.000
#> GSM25686     4  0.0510     0.9226 0.000 0.016 0.000 0.984 0.000
#> GSM25687     4  0.0510     0.9226 0.000 0.016 0.000 0.984 0.000
#> GSM48664     5  0.4980     0.0473 0.484 0.028 0.000 0.000 0.488
#> GSM48665     1  0.5049    -0.1498 0.484 0.032 0.000 0.000 0.484

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM25548     5  0.1720     0.8260 0.000 0.032 0.000 0.040 0.928 0.000
#> GSM25549     5  0.2201     0.8152 0.000 0.052 0.000 0.048 0.900 0.000
#> GSM25550     5  0.2134     0.8171 0.000 0.052 0.000 0.044 0.904 0.000
#> GSM25551     5  0.0000     0.8326 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25570     5  0.1720     0.8260 0.000 0.032 0.000 0.040 0.928 0.000
#> GSM25571     5  0.1720     0.8260 0.000 0.032 0.000 0.040 0.928 0.000
#> GSM25358     1  0.6563     0.5616 0.604 0.204 0.016 0.092 0.056 0.028
#> GSM25359     1  0.6825     0.5481 0.588 0.204 0.028 0.100 0.048 0.032
#> GSM25360     3  0.0000     0.8431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25361     1  0.6303     0.5444 0.592 0.196 0.008 0.124 0.000 0.080
#> GSM25377     4  0.3496     0.7049 0.140 0.052 0.000 0.804 0.004 0.000
#> GSM25378     5  0.6503     0.2878 0.036 0.128 0.000 0.332 0.488 0.016
#> GSM25401     4  0.3676     0.6973 0.120 0.052 0.000 0.808 0.020 0.000
#> GSM25402     4  0.6934     0.4812 0.148 0.116 0.000 0.528 0.196 0.012
#> GSM25349     2  0.5425     0.7099 0.000 0.636 0.000 0.076 0.048 0.240
#> GSM25350     2  0.5425     0.7099 0.000 0.636 0.000 0.076 0.048 0.240
#> GSM25356     5  0.4637     0.5257 0.000 0.064 0.000 0.308 0.628 0.000
#> GSM25357     5  0.0405     0.8317 0.000 0.004 0.000 0.008 0.988 0.000
#> GSM25385     3  0.4719     0.7296 0.012 0.164 0.732 0.072 0.000 0.020
#> GSM25386     3  0.0000     0.8431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25399     4  0.3052     0.6873 0.216 0.004 0.000 0.780 0.000 0.000
#> GSM25400     1  0.6619     0.1269 0.456 0.176 0.000 0.328 0.020 0.020
#> GSM48659     5  0.6317    -0.2566 0.000 0.156 0.000 0.032 0.412 0.400
#> GSM48660     2  0.4956     0.7883 0.000 0.592 0.000 0.004 0.072 0.332
#> GSM25409     4  0.5108     0.2277 0.000 0.436 0.000 0.484 0.080 0.000
#> GSM25410     3  0.0000     0.8431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25426     5  0.0508     0.8309 0.000 0.004 0.000 0.012 0.984 0.000
#> GSM25427     5  0.6402     0.1526 0.024 0.128 0.000 0.392 0.440 0.016
#> GSM25540     1  0.6776     0.5407 0.584 0.176 0.048 0.108 0.000 0.084
#> GSM25541     1  0.5662     0.5929 0.652 0.160 0.000 0.108 0.000 0.080
#> GSM25542     6  0.8394     0.2866 0.144 0.248 0.152 0.096 0.000 0.360
#> GSM25543     6  0.7829     0.3389 0.148 0.312 0.024 0.168 0.000 0.348
#> GSM25479     1  0.4229     0.5491 0.744 0.064 0.000 0.180 0.000 0.012
#> GSM25480     1  0.4229     0.5491 0.744 0.064 0.000 0.180 0.000 0.012
#> GSM25481     5  0.5760     0.4280 0.008 0.120 0.000 0.300 0.560 0.012
#> GSM25482     5  0.5455     0.4797 0.008 0.116 0.000 0.280 0.592 0.004
#> GSM48654     6  0.1637     0.5187 0.056 0.004 0.000 0.004 0.004 0.932
#> GSM48650     2  0.4956     0.7883 0.000 0.592 0.000 0.004 0.072 0.332
#> GSM48651     2  0.4956     0.7883 0.000 0.592 0.000 0.004 0.072 0.332
#> GSM48652     2  0.4835     0.7834 0.000 0.592 0.000 0.000 0.072 0.336
#> GSM48653     2  0.4956     0.7883 0.000 0.592 0.000 0.004 0.072 0.332
#> GSM48662     2  0.4956     0.7883 0.000 0.592 0.000 0.004 0.072 0.332
#> GSM48663     2  0.4956     0.7883 0.000 0.592 0.000 0.004 0.072 0.332
#> GSM25524     1  0.5310     0.6355 0.660 0.216 0.000 0.088 0.004 0.032
#> GSM25525     1  0.4266     0.6049 0.776 0.072 0.000 0.124 0.012 0.016
#> GSM25526     1  0.5812     0.6018 0.664 0.168 0.048 0.088 0.000 0.032
#> GSM25527     1  0.0458     0.7005 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM25528     1  0.5704     0.5961 0.656 0.196 0.048 0.080 0.000 0.020
#> GSM25529     1  0.1268     0.7057 0.952 0.036 0.000 0.008 0.000 0.004
#> GSM25530     3  0.7439     0.0940 0.312 0.200 0.388 0.080 0.000 0.020
#> GSM25531     1  0.4666     0.6333 0.716 0.184 0.000 0.076 0.000 0.024
#> GSM48661     6  0.2346     0.5618 0.124 0.008 0.000 0.000 0.000 0.868
#> GSM25561     3  0.5206     0.7014 0.028 0.172 0.700 0.080 0.000 0.020
#> GSM25562     4  0.3298     0.6764 0.236 0.008 0.000 0.756 0.000 0.000
#> GSM25563     3  0.4036     0.7560 0.004 0.136 0.780 0.068 0.000 0.012
#> GSM25564     4  0.5669     0.3333 0.016 0.360 0.000 0.516 0.108 0.000
#> GSM25565     2  0.5966    -0.1744 0.000 0.452 0.000 0.404 0.120 0.024
#> GSM25566     2  0.5475    -0.2185 0.000 0.460 0.000 0.416 0.124 0.000
#> GSM25568     6  0.4019     0.1212 0.000 0.216 0.000 0.028 0.016 0.740
#> GSM25569     2  0.5486     0.6750 0.000 0.508 0.000 0.024 0.068 0.400
#> GSM25552     4  0.5524     0.3540 0.012 0.364 0.000 0.524 0.100 0.000
#> GSM25553     4  0.5524     0.3540 0.012 0.364 0.000 0.524 0.100 0.000
#> GSM25578     1  0.1398     0.6972 0.940 0.008 0.000 0.052 0.000 0.000
#> GSM25579     1  0.1524     0.6949 0.932 0.008 0.000 0.060 0.000 0.000
#> GSM25580     1  0.1265     0.6989 0.948 0.008 0.000 0.044 0.000 0.000
#> GSM25581     1  0.0458     0.7015 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM48655     6  0.4132     0.2011 0.000 0.104 0.000 0.004 0.136 0.756
#> GSM48656     6  0.1411     0.5229 0.060 0.004 0.000 0.000 0.000 0.936
#> GSM48657     6  0.4045    -0.0602 0.000 0.268 0.000 0.004 0.028 0.700
#> GSM48658     6  0.3874     0.4004 0.356 0.000 0.000 0.008 0.000 0.636
#> GSM25624     6  0.4867     0.3559 0.340 0.048 0.000 0.012 0.000 0.600
#> GSM25625     3  0.0000     0.8431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25626     3  0.0000     0.8431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25627     6  0.3887     0.3926 0.360 0.000 0.000 0.008 0.000 0.632
#> GSM25628     3  0.0000     0.8431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25629     1  0.4923     0.4523 0.656 0.028 0.000 0.052 0.000 0.264
#> GSM25630     3  0.0000     0.8431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25631     1  0.3809     0.5168 0.732 0.004 0.000 0.024 0.000 0.240
#> GSM25632     3  0.0000     0.8431 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25633     1  0.2070     0.6598 0.892 0.000 0.000 0.008 0.000 0.100
#> GSM25634     1  0.2553     0.6282 0.848 0.000 0.000 0.008 0.000 0.144
#> GSM25635     1  0.3012     0.5780 0.796 0.000 0.000 0.008 0.000 0.196
#> GSM25656     3  0.4771     0.7216 0.004 0.156 0.724 0.092 0.000 0.024
#> GSM25657     1  0.2234     0.6701 0.872 0.004 0.000 0.124 0.000 0.000
#> GSM25658     1  0.5036     0.3918 0.648 0.076 0.000 0.260 0.004 0.012
#> GSM25659     1  0.5087     0.3066 0.616 0.064 0.000 0.304 0.004 0.012
#> GSM25660     1  0.1265     0.6989 0.948 0.008 0.000 0.044 0.000 0.000
#> GSM25661     4  0.3607     0.5001 0.348 0.000 0.000 0.652 0.000 0.000
#> GSM25662     5  0.1635     0.8053 0.016 0.012 0.000 0.012 0.944 0.016
#> GSM25663     1  0.4562     0.6510 0.752 0.124 0.000 0.068 0.000 0.056
#> GSM25680     5  0.1720     0.8260 0.000 0.032 0.000 0.040 0.928 0.000
#> GSM25681     5  0.1720     0.8260 0.000 0.032 0.000 0.040 0.928 0.000
#> GSM25682     5  0.0146     0.8326 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM25683     5  0.0291     0.8319 0.000 0.004 0.000 0.004 0.992 0.000
#> GSM25684     5  0.0260     0.8316 0.000 0.000 0.000 0.008 0.992 0.000
#> GSM25685     5  0.0260     0.8316 0.000 0.000 0.000 0.008 0.992 0.000
#> GSM25686     5  0.0146     0.8326 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM25687     5  0.0146     0.8326 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM48664     4  0.3287     0.6907 0.220 0.012 0.000 0.768 0.000 0.000
#> GSM48665     4  0.3320     0.6959 0.212 0.016 0.000 0.772 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-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 genotype/variation(p) k
#> ATC:kmeans 100              1.21e-04 2
#> ATC:kmeans  86              6.61e-04 3
#> ATC:kmeans  86              9.88e-09 4
#> ATC:kmeans  74              1.24e-10 5
#> ATC:kmeans  75              2.57e-16 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk ATC-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.957           0.939       0.975         0.5041 0.496   0.496
#> 3 3 0.910           0.917       0.961         0.3078 0.762   0.555
#> 4 4 0.803           0.846       0.915         0.1324 0.828   0.546
#> 5 5 0.842           0.810       0.894         0.0685 0.888   0.598
#> 6 6 0.827           0.728       0.864         0.0380 0.940   0.722

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

suggest_best_k(res)
#> [1] 3
#> 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
#> GSM25548     2  0.0000      0.961 0.000 1.000
#> GSM25549     2  0.0000      0.961 0.000 1.000
#> GSM25550     2  0.0000      0.961 0.000 1.000
#> GSM25551     2  0.0000      0.961 0.000 1.000
#> GSM25570     2  0.0000      0.961 0.000 1.000
#> GSM25571     2  0.0000      0.961 0.000 1.000
#> GSM25358     1  0.0000      0.987 1.000 0.000
#> GSM25359     1  0.0000      0.987 1.000 0.000
#> GSM25360     1  0.0000      0.987 1.000 0.000
#> GSM25361     1  0.0000      0.987 1.000 0.000
#> GSM25377     2  0.0000      0.961 0.000 1.000
#> GSM25378     2  0.0000      0.961 0.000 1.000
#> GSM25401     2  0.0000      0.961 0.000 1.000
#> GSM25402     2  0.0000      0.961 0.000 1.000
#> GSM25349     2  0.0000      0.961 0.000 1.000
#> GSM25350     2  0.0000      0.961 0.000 1.000
#> GSM25356     2  0.0000      0.961 0.000 1.000
#> GSM25357     2  0.0000      0.961 0.000 1.000
#> GSM25385     1  0.0000      0.987 1.000 0.000
#> GSM25386     1  0.0000      0.987 1.000 0.000
#> GSM25399     1  0.0000      0.987 1.000 0.000
#> GSM25400     1  0.0000      0.987 1.000 0.000
#> GSM48659     2  0.0000      0.961 0.000 1.000
#> GSM48660     2  0.0000      0.961 0.000 1.000
#> GSM25409     2  0.0000      0.961 0.000 1.000
#> GSM25410     1  0.0000      0.987 1.000 0.000
#> GSM25426     2  0.0000      0.961 0.000 1.000
#> GSM25427     2  0.0000      0.961 0.000 1.000
#> GSM25540     1  0.0000      0.987 1.000 0.000
#> GSM25541     1  0.0000      0.987 1.000 0.000
#> GSM25542     1  0.0938      0.977 0.988 0.012
#> GSM25543     1  0.0938      0.977 0.988 0.012
#> GSM25479     2  0.9661      0.387 0.392 0.608
#> GSM25480     2  0.9393      0.473 0.356 0.644
#> GSM25481     2  0.0000      0.961 0.000 1.000
#> GSM25482     2  0.0000      0.961 0.000 1.000
#> GSM48654     2  0.4298      0.879 0.088 0.912
#> GSM48650     2  0.0000      0.961 0.000 1.000
#> GSM48651     2  0.0000      0.961 0.000 1.000
#> GSM48652     2  0.0000      0.961 0.000 1.000
#> GSM48653     2  0.0000      0.961 0.000 1.000
#> GSM48662     2  0.0000      0.961 0.000 1.000
#> GSM48663     2  0.0000      0.961 0.000 1.000
#> GSM25524     1  0.0000      0.987 1.000 0.000
#> GSM25525     2  0.9248      0.508 0.340 0.660
#> GSM25526     1  0.0000      0.987 1.000 0.000
#> GSM25527     1  0.0000      0.987 1.000 0.000
#> GSM25528     1  0.0000      0.987 1.000 0.000
#> GSM25529     1  0.0000      0.987 1.000 0.000
#> GSM25530     1  0.0000      0.987 1.000 0.000
#> GSM25531     1  0.0000      0.987 1.000 0.000
#> GSM48661     1  0.0000      0.987 1.000 0.000
#> GSM25561     1  0.0000      0.987 1.000 0.000
#> GSM25562     1  0.0000      0.987 1.000 0.000
#> GSM25563     1  0.0000      0.987 1.000 0.000
#> GSM25564     2  0.0000      0.961 0.000 1.000
#> GSM25565     2  0.0000      0.961 0.000 1.000
#> GSM25566     2  0.0000      0.961 0.000 1.000
#> GSM25568     2  0.0000      0.961 0.000 1.000
#> GSM25569     2  0.0000      0.961 0.000 1.000
#> GSM25552     2  0.0000      0.961 0.000 1.000
#> GSM25553     2  0.0000      0.961 0.000 1.000
#> GSM25578     1  0.0000      0.987 1.000 0.000
#> GSM25579     1  0.0000      0.987 1.000 0.000
#> GSM25580     1  0.0000      0.987 1.000 0.000
#> GSM25581     1  0.0000      0.987 1.000 0.000
#> GSM48655     2  0.0000      0.961 0.000 1.000
#> GSM48656     1  0.9129      0.482 0.672 0.328
#> GSM48657     2  0.0000      0.961 0.000 1.000
#> GSM48658     1  0.0000      0.987 1.000 0.000
#> GSM25624     2  0.9954      0.188 0.460 0.540
#> GSM25625     1  0.0000      0.987 1.000 0.000
#> GSM25626     1  0.0000      0.987 1.000 0.000
#> GSM25627     1  0.0000      0.987 1.000 0.000
#> GSM25628     1  0.0000      0.987 1.000 0.000
#> GSM25629     1  0.0000      0.987 1.000 0.000
#> GSM25630     1  0.0000      0.987 1.000 0.000
#> GSM25631     1  0.0000      0.987 1.000 0.000
#> GSM25632     1  0.0000      0.987 1.000 0.000
#> GSM25633     1  0.0000      0.987 1.000 0.000
#> GSM25634     1  0.0000      0.987 1.000 0.000
#> GSM25635     1  0.0000      0.987 1.000 0.000
#> GSM25656     1  0.0000      0.987 1.000 0.000
#> GSM25657     1  0.0000      0.987 1.000 0.000
#> GSM25658     1  0.0672      0.980 0.992 0.008
#> GSM25659     2  0.3274      0.909 0.060 0.940
#> GSM25660     1  0.0000      0.987 1.000 0.000
#> GSM25661     1  0.0672      0.980 0.992 0.008
#> GSM25662     2  0.0000      0.961 0.000 1.000
#> GSM25663     1  0.0000      0.987 1.000 0.000
#> GSM25680     2  0.0000      0.961 0.000 1.000
#> GSM25681     2  0.0000      0.961 0.000 1.000
#> GSM25682     2  0.0000      0.961 0.000 1.000
#> GSM25683     2  0.0000      0.961 0.000 1.000
#> GSM25684     2  0.0000      0.961 0.000 1.000
#> GSM25685     2  0.0000      0.961 0.000 1.000
#> GSM25686     2  0.0000      0.961 0.000 1.000
#> GSM25687     2  0.0000      0.961 0.000 1.000
#> GSM48664     1  0.7056      0.749 0.808 0.192
#> GSM48665     2  0.7745      0.705 0.228 0.772

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25549     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25550     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25551     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25570     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25571     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25358     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25359     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25360     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25361     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25377     1  0.3686     0.8018 0.860 0.140 0.000
#> GSM25378     2  0.4452     0.7512 0.192 0.808 0.000
#> GSM25401     1  0.5016     0.6738 0.760 0.240 0.000
#> GSM25402     1  0.5138     0.6699 0.748 0.252 0.000
#> GSM25349     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM25350     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM25356     2  0.0237     0.9829 0.004 0.996 0.000
#> GSM25357     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25385     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25386     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25399     1  0.0237     0.9137 0.996 0.000 0.004
#> GSM25400     1  0.1860     0.8913 0.948 0.000 0.052
#> GSM48659     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM48660     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM25409     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM25410     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25426     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25427     2  0.4399     0.7575 0.188 0.812 0.000
#> GSM25540     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25541     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25542     3  0.0424     0.9553 0.008 0.000 0.992
#> GSM25543     3  0.0424     0.9553 0.008 0.000 0.992
#> GSM25479     1  0.0424     0.9146 0.992 0.000 0.008
#> GSM25480     1  0.0475     0.9137 0.992 0.004 0.004
#> GSM25481     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25482     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM48654     3  0.4808     0.7479 0.008 0.188 0.804
#> GSM48650     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM48651     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM48652     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM48653     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM48662     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM48663     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM25524     1  0.5733     0.5657 0.676 0.000 0.324
#> GSM25525     1  0.1860     0.8874 0.948 0.052 0.000
#> GSM25526     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25527     1  0.0892     0.9122 0.980 0.000 0.020
#> GSM25528     3  0.4346     0.7497 0.184 0.000 0.816
#> GSM25529     1  0.0747     0.9136 0.984 0.000 0.016
#> GSM25530     3  0.0237     0.9583 0.004 0.000 0.996
#> GSM25531     1  0.6204     0.3122 0.576 0.000 0.424
#> GSM48661     3  0.0237     0.9580 0.004 0.000 0.996
#> GSM25561     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25562     1  0.0000     0.9120 1.000 0.000 0.000
#> GSM25563     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25564     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM25565     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM25566     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM25568     2  0.1453     0.9642 0.008 0.968 0.024
#> GSM25569     2  0.0424     0.9840 0.008 0.992 0.000
#> GSM25552     2  0.0424     0.9840 0.008 0.992 0.000
#> GSM25553     2  0.0424     0.9840 0.008 0.992 0.000
#> GSM25578     1  0.0592     0.9143 0.988 0.000 0.012
#> GSM25579     1  0.0424     0.9146 0.992 0.000 0.008
#> GSM25580     1  0.0592     0.9143 0.988 0.000 0.012
#> GSM25581     1  0.0892     0.9122 0.980 0.000 0.020
#> GSM48655     2  0.0237     0.9844 0.004 0.996 0.000
#> GSM48656     3  0.5339     0.8200 0.096 0.080 0.824
#> GSM48657     2  0.0592     0.9834 0.012 0.988 0.000
#> GSM48658     3  0.2711     0.8973 0.088 0.000 0.912
#> GSM25624     1  0.2096     0.8821 0.944 0.052 0.004
#> GSM25625     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25626     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25627     3  0.2878     0.8902 0.096 0.000 0.904
#> GSM25628     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25629     3  0.2066     0.9175 0.060 0.000 0.940
#> GSM25630     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25631     3  0.4931     0.7085 0.232 0.000 0.768
#> GSM25632     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25633     1  0.0892     0.9122 0.980 0.000 0.020
#> GSM25634     1  0.0747     0.9136 0.984 0.000 0.016
#> GSM25635     1  0.6305     0.0295 0.516 0.000 0.484
#> GSM25656     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25657     1  0.0747     0.9136 0.984 0.000 0.016
#> GSM25658     1  0.0424     0.9146 0.992 0.000 0.008
#> GSM25659     1  0.0237     0.9124 0.996 0.004 0.000
#> GSM25660     1  0.0592     0.9143 0.988 0.000 0.012
#> GSM25661     1  0.0424     0.9146 0.992 0.000 0.008
#> GSM25662     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25663     3  0.0000     0.9607 0.000 0.000 1.000
#> GSM25680     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25681     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25682     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25683     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25684     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25685     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25686     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM25687     2  0.0000     0.9849 0.000 1.000 0.000
#> GSM48664     1  0.0237     0.9137 0.996 0.000 0.004
#> GSM48665     1  0.0000     0.9120 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25549     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25550     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25551     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25570     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25571     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25358     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25359     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25360     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25361     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25377     1  0.2255     0.8650 0.920 0.012 0.000 0.068
#> GSM25378     2  0.0469     0.9021 0.012 0.988 0.000 0.000
#> GSM25401     1  0.6396     0.2779 0.564 0.360 0.000 0.076
#> GSM25402     2  0.4730     0.3782 0.364 0.636 0.000 0.000
#> GSM25349     4  0.3688     0.8529 0.000 0.208 0.000 0.792
#> GSM25350     4  0.3688     0.8529 0.000 0.208 0.000 0.792
#> GSM25356     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25357     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25385     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25386     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25399     1  0.0000     0.9228 1.000 0.000 0.000 0.000
#> GSM25400     1  0.1706     0.8960 0.948 0.036 0.016 0.000
#> GSM48659     4  0.4250     0.7876 0.000 0.276 0.000 0.724
#> GSM48660     4  0.3688     0.8529 0.000 0.208 0.000 0.792
#> GSM25409     2  0.4761     0.4211 0.004 0.664 0.000 0.332
#> GSM25410     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25426     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25427     2  0.0592     0.8981 0.016 0.984 0.000 0.000
#> GSM25540     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25541     3  0.0336     0.9584 0.008 0.000 0.992 0.000
#> GSM25542     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25543     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25479     1  0.0000     0.9228 1.000 0.000 0.000 0.000
#> GSM25480     1  0.0000     0.9228 1.000 0.000 0.000 0.000
#> GSM25481     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25482     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM48654     4  0.0000     0.7581 0.000 0.000 0.000 1.000
#> GSM48650     4  0.3688     0.8529 0.000 0.208 0.000 0.792
#> GSM48651     4  0.3688     0.8529 0.000 0.208 0.000 0.792
#> GSM48652     4  0.3688     0.8529 0.000 0.208 0.000 0.792
#> GSM48653     4  0.3688     0.8529 0.000 0.208 0.000 0.792
#> GSM48662     4  0.3688     0.8529 0.000 0.208 0.000 0.792
#> GSM48663     4  0.3688     0.8529 0.000 0.208 0.000 0.792
#> GSM25524     3  0.2814     0.8273 0.132 0.000 0.868 0.000
#> GSM25525     1  0.0817     0.9107 0.976 0.024 0.000 0.000
#> GSM25526     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25527     1  0.2408     0.8727 0.896 0.000 0.000 0.104
#> GSM25528     3  0.0188     0.9616 0.004 0.000 0.996 0.000
#> GSM25529     1  0.0469     0.9219 0.988 0.000 0.000 0.012
#> GSM25530     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25531     3  0.4972     0.1194 0.456 0.000 0.544 0.000
#> GSM48661     4  0.3649     0.5874 0.000 0.000 0.204 0.796
#> GSM25561     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25562     1  0.0000     0.9228 1.000 0.000 0.000 0.000
#> GSM25563     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25564     4  0.4328     0.8094 0.008 0.244 0.000 0.748
#> GSM25565     2  0.4941     0.0671 0.000 0.564 0.000 0.436
#> GSM25566     2  0.4585     0.4266 0.000 0.668 0.000 0.332
#> GSM25568     4  0.2760     0.8279 0.000 0.128 0.000 0.872
#> GSM25569     4  0.3688     0.8529 0.000 0.208 0.000 0.792
#> GSM25552     2  0.3266     0.7376 0.000 0.832 0.000 0.168
#> GSM25553     2  0.3933     0.6857 0.008 0.792 0.000 0.200
#> GSM25578     1  0.0469     0.9219 0.988 0.000 0.000 0.012
#> GSM25579     1  0.0336     0.9225 0.992 0.000 0.000 0.008
#> GSM25580     1  0.0469     0.9219 0.988 0.000 0.000 0.012
#> GSM25581     1  0.0927     0.9184 0.976 0.000 0.008 0.016
#> GSM48655     4  0.4072     0.8028 0.000 0.252 0.000 0.748
#> GSM48656     4  0.0000     0.7581 0.000 0.000 0.000 1.000
#> GSM48657     4  0.3266     0.8440 0.000 0.168 0.000 0.832
#> GSM48658     4  0.4307     0.6329 0.048 0.000 0.144 0.808
#> GSM25624     4  0.2973     0.6310 0.144 0.000 0.000 0.856
#> GSM25625     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25626     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25627     4  0.4356     0.6288 0.048 0.000 0.148 0.804
#> GSM25628     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25629     3  0.4485     0.7429 0.028 0.000 0.772 0.200
#> GSM25630     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25631     1  0.7413     0.4331 0.516 0.000 0.252 0.232
#> GSM25632     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25633     1  0.3610     0.8013 0.800 0.000 0.000 0.200
#> GSM25634     1  0.3610     0.8013 0.800 0.000 0.000 0.200
#> GSM25635     1  0.5522     0.7246 0.716 0.000 0.080 0.204
#> GSM25656     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25657     1  0.0469     0.9219 0.988 0.000 0.000 0.012
#> GSM25658     1  0.0000     0.9228 1.000 0.000 0.000 0.000
#> GSM25659     1  0.0000     0.9228 1.000 0.000 0.000 0.000
#> GSM25660     1  0.0336     0.9225 0.992 0.000 0.000 0.008
#> GSM25661     1  0.0000     0.9228 1.000 0.000 0.000 0.000
#> GSM25662     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25663     3  0.0000     0.9649 0.000 0.000 1.000 0.000
#> GSM25680     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25681     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25682     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25683     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25684     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25685     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25686     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM25687     2  0.0000     0.9131 0.000 1.000 0.000 0.000
#> GSM48664     1  0.0000     0.9228 1.000 0.000 0.000 0.000
#> GSM48665     1  0.0000     0.9228 1.000 0.000 0.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
#> GSM25548     4  0.0162      0.937 0.000 0.000 0.000 0.996 0.004
#> GSM25549     4  0.0324      0.935 0.000 0.004 0.000 0.992 0.004
#> GSM25550     4  0.0324      0.935 0.000 0.004 0.000 0.992 0.004
#> GSM25551     4  0.0000      0.937 0.000 0.000 0.000 1.000 0.000
#> GSM25570     4  0.0162      0.937 0.000 0.000 0.000 0.996 0.004
#> GSM25571     4  0.0162      0.937 0.000 0.000 0.000 0.996 0.004
#> GSM25358     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25359     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25360     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25361     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25377     1  0.5927      0.365 0.540 0.340 0.000 0.000 0.120
#> GSM25378     4  0.3753      0.821 0.044 0.020 0.000 0.832 0.104
#> GSM25401     1  0.6199      0.178 0.468 0.408 0.000 0.004 0.120
#> GSM25402     1  0.6951      0.242 0.484 0.048 0.000 0.348 0.120
#> GSM25349     2  0.0794      0.896 0.000 0.972 0.000 0.028 0.000
#> GSM25350     2  0.0794      0.896 0.000 0.972 0.000 0.028 0.000
#> GSM25356     4  0.1670      0.901 0.000 0.012 0.000 0.936 0.052
#> GSM25357     4  0.0000      0.937 0.000 0.000 0.000 1.000 0.000
#> GSM25385     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25386     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25399     1  0.3527      0.736 0.828 0.056 0.000 0.000 0.116
#> GSM25400     1  0.3641      0.748 0.840 0.016 0.024 0.008 0.112
#> GSM48659     4  0.5052      0.407 0.000 0.340 0.000 0.612 0.048
#> GSM48660     2  0.1485      0.898 0.000 0.948 0.000 0.032 0.020
#> GSM25409     2  0.3929      0.805 0.036 0.820 0.000 0.028 0.116
#> GSM25410     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25426     4  0.0000      0.937 0.000 0.000 0.000 1.000 0.000
#> GSM25427     4  0.4440      0.786 0.072 0.028 0.000 0.792 0.108
#> GSM25540     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25541     3  0.1200      0.951 0.012 0.008 0.964 0.000 0.016
#> GSM25542     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25543     3  0.0162      0.976 0.000 0.004 0.996 0.000 0.000
#> GSM25479     1  0.0703      0.797 0.976 0.000 0.000 0.000 0.024
#> GSM25480     1  0.0703      0.797 0.976 0.000 0.000 0.000 0.024
#> GSM25481     4  0.5015      0.739 0.028 0.120 0.000 0.748 0.104
#> GSM25482     4  0.4700      0.761 0.020 0.112 0.000 0.768 0.100
#> GSM48654     5  0.3074      0.701 0.000 0.196 0.000 0.000 0.804
#> GSM48650     2  0.1485      0.898 0.000 0.948 0.000 0.032 0.020
#> GSM48651     2  0.1485      0.898 0.000 0.948 0.000 0.032 0.020
#> GSM48652     2  0.1485      0.898 0.000 0.948 0.000 0.032 0.020
#> GSM48653     2  0.1485      0.898 0.000 0.948 0.000 0.032 0.020
#> GSM48662     2  0.1485      0.898 0.000 0.948 0.000 0.032 0.020
#> GSM48663     2  0.1485      0.898 0.000 0.948 0.000 0.032 0.020
#> GSM25524     3  0.3596      0.714 0.212 0.000 0.776 0.000 0.012
#> GSM25525     1  0.2754      0.758 0.884 0.004 0.000 0.080 0.032
#> GSM25526     3  0.2079      0.901 0.064 0.000 0.916 0.000 0.020
#> GSM25527     1  0.2522      0.757 0.880 0.012 0.000 0.000 0.108
#> GSM25528     3  0.1571      0.923 0.060 0.000 0.936 0.000 0.004
#> GSM25529     1  0.2006      0.785 0.916 0.012 0.000 0.000 0.072
#> GSM25530     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25531     1  0.5384      0.147 0.512 0.012 0.444 0.000 0.032
#> GSM48661     5  0.3779      0.716 0.000 0.144 0.052 0.000 0.804
#> GSM25561     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25562     1  0.3741      0.726 0.816 0.076 0.000 0.000 0.108
#> GSM25563     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25564     2  0.1596      0.888 0.012 0.948 0.000 0.028 0.012
#> GSM25565     2  0.2570      0.857 0.000 0.888 0.000 0.028 0.084
#> GSM25566     2  0.3037      0.842 0.004 0.864 0.000 0.032 0.100
#> GSM25568     2  0.4457      0.273 0.000 0.620 0.000 0.012 0.368
#> GSM25569     2  0.2067      0.873 0.000 0.920 0.000 0.032 0.048
#> GSM25552     2  0.4602      0.776 0.040 0.784 0.000 0.064 0.112
#> GSM25553     2  0.4341      0.790 0.044 0.800 0.000 0.044 0.112
#> GSM25578     1  0.1942      0.787 0.920 0.012 0.000 0.000 0.068
#> GSM25579     1  0.1877      0.788 0.924 0.012 0.000 0.000 0.064
#> GSM25580     1  0.2006      0.785 0.916 0.012 0.000 0.000 0.072
#> GSM25581     1  0.2166      0.784 0.912 0.012 0.004 0.000 0.072
#> GSM48655     5  0.6371      0.408 0.000 0.268 0.000 0.216 0.516
#> GSM48656     5  0.3074      0.701 0.000 0.196 0.000 0.000 0.804
#> GSM48657     5  0.4713      0.247 0.000 0.440 0.000 0.016 0.544
#> GSM48658     5  0.2783      0.749 0.012 0.116 0.004 0.000 0.868
#> GSM25624     5  0.3055      0.758 0.072 0.064 0.000 0.000 0.864
#> GSM25625     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25626     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25627     5  0.2844      0.756 0.028 0.092 0.004 0.000 0.876
#> GSM25628     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25629     5  0.4108      0.696 0.068 0.012 0.116 0.000 0.804
#> GSM25630     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25631     5  0.3163      0.703 0.164 0.012 0.000 0.000 0.824
#> GSM25632     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25633     5  0.4655      0.134 0.476 0.012 0.000 0.000 0.512
#> GSM25634     5  0.4339      0.489 0.336 0.012 0.000 0.000 0.652
#> GSM25635     5  0.3686      0.670 0.204 0.012 0.004 0.000 0.780
#> GSM25656     3  0.0000      0.979 0.000 0.000 1.000 0.000 0.000
#> GSM25657     1  0.1942      0.787 0.920 0.012 0.000 0.000 0.068
#> GSM25658     1  0.1012      0.795 0.968 0.012 0.000 0.000 0.020
#> GSM25659     1  0.0671      0.797 0.980 0.004 0.000 0.000 0.016
#> GSM25660     1  0.2006      0.785 0.916 0.012 0.000 0.000 0.072
#> GSM25661     1  0.0798      0.796 0.976 0.008 0.000 0.000 0.016
#> GSM25662     4  0.0000      0.937 0.000 0.000 0.000 1.000 0.000
#> GSM25663     3  0.0451      0.971 0.000 0.000 0.988 0.008 0.004
#> GSM25680     4  0.0162      0.937 0.000 0.000 0.000 0.996 0.004
#> GSM25681     4  0.0162      0.937 0.000 0.000 0.000 0.996 0.004
#> GSM25682     4  0.0000      0.937 0.000 0.000 0.000 1.000 0.000
#> GSM25683     4  0.0000      0.937 0.000 0.000 0.000 1.000 0.000
#> GSM25684     4  0.0000      0.937 0.000 0.000 0.000 1.000 0.000
#> GSM25685     4  0.0000      0.937 0.000 0.000 0.000 1.000 0.000
#> GSM25686     4  0.0000      0.937 0.000 0.000 0.000 1.000 0.000
#> GSM25687     4  0.0000      0.937 0.000 0.000 0.000 1.000 0.000
#> GSM48664     1  0.3359      0.741 0.840 0.052 0.000 0.000 0.108
#> GSM48665     1  0.2853      0.761 0.876 0.052 0.000 0.000 0.072

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM25548     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25549     5  0.0146     0.9299 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM25550     5  0.0146     0.9299 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM25551     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25570     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25571     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25358     3  0.0713     0.9347 0.000 0.000 0.972 0.028 0.000 0.000
#> GSM25359     3  0.0458     0.9421 0.000 0.000 0.984 0.016 0.000 0.000
#> GSM25360     3  0.0146     0.9448 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM25361     3  0.1452     0.9280 0.000 0.020 0.948 0.020 0.000 0.012
#> GSM25377     4  0.3554     0.5948 0.040 0.112 0.000 0.820 0.000 0.028
#> GSM25378     4  0.4075     0.4614 0.004 0.004 0.000 0.668 0.312 0.012
#> GSM25401     4  0.2704     0.6078 0.012 0.100 0.000 0.868 0.000 0.020
#> GSM25402     4  0.2143     0.6213 0.016 0.008 0.000 0.916 0.048 0.012
#> GSM25349     2  0.1251     0.8599 0.000 0.956 0.000 0.024 0.012 0.008
#> GSM25350     2  0.1138     0.8589 0.000 0.960 0.000 0.024 0.012 0.004
#> GSM25356     5  0.3854     0.0239 0.000 0.000 0.000 0.464 0.536 0.000
#> GSM25357     5  0.0260     0.9275 0.000 0.000 0.000 0.008 0.992 0.000
#> GSM25385     3  0.0000     0.9449 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25386     3  0.0000     0.9449 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25399     4  0.4832     0.4545 0.228 0.060 0.000 0.684 0.000 0.028
#> GSM25400     4  0.2967     0.5433 0.136 0.004 0.008 0.840 0.000 0.012
#> GSM48659     5  0.5270     0.0546 0.000 0.404 0.000 0.000 0.496 0.100
#> GSM48660     2  0.1858     0.8674 0.000 0.912 0.000 0.000 0.012 0.076
#> GSM25409     2  0.3659     0.7214 0.000 0.780 0.000 0.180 0.012 0.028
#> GSM25410     3  0.0000     0.9449 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25426     5  0.0260     0.9275 0.000 0.000 0.000 0.008 0.992 0.000
#> GSM25427     4  0.3159     0.6137 0.004 0.004 0.000 0.812 0.168 0.012
#> GSM25540     3  0.0909     0.9372 0.000 0.000 0.968 0.020 0.000 0.012
#> GSM25541     3  0.3434     0.8169 0.136 0.008 0.820 0.024 0.000 0.012
#> GSM25542     3  0.0993     0.9361 0.000 0.000 0.964 0.024 0.000 0.012
#> GSM25543     3  0.1700     0.9215 0.000 0.028 0.936 0.024 0.000 0.012
#> GSM25479     1  0.2755     0.6957 0.844 0.004 0.000 0.140 0.000 0.012
#> GSM25480     1  0.2755     0.6957 0.844 0.004 0.000 0.140 0.000 0.012
#> GSM25481     4  0.5684     0.4112 0.000 0.148 0.000 0.536 0.308 0.008
#> GSM25482     4  0.5529     0.3612 0.000 0.148 0.000 0.516 0.336 0.000
#> GSM48654     6  0.1411     0.7628 0.000 0.060 0.000 0.004 0.000 0.936
#> GSM48650     2  0.1858     0.8674 0.000 0.912 0.000 0.000 0.012 0.076
#> GSM48651     2  0.1858     0.8674 0.000 0.912 0.000 0.000 0.012 0.076
#> GSM48652     2  0.1858     0.8674 0.000 0.912 0.000 0.000 0.012 0.076
#> GSM48653     2  0.1858     0.8674 0.000 0.912 0.000 0.000 0.012 0.076
#> GSM48662     2  0.1858     0.8674 0.000 0.912 0.000 0.000 0.012 0.076
#> GSM48663     2  0.1858     0.8674 0.000 0.912 0.000 0.000 0.012 0.076
#> GSM25524     3  0.5038     0.4122 0.316 0.004 0.596 0.084 0.000 0.000
#> GSM25525     1  0.3846     0.6595 0.784 0.008 0.000 0.164 0.032 0.012
#> GSM25526     3  0.3129     0.7962 0.152 0.000 0.820 0.024 0.000 0.004
#> GSM25527     1  0.0622     0.7529 0.980 0.000 0.000 0.012 0.000 0.008
#> GSM25528     3  0.2909     0.8159 0.136 0.000 0.836 0.028 0.000 0.000
#> GSM25529     1  0.0777     0.7505 0.972 0.000 0.000 0.024 0.000 0.004
#> GSM25530     3  0.0891     0.9332 0.008 0.000 0.968 0.024 0.000 0.000
#> GSM25531     1  0.4379     0.2228 0.576 0.000 0.396 0.028 0.000 0.000
#> GSM48661     6  0.1464     0.7631 0.000 0.036 0.016 0.004 0.000 0.944
#> GSM25561     3  0.0000     0.9449 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25562     4  0.5864     0.0585 0.408 0.092 0.000 0.468 0.000 0.032
#> GSM25563     3  0.0000     0.9449 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25564     2  0.2278     0.8549 0.000 0.904 0.000 0.032 0.012 0.052
#> GSM25565     2  0.2313     0.8203 0.000 0.884 0.000 0.100 0.012 0.004
#> GSM25566     2  0.2752     0.8037 0.000 0.864 0.000 0.104 0.012 0.020
#> GSM25568     6  0.3999     0.0414 0.000 0.496 0.000 0.004 0.000 0.500
#> GSM25569     2  0.1913     0.8641 0.000 0.908 0.000 0.000 0.012 0.080
#> GSM25552     2  0.4405     0.6160 0.000 0.696 0.000 0.252 0.024 0.028
#> GSM25553     2  0.4383     0.6192 0.004 0.700 0.000 0.252 0.016 0.028
#> GSM25578     1  0.0146     0.7560 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM25579     1  0.0653     0.7551 0.980 0.004 0.000 0.012 0.000 0.004
#> GSM25580     1  0.0146     0.7560 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM25581     1  0.0291     0.7554 0.992 0.000 0.000 0.004 0.000 0.004
#> GSM48655     6  0.4895     0.5464 0.000 0.228 0.000 0.000 0.124 0.648
#> GSM48656     6  0.1285     0.7645 0.000 0.052 0.000 0.004 0.000 0.944
#> GSM48657     6  0.3592     0.4608 0.000 0.344 0.000 0.000 0.000 0.656
#> GSM48658     6  0.1562     0.7675 0.024 0.032 0.000 0.004 0.000 0.940
#> GSM25624     6  0.1606     0.7533 0.056 0.008 0.000 0.004 0.000 0.932
#> GSM25625     3  0.0260     0.9445 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM25626     3  0.0146     0.9448 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM25627     6  0.1462     0.7603 0.056 0.008 0.000 0.000 0.000 0.936
#> GSM25628     3  0.0146     0.9448 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM25629     6  0.3776     0.6348 0.196 0.000 0.048 0.000 0.000 0.756
#> GSM25630     3  0.0146     0.9448 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM25631     6  0.3101     0.6162 0.244 0.000 0.000 0.000 0.000 0.756
#> GSM25632     3  0.0000     0.9449 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25633     1  0.3023     0.5571 0.768 0.000 0.000 0.000 0.000 0.232
#> GSM25634     1  0.3695     0.2646 0.624 0.000 0.000 0.000 0.000 0.376
#> GSM25635     6  0.3782     0.3152 0.412 0.000 0.000 0.000 0.000 0.588
#> GSM25656     3  0.0622     0.9411 0.000 0.000 0.980 0.008 0.000 0.012
#> GSM25657     1  0.1334     0.7430 0.948 0.000 0.000 0.032 0.000 0.020
#> GSM25658     1  0.4392     0.1375 0.504 0.004 0.000 0.476 0.000 0.016
#> GSM25659     1  0.4150     0.5775 0.720 0.016 0.000 0.236 0.000 0.028
#> GSM25660     1  0.0146     0.7560 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM25661     1  0.4778     0.4501 0.652 0.036 0.000 0.284 0.000 0.028
#> GSM25662     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25663     3  0.2137     0.9152 0.004 0.020 0.924 0.020 0.020 0.012
#> GSM25680     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25681     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25682     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25683     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25684     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25685     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25686     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25687     5  0.0000     0.9332 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM48664     4  0.5662     0.0110 0.428 0.076 0.000 0.468 0.000 0.028
#> GSM48665     1  0.5705    -0.0584 0.456 0.080 0.000 0.436 0.000 0.028

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 genotype/variation(p) k
#> ATC:skmeans 96              1.32e-04 2
#> ATC:skmeans 98              9.99e-06 3
#> ATC:skmeans 93              8.62e-11 4
#> ATC:skmeans 90              5.14e-14 5
#> ATC:skmeans 83              1.99e-14 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) are extracted by 'ATC' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk ATC-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.802           0.875       0.950         0.4887 0.515   0.515
#> 3 3 0.754           0.824       0.929         0.1766 0.916   0.837
#> 4 4 0.593           0.690       0.848         0.1960 0.858   0.685
#> 5 5 0.831           0.828       0.919         0.1225 0.818   0.508
#> 6 6 0.817           0.760       0.887         0.0443 0.954   0.802

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
#> GSM25548     2  0.0000     0.9605 0.000 1.000
#> GSM25549     2  0.0000     0.9605 0.000 1.000
#> GSM25550     2  0.0000     0.9605 0.000 1.000
#> GSM25551     2  0.0000     0.9605 0.000 1.000
#> GSM25570     2  0.0000     0.9605 0.000 1.000
#> GSM25571     2  0.0000     0.9605 0.000 1.000
#> GSM25358     1  0.0000     0.9349 1.000 0.000
#> GSM25359     1  0.0000     0.9349 1.000 0.000
#> GSM25360     1  0.0000     0.9349 1.000 0.000
#> GSM25361     1  0.0000     0.9349 1.000 0.000
#> GSM25377     1  0.5408     0.8267 0.876 0.124
#> GSM25378     2  0.0000     0.9605 0.000 1.000
#> GSM25401     1  0.8608     0.6160 0.716 0.284
#> GSM25402     1  0.4690     0.8506 0.900 0.100
#> GSM25349     2  0.0000     0.9605 0.000 1.000
#> GSM25350     2  0.9970     0.0406 0.468 0.532
#> GSM25356     2  0.0000     0.9605 0.000 1.000
#> GSM25357     2  0.0000     0.9605 0.000 1.000
#> GSM25385     1  0.0000     0.9349 1.000 0.000
#> GSM25386     1  0.0000     0.9349 1.000 0.000
#> GSM25399     1  0.0000     0.9349 1.000 0.000
#> GSM25400     1  0.0000     0.9349 1.000 0.000
#> GSM48659     2  0.0000     0.9605 0.000 1.000
#> GSM48660     2  0.0000     0.9605 0.000 1.000
#> GSM25409     1  0.9866     0.2881 0.568 0.432
#> GSM25410     1  0.0000     0.9349 1.000 0.000
#> GSM25426     2  0.0000     0.9605 0.000 1.000
#> GSM25427     2  0.0000     0.9605 0.000 1.000
#> GSM25540     1  0.0000     0.9349 1.000 0.000
#> GSM25541     1  0.0000     0.9349 1.000 0.000
#> GSM25542     1  0.0000     0.9349 1.000 0.000
#> GSM25543     1  0.0000     0.9349 1.000 0.000
#> GSM25479     1  0.9909     0.2163 0.556 0.444
#> GSM25480     1  0.9795     0.3280 0.584 0.416
#> GSM25481     2  0.0000     0.9605 0.000 1.000
#> GSM25482     2  0.0000     0.9605 0.000 1.000
#> GSM48654     1  0.9044     0.5533 0.680 0.320
#> GSM48650     2  0.0000     0.9605 0.000 1.000
#> GSM48651     2  0.0000     0.9605 0.000 1.000
#> GSM48652     2  0.0000     0.9605 0.000 1.000
#> GSM48653     2  0.2948     0.9144 0.052 0.948
#> GSM48662     2  0.4161     0.8814 0.084 0.916
#> GSM48663     2  0.6801     0.7574 0.180 0.820
#> GSM25524     1  0.0000     0.9349 1.000 0.000
#> GSM25525     2  0.0376     0.9573 0.004 0.996
#> GSM25526     1  0.0000     0.9349 1.000 0.000
#> GSM25527     1  0.0000     0.9349 1.000 0.000
#> GSM25528     1  0.0000     0.9349 1.000 0.000
#> GSM25529     1  0.0000     0.9349 1.000 0.000
#> GSM25530     1  0.0000     0.9349 1.000 0.000
#> GSM25531     1  0.0000     0.9349 1.000 0.000
#> GSM48661     1  0.0376     0.9322 0.996 0.004
#> GSM25561     1  0.0000     0.9349 1.000 0.000
#> GSM25562     1  0.0000     0.9349 1.000 0.000
#> GSM25563     1  0.0000     0.9349 1.000 0.000
#> GSM25564     2  0.0000     0.9605 0.000 1.000
#> GSM25565     1  0.9170     0.5313 0.668 0.332
#> GSM25566     2  0.6148     0.7976 0.152 0.848
#> GSM25568     2  0.0000     0.9605 0.000 1.000
#> GSM25569     2  0.0000     0.9605 0.000 1.000
#> GSM25552     2  0.9922     0.1176 0.448 0.552
#> GSM25553     1  0.9850     0.2996 0.572 0.428
#> GSM25578     1  0.0000     0.9349 1.000 0.000
#> GSM25579     1  0.0000     0.9349 1.000 0.000
#> GSM25580     1  0.0000     0.9349 1.000 0.000
#> GSM25581     1  0.0000     0.9349 1.000 0.000
#> GSM48655     2  0.0000     0.9605 0.000 1.000
#> GSM48656     1  0.0938     0.9265 0.988 0.012
#> GSM48657     2  0.0000     0.9605 0.000 1.000
#> GSM48658     1  0.0000     0.9349 1.000 0.000
#> GSM25624     2  0.0376     0.9573 0.004 0.996
#> GSM25625     1  0.0000     0.9349 1.000 0.000
#> GSM25626     1  0.0000     0.9349 1.000 0.000
#> GSM25627     1  0.0000     0.9349 1.000 0.000
#> GSM25628     1  0.0000     0.9349 1.000 0.000
#> GSM25629     1  0.0000     0.9349 1.000 0.000
#> GSM25630     1  0.0000     0.9349 1.000 0.000
#> GSM25631     1  0.0000     0.9349 1.000 0.000
#> GSM25632     1  0.0000     0.9349 1.000 0.000
#> GSM25633     1  0.0000     0.9349 1.000 0.000
#> GSM25634     1  0.0000     0.9349 1.000 0.000
#> GSM25635     1  0.0000     0.9349 1.000 0.000
#> GSM25656     1  0.0000     0.9349 1.000 0.000
#> GSM25657     1  0.0000     0.9349 1.000 0.000
#> GSM25658     1  0.0000     0.9349 1.000 0.000
#> GSM25659     1  0.9170     0.5308 0.668 0.332
#> GSM25660     1  0.0000     0.9349 1.000 0.000
#> GSM25661     1  0.0000     0.9349 1.000 0.000
#> GSM25662     1  0.9170     0.5313 0.668 0.332
#> GSM25663     1  0.0376     0.9322 0.996 0.004
#> GSM25680     2  0.0000     0.9605 0.000 1.000
#> GSM25681     2  0.0000     0.9605 0.000 1.000
#> GSM25682     2  0.0000     0.9605 0.000 1.000
#> GSM25683     2  0.0000     0.9605 0.000 1.000
#> GSM25684     2  0.0000     0.9605 0.000 1.000
#> GSM25685     2  0.0000     0.9605 0.000 1.000
#> GSM25686     2  0.0000     0.9605 0.000 1.000
#> GSM25687     2  0.0000     0.9605 0.000 1.000
#> GSM48664     1  0.0000     0.9349 1.000 0.000
#> GSM48665     1  0.1633     0.9175 0.976 0.024

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25549     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25550     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25551     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25570     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25571     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25358     1  0.0237      0.870 0.996 0.000 0.004
#> GSM25359     1  0.0237      0.870 0.996 0.000 0.004
#> GSM25360     3  0.5948      0.308 0.360 0.000 0.640
#> GSM25361     1  0.1031      0.863 0.976 0.000 0.024
#> GSM25377     1  0.3267      0.786 0.884 0.116 0.000
#> GSM25378     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25401     1  0.5754      0.591 0.700 0.296 0.004
#> GSM25402     1  0.3193      0.801 0.896 0.100 0.004
#> GSM25349     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25350     2  0.6442      0.107 0.432 0.564 0.004
#> GSM25356     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25357     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25385     1  0.5882      0.498 0.652 0.000 0.348
#> GSM25386     3  0.0000      0.938 0.000 0.000 1.000
#> GSM25399     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25400     1  0.0237      0.870 0.996 0.000 0.004
#> GSM48659     2  0.0000      0.950 0.000 1.000 0.000
#> GSM48660     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25409     1  0.6505      0.226 0.528 0.468 0.004
#> GSM25410     3  0.0000      0.938 0.000 0.000 1.000
#> GSM25426     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25427     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25540     1  0.1031      0.862 0.976 0.000 0.024
#> GSM25541     1  0.0237      0.870 0.996 0.000 0.004
#> GSM25542     1  0.2590      0.832 0.924 0.004 0.072
#> GSM25543     1  0.0237      0.870 0.996 0.000 0.004
#> GSM25479     1  0.6154      0.327 0.592 0.408 0.000
#> GSM25480     1  0.6026      0.439 0.624 0.376 0.000
#> GSM25481     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25482     2  0.0000      0.950 0.000 1.000 0.000
#> GSM48654     1  0.6298      0.440 0.608 0.388 0.004
#> GSM48650     2  0.0000      0.950 0.000 1.000 0.000
#> GSM48651     2  0.0000      0.950 0.000 1.000 0.000
#> GSM48652     2  0.0000      0.950 0.000 1.000 0.000
#> GSM48653     2  0.1860      0.899 0.052 0.948 0.000
#> GSM48662     2  0.2772      0.863 0.080 0.916 0.004
#> GSM48663     2  0.4465      0.732 0.176 0.820 0.004
#> GSM25524     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25525     2  0.1643      0.909 0.044 0.956 0.000
#> GSM25526     1  0.0747      0.865 0.984 0.000 0.016
#> GSM25527     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25528     1  0.0892      0.863 0.980 0.000 0.020
#> GSM25529     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25530     1  0.5216      0.639 0.740 0.000 0.260
#> GSM25531     1  0.0000      0.870 1.000 0.000 0.000
#> GSM48661     1  0.3461      0.820 0.900 0.024 0.076
#> GSM25561     1  0.2625      0.823 0.916 0.000 0.084
#> GSM25562     1  0.0237      0.870 0.996 0.000 0.004
#> GSM25563     1  0.5560      0.581 0.700 0.000 0.300
#> GSM25564     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25565     1  0.6330      0.423 0.600 0.396 0.004
#> GSM25566     2  0.3879      0.772 0.152 0.848 0.000
#> GSM25568     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25569     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25552     2  0.6398      0.167 0.416 0.580 0.004
#> GSM25553     1  0.6500      0.238 0.532 0.464 0.004
#> GSM25578     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25579     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25580     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25581     1  0.0000      0.870 1.000 0.000 0.000
#> GSM48655     2  0.0000      0.950 0.000 1.000 0.000
#> GSM48656     1  0.0661      0.868 0.988 0.008 0.004
#> GSM48657     2  0.0000      0.950 0.000 1.000 0.000
#> GSM48658     1  0.0237      0.870 0.996 0.000 0.004
#> GSM25624     2  0.1860      0.899 0.052 0.948 0.000
#> GSM25625     3  0.0000      0.938 0.000 0.000 1.000
#> GSM25626     3  0.0000      0.938 0.000 0.000 1.000
#> GSM25627     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25628     3  0.0000      0.938 0.000 0.000 1.000
#> GSM25629     1  0.0237      0.870 0.996 0.000 0.004
#> GSM25630     3  0.0237      0.936 0.004 0.000 0.996
#> GSM25631     1  0.0237      0.870 0.996 0.000 0.004
#> GSM25632     3  0.0237      0.936 0.004 0.000 0.996
#> GSM25633     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25634     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25635     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25656     1  0.3551      0.787 0.868 0.000 0.132
#> GSM25657     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25658     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25659     1  0.6057      0.529 0.656 0.340 0.004
#> GSM25660     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25661     1  0.0000      0.870 1.000 0.000 0.000
#> GSM25662     1  0.6330      0.423 0.600 0.396 0.004
#> GSM25663     1  0.1399      0.856 0.968 0.028 0.004
#> GSM25680     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25681     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25682     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25683     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25684     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25685     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25686     2  0.0000      0.950 0.000 1.000 0.000
#> GSM25687     2  0.0000      0.950 0.000 1.000 0.000
#> GSM48664     1  0.0000      0.870 1.000 0.000 0.000
#> GSM48665     1  0.0892      0.862 0.980 0.020 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25549     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25550     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25551     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25570     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25571     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25358     1  0.3428    0.79191 0.844 0.012 0.000 0.144
#> GSM25359     1  0.2973    0.79498 0.856 0.000 0.000 0.144
#> GSM25360     3  0.4673    0.65977 0.132 0.000 0.792 0.076
#> GSM25361     1  0.4677    0.75682 0.768 0.000 0.040 0.192
#> GSM25377     1  0.5847    0.18654 0.560 0.036 0.000 0.404
#> GSM25378     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25401     4  0.7250    0.10074 0.336 0.160 0.000 0.504
#> GSM25402     1  0.5999    0.45730 0.552 0.044 0.000 0.404
#> GSM25349     4  0.3024    0.74004 0.000 0.148 0.000 0.852
#> GSM25350     4  0.1978    0.71209 0.004 0.068 0.000 0.928
#> GSM25356     2  0.0188    0.83697 0.000 0.996 0.000 0.004
#> GSM25357     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25385     1  0.6702    0.45841 0.544 0.000 0.356 0.100
#> GSM25386     3  0.0000    0.95637 0.000 0.000 1.000 0.000
#> GSM25399     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM25400     1  0.2973    0.79498 0.856 0.000 0.000 0.144
#> GSM48659     2  0.0921    0.81574 0.000 0.972 0.000 0.028
#> GSM48660     4  0.3975    0.64006 0.000 0.240 0.000 0.760
#> GSM25409     4  0.3471    0.68616 0.060 0.072 0.000 0.868
#> GSM25410     3  0.0000    0.95637 0.000 0.000 1.000 0.000
#> GSM25426     2  0.4605    0.29520 0.000 0.664 0.000 0.336
#> GSM25427     2  0.1716    0.77893 0.000 0.936 0.000 0.064
#> GSM25540     1  0.3658    0.79149 0.836 0.000 0.020 0.144
#> GSM25541     1  0.2973    0.79498 0.856 0.000 0.000 0.144
#> GSM25542     1  0.6182    0.39883 0.520 0.000 0.052 0.428
#> GSM25543     1  0.4925    0.45748 0.572 0.000 0.000 0.428
#> GSM25479     1  0.3837    0.59224 0.776 0.224 0.000 0.000
#> GSM25480     1  0.4182    0.64686 0.796 0.180 0.000 0.024
#> GSM25481     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25482     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM48654     2  0.7667   -0.03293 0.224 0.440 0.000 0.336
#> GSM48650     4  0.2973    0.74001 0.000 0.144 0.000 0.856
#> GSM48651     4  0.2973    0.74001 0.000 0.144 0.000 0.856
#> GSM48652     4  0.3123    0.73636 0.000 0.156 0.000 0.844
#> GSM48653     4  0.2868    0.74184 0.000 0.136 0.000 0.864
#> GSM48662     4  0.2589    0.73847 0.000 0.116 0.000 0.884
#> GSM48663     4  0.1867    0.71559 0.000 0.072 0.000 0.928
#> GSM25524     1  0.0336    0.81954 0.992 0.000 0.000 0.008
#> GSM25525     2  0.4250    0.51153 0.276 0.724 0.000 0.000
#> GSM25526     1  0.2197    0.81536 0.928 0.000 0.024 0.048
#> GSM25527     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM25528     1  0.1733    0.81621 0.948 0.000 0.028 0.024
#> GSM25529     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM25530     1  0.4164    0.63340 0.736 0.000 0.264 0.000
#> GSM25531     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM48661     1  0.8335    0.52436 0.552 0.212 0.092 0.144
#> GSM25561     1  0.4114    0.77751 0.828 0.000 0.112 0.060
#> GSM25562     1  0.4830    0.47642 0.608 0.000 0.000 0.392
#> GSM25563     1  0.6708    0.57336 0.592 0.000 0.280 0.128
#> GSM25564     2  0.0592    0.82761 0.000 0.984 0.000 0.016
#> GSM25565     4  0.7439    0.20999 0.296 0.204 0.000 0.500
#> GSM25566     2  0.6130    0.00966 0.052 0.548 0.000 0.400
#> GSM25568     2  0.5000   -0.17700 0.000 0.500 0.000 0.500
#> GSM25569     4  0.3486    0.71925 0.000 0.188 0.000 0.812
#> GSM25552     4  0.7466    0.28004 0.176 0.388 0.000 0.436
#> GSM25553     4  0.7731    0.35814 0.248 0.316 0.000 0.436
#> GSM25578     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM25579     1  0.0469    0.82018 0.988 0.000 0.000 0.012
#> GSM25580     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM25581     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM48655     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM48656     1  0.4920    0.59602 0.628 0.004 0.000 0.368
#> GSM48657     2  0.5000   -0.08312 0.000 0.504 0.000 0.496
#> GSM48658     1  0.2973    0.79498 0.856 0.000 0.000 0.144
#> GSM25624     2  0.4679    0.38868 0.352 0.648 0.000 0.000
#> GSM25625     3  0.0000    0.95637 0.000 0.000 1.000 0.000
#> GSM25626     3  0.0000    0.95637 0.000 0.000 1.000 0.000
#> GSM25627     1  0.1302    0.81753 0.956 0.000 0.000 0.044
#> GSM25628     3  0.0000    0.95637 0.000 0.000 1.000 0.000
#> GSM25629     1  0.2973    0.79498 0.856 0.000 0.000 0.144
#> GSM25630     3  0.0000    0.95637 0.000 0.000 1.000 0.000
#> GSM25631     1  0.5063    0.73737 0.768 0.108 0.000 0.124
#> GSM25632     3  0.0000    0.95637 0.000 0.000 1.000 0.000
#> GSM25633     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM25634     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM25635     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM25656     1  0.6945    0.51852 0.552 0.000 0.312 0.136
#> GSM25657     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM25658     1  0.1940    0.81373 0.924 0.000 0.000 0.076
#> GSM25659     1  0.7137    0.33436 0.536 0.304 0.000 0.160
#> GSM25660     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM25661     1  0.0000    0.81927 1.000 0.000 0.000 0.000
#> GSM25662     2  0.6955    0.17085 0.296 0.560 0.000 0.144
#> GSM25663     1  0.6295    0.62614 0.660 0.196 0.000 0.144
#> GSM25680     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25681     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25682     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25683     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25684     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25685     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25686     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM25687     2  0.0000    0.83990 0.000 1.000 0.000 0.000
#> GSM48664     1  0.0188    0.81839 0.996 0.000 0.000 0.004
#> GSM48665     1  0.2125    0.78114 0.920 0.004 0.000 0.076

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25549     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25550     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25551     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25570     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25571     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25358     5  0.1544     0.8754 0.068 0.000 0.000 0.000 0.932
#> GSM25359     5  0.1544     0.8754 0.068 0.000 0.000 0.000 0.932
#> GSM25360     3  0.4088     0.3031 0.000 0.000 0.632 0.000 0.368
#> GSM25361     5  0.1544     0.8754 0.068 0.000 0.000 0.000 0.932
#> GSM25377     1  0.4297     0.7053 0.764 0.072 0.000 0.000 0.164
#> GSM25378     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25401     5  0.1544     0.8606 0.000 0.068 0.000 0.000 0.932
#> GSM25402     5  0.1800     0.8718 0.020 0.048 0.000 0.000 0.932
#> GSM25349     2  0.0404     0.9255 0.000 0.988 0.000 0.012 0.000
#> GSM25350     2  0.0404     0.9245 0.000 0.988 0.000 0.000 0.012
#> GSM25356     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25357     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25385     5  0.4755     0.6555 0.060 0.000 0.244 0.000 0.696
#> GSM25386     3  0.0000     0.9279 0.000 0.000 1.000 0.000 0.000
#> GSM25399     1  0.0609     0.8612 0.980 0.000 0.000 0.000 0.020
#> GSM25400     5  0.1544     0.8754 0.068 0.000 0.000 0.000 0.932
#> GSM48659     4  0.0290     0.9492 0.000 0.008 0.000 0.992 0.000
#> GSM48660     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM25409     2  0.3336     0.6439 0.000 0.772 0.000 0.000 0.228
#> GSM25410     3  0.0000     0.9279 0.000 0.000 1.000 0.000 0.000
#> GSM25426     4  0.1544     0.8914 0.000 0.068 0.000 0.932 0.000
#> GSM25427     4  0.0162     0.9521 0.000 0.004 0.000 0.996 0.000
#> GSM25540     5  0.1544     0.8754 0.068 0.000 0.000 0.000 0.932
#> GSM25541     5  0.1608     0.8742 0.072 0.000 0.000 0.000 0.928
#> GSM25542     5  0.1697     0.8651 0.008 0.060 0.000 0.000 0.932
#> GSM25543     5  0.1697     0.8651 0.008 0.060 0.000 0.000 0.932
#> GSM25479     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM25480     1  0.0290     0.8638 0.992 0.008 0.000 0.000 0.000
#> GSM25481     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25482     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM48654     5  0.2179     0.7881 0.000 0.112 0.000 0.000 0.888
#> GSM48650     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM48651     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM48652     2  0.0162     0.9307 0.000 0.996 0.000 0.004 0.000
#> GSM48653     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM48662     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM48663     2  0.0000     0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM25524     1  0.1608     0.8337 0.928 0.000 0.000 0.000 0.072
#> GSM25525     1  0.4161     0.3789 0.608 0.000 0.000 0.392 0.000
#> GSM25526     1  0.5005     0.5532 0.660 0.000 0.064 0.000 0.276
#> GSM25527     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM25528     1  0.3608     0.7598 0.824 0.000 0.064 0.000 0.112
#> GSM25529     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM25530     1  0.3961     0.6337 0.736 0.000 0.248 0.000 0.016
#> GSM25531     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM48661     5  0.0000     0.8610 0.000 0.000 0.000 0.000 1.000
#> GSM25561     1  0.5449     0.3186 0.556 0.000 0.068 0.000 0.376
#> GSM25562     5  0.4035     0.7735 0.156 0.060 0.000 0.000 0.784
#> GSM25563     5  0.3868     0.7903 0.060 0.000 0.140 0.000 0.800
#> GSM25564     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25565     5  0.1544     0.8606 0.000 0.068 0.000 0.000 0.932
#> GSM25566     4  0.3994     0.7318 0.000 0.068 0.000 0.792 0.140
#> GSM25568     4  0.3336     0.6941 0.000 0.228 0.000 0.772 0.000
#> GSM25569     2  0.3177     0.6855 0.000 0.792 0.000 0.208 0.000
#> GSM25552     4  0.5542     0.0215 0.000 0.068 0.000 0.500 0.432
#> GSM25553     5  0.5513     0.2417 0.000 0.068 0.000 0.408 0.524
#> GSM25578     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM25579     1  0.2773     0.7539 0.836 0.000 0.000 0.000 0.164
#> GSM25580     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM25581     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM48655     4  0.0510     0.9439 0.000 0.000 0.000 0.984 0.016
#> GSM48656     5  0.1908     0.8080 0.000 0.092 0.000 0.000 0.908
#> GSM48657     2  0.1544     0.8711 0.000 0.932 0.000 0.000 0.068
#> GSM48658     5  0.0000     0.8610 0.000 0.000 0.000 0.000 1.000
#> GSM25624     1  0.5086     0.5020 0.636 0.000 0.000 0.304 0.060
#> GSM25625     3  0.0000     0.9279 0.000 0.000 1.000 0.000 0.000
#> GSM25626     3  0.0000     0.9279 0.000 0.000 1.000 0.000 0.000
#> GSM25627     1  0.2852     0.7634 0.828 0.000 0.000 0.000 0.172
#> GSM25628     3  0.0000     0.9279 0.000 0.000 1.000 0.000 0.000
#> GSM25629     5  0.1478     0.8754 0.064 0.000 0.000 0.000 0.936
#> GSM25630     3  0.0000     0.9279 0.000 0.000 1.000 0.000 0.000
#> GSM25631     5  0.2648     0.8230 0.152 0.000 0.000 0.000 0.848
#> GSM25632     3  0.0000     0.9279 0.000 0.000 1.000 0.000 0.000
#> GSM25633     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM25634     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM25635     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM25656     5  0.2900     0.8331 0.028 0.000 0.108 0.000 0.864
#> GSM25657     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM25658     1  0.4256     0.2183 0.564 0.000 0.000 0.000 0.436
#> GSM25659     5  0.4985     0.3954 0.392 0.012 0.000 0.016 0.580
#> GSM25660     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM25661     1  0.0000     0.8682 1.000 0.000 0.000 0.000 0.000
#> GSM25662     5  0.1544     0.8469 0.000 0.000 0.000 0.068 0.932
#> GSM25663     5  0.1818     0.8739 0.044 0.000 0.000 0.024 0.932
#> GSM25680     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25681     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25682     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25683     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25684     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25685     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25686     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM25687     4  0.0000     0.9550 0.000 0.000 0.000 1.000 0.000
#> GSM48664     1  0.0162     0.8670 0.996 0.000 0.000 0.000 0.004
#> GSM48665     1  0.0290     0.8638 0.992 0.008 0.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
#> GSM25548     5  0.0000    0.91249 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25549     5  0.0000    0.91249 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25550     5  0.0000    0.91249 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25551     5  0.0000    0.91249 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25570     5  0.0000    0.91249 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25571     5  0.0000    0.91249 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25358     4  0.1141    0.83916 0.052 0.000 0.000 0.948 0.000 0.000
#> GSM25359     4  0.0632    0.84469 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM25360     3  0.3765    0.26132 0.000 0.000 0.596 0.404 0.000 0.000
#> GSM25361     4  0.0632    0.84469 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM25377     1  0.7030   -0.09102 0.424 0.332 0.000 0.132 0.004 0.108
#> GSM25378     5  0.0000    0.91249 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25401     4  0.5788    0.20450 0.020 0.324 0.000 0.544 0.004 0.108
#> GSM25402     4  0.1003    0.83100 0.028 0.004 0.000 0.964 0.000 0.004
#> GSM25349     2  0.2669    0.78744 0.000 0.864 0.000 0.024 0.004 0.108
#> GSM25350     2  0.2669    0.78744 0.000 0.864 0.000 0.024 0.004 0.108
#> GSM25356     5  0.0603    0.90095 0.000 0.004 0.000 0.000 0.980 0.016
#> GSM25357     5  0.0146    0.91191 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM25385     4  0.2912    0.66080 0.000 0.000 0.216 0.784 0.000 0.000
#> GSM25386     3  0.0000    0.91898 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25399     1  0.0632    0.85591 0.976 0.000 0.000 0.024 0.000 0.000
#> GSM25400     4  0.1141    0.83916 0.052 0.000 0.000 0.948 0.000 0.000
#> GSM48659     5  0.0692    0.89820 0.000 0.020 0.000 0.000 0.976 0.004
#> GSM48660     2  0.1663    0.74056 0.000 0.912 0.000 0.000 0.088 0.000
#> GSM25409     2  0.4457    0.67778 0.000 0.720 0.000 0.168 0.004 0.108
#> GSM25410     3  0.0000    0.91898 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25426     5  0.5763    0.14989 0.000 0.324 0.000 0.024 0.540 0.112
#> GSM25427     5  0.2454    0.81297 0.000 0.008 0.000 0.020 0.884 0.088
#> GSM25540     4  0.0632    0.84469 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM25541     4  0.0632    0.84469 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM25542     4  0.0632    0.84469 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM25543     4  0.0632    0.84469 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM25479     1  0.0260    0.85910 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM25480     1  0.0622    0.85273 0.980 0.000 0.000 0.012 0.008 0.000
#> GSM25481     5  0.0000    0.91249 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25482     5  0.0146    0.91191 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM48654     6  0.2053    0.89322 0.000 0.000 0.000 0.108 0.004 0.888
#> GSM48650     2  0.0000    0.81869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48651     2  0.0000    0.81869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48652     2  0.0000    0.81869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48653     2  0.0000    0.81869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48662     2  0.0000    0.81869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48663     2  0.0000    0.81869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25524     1  0.1387    0.82924 0.932 0.000 0.000 0.068 0.000 0.000
#> GSM25525     1  0.3797    0.27998 0.580 0.000 0.000 0.000 0.420 0.000
#> GSM25526     1  0.4317    0.60649 0.688 0.000 0.060 0.252 0.000 0.000
#> GSM25527     1  0.0000    0.86352 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25528     1  0.3183    0.75524 0.828 0.000 0.060 0.112 0.000 0.000
#> GSM25529     1  0.0000    0.86352 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25530     1  0.3766    0.65590 0.748 0.000 0.212 0.040 0.000 0.000
#> GSM25531     1  0.0713    0.85075 0.972 0.000 0.000 0.028 0.000 0.000
#> GSM48661     6  0.1957    0.89198 0.000 0.000 0.000 0.112 0.000 0.888
#> GSM25561     1  0.4808    0.39098 0.576 0.000 0.064 0.360 0.000 0.000
#> GSM25562     4  0.5549    0.35849 0.164 0.304 0.000 0.532 0.000 0.000
#> GSM25563     4  0.2389    0.76135 0.008 0.000 0.128 0.864 0.000 0.000
#> GSM25564     5  0.0508    0.90361 0.000 0.000 0.000 0.004 0.984 0.012
#> GSM25565     4  0.5795    0.17525 0.000 0.324 0.000 0.540 0.028 0.108
#> GSM25566     5  0.6539   -0.00448 0.000 0.324 0.000 0.088 0.480 0.108
#> GSM25568     2  0.5524    0.49272 0.000 0.568 0.000 0.008 0.288 0.136
#> GSM25569     2  0.3929    0.74347 0.000 0.792 0.000 0.020 0.112 0.076
#> GSM25552     5  0.7324   -0.29449 0.000 0.320 0.000 0.236 0.336 0.108
#> GSM25553     2  0.7369    0.21919 0.000 0.324 0.000 0.292 0.276 0.108
#> GSM25578     1  0.0000    0.86352 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25579     1  0.2562    0.73076 0.828 0.000 0.000 0.172 0.000 0.000
#> GSM25580     1  0.0000    0.86352 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25581     1  0.0000    0.86352 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM48655     5  0.2178    0.79116 0.000 0.000 0.000 0.000 0.868 0.132
#> GSM48656     6  0.2053    0.89338 0.000 0.004 0.000 0.108 0.000 0.888
#> GSM48657     6  0.2135    0.81320 0.000 0.128 0.000 0.000 0.000 0.872
#> GSM48658     6  0.2053    0.89313 0.004 0.000 0.000 0.108 0.000 0.888
#> GSM25624     6  0.3163    0.75912 0.040 0.000 0.000 0.000 0.140 0.820
#> GSM25625     3  0.0260    0.91187 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM25626     3  0.0000    0.91898 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25627     6  0.2260    0.78240 0.140 0.000 0.000 0.000 0.000 0.860
#> GSM25628     3  0.0000    0.91898 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25629     4  0.1168    0.83923 0.028 0.000 0.000 0.956 0.000 0.016
#> GSM25630     3  0.0000    0.91898 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25631     4  0.2178    0.78570 0.132 0.000 0.000 0.868 0.000 0.000
#> GSM25632     3  0.0000    0.91898 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25633     1  0.0000    0.86352 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25634     1  0.0000    0.86352 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25635     1  0.0000    0.86352 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25656     4  0.1950    0.81241 0.024 0.000 0.064 0.912 0.000 0.000
#> GSM25657     1  0.0000    0.86352 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25658     1  0.3789    0.28467 0.584 0.000 0.000 0.416 0.000 0.000
#> GSM25659     4  0.3915    0.54060 0.304 0.000 0.000 0.680 0.008 0.008
#> GSM25660     1  0.0000    0.86352 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25661     1  0.0000    0.86352 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25662     4  0.1267    0.80637 0.000 0.000 0.000 0.940 0.060 0.000
#> GSM25663     4  0.1075    0.84056 0.048 0.000 0.000 0.952 0.000 0.000
#> GSM25680     5  0.0000    0.91249 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25681     5  0.0000    0.91249 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25682     5  0.0146    0.91191 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM25683     5  0.0146    0.91191 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM25684     5  0.0146    0.91191 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM25685     5  0.0146    0.91191 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM25686     5  0.0146    0.91191 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM25687     5  0.0146    0.91191 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM48664     1  0.0458    0.85872 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM48665     1  0.0993    0.84342 0.964 0.000 0.000 0.024 0.000 0.012

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 genotype/variation(p) k
#> ATC:pam 94              2.43e-06 2
#> ATC:pam 89              2.91e-06 3
#> ATC:pam 82              3.25e-08 4
#> ATC:pam 93              7.44e-12 5
#> ATC:pam 87              8.79e-17 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) 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 5.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk ATC-mclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.776           0.915       0.954         0.3658 0.665   0.665
#> 3 3 0.384           0.732       0.845         0.6695 0.666   0.512
#> 4 4 0.817           0.848       0.934         0.0689 0.704   0.418
#> 5 5 0.684           0.758       0.843         0.1152 0.922   0.787
#> 6 6 0.685           0.625       0.787         0.0625 0.829   0.500

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

suggest_best_k(res)
#> [1] 5

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM25548     2  0.0938      0.974 0.012 0.988
#> GSM25549     2  0.2043      0.967 0.032 0.968
#> GSM25550     2  0.2043      0.967 0.032 0.968
#> GSM25551     2  0.0000      0.975 0.000 1.000
#> GSM25570     2  0.2043      0.967 0.032 0.968
#> GSM25571     2  0.0000      0.975 0.000 1.000
#> GSM25358     1  0.0000      0.945 1.000 0.000
#> GSM25359     1  0.0000      0.945 1.000 0.000
#> GSM25360     1  0.0000      0.945 1.000 0.000
#> GSM25361     1  0.0000      0.945 1.000 0.000
#> GSM25377     1  0.8081      0.728 0.752 0.248
#> GSM25378     2  0.2236      0.964 0.036 0.964
#> GSM25401     1  0.8144      0.726 0.748 0.252
#> GSM25402     1  0.9248      0.574 0.660 0.340
#> GSM25349     1  0.0672      0.944 0.992 0.008
#> GSM25350     1  0.0672      0.944 0.992 0.008
#> GSM25356     2  0.2236      0.964 0.036 0.964
#> GSM25357     2  0.0000      0.975 0.000 1.000
#> GSM25385     1  0.0000      0.945 1.000 0.000
#> GSM25386     1  0.0000      0.945 1.000 0.000
#> GSM25399     1  0.4562      0.886 0.904 0.096
#> GSM25400     1  0.0672      0.943 0.992 0.008
#> GSM48659     1  0.0672      0.944 0.992 0.008
#> GSM48660     1  0.0672      0.944 0.992 0.008
#> GSM25409     1  0.7299      0.787 0.796 0.204
#> GSM25410     1  0.0000      0.945 1.000 0.000
#> GSM25426     2  0.0000      0.975 0.000 1.000
#> GSM25427     2  0.7056      0.751 0.192 0.808
#> GSM25540     1  0.0000      0.945 1.000 0.000
#> GSM25541     1  0.0000      0.945 1.000 0.000
#> GSM25542     1  0.0000      0.945 1.000 0.000
#> GSM25543     1  0.0000      0.945 1.000 0.000
#> GSM25479     1  0.7453      0.775 0.788 0.212
#> GSM25480     1  0.7602      0.765 0.780 0.220
#> GSM25481     2  0.2043      0.967 0.032 0.968
#> GSM25482     2  0.2043      0.967 0.032 0.968
#> GSM48654     1  0.0672      0.944 0.992 0.008
#> GSM48650     1  0.0672      0.944 0.992 0.008
#> GSM48651     1  0.0672      0.944 0.992 0.008
#> GSM48652     1  0.0672      0.944 0.992 0.008
#> GSM48653     1  0.0672      0.944 0.992 0.008
#> GSM48662     1  0.0672      0.944 0.992 0.008
#> GSM48663     1  0.0672      0.944 0.992 0.008
#> GSM25524     1  0.0000      0.945 1.000 0.000
#> GSM25525     1  0.9608      0.482 0.616 0.384
#> GSM25526     1  0.0000      0.945 1.000 0.000
#> GSM25527     1  0.0000      0.945 1.000 0.000
#> GSM25528     1  0.0000      0.945 1.000 0.000
#> GSM25529     1  0.0000      0.945 1.000 0.000
#> GSM25530     1  0.0000      0.945 1.000 0.000
#> GSM25531     1  0.0000      0.945 1.000 0.000
#> GSM48661     1  0.0672      0.944 0.992 0.008
#> GSM25561     1  0.0000      0.945 1.000 0.000
#> GSM25562     1  0.0938      0.941 0.988 0.012
#> GSM25563     1  0.0000      0.945 1.000 0.000
#> GSM25564     1  0.2603      0.927 0.956 0.044
#> GSM25565     1  0.3733      0.906 0.928 0.072
#> GSM25566     1  0.5519      0.861 0.872 0.128
#> GSM25568     1  0.0672      0.944 0.992 0.008
#> GSM25569     1  0.0672      0.944 0.992 0.008
#> GSM25552     1  0.8555      0.688 0.720 0.280
#> GSM25553     1  0.8443      0.700 0.728 0.272
#> GSM25578     1  0.3274      0.913 0.940 0.060
#> GSM25579     1  0.3431      0.911 0.936 0.064
#> GSM25580     1  0.2948      0.918 0.948 0.052
#> GSM25581     1  0.0000      0.945 1.000 0.000
#> GSM48655     1  0.0672      0.944 0.992 0.008
#> GSM48656     1  0.0672      0.944 0.992 0.008
#> GSM48657     1  0.0672      0.944 0.992 0.008
#> GSM48658     1  0.0672      0.944 0.992 0.008
#> GSM25624     1  0.0672      0.944 0.992 0.008
#> GSM25625     1  0.0000      0.945 1.000 0.000
#> GSM25626     1  0.0000      0.945 1.000 0.000
#> GSM25627     1  0.0672      0.944 0.992 0.008
#> GSM25628     1  0.0000      0.945 1.000 0.000
#> GSM25629     1  0.0000      0.945 1.000 0.000
#> GSM25630     1  0.0000      0.945 1.000 0.000
#> GSM25631     1  0.0000      0.945 1.000 0.000
#> GSM25632     1  0.0000      0.945 1.000 0.000
#> GSM25633     1  0.0000      0.945 1.000 0.000
#> GSM25634     1  0.0000      0.945 1.000 0.000
#> GSM25635     1  0.0000      0.945 1.000 0.000
#> GSM25656     1  0.0000      0.945 1.000 0.000
#> GSM25657     1  0.0000      0.945 1.000 0.000
#> GSM25658     1  0.6438      0.827 0.836 0.164
#> GSM25659     1  0.7745      0.755 0.772 0.228
#> GSM25660     1  0.3733      0.904 0.928 0.072
#> GSM25661     1  0.7219      0.789 0.800 0.200
#> GSM25662     1  0.1184      0.942 0.984 0.016
#> GSM25663     1  0.0000      0.945 1.000 0.000
#> GSM25680     2  0.0000      0.975 0.000 1.000
#> GSM25681     2  0.0672      0.975 0.008 0.992
#> GSM25682     2  0.0000      0.975 0.000 1.000
#> GSM25683     2  0.0000      0.975 0.000 1.000
#> GSM25684     2  0.0000      0.975 0.000 1.000
#> GSM25685     2  0.0000      0.975 0.000 1.000
#> GSM25686     2  0.0000      0.975 0.000 1.000
#> GSM25687     2  0.0000      0.975 0.000 1.000
#> GSM48664     1  0.7299      0.784 0.796 0.204
#> GSM48665     1  0.6343      0.830 0.840 0.160

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM25548     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25549     2  0.6305     0.1473 0.484 0.516 0.000
#> GSM25550     2  0.6302     0.1621 0.480 0.520 0.000
#> GSM25551     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25570     2  0.6225     0.2907 0.432 0.568 0.000
#> GSM25571     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25358     1  0.2796     0.7917 0.908 0.000 0.092
#> GSM25359     1  0.2261     0.8145 0.932 0.000 0.068
#> GSM25360     3  0.3116     0.8213 0.108 0.000 0.892
#> GSM25361     3  0.6095     0.6302 0.392 0.000 0.608
#> GSM25377     1  0.3412     0.7694 0.876 0.124 0.000
#> GSM25378     1  0.6111     0.2631 0.604 0.396 0.000
#> GSM25401     1  0.3752     0.7560 0.856 0.144 0.000
#> GSM25402     1  0.4047     0.7576 0.848 0.148 0.004
#> GSM25349     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM25350     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM25356     1  0.6267     0.0582 0.548 0.452 0.000
#> GSM25357     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25385     3  0.3340     0.8172 0.120 0.000 0.880
#> GSM25386     3  0.3340     0.8172 0.120 0.000 0.880
#> GSM25399     1  0.0237     0.8477 0.996 0.004 0.000
#> GSM25400     1  0.0892     0.8430 0.980 0.000 0.020
#> GSM48659     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM48660     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM25409     1  0.4291     0.7155 0.820 0.180 0.000
#> GSM25410     3  0.3340     0.8172 0.120 0.000 0.880
#> GSM25426     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25427     1  0.5529     0.5243 0.704 0.296 0.000
#> GSM25540     3  0.5497     0.7607 0.292 0.000 0.708
#> GSM25541     3  0.6307     0.4369 0.488 0.000 0.512
#> GSM25542     3  0.5115     0.8070 0.228 0.004 0.768
#> GSM25543     3  0.4974     0.8024 0.236 0.000 0.764
#> GSM25479     1  0.0747     0.8458 0.984 0.016 0.000
#> GSM25480     1  0.0747     0.8458 0.984 0.016 0.000
#> GSM25481     2  0.6308     0.1142 0.492 0.508 0.000
#> GSM25482     2  0.6302     0.1621 0.480 0.520 0.000
#> GSM48654     3  0.4569     0.8219 0.068 0.072 0.860
#> GSM48650     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM48651     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM48652     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM48653     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM48662     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM48663     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM25524     1  0.0237     0.8483 0.996 0.000 0.004
#> GSM25525     1  0.4504     0.7010 0.804 0.196 0.000
#> GSM25526     3  0.4291     0.8053 0.180 0.000 0.820
#> GSM25527     1  0.3482     0.7330 0.872 0.000 0.128
#> GSM25528     1  0.1289     0.8410 0.968 0.000 0.032
#> GSM25529     1  0.0000     0.8480 1.000 0.000 0.000
#> GSM25530     1  0.6140     0.3230 0.596 0.000 0.404
#> GSM25531     1  0.0592     0.8458 0.988 0.000 0.012
#> GSM48661     3  0.3851     0.8152 0.136 0.004 0.860
#> GSM25561     3  0.3412     0.8178 0.124 0.000 0.876
#> GSM25562     1  0.1289     0.8346 0.968 0.000 0.032
#> GSM25563     3  0.3340     0.8172 0.120 0.000 0.880
#> GSM25564     3  0.9018     0.3562 0.412 0.132 0.456
#> GSM25565     3  0.7273     0.7913 0.156 0.132 0.712
#> GSM25566     3  0.8924     0.5327 0.336 0.140 0.524
#> GSM25568     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM25569     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM25552     1  0.4452     0.6993 0.808 0.192 0.000
#> GSM25553     1  0.4291     0.7155 0.820 0.180 0.000
#> GSM25578     1  0.0000     0.8480 1.000 0.000 0.000
#> GSM25579     1  0.0000     0.8480 1.000 0.000 0.000
#> GSM25580     1  0.0000     0.8480 1.000 0.000 0.000
#> GSM25581     1  0.0000     0.8480 1.000 0.000 0.000
#> GSM48655     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM48656     3  0.3965     0.8163 0.132 0.008 0.860
#> GSM48657     3  0.4139     0.8097 0.016 0.124 0.860
#> GSM48658     3  0.3918     0.8161 0.140 0.004 0.856
#> GSM25624     3  0.5277     0.8255 0.180 0.024 0.796
#> GSM25625     3  0.2959     0.8234 0.100 0.000 0.900
#> GSM25626     3  0.2959     0.8234 0.100 0.000 0.900
#> GSM25627     3  0.4110     0.8177 0.152 0.004 0.844
#> GSM25628     3  0.2959     0.8234 0.100 0.000 0.900
#> GSM25629     3  0.4974     0.8024 0.236 0.000 0.764
#> GSM25630     3  0.2959     0.8234 0.100 0.000 0.900
#> GSM25631     3  0.5327     0.7784 0.272 0.000 0.728
#> GSM25632     3  0.2959     0.8234 0.100 0.000 0.900
#> GSM25633     3  0.6274     0.5076 0.456 0.000 0.544
#> GSM25634     3  0.6192     0.5811 0.420 0.000 0.580
#> GSM25635     3  0.5431     0.7693 0.284 0.000 0.716
#> GSM25656     3  0.2959     0.8234 0.100 0.000 0.900
#> GSM25657     1  0.0747     0.8441 0.984 0.000 0.016
#> GSM25658     1  0.0237     0.8477 0.996 0.004 0.000
#> GSM25659     1  0.3267     0.7799 0.884 0.116 0.000
#> GSM25660     1  0.0000     0.8480 1.000 0.000 0.000
#> GSM25661     1  0.0592     0.8472 0.988 0.012 0.000
#> GSM25662     3  0.7433     0.7783 0.132 0.168 0.700
#> GSM25663     1  0.6244    -0.2571 0.560 0.000 0.440
#> GSM25680     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25681     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25682     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25683     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25684     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25685     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25686     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM25687     2  0.0237     0.8335 0.004 0.996 0.000
#> GSM48664     1  0.0592     0.8472 0.988 0.012 0.000
#> GSM48665     1  0.0661     0.8488 0.988 0.008 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25549     1  0.3764     0.7428 0.784 0.216 0.000 0.000
#> GSM25550     1  0.3801     0.7374 0.780 0.220 0.000 0.000
#> GSM25551     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25570     2  0.4998    -0.0577 0.488 0.512 0.000 0.000
#> GSM25571     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25358     1  0.1824     0.8913 0.936 0.004 0.060 0.000
#> GSM25359     1  0.3448     0.7829 0.828 0.004 0.168 0.000
#> GSM25360     3  0.0000     0.8566 0.000 0.000 1.000 0.000
#> GSM25361     1  0.0707     0.9147 0.980 0.020 0.000 0.000
#> GSM25377     1  0.0336     0.9196 0.992 0.008 0.000 0.000
#> GSM25378     1  0.0921     0.9143 0.972 0.028 0.000 0.000
#> GSM25401     1  0.0336     0.9196 0.992 0.008 0.000 0.000
#> GSM25402     1  0.0336     0.9202 0.992 0.008 0.000 0.000
#> GSM25349     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM25350     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM25356     1  0.1474     0.9013 0.948 0.052 0.000 0.000
#> GSM25357     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25385     3  0.3873     0.6947 0.228 0.000 0.772 0.000
#> GSM25386     3  0.0000     0.8566 0.000 0.000 1.000 0.000
#> GSM25399     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25400     1  0.0524     0.9195 0.988 0.004 0.008 0.000
#> GSM48659     4  0.0469     0.9311 0.000 0.012 0.000 0.988
#> GSM48660     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM25409     1  0.1022     0.9123 0.968 0.032 0.000 0.000
#> GSM25410     3  0.0000     0.8566 0.000 0.000 1.000 0.000
#> GSM25426     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25427     1  0.0469     0.9191 0.988 0.012 0.000 0.000
#> GSM25540     1  0.0707     0.9147 0.980 0.020 0.000 0.000
#> GSM25541     1  0.0707     0.9147 0.980 0.020 0.000 0.000
#> GSM25542     1  0.6292     0.2119 0.548 0.044 0.008 0.400
#> GSM25543     1  0.5832     0.4683 0.640 0.044 0.004 0.312
#> GSM25479     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25480     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25481     1  0.3688     0.7532 0.792 0.208 0.000 0.000
#> GSM25482     1  0.3801     0.7374 0.780 0.220 0.000 0.000
#> GSM48654     4  0.0469     0.9252 0.000 0.012 0.000 0.988
#> GSM48650     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM48651     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM48652     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM48653     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM48662     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM48663     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM25524     1  0.0779     0.9178 0.980 0.004 0.016 0.000
#> GSM25525     1  0.0469     0.9191 0.988 0.012 0.000 0.000
#> GSM25526     3  0.4843     0.3891 0.396 0.000 0.604 0.000
#> GSM25527     1  0.0707     0.9147 0.980 0.020 0.000 0.000
#> GSM25528     1  0.4079     0.7540 0.800 0.020 0.180 0.000
#> GSM25529     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25530     1  0.5606    -0.0616 0.500 0.020 0.480 0.000
#> GSM25531     1  0.3991     0.7646 0.808 0.020 0.172 0.000
#> GSM48661     4  0.0707     0.9209 0.000 0.020 0.000 0.980
#> GSM25561     3  0.4134     0.6589 0.260 0.000 0.740 0.000
#> GSM25562     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25563     3  0.2868     0.7788 0.136 0.000 0.864 0.000
#> GSM25564     1  0.1022     0.9123 0.968 0.032 0.000 0.000
#> GSM25565     1  0.1022     0.9123 0.968 0.032 0.000 0.000
#> GSM25566     1  0.1022     0.9123 0.968 0.032 0.000 0.000
#> GSM25568     4  0.0592     0.9275 0.000 0.016 0.000 0.984
#> GSM25569     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM25552     1  0.1022     0.9123 0.968 0.032 0.000 0.000
#> GSM25553     1  0.1022     0.9123 0.968 0.032 0.000 0.000
#> GSM25578     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25579     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25580     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25581     1  0.0707     0.9147 0.980 0.020 0.000 0.000
#> GSM48655     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM48656     4  0.0707     0.9209 0.000 0.020 0.000 0.980
#> GSM48657     4  0.0336     0.9341 0.000 0.008 0.000 0.992
#> GSM48658     4  0.1520     0.9011 0.020 0.024 0.000 0.956
#> GSM25624     4  0.6108     0.1449 0.424 0.048 0.000 0.528
#> GSM25625     3  0.0469     0.8478 0.000 0.012 0.988 0.000
#> GSM25626     3  0.0000     0.8566 0.000 0.000 1.000 0.000
#> GSM25627     4  0.5393     0.5251 0.268 0.044 0.000 0.688
#> GSM25628     3  0.0000     0.8566 0.000 0.000 1.000 0.000
#> GSM25629     1  0.4954     0.6928 0.772 0.020 0.028 0.180
#> GSM25630     3  0.0000     0.8566 0.000 0.000 1.000 0.000
#> GSM25631     1  0.1211     0.9133 0.960 0.040 0.000 0.000
#> GSM25632     3  0.0000     0.8566 0.000 0.000 1.000 0.000
#> GSM25633     1  0.0707     0.9147 0.980 0.020 0.000 0.000
#> GSM25634     1  0.0707     0.9147 0.980 0.020 0.000 0.000
#> GSM25635     1  0.0707     0.9147 0.980 0.020 0.000 0.000
#> GSM25656     3  0.2011     0.8177 0.080 0.000 0.920 0.000
#> GSM25657     1  0.0707     0.9147 0.980 0.020 0.000 0.000
#> GSM25658     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25659     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25660     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25661     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25662     1  0.2973     0.8242 0.856 0.144 0.000 0.000
#> GSM25663     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM25680     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25681     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25682     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25683     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25684     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25685     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25686     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM25687     2  0.0707     0.9416 0.020 0.980 0.000 0.000
#> GSM48664     1  0.0000     0.9209 1.000 0.000 0.000 0.000
#> GSM48665     1  0.0000     0.9209 1.000 0.000 0.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
#> GSM25548     5  0.2424     0.7824 0.000 0.000 0.000 0.132 0.868
#> GSM25549     4  0.4972     0.9342 0.068 0.000 0.000 0.672 0.260
#> GSM25550     4  0.4995     0.9352 0.068 0.000 0.000 0.668 0.264
#> GSM25551     5  0.0000     0.9772 0.000 0.000 0.000 0.000 1.000
#> GSM25570     4  0.4484     0.8394 0.024 0.000 0.000 0.668 0.308
#> GSM25571     5  0.0000     0.9772 0.000 0.000 0.000 0.000 1.000
#> GSM25358     1  0.4791     0.7220 0.740 0.000 0.072 0.176 0.012
#> GSM25359     1  0.4444     0.7247 0.748 0.000 0.072 0.180 0.000
#> GSM25360     3  0.0162     0.7683 0.000 0.000 0.996 0.004 0.000
#> GSM25361     1  0.3003     0.7619 0.812 0.000 0.000 0.188 0.000
#> GSM25377     1  0.2017     0.7467 0.912 0.000 0.000 0.080 0.008
#> GSM25378     1  0.6376     0.2079 0.516 0.000 0.000 0.264 0.220
#> GSM25401     1  0.2843     0.7031 0.848 0.000 0.000 0.144 0.008
#> GSM25402     1  0.3075     0.7370 0.860 0.000 0.000 0.092 0.048
#> GSM25349     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM25350     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM25356     4  0.5887     0.7975 0.156 0.000 0.000 0.592 0.252
#> GSM25357     5  0.0000     0.9772 0.000 0.000 0.000 0.000 1.000
#> GSM25385     3  0.4662     0.6992 0.096 0.000 0.736 0.168 0.000
#> GSM25386     3  0.0000     0.7689 0.000 0.000 1.000 0.000 0.000
#> GSM25399     1  0.0324     0.7824 0.992 0.000 0.000 0.004 0.004
#> GSM25400     1  0.1041     0.7822 0.964 0.000 0.000 0.032 0.004
#> GSM48659     2  0.3143     0.6780 0.000 0.796 0.000 0.000 0.204
#> GSM48660     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM25409     1  0.4429     0.6064 0.744 0.000 0.000 0.192 0.064
#> GSM25410     3  0.0000     0.7689 0.000 0.000 1.000 0.000 0.000
#> GSM25426     5  0.0000     0.9772 0.000 0.000 0.000 0.000 1.000
#> GSM25427     1  0.5820     0.4552 0.612 0.000 0.000 0.196 0.192
#> GSM25540     1  0.3710     0.7549 0.784 0.000 0.024 0.192 0.000
#> GSM25541     1  0.3003     0.7619 0.812 0.000 0.000 0.188 0.000
#> GSM25542     1  0.7418     0.1814 0.384 0.320 0.032 0.264 0.000
#> GSM25543     1  0.6436     0.4410 0.504 0.232 0.000 0.264 0.000
#> GSM25479     1  0.1502     0.7601 0.940 0.000 0.000 0.056 0.004
#> GSM25480     1  0.1892     0.7461 0.916 0.000 0.000 0.080 0.004
#> GSM25481     4  0.5028     0.9332 0.072 0.000 0.000 0.668 0.260
#> GSM25482     4  0.4995     0.9352 0.068 0.000 0.000 0.668 0.264
#> GSM48654     2  0.2012     0.8658 0.060 0.920 0.000 0.020 0.000
#> GSM48650     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM48651     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM48652     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM48653     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM48662     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM48663     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM25524     1  0.3109     0.7622 0.800 0.000 0.000 0.200 0.000
#> GSM25525     1  0.2997     0.6975 0.840 0.000 0.000 0.148 0.012
#> GSM25526     3  0.6052     0.5478 0.248 0.000 0.572 0.180 0.000
#> GSM25527     1  0.2813     0.7652 0.832 0.000 0.000 0.168 0.000
#> GSM25528     1  0.4960     0.6891 0.708 0.000 0.112 0.180 0.000
#> GSM25529     1  0.2648     0.7704 0.848 0.000 0.000 0.152 0.000
#> GSM25530     3  0.6349     0.2383 0.360 0.000 0.472 0.168 0.000
#> GSM25531     1  0.4502     0.7226 0.744 0.000 0.076 0.180 0.000
#> GSM48661     2  0.2915     0.8027 0.116 0.860 0.000 0.024 0.000
#> GSM25561     3  0.5258     0.6736 0.140 0.000 0.680 0.180 0.000
#> GSM25562     1  0.0162     0.7817 0.996 0.000 0.000 0.004 0.000
#> GSM25563     3  0.5218     0.6762 0.136 0.000 0.684 0.180 0.000
#> GSM25564     1  0.4455     0.6077 0.744 0.000 0.000 0.188 0.068
#> GSM25565     1  0.7803     0.2024 0.484 0.144 0.000 0.192 0.180
#> GSM25566     1  0.6286     0.4686 0.640 0.060 0.000 0.192 0.108
#> GSM25568     2  0.2012     0.8658 0.060 0.920 0.000 0.020 0.000
#> GSM25569     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM25552     1  0.4547     0.6008 0.736 0.000 0.000 0.192 0.072
#> GSM25553     1  0.4036     0.6584 0.788 0.000 0.000 0.144 0.068
#> GSM25578     1  0.0000     0.7823 1.000 0.000 0.000 0.000 0.000
#> GSM25579     1  0.0162     0.7817 0.996 0.000 0.000 0.004 0.000
#> GSM25580     1  0.0000     0.7823 1.000 0.000 0.000 0.000 0.000
#> GSM25581     1  0.2773     0.7666 0.836 0.000 0.000 0.164 0.000
#> GSM48655     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM48656     2  0.2012     0.8658 0.060 0.920 0.000 0.020 0.000
#> GSM48657     2  0.0510     0.9115 0.000 0.984 0.000 0.000 0.016
#> GSM48658     2  0.4884     0.6925 0.128 0.720 0.000 0.152 0.000
#> GSM25624     1  0.5737     0.0422 0.460 0.456 0.000 0.084 0.000
#> GSM25625     3  0.1502     0.7425 0.004 0.000 0.940 0.056 0.000
#> GSM25626     3  0.0000     0.7689 0.000 0.000 1.000 0.000 0.000
#> GSM25627     2  0.6180     0.4398 0.220 0.556 0.000 0.224 0.000
#> GSM25628     3  0.0000     0.7689 0.000 0.000 1.000 0.000 0.000
#> GSM25629     1  0.4960     0.6776 0.668 0.064 0.000 0.268 0.000
#> GSM25630     3  0.0000     0.7689 0.000 0.000 1.000 0.000 0.000
#> GSM25631     1  0.3750     0.7428 0.756 0.012 0.000 0.232 0.000
#> GSM25632     3  0.0000     0.7689 0.000 0.000 1.000 0.000 0.000
#> GSM25633     1  0.2966     0.7635 0.816 0.000 0.000 0.184 0.000
#> GSM25634     1  0.3039     0.7660 0.808 0.000 0.000 0.192 0.000
#> GSM25635     1  0.3177     0.7572 0.792 0.000 0.000 0.208 0.000
#> GSM25656     3  0.5440     0.6580 0.156 0.000 0.660 0.184 0.000
#> GSM25657     1  0.0703     0.7839 0.976 0.000 0.000 0.024 0.000
#> GSM25658     1  0.0579     0.7811 0.984 0.000 0.000 0.008 0.008
#> GSM25659     1  0.2563     0.7137 0.872 0.000 0.000 0.120 0.008
#> GSM25660     1  0.0000     0.7823 1.000 0.000 0.000 0.000 0.000
#> GSM25661     1  0.0324     0.7814 0.992 0.000 0.000 0.004 0.004
#> GSM25662     1  0.4928     0.5612 0.692 0.004 0.008 0.040 0.256
#> GSM25663     1  0.3039     0.7639 0.808 0.000 0.000 0.192 0.000
#> GSM25680     5  0.0290     0.9682 0.000 0.000 0.000 0.008 0.992
#> GSM25681     5  0.1121     0.9218 0.000 0.000 0.000 0.044 0.956
#> GSM25682     5  0.0000     0.9772 0.000 0.000 0.000 0.000 1.000
#> GSM25683     5  0.0000     0.9772 0.000 0.000 0.000 0.000 1.000
#> GSM25684     5  0.0000     0.9772 0.000 0.000 0.000 0.000 1.000
#> GSM25685     5  0.0000     0.9772 0.000 0.000 0.000 0.000 1.000
#> GSM25686     5  0.0000     0.9772 0.000 0.000 0.000 0.000 1.000
#> GSM25687     5  0.0000     0.9772 0.000 0.000 0.000 0.000 1.000
#> GSM48664     1  0.0451     0.7817 0.988 0.000 0.000 0.008 0.004
#> GSM48665     1  0.0324     0.7814 0.992 0.000 0.000 0.004 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
#> GSM25548     5  0.1556   0.735149 0.000 0.000 0.000 0.080 0.920 0.000
#> GSM25549     5  0.4338   0.593351 0.000 0.000 0.000 0.484 0.496 0.020
#> GSM25550     5  0.4338   0.593351 0.000 0.000 0.000 0.484 0.496 0.020
#> GSM25551     5  0.0000   0.751679 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25570     5  0.4337   0.595014 0.000 0.000 0.000 0.480 0.500 0.020
#> GSM25571     5  0.0000   0.751679 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25358     4  0.5304   0.408410 0.388 0.000 0.004 0.516 0.000 0.092
#> GSM25359     4  0.5397   0.419885 0.384 0.000 0.008 0.516 0.000 0.092
#> GSM25360     3  0.1967   0.893915 0.000 0.000 0.904 0.084 0.000 0.012
#> GSM25361     1  0.5241   0.209159 0.568 0.000 0.000 0.312 0.000 0.120
#> GSM25377     1  0.0603   0.732509 0.980 0.000 0.000 0.000 0.004 0.016
#> GSM25378     5  0.5811   0.274982 0.360 0.000 0.000 0.136 0.492 0.012
#> GSM25401     1  0.2776   0.676410 0.860 0.000 0.000 0.052 0.088 0.000
#> GSM25402     1  0.4756   0.555765 0.696 0.000 0.000 0.060 0.216 0.028
#> GSM25349     2  0.0000   0.915257 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25350     2  0.0000   0.915257 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25356     5  0.5550   0.575281 0.088 0.000 0.000 0.400 0.496 0.016
#> GSM25357     5  0.0000   0.751679 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25385     4  0.5745   0.472078 0.036 0.000 0.388 0.500 0.000 0.076
#> GSM25386     3  0.0260   0.962616 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM25399     1  0.1010   0.733085 0.960 0.000 0.000 0.004 0.000 0.036
#> GSM25400     1  0.3327   0.645851 0.820 0.000 0.000 0.092 0.000 0.088
#> GSM48659     2  0.5152  -0.000294 0.000 0.468 0.000 0.000 0.448 0.084
#> GSM48660     2  0.0000   0.915257 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25409     1  0.4313   0.594623 0.728 0.000 0.000 0.148 0.124 0.000
#> GSM25410     3  0.0260   0.962616 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM25426     5  0.0000   0.751679 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25427     5  0.5664   0.225253 0.384 0.000 0.000 0.112 0.492 0.012
#> GSM25540     4  0.5589   0.419900 0.380 0.000 0.012 0.504 0.000 0.104
#> GSM25541     1  0.4791   0.422358 0.652 0.000 0.000 0.244 0.000 0.104
#> GSM25542     6  0.4980   0.592052 0.132 0.120 0.012 0.020 0.000 0.716
#> GSM25543     6  0.4712   0.389296 0.288 0.040 0.000 0.020 0.000 0.652
#> GSM25479     1  0.0622   0.731781 0.980 0.000 0.000 0.008 0.000 0.012
#> GSM25480     1  0.0820   0.729175 0.972 0.000 0.000 0.016 0.000 0.012
#> GSM25481     5  0.4338   0.593351 0.000 0.000 0.000 0.484 0.496 0.020
#> GSM25482     5  0.4338   0.593351 0.000 0.000 0.000 0.484 0.496 0.020
#> GSM48654     6  0.3659   0.483838 0.000 0.364 0.000 0.000 0.000 0.636
#> GSM48650     2  0.0000   0.915257 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48651     2  0.0000   0.915257 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48652     2  0.0000   0.915257 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48653     2  0.0000   0.915257 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48662     2  0.0000   0.915257 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM48663     2  0.0000   0.915257 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM25524     1  0.5201  -0.118102 0.500 0.000 0.000 0.408 0.000 0.092
#> GSM25525     1  0.3660   0.649318 0.800 0.000 0.000 0.096 0.100 0.004
#> GSM25526     4  0.6077   0.563558 0.056 0.000 0.336 0.516 0.000 0.092
#> GSM25527     1  0.4414   0.508724 0.704 0.000 0.000 0.204 0.000 0.092
#> GSM25528     4  0.6116   0.508977 0.332 0.000 0.060 0.516 0.000 0.092
#> GSM25529     1  0.4570   0.468255 0.680 0.000 0.000 0.228 0.000 0.092
#> GSM25530     4  0.6309   0.566762 0.104 0.000 0.328 0.500 0.000 0.068
#> GSM25531     4  0.5909   0.471441 0.356 0.000 0.040 0.512 0.000 0.092
#> GSM48661     6  0.3531   0.527423 0.000 0.328 0.000 0.000 0.000 0.672
#> GSM25561     4  0.5798   0.528268 0.032 0.000 0.360 0.516 0.000 0.092
#> GSM25562     1  0.0000   0.734410 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM25563     4  0.5691   0.507131 0.024 0.000 0.372 0.512 0.000 0.092
#> GSM25564     1  0.4390   0.587426 0.720 0.000 0.000 0.148 0.132 0.000
#> GSM25565     5  0.6385   0.117259 0.400 0.044 0.000 0.140 0.416 0.000
#> GSM25566     1  0.6159   0.276579 0.536 0.040 0.000 0.152 0.272 0.000
#> GSM25568     6  0.3659   0.483838 0.000 0.364 0.000 0.000 0.000 0.636
#> GSM25569     2  0.1610   0.841542 0.000 0.916 0.000 0.000 0.000 0.084
#> GSM25552     1  0.4348   0.592163 0.724 0.000 0.000 0.152 0.124 0.000
#> GSM25553     1  0.3873   0.627237 0.772 0.000 0.000 0.124 0.104 0.000
#> GSM25578     1  0.0146   0.734353 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM25579     1  0.0146   0.734353 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM25580     1  0.0146   0.734393 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM25581     1  0.4520   0.482356 0.688 0.000 0.000 0.220 0.000 0.092
#> GSM48655     2  0.2060   0.830110 0.000 0.900 0.000 0.000 0.016 0.084
#> GSM48656     6  0.3659   0.483838 0.000 0.364 0.000 0.000 0.000 0.636
#> GSM48657     2  0.0363   0.907264 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM48658     6  0.1610   0.593804 0.000 0.084 0.000 0.000 0.000 0.916
#> GSM25624     6  0.5166   0.276085 0.384 0.092 0.000 0.000 0.000 0.524
#> GSM25625     3  0.2488   0.874182 0.000 0.000 0.880 0.076 0.000 0.044
#> GSM25626     3  0.0000   0.963598 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25627     6  0.1745   0.599827 0.012 0.068 0.000 0.000 0.000 0.920
#> GSM25628     3  0.0000   0.963598 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25629     6  0.5712   0.095223 0.328 0.012 0.004 0.116 0.000 0.540
#> GSM25630     3  0.0000   0.963598 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25631     1  0.5222   0.364042 0.584 0.000 0.000 0.128 0.000 0.288
#> GSM25632     3  0.0000   0.963598 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM25633     1  0.4707   0.484358 0.676 0.000 0.000 0.204 0.000 0.120
#> GSM25634     1  0.4001   0.603228 0.760 0.000 0.000 0.112 0.000 0.128
#> GSM25635     1  0.5399   0.073357 0.528 0.000 0.000 0.344 0.000 0.128
#> GSM25656     4  0.5865   0.529800 0.032 0.000 0.356 0.512 0.000 0.100
#> GSM25657     1  0.3006   0.661959 0.844 0.000 0.000 0.064 0.000 0.092
#> GSM25658     1  0.0146   0.734353 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM25659     1  0.0909   0.727678 0.968 0.000 0.000 0.020 0.000 0.012
#> GSM25660     1  0.0146   0.734393 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM25661     1  0.0458   0.732495 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM25662     5  0.6376   0.189891 0.336 0.004 0.004 0.056 0.504 0.096
#> GSM25663     1  0.4358   0.520582 0.712 0.000 0.000 0.196 0.000 0.092
#> GSM25680     5  0.0000   0.751679 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25681     5  0.0632   0.747918 0.000 0.000 0.000 0.024 0.976 0.000
#> GSM25682     5  0.0000   0.751679 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25683     5  0.0000   0.751679 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25684     5  0.0000   0.751679 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25685     5  0.0000   0.751679 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25686     5  0.0000   0.751679 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM25687     5  0.0000   0.751679 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM48664     1  0.0458   0.732495 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM48665     1  0.0458   0.732495 0.984 0.000 0.000 0.000 0.000 0.016

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 genotype/variation(p) k
#> ATC:mclust 99              3.10e-08 2
#> ATC:mclust 89              1.82e-12 3
#> ATC:mclust 94              4.94e-12 4
#> ATC:mclust 91              2.60e-13 5
#> ATC:mclust 75              4.12e-13 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 8353 rows and 100 columns.
#>   Top rows (835, 1670, 2506, 3341, 4176) are extracted by 'ATC' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk ATC-NMF-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.898           0.905       0.962         0.4728 0.515   0.515
#> 3 3 0.832           0.889       0.944         0.4016 0.708   0.490
#> 4 4 0.759           0.818       0.896         0.1328 0.845   0.580
#> 5 5 0.666           0.631       0.788         0.0577 0.915   0.682
#> 6 6 0.680           0.568       0.755         0.0452 0.903   0.583

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
#> GSM25548     2  0.0000     0.9833 0.000 1.000
#> GSM25549     2  0.0000     0.9833 0.000 1.000
#> GSM25550     2  0.0000     0.9833 0.000 1.000
#> GSM25551     2  0.0000     0.9833 0.000 1.000
#> GSM25570     2  0.0000     0.9833 0.000 1.000
#> GSM25571     2  0.0000     0.9833 0.000 1.000
#> GSM25358     1  0.0000     0.9217 1.000 0.000
#> GSM25359     1  0.0000     0.9217 1.000 0.000
#> GSM25360     1  0.0000     0.9217 1.000 0.000
#> GSM25361     1  0.0000     0.9217 1.000 0.000
#> GSM25377     2  0.0000     0.9833 0.000 1.000
#> GSM25378     2  0.0000     0.9833 0.000 1.000
#> GSM25401     2  0.0000     0.9833 0.000 1.000
#> GSM25402     2  0.0000     0.9833 0.000 1.000
#> GSM25349     2  0.0000     0.9833 0.000 1.000
#> GSM25350     2  0.0000     0.9833 0.000 1.000
#> GSM25356     2  0.0000     0.9833 0.000 1.000
#> GSM25357     2  0.0000     0.9833 0.000 1.000
#> GSM25385     1  0.0000     0.9217 1.000 0.000
#> GSM25386     1  0.0000     0.9217 1.000 0.000
#> GSM25399     1  1.0000     0.1149 0.500 0.500
#> GSM25400     1  0.9754     0.3941 0.592 0.408
#> GSM48659     2  0.0000     0.9833 0.000 1.000
#> GSM48660     2  0.0000     0.9833 0.000 1.000
#> GSM25409     2  0.0000     0.9833 0.000 1.000
#> GSM25410     1  0.0000     0.9217 1.000 0.000
#> GSM25426     2  0.0000     0.9833 0.000 1.000
#> GSM25427     2  0.0000     0.9833 0.000 1.000
#> GSM25540     1  0.0000     0.9217 1.000 0.000
#> GSM25541     1  0.0000     0.9217 1.000 0.000
#> GSM25542     1  0.0376     0.9198 0.996 0.004
#> GSM25543     1  0.3584     0.8742 0.932 0.068
#> GSM25479     2  0.0000     0.9833 0.000 1.000
#> GSM25480     2  0.0000     0.9833 0.000 1.000
#> GSM25481     2  0.0000     0.9833 0.000 1.000
#> GSM25482     2  0.0000     0.9833 0.000 1.000
#> GSM48654     2  0.0000     0.9833 0.000 1.000
#> GSM48650     2  0.0000     0.9833 0.000 1.000
#> GSM48651     2  0.0000     0.9833 0.000 1.000
#> GSM48652     2  0.0000     0.9833 0.000 1.000
#> GSM48653     2  0.0000     0.9833 0.000 1.000
#> GSM48662     2  0.0000     0.9833 0.000 1.000
#> GSM48663     2  0.0000     0.9833 0.000 1.000
#> GSM25524     1  0.0938     0.9150 0.988 0.012
#> GSM25525     2  0.0000     0.9833 0.000 1.000
#> GSM25526     1  0.0000     0.9217 1.000 0.000
#> GSM25527     1  0.0672     0.9175 0.992 0.008
#> GSM25528     1  0.0000     0.9217 1.000 0.000
#> GSM25529     1  0.0000     0.9217 1.000 0.000
#> GSM25530     1  0.0000     0.9217 1.000 0.000
#> GSM25531     1  0.0000     0.9217 1.000 0.000
#> GSM48661     1  0.0000     0.9217 1.000 0.000
#> GSM25561     1  0.0000     0.9217 1.000 0.000
#> GSM25562     2  0.0376     0.9795 0.004 0.996
#> GSM25563     1  0.0000     0.9217 1.000 0.000
#> GSM25564     2  0.0000     0.9833 0.000 1.000
#> GSM25565     2  0.0000     0.9833 0.000 1.000
#> GSM25566     2  0.0000     0.9833 0.000 1.000
#> GSM25568     2  0.0000     0.9833 0.000 1.000
#> GSM25569     2  0.0000     0.9833 0.000 1.000
#> GSM25552     2  0.0000     0.9833 0.000 1.000
#> GSM25553     2  0.0000     0.9833 0.000 1.000
#> GSM25578     2  0.9988    -0.0783 0.480 0.520
#> GSM25579     2  0.0376     0.9795 0.004 0.996
#> GSM25580     1  0.8661     0.6272 0.712 0.288
#> GSM25581     1  0.0000     0.9217 1.000 0.000
#> GSM48655     2  0.0000     0.9833 0.000 1.000
#> GSM48656     2  0.0000     0.9833 0.000 1.000
#> GSM48657     2  0.0000     0.9833 0.000 1.000
#> GSM48658     1  0.9491     0.4856 0.632 0.368
#> GSM25624     2  0.0000     0.9833 0.000 1.000
#> GSM25625     1  0.0000     0.9217 1.000 0.000
#> GSM25626     1  0.0000     0.9217 1.000 0.000
#> GSM25627     1  0.8763     0.6150 0.704 0.296
#> GSM25628     1  0.0000     0.9217 1.000 0.000
#> GSM25629     1  0.0000     0.9217 1.000 0.000
#> GSM25630     1  0.0000     0.9217 1.000 0.000
#> GSM25631     1  0.9983     0.2005 0.524 0.476
#> GSM25632     1  0.0000     0.9217 1.000 0.000
#> GSM25633     1  0.0000     0.9217 1.000 0.000
#> GSM25634     1  0.5294     0.8285 0.880 0.120
#> GSM25635     1  0.0376     0.9198 0.996 0.004
#> GSM25656     1  0.0000     0.9217 1.000 0.000
#> GSM25657     1  0.0000     0.9217 1.000 0.000
#> GSM25658     2  0.2603     0.9359 0.044 0.956
#> GSM25659     2  0.0000     0.9833 0.000 1.000
#> GSM25660     1  0.9608     0.4512 0.616 0.384
#> GSM25661     2  0.0938     0.9714 0.012 0.988
#> GSM25662     2  0.0000     0.9833 0.000 1.000
#> GSM25663     2  0.9209     0.4188 0.336 0.664
#> GSM25680     2  0.0000     0.9833 0.000 1.000
#> GSM25681     2  0.0000     0.9833 0.000 1.000
#> GSM25682     2  0.0000     0.9833 0.000 1.000
#> GSM25683     2  0.0000     0.9833 0.000 1.000
#> GSM25684     2  0.0000     0.9833 0.000 1.000
#> GSM25685     2  0.0000     0.9833 0.000 1.000
#> GSM25686     2  0.0000     0.9833 0.000 1.000
#> GSM25687     2  0.0000     0.9833 0.000 1.000
#> GSM48664     2  0.0000     0.9833 0.000 1.000
#> GSM48665     2  0.0000     0.9833 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
#> GSM25548     2  0.0000      0.955 0.000 1.000 0.000
#> GSM25549     2  0.1529      0.946 0.040 0.960 0.000
#> GSM25550     2  0.1964      0.937 0.056 0.944 0.000
#> GSM25551     2  0.0000      0.955 0.000 1.000 0.000
#> GSM25570     2  0.0747      0.954 0.016 0.984 0.000
#> GSM25571     2  0.0000      0.955 0.000 1.000 0.000
#> GSM25358     3  0.0661      0.943 0.004 0.008 0.988
#> GSM25359     3  0.0475      0.944 0.004 0.004 0.992
#> GSM25360     3  0.0000      0.944 0.000 0.000 1.000
#> GSM25361     1  0.5560      0.597 0.700 0.000 0.300
#> GSM25377     1  0.0424      0.913 0.992 0.008 0.000
#> GSM25378     2  0.5465      0.646 0.288 0.712 0.000
#> GSM25401     1  0.0747      0.910 0.984 0.016 0.000
#> GSM25402     1  0.1163      0.904 0.972 0.028 0.000
#> GSM25349     2  0.3482      0.879 0.128 0.872 0.000
#> GSM25350     2  0.4062      0.841 0.164 0.836 0.000
#> GSM25356     2  0.5591      0.616 0.304 0.696 0.000
#> GSM25357     2  0.0000      0.955 0.000 1.000 0.000
#> GSM25385     3  0.0237      0.944 0.004 0.000 0.996
#> GSM25386     3  0.0000      0.944 0.000 0.000 1.000
#> GSM25399     1  0.0237      0.915 0.996 0.000 0.004
#> GSM25400     1  0.1163      0.911 0.972 0.000 0.028
#> GSM48659     2  0.0237      0.954 0.000 0.996 0.004
#> GSM48660     2  0.0747      0.954 0.016 0.984 0.000
#> GSM25409     1  0.2165      0.878 0.936 0.064 0.000
#> GSM25410     3  0.0424      0.942 0.000 0.008 0.992
#> GSM25426     2  0.0000      0.955 0.000 1.000 0.000
#> GSM25427     1  0.3879      0.791 0.848 0.152 0.000
#> GSM25540     3  0.1529      0.925 0.040 0.000 0.960
#> GSM25541     1  0.3116      0.855 0.892 0.000 0.108
#> GSM25542     3  0.2261      0.903 0.000 0.068 0.932
#> GSM25543     3  0.0747      0.938 0.000 0.016 0.984
#> GSM25479     1  0.0000      0.915 1.000 0.000 0.000
#> GSM25480     1  0.0000      0.915 1.000 0.000 0.000
#> GSM25481     2  0.2537      0.921 0.080 0.920 0.000
#> GSM25482     2  0.1964      0.937 0.056 0.944 0.000
#> GSM48654     2  0.1529      0.930 0.000 0.960 0.040
#> GSM48650     2  0.1289      0.949 0.032 0.968 0.000
#> GSM48651     2  0.1289      0.949 0.032 0.968 0.000
#> GSM48652     2  0.0424      0.955 0.008 0.992 0.000
#> GSM48653     2  0.0747      0.954 0.016 0.984 0.000
#> GSM48662     2  0.0747      0.954 0.016 0.984 0.000
#> GSM48663     2  0.0892      0.953 0.020 0.980 0.000
#> GSM25524     1  0.6291      0.154 0.532 0.000 0.468
#> GSM25525     1  0.0237      0.914 0.996 0.004 0.000
#> GSM25526     3  0.0424      0.943 0.008 0.000 0.992
#> GSM25527     1  0.2448      0.883 0.924 0.000 0.076
#> GSM25528     3  0.3412      0.844 0.124 0.000 0.876
#> GSM25529     1  0.1860      0.898 0.948 0.000 0.052
#> GSM25530     3  0.1643      0.922 0.044 0.000 0.956
#> GSM25531     1  0.5988      0.457 0.632 0.000 0.368
#> GSM48661     3  0.4796      0.738 0.000 0.220 0.780
#> GSM25561     3  0.0424      0.943 0.008 0.000 0.992
#> GSM25562     1  0.0000      0.915 1.000 0.000 0.000
#> GSM25563     3  0.0000      0.944 0.000 0.000 1.000
#> GSM25564     1  0.5621      0.516 0.692 0.308 0.000
#> GSM25565     2  0.1643      0.944 0.044 0.956 0.000
#> GSM25566     2  0.4062      0.840 0.164 0.836 0.000
#> GSM25568     2  0.1411      0.933 0.000 0.964 0.036
#> GSM25569     2  0.0237      0.955 0.004 0.996 0.000
#> GSM25552     1  0.2165      0.878 0.936 0.064 0.000
#> GSM25553     1  0.1163      0.903 0.972 0.028 0.000
#> GSM25578     1  0.0892      0.912 0.980 0.000 0.020
#> GSM25579     1  0.0000      0.915 1.000 0.000 0.000
#> GSM25580     1  0.0892      0.912 0.980 0.000 0.020
#> GSM25581     1  0.2066      0.893 0.940 0.000 0.060
#> GSM48655     2  0.0237      0.954 0.000 0.996 0.004
#> GSM48656     2  0.1170      0.950 0.008 0.976 0.016
#> GSM48657     2  0.0424      0.955 0.008 0.992 0.000
#> GSM48658     3  0.4178      0.795 0.000 0.172 0.828
#> GSM25624     2  0.3686      0.867 0.140 0.860 0.000
#> GSM25625     3  0.0237      0.943 0.000 0.004 0.996
#> GSM25626     3  0.0000      0.944 0.000 0.000 1.000
#> GSM25627     3  0.2261      0.900 0.000 0.068 0.932
#> GSM25628     3  0.0000      0.944 0.000 0.000 1.000
#> GSM25629     3  0.0747      0.940 0.016 0.000 0.984
#> GSM25630     3  0.0237      0.944 0.004 0.000 0.996
#> GSM25631     3  0.6696      0.391 0.348 0.020 0.632
#> GSM25632     3  0.0000      0.944 0.000 0.000 1.000
#> GSM25633     1  0.2448      0.882 0.924 0.000 0.076
#> GSM25634     1  0.1411      0.906 0.964 0.000 0.036
#> GSM25635     3  0.2796      0.880 0.092 0.000 0.908
#> GSM25656     3  0.0237      0.944 0.004 0.000 0.996
#> GSM25657     1  0.1289      0.908 0.968 0.000 0.032
#> GSM25658     1  0.0000      0.915 1.000 0.000 0.000
#> GSM25659     1  0.0237      0.914 0.996 0.004 0.000
#> GSM25660     1  0.1031      0.911 0.976 0.000 0.024
#> GSM25661     1  0.0000      0.915 1.000 0.000 0.000
#> GSM25662     2  0.0424      0.952 0.000 0.992 0.008
#> GSM25663     1  0.6001      0.751 0.772 0.052 0.176
#> GSM25680     2  0.0000      0.955 0.000 1.000 0.000
#> GSM25681     2  0.0000      0.955 0.000 1.000 0.000
#> GSM25682     2  0.0000      0.955 0.000 1.000 0.000
#> GSM25683     2  0.0237      0.954 0.000 0.996 0.004
#> GSM25684     2  0.0000      0.955 0.000 1.000 0.000
#> GSM25685     2  0.0747      0.947 0.000 0.984 0.016
#> GSM25686     2  0.0000      0.955 0.000 1.000 0.000
#> GSM25687     2  0.0000      0.955 0.000 1.000 0.000
#> GSM48664     1  0.0000      0.915 1.000 0.000 0.000
#> GSM48665     1  0.0000      0.915 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM25548     2  0.1474      0.917 0.000 0.948 0.000 0.052
#> GSM25549     2  0.2859      0.869 0.008 0.880 0.000 0.112
#> GSM25550     2  0.1975      0.918 0.016 0.936 0.000 0.048
#> GSM25551     2  0.0921      0.919 0.000 0.972 0.000 0.028
#> GSM25570     2  0.2125      0.904 0.004 0.920 0.000 0.076
#> GSM25571     2  0.1022      0.920 0.000 0.968 0.000 0.032
#> GSM25358     2  0.4050      0.757 0.016 0.824 0.148 0.012
#> GSM25359     2  0.5630      0.345 0.012 0.600 0.376 0.012
#> GSM25360     3  0.0188      0.900 0.004 0.000 0.996 0.000
#> GSM25361     3  0.4872      0.414 0.356 0.000 0.640 0.004
#> GSM25377     1  0.0707      0.886 0.980 0.000 0.000 0.020
#> GSM25378     2  0.1406      0.885 0.024 0.960 0.000 0.016
#> GSM25401     1  0.0779      0.887 0.980 0.004 0.000 0.016
#> GSM25402     2  0.3829      0.762 0.152 0.828 0.004 0.016
#> GSM25349     4  0.1305      0.867 0.036 0.004 0.000 0.960
#> GSM25350     4  0.1398      0.865 0.040 0.004 0.000 0.956
#> GSM25356     2  0.0921      0.895 0.028 0.972 0.000 0.000
#> GSM25357     2  0.1022      0.920 0.000 0.968 0.000 0.032
#> GSM25385     3  0.1821      0.879 0.008 0.032 0.948 0.012
#> GSM25386     3  0.0376      0.900 0.004 0.004 0.992 0.000
#> GSM25399     1  0.0657      0.888 0.984 0.000 0.004 0.012
#> GSM25400     1  0.5546      0.465 0.620 0.356 0.008 0.016
#> GSM48659     2  0.4837      0.451 0.000 0.648 0.004 0.348
#> GSM48660     4  0.3105      0.860 0.004 0.140 0.000 0.856
#> GSM25409     1  0.3215      0.827 0.876 0.032 0.000 0.092
#> GSM25410     3  0.0927      0.893 0.000 0.016 0.976 0.008
#> GSM25426     2  0.0817      0.918 0.000 0.976 0.000 0.024
#> GSM25427     2  0.2924      0.825 0.100 0.884 0.000 0.016
#> GSM25540     3  0.0469      0.899 0.012 0.000 0.988 0.000
#> GSM25541     1  0.3048      0.823 0.876 0.000 0.108 0.016
#> GSM25542     3  0.1004      0.889 0.000 0.004 0.972 0.024
#> GSM25543     3  0.4898      0.221 0.000 0.000 0.584 0.416
#> GSM25479     1  0.0188      0.887 0.996 0.000 0.004 0.000
#> GSM25480     1  0.0376      0.888 0.992 0.000 0.004 0.004
#> GSM25481     2  0.2282      0.911 0.024 0.924 0.000 0.052
#> GSM25482     2  0.2522      0.903 0.016 0.908 0.000 0.076
#> GSM48654     4  0.2224      0.876 0.000 0.032 0.040 0.928
#> GSM48650     4  0.1545      0.888 0.008 0.040 0.000 0.952
#> GSM48651     4  0.2773      0.877 0.004 0.116 0.000 0.880
#> GSM48652     4  0.1978      0.892 0.004 0.068 0.000 0.928
#> GSM48653     4  0.2125      0.891 0.004 0.076 0.000 0.920
#> GSM48662     4  0.2611      0.886 0.008 0.096 0.000 0.896
#> GSM48663     4  0.2831      0.874 0.004 0.120 0.000 0.876
#> GSM25524     1  0.7913      0.344 0.484 0.308 0.192 0.016
#> GSM25525     1  0.4569      0.696 0.760 0.220 0.008 0.012
#> GSM25526     3  0.0672      0.897 0.008 0.000 0.984 0.008
#> GSM25527     1  0.1151      0.884 0.968 0.000 0.024 0.008
#> GSM25528     3  0.4000      0.778 0.144 0.016 0.828 0.012
#> GSM25529     1  0.1262      0.882 0.968 0.008 0.016 0.008
#> GSM25530     3  0.2271      0.868 0.052 0.008 0.928 0.012
#> GSM25531     1  0.5270      0.505 0.660 0.008 0.320 0.012
#> GSM48661     4  0.4454      0.530 0.000 0.000 0.308 0.692
#> GSM25561     3  0.0524      0.898 0.008 0.000 0.988 0.004
#> GSM25562     1  0.1118      0.883 0.964 0.000 0.000 0.036
#> GSM25563     3  0.0188      0.900 0.004 0.000 0.996 0.000
#> GSM25564     1  0.5668      0.195 0.532 0.024 0.000 0.444
#> GSM25565     4  0.3668      0.808 0.004 0.188 0.000 0.808
#> GSM25566     4  0.4829      0.797 0.068 0.156 0.000 0.776
#> GSM25568     4  0.2742      0.889 0.000 0.076 0.024 0.900
#> GSM25569     4  0.2773      0.878 0.000 0.116 0.004 0.880
#> GSM25552     1  0.2032      0.872 0.936 0.028 0.000 0.036
#> GSM25553     1  0.1389      0.878 0.952 0.000 0.000 0.048
#> GSM25578     1  0.0336      0.887 0.992 0.000 0.008 0.000
#> GSM25579     1  0.0657      0.888 0.984 0.000 0.004 0.012
#> GSM25580     1  0.0672      0.887 0.984 0.000 0.008 0.008
#> GSM25581     1  0.0895      0.885 0.976 0.000 0.020 0.004
#> GSM48655     4  0.3142      0.867 0.000 0.132 0.008 0.860
#> GSM48656     4  0.1398      0.863 0.004 0.000 0.040 0.956
#> GSM48657     4  0.0895      0.882 0.004 0.020 0.000 0.976
#> GSM48658     4  0.3791      0.704 0.004 0.000 0.200 0.796
#> GSM25624     4  0.1610      0.862 0.016 0.000 0.032 0.952
#> GSM25625     3  0.0336      0.898 0.000 0.000 0.992 0.008
#> GSM25626     3  0.0336      0.898 0.000 0.000 0.992 0.008
#> GSM25627     4  0.4053      0.662 0.004 0.000 0.228 0.768
#> GSM25628     3  0.0336      0.898 0.000 0.000 0.992 0.008
#> GSM25629     3  0.3539      0.765 0.004 0.000 0.820 0.176
#> GSM25630     3  0.0376      0.900 0.004 0.000 0.992 0.004
#> GSM25631     3  0.6050      0.222 0.044 0.000 0.524 0.432
#> GSM25632     3  0.0376      0.900 0.004 0.000 0.992 0.004
#> GSM25633     1  0.3548      0.830 0.864 0.000 0.068 0.068
#> GSM25634     1  0.4907      0.745 0.764 0.000 0.060 0.176
#> GSM25635     3  0.3143      0.830 0.024 0.000 0.876 0.100
#> GSM25656     3  0.0188      0.899 0.000 0.000 0.996 0.004
#> GSM25657     1  0.1042      0.886 0.972 0.000 0.008 0.020
#> GSM25658     1  0.0859      0.884 0.980 0.004 0.008 0.008
#> GSM25659     1  0.0188      0.888 0.996 0.000 0.000 0.004
#> GSM25660     1  0.0992      0.883 0.976 0.012 0.008 0.004
#> GSM25661     1  0.0592      0.887 0.984 0.000 0.000 0.016
#> GSM25662     2  0.1302      0.919 0.000 0.956 0.000 0.044
#> GSM25663     1  0.7377      0.422 0.552 0.300 0.132 0.016
#> GSM25680     2  0.1211      0.920 0.000 0.960 0.000 0.040
#> GSM25681     2  0.1022      0.920 0.000 0.968 0.000 0.032
#> GSM25682     2  0.1302      0.919 0.000 0.956 0.000 0.044
#> GSM25683     2  0.0817      0.918 0.000 0.976 0.000 0.024
#> GSM25684     2  0.1389      0.918 0.000 0.952 0.000 0.048
#> GSM25685     2  0.1022      0.920 0.000 0.968 0.000 0.032
#> GSM25686     2  0.1716      0.912 0.000 0.936 0.000 0.064
#> GSM25687     2  0.1716      0.912 0.000 0.936 0.000 0.064
#> GSM48664     1  0.1022      0.884 0.968 0.000 0.000 0.032
#> GSM48665     1  0.1389      0.879 0.952 0.000 0.000 0.048

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM25548     4  0.2331    0.86257 0.000 0.020 0.000 0.900 0.080
#> GSM25549     4  0.2969    0.83798 0.000 0.128 0.000 0.852 0.020
#> GSM25550     4  0.2331    0.86626 0.000 0.080 0.000 0.900 0.020
#> GSM25551     4  0.1638    0.85503 0.000 0.004 0.000 0.932 0.064
#> GSM25570     4  0.2580    0.86934 0.000 0.064 0.000 0.892 0.044
#> GSM25571     4  0.2006    0.86137 0.000 0.012 0.000 0.916 0.072
#> GSM25358     4  0.5601    0.68425 0.032 0.028 0.104 0.736 0.100
#> GSM25359     3  0.4185    0.62462 0.008 0.008 0.732 0.248 0.004
#> GSM25360     3  0.0290    0.91393 0.000 0.000 0.992 0.000 0.008
#> GSM25361     3  0.3516    0.78392 0.108 0.052 0.836 0.000 0.004
#> GSM25377     1  0.3403    0.55921 0.820 0.160 0.000 0.008 0.012
#> GSM25378     4  0.4405    0.75048 0.052 0.028 0.000 0.788 0.132
#> GSM25401     1  0.5594    0.44928 0.696 0.192 0.004 0.072 0.036
#> GSM25402     4  0.4699    0.67107 0.216 0.036 0.008 0.732 0.008
#> GSM25349     2  0.2011    0.66426 0.044 0.928 0.000 0.020 0.008
#> GSM25350     2  0.2228    0.66137 0.056 0.916 0.000 0.020 0.008
#> GSM25356     4  0.2720    0.84831 0.020 0.096 0.000 0.880 0.004
#> GSM25357     4  0.1544    0.86824 0.000 0.068 0.000 0.932 0.000
#> GSM25385     3  0.0486    0.91404 0.004 0.000 0.988 0.004 0.004
#> GSM25386     3  0.0727    0.91227 0.004 0.000 0.980 0.004 0.012
#> GSM25399     1  0.2623    0.59640 0.884 0.096 0.004 0.000 0.016
#> GSM25400     1  0.5560    0.14038 0.508 0.024 0.000 0.440 0.028
#> GSM48659     4  0.6114    0.14445 0.000 0.376 0.000 0.492 0.132
#> GSM48660     2  0.3563    0.65417 0.000 0.780 0.000 0.208 0.012
#> GSM25409     2  0.6381    0.13791 0.428 0.436 0.000 0.128 0.008
#> GSM25410     3  0.0727    0.91227 0.004 0.000 0.980 0.004 0.012
#> GSM25426     4  0.2068    0.85771 0.000 0.092 0.000 0.904 0.004
#> GSM25427     4  0.3518    0.80434 0.104 0.048 0.000 0.840 0.008
#> GSM25540     3  0.0693    0.91306 0.008 0.000 0.980 0.000 0.012
#> GSM25541     1  0.4185    0.61766 0.816 0.040 0.072 0.000 0.072
#> GSM25542     3  0.1082    0.90223 0.000 0.008 0.964 0.000 0.028
#> GSM25543     3  0.4394    0.69219 0.016 0.196 0.756 0.000 0.032
#> GSM25479     1  0.4589    0.53250 0.660 0.004 0.000 0.020 0.316
#> GSM25480     1  0.4669    0.53633 0.664 0.008 0.000 0.020 0.308
#> GSM25481     4  0.3360    0.78609 0.012 0.168 0.000 0.816 0.004
#> GSM25482     4  0.2583    0.83233 0.000 0.132 0.000 0.864 0.004
#> GSM48654     2  0.5208    0.15133 0.000 0.544 0.024 0.012 0.420
#> GSM48650     2  0.1992    0.68217 0.000 0.924 0.000 0.044 0.032
#> GSM48651     2  0.3053    0.67639 0.000 0.828 0.000 0.164 0.008
#> GSM48652     2  0.3800    0.65746 0.000 0.812 0.000 0.080 0.108
#> GSM48653     2  0.3090    0.68452 0.000 0.860 0.000 0.088 0.052
#> GSM48662     2  0.2124    0.69162 0.000 0.900 0.000 0.096 0.004
#> GSM48663     2  0.3461    0.67041 0.016 0.812 0.000 0.168 0.004
#> GSM25524     1  0.7588    0.17003 0.388 0.028 0.012 0.352 0.220
#> GSM25525     5  0.6961   -0.01358 0.300 0.020 0.000 0.208 0.472
#> GSM25526     5  0.5884    0.40139 0.012 0.016 0.284 0.064 0.624
#> GSM25527     5  0.4249    0.34493 0.296 0.000 0.000 0.016 0.688
#> GSM25528     3  0.6000    0.16492 0.360 0.008 0.536 0.000 0.096
#> GSM25529     1  0.5104    0.50481 0.632 0.016 0.000 0.028 0.324
#> GSM25530     3  0.0898    0.91035 0.020 0.000 0.972 0.000 0.008
#> GSM25531     1  0.5365    0.55480 0.708 0.008 0.112 0.008 0.164
#> GSM48661     5  0.5663    0.14059 0.000 0.412 0.080 0.000 0.508
#> GSM25561     3  0.0324    0.91459 0.004 0.000 0.992 0.004 0.000
#> GSM25562     1  0.2648    0.57393 0.848 0.152 0.000 0.000 0.000
#> GSM25563     3  0.0324    0.91459 0.004 0.000 0.992 0.004 0.000
#> GSM25564     2  0.5827    0.21582 0.408 0.520 0.000 0.052 0.020
#> GSM25565     2  0.5605    0.57595 0.132 0.660 0.000 0.200 0.008
#> GSM25566     2  0.5716    0.56222 0.156 0.660 0.000 0.172 0.012
#> GSM25568     2  0.4706    0.63277 0.000 0.768 0.024 0.080 0.128
#> GSM25569     2  0.3865    0.66720 0.000 0.808 0.000 0.100 0.092
#> GSM25552     1  0.6284    0.14422 0.544 0.316 0.000 0.128 0.012
#> GSM25553     1  0.5129    0.38676 0.672 0.264 0.000 0.052 0.012
#> GSM25578     1  0.3890    0.59231 0.736 0.000 0.000 0.012 0.252
#> GSM25579     1  0.3352    0.62070 0.800 0.004 0.000 0.004 0.192
#> GSM25580     1  0.4151    0.50901 0.652 0.000 0.000 0.004 0.344
#> GSM25581     1  0.4059    0.56171 0.700 0.000 0.004 0.004 0.292
#> GSM48655     2  0.5770    0.32107 0.000 0.532 0.000 0.096 0.372
#> GSM48656     2  0.4557   -0.00899 0.000 0.516 0.008 0.000 0.476
#> GSM48657     2  0.4201    0.19701 0.000 0.592 0.000 0.000 0.408
#> GSM48658     5  0.4677    0.46663 0.000 0.300 0.036 0.000 0.664
#> GSM25624     5  0.3365    0.59693 0.008 0.180 0.004 0.000 0.808
#> GSM25625     3  0.0880    0.90189 0.000 0.000 0.968 0.000 0.032
#> GSM25626     3  0.0510    0.91136 0.000 0.000 0.984 0.000 0.016
#> GSM25627     5  0.4822    0.48241 0.000 0.288 0.048 0.000 0.664
#> GSM25628     3  0.0162    0.91438 0.000 0.000 0.996 0.000 0.004
#> GSM25629     5  0.5128    0.60210 0.008 0.168 0.112 0.000 0.712
#> GSM25630     3  0.0162    0.91474 0.000 0.000 0.996 0.000 0.004
#> GSM25631     5  0.3530    0.64383 0.024 0.104 0.028 0.000 0.844
#> GSM25632     3  0.0609    0.90967 0.000 0.000 0.980 0.000 0.020
#> GSM25633     5  0.4735    0.38058 0.304 0.024 0.008 0.000 0.664
#> GSM25634     5  0.4952    0.52744 0.216 0.068 0.008 0.000 0.708
#> GSM25635     5  0.3105    0.61457 0.064 0.012 0.036 0.008 0.880
#> GSM25656     3  0.0290    0.91440 0.000 0.000 0.992 0.000 0.008
#> GSM25657     1  0.2879    0.63393 0.868 0.032 0.000 0.000 0.100
#> GSM25658     1  0.4573    0.59522 0.728 0.020 0.000 0.024 0.228
#> GSM25659     1  0.3966    0.60576 0.756 0.008 0.000 0.012 0.224
#> GSM25660     1  0.4839    0.53409 0.660 0.012 0.000 0.024 0.304
#> GSM25661     1  0.2344    0.63288 0.904 0.032 0.000 0.000 0.064
#> GSM25662     4  0.2873    0.81994 0.000 0.016 0.000 0.856 0.128
#> GSM25663     1  0.7752    0.08073 0.340 0.016 0.328 0.292 0.024
#> GSM25680     4  0.2193    0.87220 0.000 0.060 0.000 0.912 0.028
#> GSM25681     4  0.1522    0.86647 0.000 0.012 0.000 0.944 0.044
#> GSM25682     4  0.1430    0.87150 0.000 0.052 0.000 0.944 0.004
#> GSM25683     4  0.0963    0.87191 0.000 0.036 0.000 0.964 0.000
#> GSM25684     4  0.2172    0.86141 0.000 0.016 0.000 0.908 0.076
#> GSM25685     4  0.2818    0.81578 0.000 0.012 0.000 0.856 0.132
#> GSM25686     4  0.1544    0.86809 0.000 0.068 0.000 0.932 0.000
#> GSM25687     4  0.1704    0.86820 0.000 0.068 0.000 0.928 0.004
#> GSM48664     1  0.1952    0.60923 0.912 0.084 0.000 0.000 0.004
#> GSM48665     1  0.2423    0.61818 0.896 0.080 0.000 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
#> GSM25548     5  0.4935     0.1527 0.000 0.040 0.000 0.012 0.524 0.424
#> GSM25549     6  0.4280     0.5495 0.000 0.044 0.000 0.012 0.228 0.716
#> GSM25550     6  0.4760     0.2850 0.000 0.040 0.000 0.008 0.376 0.576
#> GSM25551     5  0.2294     0.7092 0.000 0.008 0.000 0.020 0.896 0.076
#> GSM25570     6  0.4845     0.2316 0.000 0.044 0.000 0.008 0.388 0.560
#> GSM25571     5  0.4505     0.4958 0.000 0.032 0.000 0.020 0.676 0.272
#> GSM25358     5  0.3911     0.6353 0.016 0.000 0.040 0.072 0.820 0.052
#> GSM25359     3  0.3192     0.7298 0.000 0.000 0.776 0.004 0.216 0.004
#> GSM25360     3  0.1074     0.9303 0.000 0.000 0.960 0.028 0.000 0.012
#> GSM25361     6  0.4154     0.5102 0.008 0.004 0.244 0.028 0.000 0.716
#> GSM25377     1  0.3342     0.5550 0.836 0.092 0.000 0.008 0.004 0.060
#> GSM25378     5  0.4339     0.6181 0.048 0.008 0.000 0.092 0.784 0.068
#> GSM25401     1  0.3573     0.5292 0.832 0.100 0.012 0.004 0.012 0.040
#> GSM25402     1  0.5209     0.4378 0.696 0.044 0.016 0.028 0.204 0.012
#> GSM25349     2  0.3545     0.7011 0.036 0.824 0.000 0.012 0.012 0.116
#> GSM25350     2  0.5237     0.1998 0.032 0.548 0.000 0.020 0.012 0.388
#> GSM25356     5  0.4223     0.6647 0.124 0.064 0.000 0.008 0.780 0.024
#> GSM25357     5  0.1777     0.7200 0.000 0.044 0.000 0.004 0.928 0.024
#> GSM25385     3  0.2118     0.9060 0.020 0.000 0.920 0.016 0.036 0.008
#> GSM25386     3  0.0436     0.9314 0.004 0.000 0.988 0.004 0.004 0.000
#> GSM25399     1  0.2186     0.5931 0.916 0.016 0.008 0.008 0.004 0.048
#> GSM25400     1  0.4108     0.5576 0.780 0.004 0.012 0.048 0.148 0.008
#> GSM48659     2  0.4500     0.5254 0.000 0.688 0.000 0.028 0.256 0.028
#> GSM48660     2  0.1931     0.7529 0.008 0.916 0.000 0.004 0.068 0.004
#> GSM25409     6  0.6427     0.5270 0.120 0.212 0.000 0.004 0.096 0.568
#> GSM25410     3  0.0964     0.9272 0.004 0.000 0.968 0.016 0.012 0.000
#> GSM25426     5  0.2630     0.7007 0.012 0.088 0.000 0.012 0.880 0.008
#> GSM25427     5  0.4764     0.3433 0.380 0.020 0.000 0.012 0.580 0.008
#> GSM25540     3  0.1788     0.9000 0.004 0.000 0.916 0.004 0.000 0.076
#> GSM25541     6  0.5304     0.4367 0.060 0.000 0.152 0.104 0.000 0.684
#> GSM25542     3  0.0748     0.9296 0.000 0.004 0.976 0.016 0.000 0.004
#> GSM25543     3  0.2638     0.8713 0.020 0.052 0.892 0.008 0.000 0.028
#> GSM25479     1  0.5456     0.2451 0.452 0.000 0.000 0.440 0.004 0.104
#> GSM25480     4  0.5646    -0.3130 0.436 0.000 0.000 0.440 0.008 0.116
#> GSM25481     5  0.6168     0.3782 0.164 0.300 0.000 0.008 0.512 0.016
#> GSM25482     5  0.5292     0.5231 0.064 0.272 0.000 0.008 0.632 0.024
#> GSM48654     2  0.3672     0.5858 0.000 0.712 0.008 0.276 0.000 0.004
#> GSM48650     2  0.1078     0.7603 0.012 0.964 0.000 0.016 0.000 0.008
#> GSM48651     2  0.2317     0.7427 0.020 0.900 0.000 0.000 0.064 0.016
#> GSM48652     2  0.1296     0.7622 0.000 0.952 0.000 0.032 0.012 0.004
#> GSM48653     2  0.1237     0.7650 0.000 0.956 0.000 0.020 0.020 0.004
#> GSM48662     2  0.1269     0.7604 0.012 0.956 0.000 0.000 0.020 0.012
#> GSM48663     2  0.3159     0.7173 0.064 0.856 0.000 0.004 0.060 0.016
#> GSM25524     1  0.6849     0.3290 0.468 0.004 0.004 0.220 0.256 0.048
#> GSM25525     4  0.6462     0.1976 0.196 0.000 0.000 0.552 0.164 0.088
#> GSM25526     4  0.6126     0.4429 0.072 0.000 0.104 0.664 0.096 0.064
#> GSM25527     4  0.3501     0.5274 0.128 0.000 0.004 0.816 0.008 0.044
#> GSM25528     1  0.5562     0.4533 0.616 0.000 0.184 0.184 0.004 0.012
#> GSM25529     1  0.4797     0.3412 0.524 0.000 0.000 0.432 0.008 0.036
#> GSM25530     3  0.4454     0.6568 0.232 0.000 0.708 0.044 0.008 0.008
#> GSM25531     1  0.4009     0.5916 0.764 0.000 0.040 0.180 0.004 0.012
#> GSM48661     2  0.4878     0.1509 0.000 0.480 0.040 0.472 0.000 0.008
#> GSM25561     3  0.0405     0.9314 0.004 0.000 0.988 0.000 0.008 0.000
#> GSM25562     1  0.3505     0.5799 0.824 0.068 0.000 0.016 0.000 0.092
#> GSM25563     3  0.0146     0.9318 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM25564     2  0.6083     0.4712 0.232 0.612 0.000 0.036 0.040 0.080
#> GSM25565     6  0.6083     0.5433 0.036 0.196 0.012 0.004 0.140 0.612
#> GSM25566     6  0.4752     0.6101 0.028 0.120 0.000 0.000 0.128 0.724
#> GSM25568     2  0.2022     0.7579 0.000 0.916 0.000 0.052 0.024 0.008
#> GSM25569     2  0.2024     0.7640 0.000 0.920 0.000 0.028 0.036 0.016
#> GSM25552     6  0.3237     0.6557 0.012 0.036 0.000 0.020 0.076 0.856
#> GSM25553     6  0.3280     0.6562 0.020 0.040 0.000 0.024 0.056 0.860
#> GSM25578     1  0.4756     0.5018 0.628 0.000 0.000 0.304 0.004 0.064
#> GSM25579     6  0.5658    -0.2276 0.316 0.000 0.000 0.176 0.000 0.508
#> GSM25580     1  0.5301     0.3104 0.492 0.000 0.000 0.416 0.004 0.088
#> GSM25581     1  0.5304     0.3592 0.516 0.000 0.000 0.388 0.004 0.092
#> GSM48655     2  0.4150     0.6341 0.000 0.724 0.000 0.228 0.036 0.012
#> GSM48656     2  0.4437     0.2842 0.000 0.540 0.004 0.436 0.000 0.020
#> GSM48657     2  0.3468     0.6056 0.000 0.728 0.000 0.264 0.000 0.008
#> GSM48658     4  0.4060     0.3515 0.000 0.296 0.016 0.680 0.000 0.008
#> GSM25624     4  0.3426     0.4916 0.004 0.220 0.000 0.764 0.000 0.012
#> GSM25625     3  0.1802     0.9114 0.000 0.000 0.916 0.072 0.000 0.012
#> GSM25626     3  0.1010     0.9301 0.000 0.000 0.960 0.036 0.000 0.004
#> GSM25627     4  0.4004     0.2807 0.000 0.328 0.012 0.656 0.000 0.004
#> GSM25628     3  0.0820     0.9320 0.000 0.000 0.972 0.016 0.000 0.012
#> GSM25629     4  0.4909     0.5472 0.000 0.128 0.088 0.724 0.000 0.060
#> GSM25630     3  0.0717     0.9323 0.000 0.000 0.976 0.016 0.000 0.008
#> GSM25631     4  0.4448     0.5017 0.008 0.020 0.016 0.684 0.000 0.272
#> GSM25632     3  0.1719     0.9196 0.008 0.000 0.928 0.056 0.000 0.008
#> GSM25633     4  0.3543     0.5459 0.120 0.004 0.008 0.816 0.000 0.052
#> GSM25634     4  0.3594     0.5660 0.104 0.028 0.000 0.820 0.000 0.048
#> GSM25635     4  0.2502     0.5966 0.016 0.020 0.012 0.908 0.012 0.032
#> GSM25656     3  0.0820     0.9320 0.000 0.000 0.972 0.016 0.000 0.012
#> GSM25657     1  0.4535     0.6019 0.704 0.000 0.000 0.148 0.000 0.148
#> GSM25658     1  0.4108     0.5781 0.724 0.000 0.000 0.232 0.012 0.032
#> GSM25659     1  0.6115     0.3415 0.428 0.000 0.000 0.248 0.004 0.320
#> GSM25660     4  0.6243    -0.1240 0.320 0.000 0.000 0.436 0.012 0.232
#> GSM25661     1  0.5007     0.5723 0.648 0.004 0.000 0.124 0.000 0.224
#> GSM25662     5  0.2865     0.6998 0.000 0.012 0.000 0.064 0.868 0.056
#> GSM25663     6  0.3786     0.6359 0.008 0.004 0.028 0.024 0.124 0.812
#> GSM25680     5  0.5061    -0.0190 0.000 0.044 0.004 0.008 0.480 0.464
#> GSM25681     5  0.5081     0.0865 0.000 0.040 0.004 0.012 0.504 0.440
#> GSM25682     5  0.2457     0.7085 0.000 0.036 0.000 0.000 0.880 0.084
#> GSM25683     5  0.1624     0.7202 0.000 0.020 0.000 0.004 0.936 0.040
#> GSM25684     5  0.2628     0.7132 0.000 0.024 0.000 0.024 0.884 0.068
#> GSM25685     5  0.2879     0.6712 0.000 0.008 0.000 0.072 0.864 0.056
#> GSM25686     5  0.2376     0.7158 0.000 0.068 0.000 0.000 0.888 0.044
#> GSM25687     5  0.2801     0.7067 0.000 0.068 0.000 0.000 0.860 0.072
#> GSM48664     1  0.3977     0.5850 0.752 0.016 0.000 0.032 0.000 0.200
#> GSM48665     1  0.4441     0.5875 0.720 0.016 0.000 0.060 0.000 0.204

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 genotype/variation(p) k
#> ATC:NMF 93              7.87e-05 2
#> ATC:NMF 97              4.24e-06 3
#> ATC:NMF 91              2.02e-10 4
#> ATC:NMF 79              1.26e-11 5
#> ATC:NMF 71              5.36e-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.

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