cola Report for GDS4336

Date: 2019-12-25 21:31:16 CET, cola version: 1.3.2

Document is loading...


Summary

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

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

The call of run_all_consensus_partition_methods() was:

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

Dimension of the input matrix:

mat = get_matrix(res_list)
dim(mat)
#> [1] 27425    90

Density distribution

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

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

plot of chunk density-heatmap

Suggest the best k

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

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

suggest_best_k(res_list)
The best k 1-PAC Mean silhouette Concordance Optional k
SD:pam 2 1.000 0.988 0.995 **
SD:NMF 3 1.000 0.965 0.985 ** 2
MAD:skmeans 3 1.000 0.947 0.980 ** 2
ATC:kmeans 2 1.000 0.992 0.997 **
ATC:mclust 2 1.000 0.989 0.995 **
ATC:NMF 2 1.000 0.985 0.994 **
MAD:NMF 3 1.000 0.977 0.990 ** 2
SD:hclust 2 0.979 0.951 0.975 **
CV:kmeans 4 0.974 0.928 0.969 ** 2,3
ATC:pam 4 0.969 0.936 0.975 ** 2
CV:pam 6 0.968 0.911 0.958 ** 2,4
CV:skmeans 4 0.961 0.915 0.966 ** 2,3
MAD:mclust 4 0.961 0.920 0.968 ** 2
SD:skmeans 4 0.957 0.918 0.967 ** 2,3
MAD:pam 4 0.947 0.914 0.966 * 2
CV:NMF 4 0.937 0.904 0.959 * 2,3
MAD:hclust 2 0.930 0.926 0.969 *
SD:kmeans 4 0.927 0.876 0.951 * 2,3
CV:mclust 4 0.917 0.893 0.938 *
MAD:kmeans 4 0.916 0.870 0.945 * 2,3
ATC:hclust 2 0.910 0.957 0.981 *
ATC:skmeans 5 0.903 0.891 0.943 * 2
SD:mclust 4 0.890 0.885 0.945
CV:hclust 3 0.696 0.706 0.878

**: 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 1.000           0.966       0.987          0.422 0.585   0.585
#> CV:NMF      2 0.999           0.964       0.985          0.436 0.567   0.567
#> MAD:NMF     2 1.000           0.977       0.990          0.428 0.575   0.575
#> ATC:NMF     2 1.000           0.985       0.994          0.412 0.585   0.585
#> SD:skmeans  2 0.954           0.950       0.979          0.477 0.525   0.525
#> CV:skmeans  2 1.000           0.949       0.980          0.485 0.515   0.515
#> MAD:skmeans 2 0.976           0.939       0.977          0.483 0.519   0.519
#> ATC:skmeans 2 1.000           0.987       0.995          0.439 0.558   0.558
#> SD:mclust   2 0.810           0.941       0.968          0.415 0.594   0.594
#> CV:mclust   2 0.754           0.804       0.922          0.445 0.594   0.594
#> MAD:mclust  2 1.000           0.975       0.986          0.409 0.594   0.594
#> ATC:mclust  2 1.000           0.989       0.995          0.429 0.575   0.575
#> SD:kmeans   2 1.000           0.972       0.985          0.393 0.615   0.615
#> CV:kmeans   2 1.000           0.969       0.986          0.406 0.604   0.604
#> MAD:kmeans  2 1.000           0.966       0.987          0.400 0.604   0.604
#> ATC:kmeans  2 1.000           0.992       0.997          0.388 0.615   0.615
#> SD:pam      2 1.000           0.988       0.995          0.413 0.585   0.585
#> CV:pam      2 0.931           0.924       0.970          0.433 0.585   0.585
#> MAD:pam     2 1.000           0.981       0.993          0.418 0.585   0.585
#> ATC:pam     2 1.000           1.000       1.000          0.406 0.594   0.594
#> SD:hclust   2 0.979           0.951       0.975          0.348 0.676   0.676
#> CV:hclust   2 0.860           0.870       0.950          0.375 0.626   0.626
#> MAD:hclust  2 0.930           0.926       0.969          0.368 0.626   0.626
#> ATC:hclust  2 0.910           0.957       0.981          0.375 0.626   0.626
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 1.000           0.965       0.985          0.542 0.721   0.539
#> CV:NMF      3 0.970           0.957       0.981          0.492 0.756   0.578
#> MAD:NMF     3 1.000           0.977       0.990          0.530 0.758   0.584
#> ATC:NMF     3 0.720           0.855       0.913          0.430 0.788   0.644
#> SD:skmeans  3 1.000           0.956       0.982          0.378 0.733   0.528
#> CV:skmeans  3 0.945           0.948       0.978          0.352 0.768   0.574
#> MAD:skmeans 3 1.000           0.947       0.980          0.364 0.747   0.545
#> ATC:skmeans 3 0.656           0.811       0.876          0.408 0.773   0.601
#> SD:mclust   3 0.778           0.859       0.904          0.533 0.716   0.533
#> CV:mclust   3 0.781           0.889       0.941          0.466 0.713   0.529
#> MAD:mclust  3 0.790           0.859       0.914          0.557 0.716   0.533
#> ATC:mclust  3 0.774           0.893       0.947          0.447 0.766   0.610
#> SD:kmeans   3 0.966           0.940       0.975          0.577 0.765   0.619
#> CV:kmeans   3 0.951           0.959       0.982          0.560 0.736   0.572
#> MAD:kmeans  3 0.965           0.924       0.970          0.602 0.725   0.554
#> ATC:kmeans  3 0.602           0.787       0.879          0.571 0.722   0.553
#> SD:pam      3 0.748           0.828       0.913          0.567 0.690   0.498
#> CV:pam      3 0.749           0.851       0.912          0.494 0.690   0.497
#> MAD:pam     3 0.736           0.765       0.910          0.552 0.741   0.561
#> ATC:pam     3 0.848           0.858       0.943          0.415 0.787   0.649
#> SD:hclust   3 0.735           0.792       0.898          0.705 0.776   0.669
#> CV:hclust   3 0.696           0.706       0.878          0.634 0.768   0.629
#> MAD:hclust  3 0.718           0.853       0.925          0.596 0.792   0.668
#> ATC:hclust  3 0.814           0.874       0.937          0.121 0.986   0.977
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.899           0.903       0.956         0.1397 0.838   0.578
#> CV:NMF      4 0.937           0.904       0.959         0.1311 0.834   0.569
#> MAD:NMF     4 0.874           0.872       0.942         0.1352 0.844   0.587
#> ATC:NMF     4 0.725           0.591       0.796         0.2134 0.697   0.394
#> SD:skmeans  4 0.957           0.918       0.967         0.0913 0.926   0.789
#> CV:skmeans  4 0.961           0.915       0.966         0.0906 0.930   0.800
#> MAD:skmeans 4 0.893           0.890       0.956         0.0961 0.913   0.753
#> ATC:skmeans 4 0.780           0.826       0.897         0.1722 0.794   0.494
#> SD:mclust   4 0.890           0.885       0.945         0.1309 0.919   0.768
#> CV:mclust   4 0.917           0.893       0.938         0.0926 0.886   0.690
#> MAD:mclust  4 0.961           0.920       0.968         0.1266 0.931   0.802
#> ATC:mclust  4 0.855           0.857       0.930         0.1590 0.853   0.630
#> SD:kmeans   4 0.927           0.876       0.951         0.1637 0.858   0.647
#> CV:kmeans   4 0.974           0.928       0.969         0.1387 0.869   0.660
#> MAD:kmeans  4 0.916           0.870       0.945         0.1410 0.849   0.608
#> ATC:kmeans  4 0.626           0.778       0.849         0.1500 0.895   0.714
#> SD:pam      4 0.893           0.916       0.962         0.1368 0.914   0.750
#> CV:pam      4 0.975           0.957       0.981         0.1463 0.911   0.742
#> MAD:pam     4 0.947           0.914       0.966         0.1332 0.856   0.614
#> ATC:pam     4 0.969           0.936       0.975         0.0928 0.944   0.867
#> SD:hclust   4 0.699           0.875       0.874         0.1695 0.824   0.612
#> CV:hclust   4 0.683           0.797       0.844         0.1231 0.857   0.655
#> MAD:hclust  4 0.636           0.649       0.808         0.1517 0.921   0.812
#> ATC:hclust  4 0.745           0.827       0.919         0.1825 0.931   0.887
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.790           0.747       0.868         0.0497 0.946   0.800
#> CV:NMF      5 0.799           0.809       0.866         0.0532 0.940   0.785
#> MAD:NMF     5 0.772           0.724       0.863         0.0479 0.942   0.789
#> ATC:NMF     5 0.666           0.617       0.815         0.0471 0.877   0.645
#> SD:skmeans  5 0.806           0.772       0.846         0.0936 0.893   0.642
#> CV:skmeans  5 0.788           0.767       0.826         0.0944 0.898   0.660
#> MAD:skmeans 5 0.792           0.668       0.852         0.0822 0.913   0.698
#> ATC:skmeans 5 0.903           0.891       0.943         0.0587 0.847   0.523
#> SD:mclust   5 0.757           0.752       0.862         0.0538 0.906   0.704
#> CV:mclust   5 0.681           0.641       0.808         0.0748 0.911   0.709
#> MAD:mclust  5 0.796           0.790       0.889         0.0595 0.909   0.705
#> ATC:mclust  5 0.753           0.767       0.862         0.0498 0.912   0.707
#> SD:kmeans   5 0.733           0.636       0.822         0.0771 0.919   0.723
#> CV:kmeans   5 0.747           0.662       0.826         0.0756 0.918   0.722
#> MAD:kmeans  5 0.732           0.695       0.757         0.0658 0.935   0.788
#> ATC:kmeans  5 0.699           0.693       0.770         0.0840 0.951   0.831
#> SD:pam      5 0.789           0.684       0.865         0.0846 0.860   0.532
#> CV:pam      5 0.858           0.894       0.926         0.0754 0.886   0.600
#> MAD:pam     5 0.843           0.816       0.906         0.0873 0.893   0.622
#> ATC:pam     5 0.650           0.772       0.857         0.1401 0.898   0.734
#> SD:hclust   5 0.777           0.831       0.885         0.0601 1.000   1.000
#> CV:hclust   5 0.726           0.732       0.858         0.0442 0.971   0.904
#> MAD:hclust  5 0.712           0.650       0.809         0.0828 0.880   0.660
#> ATC:hclust  5 0.585           0.698       0.852         0.1296 0.907   0.832
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.853           0.738       0.890         0.0451 0.913   0.653
#> CV:NMF      6 0.864           0.748       0.892         0.0502 0.914   0.657
#> MAD:NMF     6 0.857           0.765       0.890         0.0443 0.900   0.613
#> ATC:NMF     6 0.691           0.699       0.831         0.0408 0.914   0.699
#> SD:skmeans  6 0.781           0.658       0.821         0.0419 0.958   0.810
#> CV:skmeans  6 0.766           0.576       0.762         0.0426 0.982   0.913
#> MAD:skmeans 6 0.766           0.601       0.785         0.0430 0.911   0.634
#> ATC:skmeans 6 0.825           0.783       0.877         0.0274 0.968   0.866
#> SD:mclust   6 0.699           0.644       0.775         0.0587 0.884   0.585
#> CV:mclust   6 0.734           0.685       0.792         0.0485 0.884   0.571
#> MAD:mclust  6 0.725           0.611       0.759         0.0520 0.928   0.714
#> ATC:mclust  6 0.806           0.695       0.856         0.0530 0.897   0.631
#> SD:kmeans   6 0.713           0.584       0.738         0.0469 0.939   0.746
#> CV:kmeans   6 0.726           0.591       0.767         0.0437 0.931   0.715
#> MAD:kmeans  6 0.707           0.613       0.760         0.0438 0.910   0.685
#> ATC:kmeans  6 0.752           0.581       0.751         0.0531 0.975   0.899
#> SD:pam      6 0.803           0.592       0.753         0.0322 0.891   0.537
#> CV:pam      6 0.968           0.911       0.958         0.0213 0.982   0.911
#> MAD:pam     6 0.845           0.798       0.904         0.0206 0.982   0.910
#> ATC:pam     6 0.762           0.784       0.829         0.1124 0.821   0.448
#> SD:hclust   6 0.765           0.809       0.875         0.0516 0.928   0.741
#> CV:hclust   6 0.714           0.689       0.822         0.0432 0.961   0.867
#> MAD:hclust  6 0.730           0.736       0.840         0.0503 0.917   0.690
#> ATC:hclust  6 0.638           0.630       0.777         0.1978 0.828   0.628

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

collect_stats(res_list, k = 2)

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

collect_stats(res_list, k = 3)

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

collect_stats(res_list, k = 4)

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

collect_stats(res_list, k = 5)

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

collect_stats(res_list, k = 6)

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

Partition from all methods

Collect partitions from all methods:

collect_classes(res_list, k = 2)

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

collect_classes(res_list, k = 3)

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

collect_classes(res_list, k = 4)

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

collect_classes(res_list, k = 5)

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

collect_classes(res_list, k = 6)

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

Top rows overlap

Overlap of top rows from different top-row methods:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Heatmaps of the top rows:

top_rows_heatmap(res_list, top_n = 1000)

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

top_rows_heatmap(res_list, top_n = 2000)

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

top_rows_heatmap(res_list, top_n = 3000)

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

top_rows_heatmap(res_list, top_n = 4000)

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

top_rows_heatmap(res_list, top_n = 5000)

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

Test to known annotations

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

test_to_known_factors(res_list, k = 2)
#>              n tissue(p) disease.state(p) individual(p) k
#> SD:NMF      89  5.55e-05            0.219         0.616 2
#> CV:NMF      89  1.04e-05            0.188         0.726 2
#> MAD:NMF     90  3.47e-05            0.176         0.644 2
#> ATC:NMF     89  1.62e-05            0.236         0.559 2
#> SD:skmeans  88  4.87e-06            0.547         0.842 2
#> CV:skmeans  87  9.67e-07            0.475         0.831 2
#> MAD:skmeans 87  2.96e-06            0.521         0.864 2
#> ATC:skmeans 89  1.99e-05            0.227         0.726 2
#> SD:mclust   89  3.70e-05            0.193         0.501 2
#> CV:mclust   77  9.27e-07            0.353         0.768 2
#> MAD:mclust  90  2.27e-05            0.143         0.530 2
#> ATC:mclust  89  5.58e-06            0.237         0.672 2
#> SD:kmeans   88  6.08e-05            0.209         0.473 2
#> CV:kmeans   89  3.70e-05            0.223         0.501 2
#> MAD:kmeans  88  6.08e-05            0.209         0.473 2
#> ATC:kmeans  90  1.10e-04            0.296         0.417 2
#> SD:pam      90  7.70e-05            0.240         0.587 2
#> CV:pam      87  2.74e-05            0.222         0.674 2
#> MAD:pam     89  5.55e-05            0.219         0.616 2
#> ATC:pam     90  2.27e-05            0.233         0.530 2
#> SD:hclust   90  3.75e-03            0.160         0.178 2
#> CV:hclust   83  3.62e-04            0.218         0.382 2
#> MAD:hclust  86  8.01e-04            0.195         0.306 2
#> ATC:hclust  90  2.34e-04            0.285         0.363 2
test_to_known_factors(res_list, k = 3)
#>              n tissue(p) disease.state(p) individual(p) k
#> SD:NMF      89  3.41e-11            0.244         0.695 3
#> CV:NMF      89  3.41e-11            0.244         0.695 3
#> MAD:NMF     90  9.16e-11            0.259         0.733 3
#> ATC:NMF     84  9.89e-05            0.232         0.142 3
#> SD:skmeans  88  2.59e-10            0.172         0.735 3
#> CV:skmeans  88  1.71e-10            0.166         0.653 3
#> MAD:skmeans 88  2.59e-10            0.172         0.735 3
#> ATC:skmeans 83  5.53e-06            0.131         0.319 3
#> SD:mclust   90  1.63e-10            0.402         0.570 3
#> CV:mclust   87  1.24e-10            0.371         0.568 3
#> MAD:mclust  88  4.17e-10            0.459         0.513 3
#> ATC:mclust  89  2.72e-09            0.106         0.405 3
#> SD:kmeans   87  6.75e-09            0.122         0.360 3
#> CV:kmeans   90  1.20e-10            0.312         0.574 3
#> MAD:kmeans  86  3.75e-11            0.308         0.623 3
#> ATC:kmeans  80  3.20e-07            0.504         0.488 3
#> SD:pam      85  7.04e-11            0.482         0.801 3
#> CV:pam      88  4.99e-11            0.404         0.753 3
#> MAD:pam     79  2.25e-10            0.343         0.657 3
#> ATC:pam     79  5.23e-05            0.588         0.417 3
#> SD:hclust   79  2.47e-08            0.123         0.490 3
#> CV:hclust   70  1.90e-08            0.159         0.643 3
#> MAD:hclust  85  2.23e-07            0.121         0.486 3
#> ATC:hclust  89  6.25e-04            0.273         0.311 3
test_to_known_factors(res_list, k = 4)
#>              n tissue(p) disease.state(p) individual(p) k
#> SD:NMF      88  3.24e-08           0.1629         0.420 4
#> CV:NMF      86  8.20e-08           0.1927         0.483 4
#> MAD:NMF     86  3.48e-08           0.1845         0.329 4
#> ATC:NMF     70  1.13e-08           0.1970         0.526 4
#> SD:skmeans  86  9.38e-10           0.2772         0.303 4
#> CV:skmeans  86  8.89e-10           0.2582         0.304 4
#> MAD:skmeans 86  3.07e-09           0.3459         0.328 4
#> ATC:skmeans 87  1.01e-08           0.1270         0.585 4
#> SD:mclust   86  1.14e-09           0.1160         0.429 4
#> CV:mclust   86  9.29e-10           0.1184         0.560 4
#> MAD:mclust  87  1.42e-10           0.1061         0.527 4
#> ATC:mclust  87  3.52e-09           0.1548         0.466 4
#> SD:kmeans   83  2.78e-09           0.1177         0.321 4
#> CV:kmeans   87  4.74e-09           0.1091         0.315 4
#> MAD:kmeans  83  5.91e-09           0.1221         0.362 4
#> ATC:kmeans  85  5.03e-06           0.3688         0.383 4
#> SD:pam      88  4.01e-10           0.1419         0.549 4
#> CV:pam      90  3.70e-10           0.1306         0.503 4
#> MAD:pam     87  7.89e-10           0.1313         0.413 4
#> ATC:pam     88  4.96e-05           0.0964         0.465 4
#> SD:hclust   90  1.19e-09           0.0989         0.348 4
#> CV:hclust   80  7.97e-09           0.2004         0.345 4
#> MAD:hclust  76  1.23e-08           0.2914         0.357 4
#> ATC:hclust  88  1.53e-04           0.4415         0.428 4
test_to_known_factors(res_list, k = 5)
#>              n tissue(p) disease.state(p) individual(p) k
#> SD:NMF      76  2.61e-08           0.1476         0.274 5
#> CV:NMF      84  4.64e-09           0.0432         0.307 5
#> MAD:NMF     76  7.56e-09           0.2252         0.259 5
#> ATC:NMF     63  1.58e-08           0.1852         0.506 5
#> SD:skmeans  83  3.11e-08           0.1453         0.108 5
#> CV:skmeans  81  1.85e-08           0.1698         0.177 5
#> MAD:skmeans 70  1.50e-07           0.1701         0.198 5
#> ATC:skmeans 88  4.44e-08           0.2393         0.369 5
#> SD:mclust   81  5.58e-08           0.1066         0.423 5
#> CV:mclust   69  1.07e-07           0.0452         0.491 5
#> MAD:mclust  83  2.10e-08           0.0328         0.381 5
#> ATC:mclust  82  3.16e-09           0.3893         0.178 5
#> SD:kmeans   71  1.99e-07           0.1041         0.147 5
#> CV:kmeans   74  7.56e-07           0.1242         0.143 5
#> MAD:kmeans  79  4.70e-09           0.1205         0.273 5
#> ATC:kmeans  76  4.61e-06           0.0658         0.272 5
#> SD:pam      72  4.01e-07           0.1846         0.210 5
#> CV:pam      88  1.23e-08           0.1024         0.298 5
#> MAD:pam     83  8.12e-08           0.1455         0.221 5
#> ATC:pam     84  2.02e-05           0.0221         0.175 5
#> SD:hclust   87  3.92e-09           0.0651         0.389 5
#> CV:hclust   75  2.02e-08           0.0888         0.359 5
#> MAD:hclust  75  5.45e-07           0.1257         0.279 5
#> ATC:hclust  75  3.66e-04           0.6750         0.413 5
test_to_known_factors(res_list, k = 6)
#>              n tissue(p) disease.state(p) individual(p) k
#> SD:NMF      74  1.28e-06           0.1336         0.226 6
#> CV:NMF      75  1.39e-06           0.1377         0.157 6
#> MAD:NMF     78  1.77e-07           0.2662         0.200 6
#> ATC:NMF     67  3.43e-07           0.3627         0.782 6
#> SD:skmeans  68  8.62e-07           0.0593         0.013 6
#> CV:skmeans  53  4.95e-06           0.3984         0.184 6
#> MAD:skmeans 57  6.73e-06           0.1744         0.395 6
#> ATC:skmeans 83  4.02e-07           0.1472         0.333 6
#> SD:mclust   77  1.25e-08           0.1094         0.216 6
#> CV:mclust   78  1.96e-08           0.0660         0.273 6
#> MAD:mclust  72  3.14e-07           0.0460         0.200 6
#> ATC:mclust  80  2.89e-07           0.0544         0.197 6
#> SD:kmeans   70  1.06e-07           0.2721         0.237 6
#> CV:kmeans   70  9.17e-07           0.1770         0.193 6
#> MAD:kmeans  70  9.12e-08           0.2648         0.400 6
#> ATC:kmeans  68  5.00e-05           0.1443         0.473 6
#> SD:pam      70  1.48e-06           0.1795         0.355 6
#> CV:pam      87  4.00e-08           0.1128         0.240 6
#> MAD:pam     84  2.21e-08           0.1779         0.197 6
#> ATC:pam     87  2.04e-07           0.0785         0.324 6
#> SD:hclust   85  1.13e-08           0.0425         0.431 6
#> CV:hclust   74  9.32e-08           0.0379         0.205 6
#> MAD:hclust  72  8.66e-08           0.1514         0.558 6
#> ATC:hclust  68  3.69e-07           0.4445         0.554 6

Results for each method


SD:hclust**

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

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

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

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

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

collect_plots(res)

plot of chunk SD-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.979           0.951       0.975         0.3479 0.676   0.676
#> 3 3 0.735           0.792       0.898         0.7051 0.776   0.669
#> 4 4 0.699           0.875       0.874         0.1695 0.824   0.612
#> 5 5 0.777           0.831       0.885         0.0601 1.000   1.000
#> 6 6 0.765           0.809       0.875         0.0516 0.928   0.741

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
#> GSM711936     2  0.0376      0.995 0.004 0.996
#> GSM711938     2  0.0000      0.998 0.000 1.000
#> GSM711950     1  0.0000      0.969 1.000 0.000
#> GSM711956     1  0.0000      0.969 1.000 0.000
#> GSM711958     1  0.0000      0.969 1.000 0.000
#> GSM711960     1  0.0000      0.969 1.000 0.000
#> GSM711964     1  0.0000      0.969 1.000 0.000
#> GSM711966     1  0.0000      0.969 1.000 0.000
#> GSM711968     1  0.0000      0.969 1.000 0.000
#> GSM711972     1  0.0000      0.969 1.000 0.000
#> GSM711976     1  0.0000      0.969 1.000 0.000
#> GSM711980     1  0.0000      0.969 1.000 0.000
#> GSM711986     1  0.0000      0.969 1.000 0.000
#> GSM711904     1  0.0000      0.969 1.000 0.000
#> GSM711906     1  0.0000      0.969 1.000 0.000
#> GSM711908     1  0.0000      0.969 1.000 0.000
#> GSM711910     1  0.0000      0.969 1.000 0.000
#> GSM711914     1  0.0000      0.969 1.000 0.000
#> GSM711916     1  0.0000      0.969 1.000 0.000
#> GSM711922     1  0.0000      0.969 1.000 0.000
#> GSM711924     1  0.0000      0.969 1.000 0.000
#> GSM711926     1  0.3584      0.924 0.932 0.068
#> GSM711928     1  0.0000      0.969 1.000 0.000
#> GSM711930     1  0.0000      0.969 1.000 0.000
#> GSM711932     1  0.0000      0.969 1.000 0.000
#> GSM711934     1  0.0000      0.969 1.000 0.000
#> GSM711940     1  0.0000      0.969 1.000 0.000
#> GSM711942     1  0.0000      0.969 1.000 0.000
#> GSM711944     1  0.0000      0.969 1.000 0.000
#> GSM711946     1  0.2778      0.939 0.952 0.048
#> GSM711948     1  0.0000      0.969 1.000 0.000
#> GSM711952     1  0.0000      0.969 1.000 0.000
#> GSM711954     1  0.0000      0.969 1.000 0.000
#> GSM711962     1  0.0000      0.969 1.000 0.000
#> GSM711970     1  0.0000      0.969 1.000 0.000
#> GSM711974     1  0.0000      0.969 1.000 0.000
#> GSM711978     1  0.2603      0.942 0.956 0.044
#> GSM711988     1  0.0000      0.969 1.000 0.000
#> GSM711990     1  0.0000      0.969 1.000 0.000
#> GSM711992     1  0.3584      0.924 0.932 0.068
#> GSM711982     1  0.0000      0.969 1.000 0.000
#> GSM711984     2  0.0000      0.998 0.000 1.000
#> GSM711912     1  0.0000      0.969 1.000 0.000
#> GSM711918     1  0.0000      0.969 1.000 0.000
#> GSM711920     1  0.0000      0.969 1.000 0.000
#> GSM711937     2  0.0376      0.995 0.004 0.996
#> GSM711939     2  0.0000      0.998 0.000 1.000
#> GSM711951     1  0.9000      0.590 0.684 0.316
#> GSM711957     1  0.0000      0.969 1.000 0.000
#> GSM711959     2  0.0000      0.998 0.000 1.000
#> GSM711961     2  0.0000      0.998 0.000 1.000
#> GSM711965     1  0.0000      0.969 1.000 0.000
#> GSM711967     1  0.0000      0.969 1.000 0.000
#> GSM711969     2  0.0376      0.995 0.004 0.996
#> GSM711973     1  0.0000      0.969 1.000 0.000
#> GSM711977     1  0.0000      0.969 1.000 0.000
#> GSM711981     1  0.4022      0.914 0.920 0.080
#> GSM711987     2  0.0000      0.998 0.000 1.000
#> GSM711905     2  0.0000      0.998 0.000 1.000
#> GSM711907     1  0.9248      0.542 0.660 0.340
#> GSM711909     1  0.0000      0.969 1.000 0.000
#> GSM711911     1  0.0000      0.969 1.000 0.000
#> GSM711915     1  0.0000      0.969 1.000 0.000
#> GSM711917     2  0.1414      0.979 0.020 0.980
#> GSM711923     1  0.2423      0.945 0.960 0.040
#> GSM711925     2  0.0000      0.998 0.000 1.000
#> GSM711927     1  0.0000      0.969 1.000 0.000
#> GSM711929     2  0.0000      0.998 0.000 1.000
#> GSM711931     1  0.5178      0.879 0.884 0.116
#> GSM711933     1  0.0000      0.969 1.000 0.000
#> GSM711935     2  0.0000      0.998 0.000 1.000
#> GSM711941     1  0.0000      0.969 1.000 0.000
#> GSM711943     1  0.2423      0.945 0.960 0.040
#> GSM711945     1  0.2778      0.939 0.952 0.048
#> GSM711947     1  0.5629      0.864 0.868 0.132
#> GSM711949     2  0.0000      0.998 0.000 1.000
#> GSM711953     2  0.0000      0.998 0.000 1.000
#> GSM711955     1  0.0000      0.969 1.000 0.000
#> GSM711963     2  0.0000      0.998 0.000 1.000
#> GSM711971     1  0.0000      0.969 1.000 0.000
#> GSM711975     1  0.9000      0.590 0.684 0.316
#> GSM711979     1  0.2603      0.942 0.956 0.044
#> GSM711989     1  0.9000      0.590 0.684 0.316
#> GSM711991     1  0.4022      0.914 0.920 0.080
#> GSM711993     1  0.4022      0.914 0.920 0.080
#> GSM711983     1  0.0000      0.969 1.000 0.000
#> GSM711985     2  0.0000      0.998 0.000 1.000
#> GSM711913     1  0.0000      0.969 1.000 0.000
#> GSM711919     1  0.0000      0.969 1.000 0.000
#> GSM711921     1  0.0000      0.969 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
#> GSM711936     2  0.0237     0.9945 0.000 0.996 0.004
#> GSM711938     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711950     1  0.0892     0.8298 0.980 0.000 0.020
#> GSM711956     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711958     1  0.0592     0.8318 0.988 0.000 0.012
#> GSM711960     1  0.1643     0.8164 0.956 0.000 0.044
#> GSM711964     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711966     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711968     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711972     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711976     1  0.0592     0.8318 0.988 0.000 0.012
#> GSM711980     1  0.0592     0.8318 0.988 0.000 0.012
#> GSM711986     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711904     1  0.0237     0.8335 0.996 0.000 0.004
#> GSM711906     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711908     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711910     3  0.0000     0.9424 0.000 0.000 1.000
#> GSM711914     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711916     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711922     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711924     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711926     1  0.7764     0.5002 0.604 0.068 0.328
#> GSM711928     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711930     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711932     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711934     1  0.0592     0.8318 0.988 0.000 0.012
#> GSM711940     1  0.5968     0.5280 0.636 0.000 0.364
#> GSM711942     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711944     3  0.3816     0.8245 0.148 0.000 0.852
#> GSM711946     1  0.7648     0.4140 0.552 0.048 0.400
#> GSM711948     1  0.1411     0.8228 0.964 0.000 0.036
#> GSM711952     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711954     1  0.0592     0.8318 0.988 0.000 0.012
#> GSM711962     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711970     1  0.0424     0.8328 0.992 0.000 0.008
#> GSM711974     1  0.0592     0.8318 0.988 0.000 0.012
#> GSM711978     1  0.7138     0.5493 0.644 0.044 0.312
#> GSM711988     1  0.0592     0.8318 0.988 0.000 0.012
#> GSM711990     3  0.1411     0.9359 0.036 0.000 0.964
#> GSM711992     1  0.7618     0.5448 0.628 0.068 0.304
#> GSM711982     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711984     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711912     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711918     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711920     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711937     2  0.0237     0.9945 0.000 0.996 0.004
#> GSM711939     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711951     1  0.9981     0.0562 0.364 0.316 0.320
#> GSM711957     1  0.1411     0.8203 0.964 0.000 0.036
#> GSM711959     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711961     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711965     1  0.6062     0.4961 0.616 0.000 0.384
#> GSM711967     1  0.0000     0.8341 1.000 0.000 0.000
#> GSM711969     2  0.0237     0.9945 0.000 0.996 0.004
#> GSM711973     3  0.4235     0.7826 0.176 0.000 0.824
#> GSM711977     3  0.0892     0.9404 0.020 0.000 0.980
#> GSM711981     1  0.7992     0.4845 0.592 0.080 0.328
#> GSM711987     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711905     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711907     1  0.9990     0.0192 0.348 0.340 0.312
#> GSM711909     3  0.0000     0.9424 0.000 0.000 1.000
#> GSM711911     3  0.0000     0.9424 0.000 0.000 1.000
#> GSM711915     3  0.0000     0.9424 0.000 0.000 1.000
#> GSM711917     2  0.1015     0.9766 0.008 0.980 0.012
#> GSM711923     1  0.7346     0.4798 0.592 0.040 0.368
#> GSM711925     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711927     3  0.0000     0.9424 0.000 0.000 1.000
#> GSM711929     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711931     1  0.8573     0.4306 0.556 0.116 0.328
#> GSM711933     1  0.0892     0.8292 0.980 0.000 0.020
#> GSM711935     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711941     1  0.5968     0.5280 0.636 0.000 0.364
#> GSM711943     1  0.7271     0.5056 0.608 0.040 0.352
#> GSM711945     1  0.7648     0.4140 0.552 0.048 0.400
#> GSM711947     3  0.4128     0.8409 0.012 0.132 0.856
#> GSM711949     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711953     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711955     1  0.1643     0.8186 0.956 0.000 0.044
#> GSM711963     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711971     3  0.1411     0.9359 0.036 0.000 0.964
#> GSM711975     1  0.9981     0.0562 0.364 0.316 0.320
#> GSM711979     1  0.7138     0.5493 0.644 0.044 0.312
#> GSM711989     1  0.9981     0.0562 0.364 0.316 0.320
#> GSM711991     3  0.3802     0.8748 0.032 0.080 0.888
#> GSM711993     1  0.7992     0.4845 0.592 0.080 0.328
#> GSM711983     3  0.1411     0.9359 0.036 0.000 0.964
#> GSM711985     2  0.0000     0.9977 0.000 1.000 0.000
#> GSM711913     3  0.0892     0.9404 0.020 0.000 0.980
#> GSM711919     3  0.0000     0.9424 0.000 0.000 1.000
#> GSM711921     3  0.0000     0.9424 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0188      0.994 0.000 0.996 0.000 0.004
#> GSM711938     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711950     1  0.1488      0.935 0.956 0.000 0.012 0.032
#> GSM711956     1  0.0188      0.946 0.996 0.000 0.000 0.004
#> GSM711958     1  0.1174      0.941 0.968 0.000 0.012 0.020
#> GSM711960     1  0.2111      0.919 0.932 0.000 0.044 0.024
#> GSM711964     1  0.0188      0.946 0.996 0.000 0.000 0.004
#> GSM711966     1  0.2345      0.902 0.900 0.000 0.000 0.100
#> GSM711968     1  0.0336      0.946 0.992 0.000 0.000 0.008
#> GSM711972     1  0.2345      0.902 0.900 0.000 0.000 0.100
#> GSM711976     1  0.1284      0.940 0.964 0.000 0.012 0.024
#> GSM711980     1  0.1284      0.940 0.964 0.000 0.012 0.024
#> GSM711986     1  0.2216      0.907 0.908 0.000 0.000 0.092
#> GSM711904     1  0.0524      0.946 0.988 0.000 0.004 0.008
#> GSM711906     1  0.1211      0.932 0.960 0.000 0.000 0.040
#> GSM711908     1  0.2408      0.900 0.896 0.000 0.000 0.104
#> GSM711910     3  0.0000      0.909 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0188      0.946 0.996 0.000 0.000 0.004
#> GSM711916     1  0.2408      0.900 0.896 0.000 0.000 0.104
#> GSM711922     1  0.0336      0.946 0.992 0.000 0.000 0.008
#> GSM711924     1  0.0188      0.946 0.996 0.000 0.000 0.004
#> GSM711926     4  0.7228      0.752 0.088 0.068 0.200 0.644
#> GSM711928     1  0.0188      0.946 0.996 0.000 0.000 0.004
#> GSM711930     1  0.2408      0.900 0.896 0.000 0.000 0.104
#> GSM711932     1  0.1637      0.910 0.940 0.000 0.000 0.060
#> GSM711934     1  0.1284      0.940 0.964 0.000 0.012 0.024
#> GSM711940     4  0.7458      0.673 0.240 0.000 0.252 0.508
#> GSM711942     1  0.0188      0.946 0.996 0.000 0.000 0.004
#> GSM711944     3  0.3324      0.742 0.136 0.000 0.852 0.012
#> GSM711946     4  0.7824      0.735 0.120 0.048 0.280 0.552
#> GSM711948     1  0.2021      0.922 0.936 0.000 0.024 0.040
#> GSM711952     1  0.2408      0.900 0.896 0.000 0.000 0.104
#> GSM711954     1  0.1284      0.940 0.964 0.000 0.012 0.024
#> GSM711962     1  0.0469      0.945 0.988 0.000 0.000 0.012
#> GSM711970     1  0.1151      0.941 0.968 0.000 0.008 0.024
#> GSM711974     1  0.1174      0.941 0.968 0.000 0.012 0.020
#> GSM711978     4  0.7615      0.760 0.156 0.044 0.200 0.600
#> GSM711988     1  0.1284      0.940 0.964 0.000 0.012 0.024
#> GSM711990     3  0.1209      0.892 0.032 0.000 0.964 0.004
#> GSM711992     4  0.8933      0.566 0.324 0.068 0.204 0.404
#> GSM711982     1  0.2408      0.900 0.896 0.000 0.000 0.104
#> GSM711984     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711912     1  0.2408      0.900 0.896 0.000 0.000 0.104
#> GSM711918     1  0.2408      0.900 0.896 0.000 0.000 0.104
#> GSM711920     1  0.0188      0.946 0.996 0.000 0.000 0.004
#> GSM711937     2  0.0188      0.994 0.000 0.996 0.000 0.004
#> GSM711939     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711951     4  0.7963      0.599 0.016 0.316 0.196 0.472
#> GSM711957     4  0.3569      0.520 0.196 0.000 0.000 0.804
#> GSM711959     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711965     4  0.7389      0.677 0.212 0.000 0.272 0.516
#> GSM711967     1  0.0469      0.945 0.988 0.000 0.000 0.012
#> GSM711969     2  0.0188      0.994 0.000 0.996 0.000 0.004
#> GSM711973     3  0.4388      0.699 0.132 0.000 0.808 0.060
#> GSM711977     3  0.0707      0.900 0.000 0.000 0.980 0.020
#> GSM711981     4  0.7237      0.748 0.076 0.080 0.200 0.644
#> GSM711987     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711907     4  0.7973      0.575 0.016 0.340 0.188 0.456
#> GSM711909     3  0.0000      0.909 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000      0.909 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0000      0.909 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0804      0.975 0.000 0.980 0.012 0.008
#> GSM711923     4  0.8018      0.739 0.168 0.040 0.256 0.536
#> GSM711925     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000      0.909 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711931     4  0.7176      0.723 0.044 0.116 0.200 0.640
#> GSM711933     1  0.1624      0.933 0.952 0.000 0.020 0.028
#> GSM711935     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711941     4  0.7458      0.673 0.240 0.000 0.252 0.508
#> GSM711943     4  0.7994      0.744 0.176 0.040 0.240 0.544
#> GSM711945     4  0.7824      0.735 0.120 0.048 0.280 0.552
#> GSM711947     3  0.5253      0.636 0.012 0.132 0.772 0.084
#> GSM711949     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711955     1  0.2313      0.911 0.924 0.000 0.032 0.044
#> GSM711963     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711971     3  0.1209      0.892 0.032 0.000 0.964 0.004
#> GSM711975     4  0.7963      0.599 0.016 0.316 0.196 0.472
#> GSM711979     4  0.7615      0.760 0.156 0.044 0.200 0.600
#> GSM711989     4  0.7963      0.599 0.016 0.316 0.196 0.472
#> GSM711991     3  0.5188      0.623 0.012 0.080 0.776 0.132
#> GSM711993     4  0.7237      0.748 0.076 0.080 0.200 0.644
#> GSM711983     3  0.1209      0.892 0.032 0.000 0.964 0.004
#> GSM711985     2  0.0000      0.998 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0707      0.900 0.000 0.000 0.980 0.020
#> GSM711919     3  0.0000      0.909 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000      0.909 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4 p5
#> GSM711936     2  0.0609      0.986 0.000 0.980 0.000 0.020 NA
#> GSM711938     2  0.0510      0.988 0.000 0.984 0.000 0.016 NA
#> GSM711950     1  0.1356      0.889 0.956 0.000 0.012 0.028 NA
#> GSM711956     1  0.0162      0.899 0.996 0.000 0.000 0.000 NA
#> GSM711958     1  0.1299      0.894 0.960 0.000 0.012 0.020 NA
#> GSM711960     1  0.2095      0.877 0.928 0.000 0.028 0.020 NA
#> GSM711964     1  0.0162      0.899 0.996 0.000 0.000 0.000 NA
#> GSM711966     1  0.3242      0.810 0.784 0.000 0.000 0.000 NA
#> GSM711968     1  0.0162      0.899 0.996 0.000 0.000 0.000 NA
#> GSM711972     1  0.3452      0.794 0.756 0.000 0.000 0.000 NA
#> GSM711976     1  0.1173      0.893 0.964 0.000 0.012 0.020 NA
#> GSM711980     1  0.1173      0.893 0.964 0.000 0.012 0.020 NA
#> GSM711986     1  0.3612      0.778 0.732 0.000 0.000 0.000 NA
#> GSM711904     1  0.0932      0.898 0.972 0.000 0.004 0.004 NA
#> GSM711906     1  0.2127      0.866 0.892 0.000 0.000 0.000 NA
#> GSM711908     1  0.3730      0.763 0.712 0.000 0.000 0.000 NA
#> GSM711910     3  0.0404      0.846 0.000 0.000 0.988 0.000 NA
#> GSM711914     1  0.0162      0.899 0.996 0.000 0.000 0.000 NA
#> GSM711916     1  0.3508      0.788 0.748 0.000 0.000 0.000 NA
#> GSM711922     1  0.0162      0.899 0.996 0.000 0.000 0.000 NA
#> GSM711924     1  0.0162      0.899 0.996 0.000 0.000 0.000 NA
#> GSM711926     4  0.2158      0.773 0.052 0.008 0.000 0.920 NA
#> GSM711928     1  0.0162      0.899 0.996 0.000 0.000 0.000 NA
#> GSM711930     1  0.3730      0.763 0.712 0.000 0.000 0.000 NA
#> GSM711932     1  0.1270      0.877 0.948 0.000 0.000 0.052 NA
#> GSM711934     1  0.1173      0.893 0.964 0.000 0.012 0.020 NA
#> GSM711940     4  0.5079      0.708 0.232 0.000 0.040 0.700 NA
#> GSM711942     1  0.0162      0.899 0.996 0.000 0.000 0.000 NA
#> GSM711944     3  0.3197      0.746 0.140 0.000 0.836 0.000 NA
#> GSM711946     4  0.4593      0.767 0.112 0.008 0.072 0.788 NA
#> GSM711948     1  0.1885      0.877 0.936 0.000 0.020 0.032 NA
#> GSM711952     1  0.3730      0.763 0.712 0.000 0.000 0.000 NA
#> GSM711954     1  0.1173      0.893 0.964 0.000 0.012 0.020 NA
#> GSM711962     1  0.1270      0.889 0.948 0.000 0.000 0.000 NA
#> GSM711970     1  0.1059      0.894 0.968 0.000 0.008 0.020 NA
#> GSM711974     1  0.1299      0.894 0.960 0.000 0.012 0.020 NA
#> GSM711978     4  0.3246      0.783 0.120 0.008 0.000 0.848 NA
#> GSM711988     1  0.1173      0.893 0.964 0.000 0.012 0.020 NA
#> GSM711990     3  0.1469      0.839 0.036 0.000 0.948 0.000 NA
#> GSM711992     4  0.4483      0.595 0.308 0.008 0.012 0.672 NA
#> GSM711982     1  0.3508      0.788 0.748 0.000 0.000 0.000 NA
#> GSM711984     2  0.0510      0.988 0.000 0.984 0.000 0.016 NA
#> GSM711912     1  0.3730      0.763 0.712 0.000 0.000 0.000 NA
#> GSM711918     1  0.3730      0.763 0.712 0.000 0.000 0.000 NA
#> GSM711920     1  0.0162      0.899 0.996 0.000 0.000 0.000 NA
#> GSM711937     2  0.0609      0.986 0.000 0.980 0.000 0.020 NA
#> GSM711939     2  0.0510      0.988 0.000 0.984 0.000 0.016 NA
#> GSM711951     4  0.3452      0.662 0.000 0.244 0.000 0.756 NA
#> GSM711957     4  0.5557      0.406 0.068 0.000 0.000 0.472 NA
#> GSM711959     2  0.0510      0.988 0.000 0.984 0.000 0.016 NA
#> GSM711961     2  0.0000      0.989 0.000 1.000 0.000 0.000 NA
#> GSM711965     4  0.5153      0.716 0.208 0.000 0.060 0.708 NA
#> GSM711967     1  0.1197      0.890 0.952 0.000 0.000 0.000 NA
#> GSM711969     2  0.0609      0.986 0.000 0.980 0.000 0.020 NA
#> GSM711973     3  0.6674      0.626 0.136 0.000 0.592 0.056 NA
#> GSM711977     3  0.3829      0.775 0.000 0.000 0.776 0.028 NA
#> GSM711981     4  0.2011      0.770 0.044 0.008 0.000 0.928 NA
#> GSM711987     2  0.0000      0.989 0.000 1.000 0.000 0.000 NA
#> GSM711905     2  0.0000      0.989 0.000 1.000 0.000 0.000 NA
#> GSM711907     4  0.3612      0.630 0.000 0.268 0.000 0.732 NA
#> GSM711909     3  0.0000      0.848 0.000 0.000 1.000 0.000 NA
#> GSM711911     3  0.0000      0.848 0.000 0.000 1.000 0.000 NA
#> GSM711915     3  0.3690      0.775 0.000 0.000 0.764 0.012 NA
#> GSM711917     2  0.1043      0.967 0.000 0.960 0.000 0.040 NA
#> GSM711923     4  0.4731      0.764 0.160 0.008 0.048 0.764 NA
#> GSM711925     2  0.0000      0.989 0.000 1.000 0.000 0.000 NA
#> GSM711927     3  0.0000      0.848 0.000 0.000 1.000 0.000 NA
#> GSM711929     2  0.0000      0.989 0.000 1.000 0.000 0.000 NA
#> GSM711931     4  0.2011      0.749 0.008 0.044 0.000 0.928 NA
#> GSM711933     1  0.1518      0.888 0.952 0.000 0.016 0.020 NA
#> GSM711935     2  0.0000      0.989 0.000 1.000 0.000 0.000 NA
#> GSM711941     4  0.5079      0.708 0.232 0.000 0.040 0.700 NA
#> GSM711943     4  0.4475      0.768 0.164 0.008 0.032 0.776 NA
#> GSM711945     4  0.4593      0.767 0.112 0.008 0.072 0.788 NA
#> GSM711947     3  0.6230      0.253 0.000 0.060 0.528 0.372 NA
#> GSM711949     2  0.0000      0.989 0.000 1.000 0.000 0.000 NA
#> GSM711953     2  0.0000      0.989 0.000 1.000 0.000 0.000 NA
#> GSM711955     1  0.2180      0.868 0.924 0.000 0.024 0.032 NA
#> GSM711963     2  0.0000      0.989 0.000 1.000 0.000 0.000 NA
#> GSM711971     3  0.1469      0.839 0.036 0.000 0.948 0.000 NA
#> GSM711975     4  0.3452      0.662 0.000 0.244 0.000 0.756 NA
#> GSM711979     4  0.3246      0.783 0.120 0.008 0.000 0.848 NA
#> GSM711989     4  0.3452      0.662 0.000 0.244 0.000 0.756 NA
#> GSM711991     3  0.5453      0.198 0.000 0.008 0.528 0.420 NA
#> GSM711993     4  0.1934      0.768 0.040 0.008 0.000 0.932 NA
#> GSM711983     3  0.1469      0.839 0.036 0.000 0.948 0.000 NA
#> GSM711985     2  0.0510      0.988 0.000 0.984 0.000 0.016 NA
#> GSM711913     3  0.3829      0.775 0.000 0.000 0.776 0.028 NA
#> GSM711919     3  0.0000      0.848 0.000 0.000 1.000 0.000 NA
#> GSM711921     3  0.0404      0.846 0.000 0.000 0.988 0.000 NA

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.0603      0.985 0.000 0.980 0.000 0.016 0.000 0.004
#> GSM711938     2  0.0458      0.987 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM711950     1  0.0260      0.933 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM711956     1  0.1075      0.932 0.952 0.000 0.000 0.000 0.000 0.048
#> GSM711958     1  0.0146      0.938 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM711960     1  0.0972      0.913 0.964 0.000 0.008 0.000 0.028 0.000
#> GSM711964     1  0.1075      0.932 0.952 0.000 0.000 0.000 0.000 0.048
#> GSM711966     6  0.3672      0.771 0.368 0.000 0.000 0.000 0.000 0.632
#> GSM711968     1  0.0865      0.937 0.964 0.000 0.000 0.000 0.000 0.036
#> GSM711972     6  0.3482      0.857 0.316 0.000 0.000 0.000 0.000 0.684
#> GSM711976     1  0.0000      0.938 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711980     1  0.0000      0.938 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711986     6  0.3244      0.864 0.268 0.000 0.000 0.000 0.000 0.732
#> GSM711904     1  0.1267      0.923 0.940 0.000 0.000 0.000 0.000 0.060
#> GSM711906     1  0.3266      0.514 0.728 0.000 0.000 0.000 0.000 0.272
#> GSM711908     6  0.2762      0.890 0.196 0.000 0.000 0.000 0.000 0.804
#> GSM711910     3  0.0551      0.768 0.000 0.000 0.984 0.004 0.008 0.004
#> GSM711914     1  0.1075      0.932 0.952 0.000 0.000 0.000 0.000 0.048
#> GSM711916     6  0.3390      0.874 0.296 0.000 0.000 0.000 0.000 0.704
#> GSM711922     1  0.0865      0.937 0.964 0.000 0.000 0.000 0.000 0.036
#> GSM711924     1  0.1007      0.934 0.956 0.000 0.000 0.000 0.000 0.044
#> GSM711926     4  0.1007      0.708 0.044 0.000 0.000 0.956 0.000 0.000
#> GSM711928     1  0.1075      0.932 0.952 0.000 0.000 0.000 0.000 0.048
#> GSM711930     6  0.2762      0.890 0.196 0.000 0.000 0.000 0.000 0.804
#> GSM711932     1  0.2066      0.895 0.908 0.000 0.000 0.052 0.000 0.040
#> GSM711934     1  0.0000      0.938 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711940     4  0.4607      0.644 0.268 0.000 0.016 0.676 0.036 0.004
#> GSM711942     1  0.1007      0.934 0.956 0.000 0.000 0.000 0.000 0.044
#> GSM711944     3  0.3094      0.639 0.140 0.000 0.824 0.000 0.036 0.000
#> GSM711946     4  0.4196      0.724 0.144 0.000 0.056 0.772 0.024 0.004
#> GSM711948     1  0.0820      0.915 0.972 0.000 0.000 0.012 0.016 0.000
#> GSM711952     6  0.2762      0.890 0.196 0.000 0.000 0.000 0.000 0.804
#> GSM711954     1  0.0000      0.938 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711962     1  0.2092      0.844 0.876 0.000 0.000 0.000 0.000 0.124
#> GSM711970     1  0.0146      0.939 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM711974     1  0.0146      0.938 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM711978     4  0.2243      0.723 0.112 0.000 0.000 0.880 0.004 0.004
#> GSM711988     1  0.0000      0.938 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711990     3  0.1572      0.759 0.036 0.000 0.936 0.000 0.028 0.000
#> GSM711992     4  0.3578      0.496 0.340 0.000 0.000 0.660 0.000 0.000
#> GSM711982     6  0.3390      0.874 0.296 0.000 0.000 0.000 0.000 0.704
#> GSM711984     2  0.0458      0.987 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM711912     6  0.2762      0.890 0.196 0.000 0.000 0.000 0.000 0.804
#> GSM711918     6  0.2762      0.890 0.196 0.000 0.000 0.000 0.000 0.804
#> GSM711920     1  0.1007      0.934 0.956 0.000 0.000 0.000 0.000 0.044
#> GSM711937     2  0.0603      0.985 0.000 0.980 0.000 0.016 0.000 0.004
#> GSM711939     2  0.0458      0.987 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM711951     4  0.3189      0.571 0.000 0.236 0.000 0.760 0.000 0.004
#> GSM711957     5  0.4915      0.000 0.000 0.000 0.000 0.188 0.656 0.156
#> GSM711959     2  0.0458      0.987 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM711961     2  0.0000      0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711965     4  0.4821      0.655 0.240 0.000 0.036 0.684 0.036 0.004
#> GSM711967     1  0.2003      0.855 0.884 0.000 0.000 0.000 0.000 0.116
#> GSM711969     2  0.0603      0.985 0.000 0.980 0.000 0.016 0.000 0.004
#> GSM711973     3  0.6371      0.390 0.136 0.000 0.500 0.044 0.316 0.004
#> GSM711977     3  0.3840      0.601 0.000 0.000 0.696 0.020 0.284 0.000
#> GSM711981     4  0.0865      0.703 0.036 0.000 0.000 0.964 0.000 0.000
#> GSM711987     2  0.0000      0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0000      0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     4  0.3337      0.538 0.000 0.260 0.000 0.736 0.000 0.004
#> GSM711909     3  0.0000      0.771 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711911     3  0.0000      0.771 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711915     3  0.3721      0.595 0.000 0.000 0.684 0.004 0.308 0.004
#> GSM711917     2  0.0937      0.961 0.000 0.960 0.000 0.040 0.000 0.000
#> GSM711923     4  0.4218      0.716 0.192 0.000 0.032 0.748 0.024 0.004
#> GSM711925     2  0.0000      0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.0000      0.771 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711929     2  0.0000      0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     4  0.1010      0.667 0.000 0.036 0.000 0.960 0.000 0.004
#> GSM711933     1  0.0363      0.931 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM711935     2  0.0000      0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     4  0.4607      0.644 0.268 0.000 0.016 0.676 0.036 0.004
#> GSM711943     4  0.3939      0.718 0.196 0.000 0.016 0.760 0.024 0.004
#> GSM711945     4  0.4196      0.724 0.144 0.000 0.056 0.772 0.024 0.004
#> GSM711947     3  0.6064      0.156 0.000 0.052 0.504 0.380 0.028 0.036
#> GSM711949     2  0.0000      0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0000      0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     1  0.1074      0.902 0.960 0.000 0.000 0.012 0.028 0.000
#> GSM711963     2  0.0000      0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.1572      0.759 0.036 0.000 0.936 0.000 0.028 0.000
#> GSM711975     4  0.3189      0.571 0.000 0.236 0.000 0.760 0.000 0.004
#> GSM711979     4  0.2243      0.723 0.112 0.000 0.000 0.880 0.004 0.004
#> GSM711989     4  0.3189      0.571 0.000 0.236 0.000 0.760 0.000 0.004
#> GSM711991     3  0.5291      0.147 0.000 0.000 0.504 0.424 0.032 0.040
#> GSM711993     4  0.0935      0.698 0.032 0.000 0.000 0.964 0.000 0.004
#> GSM711983     3  0.1572      0.759 0.036 0.000 0.936 0.000 0.028 0.000
#> GSM711985     2  0.0458      0.987 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM711913     3  0.3840      0.601 0.000 0.000 0.696 0.020 0.284 0.000
#> GSM711919     3  0.0000      0.771 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711921     3  0.0551      0.768 0.000 0.000 0.984 0.004 0.008 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-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 tissue(p) disease.state(p) individual(p) k
#> SD:hclust 90  3.75e-03           0.1604         0.178 2
#> SD:hclust 79  2.47e-08           0.1225         0.490 3
#> SD:hclust 90  1.19e-09           0.0989         0.348 4
#> SD:hclust 87  3.92e-09           0.0651         0.389 5
#> SD:hclust 85  1.13e-08           0.0425         0.431 6

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


SD:kmeans*

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

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

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

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

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

collect_plots(res)

plot of chunk SD-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 1.000           0.972       0.985         0.3933 0.615   0.615
#> 3 3 0.966           0.940       0.975         0.5770 0.765   0.619
#> 4 4 0.927           0.876       0.951         0.1637 0.858   0.647
#> 5 5 0.733           0.636       0.822         0.0771 0.919   0.723
#> 6 6 0.713           0.584       0.738         0.0469 0.939   0.746

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

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

There is also optional best \(k\) = 2 3 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
#> GSM711936     2  0.0938      1.000 0.012 0.988
#> GSM711938     2  0.0938      1.000 0.012 0.988
#> GSM711950     1  0.0000      0.984 1.000 0.000
#> GSM711956     1  0.0000      0.984 1.000 0.000
#> GSM711958     1  0.0376      0.983 0.996 0.004
#> GSM711960     1  0.0938      0.979 0.988 0.012
#> GSM711964     1  0.0000      0.984 1.000 0.000
#> GSM711966     1  0.0000      0.984 1.000 0.000
#> GSM711968     1  0.0000      0.984 1.000 0.000
#> GSM711972     1  0.0000      0.984 1.000 0.000
#> GSM711976     1  0.0000      0.984 1.000 0.000
#> GSM711980     1  0.0000      0.984 1.000 0.000
#> GSM711986     1  0.0000      0.984 1.000 0.000
#> GSM711904     1  0.0000      0.984 1.000 0.000
#> GSM711906     1  0.0000      0.984 1.000 0.000
#> GSM711908     1  0.0000      0.984 1.000 0.000
#> GSM711910     1  0.0938      0.979 0.988 0.012
#> GSM711914     1  0.0000      0.984 1.000 0.000
#> GSM711916     1  0.0000      0.984 1.000 0.000
#> GSM711922     1  0.0000      0.984 1.000 0.000
#> GSM711924     1  0.0000      0.984 1.000 0.000
#> GSM711926     1  0.0376      0.982 0.996 0.004
#> GSM711928     1  0.0000      0.984 1.000 0.000
#> GSM711930     1  0.0000      0.984 1.000 0.000
#> GSM711932     1  0.0000      0.984 1.000 0.000
#> GSM711934     1  0.0000      0.984 1.000 0.000
#> GSM711940     1  0.0000      0.984 1.000 0.000
#> GSM711942     1  0.0000      0.984 1.000 0.000
#> GSM711944     1  0.0938      0.979 0.988 0.012
#> GSM711946     1  0.0376      0.983 0.996 0.004
#> GSM711948     1  0.0000      0.984 1.000 0.000
#> GSM711952     1  0.0000      0.984 1.000 0.000
#> GSM711954     1  0.0000      0.984 1.000 0.000
#> GSM711962     1  0.0000      0.984 1.000 0.000
#> GSM711970     1  0.0000      0.984 1.000 0.000
#> GSM711974     1  0.0000      0.984 1.000 0.000
#> GSM711978     1  0.0000      0.984 1.000 0.000
#> GSM711988     1  0.0000      0.984 1.000 0.000
#> GSM711990     1  0.0938      0.979 0.988 0.012
#> GSM711992     1  0.0000      0.984 1.000 0.000
#> GSM711982     1  0.0000      0.984 1.000 0.000
#> GSM711984     2  0.0938      1.000 0.012 0.988
#> GSM711912     1  0.0000      0.984 1.000 0.000
#> GSM711918     1  0.0000      0.984 1.000 0.000
#> GSM711920     1  0.0000      0.984 1.000 0.000
#> GSM711937     2  0.0938      1.000 0.012 0.988
#> GSM711939     2  0.0938      1.000 0.012 0.988
#> GSM711951     2  0.0938      1.000 0.012 0.988
#> GSM711957     1  0.0000      0.984 1.000 0.000
#> GSM711959     2  0.0938      1.000 0.012 0.988
#> GSM711961     2  0.0938      1.000 0.012 0.988
#> GSM711965     1  0.0938      0.979 0.988 0.012
#> GSM711967     1  0.0000      0.984 1.000 0.000
#> GSM711969     2  0.0938      1.000 0.012 0.988
#> GSM711973     1  0.0000      0.984 1.000 0.000
#> GSM711977     1  0.0938      0.979 0.988 0.012
#> GSM711981     1  0.0376      0.982 0.996 0.004
#> GSM711987     2  0.0938      1.000 0.012 0.988
#> GSM711905     2  0.0938      1.000 0.012 0.988
#> GSM711907     2  0.0938      1.000 0.012 0.988
#> GSM711909     1  0.0938      0.979 0.988 0.012
#> GSM711911     1  0.0938      0.979 0.988 0.012
#> GSM711915     1  0.0938      0.979 0.988 0.012
#> GSM711917     2  0.0938      1.000 0.012 0.988
#> GSM711923     1  0.0000      0.984 1.000 0.000
#> GSM711925     2  0.0938      1.000 0.012 0.988
#> GSM711927     1  0.0938      0.979 0.988 0.012
#> GSM711929     2  0.0938      1.000 0.012 0.988
#> GSM711931     2  0.0938      1.000 0.012 0.988
#> GSM711933     1  0.0000      0.984 1.000 0.000
#> GSM711935     2  0.0938      1.000 0.012 0.988
#> GSM711941     1  0.0000      0.984 1.000 0.000
#> GSM711943     1  0.0000      0.984 1.000 0.000
#> GSM711945     1  0.0672      0.981 0.992 0.008
#> GSM711947     1  0.9850      0.282 0.572 0.428
#> GSM711949     2  0.0938      1.000 0.012 0.988
#> GSM711953     2  0.0938      1.000 0.012 0.988
#> GSM711955     1  0.0376      0.983 0.996 0.004
#> GSM711963     2  0.0938      1.000 0.012 0.988
#> GSM711971     1  0.0938      0.979 0.988 0.012
#> GSM711975     2  0.0938      1.000 0.012 0.988
#> GSM711979     1  0.0000      0.984 1.000 0.000
#> GSM711989     2  0.0938      1.000 0.012 0.988
#> GSM711991     1  0.1184      0.977 0.984 0.016
#> GSM711993     1  0.9635      0.363 0.612 0.388
#> GSM711983     1  0.0938      0.979 0.988 0.012
#> GSM711985     2  0.0938      1.000 0.012 0.988
#> GSM711913     1  0.0938      0.979 0.988 0.012
#> GSM711919     1  0.0938      0.979 0.988 0.012
#> GSM711921     1  0.0938      0.979 0.988 0.012

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM711936     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711938     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711950     1  0.0237      0.968 0.996 0.000 0.004
#> GSM711956     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711958     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711960     1  0.5138      0.652 0.748 0.000 0.252
#> GSM711964     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711966     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711968     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711972     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711976     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711980     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711986     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711904     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711906     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711908     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711910     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711914     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711916     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711922     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711924     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711926     1  0.0592      0.962 0.988 0.000 0.012
#> GSM711928     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711930     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711932     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711934     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711940     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711942     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711944     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711946     3  0.0000      0.935 0.000 0.000 1.000
#> GSM711948     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711952     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711954     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711962     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711970     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711974     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711978     1  0.0592      0.962 0.988 0.000 0.012
#> GSM711988     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711990     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711992     1  0.0592      0.962 0.988 0.000 0.012
#> GSM711982     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711984     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711912     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711918     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711920     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711937     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711939     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711951     2  0.0592      0.990 0.000 0.988 0.012
#> GSM711957     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711959     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711961     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711965     3  0.0237      0.938 0.004 0.000 0.996
#> GSM711967     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711969     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711973     1  0.3941      0.804 0.844 0.000 0.156
#> GSM711977     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711981     1  0.4121      0.798 0.832 0.000 0.168
#> GSM711987     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711905     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711907     2  0.0592      0.990 0.000 0.988 0.012
#> GSM711909     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711911     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711915     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711917     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711923     3  0.6140      0.312 0.404 0.000 0.596
#> GSM711925     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711927     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711929     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711931     2  0.0592      0.990 0.000 0.988 0.012
#> GSM711933     1  0.0000      0.971 1.000 0.000 0.000
#> GSM711935     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711941     1  0.0592      0.962 0.988 0.000 0.012
#> GSM711943     3  0.6154      0.301 0.408 0.000 0.592
#> GSM711945     3  0.0000      0.935 0.000 0.000 1.000
#> GSM711947     3  0.0237      0.933 0.000 0.004 0.996
#> GSM711949     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711955     1  0.4399      0.758 0.812 0.000 0.188
#> GSM711963     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711971     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711975     2  0.0237      0.996 0.000 0.996 0.004
#> GSM711979     1  0.0592      0.962 0.988 0.000 0.012
#> GSM711989     2  0.0237      0.996 0.000 0.996 0.004
#> GSM711991     3  0.0000      0.935 0.000 0.000 1.000
#> GSM711993     1  0.6632      0.341 0.596 0.392 0.012
#> GSM711983     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711985     2  0.0000      0.998 0.000 1.000 0.000
#> GSM711913     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711919     3  0.0592      0.943 0.012 0.000 0.988
#> GSM711921     3  0.0592      0.943 0.012 0.000 0.988

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0188     0.9562 0.000 0.996 0.000 0.004
#> GSM711938     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711950     4  0.3688     0.6856 0.208 0.000 0.000 0.792
#> GSM711956     1  0.0000     0.9619 1.000 0.000 0.000 0.000
#> GSM711958     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711960     1  0.0779     0.9504 0.980 0.000 0.016 0.004
#> GSM711964     1  0.0000     0.9619 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711968     1  0.0188     0.9613 0.996 0.000 0.000 0.004
#> GSM711972     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711976     1  0.1557     0.9186 0.944 0.000 0.000 0.056
#> GSM711980     1  0.0000     0.9619 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0188     0.9613 0.996 0.000 0.000 0.004
#> GSM711904     1  0.0188     0.9613 0.996 0.000 0.000 0.004
#> GSM711906     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711908     1  0.0188     0.9613 0.996 0.000 0.000 0.004
#> GSM711910     3  0.0000     0.9700 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000     0.9619 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711922     1  0.0188     0.9613 0.996 0.000 0.000 0.004
#> GSM711924     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711926     4  0.0469     0.8520 0.012 0.000 0.000 0.988
#> GSM711928     1  0.0188     0.9613 0.996 0.000 0.000 0.004
#> GSM711930     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711932     1  0.2081     0.8882 0.916 0.000 0.000 0.084
#> GSM711934     1  0.0000     0.9619 1.000 0.000 0.000 0.000
#> GSM711940     1  0.3311     0.7731 0.828 0.000 0.000 0.172
#> GSM711942     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711944     3  0.0188     0.9665 0.004 0.000 0.996 0.000
#> GSM711946     4  0.0592     0.8460 0.000 0.000 0.016 0.984
#> GSM711948     4  0.4916     0.2578 0.424 0.000 0.000 0.576
#> GSM711952     1  0.0188     0.9613 0.996 0.000 0.000 0.004
#> GSM711954     1  0.0188     0.9613 0.996 0.000 0.000 0.004
#> GSM711962     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711970     1  0.0188     0.9613 0.996 0.000 0.000 0.004
#> GSM711974     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711978     4  0.0469     0.8520 0.012 0.000 0.000 0.988
#> GSM711988     1  0.0592     0.9517 0.984 0.000 0.000 0.016
#> GSM711990     3  0.0000     0.9700 0.000 0.000 1.000 0.000
#> GSM711992     4  0.0469     0.8520 0.012 0.000 0.000 0.988
#> GSM711982     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711984     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0188     0.9613 0.996 0.000 0.000 0.004
#> GSM711918     1  0.0188     0.9613 0.996 0.000 0.000 0.004
#> GSM711920     1  0.0000     0.9619 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711951     4  0.0592     0.8450 0.000 0.016 0.000 0.984
#> GSM711957     1  0.4967     0.1181 0.548 0.000 0.000 0.452
#> GSM711959     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711965     4  0.5000    -0.0915 0.000 0.000 0.496 0.504
#> GSM711967     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711969     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711973     4  0.4222     0.5970 0.272 0.000 0.000 0.728
#> GSM711977     3  0.0188     0.9683 0.000 0.000 0.996 0.004
#> GSM711981     4  0.0336     0.8516 0.008 0.000 0.000 0.992
#> GSM711987     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711907     2  0.4830     0.3922 0.000 0.608 0.000 0.392
#> GSM711909     3  0.0000     0.9700 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000     0.9700 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0188     0.9683 0.000 0.000 0.996 0.004
#> GSM711917     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0524     0.8496 0.004 0.000 0.008 0.988
#> GSM711925     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000     0.9700 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711931     4  0.4877     0.1754 0.000 0.408 0.000 0.592
#> GSM711933     1  0.0188     0.9617 0.996 0.000 0.000 0.004
#> GSM711935     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0469     0.8510 0.012 0.000 0.000 0.988
#> GSM711943     4  0.0524     0.8496 0.004 0.000 0.008 0.988
#> GSM711945     4  0.0469     0.8466 0.000 0.000 0.012 0.988
#> GSM711947     3  0.4149     0.7818 0.000 0.028 0.804 0.168
#> GSM711949     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711955     1  0.5253     0.3808 0.624 0.000 0.016 0.360
#> GSM711963     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0000     0.9700 0.000 0.000 1.000 0.000
#> GSM711975     2  0.4661     0.4813 0.000 0.652 0.000 0.348
#> GSM711979     4  0.0336     0.8520 0.008 0.000 0.000 0.992
#> GSM711989     2  0.1118     0.9283 0.000 0.964 0.000 0.036
#> GSM711991     3  0.3569     0.7661 0.000 0.000 0.804 0.196
#> GSM711993     4  0.0524     0.8503 0.004 0.008 0.000 0.988
#> GSM711983     3  0.0000     0.9700 0.000 0.000 1.000 0.000
#> GSM711985     2  0.0000     0.9593 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0188     0.9683 0.000 0.000 0.996 0.004
#> GSM711919     3  0.0000     0.9700 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000     0.9700 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.3779     0.8249 0.000 0.752 0.000 0.012 0.236
#> GSM711938     2  0.0000     0.9127 0.000 1.000 0.000 0.000 0.000
#> GSM711950     4  0.5376     0.1664 0.424 0.000 0.000 0.520 0.056
#> GSM711956     1  0.0880     0.6075 0.968 0.000 0.000 0.000 0.032
#> GSM711958     1  0.2179     0.5667 0.888 0.000 0.000 0.000 0.112
#> GSM711960     1  0.4486     0.5100 0.784 0.000 0.052 0.032 0.132
#> GSM711964     1  0.3003     0.3268 0.812 0.000 0.000 0.000 0.188
#> GSM711966     5  0.4304     0.9654 0.484 0.000 0.000 0.000 0.516
#> GSM711968     1  0.1608     0.5737 0.928 0.000 0.000 0.000 0.072
#> GSM711972     5  0.4304     0.9654 0.484 0.000 0.000 0.000 0.516
#> GSM711976     1  0.2574     0.5620 0.876 0.000 0.000 0.112 0.012
#> GSM711980     1  0.0451     0.6194 0.988 0.000 0.000 0.008 0.004
#> GSM711986     1  0.4294    -0.7998 0.532 0.000 0.000 0.000 0.468
#> GSM711904     1  0.2605     0.4542 0.852 0.000 0.000 0.000 0.148
#> GSM711906     5  0.4291     0.9569 0.464 0.000 0.000 0.000 0.536
#> GSM711908     5  0.4297     0.9236 0.472 0.000 0.000 0.000 0.528
#> GSM711910     3  0.0510     0.9145 0.000 0.000 0.984 0.000 0.016
#> GSM711914     1  0.3003     0.3314 0.812 0.000 0.000 0.000 0.188
#> GSM711916     5  0.4302     0.9666 0.480 0.000 0.000 0.000 0.520
#> GSM711922     1  0.0290     0.6185 0.992 0.000 0.000 0.000 0.008
#> GSM711924     1  0.2127     0.5535 0.892 0.000 0.000 0.000 0.108
#> GSM711926     4  0.2124     0.7517 0.004 0.000 0.000 0.900 0.096
#> GSM711928     1  0.2127     0.5212 0.892 0.000 0.000 0.000 0.108
#> GSM711930     5  0.4291     0.9569 0.464 0.000 0.000 0.000 0.536
#> GSM711932     1  0.2189     0.5869 0.904 0.000 0.000 0.084 0.012
#> GSM711934     1  0.0510     0.6172 0.984 0.000 0.000 0.000 0.016
#> GSM711940     1  0.5082     0.3820 0.664 0.000 0.000 0.260 0.076
#> GSM711942     1  0.2127     0.5535 0.892 0.000 0.000 0.000 0.108
#> GSM711944     3  0.5467     0.6589 0.164 0.000 0.712 0.048 0.076
#> GSM711946     4  0.1764     0.7490 0.008 0.000 0.000 0.928 0.064
#> GSM711948     1  0.5396     0.1873 0.560 0.000 0.000 0.376 0.064
#> GSM711952     1  0.4294    -0.7998 0.532 0.000 0.000 0.000 0.468
#> GSM711954     1  0.0798     0.6183 0.976 0.000 0.000 0.008 0.016
#> GSM711962     1  0.3177     0.3550 0.792 0.000 0.000 0.000 0.208
#> GSM711970     1  0.0451     0.6191 0.988 0.000 0.000 0.004 0.008
#> GSM711974     1  0.2471     0.5345 0.864 0.000 0.000 0.000 0.136
#> GSM711978     4  0.1364     0.7667 0.012 0.000 0.000 0.952 0.036
#> GSM711988     1  0.1764     0.5996 0.928 0.000 0.000 0.064 0.008
#> GSM711990     3  0.1205     0.9119 0.000 0.000 0.956 0.004 0.040
#> GSM711992     4  0.1364     0.7667 0.012 0.000 0.000 0.952 0.036
#> GSM711982     5  0.4304     0.9654 0.484 0.000 0.000 0.000 0.516
#> GSM711984     2  0.1851     0.9012 0.000 0.912 0.000 0.000 0.088
#> GSM711912     1  0.4294    -0.7998 0.532 0.000 0.000 0.000 0.468
#> GSM711918     1  0.4294    -0.7998 0.532 0.000 0.000 0.000 0.468
#> GSM711920     1  0.1197     0.6013 0.952 0.000 0.000 0.000 0.048
#> GSM711937     2  0.3551     0.8405 0.000 0.772 0.000 0.008 0.220
#> GSM711939     2  0.2424     0.8887 0.000 0.868 0.000 0.000 0.132
#> GSM711951     4  0.3689     0.6640 0.000 0.004 0.000 0.740 0.256
#> GSM711957     1  0.4558     0.4309 0.740 0.000 0.000 0.180 0.080
#> GSM711959     2  0.2424     0.8887 0.000 0.868 0.000 0.000 0.132
#> GSM711961     2  0.0000     0.9127 0.000 1.000 0.000 0.000 0.000
#> GSM711965     4  0.6467    -0.0751 0.012 0.000 0.408 0.452 0.128
#> GSM711967     1  0.3209     0.4197 0.812 0.000 0.000 0.008 0.180
#> GSM711969     2  0.3582     0.8379 0.000 0.768 0.000 0.008 0.224
#> GSM711973     4  0.6233     0.3028 0.344 0.000 0.008 0.524 0.124
#> GSM711977     3  0.2513     0.8867 0.000 0.000 0.876 0.008 0.116
#> GSM711981     4  0.1282     0.7644 0.004 0.000 0.000 0.952 0.044
#> GSM711987     2  0.0000     0.9127 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.9127 0.000 1.000 0.000 0.000 0.000
#> GSM711907     4  0.6526     0.2722 0.000 0.260 0.000 0.484 0.256
#> GSM711909     3  0.0404     0.9148 0.000 0.000 0.988 0.000 0.012
#> GSM711911     3  0.0865     0.9147 0.000 0.000 0.972 0.004 0.024
#> GSM711915     3  0.1732     0.8982 0.000 0.000 0.920 0.000 0.080
#> GSM711917     2  0.3582     0.8379 0.000 0.768 0.000 0.008 0.224
#> GSM711923     4  0.1522     0.7566 0.012 0.000 0.000 0.944 0.044
#> GSM711925     2  0.0000     0.9127 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0290     0.9152 0.000 0.000 0.992 0.000 0.008
#> GSM711929     2  0.0000     0.9127 0.000 1.000 0.000 0.000 0.000
#> GSM711931     4  0.5841     0.4893 0.000 0.148 0.000 0.596 0.256
#> GSM711933     1  0.2077     0.6027 0.920 0.000 0.000 0.040 0.040
#> GSM711935     2  0.0000     0.9127 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.1893     0.7514 0.024 0.000 0.000 0.928 0.048
#> GSM711943     4  0.0693     0.7650 0.012 0.000 0.000 0.980 0.008
#> GSM711945     4  0.1671     0.7514 0.000 0.000 0.000 0.924 0.076
#> GSM711947     3  0.4680     0.7297 0.000 0.008 0.752 0.152 0.088
#> GSM711949     2  0.0000     0.9127 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9127 0.000 1.000 0.000 0.000 0.000
#> GSM711955     1  0.5503     0.2946 0.596 0.000 0.004 0.328 0.072
#> GSM711963     2  0.0000     0.9127 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0865     0.9147 0.000 0.000 0.972 0.004 0.024
#> GSM711975     4  0.6651     0.1629 0.000 0.300 0.000 0.444 0.256
#> GSM711979     4  0.0404     0.7660 0.012 0.000 0.000 0.988 0.000
#> GSM711989     2  0.5215     0.7124 0.000 0.656 0.000 0.088 0.256
#> GSM711991     3  0.4270     0.7067 0.000 0.000 0.748 0.204 0.048
#> GSM711993     4  0.2179     0.7500 0.004 0.000 0.000 0.896 0.100
#> GSM711983     3  0.1205     0.9119 0.000 0.000 0.956 0.004 0.040
#> GSM711985     2  0.1965     0.8995 0.000 0.904 0.000 0.000 0.096
#> GSM711913     3  0.2513     0.8867 0.000 0.000 0.876 0.008 0.116
#> GSM711919     3  0.0290     0.9152 0.000 0.000 0.992 0.000 0.008
#> GSM711921     3  0.0510     0.9145 0.000 0.000 0.984 0.000 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
#> GSM711936     2  0.4335     0.1410 0.000 0.508 0.000 0.020 0.472 0.000
#> GSM711938     2  0.1082     0.7706 0.040 0.956 0.000 0.000 0.004 0.000
#> GSM711950     4  0.5389     0.0968 0.444 0.000 0.000 0.456 0.096 0.004
#> GSM711956     1  0.4270     0.6659 0.684 0.000 0.000 0.000 0.052 0.264
#> GSM711958     1  0.5025     0.5846 0.560 0.000 0.000 0.000 0.084 0.356
#> GSM711960     1  0.6504     0.4835 0.540 0.000 0.108 0.008 0.080 0.264
#> GSM711964     1  0.5015     0.3976 0.504 0.000 0.000 0.000 0.072 0.424
#> GSM711966     6  0.0603     0.7694 0.016 0.000 0.000 0.000 0.004 0.980
#> GSM711968     1  0.4687     0.6211 0.632 0.000 0.000 0.000 0.072 0.296
#> GSM711972     6  0.0458     0.7708 0.016 0.000 0.000 0.000 0.000 0.984
#> GSM711976     1  0.5371     0.5987 0.684 0.000 0.000 0.136 0.076 0.104
#> GSM711980     1  0.3558     0.6825 0.736 0.000 0.000 0.000 0.016 0.248
#> GSM711986     6  0.3792     0.6976 0.108 0.000 0.000 0.000 0.112 0.780
#> GSM711904     1  0.5157     0.5060 0.544 0.000 0.000 0.000 0.096 0.360
#> GSM711906     6  0.0405     0.7701 0.004 0.000 0.000 0.000 0.008 0.988
#> GSM711908     6  0.2309     0.7494 0.028 0.000 0.000 0.000 0.084 0.888
#> GSM711910     3  0.0260     0.8680 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM711914     1  0.5087     0.4231 0.508 0.000 0.000 0.000 0.080 0.412
#> GSM711916     6  0.0363     0.7714 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711922     1  0.4022     0.6740 0.708 0.000 0.000 0.000 0.040 0.252
#> GSM711924     1  0.5045     0.5142 0.512 0.000 0.000 0.000 0.076 0.412
#> GSM711926     4  0.2980     0.4642 0.008 0.000 0.000 0.800 0.192 0.000
#> GSM711928     1  0.4697     0.5945 0.612 0.000 0.000 0.000 0.064 0.324
#> GSM711930     6  0.0405     0.7701 0.004 0.000 0.000 0.000 0.008 0.988
#> GSM711932     1  0.5377     0.6386 0.684 0.000 0.000 0.100 0.080 0.136
#> GSM711934     1  0.3695     0.6780 0.712 0.000 0.000 0.000 0.016 0.272
#> GSM711940     1  0.6276     0.3969 0.544 0.000 0.000 0.264 0.068 0.124
#> GSM711942     1  0.5045     0.5142 0.512 0.000 0.000 0.000 0.076 0.412
#> GSM711944     3  0.6412     0.4244 0.268 0.000 0.516 0.056 0.160 0.000
#> GSM711946     4  0.2571     0.6394 0.060 0.000 0.000 0.876 0.064 0.000
#> GSM711948     1  0.5652     0.3058 0.576 0.000 0.000 0.292 0.104 0.028
#> GSM711952     6  0.3792     0.6976 0.108 0.000 0.000 0.000 0.112 0.780
#> GSM711954     1  0.4085     0.6761 0.704 0.000 0.000 0.000 0.044 0.252
#> GSM711962     6  0.4563    -0.1944 0.368 0.000 0.000 0.000 0.044 0.588
#> GSM711970     1  0.3841     0.6794 0.724 0.000 0.000 0.000 0.032 0.244
#> GSM711974     1  0.4709     0.5451 0.540 0.000 0.000 0.000 0.048 0.412
#> GSM711978     4  0.1950     0.6209 0.024 0.000 0.000 0.912 0.064 0.000
#> GSM711988     1  0.5003     0.6504 0.708 0.000 0.000 0.068 0.064 0.160
#> GSM711990     3  0.1938     0.8621 0.036 0.000 0.920 0.004 0.040 0.000
#> GSM711992     4  0.2088     0.6203 0.028 0.000 0.000 0.904 0.068 0.000
#> GSM711982     6  0.0603     0.7694 0.016 0.000 0.000 0.000 0.004 0.980
#> GSM711984     2  0.2703     0.7017 0.004 0.824 0.000 0.000 0.172 0.000
#> GSM711912     6  0.3747     0.7019 0.104 0.000 0.000 0.000 0.112 0.784
#> GSM711918     6  0.3747     0.7019 0.104 0.000 0.000 0.000 0.112 0.784
#> GSM711920     1  0.4767     0.6271 0.620 0.000 0.000 0.000 0.076 0.304
#> GSM711937     2  0.3966     0.3026 0.000 0.552 0.000 0.004 0.444 0.000
#> GSM711939     2  0.4044     0.6227 0.040 0.704 0.000 0.000 0.256 0.000
#> GSM711951     4  0.3991    -0.4285 0.000 0.004 0.000 0.524 0.472 0.000
#> GSM711957     1  0.5627     0.5460 0.656 0.000 0.000 0.144 0.128 0.072
#> GSM711959     2  0.3717     0.6071 0.016 0.708 0.000 0.000 0.276 0.000
#> GSM711961     2  0.0937     0.7702 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM711965     4  0.6981     0.2634 0.112 0.000 0.188 0.472 0.228 0.000
#> GSM711967     6  0.4978    -0.2911 0.396 0.000 0.000 0.000 0.072 0.532
#> GSM711969     2  0.3975     0.2834 0.000 0.544 0.000 0.004 0.452 0.000
#> GSM711973     4  0.6387     0.3410 0.324 0.000 0.000 0.408 0.252 0.016
#> GSM711977     3  0.4672     0.7766 0.088 0.000 0.716 0.020 0.176 0.000
#> GSM711981     4  0.1588     0.6130 0.004 0.000 0.000 0.924 0.072 0.000
#> GSM711987     2  0.0000     0.7721 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0713     0.7708 0.028 0.972 0.000 0.000 0.000 0.000
#> GSM711907     5  0.4929     0.5116 0.000 0.064 0.000 0.428 0.508 0.000
#> GSM711909     3  0.0146     0.8685 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM711911     3  0.1261     0.8670 0.024 0.000 0.952 0.000 0.024 0.000
#> GSM711915     3  0.3934     0.8000 0.068 0.000 0.780 0.012 0.140 0.000
#> GSM711917     2  0.3975     0.2834 0.000 0.544 0.000 0.004 0.452 0.000
#> GSM711923     4  0.2325     0.6440 0.060 0.000 0.000 0.892 0.048 0.000
#> GSM711925     2  0.0291     0.7725 0.004 0.992 0.000 0.000 0.004 0.000
#> GSM711927     3  0.0000     0.8687 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711929     2  0.0713     0.7708 0.028 0.972 0.000 0.000 0.000 0.000
#> GSM711931     4  0.4758    -0.5913 0.000 0.048 0.000 0.476 0.476 0.000
#> GSM711933     1  0.4838     0.6531 0.676 0.000 0.000 0.012 0.088 0.224
#> GSM711935     2  0.0291     0.7725 0.004 0.992 0.000 0.000 0.004 0.000
#> GSM711941     4  0.3006     0.6273 0.064 0.000 0.000 0.844 0.092 0.000
#> GSM711943     4  0.1007     0.6485 0.044 0.000 0.000 0.956 0.000 0.000
#> GSM711945     4  0.2740     0.6224 0.076 0.000 0.000 0.864 0.060 0.000
#> GSM711947     3  0.5016     0.6911 0.040 0.004 0.716 0.124 0.116 0.000
#> GSM711949     2  0.0291     0.7725 0.004 0.992 0.000 0.000 0.004 0.000
#> GSM711953     2  0.0937     0.7702 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM711955     1  0.5851     0.3192 0.584 0.000 0.008 0.264 0.120 0.024
#> GSM711963     2  0.0291     0.7725 0.004 0.992 0.000 0.000 0.004 0.000
#> GSM711971     3  0.1418     0.8661 0.024 0.000 0.944 0.000 0.032 0.000
#> GSM711975     5  0.5449     0.6247 0.000 0.128 0.000 0.368 0.504 0.000
#> GSM711979     4  0.1010     0.6463 0.036 0.000 0.000 0.960 0.004 0.000
#> GSM711989     5  0.5341     0.1493 0.000 0.380 0.000 0.112 0.508 0.000
#> GSM711991     3  0.4673     0.6664 0.040 0.000 0.708 0.208 0.044 0.000
#> GSM711993     4  0.2558     0.5206 0.004 0.000 0.000 0.840 0.156 0.000
#> GSM711983     3  0.1938     0.8621 0.036 0.000 0.920 0.004 0.040 0.000
#> GSM711985     2  0.3259     0.6713 0.012 0.772 0.000 0.000 0.216 0.000
#> GSM711913     3  0.4672     0.7766 0.088 0.000 0.716 0.020 0.176 0.000
#> GSM711919     3  0.0000     0.8687 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711921     3  0.0260     0.8680 0.008 0.000 0.992 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-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 tissue(p) disease.state(p) individual(p) k
#> SD:kmeans 88  6.08e-05            0.209         0.473 2
#> SD:kmeans 87  6.75e-09            0.122         0.360 3
#> SD:kmeans 83  2.78e-09            0.118         0.321 4
#> SD:kmeans 71  1.99e-07            0.104         0.147 5
#> SD:kmeans 70  1.06e-07            0.272         0.237 6

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


SD:skmeans**

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

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

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

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

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

collect_plots(res)

plot of chunk SD-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.954           0.950       0.979         0.4769 0.525   0.525
#> 3 3 1.000           0.956       0.982         0.3779 0.733   0.528
#> 4 4 0.957           0.918       0.967         0.0913 0.926   0.789
#> 5 5 0.806           0.772       0.846         0.0936 0.893   0.642
#> 6 6 0.781           0.658       0.821         0.0419 0.958   0.810

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

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

There is also optional best \(k\) = 2 3 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
#> GSM711936     2   0.000      0.974 0.000 1.000
#> GSM711938     2   0.000      0.974 0.000 1.000
#> GSM711950     1   0.000      0.981 1.000 0.000
#> GSM711956     1   0.000      0.981 1.000 0.000
#> GSM711958     1   0.000      0.981 1.000 0.000
#> GSM711960     1   0.000      0.981 1.000 0.000
#> GSM711964     1   0.000      0.981 1.000 0.000
#> GSM711966     1   0.000      0.981 1.000 0.000
#> GSM711968     1   0.000      0.981 1.000 0.000
#> GSM711972     1   0.000      0.981 1.000 0.000
#> GSM711976     1   0.000      0.981 1.000 0.000
#> GSM711980     1   0.000      0.981 1.000 0.000
#> GSM711986     1   0.000      0.981 1.000 0.000
#> GSM711904     1   0.000      0.981 1.000 0.000
#> GSM711906     1   0.000      0.981 1.000 0.000
#> GSM711908     1   0.000      0.981 1.000 0.000
#> GSM711910     1   0.000      0.981 1.000 0.000
#> GSM711914     1   0.000      0.981 1.000 0.000
#> GSM711916     1   0.000      0.981 1.000 0.000
#> GSM711922     1   0.000      0.981 1.000 0.000
#> GSM711924     1   0.000      0.981 1.000 0.000
#> GSM711926     2   0.000      0.974 0.000 1.000
#> GSM711928     1   0.000      0.981 1.000 0.000
#> GSM711930     1   0.000      0.981 1.000 0.000
#> GSM711932     1   0.000      0.981 1.000 0.000
#> GSM711934     1   0.000      0.981 1.000 0.000
#> GSM711940     1   0.000      0.981 1.000 0.000
#> GSM711942     1   0.000      0.981 1.000 0.000
#> GSM711944     1   0.000      0.981 1.000 0.000
#> GSM711946     1   0.722      0.750 0.800 0.200
#> GSM711948     1   0.000      0.981 1.000 0.000
#> GSM711952     1   0.000      0.981 1.000 0.000
#> GSM711954     1   0.000      0.981 1.000 0.000
#> GSM711962     1   0.000      0.981 1.000 0.000
#> GSM711970     1   0.000      0.981 1.000 0.000
#> GSM711974     1   0.000      0.981 1.000 0.000
#> GSM711978     2   0.000      0.974 0.000 1.000
#> GSM711988     1   0.000      0.981 1.000 0.000
#> GSM711990     1   0.000      0.981 1.000 0.000
#> GSM711992     2   0.000      0.974 0.000 1.000
#> GSM711982     1   0.000      0.981 1.000 0.000
#> GSM711984     2   0.000      0.974 0.000 1.000
#> GSM711912     1   0.000      0.981 1.000 0.000
#> GSM711918     1   0.000      0.981 1.000 0.000
#> GSM711920     1   0.000      0.981 1.000 0.000
#> GSM711937     2   0.000      0.974 0.000 1.000
#> GSM711939     2   0.000      0.974 0.000 1.000
#> GSM711951     2   0.000      0.974 0.000 1.000
#> GSM711957     2   0.991      0.226 0.444 0.556
#> GSM711959     2   0.000      0.974 0.000 1.000
#> GSM711961     2   0.000      0.974 0.000 1.000
#> GSM711965     1   0.000      0.981 1.000 0.000
#> GSM711967     1   0.000      0.981 1.000 0.000
#> GSM711969     2   0.000      0.974 0.000 1.000
#> GSM711973     1   0.000      0.981 1.000 0.000
#> GSM711977     1   0.000      0.981 1.000 0.000
#> GSM711981     2   0.000      0.974 0.000 1.000
#> GSM711987     2   0.000      0.974 0.000 1.000
#> GSM711905     2   0.000      0.974 0.000 1.000
#> GSM711907     2   0.000      0.974 0.000 1.000
#> GSM711909     1   0.000      0.981 1.000 0.000
#> GSM711911     1   0.000      0.981 1.000 0.000
#> GSM711915     2   0.714      0.754 0.196 0.804
#> GSM711917     2   0.000      0.974 0.000 1.000
#> GSM711923     1   0.745      0.733 0.788 0.212
#> GSM711925     2   0.000      0.974 0.000 1.000
#> GSM711927     1   0.000      0.981 1.000 0.000
#> GSM711929     2   0.000      0.974 0.000 1.000
#> GSM711931     2   0.000      0.974 0.000 1.000
#> GSM711933     1   0.000      0.981 1.000 0.000
#> GSM711935     2   0.000      0.974 0.000 1.000
#> GSM711941     1   0.000      0.981 1.000 0.000
#> GSM711943     1   0.971      0.348 0.600 0.400
#> GSM711945     2   0.000      0.974 0.000 1.000
#> GSM711947     2   0.000      0.974 0.000 1.000
#> GSM711949     2   0.000      0.974 0.000 1.000
#> GSM711953     2   0.000      0.974 0.000 1.000
#> GSM711955     1   0.000      0.981 1.000 0.000
#> GSM711963     2   0.000      0.974 0.000 1.000
#> GSM711971     1   0.000      0.981 1.000 0.000
#> GSM711975     2   0.000      0.974 0.000 1.000
#> GSM711979     1   0.745      0.733 0.788 0.212
#> GSM711989     2   0.000      0.974 0.000 1.000
#> GSM711991     2   0.000      0.974 0.000 1.000
#> GSM711993     2   0.000      0.974 0.000 1.000
#> GSM711983     1   0.000      0.981 1.000 0.000
#> GSM711985     2   0.000      0.974 0.000 1.000
#> GSM711913     2   0.722      0.749 0.200 0.800
#> GSM711919     1   0.000      0.981 1.000 0.000
#> GSM711921     1   0.000      0.981 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
#> GSM711936     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711938     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711950     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711956     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711958     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711960     3  0.6095      0.395 0.392 0.000 0.608
#> GSM711964     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711966     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711968     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711972     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711976     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711980     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711986     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711904     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711906     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711908     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711910     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711914     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711916     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711922     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711924     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711926     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711928     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711930     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711932     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711934     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711940     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711942     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711944     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711946     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711948     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711952     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711954     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711962     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711970     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711974     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711978     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711988     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711990     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711992     1  0.6204      0.270 0.576 0.424 0.000
#> GSM711982     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711984     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711912     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711918     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711920     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711937     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711939     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711951     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711957     1  0.0237      0.978 0.996 0.004 0.000
#> GSM711959     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711961     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711965     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711967     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711969     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711973     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711977     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711981     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711987     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711905     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711907     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711909     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711911     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711915     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711917     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711923     3  0.0237      0.951 0.000 0.004 0.996
#> GSM711925     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711927     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711929     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711931     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711933     1  0.0000      0.982 1.000 0.000 0.000
#> GSM711935     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711941     3  0.0237      0.951 0.004 0.000 0.996
#> GSM711943     3  0.2066      0.907 0.000 0.060 0.940
#> GSM711945     3  0.1753      0.917 0.000 0.048 0.952
#> GSM711947     3  0.4555      0.742 0.000 0.200 0.800
#> GSM711949     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711953     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711955     3  0.5529      0.600 0.296 0.000 0.704
#> GSM711963     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711971     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711975     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711979     1  0.4605      0.736 0.796 0.204 0.000
#> GSM711989     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711991     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711993     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711983     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711985     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711913     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711919     3  0.0000      0.953 0.000 0.000 1.000
#> GSM711921     3  0.0000      0.953 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711950     4  0.3942     0.6466 0.236 0.000 0.000 0.764
#> GSM711956     1  0.0188     0.9805 0.996 0.000 0.000 0.004
#> GSM711958     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711960     3  0.4543     0.4984 0.324 0.000 0.676 0.000
#> GSM711964     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0188     0.9805 0.996 0.000 0.000 0.004
#> GSM711972     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711976     1  0.0817     0.9660 0.976 0.000 0.000 0.024
#> GSM711980     1  0.0188     0.9805 0.996 0.000 0.000 0.004
#> GSM711986     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0188     0.9805 0.996 0.000 0.000 0.004
#> GSM711906     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711910     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0188     0.9805 0.996 0.000 0.000 0.004
#> GSM711924     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711926     4  0.2408     0.8488 0.000 0.104 0.000 0.896
#> GSM711928     1  0.0188     0.9805 0.996 0.000 0.000 0.004
#> GSM711930     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711932     1  0.1022     0.9597 0.968 0.000 0.000 0.032
#> GSM711934     1  0.0188     0.9805 0.996 0.000 0.000 0.004
#> GSM711940     1  0.0469     0.9758 0.988 0.000 0.000 0.012
#> GSM711942     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711944     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711946     3  0.4804     0.4189 0.000 0.000 0.616 0.384
#> GSM711948     1  0.4994     0.0653 0.520 0.000 0.000 0.480
#> GSM711952     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711954     1  0.0188     0.9805 0.996 0.000 0.000 0.004
#> GSM711962     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711970     1  0.0188     0.9805 0.996 0.000 0.000 0.004
#> GSM711974     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0000     0.9398 0.000 0.000 0.000 1.000
#> GSM711988     1  0.0817     0.9660 0.976 0.000 0.000 0.024
#> GSM711990     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711992     4  0.0000     0.9398 0.000 0.000 0.000 1.000
#> GSM711982     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711951     2  0.2973     0.8243 0.000 0.856 0.000 0.144
#> GSM711957     1  0.1109     0.9599 0.968 0.004 0.000 0.028
#> GSM711959     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711965     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711967     1  0.0000     0.9814 1.000 0.000 0.000 0.000
#> GSM711969     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711973     3  0.1302     0.8620 0.000 0.000 0.956 0.044
#> GSM711977     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711981     4  0.0336     0.9380 0.000 0.008 0.000 0.992
#> GSM711987     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711907     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711909     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0817     0.9272 0.000 0.000 0.024 0.976
#> GSM711925     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711931     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711933     1  0.0336     0.9785 0.992 0.000 0.000 0.008
#> GSM711935     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0000     0.9398 0.000 0.000 0.000 1.000
#> GSM711943     4  0.0817     0.9272 0.000 0.000 0.024 0.976
#> GSM711945     3  0.4977     0.2317 0.000 0.000 0.540 0.460
#> GSM711947     3  0.4331     0.5842 0.000 0.288 0.712 0.000
#> GSM711949     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711955     3  0.4313     0.5867 0.260 0.000 0.736 0.004
#> GSM711963     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711975     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711979     4  0.0000     0.9398 0.000 0.000 0.000 1.000
#> GSM711989     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711991     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711993     4  0.0336     0.9380 0.000 0.008 0.000 0.992
#> GSM711983     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711985     2  0.0000     0.9931 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711919     3  0.0000     0.8951 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000     0.8951 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711938     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711950     1  0.1282     0.5455 0.952 0.000 0.000 0.044 0.004
#> GSM711956     1  0.4150     0.6510 0.612 0.000 0.000 0.000 0.388
#> GSM711958     5  0.4291    -0.0433 0.464 0.000 0.000 0.000 0.536
#> GSM711960     1  0.6641     0.1679 0.448 0.000 0.296 0.000 0.256
#> GSM711964     1  0.4306     0.5091 0.508 0.000 0.000 0.000 0.492
#> GSM711966     5  0.0290     0.8083 0.008 0.000 0.000 0.000 0.992
#> GSM711968     1  0.4256     0.6108 0.564 0.000 0.000 0.000 0.436
#> GSM711972     5  0.0000     0.8073 0.000 0.000 0.000 0.000 1.000
#> GSM711976     1  0.3636     0.6718 0.728 0.000 0.000 0.000 0.272
#> GSM711980     1  0.3752     0.6812 0.708 0.000 0.000 0.000 0.292
#> GSM711986     5  0.1908     0.7518 0.092 0.000 0.000 0.000 0.908
#> GSM711904     1  0.4268     0.5961 0.556 0.000 0.000 0.000 0.444
#> GSM711906     5  0.0162     0.8063 0.004 0.000 0.000 0.000 0.996
#> GSM711908     5  0.0290     0.8064 0.008 0.000 0.000 0.000 0.992
#> GSM711910     3  0.0000     0.8896 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.4300     0.5398 0.524 0.000 0.000 0.000 0.476
#> GSM711916     5  0.0404     0.8077 0.012 0.000 0.000 0.000 0.988
#> GSM711922     1  0.4101     0.6526 0.628 0.000 0.000 0.000 0.372
#> GSM711924     5  0.3508     0.5723 0.252 0.000 0.000 0.000 0.748
#> GSM711926     4  0.1043     0.9101 0.000 0.040 0.000 0.960 0.000
#> GSM711928     1  0.4235     0.6211 0.576 0.000 0.000 0.000 0.424
#> GSM711930     5  0.0162     0.8085 0.004 0.000 0.000 0.000 0.996
#> GSM711932     1  0.3994     0.6645 0.772 0.000 0.000 0.040 0.188
#> GSM711934     1  0.3586     0.6788 0.736 0.000 0.000 0.000 0.264
#> GSM711940     1  0.4307     0.1232 0.500 0.000 0.000 0.000 0.500
#> GSM711942     5  0.3274     0.6171 0.220 0.000 0.000 0.000 0.780
#> GSM711944     3  0.1965     0.8305 0.096 0.000 0.904 0.000 0.000
#> GSM711946     3  0.6188     0.3375 0.160 0.000 0.524 0.316 0.000
#> GSM711948     1  0.0992     0.5507 0.968 0.000 0.000 0.024 0.008
#> GSM711952     5  0.1851     0.7554 0.088 0.000 0.000 0.000 0.912
#> GSM711954     1  0.4161     0.6342 0.608 0.000 0.000 0.000 0.392
#> GSM711962     5  0.1965     0.7603 0.096 0.000 0.000 0.000 0.904
#> GSM711970     1  0.4060     0.6480 0.640 0.000 0.000 0.000 0.360
#> GSM711974     5  0.4074     0.2009 0.364 0.000 0.000 0.000 0.636
#> GSM711978     4  0.0000     0.9373 0.000 0.000 0.000 1.000 0.000
#> GSM711988     1  0.3003     0.6705 0.812 0.000 0.000 0.000 0.188
#> GSM711990     3  0.0000     0.8896 0.000 0.000 1.000 0.000 0.000
#> GSM711992     4  0.0162     0.9361 0.004 0.000 0.000 0.996 0.000
#> GSM711982     5  0.0290     0.8083 0.008 0.000 0.000 0.000 0.992
#> GSM711984     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711912     5  0.1341     0.7860 0.056 0.000 0.000 0.000 0.944
#> GSM711918     5  0.1478     0.7798 0.064 0.000 0.000 0.000 0.936
#> GSM711920     5  0.3949     0.3592 0.332 0.000 0.000 0.000 0.668
#> GSM711937     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711951     2  0.2471     0.8346 0.000 0.864 0.000 0.136 0.000
#> GSM711957     1  0.5341     0.6178 0.664 0.000 0.000 0.124 0.212
#> GSM711959     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711965     3  0.2732     0.8094 0.160 0.000 0.840 0.000 0.000
#> GSM711967     5  0.1410     0.7830 0.060 0.000 0.000 0.000 0.940
#> GSM711969     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711973     3  0.4127     0.6693 0.312 0.000 0.680 0.008 0.000
#> GSM711977     3  0.2020     0.8491 0.100 0.000 0.900 0.000 0.000
#> GSM711981     4  0.1638     0.9257 0.064 0.004 0.000 0.932 0.000
#> GSM711987     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711907     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711909     3  0.0000     0.8896 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.0000     0.8896 0.000 0.000 1.000 0.000 0.000
#> GSM711915     3  0.0404     0.8862 0.012 0.000 0.988 0.000 0.000
#> GSM711917     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711923     4  0.2798     0.8800 0.140 0.000 0.008 0.852 0.000
#> GSM711925     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0000     0.8896 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711931     2  0.2852     0.8013 0.000 0.828 0.000 0.172 0.000
#> GSM711933     1  0.3424     0.6588 0.760 0.000 0.000 0.000 0.240
#> GSM711935     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.3534     0.8079 0.256 0.000 0.000 0.744 0.000
#> GSM711943     4  0.1478     0.9259 0.064 0.000 0.000 0.936 0.000
#> GSM711945     3  0.6282     0.2012 0.156 0.000 0.476 0.368 0.000
#> GSM711947     3  0.3177     0.6766 0.000 0.208 0.792 0.000 0.000
#> GSM711949     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711955     1  0.2771     0.5027 0.860 0.000 0.128 0.000 0.012
#> GSM711963     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0000     0.8896 0.000 0.000 1.000 0.000 0.000
#> GSM711975     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711979     4  0.0000     0.9373 0.000 0.000 0.000 1.000 0.000
#> GSM711989     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711991     3  0.0162     0.8886 0.004 0.000 0.996 0.000 0.000
#> GSM711993     4  0.0000     0.9373 0.000 0.000 0.000 1.000 0.000
#> GSM711983     3  0.0000     0.8896 0.000 0.000 1.000 0.000 0.000
#> GSM711985     2  0.0000     0.9856 0.000 1.000 0.000 0.000 0.000
#> GSM711913     3  0.1965     0.8513 0.096 0.000 0.904 0.000 0.000
#> GSM711919     3  0.0000     0.8896 0.000 0.000 1.000 0.000 0.000
#> GSM711921     3  0.0000     0.8896 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711938     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711950     1  0.3857     0.4020 0.532 0.000 0.000 0.000 0.468 0.000
#> GSM711956     1  0.3062     0.6734 0.824 0.000 0.000 0.000 0.032 0.144
#> GSM711958     6  0.5725     0.1624 0.416 0.000 0.000 0.000 0.164 0.420
#> GSM711960     6  0.7638     0.0905 0.268 0.000 0.280 0.000 0.172 0.280
#> GSM711964     1  0.3314     0.6011 0.740 0.000 0.000 0.000 0.004 0.256
#> GSM711966     6  0.0363     0.6591 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711968     1  0.3202     0.6466 0.800 0.000 0.000 0.000 0.024 0.176
#> GSM711972     6  0.0458     0.6584 0.016 0.000 0.000 0.000 0.000 0.984
#> GSM711976     1  0.4520     0.6333 0.688 0.000 0.000 0.000 0.220 0.092
#> GSM711980     1  0.3006     0.6765 0.844 0.000 0.000 0.000 0.064 0.092
#> GSM711986     6  0.4508     0.2395 0.396 0.000 0.000 0.000 0.036 0.568
#> GSM711904     1  0.4065     0.6100 0.724 0.000 0.000 0.000 0.056 0.220
#> GSM711906     6  0.0363     0.6579 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711908     6  0.2858     0.5855 0.124 0.000 0.000 0.000 0.032 0.844
#> GSM711910     3  0.0000     0.8253 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711914     1  0.3817     0.5891 0.720 0.000 0.000 0.000 0.028 0.252
#> GSM711916     6  0.0458     0.6578 0.016 0.000 0.000 0.000 0.000 0.984
#> GSM711922     1  0.2573     0.6720 0.864 0.000 0.000 0.000 0.024 0.112
#> GSM711924     6  0.5304     0.4360 0.276 0.000 0.000 0.000 0.144 0.580
#> GSM711926     4  0.1010     0.8072 0.000 0.036 0.000 0.960 0.004 0.000
#> GSM711928     1  0.3551     0.6480 0.772 0.000 0.000 0.000 0.036 0.192
#> GSM711930     6  0.0260     0.6582 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM711932     1  0.4297     0.6435 0.752 0.000 0.000 0.032 0.168 0.048
#> GSM711934     1  0.4232     0.5916 0.732 0.000 0.000 0.000 0.168 0.100
#> GSM711940     6  0.5451     0.2460 0.328 0.000 0.000 0.000 0.140 0.532
#> GSM711942     6  0.5065     0.4710 0.260 0.000 0.000 0.000 0.124 0.616
#> GSM711944     3  0.4044     0.4865 0.076 0.000 0.744 0.000 0.180 0.000
#> GSM711946     5  0.5627     0.4444 0.004 0.000 0.380 0.132 0.484 0.000
#> GSM711948     1  0.3996     0.3982 0.512 0.000 0.000 0.000 0.484 0.004
#> GSM711952     6  0.4552     0.2526 0.388 0.000 0.000 0.000 0.040 0.572
#> GSM711954     1  0.3062     0.6595 0.816 0.000 0.000 0.000 0.024 0.160
#> GSM711962     6  0.2112     0.6330 0.088 0.000 0.000 0.000 0.016 0.896
#> GSM711970     1  0.2888     0.6570 0.852 0.000 0.000 0.000 0.056 0.092
#> GSM711974     6  0.5486     0.2423 0.372 0.000 0.000 0.000 0.132 0.496
#> GSM711978     4  0.0146     0.8410 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM711988     1  0.4044     0.6088 0.704 0.000 0.000 0.000 0.256 0.040
#> GSM711990     3  0.0260     0.8251 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM711992     4  0.0436     0.8371 0.004 0.000 0.000 0.988 0.004 0.004
#> GSM711982     6  0.0363     0.6591 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711984     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711912     6  0.4396     0.3356 0.352 0.000 0.000 0.000 0.036 0.612
#> GSM711918     6  0.4408     0.3279 0.356 0.000 0.000 0.000 0.036 0.608
#> GSM711920     1  0.5624    -0.0576 0.488 0.000 0.000 0.000 0.156 0.356
#> GSM711937     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711951     2  0.2912     0.7313 0.000 0.784 0.000 0.216 0.000 0.000
#> GSM711957     1  0.4294     0.6067 0.768 0.000 0.000 0.080 0.120 0.032
#> GSM711959     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711961     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711965     3  0.3982    -0.0976 0.004 0.000 0.536 0.000 0.460 0.000
#> GSM711967     6  0.2510     0.6290 0.100 0.000 0.000 0.000 0.028 0.872
#> GSM711969     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711973     5  0.4209     0.2371 0.020 0.000 0.384 0.000 0.596 0.000
#> GSM711977     3  0.2941     0.6211 0.000 0.000 0.780 0.000 0.220 0.000
#> GSM711981     4  0.2362     0.7547 0.000 0.004 0.000 0.860 0.136 0.000
#> GSM711987     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711909     3  0.0000     0.8253 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711911     3  0.0260     0.8251 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM711915     3  0.2300     0.7152 0.000 0.000 0.856 0.000 0.144 0.000
#> GSM711917     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711923     4  0.4171     0.3880 0.012 0.000 0.004 0.604 0.380 0.000
#> GSM711925     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.0000     0.8253 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711929     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     2  0.3309     0.6323 0.000 0.720 0.000 0.280 0.000 0.000
#> GSM711933     1  0.4924     0.4474 0.652 0.000 0.000 0.000 0.204 0.144
#> GSM711935     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     5  0.4453    -0.2672 0.028 0.000 0.000 0.444 0.528 0.000
#> GSM711943     4  0.3714     0.6103 0.008 0.000 0.008 0.720 0.264 0.000
#> GSM711945     5  0.5549     0.5177 0.000 0.000 0.304 0.164 0.532 0.000
#> GSM711947     3  0.3776     0.4634 0.000 0.196 0.756 0.000 0.048 0.000
#> GSM711949     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     1  0.5218     0.3180 0.464 0.000 0.068 0.000 0.460 0.008
#> GSM711963     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.0260     0.8251 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM711975     2  0.0363     0.9667 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM711979     4  0.0692     0.8378 0.004 0.000 0.000 0.976 0.020 0.000
#> GSM711989     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711991     3  0.2454     0.6551 0.000 0.000 0.840 0.000 0.160 0.000
#> GSM711993     4  0.0000     0.8406 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711983     3  0.0260     0.8251 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM711985     2  0.0000     0.9765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711913     3  0.2883     0.6345 0.000 0.000 0.788 0.000 0.212 0.000
#> GSM711919     3  0.0000     0.8253 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711921     3  0.0000     0.8253 0.000 0.000 1.000 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-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 tissue(p) disease.state(p) individual(p) k
#> SD:skmeans 88  4.87e-06           0.5469         0.842 2
#> SD:skmeans 88  2.59e-10           0.1724         0.735 3
#> SD:skmeans 86  9.38e-10           0.2772         0.303 4
#> SD:skmeans 83  3.11e-08           0.1453         0.108 5
#> SD:skmeans 68  8.62e-07           0.0593         0.013 6

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


SD:pam**

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

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

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

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

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

collect_plots(res)

plot of chunk SD-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.988       0.995         0.4130 0.585   0.585
#> 3 3 0.748           0.828       0.913         0.5666 0.690   0.498
#> 4 4 0.893           0.916       0.962         0.1368 0.914   0.750
#> 5 5 0.789           0.684       0.865         0.0846 0.860   0.532
#> 6 6 0.803           0.592       0.753         0.0322 0.891   0.537

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
#> GSM711936     2  0.0000      0.985 0.000 1.000
#> GSM711938     2  0.0000      0.985 0.000 1.000
#> GSM711950     1  0.0000      0.999 1.000 0.000
#> GSM711956     1  0.0000      0.999 1.000 0.000
#> GSM711958     1  0.0000      0.999 1.000 0.000
#> GSM711960     1  0.0000      0.999 1.000 0.000
#> GSM711964     1  0.0000      0.999 1.000 0.000
#> GSM711966     1  0.0000      0.999 1.000 0.000
#> GSM711968     1  0.0000      0.999 1.000 0.000
#> GSM711972     1  0.0000      0.999 1.000 0.000
#> GSM711976     1  0.0000      0.999 1.000 0.000
#> GSM711980     1  0.0000      0.999 1.000 0.000
#> GSM711986     1  0.0000      0.999 1.000 0.000
#> GSM711904     1  0.0000      0.999 1.000 0.000
#> GSM711906     1  0.0000      0.999 1.000 0.000
#> GSM711908     1  0.0000      0.999 1.000 0.000
#> GSM711910     1  0.0000      0.999 1.000 0.000
#> GSM711914     1  0.0000      0.999 1.000 0.000
#> GSM711916     1  0.0000      0.999 1.000 0.000
#> GSM711922     1  0.0000      0.999 1.000 0.000
#> GSM711924     1  0.0000      0.999 1.000 0.000
#> GSM711926     2  0.9129      0.517 0.328 0.672
#> GSM711928     1  0.0000      0.999 1.000 0.000
#> GSM711930     1  0.0000      0.999 1.000 0.000
#> GSM711932     1  0.0000      0.999 1.000 0.000
#> GSM711934     1  0.0000      0.999 1.000 0.000
#> GSM711940     1  0.0000      0.999 1.000 0.000
#> GSM711942     1  0.0000      0.999 1.000 0.000
#> GSM711944     1  0.0000      0.999 1.000 0.000
#> GSM711946     1  0.0000      0.999 1.000 0.000
#> GSM711948     1  0.0000      0.999 1.000 0.000
#> GSM711952     1  0.0000      0.999 1.000 0.000
#> GSM711954     1  0.0000      0.999 1.000 0.000
#> GSM711962     1  0.0000      0.999 1.000 0.000
#> GSM711970     1  0.0000      0.999 1.000 0.000
#> GSM711974     1  0.0000      0.999 1.000 0.000
#> GSM711978     1  0.0376      0.995 0.996 0.004
#> GSM711988     1  0.0000      0.999 1.000 0.000
#> GSM711990     1  0.0000      0.999 1.000 0.000
#> GSM711992     1  0.0376      0.995 0.996 0.004
#> GSM711982     1  0.0000      0.999 1.000 0.000
#> GSM711984     2  0.0000      0.985 0.000 1.000
#> GSM711912     1  0.0000      0.999 1.000 0.000
#> GSM711918     1  0.0000      0.999 1.000 0.000
#> GSM711920     1  0.0000      0.999 1.000 0.000
#> GSM711937     2  0.0000      0.985 0.000 1.000
#> GSM711939     2  0.0000      0.985 0.000 1.000
#> GSM711951     2  0.0000      0.985 0.000 1.000
#> GSM711957     1  0.0000      0.999 1.000 0.000
#> GSM711959     2  0.0000      0.985 0.000 1.000
#> GSM711961     2  0.0000      0.985 0.000 1.000
#> GSM711965     1  0.0000      0.999 1.000 0.000
#> GSM711967     1  0.0000      0.999 1.000 0.000
#> GSM711969     2  0.0000      0.985 0.000 1.000
#> GSM711973     1  0.0000      0.999 1.000 0.000
#> GSM711977     1  0.0000      0.999 1.000 0.000
#> GSM711981     1  0.1184      0.984 0.984 0.016
#> GSM711987     2  0.0000      0.985 0.000 1.000
#> GSM711905     2  0.0000      0.985 0.000 1.000
#> GSM711907     2  0.0000      0.985 0.000 1.000
#> GSM711909     1  0.0000      0.999 1.000 0.000
#> GSM711911     1  0.0000      0.999 1.000 0.000
#> GSM711915     1  0.0672      0.992 0.992 0.008
#> GSM711917     2  0.0000      0.985 0.000 1.000
#> GSM711923     1  0.0000      0.999 1.000 0.000
#> GSM711925     2  0.0000      0.985 0.000 1.000
#> GSM711927     1  0.0000      0.999 1.000 0.000
#> GSM711929     2  0.0000      0.985 0.000 1.000
#> GSM711931     2  0.0000      0.985 0.000 1.000
#> GSM711933     1  0.0000      0.999 1.000 0.000
#> GSM711935     2  0.0000      0.985 0.000 1.000
#> GSM711941     1  0.0000      0.999 1.000 0.000
#> GSM711943     1  0.0000      0.999 1.000 0.000
#> GSM711945     1  0.1414      0.980 0.980 0.020
#> GSM711947     2  0.1843      0.961 0.028 0.972
#> GSM711949     2  0.0000      0.985 0.000 1.000
#> GSM711953     2  0.0000      0.985 0.000 1.000
#> GSM711955     1  0.0000      0.999 1.000 0.000
#> GSM711963     2  0.0000      0.985 0.000 1.000
#> GSM711971     1  0.0000      0.999 1.000 0.000
#> GSM711975     2  0.0000      0.985 0.000 1.000
#> GSM711979     1  0.0000      0.999 1.000 0.000
#> GSM711989     2  0.0000      0.985 0.000 1.000
#> GSM711991     1  0.1843      0.972 0.972 0.028
#> GSM711993     2  0.1633      0.965 0.024 0.976
#> GSM711983     1  0.0000      0.999 1.000 0.000
#> GSM711985     2  0.0000      0.985 0.000 1.000
#> GSM711913     1  0.0000      0.999 1.000 0.000
#> GSM711919     1  0.0000      0.999 1.000 0.000
#> GSM711921     1  0.0000      0.999 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
#> GSM711936     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711938     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711950     3  0.6095      0.585 0.392 0.000 0.608
#> GSM711956     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711958     1  0.5650      0.350 0.688 0.000 0.312
#> GSM711960     1  0.5529      0.512 0.704 0.000 0.296
#> GSM711964     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711966     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711968     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711972     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711976     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711980     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711986     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711904     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711906     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711908     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711910     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711914     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711916     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711922     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711924     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711926     3  0.6095      0.585 0.392 0.000 0.608
#> GSM711928     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711930     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711932     1  0.6260     -0.183 0.552 0.000 0.448
#> GSM711934     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711940     3  0.6095      0.585 0.392 0.000 0.608
#> GSM711942     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711944     3  0.0237      0.789 0.004 0.000 0.996
#> GSM711946     3  0.0424      0.789 0.008 0.000 0.992
#> GSM711948     3  0.6111      0.579 0.396 0.000 0.604
#> GSM711952     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711954     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711962     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711970     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711974     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711978     3  0.6095      0.585 0.392 0.000 0.608
#> GSM711988     1  0.0592      0.941 0.988 0.000 0.012
#> GSM711990     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711992     3  0.6095      0.585 0.392 0.000 0.608
#> GSM711982     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711984     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711912     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711918     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711920     1  0.0000      0.955 1.000 0.000 0.000
#> GSM711937     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711939     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711951     3  0.6095      0.415 0.000 0.392 0.608
#> GSM711957     3  0.6111      0.579 0.396 0.000 0.604
#> GSM711959     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711961     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711965     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711967     3  0.6111      0.579 0.396 0.000 0.604
#> GSM711969     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711973     3  0.6008      0.605 0.372 0.000 0.628
#> GSM711977     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711981     3  0.6079      0.590 0.388 0.000 0.612
#> GSM711987     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711905     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711907     2  0.4504      0.713 0.000 0.804 0.196
#> GSM711909     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711911     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711915     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711917     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711923     3  0.2959      0.770 0.100 0.000 0.900
#> GSM711925     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711927     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711929     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711931     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711933     3  0.6111      0.579 0.396 0.000 0.604
#> GSM711935     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711941     3  0.5254      0.690 0.264 0.000 0.736
#> GSM711943     3  0.2959      0.770 0.100 0.000 0.900
#> GSM711945     3  0.1647      0.786 0.036 0.004 0.960
#> GSM711947     3  0.6079      0.422 0.000 0.388 0.612
#> GSM711949     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711955     3  0.4555      0.728 0.200 0.000 0.800
#> GSM711963     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711971     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711975     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711979     3  0.6095      0.585 0.392 0.000 0.608
#> GSM711989     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711991     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711993     3  0.6095      0.415 0.000 0.392 0.608
#> GSM711983     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711985     2  0.0000      0.989 0.000 1.000 0.000
#> GSM711913     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711919     3  0.0000      0.789 0.000 0.000 1.000
#> GSM711921     3  0.0000      0.789 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0707      0.968 0.000 0.980 0.000 0.020
#> GSM711938     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711950     4  0.2589      0.864 0.116 0.000 0.000 0.884
#> GSM711956     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711958     1  0.4477      0.479 0.688 0.000 0.000 0.312
#> GSM711960     3  0.3024      0.803 0.148 0.000 0.852 0.000
#> GSM711964     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711976     1  0.0188      0.966 0.996 0.000 0.000 0.004
#> GSM711980     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711906     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711910     3  0.0000      0.968 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711924     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711926     4  0.0000      0.907 0.000 0.000 0.000 1.000
#> GSM711928     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711932     1  0.4999     -0.111 0.508 0.000 0.000 0.492
#> GSM711934     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711940     4  0.2589      0.864 0.116 0.000 0.000 0.884
#> GSM711942     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711944     3  0.3355      0.800 0.004 0.000 0.836 0.160
#> GSM711946     4  0.0336      0.904 0.000 0.000 0.008 0.992
#> GSM711948     4  0.4730      0.509 0.364 0.000 0.000 0.636
#> GSM711952     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711954     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711962     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711970     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711974     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0000      0.907 0.000 0.000 0.000 1.000
#> GSM711988     1  0.0469      0.958 0.988 0.000 0.000 0.012
#> GSM711990     3  0.0000      0.968 0.000 0.000 1.000 0.000
#> GSM711992     4  0.0000      0.907 0.000 0.000 0.000 1.000
#> GSM711982     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000      0.969 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0707      0.968 0.000 0.980 0.000 0.020
#> GSM711939     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711951     4  0.0000      0.907 0.000 0.000 0.000 1.000
#> GSM711957     4  0.2868      0.851 0.136 0.000 0.000 0.864
#> GSM711959     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711965     4  0.1557      0.878 0.000 0.000 0.056 0.944
#> GSM711967     4  0.2921      0.848 0.140 0.000 0.000 0.860
#> GSM711969     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711973     4  0.4552      0.816 0.128 0.000 0.072 0.800
#> GSM711977     3  0.0921      0.951 0.000 0.000 0.972 0.028
#> GSM711981     4  0.0000      0.907 0.000 0.000 0.000 1.000
#> GSM711987     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711907     2  0.4277      0.620 0.000 0.720 0.000 0.280
#> GSM711909     3  0.0000      0.968 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000      0.968 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0000      0.968 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0000      0.907 0.000 0.000 0.000 1.000
#> GSM711925     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000      0.968 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711931     2  0.1637      0.934 0.000 0.940 0.000 0.060
#> GSM711933     4  0.3907      0.753 0.232 0.000 0.000 0.768
#> GSM711935     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0707      0.903 0.020 0.000 0.000 0.980
#> GSM711943     4  0.0000      0.907 0.000 0.000 0.000 1.000
#> GSM711945     4  0.0000      0.907 0.000 0.000 0.000 1.000
#> GSM711947     4  0.4194      0.757 0.000 0.172 0.028 0.800
#> GSM711949     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711955     4  0.3674      0.852 0.116 0.000 0.036 0.848
#> GSM711963     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0000      0.968 0.000 0.000 1.000 0.000
#> GSM711975     2  0.1022      0.959 0.000 0.968 0.000 0.032
#> GSM711979     4  0.0000      0.907 0.000 0.000 0.000 1.000
#> GSM711989     2  0.0707      0.968 0.000 0.980 0.000 0.020
#> GSM711991     4  0.0592      0.901 0.000 0.000 0.016 0.984
#> GSM711993     4  0.0000      0.907 0.000 0.000 0.000 1.000
#> GSM711983     3  0.0188      0.966 0.000 0.000 0.996 0.004
#> GSM711985     2  0.0000      0.978 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0921      0.951 0.000 0.000 0.972 0.028
#> GSM711919     3  0.0000      0.968 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000      0.968 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.1410     0.9041 0.000 0.940 0.000 0.060 0.000
#> GSM711938     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711950     5  0.4297    -0.2564 0.000 0.000 0.000 0.472 0.528
#> GSM711956     1  0.0404     0.8966 0.988 0.000 0.000 0.000 0.012
#> GSM711958     5  0.1410     0.6793 0.060 0.000 0.000 0.000 0.940
#> GSM711960     5  0.1697     0.6794 0.060 0.000 0.008 0.000 0.932
#> GSM711964     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000
#> GSM711966     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000
#> GSM711968     1  0.0290     0.8987 0.992 0.000 0.000 0.000 0.008
#> GSM711972     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000
#> GSM711976     1  0.5663     0.0363 0.508 0.000 0.000 0.080 0.412
#> GSM711980     5  0.4114     0.3769 0.376 0.000 0.000 0.000 0.624
#> GSM711986     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000
#> GSM711904     1  0.1270     0.8708 0.948 0.000 0.000 0.000 0.052
#> GSM711906     5  0.4306     0.1346 0.492 0.000 0.000 0.000 0.508
#> GSM711908     1  0.1043     0.8765 0.960 0.000 0.000 0.000 0.040
#> GSM711910     3  0.0000     0.8887 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.0290     0.8987 0.992 0.000 0.000 0.000 0.008
#> GSM711916     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000
#> GSM711922     1  0.3837     0.4520 0.692 0.000 0.000 0.000 0.308
#> GSM711924     5  0.1671     0.6797 0.076 0.000 0.000 0.000 0.924
#> GSM711926     4  0.0000     0.7249 0.000 0.000 0.000 1.000 0.000
#> GSM711928     1  0.1043     0.8813 0.960 0.000 0.000 0.000 0.040
#> GSM711930     1  0.0404     0.8964 0.988 0.000 0.000 0.000 0.012
#> GSM711932     5  0.3612     0.5109 0.000 0.000 0.000 0.268 0.732
#> GSM711934     1  0.4015     0.3545 0.652 0.000 0.000 0.000 0.348
#> GSM711940     5  0.4825     0.0184 0.024 0.000 0.000 0.408 0.568
#> GSM711942     5  0.4283     0.2258 0.456 0.000 0.000 0.000 0.544
#> GSM711944     5  0.1197     0.6214 0.000 0.000 0.048 0.000 0.952
#> GSM711946     4  0.4030     0.4885 0.000 0.000 0.000 0.648 0.352
#> GSM711948     5  0.1965     0.6288 0.096 0.000 0.000 0.000 0.904
#> GSM711952     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000
#> GSM711954     5  0.4273     0.2331 0.448 0.000 0.000 0.000 0.552
#> GSM711962     5  0.3395     0.5680 0.236 0.000 0.000 0.000 0.764
#> GSM711970     5  0.4305     0.1403 0.488 0.000 0.000 0.000 0.512
#> GSM711974     1  0.2561     0.7512 0.856 0.000 0.000 0.000 0.144
#> GSM711978     4  0.0000     0.7249 0.000 0.000 0.000 1.000 0.000
#> GSM711988     5  0.1597     0.6754 0.048 0.000 0.000 0.012 0.940
#> GSM711990     3  0.3612     0.7259 0.000 0.000 0.732 0.000 0.268
#> GSM711992     4  0.0000     0.7249 0.000 0.000 0.000 1.000 0.000
#> GSM711982     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000
#> GSM711984     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711912     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000
#> GSM711918     1  0.0000     0.9008 1.000 0.000 0.000 0.000 0.000
#> GSM711920     5  0.3180     0.6594 0.068 0.000 0.000 0.076 0.856
#> GSM711937     2  0.1270     0.9118 0.000 0.948 0.000 0.052 0.000
#> GSM711939     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711951     4  0.0000     0.7249 0.000 0.000 0.000 1.000 0.000
#> GSM711957     5  0.3612     0.5109 0.000 0.000 0.000 0.268 0.732
#> GSM711959     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711965     4  0.5450     0.3030 0.000 0.000 0.060 0.496 0.444
#> GSM711967     5  0.3612     0.5109 0.000 0.000 0.000 0.268 0.732
#> GSM711969     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711973     5  0.4356     0.0875 0.012 0.000 0.000 0.340 0.648
#> GSM711977     3  0.4150     0.5437 0.000 0.000 0.612 0.000 0.388
#> GSM711981     4  0.0000     0.7249 0.000 0.000 0.000 1.000 0.000
#> GSM711987     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711907     4  0.4291    -0.0581 0.000 0.464 0.000 0.536 0.000
#> GSM711909     3  0.0000     0.8887 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.0000     0.8887 0.000 0.000 1.000 0.000 0.000
#> GSM711915     3  0.1410     0.8673 0.000 0.000 0.940 0.000 0.060
#> GSM711917     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711923     4  0.2891     0.6270 0.000 0.000 0.000 0.824 0.176
#> GSM711925     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0000     0.8887 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711931     4  0.4306    -0.1480 0.000 0.492 0.000 0.508 0.000
#> GSM711933     5  0.1410     0.6793 0.060 0.000 0.000 0.000 0.940
#> GSM711935     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.3857     0.5171 0.000 0.000 0.000 0.688 0.312
#> GSM711943     4  0.0000     0.7249 0.000 0.000 0.000 1.000 0.000
#> GSM711945     4  0.3274     0.6081 0.000 0.000 0.000 0.780 0.220
#> GSM711947     4  0.6257     0.2224 0.000 0.148 0.392 0.460 0.000
#> GSM711949     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711955     5  0.0000     0.6415 0.000 0.000 0.000 0.000 1.000
#> GSM711963     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0000     0.8887 0.000 0.000 1.000 0.000 0.000
#> GSM711975     2  0.4235     0.3075 0.000 0.576 0.000 0.424 0.000
#> GSM711979     4  0.2891     0.6270 0.000 0.000 0.000 0.824 0.176
#> GSM711989     2  0.3395     0.6906 0.000 0.764 0.000 0.236 0.000
#> GSM711991     4  0.5772     0.3555 0.000 0.000 0.328 0.564 0.108
#> GSM711993     4  0.0000     0.7249 0.000 0.000 0.000 1.000 0.000
#> GSM711983     3  0.3612     0.7259 0.000 0.000 0.732 0.000 0.268
#> GSM711985     2  0.0000     0.9555 0.000 1.000 0.000 0.000 0.000
#> GSM711913     3  0.2230     0.8434 0.000 0.000 0.884 0.000 0.116
#> GSM711919     3  0.0000     0.8887 0.000 0.000 1.000 0.000 0.000
#> GSM711921     3  0.0000     0.8887 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     5  0.3737     0.0857 0.000 0.392 0.000 0.000 0.608 0.000
#> GSM711938     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711950     4  0.2135     0.6941 0.128 0.000 0.000 0.872 0.000 0.000
#> GSM711956     6  0.0363     0.9339 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711958     1  0.0000     0.8576 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711960     1  0.0000     0.8576 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711964     6  0.0000     0.9385 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711966     6  0.0000     0.9385 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711968     6  0.0260     0.9362 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM711972     6  0.0000     0.9385 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711976     6  0.4780     0.5484 0.112 0.000 0.000 0.000 0.228 0.660
#> GSM711980     1  0.1444     0.8564 0.928 0.000 0.000 0.000 0.000 0.072
#> GSM711986     6  0.0000     0.9385 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711904     6  0.0790     0.9222 0.032 0.000 0.000 0.000 0.000 0.968
#> GSM711906     1  0.2664     0.7976 0.816 0.000 0.000 0.000 0.000 0.184
#> GSM711908     6  0.0547     0.9281 0.020 0.000 0.000 0.000 0.000 0.980
#> GSM711910     3  0.0000     0.8716 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711914     6  0.0260     0.9362 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM711916     6  0.0000     0.9385 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711922     1  0.3659     0.5091 0.636 0.000 0.000 0.000 0.000 0.364
#> GSM711924     1  0.0458     0.8597 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM711926     5  0.3851    -0.4866 0.000 0.000 0.000 0.460 0.540 0.000
#> GSM711928     6  0.0632     0.9285 0.024 0.000 0.000 0.000 0.000 0.976
#> GSM711930     6  0.0363     0.9337 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711932     1  0.1349     0.8420 0.940 0.000 0.000 0.004 0.056 0.000
#> GSM711934     1  0.3578     0.5594 0.660 0.000 0.000 0.000 0.000 0.340
#> GSM711940     4  0.3864     0.2455 0.480 0.000 0.000 0.520 0.000 0.000
#> GSM711942     1  0.1910     0.8440 0.892 0.000 0.000 0.000 0.000 0.108
#> GSM711944     1  0.0547     0.8533 0.980 0.000 0.020 0.000 0.000 0.000
#> GSM711946     4  0.2006     0.7128 0.080 0.000 0.000 0.904 0.016 0.000
#> GSM711948     1  0.1910     0.8208 0.892 0.000 0.000 0.000 0.000 0.108
#> GSM711952     6  0.0000     0.9385 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711954     1  0.2378     0.8227 0.848 0.000 0.000 0.000 0.000 0.152
#> GSM711962     1  0.0865     0.8609 0.964 0.000 0.000 0.000 0.000 0.036
#> GSM711970     1  0.2048     0.8385 0.880 0.000 0.000 0.000 0.000 0.120
#> GSM711974     6  0.3864    -0.1079 0.480 0.000 0.000 0.000 0.000 0.520
#> GSM711978     4  0.3499     0.6725 0.000 0.000 0.000 0.680 0.320 0.000
#> GSM711988     1  0.0000     0.8576 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711990     3  0.5284     0.6178 0.080 0.040 0.652 0.228 0.000 0.000
#> GSM711992     4  0.3789     0.5952 0.000 0.000 0.000 0.584 0.416 0.000
#> GSM711982     6  0.0000     0.9385 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711984     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711912     6  0.0000     0.9385 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711918     6  0.0000     0.9385 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711920     1  0.0909     0.8596 0.968 0.000 0.000 0.000 0.020 0.012
#> GSM711937     5  0.3789     0.0496 0.000 0.416 0.000 0.000 0.584 0.000
#> GSM711939     5  0.3789     0.0496 0.000 0.416 0.000 0.000 0.584 0.000
#> GSM711951     5  0.3620    -0.3307 0.000 0.000 0.000 0.352 0.648 0.000
#> GSM711957     1  0.3426     0.6024 0.720 0.000 0.000 0.004 0.276 0.000
#> GSM711959     5  0.3843    -0.0775 0.000 0.452 0.000 0.000 0.548 0.000
#> GSM711961     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711965     4  0.1908     0.7069 0.096 0.004 0.000 0.900 0.000 0.000
#> GSM711967     1  0.3534     0.5963 0.716 0.000 0.000 0.008 0.276 0.000
#> GSM711969     5  0.3789     0.0496 0.000 0.416 0.000 0.000 0.584 0.000
#> GSM711973     4  0.5395     0.2125 0.096 0.328 0.000 0.564 0.000 0.012
#> GSM711977     2  0.6127    -0.4578 0.000 0.352 0.328 0.320 0.000 0.000
#> GSM711981     5  0.3854    -0.4963 0.000 0.000 0.000 0.464 0.536 0.000
#> GSM711987     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711905     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711907     5  0.1075     0.3855 0.000 0.000 0.000 0.048 0.952 0.000
#> GSM711909     3  0.0000     0.8716 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711911     3  0.1007     0.8539 0.000 0.044 0.956 0.000 0.000 0.000
#> GSM711915     2  0.6127    -0.4578 0.000 0.352 0.328 0.320 0.000 0.000
#> GSM711917     5  0.3789     0.0496 0.000 0.416 0.000 0.000 0.584 0.000
#> GSM711923     4  0.4087     0.6866 0.036 0.000 0.000 0.688 0.276 0.000
#> GSM711925     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711927     3  0.0000     0.8716 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711929     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711931     5  0.0260     0.3849 0.000 0.000 0.000 0.008 0.992 0.000
#> GSM711933     1  0.0000     0.8576 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711935     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711941     4  0.2134     0.7255 0.044 0.000 0.000 0.904 0.052 0.000
#> GSM711943     4  0.3499     0.6725 0.000 0.000 0.000 0.680 0.320 0.000
#> GSM711945     4  0.2070     0.7171 0.048 0.000 0.000 0.908 0.044 0.000
#> GSM711947     3  0.5137     0.3436 0.000 0.000 0.552 0.096 0.352 0.000
#> GSM711949     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711953     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711955     1  0.1863     0.7878 0.896 0.000 0.000 0.104 0.000 0.000
#> GSM711963     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711971     3  0.0000     0.8716 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711975     5  0.0937     0.3738 0.000 0.040 0.000 0.000 0.960 0.000
#> GSM711979     4  0.4127     0.6829 0.036 0.000 0.000 0.680 0.284 0.000
#> GSM711989     5  0.3288     0.2089 0.000 0.276 0.000 0.000 0.724 0.000
#> GSM711991     4  0.1913     0.6765 0.012 0.000 0.080 0.908 0.000 0.000
#> GSM711993     4  0.3864     0.5305 0.000 0.000 0.000 0.520 0.480 0.000
#> GSM711983     3  0.4247     0.6405 0.060 0.000 0.700 0.240 0.000 0.000
#> GSM711985     2  0.3620     0.5868 0.000 0.648 0.000 0.000 0.352 0.000
#> GSM711913     2  0.6127    -0.4578 0.000 0.352 0.328 0.320 0.000 0.000
#> GSM711919     3  0.0000     0.8716 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711921     3  0.0000     0.8716 0.000 0.000 1.000 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-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 tissue(p) disease.state(p) individual(p) k
#> SD:pam 90  7.70e-05            0.240         0.587 2
#> SD:pam 85  7.04e-11            0.482         0.801 3
#> SD:pam 88  4.01e-10            0.142         0.549 4
#> SD:pam 72  4.01e-07            0.185         0.210 5
#> SD:pam 70  1.48e-06            0.179         0.355 6

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


SD:mclust

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

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

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

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

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

collect_plots(res)

plot of chunk SD-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.810           0.941       0.968         0.4150 0.594   0.594
#> 3 3 0.778           0.859       0.904         0.5328 0.716   0.533
#> 4 4 0.890           0.885       0.945         0.1309 0.919   0.768
#> 5 5 0.757           0.752       0.862         0.0538 0.906   0.704
#> 6 6 0.699           0.644       0.775         0.0587 0.884   0.585

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
#> GSM711936     2   0.000      0.973 0.000 1.000
#> GSM711938     2   0.000      0.973 0.000 1.000
#> GSM711950     1   0.000      0.963 1.000 0.000
#> GSM711956     1   0.000      0.963 1.000 0.000
#> GSM711958     1   0.000      0.963 1.000 0.000
#> GSM711960     1   0.000      0.963 1.000 0.000
#> GSM711964     1   0.000      0.963 1.000 0.000
#> GSM711966     1   0.000      0.963 1.000 0.000
#> GSM711968     1   0.000      0.963 1.000 0.000
#> GSM711972     1   0.000      0.963 1.000 0.000
#> GSM711976     1   0.000      0.963 1.000 0.000
#> GSM711980     1   0.000      0.963 1.000 0.000
#> GSM711986     1   0.000      0.963 1.000 0.000
#> GSM711904     1   0.000      0.963 1.000 0.000
#> GSM711906     1   0.000      0.963 1.000 0.000
#> GSM711908     1   0.000      0.963 1.000 0.000
#> GSM711910     1   0.529      0.894 0.880 0.120
#> GSM711914     1   0.000      0.963 1.000 0.000
#> GSM711916     1   0.000      0.963 1.000 0.000
#> GSM711922     1   0.000      0.963 1.000 0.000
#> GSM711924     1   0.000      0.963 1.000 0.000
#> GSM711926     1   0.242      0.944 0.960 0.040
#> GSM711928     1   0.000      0.963 1.000 0.000
#> GSM711930     1   0.000      0.963 1.000 0.000
#> GSM711932     1   0.000      0.963 1.000 0.000
#> GSM711934     1   0.000      0.963 1.000 0.000
#> GSM711940     1   0.000      0.963 1.000 0.000
#> GSM711942     1   0.000      0.963 1.000 0.000
#> GSM711944     1   0.000      0.963 1.000 0.000
#> GSM711946     1   0.456      0.915 0.904 0.096
#> GSM711948     1   0.000      0.963 1.000 0.000
#> GSM711952     1   0.000      0.963 1.000 0.000
#> GSM711954     1   0.000      0.963 1.000 0.000
#> GSM711962     1   0.000      0.963 1.000 0.000
#> GSM711970     1   0.000      0.963 1.000 0.000
#> GSM711974     1   0.000      0.963 1.000 0.000
#> GSM711978     1   0.242      0.944 0.960 0.040
#> GSM711988     1   0.000      0.963 1.000 0.000
#> GSM711990     1   0.456      0.912 0.904 0.096
#> GSM711992     1   0.242      0.944 0.960 0.040
#> GSM711982     1   0.000      0.963 1.000 0.000
#> GSM711984     2   0.000      0.973 0.000 1.000
#> GSM711912     1   0.000      0.963 1.000 0.000
#> GSM711918     1   0.000      0.963 1.000 0.000
#> GSM711920     1   0.000      0.963 1.000 0.000
#> GSM711937     2   0.000      0.973 0.000 1.000
#> GSM711939     2   0.000      0.973 0.000 1.000
#> GSM711951     2   0.000      0.973 0.000 1.000
#> GSM711957     1   0.000      0.963 1.000 0.000
#> GSM711959     2   0.000      0.973 0.000 1.000
#> GSM711961     2   0.000      0.973 0.000 1.000
#> GSM711965     1   0.343      0.933 0.936 0.064
#> GSM711967     1   0.000      0.963 1.000 0.000
#> GSM711969     2   0.000      0.973 0.000 1.000
#> GSM711973     1   0.000      0.963 1.000 0.000
#> GSM711977     1   0.430      0.918 0.912 0.088
#> GSM711981     2   0.981      0.265 0.420 0.580
#> GSM711987     2   0.000      0.973 0.000 1.000
#> GSM711905     2   0.000      0.973 0.000 1.000
#> GSM711907     2   0.000      0.973 0.000 1.000
#> GSM711909     1   0.529      0.894 0.880 0.120
#> GSM711911     1   0.529      0.894 0.880 0.120
#> GSM711915     1   0.529      0.894 0.880 0.120
#> GSM711917     2   0.000      0.973 0.000 1.000
#> GSM711923     1   0.260      0.942 0.956 0.044
#> GSM711925     2   0.000      0.973 0.000 1.000
#> GSM711927     1   0.529      0.894 0.880 0.120
#> GSM711929     2   0.000      0.973 0.000 1.000
#> GSM711931     2   0.000      0.973 0.000 1.000
#> GSM711933     1   0.000      0.963 1.000 0.000
#> GSM711935     2   0.000      0.973 0.000 1.000
#> GSM711941     1   0.242      0.944 0.960 0.040
#> GSM711943     1   0.311      0.937 0.944 0.056
#> GSM711945     1   0.625      0.863 0.844 0.156
#> GSM711947     1   0.634      0.859 0.840 0.160
#> GSM711949     2   0.000      0.973 0.000 1.000
#> GSM711953     2   0.000      0.973 0.000 1.000
#> GSM711955     1   0.000      0.963 1.000 0.000
#> GSM711963     2   0.000      0.973 0.000 1.000
#> GSM711971     1   0.529      0.894 0.880 0.120
#> GSM711975     2   0.000      0.973 0.000 1.000
#> GSM711979     1   0.242      0.944 0.960 0.040
#> GSM711989     2   0.000      0.973 0.000 1.000
#> GSM711991     1   0.634      0.859 0.840 0.160
#> GSM711993     2   0.722      0.738 0.200 0.800
#> GSM711983     1   0.529      0.894 0.880 0.120
#> GSM711985     2   0.000      0.973 0.000 1.000
#> GSM711913     1   0.430      0.918 0.912 0.088
#> GSM711919     1   0.529      0.894 0.880 0.120
#> GSM711921     1   0.529      0.894 0.880 0.120

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM711936     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711938     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711950     3  0.6154      0.652 0.408 0.000 0.592
#> GSM711956     1  0.1753      0.941 0.952 0.000 0.048
#> GSM711958     1  0.2165      0.941 0.936 0.000 0.064
#> GSM711960     1  0.5178      0.668 0.744 0.000 0.256
#> GSM711964     1  0.1289      0.937 0.968 0.000 0.032
#> GSM711966     1  0.2066      0.942 0.940 0.000 0.060
#> GSM711968     1  0.1411      0.939 0.964 0.000 0.036
#> GSM711972     1  0.2165      0.941 0.936 0.000 0.064
#> GSM711976     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711980     1  0.0237      0.925 0.996 0.000 0.004
#> GSM711986     1  0.2165      0.941 0.936 0.000 0.064
#> GSM711904     1  0.2165      0.941 0.936 0.000 0.064
#> GSM711906     1  0.2537      0.933 0.920 0.000 0.080
#> GSM711908     1  0.2711      0.927 0.912 0.000 0.088
#> GSM711910     3  0.0000      0.771 0.000 0.000 1.000
#> GSM711914     1  0.2066      0.942 0.940 0.000 0.060
#> GSM711916     1  0.2261      0.939 0.932 0.000 0.068
#> GSM711922     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711924     1  0.2356      0.937 0.928 0.000 0.072
#> GSM711926     3  0.6600      0.680 0.384 0.012 0.604
#> GSM711928     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711930     1  0.2711      0.927 0.912 0.000 0.088
#> GSM711932     1  0.4452      0.642 0.808 0.000 0.192
#> GSM711934     1  0.1411      0.939 0.964 0.000 0.036
#> GSM711940     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711942     1  0.2261      0.939 0.932 0.000 0.068
#> GSM711944     3  0.5591      0.679 0.304 0.000 0.696
#> GSM711946     3  0.6062      0.683 0.384 0.000 0.616
#> GSM711948     1  0.0237      0.923 0.996 0.000 0.004
#> GSM711952     1  0.2165      0.941 0.936 0.000 0.064
#> GSM711954     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711962     1  0.2066      0.942 0.940 0.000 0.060
#> GSM711970     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711974     1  0.2165      0.941 0.936 0.000 0.064
#> GSM711978     3  0.6600      0.680 0.384 0.012 0.604
#> GSM711988     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711990     3  0.0237      0.772 0.004 0.000 0.996
#> GSM711992     3  0.6600      0.680 0.384 0.012 0.604
#> GSM711982     1  0.2165      0.941 0.936 0.000 0.064
#> GSM711984     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711912     1  0.2537      0.933 0.920 0.000 0.080
#> GSM711918     1  0.2537      0.933 0.920 0.000 0.080
#> GSM711920     1  0.2165      0.941 0.936 0.000 0.064
#> GSM711937     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711939     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711951     2  0.4062      0.784 0.000 0.836 0.164
#> GSM711957     3  0.5785      0.658 0.332 0.000 0.668
#> GSM711959     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711961     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711965     3  0.6008      0.693 0.372 0.000 0.628
#> GSM711967     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711969     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711973     3  0.5733      0.663 0.324 0.000 0.676
#> GSM711977     3  0.0000      0.771 0.000 0.000 1.000
#> GSM711981     3  0.8608      0.654 0.192 0.204 0.604
#> GSM711987     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711905     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711907     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711909     3  0.0000      0.771 0.000 0.000 1.000
#> GSM711911     3  0.0000      0.771 0.000 0.000 1.000
#> GSM711915     3  0.0000      0.771 0.000 0.000 1.000
#> GSM711917     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711923     3  0.6062      0.683 0.384 0.000 0.616
#> GSM711925     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711927     3  0.0000      0.771 0.000 0.000 1.000
#> GSM711929     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711931     2  0.4291      0.760 0.000 0.820 0.180
#> GSM711933     1  0.0237      0.923 0.996 0.000 0.004
#> GSM711935     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711941     3  0.6111      0.668 0.396 0.000 0.604
#> GSM711943     3  0.6062      0.683 0.384 0.000 0.616
#> GSM711945     3  0.6667      0.691 0.368 0.016 0.616
#> GSM711947     3  0.0747      0.764 0.000 0.016 0.984
#> GSM711949     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711955     1  0.4702      0.598 0.788 0.000 0.212
#> GSM711963     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711971     3  0.0000      0.771 0.000 0.000 1.000
#> GSM711975     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711979     3  0.6600      0.680 0.384 0.012 0.604
#> GSM711989     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711991     3  0.1774      0.772 0.024 0.016 0.960
#> GSM711993     3  0.8258      0.548 0.112 0.284 0.604
#> GSM711983     3  0.0237      0.772 0.004 0.000 0.996
#> GSM711985     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711913     3  0.0000      0.771 0.000 0.000 1.000
#> GSM711919     3  0.0000      0.771 0.000 0.000 1.000
#> GSM711921     3  0.0000      0.771 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000      0.991 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000      0.991 0.000 1.000 0.000 0.000
#> GSM711950     4  0.3219      0.726 0.164 0.000 0.000 0.836
#> GSM711956     1  0.0592      0.938 0.984 0.000 0.000 0.016
#> GSM711958     1  0.0336      0.938 0.992 0.000 0.000 0.008
#> GSM711960     1  0.2921      0.812 0.860 0.000 0.000 0.140
#> GSM711964     1  0.0592      0.938 0.984 0.000 0.000 0.016
#> GSM711966     1  0.0336      0.939 0.992 0.000 0.000 0.008
#> GSM711968     1  0.0817      0.936 0.976 0.000 0.000 0.024
#> GSM711972     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM711976     1  0.2469      0.890 0.892 0.000 0.000 0.108
#> GSM711980     1  0.1867      0.917 0.928 0.000 0.000 0.072
#> GSM711986     1  0.0336      0.939 0.992 0.000 0.000 0.008
#> GSM711904     1  0.0817      0.937 0.976 0.000 0.000 0.024
#> GSM711906     1  0.0188      0.938 0.996 0.000 0.000 0.004
#> GSM711908     1  0.0188      0.938 0.996 0.000 0.000 0.004
#> GSM711910     3  0.0188      0.885 0.000 0.000 0.996 0.004
#> GSM711914     1  0.0188      0.939 0.996 0.000 0.000 0.004
#> GSM711916     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM711922     1  0.1940      0.915 0.924 0.000 0.000 0.076
#> GSM711924     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM711926     4  0.0469      0.894 0.000 0.012 0.000 0.988
#> GSM711928     1  0.1389      0.927 0.952 0.000 0.000 0.048
#> GSM711930     1  0.0188      0.938 0.996 0.000 0.000 0.004
#> GSM711932     4  0.4967      0.122 0.452 0.000 0.000 0.548
#> GSM711934     1  0.0336      0.939 0.992 0.000 0.000 0.008
#> GSM711940     1  0.3074      0.848 0.848 0.000 0.000 0.152
#> GSM711942     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM711944     1  0.6016      0.182 0.544 0.000 0.044 0.412
#> GSM711946     4  0.1022      0.881 0.000 0.000 0.032 0.968
#> GSM711948     1  0.3074      0.848 0.848 0.000 0.000 0.152
#> GSM711952     1  0.0469      0.939 0.988 0.000 0.000 0.012
#> GSM711954     1  0.2921      0.860 0.860 0.000 0.000 0.140
#> GSM711962     1  0.0188      0.939 0.996 0.000 0.000 0.004
#> GSM711970     1  0.1940      0.915 0.924 0.000 0.000 0.076
#> GSM711974     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0469      0.894 0.000 0.012 0.000 0.988
#> GSM711988     1  0.1867      0.917 0.928 0.000 0.000 0.072
#> GSM711990     3  0.3933      0.744 0.008 0.000 0.792 0.200
#> GSM711992     4  0.0469      0.894 0.000 0.012 0.000 0.988
#> GSM711982     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000      0.991 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0188      0.938 0.996 0.000 0.000 0.004
#> GSM711918     1  0.0188      0.938 0.996 0.000 0.000 0.004
#> GSM711920     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000      0.991 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000      0.991 0.000 1.000 0.000 0.000
#> GSM711951     2  0.1389      0.950 0.000 0.952 0.000 0.048
#> GSM711957     4  0.4419      0.735 0.152 0.004 0.040 0.804
#> GSM711959     2  0.0000      0.991 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0188      0.991 0.000 0.996 0.004 0.000
#> GSM711965     4  0.0592      0.892 0.000 0.000 0.016 0.984
#> GSM711967     1  0.1940      0.915 0.924 0.000 0.000 0.076
#> GSM711969     2  0.0000      0.991 0.000 1.000 0.000 0.000
#> GSM711973     4  0.4224      0.746 0.144 0.000 0.044 0.812
#> GSM711977     3  0.4866      0.354 0.000 0.000 0.596 0.404
#> GSM711981     4  0.0469      0.894 0.000 0.012 0.000 0.988
#> GSM711987     2  0.0524      0.989 0.000 0.988 0.004 0.008
#> GSM711905     2  0.0524      0.989 0.000 0.988 0.004 0.008
#> GSM711907     2  0.0000      0.991 0.000 1.000 0.000 0.000
#> GSM711909     3  0.0188      0.885 0.000 0.000 0.996 0.004
#> GSM711911     3  0.0188      0.885 0.000 0.000 0.996 0.004
#> GSM711915     3  0.0188      0.885 0.000 0.000 0.996 0.004
#> GSM711917     2  0.0000      0.991 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0592      0.892 0.000 0.000 0.016 0.984
#> GSM711925     2  0.0188      0.991 0.000 0.996 0.004 0.000
#> GSM711927     3  0.0188      0.885 0.000 0.000 0.996 0.004
#> GSM711929     2  0.0524      0.989 0.000 0.988 0.004 0.008
#> GSM711931     2  0.1211      0.958 0.000 0.960 0.000 0.040
#> GSM711933     1  0.1792      0.919 0.932 0.000 0.000 0.068
#> GSM711935     2  0.0524      0.989 0.000 0.988 0.004 0.008
#> GSM711941     4  0.0657      0.891 0.012 0.000 0.004 0.984
#> GSM711943     4  0.0592      0.892 0.000 0.000 0.016 0.984
#> GSM711945     4  0.0592      0.892 0.000 0.000 0.016 0.984
#> GSM711947     3  0.0188      0.885 0.000 0.000 0.996 0.004
#> GSM711949     2  0.0524      0.989 0.000 0.988 0.004 0.008
#> GSM711953     2  0.0524      0.989 0.000 0.988 0.004 0.008
#> GSM711955     1  0.4872      0.502 0.640 0.000 0.004 0.356
#> GSM711963     2  0.0524      0.989 0.000 0.988 0.004 0.008
#> GSM711971     3  0.3088      0.808 0.008 0.000 0.864 0.128
#> GSM711975     2  0.0592      0.980 0.000 0.984 0.000 0.016
#> GSM711979     4  0.0469      0.894 0.000 0.012 0.000 0.988
#> GSM711989     2  0.0000      0.991 0.000 1.000 0.000 0.000
#> GSM711991     3  0.0336      0.883 0.000 0.000 0.992 0.008
#> GSM711993     4  0.0707      0.888 0.000 0.020 0.000 0.980
#> GSM711983     3  0.3933      0.744 0.008 0.000 0.792 0.200
#> GSM711985     2  0.0000      0.991 0.000 1.000 0.000 0.000
#> GSM711913     3  0.4866      0.354 0.000 0.000 0.596 0.404
#> GSM711919     3  0.0188      0.885 0.000 0.000 0.996 0.004
#> GSM711921     3  0.0188      0.885 0.000 0.000 0.996 0.004

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.0609      0.929 0.000 0.980 0.000 0.020 0.000
#> GSM711938     2  0.0912      0.935 0.000 0.972 0.000 0.012 0.016
#> GSM711950     1  0.4238      0.654 0.768 0.000 0.000 0.164 0.068
#> GSM711956     1  0.0404      0.822 0.988 0.000 0.000 0.000 0.012
#> GSM711958     1  0.4171      0.117 0.604 0.000 0.000 0.000 0.396
#> GSM711960     5  0.3838      0.854 0.280 0.000 0.000 0.004 0.716
#> GSM711964     1  0.0693      0.825 0.980 0.000 0.000 0.012 0.008
#> GSM711966     1  0.0671      0.822 0.980 0.000 0.000 0.004 0.016
#> GSM711968     1  0.0579      0.825 0.984 0.000 0.000 0.008 0.008
#> GSM711972     1  0.1197      0.811 0.952 0.000 0.000 0.000 0.048
#> GSM711976     1  0.2580      0.782 0.892 0.000 0.000 0.044 0.064
#> GSM711980     1  0.0880      0.826 0.968 0.000 0.000 0.032 0.000
#> GSM711986     1  0.2516      0.750 0.860 0.000 0.000 0.000 0.140
#> GSM711904     1  0.2997      0.736 0.840 0.000 0.000 0.012 0.148
#> GSM711906     5  0.3480      0.900 0.248 0.000 0.000 0.000 0.752
#> GSM711908     5  0.3003      0.932 0.188 0.000 0.000 0.000 0.812
#> GSM711910     3  0.0000      0.779 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.1043      0.813 0.960 0.000 0.000 0.000 0.040
#> GSM711916     5  0.3210      0.934 0.212 0.000 0.000 0.000 0.788
#> GSM711922     1  0.0880      0.826 0.968 0.000 0.000 0.032 0.000
#> GSM711924     1  0.3242      0.624 0.784 0.000 0.000 0.000 0.216
#> GSM711926     4  0.2713      0.810 0.020 0.008 0.008 0.896 0.068
#> GSM711928     1  0.0955      0.826 0.968 0.000 0.000 0.028 0.004
#> GSM711930     5  0.3003      0.932 0.188 0.000 0.000 0.000 0.812
#> GSM711932     1  0.1740      0.813 0.932 0.000 0.000 0.056 0.012
#> GSM711934     1  0.2230      0.769 0.884 0.000 0.000 0.000 0.116
#> GSM711940     1  0.1121      0.822 0.956 0.000 0.000 0.044 0.000
#> GSM711942     1  0.1608      0.801 0.928 0.000 0.000 0.000 0.072
#> GSM711944     4  0.6840      0.183 0.396 0.000 0.100 0.456 0.048
#> GSM711946     4  0.0807      0.811 0.012 0.000 0.012 0.976 0.000
#> GSM711948     1  0.3183      0.783 0.872 0.000 0.020 0.060 0.048
#> GSM711952     1  0.2852      0.708 0.828 0.000 0.000 0.000 0.172
#> GSM711954     1  0.1121      0.822 0.956 0.000 0.000 0.044 0.000
#> GSM711962     1  0.1430      0.812 0.944 0.000 0.000 0.004 0.052
#> GSM711970     1  0.0880      0.826 0.968 0.000 0.000 0.032 0.000
#> GSM711974     1  0.4114      0.137 0.624 0.000 0.000 0.000 0.376
#> GSM711978     4  0.2304      0.811 0.020 0.004 0.000 0.908 0.068
#> GSM711988     1  0.0880      0.826 0.968 0.000 0.000 0.032 0.000
#> GSM711990     3  0.6355      0.214 0.060 0.000 0.484 0.412 0.044
#> GSM711992     4  0.2304      0.811 0.020 0.004 0.000 0.908 0.068
#> GSM711982     1  0.1197      0.810 0.952 0.000 0.000 0.000 0.048
#> GSM711984     2  0.0000      0.935 0.000 1.000 0.000 0.000 0.000
#> GSM711912     1  0.4306     -0.226 0.508 0.000 0.000 0.000 0.492
#> GSM711918     1  0.4307     -0.239 0.504 0.000 0.000 0.000 0.496
#> GSM711920     1  0.2280      0.768 0.880 0.000 0.000 0.000 0.120
#> GSM711937     2  0.0000      0.935 0.000 1.000 0.000 0.000 0.000
#> GSM711939     2  0.0000      0.935 0.000 1.000 0.000 0.000 0.000
#> GSM711951     2  0.2660      0.862 0.000 0.864 0.000 0.128 0.008
#> GSM711957     4  0.5296      0.682 0.100 0.000 0.036 0.728 0.136
#> GSM711959     2  0.0000      0.935 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.2573      0.923 0.000 0.880 0.000 0.016 0.104
#> GSM711965     4  0.1877      0.787 0.064 0.000 0.012 0.924 0.000
#> GSM711967     1  0.1043      0.824 0.960 0.000 0.000 0.040 0.000
#> GSM711969     2  0.0000      0.935 0.000 1.000 0.000 0.000 0.000
#> GSM711973     4  0.5627      0.520 0.240 0.000 0.044 0.664 0.052
#> GSM711977     3  0.4201      0.444 0.000 0.000 0.592 0.408 0.000
#> GSM711981     4  0.2833      0.805 0.020 0.024 0.000 0.888 0.068
#> GSM711987     2  0.2964      0.916 0.000 0.856 0.000 0.024 0.120
#> GSM711905     2  0.2964      0.916 0.000 0.856 0.000 0.024 0.120
#> GSM711907     2  0.0609      0.929 0.000 0.980 0.000 0.020 0.000
#> GSM711909     3  0.0000      0.779 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.3999      0.541 0.000 0.000 0.656 0.344 0.000
#> GSM711915     3  0.0000      0.779 0.000 0.000 1.000 0.000 0.000
#> GSM711917     2  0.0000      0.935 0.000 1.000 0.000 0.000 0.000
#> GSM711923     4  0.0912      0.811 0.016 0.000 0.012 0.972 0.000
#> GSM711925     2  0.2573      0.923 0.000 0.880 0.000 0.016 0.104
#> GSM711927     3  0.0000      0.779 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.2964      0.916 0.000 0.856 0.000 0.024 0.120
#> GSM711931     2  0.2645      0.870 0.000 0.888 0.000 0.044 0.068
#> GSM711933     1  0.1772      0.823 0.940 0.000 0.020 0.032 0.008
#> GSM711935     2  0.2964      0.916 0.000 0.856 0.000 0.024 0.120
#> GSM711941     1  0.4677      0.617 0.732 0.000 0.004 0.196 0.068
#> GSM711943     4  0.0807      0.811 0.012 0.000 0.012 0.976 0.000
#> GSM711945     4  0.0807      0.811 0.012 0.000 0.012 0.976 0.000
#> GSM711947     3  0.1410      0.756 0.000 0.000 0.940 0.060 0.000
#> GSM711949     2  0.2964      0.916 0.000 0.856 0.000 0.024 0.120
#> GSM711953     2  0.2964      0.916 0.000 0.856 0.000 0.024 0.120
#> GSM711955     1  0.2761      0.779 0.872 0.000 0.024 0.104 0.000
#> GSM711963     2  0.2964      0.916 0.000 0.856 0.000 0.024 0.120
#> GSM711971     3  0.4679      0.589 0.012 0.000 0.700 0.260 0.028
#> GSM711975     2  0.1043      0.923 0.000 0.960 0.000 0.040 0.000
#> GSM711979     1  0.5124      0.534 0.668 0.004 0.000 0.260 0.068
#> GSM711989     2  0.0609      0.929 0.000 0.980 0.000 0.020 0.000
#> GSM711991     3  0.1965      0.746 0.000 0.000 0.904 0.096 0.000
#> GSM711993     4  0.4064      0.738 0.012 0.100 0.004 0.816 0.068
#> GSM711983     3  0.6247      0.229 0.052 0.000 0.492 0.412 0.044
#> GSM711985     2  0.0162      0.935 0.000 0.996 0.000 0.000 0.004
#> GSM711913     3  0.4150      0.475 0.000 0.000 0.612 0.388 0.000
#> GSM711919     3  0.0162      0.777 0.000 0.000 0.996 0.000 0.004
#> GSM711921     3  0.0000      0.779 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     5  0.3756     0.8510 0.000 0.400 0.000 0.000 0.600 0.000
#> GSM711938     2  0.3765    -0.4332 0.000 0.596 0.000 0.000 0.404 0.000
#> GSM711950     4  0.3706     0.3314 0.380 0.000 0.000 0.620 0.000 0.000
#> GSM711956     1  0.2972     0.7388 0.836 0.000 0.000 0.036 0.000 0.128
#> GSM711958     1  0.4567     0.4596 0.616 0.000 0.000 0.052 0.000 0.332
#> GSM711960     6  0.6380     0.2579 0.268 0.000 0.148 0.060 0.000 0.524
#> GSM711964     1  0.2278     0.7345 0.868 0.000 0.000 0.000 0.004 0.128
#> GSM711966     1  0.2135     0.7355 0.872 0.000 0.000 0.000 0.000 0.128
#> GSM711968     1  0.2191     0.7379 0.876 0.000 0.000 0.000 0.004 0.120
#> GSM711972     1  0.2454     0.7206 0.840 0.000 0.000 0.000 0.000 0.160
#> GSM711976     1  0.1765     0.7041 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM711980     1  0.0632     0.7366 0.976 0.000 0.000 0.024 0.000 0.000
#> GSM711986     6  0.3050     0.7163 0.236 0.000 0.000 0.000 0.000 0.764
#> GSM711904     6  0.5688     0.4121 0.384 0.000 0.000 0.140 0.004 0.472
#> GSM711906     6  0.3562     0.7569 0.168 0.000 0.000 0.040 0.004 0.788
#> GSM711908     6  0.0363     0.6740 0.000 0.000 0.000 0.000 0.012 0.988
#> GSM711910     3  0.0000     0.8590 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711914     1  0.2402     0.7301 0.856 0.000 0.000 0.000 0.004 0.140
#> GSM711916     6  0.3691     0.6551 0.192 0.000 0.000 0.036 0.004 0.768
#> GSM711922     1  0.1285     0.7327 0.944 0.000 0.000 0.052 0.000 0.004
#> GSM711924     1  0.3864     0.6877 0.744 0.000 0.000 0.048 0.000 0.208
#> GSM711926     4  0.1858     0.7136 0.004 0.000 0.000 0.904 0.092 0.000
#> GSM711928     1  0.1141     0.7456 0.948 0.000 0.000 0.000 0.000 0.052
#> GSM711930     6  0.0632     0.6692 0.000 0.000 0.000 0.000 0.024 0.976
#> GSM711932     1  0.2996     0.5718 0.772 0.000 0.000 0.228 0.000 0.000
#> GSM711934     1  0.4644     0.4900 0.628 0.000 0.000 0.052 0.004 0.316
#> GSM711940     1  0.1141     0.7309 0.948 0.000 0.000 0.052 0.000 0.000
#> GSM711942     1  0.2703     0.7141 0.824 0.000 0.000 0.000 0.004 0.172
#> GSM711944     1  0.7562     0.0575 0.392 0.000 0.260 0.252 0.040 0.056
#> GSM711946     4  0.4332     0.6534 0.000 0.000 0.040 0.644 0.316 0.000
#> GSM711948     1  0.4722     0.0755 0.512 0.000 0.016 0.452 0.000 0.020
#> GSM711952     6  0.4280     0.7234 0.232 0.000 0.000 0.056 0.004 0.708
#> GSM711954     1  0.0000     0.7346 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711962     1  0.2260     0.7334 0.860 0.000 0.000 0.000 0.000 0.140
#> GSM711970     1  0.0000     0.7346 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711974     1  0.4292     0.5177 0.628 0.000 0.000 0.032 0.000 0.340
#> GSM711978     4  0.2234     0.7332 0.004 0.000 0.000 0.872 0.124 0.000
#> GSM711988     1  0.1141     0.7309 0.948 0.000 0.000 0.052 0.000 0.000
#> GSM711990     3  0.5043     0.7654 0.024 0.000 0.740 0.080 0.104 0.052
#> GSM711992     4  0.2442     0.7331 0.004 0.000 0.000 0.852 0.144 0.000
#> GSM711982     1  0.3221     0.6295 0.736 0.000 0.000 0.000 0.000 0.264
#> GSM711984     5  0.3851     0.7618 0.000 0.460 0.000 0.000 0.540 0.000
#> GSM711912     6  0.3758     0.7579 0.176 0.000 0.000 0.048 0.004 0.772
#> GSM711918     6  0.3804     0.7580 0.176 0.000 0.000 0.044 0.008 0.772
#> GSM711920     1  0.2933     0.6940 0.796 0.000 0.000 0.000 0.004 0.200
#> GSM711937     5  0.3756     0.8510 0.000 0.400 0.000 0.000 0.600 0.000
#> GSM711939     5  0.3774     0.8432 0.000 0.408 0.000 0.000 0.592 0.000
#> GSM711951     2  0.6075    -0.3346 0.000 0.396 0.000 0.324 0.280 0.000
#> GSM711957     4  0.4611     0.6646 0.072 0.000 0.016 0.772 0.080 0.060
#> GSM711959     5  0.3847     0.7701 0.000 0.456 0.000 0.000 0.544 0.000
#> GSM711961     2  0.1814     0.6135 0.000 0.900 0.000 0.000 0.100 0.000
#> GSM711965     4  0.5998     0.4219 0.012 0.000 0.180 0.492 0.316 0.000
#> GSM711967     1  0.0508     0.7360 0.984 0.000 0.000 0.012 0.000 0.004
#> GSM711969     5  0.3756     0.8510 0.000 0.400 0.000 0.000 0.600 0.000
#> GSM711973     4  0.5566     0.5947 0.200 0.000 0.016 0.664 0.064 0.056
#> GSM711977     3  0.3601     0.7330 0.000 0.000 0.684 0.004 0.312 0.000
#> GSM711981     4  0.2053     0.7355 0.004 0.000 0.000 0.888 0.108 0.000
#> GSM711987     2  0.0000     0.7451 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.7451 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     5  0.3756     0.8510 0.000 0.400 0.000 0.000 0.600 0.000
#> GSM711909     3  0.0146     0.8597 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM711911     3  0.2838     0.8127 0.000 0.000 0.808 0.004 0.188 0.000
#> GSM711915     3  0.0000     0.8590 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711917     5  0.3756     0.8510 0.000 0.400 0.000 0.000 0.600 0.000
#> GSM711923     4  0.3446     0.6915 0.000 0.000 0.000 0.692 0.308 0.000
#> GSM711925     2  0.0713     0.7195 0.000 0.972 0.000 0.000 0.028 0.000
#> GSM711927     3  0.0146     0.8597 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM711929     2  0.0000     0.7451 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     5  0.6012     0.3522 0.000 0.256 0.000 0.320 0.424 0.000
#> GSM711933     1  0.4601     0.5571 0.708 0.000 0.016 0.204 0.000 0.072
#> GSM711935     2  0.0000     0.7451 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     4  0.3151     0.5474 0.252 0.000 0.000 0.748 0.000 0.000
#> GSM711943     4  0.3446     0.7064 0.000 0.000 0.000 0.692 0.308 0.000
#> GSM711945     4  0.4541     0.6543 0.000 0.000 0.044 0.596 0.360 0.000
#> GSM711947     3  0.2121     0.8064 0.000 0.000 0.892 0.096 0.012 0.000
#> GSM711949     2  0.0000     0.7451 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.7451 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     1  0.5485     0.1579 0.528 0.000 0.056 0.388 0.008 0.020
#> GSM711963     2  0.0000     0.7451 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.3939     0.8180 0.016 0.000 0.808 0.020 0.104 0.052
#> GSM711975     5  0.5818     0.5180 0.000 0.392 0.000 0.184 0.424 0.000
#> GSM711979     4  0.2300     0.6732 0.144 0.000 0.000 0.856 0.000 0.000
#> GSM711989     5  0.3756     0.8510 0.000 0.400 0.000 0.000 0.600 0.000
#> GSM711991     3  0.4125     0.7268 0.000 0.000 0.748 0.124 0.128 0.000
#> GSM711993     4  0.2737     0.6863 0.004 0.004 0.000 0.832 0.160 0.000
#> GSM711983     3  0.5043     0.7654 0.024 0.000 0.740 0.080 0.104 0.052
#> GSM711985     2  0.3868    -0.6952 0.000 0.504 0.000 0.000 0.496 0.000
#> GSM711913     3  0.3601     0.7330 0.000 0.000 0.684 0.004 0.312 0.000
#> GSM711919     3  0.0713     0.8522 0.000 0.000 0.972 0.000 0.000 0.028
#> GSM711921     3  0.0000     0.8590 0.000 0.000 1.000 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-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 tissue(p) disease.state(p) individual(p) k
#> SD:mclust 89  3.70e-05            0.193         0.501 2
#> SD:mclust 90  1.63e-10            0.402         0.570 3
#> SD:mclust 86  1.14e-09            0.116         0.429 4
#> SD:mclust 81  5.58e-08            0.107         0.423 5
#> SD:mclust 77  1.25e-08            0.109         0.216 6

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


SD:NMF**

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 27425 rows and 90 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 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-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 1.000           0.966       0.987         0.4221 0.585   0.585
#> 3 3 1.000           0.965       0.985         0.5422 0.721   0.539
#> 4 4 0.899           0.903       0.956         0.1397 0.838   0.578
#> 5 5 0.790           0.747       0.868         0.0497 0.946   0.800
#> 6 6 0.853           0.738       0.890         0.0451 0.913   0.653

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
#> GSM711936     2  0.0000      0.990 0.000 1.000
#> GSM711938     2  0.0000      0.990 0.000 1.000
#> GSM711950     1  0.0000      0.984 1.000 0.000
#> GSM711956     1  0.0000      0.984 1.000 0.000
#> GSM711958     1  0.0000      0.984 1.000 0.000
#> GSM711960     1  0.0000      0.984 1.000 0.000
#> GSM711964     1  0.0000      0.984 1.000 0.000
#> GSM711966     1  0.0000      0.984 1.000 0.000
#> GSM711968     1  0.0000      0.984 1.000 0.000
#> GSM711972     1  0.0000      0.984 1.000 0.000
#> GSM711976     1  0.0000      0.984 1.000 0.000
#> GSM711980     1  0.0000      0.984 1.000 0.000
#> GSM711986     1  0.0000      0.984 1.000 0.000
#> GSM711904     1  0.0000      0.984 1.000 0.000
#> GSM711906     1  0.0000      0.984 1.000 0.000
#> GSM711908     1  0.0000      0.984 1.000 0.000
#> GSM711910     1  0.0000      0.984 1.000 0.000
#> GSM711914     1  0.0000      0.984 1.000 0.000
#> GSM711916     1  0.0000      0.984 1.000 0.000
#> GSM711922     1  0.0000      0.984 1.000 0.000
#> GSM711924     1  0.0000      0.984 1.000 0.000
#> GSM711926     2  0.7219      0.745 0.200 0.800
#> GSM711928     1  0.0000      0.984 1.000 0.000
#> GSM711930     1  0.0000      0.984 1.000 0.000
#> GSM711932     1  0.0000      0.984 1.000 0.000
#> GSM711934     1  0.0000      0.984 1.000 0.000
#> GSM711940     1  0.0000      0.984 1.000 0.000
#> GSM711942     1  0.0000      0.984 1.000 0.000
#> GSM711944     1  0.0000      0.984 1.000 0.000
#> GSM711946     1  0.0000      0.984 1.000 0.000
#> GSM711948     1  0.0000      0.984 1.000 0.000
#> GSM711952     1  0.0000      0.984 1.000 0.000
#> GSM711954     1  0.0000      0.984 1.000 0.000
#> GSM711962     1  0.0000      0.984 1.000 0.000
#> GSM711970     1  0.0000      0.984 1.000 0.000
#> GSM711974     1  0.0000      0.984 1.000 0.000
#> GSM711978     1  0.1184      0.970 0.984 0.016
#> GSM711988     1  0.0000      0.984 1.000 0.000
#> GSM711990     1  0.0000      0.984 1.000 0.000
#> GSM711992     1  0.0000      0.984 1.000 0.000
#> GSM711982     1  0.0000      0.984 1.000 0.000
#> GSM711984     2  0.0000      0.990 0.000 1.000
#> GSM711912     1  0.0000      0.984 1.000 0.000
#> GSM711918     1  0.0000      0.984 1.000 0.000
#> GSM711920     1  0.0000      0.984 1.000 0.000
#> GSM711937     2  0.0000      0.990 0.000 1.000
#> GSM711939     2  0.0000      0.990 0.000 1.000
#> GSM711951     2  0.0000      0.990 0.000 1.000
#> GSM711957     1  0.0000      0.984 1.000 0.000
#> GSM711959     2  0.0000      0.990 0.000 1.000
#> GSM711961     2  0.0000      0.990 0.000 1.000
#> GSM711965     1  0.0000      0.984 1.000 0.000
#> GSM711967     1  0.0000      0.984 1.000 0.000
#> GSM711969     2  0.0000      0.990 0.000 1.000
#> GSM711973     1  0.0000      0.984 1.000 0.000
#> GSM711977     1  0.0000      0.984 1.000 0.000
#> GSM711981     1  0.9970      0.124 0.532 0.468
#> GSM711987     2  0.0000      0.990 0.000 1.000
#> GSM711905     2  0.0000      0.990 0.000 1.000
#> GSM711907     2  0.0000      0.990 0.000 1.000
#> GSM711909     1  0.0000      0.984 1.000 0.000
#> GSM711911     1  0.0000      0.984 1.000 0.000
#> GSM711915     1  0.0000      0.984 1.000 0.000
#> GSM711917     2  0.0000      0.990 0.000 1.000
#> GSM711923     1  0.0000      0.984 1.000 0.000
#> GSM711925     2  0.0000      0.990 0.000 1.000
#> GSM711927     1  0.0000      0.984 1.000 0.000
#> GSM711929     2  0.0000      0.990 0.000 1.000
#> GSM711931     2  0.0000      0.990 0.000 1.000
#> GSM711933     1  0.0000      0.984 1.000 0.000
#> GSM711935     2  0.0000      0.990 0.000 1.000
#> GSM711941     1  0.0000      0.984 1.000 0.000
#> GSM711943     1  0.0672      0.977 0.992 0.008
#> GSM711945     1  0.8144      0.663 0.748 0.252
#> GSM711947     2  0.0376      0.986 0.004 0.996
#> GSM711949     2  0.0000      0.990 0.000 1.000
#> GSM711953     2  0.0000      0.990 0.000 1.000
#> GSM711955     1  0.0000      0.984 1.000 0.000
#> GSM711963     2  0.0000      0.990 0.000 1.000
#> GSM711971     1  0.0000      0.984 1.000 0.000
#> GSM711975     2  0.0000      0.990 0.000 1.000
#> GSM711979     1  0.0000      0.984 1.000 0.000
#> GSM711989     2  0.0000      0.990 0.000 1.000
#> GSM711991     1  0.7602      0.716 0.780 0.220
#> GSM711993     2  0.2603      0.948 0.044 0.956
#> GSM711983     1  0.0000      0.984 1.000 0.000
#> GSM711985     2  0.0000      0.990 0.000 1.000
#> GSM711913     1  0.0000      0.984 1.000 0.000
#> GSM711919     1  0.0000      0.984 1.000 0.000
#> GSM711921     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
#> GSM711936     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711938     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711950     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711956     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711958     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711960     3  0.3879      0.828 0.152 0.000 0.848
#> GSM711964     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711966     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711968     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711972     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711976     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711980     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711986     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711904     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711906     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711908     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711910     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711914     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711916     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711922     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711924     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711926     1  0.6260      0.203 0.552 0.448 0.000
#> GSM711928     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711930     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711932     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711934     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711940     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711942     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711944     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711946     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711948     1  0.0237      0.980 0.996 0.000 0.004
#> GSM711952     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711954     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711962     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711970     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711974     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711978     1  0.3116      0.873 0.892 0.108 0.000
#> GSM711988     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711990     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711992     1  0.0424      0.976 0.992 0.008 0.000
#> GSM711982     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711984     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711912     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711918     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711920     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711937     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711939     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711951     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711957     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711959     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711961     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711965     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711967     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711969     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711973     3  0.0424      0.962 0.008 0.000 0.992
#> GSM711977     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711981     2  0.0424      0.992 0.000 0.992 0.008
#> GSM711987     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711905     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711907     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711909     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711911     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711915     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711917     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711923     3  0.0237      0.965 0.000 0.004 0.996
#> GSM711925     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711927     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711929     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711931     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711933     1  0.0000      0.983 1.000 0.000 0.000
#> GSM711935     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711941     3  0.4887      0.732 0.228 0.000 0.772
#> GSM711943     3  0.1289      0.944 0.000 0.032 0.968
#> GSM711945     3  0.0592      0.960 0.000 0.012 0.988
#> GSM711947     3  0.0747      0.957 0.000 0.016 0.984
#> GSM711949     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711953     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711955     3  0.4931      0.726 0.232 0.000 0.768
#> GSM711963     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711971     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711975     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711979     1  0.2165      0.921 0.936 0.064 0.000
#> GSM711989     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711991     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711993     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711983     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711985     2  0.0000      1.000 0.000 1.000 0.000
#> GSM711913     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711919     3  0.0000      0.967 0.000 0.000 1.000
#> GSM711921     3  0.0000      0.967 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711950     4  0.0000     0.8791 0.000 0.000 0.000 1.000
#> GSM711956     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711958     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711960     3  0.0336     0.9577 0.008 0.000 0.992 0.000
#> GSM711964     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711976     4  0.4040     0.6753 0.248 0.000 0.000 0.752
#> GSM711980     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711906     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711910     3  0.0000     0.9624 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0188     0.9614 0.996 0.000 0.000 0.004
#> GSM711924     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711926     4  0.1004     0.8745 0.004 0.024 0.000 0.972
#> GSM711928     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0188     0.9612 0.996 0.000 0.004 0.000
#> GSM711932     4  0.1302     0.8633 0.044 0.000 0.000 0.956
#> GSM711934     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711940     4  0.4250     0.6385 0.276 0.000 0.000 0.724
#> GSM711942     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711944     3  0.0817     0.9578 0.000 0.000 0.976 0.024
#> GSM711946     4  0.3942     0.6798 0.000 0.000 0.236 0.764
#> GSM711948     4  0.0000     0.8791 0.000 0.000 0.000 1.000
#> GSM711952     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711954     1  0.1118     0.9337 0.964 0.000 0.000 0.036
#> GSM711962     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711970     1  0.0188     0.9614 0.996 0.000 0.000 0.004
#> GSM711974     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0592     0.8757 0.016 0.000 0.000 0.984
#> GSM711988     1  0.3649     0.7326 0.796 0.000 0.000 0.204
#> GSM711990     3  0.0469     0.9634 0.000 0.000 0.988 0.012
#> GSM711992     4  0.3975     0.6939 0.240 0.000 0.000 0.760
#> GSM711982     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000     0.9641 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711951     4  0.0921     0.8729 0.000 0.028 0.000 0.972
#> GSM711957     1  0.4996     0.0229 0.516 0.000 0.000 0.484
#> GSM711959     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711965     4  0.3649     0.7205 0.000 0.000 0.204 0.796
#> GSM711967     1  0.3356     0.7672 0.824 0.000 0.000 0.176
#> GSM711969     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711973     4  0.3975     0.6498 0.000 0.000 0.240 0.760
#> GSM711977     3  0.1637     0.9265 0.000 0.000 0.940 0.060
#> GSM711981     4  0.0000     0.8791 0.000 0.000 0.000 1.000
#> GSM711987     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711907     2  0.3801     0.6974 0.000 0.780 0.000 0.220
#> GSM711909     3  0.0188     0.9637 0.000 0.000 0.996 0.004
#> GSM711911     3  0.0469     0.9634 0.000 0.000 0.988 0.012
#> GSM711915     3  0.0000     0.9624 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0000     0.8791 0.000 0.000 0.000 1.000
#> GSM711925     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0336     0.9638 0.000 0.000 0.992 0.008
#> GSM711929     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711931     4  0.1211     0.8672 0.000 0.040 0.000 0.960
#> GSM711933     1  0.2647     0.8436 0.880 0.000 0.000 0.120
#> GSM711935     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0000     0.8791 0.000 0.000 0.000 1.000
#> GSM711943     4  0.0000     0.8791 0.000 0.000 0.000 1.000
#> GSM711945     4  0.4222     0.6259 0.000 0.000 0.272 0.728
#> GSM711947     3  0.0336     0.9585 0.000 0.008 0.992 0.000
#> GSM711949     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711955     3  0.5217     0.3318 0.012 0.000 0.608 0.380
#> GSM711963     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0469     0.9634 0.000 0.000 0.988 0.012
#> GSM711975     4  0.3764     0.7015 0.000 0.216 0.000 0.784
#> GSM711979     4  0.0000     0.8791 0.000 0.000 0.000 1.000
#> GSM711989     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711991     3  0.0188     0.9637 0.000 0.000 0.996 0.004
#> GSM711993     4  0.0592     0.8765 0.000 0.016 0.000 0.984
#> GSM711983     3  0.0592     0.9620 0.000 0.000 0.984 0.016
#> GSM711985     2  0.0000     0.9875 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0817     0.9578 0.000 0.000 0.976 0.024
#> GSM711919     3  0.0000     0.9624 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0188     0.9637 0.000 0.000 0.996 0.004

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711938     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711950     4  0.3424     0.5500 0.000 0.000 0.000 0.760 0.240
#> GSM711956     1  0.3730     0.7274 0.712 0.000 0.000 0.000 0.288
#> GSM711958     1  0.4436     0.3077 0.596 0.000 0.396 0.000 0.008
#> GSM711960     3  0.0579     0.9218 0.008 0.000 0.984 0.000 0.008
#> GSM711964     1  0.0000     0.8439 1.000 0.000 0.000 0.000 0.000
#> GSM711966     1  0.0162     0.8433 0.996 0.000 0.000 0.000 0.004
#> GSM711968     1  0.3895     0.7047 0.680 0.000 0.000 0.000 0.320
#> GSM711972     1  0.0000     0.8439 1.000 0.000 0.000 0.000 0.000
#> GSM711976     1  0.4808     0.3737 0.576 0.000 0.000 0.400 0.024
#> GSM711980     1  0.3074     0.7789 0.804 0.000 0.000 0.000 0.196
#> GSM711986     1  0.0000     0.8439 1.000 0.000 0.000 0.000 0.000
#> GSM711904     1  0.3242     0.7694 0.784 0.000 0.000 0.000 0.216
#> GSM711906     1  0.0000     0.8439 1.000 0.000 0.000 0.000 0.000
#> GSM711908     1  0.0000     0.8439 1.000 0.000 0.000 0.000 0.000
#> GSM711910     3  0.0000     0.9311 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.0290     0.8436 0.992 0.000 0.000 0.000 0.008
#> GSM711916     1  0.0162     0.8433 0.996 0.000 0.000 0.000 0.004
#> GSM711922     1  0.4135     0.6878 0.656 0.000 0.000 0.004 0.340
#> GSM711924     1  0.3508     0.7251 0.748 0.000 0.000 0.000 0.252
#> GSM711926     4  0.3940     0.6292 0.000 0.024 0.000 0.756 0.220
#> GSM711928     1  0.0703     0.8408 0.976 0.000 0.000 0.000 0.024
#> GSM711930     1  0.0290     0.8419 0.992 0.000 0.000 0.000 0.008
#> GSM711932     4  0.5082     0.5279 0.076 0.000 0.000 0.664 0.260
#> GSM711934     1  0.3109     0.7813 0.800 0.000 0.000 0.000 0.200
#> GSM711940     4  0.3177     0.5963 0.208 0.000 0.000 0.792 0.000
#> GSM711942     1  0.3395     0.7408 0.764 0.000 0.000 0.000 0.236
#> GSM711944     3  0.0992     0.9116 0.000 0.000 0.968 0.008 0.024
#> GSM711946     4  0.2491     0.7001 0.000 0.000 0.068 0.896 0.036
#> GSM711948     4  0.3039     0.6566 0.012 0.000 0.000 0.836 0.152
#> GSM711952     1  0.0290     0.8436 0.992 0.000 0.000 0.000 0.008
#> GSM711954     1  0.3146     0.7681 0.844 0.000 0.000 0.128 0.028
#> GSM711962     1  0.0000     0.8439 1.000 0.000 0.000 0.000 0.000
#> GSM711970     1  0.4467     0.6716 0.640 0.000 0.000 0.016 0.344
#> GSM711974     1  0.0162     0.8433 0.996 0.000 0.000 0.000 0.004
#> GSM711978     4  0.1443     0.7490 0.004 0.004 0.000 0.948 0.044
#> GSM711988     1  0.3194     0.7478 0.832 0.000 0.000 0.148 0.020
#> GSM711990     3  0.0771     0.9131 0.000 0.000 0.976 0.004 0.020
#> GSM711992     4  0.2605     0.6688 0.148 0.000 0.000 0.852 0.000
#> GSM711982     1  0.0162     0.8433 0.996 0.000 0.000 0.000 0.004
#> GSM711984     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711912     1  0.0000     0.8439 1.000 0.000 0.000 0.000 0.000
#> GSM711918     1  0.0162     0.8436 0.996 0.000 0.000 0.000 0.004
#> GSM711920     1  0.4855     0.5759 0.552 0.000 0.000 0.024 0.424
#> GSM711937     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711951     4  0.1544     0.7291 0.000 0.068 0.000 0.932 0.000
#> GSM711957     5  0.6493    -0.0994 0.248 0.000 0.000 0.260 0.492
#> GSM711959     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711965     5  0.4890     0.0385 0.000 0.000 0.024 0.452 0.524
#> GSM711967     1  0.5467     0.2183 0.548 0.000 0.000 0.384 0.068
#> GSM711969     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711973     5  0.6101     0.4456 0.000 0.000 0.164 0.284 0.552
#> GSM711977     5  0.5838     0.4666 0.000 0.000 0.336 0.112 0.552
#> GSM711981     4  0.1965     0.7141 0.000 0.000 0.000 0.904 0.096
#> GSM711987     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711907     2  0.3876     0.4646 0.000 0.684 0.000 0.316 0.000
#> GSM711909     3  0.0000     0.9311 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.0451     0.9269 0.000 0.000 0.988 0.008 0.004
#> GSM711915     5  0.4451     0.1586 0.000 0.000 0.492 0.004 0.504
#> GSM711917     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711923     4  0.0324     0.7476 0.000 0.000 0.004 0.992 0.004
#> GSM711925     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0000     0.9311 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711931     4  0.3110     0.7135 0.000 0.080 0.000 0.860 0.060
#> GSM711933     4  0.6912     0.2027 0.208 0.000 0.016 0.464 0.312
#> GSM711935     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.0404     0.7440 0.000 0.000 0.000 0.988 0.012
#> GSM711943     4  0.1670     0.7376 0.000 0.000 0.052 0.936 0.012
#> GSM711945     4  0.4066     0.3761 0.000 0.000 0.004 0.672 0.324
#> GSM711947     3  0.0898     0.9072 0.000 0.020 0.972 0.000 0.008
#> GSM711949     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711955     3  0.6595    -0.0489 0.116 0.000 0.508 0.348 0.028
#> GSM711963     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0000     0.9311 0.000 0.000 1.000 0.000 0.000
#> GSM711975     4  0.4302     0.1228 0.000 0.480 0.000 0.520 0.000
#> GSM711979     4  0.1430     0.7472 0.000 0.000 0.004 0.944 0.052
#> GSM711989     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711991     3  0.0404     0.9272 0.000 0.000 0.988 0.000 0.012
#> GSM711993     4  0.0912     0.7512 0.000 0.012 0.000 0.972 0.016
#> GSM711983     3  0.0290     0.9284 0.000 0.000 0.992 0.008 0.000
#> GSM711985     2  0.0000     0.9800 0.000 1.000 0.000 0.000 0.000
#> GSM711913     5  0.5458     0.4097 0.000 0.000 0.380 0.068 0.552
#> GSM711919     3  0.0162     0.9300 0.000 0.000 0.996 0.000 0.004
#> GSM711921     3  0.0000     0.9311 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.0146     0.9571 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM711938     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711950     5  0.4208     0.1807 0.008 0.000 0.000 0.452 0.536 0.004
#> GSM711956     1  0.3823     0.3981 0.564 0.000 0.000 0.000 0.000 0.436
#> GSM711958     3  0.2805     0.7392 0.000 0.000 0.828 0.000 0.012 0.160
#> GSM711960     3  0.0000     0.9272 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711964     6  0.0291     0.8113 0.004 0.000 0.000 0.000 0.004 0.992
#> GSM711966     6  0.0622     0.8100 0.008 0.000 0.000 0.000 0.012 0.980
#> GSM711968     1  0.3309     0.6142 0.720 0.000 0.000 0.000 0.000 0.280
#> GSM711972     6  0.0363     0.8120 0.000 0.000 0.000 0.000 0.012 0.988
#> GSM711976     6  0.5858    -0.0140 0.084 0.000 0.000 0.036 0.424 0.456
#> GSM711980     1  0.3868     0.2414 0.504 0.000 0.000 0.000 0.000 0.496
#> GSM711986     6  0.0363     0.8096 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711904     6  0.3819     0.1367 0.372 0.000 0.000 0.000 0.004 0.624
#> GSM711906     6  0.0508     0.8113 0.004 0.000 0.000 0.000 0.012 0.984
#> GSM711908     6  0.0363     0.8120 0.000 0.000 0.000 0.000 0.012 0.988
#> GSM711910     3  0.0000     0.9272 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711914     6  0.0508     0.8091 0.012 0.000 0.000 0.000 0.004 0.984
#> GSM711916     6  0.0914     0.8049 0.016 0.000 0.000 0.000 0.016 0.968
#> GSM711922     1  0.3592     0.5565 0.656 0.000 0.000 0.000 0.000 0.344
#> GSM711924     1  0.5401     0.3518 0.552 0.000 0.092 0.000 0.012 0.344
#> GSM711926     4  0.2773     0.7807 0.152 0.008 0.000 0.836 0.000 0.004
#> GSM711928     6  0.0935     0.7998 0.032 0.000 0.000 0.000 0.004 0.964
#> GSM711930     6  0.0820     0.8052 0.016 0.000 0.000 0.000 0.012 0.972
#> GSM711932     1  0.4412    -0.0904 0.572 0.000 0.000 0.404 0.008 0.016
#> GSM711934     6  0.3563     0.2639 0.336 0.000 0.000 0.000 0.000 0.664
#> GSM711940     4  0.1442     0.8604 0.012 0.000 0.000 0.944 0.004 0.040
#> GSM711942     6  0.4177    -0.1544 0.468 0.000 0.000 0.000 0.012 0.520
#> GSM711944     3  0.1265     0.8969 0.044 0.000 0.948 0.000 0.008 0.000
#> GSM711946     4  0.0665     0.8847 0.008 0.000 0.008 0.980 0.004 0.000
#> GSM711948     4  0.4167     0.3409 0.012 0.000 0.000 0.636 0.344 0.008
#> GSM711952     6  0.0865     0.7964 0.036 0.000 0.000 0.000 0.000 0.964
#> GSM711954     6  0.4616     0.2543 0.060 0.000 0.000 0.316 0.000 0.624
#> GSM711962     6  0.0508     0.8113 0.004 0.000 0.000 0.000 0.012 0.984
#> GSM711970     1  0.3265     0.6258 0.748 0.000 0.000 0.004 0.000 0.248
#> GSM711974     6  0.0405     0.8121 0.004 0.000 0.000 0.000 0.008 0.988
#> GSM711978     4  0.0291     0.8870 0.004 0.004 0.000 0.992 0.000 0.000
#> GSM711988     6  0.2309     0.7344 0.084 0.000 0.000 0.028 0.000 0.888
#> GSM711990     3  0.0632     0.9128 0.000 0.000 0.976 0.000 0.024 0.000
#> GSM711992     4  0.0767     0.8845 0.008 0.004 0.000 0.976 0.000 0.012
#> GSM711982     6  0.0622     0.8100 0.008 0.000 0.000 0.000 0.012 0.980
#> GSM711984     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711912     6  0.0363     0.8096 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711918     6  0.0547     0.8069 0.020 0.000 0.000 0.000 0.000 0.980
#> GSM711920     1  0.1367     0.5515 0.944 0.000 0.000 0.000 0.012 0.044
#> GSM711937     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711951     4  0.1075     0.8587 0.000 0.048 0.000 0.952 0.000 0.000
#> GSM711957     1  0.0748     0.5256 0.976 0.000 0.000 0.004 0.004 0.016
#> GSM711959     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711961     2  0.0146     0.9569 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711965     5  0.0935     0.7892 0.000 0.000 0.004 0.032 0.964 0.000
#> GSM711967     6  0.4459     0.2310 0.016 0.000 0.000 0.384 0.012 0.588
#> GSM711969     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711973     5  0.0891     0.7906 0.000 0.000 0.008 0.024 0.968 0.000
#> GSM711977     5  0.0909     0.7897 0.000 0.000 0.020 0.012 0.968 0.000
#> GSM711981     4  0.3601     0.4655 0.004 0.000 0.000 0.684 0.312 0.000
#> GSM711987     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0146     0.9569 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711907     2  0.3647     0.4068 0.000 0.640 0.000 0.360 0.000 0.000
#> GSM711909     3  0.0000     0.9272 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711911     3  0.0146     0.9260 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM711915     5  0.1753     0.7431 0.004 0.000 0.084 0.000 0.912 0.000
#> GSM711917     2  0.0260     0.9545 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM711923     4  0.0146     0.8876 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM711925     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.0000     0.9272 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711929     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     4  0.3182     0.7427 0.036 0.124 0.000 0.832 0.008 0.000
#> GSM711933     3  0.6539     0.3413 0.180 0.000 0.516 0.248 0.004 0.052
#> GSM711935     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     4  0.0260     0.8862 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM711943     4  0.0363     0.8858 0.000 0.000 0.012 0.988 0.000 0.000
#> GSM711945     5  0.3979     0.1964 0.004 0.000 0.000 0.456 0.540 0.000
#> GSM711947     3  0.0146     0.9249 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM711949     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     3  0.4314     0.6368 0.024 0.000 0.728 0.220 0.012 0.016
#> GSM711963     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.0000     0.9272 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711975     2  0.3482     0.5279 0.000 0.684 0.000 0.316 0.000 0.000
#> GSM711979     4  0.0603     0.8845 0.016 0.000 0.000 0.980 0.004 0.000
#> GSM711989     2  0.0260     0.9545 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM711991     3  0.0146     0.9254 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM711993     4  0.0000     0.8874 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711983     3  0.0000     0.9272 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711985     2  0.0000     0.9593 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711913     5  0.0891     0.7876 0.000 0.000 0.024 0.008 0.968 0.000
#> GSM711919     3  0.0000     0.9272 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711921     3  0.0000     0.9272 0.000 0.000 1.000 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-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 tissue(p) disease.state(p) individual(p) k
#> SD:NMF 89  5.55e-05            0.219         0.616 2
#> SD:NMF 89  3.41e-11            0.244         0.695 3
#> SD:NMF 88  3.24e-08            0.163         0.420 4
#> SD:NMF 76  2.61e-08            0.148         0.274 5
#> SD:NMF 74  1.28e-06            0.134         0.226 6

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


CV:hclust

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

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

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

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

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

collect_plots(res)

plot of chunk CV-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.860           0.870       0.950         0.3748 0.626   0.626
#> 3 3 0.696           0.706       0.878         0.6344 0.768   0.629
#> 4 4 0.683           0.797       0.844         0.1231 0.857   0.655
#> 5 5 0.726           0.732       0.858         0.0442 0.971   0.904
#> 6 6 0.714           0.689       0.822         0.0432 0.961   0.867

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
#> GSM711936     2   0.416     0.8508 0.084 0.916
#> GSM711938     2   0.000     0.8984 0.000 1.000
#> GSM711950     1   0.000     0.9571 1.000 0.000
#> GSM711956     1   0.000     0.9571 1.000 0.000
#> GSM711958     1   0.000     0.9571 1.000 0.000
#> GSM711960     1   0.000     0.9571 1.000 0.000
#> GSM711964     1   0.000     0.9571 1.000 0.000
#> GSM711966     1   0.000     0.9571 1.000 0.000
#> GSM711968     1   0.000     0.9571 1.000 0.000
#> GSM711972     1   0.000     0.9571 1.000 0.000
#> GSM711976     1   0.000     0.9571 1.000 0.000
#> GSM711980     1   0.000     0.9571 1.000 0.000
#> GSM711986     1   0.000     0.9571 1.000 0.000
#> GSM711904     1   0.000     0.9571 1.000 0.000
#> GSM711906     1   0.000     0.9571 1.000 0.000
#> GSM711908     1   0.000     0.9571 1.000 0.000
#> GSM711910     1   0.000     0.9571 1.000 0.000
#> GSM711914     1   0.000     0.9571 1.000 0.000
#> GSM711916     1   0.000     0.9571 1.000 0.000
#> GSM711922     1   0.000     0.9571 1.000 0.000
#> GSM711924     1   0.000     0.9571 1.000 0.000
#> GSM711926     1   0.891     0.5218 0.692 0.308
#> GSM711928     1   0.000     0.9571 1.000 0.000
#> GSM711930     1   0.000     0.9571 1.000 0.000
#> GSM711932     1   0.000     0.9571 1.000 0.000
#> GSM711934     1   0.000     0.9571 1.000 0.000
#> GSM711940     1   0.000     0.9571 1.000 0.000
#> GSM711942     1   0.000     0.9571 1.000 0.000
#> GSM711944     1   0.000     0.9571 1.000 0.000
#> GSM711946     1   0.242     0.9244 0.960 0.040
#> GSM711948     1   0.000     0.9571 1.000 0.000
#> GSM711952     1   0.000     0.9571 1.000 0.000
#> GSM711954     1   0.000     0.9571 1.000 0.000
#> GSM711962     1   0.000     0.9571 1.000 0.000
#> GSM711970     1   0.000     0.9571 1.000 0.000
#> GSM711974     1   0.000     0.9571 1.000 0.000
#> GSM711978     1   0.358     0.8975 0.932 0.068
#> GSM711988     1   0.000     0.9571 1.000 0.000
#> GSM711990     1   0.000     0.9571 1.000 0.000
#> GSM711992     1   0.529     0.8378 0.880 0.120
#> GSM711982     1   0.000     0.9571 1.000 0.000
#> GSM711984     2   0.000     0.8984 0.000 1.000
#> GSM711912     1   0.000     0.9571 1.000 0.000
#> GSM711918     1   0.000     0.9571 1.000 0.000
#> GSM711920     1   0.000     0.9571 1.000 0.000
#> GSM711937     2   0.416     0.8508 0.084 0.916
#> GSM711939     2   0.000     0.8984 0.000 1.000
#> GSM711951     2   0.995     0.2113 0.460 0.540
#> GSM711957     1   0.000     0.9571 1.000 0.000
#> GSM711959     2   0.000     0.8984 0.000 1.000
#> GSM711961     2   0.000     0.8984 0.000 1.000
#> GSM711965     1   0.000     0.9571 1.000 0.000
#> GSM711967     1   0.000     0.9571 1.000 0.000
#> GSM711969     2   0.358     0.8624 0.068 0.932
#> GSM711973     1   0.000     0.9571 1.000 0.000
#> GSM711977     1   0.000     0.9571 1.000 0.000
#> GSM711981     1   0.722     0.7248 0.800 0.200
#> GSM711987     2   0.000     0.8984 0.000 1.000
#> GSM711905     2   0.000     0.8984 0.000 1.000
#> GSM711907     2   0.904     0.5465 0.320 0.680
#> GSM711909     1   0.000     0.9571 1.000 0.000
#> GSM711911     1   0.000     0.9571 1.000 0.000
#> GSM711915     1   0.000     0.9571 1.000 0.000
#> GSM711917     2   0.184     0.8855 0.028 0.972
#> GSM711923     1   0.242     0.9244 0.960 0.040
#> GSM711925     2   0.000     0.8984 0.000 1.000
#> GSM711927     1   0.000     0.9571 1.000 0.000
#> GSM711929     2   0.000     0.8984 0.000 1.000
#> GSM711931     1   0.917     0.4664 0.668 0.332
#> GSM711933     1   0.000     0.9571 1.000 0.000
#> GSM711935     2   0.000     0.8984 0.000 1.000
#> GSM711941     1   0.000     0.9571 1.000 0.000
#> GSM711943     1   0.242     0.9244 0.960 0.040
#> GSM711945     1   0.242     0.9244 0.960 0.040
#> GSM711947     1   1.000    -0.0487 0.512 0.488
#> GSM711949     2   0.000     0.8984 0.000 1.000
#> GSM711953     2   0.000     0.8984 0.000 1.000
#> GSM711955     1   0.000     0.9571 1.000 0.000
#> GSM711963     2   0.000     0.8984 0.000 1.000
#> GSM711971     1   0.000     0.9571 1.000 0.000
#> GSM711975     2   0.995     0.2113 0.460 0.540
#> GSM711979     1   0.358     0.8975 0.932 0.068
#> GSM711989     2   0.995     0.2113 0.460 0.540
#> GSM711991     1   0.999    -0.0168 0.520 0.480
#> GSM711993     1   0.913     0.4760 0.672 0.328
#> GSM711983     1   0.000     0.9571 1.000 0.000
#> GSM711985     2   0.000     0.8984 0.000 1.000
#> GSM711913     1   0.000     0.9571 1.000 0.000
#> GSM711919     1   0.000     0.9571 1.000 0.000
#> GSM711921     1   0.000     0.9571 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
#> GSM711936     2  0.3155     0.8230 0.040 0.916 0.044
#> GSM711938     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711950     1  0.2165     0.8324 0.936 0.000 0.064
#> GSM711956     1  0.0592     0.8589 0.988 0.000 0.012
#> GSM711958     1  0.0424     0.8591 0.992 0.000 0.008
#> GSM711960     1  0.0592     0.8585 0.988 0.000 0.012
#> GSM711964     1  0.0424     0.8591 0.992 0.000 0.008
#> GSM711966     1  0.0000     0.8573 1.000 0.000 0.000
#> GSM711968     1  0.0592     0.8589 0.988 0.000 0.012
#> GSM711972     1  0.0000     0.8573 1.000 0.000 0.000
#> GSM711976     1  0.1289     0.8513 0.968 0.000 0.032
#> GSM711980     1  0.0424     0.8591 0.992 0.000 0.008
#> GSM711986     1  0.0000     0.8573 1.000 0.000 0.000
#> GSM711904     1  0.0592     0.8589 0.988 0.000 0.012
#> GSM711906     1  0.0000     0.8573 1.000 0.000 0.000
#> GSM711908     1  0.0000     0.8573 1.000 0.000 0.000
#> GSM711910     3  0.0000     0.8132 0.000 0.000 1.000
#> GSM711914     1  0.0424     0.8591 0.992 0.000 0.008
#> GSM711916     1  0.0000     0.8573 1.000 0.000 0.000
#> GSM711922     1  0.0592     0.8589 0.988 0.000 0.012
#> GSM711924     1  0.0237     0.8586 0.996 0.000 0.004
#> GSM711926     3  0.9940     0.2214 0.304 0.308 0.388
#> GSM711928     1  0.0592     0.8589 0.988 0.000 0.012
#> GSM711930     1  0.0000     0.8573 1.000 0.000 0.000
#> GSM711932     1  0.1411     0.8485 0.964 0.000 0.036
#> GSM711934     1  0.0592     0.8589 0.988 0.000 0.012
#> GSM711940     1  0.6235     0.3328 0.564 0.000 0.436
#> GSM711942     1  0.0237     0.8586 0.996 0.000 0.004
#> GSM711944     3  0.3482     0.7078 0.128 0.000 0.872
#> GSM711946     1  0.7566     0.2251 0.512 0.040 0.448
#> GSM711948     1  0.2448     0.8239 0.924 0.000 0.076
#> GSM711952     1  0.0000     0.8573 1.000 0.000 0.000
#> GSM711954     1  0.0592     0.8589 0.988 0.000 0.012
#> GSM711962     1  0.0237     0.8586 0.996 0.000 0.004
#> GSM711970     1  0.0592     0.8589 0.988 0.000 0.012
#> GSM711974     1  0.0424     0.8591 0.992 0.000 0.008
#> GSM711978     1  0.8066     0.2677 0.528 0.068 0.404
#> GSM711988     1  0.1411     0.8494 0.964 0.000 0.036
#> GSM711990     3  0.0592     0.8099 0.012 0.000 0.988
#> GSM711992     1  0.8503     0.3773 0.576 0.120 0.304
#> GSM711982     1  0.0000     0.8573 1.000 0.000 0.000
#> GSM711984     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711912     1  0.0000     0.8573 1.000 0.000 0.000
#> GSM711918     1  0.0000     0.8573 1.000 0.000 0.000
#> GSM711920     1  0.0237     0.8586 0.996 0.000 0.004
#> GSM711937     2  0.3155     0.8230 0.040 0.916 0.044
#> GSM711939     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711951     2  0.8645     0.1896 0.116 0.540 0.344
#> GSM711957     1  0.4504     0.7125 0.804 0.000 0.196
#> GSM711959     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711961     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711965     1  0.6309     0.1763 0.500 0.000 0.500
#> GSM711967     1  0.0237     0.8586 0.996 0.000 0.004
#> GSM711969     2  0.2689     0.8362 0.036 0.932 0.032
#> GSM711973     3  0.0892     0.8044 0.020 0.000 0.980
#> GSM711977     3  0.0000     0.8132 0.000 0.000 1.000
#> GSM711981     1  0.9602    -0.0973 0.400 0.200 0.400
#> GSM711987     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711905     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711907     2  0.7259     0.4903 0.072 0.680 0.248
#> GSM711909     3  0.0000     0.8132 0.000 0.000 1.000
#> GSM711911     3  0.0000     0.8132 0.000 0.000 1.000
#> GSM711915     3  0.0000     0.8132 0.000 0.000 1.000
#> GSM711917     2  0.1315     0.8644 0.008 0.972 0.020
#> GSM711923     1  0.7566     0.2251 0.512 0.040 0.448
#> GSM711925     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711927     3  0.0000     0.8132 0.000 0.000 1.000
#> GSM711929     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711931     3  0.9932     0.1984 0.284 0.332 0.384
#> GSM711933     1  0.1643     0.8457 0.956 0.000 0.044
#> GSM711935     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711941     1  0.6235     0.3328 0.564 0.000 0.436
#> GSM711943     1  0.7566     0.2251 0.512 0.040 0.448
#> GSM711945     1  0.7581     0.1807 0.496 0.040 0.464
#> GSM711947     3  0.6307     0.0158 0.000 0.488 0.512
#> GSM711949     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711953     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711955     1  0.2537     0.8220 0.920 0.000 0.080
#> GSM711963     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711971     3  0.0592     0.8099 0.012 0.000 0.988
#> GSM711975     2  0.8645     0.1896 0.116 0.540 0.344
#> GSM711979     1  0.8066     0.2677 0.528 0.068 0.404
#> GSM711989     2  0.8645     0.1896 0.116 0.540 0.344
#> GSM711991     3  0.6302     0.0436 0.000 0.480 0.520
#> GSM711993     3  0.9937     0.2027 0.288 0.328 0.384
#> GSM711983     3  0.0592     0.8099 0.012 0.000 0.988
#> GSM711985     2  0.0000     0.8806 0.000 1.000 0.000
#> GSM711913     3  0.0000     0.8132 0.000 0.000 1.000
#> GSM711919     3  0.0000     0.8132 0.000 0.000 1.000
#> GSM711921     3  0.0000     0.8132 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.2520      0.790 0.004 0.904 0.004 0.088
#> GSM711938     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711950     1  0.2466      0.850 0.900 0.000 0.004 0.096
#> GSM711956     1  0.0707      0.916 0.980 0.000 0.000 0.020
#> GSM711958     1  0.0336      0.917 0.992 0.000 0.000 0.008
#> GSM711960     1  0.0524      0.917 0.988 0.000 0.004 0.008
#> GSM711964     1  0.0469      0.917 0.988 0.000 0.000 0.012
#> GSM711966     1  0.2589      0.865 0.884 0.000 0.000 0.116
#> GSM711968     1  0.0707      0.916 0.980 0.000 0.000 0.020
#> GSM711972     1  0.2589      0.865 0.884 0.000 0.000 0.116
#> GSM711976     1  0.1398      0.904 0.956 0.000 0.004 0.040
#> GSM711980     1  0.0469      0.917 0.988 0.000 0.000 0.012
#> GSM711986     1  0.2704      0.859 0.876 0.000 0.000 0.124
#> GSM711904     1  0.0707      0.916 0.980 0.000 0.000 0.020
#> GSM711906     1  0.1211      0.904 0.960 0.000 0.000 0.040
#> GSM711908     1  0.2760      0.857 0.872 0.000 0.000 0.128
#> GSM711910     3  0.0000      0.966 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0469      0.917 0.988 0.000 0.000 0.012
#> GSM711916     1  0.2589      0.865 0.884 0.000 0.000 0.116
#> GSM711922     1  0.0707      0.916 0.980 0.000 0.000 0.020
#> GSM711924     1  0.0336      0.916 0.992 0.000 0.000 0.008
#> GSM711926     4  0.7965      0.478 0.028 0.296 0.168 0.508
#> GSM711928     1  0.0707      0.916 0.980 0.000 0.000 0.020
#> GSM711930     1  0.2760      0.857 0.872 0.000 0.000 0.128
#> GSM711932     1  0.1474      0.906 0.948 0.000 0.000 0.052
#> GSM711934     1  0.0707      0.916 0.980 0.000 0.000 0.020
#> GSM711940     4  0.7468      0.742 0.304 0.000 0.204 0.492
#> GSM711942     1  0.0336      0.916 0.992 0.000 0.000 0.008
#> GSM711944     3  0.2944      0.777 0.128 0.000 0.868 0.004
#> GSM711946     4  0.8381      0.789 0.256 0.040 0.220 0.484
#> GSM711948     1  0.2654      0.835 0.888 0.000 0.004 0.108
#> GSM711952     1  0.2760      0.857 0.872 0.000 0.000 0.128
#> GSM711954     1  0.0817      0.917 0.976 0.000 0.000 0.024
#> GSM711962     1  0.0469      0.915 0.988 0.000 0.000 0.012
#> GSM711970     1  0.0817      0.917 0.976 0.000 0.000 0.024
#> GSM711974     1  0.0336      0.917 0.992 0.000 0.000 0.008
#> GSM711978     4  0.8475      0.787 0.256 0.056 0.192 0.496
#> GSM711988     1  0.1489      0.902 0.952 0.000 0.004 0.044
#> GSM711990     3  0.0657      0.961 0.012 0.000 0.984 0.004
#> GSM711992     1  0.8779     -0.376 0.480 0.112 0.128 0.280
#> GSM711982     1  0.2589      0.865 0.884 0.000 0.000 0.116
#> GSM711984     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711912     1  0.2760      0.857 0.872 0.000 0.000 0.128
#> GSM711918     1  0.2760      0.857 0.872 0.000 0.000 0.128
#> GSM711920     1  0.0336      0.916 0.992 0.000 0.000 0.008
#> GSM711937     2  0.2520      0.790 0.004 0.904 0.004 0.088
#> GSM711939     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711951     2  0.7262      0.154 0.004 0.528 0.148 0.320
#> GSM711957     4  0.3688      0.529 0.208 0.000 0.000 0.792
#> GSM711959     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711965     4  0.7536      0.742 0.244 0.000 0.264 0.492
#> GSM711967     1  0.0469      0.915 0.988 0.000 0.000 0.012
#> GSM711969     2  0.2164      0.804 0.004 0.924 0.004 0.068
#> GSM711973     3  0.2256      0.905 0.020 0.000 0.924 0.056
#> GSM711977     3  0.0895      0.953 0.004 0.000 0.976 0.020
#> GSM711981     4  0.8770      0.671 0.120 0.188 0.176 0.516
#> GSM711987     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711907     2  0.5822      0.485 0.004 0.668 0.056 0.272
#> GSM711909     3  0.0000      0.966 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0188      0.965 0.000 0.000 0.996 0.004
#> GSM711915     3  0.0000      0.966 0.000 0.000 1.000 0.000
#> GSM711917     2  0.1042      0.828 0.000 0.972 0.020 0.008
#> GSM711923     4  0.8381      0.789 0.256 0.040 0.220 0.484
#> GSM711925     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000      0.966 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711931     4  0.7874      0.425 0.020 0.320 0.168 0.492
#> GSM711933     1  0.1576      0.899 0.948 0.000 0.004 0.048
#> GSM711935     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711941     4  0.7468      0.742 0.304 0.000 0.204 0.492
#> GSM711943     4  0.8381      0.789 0.256 0.040 0.220 0.484
#> GSM711945     4  0.8391      0.780 0.240 0.040 0.236 0.484
#> GSM711947     2  0.6607      0.190 0.000 0.476 0.444 0.080
#> GSM711949     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711955     1  0.2737      0.836 0.888 0.000 0.008 0.104
#> GSM711963     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0657      0.961 0.012 0.000 0.984 0.004
#> GSM711975     2  0.7262      0.154 0.004 0.528 0.148 0.320
#> GSM711979     4  0.8475      0.787 0.256 0.056 0.192 0.496
#> GSM711989     2  0.7262      0.154 0.004 0.528 0.148 0.320
#> GSM711991     2  0.6659      0.173 0.000 0.468 0.448 0.084
#> GSM711993     4  0.7951      0.437 0.024 0.316 0.168 0.492
#> GSM711983     3  0.0657      0.961 0.012 0.000 0.984 0.004
#> GSM711985     2  0.0000      0.843 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0895      0.953 0.004 0.000 0.976 0.020
#> GSM711919     3  0.0000      0.966 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000      0.966 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.2329     0.8018 0.000 0.876 0.000 0.124 0.000
#> GSM711938     2  0.0609     0.8728 0.000 0.980 0.000 0.020 0.000
#> GSM711950     1  0.2293     0.8354 0.900 0.000 0.000 0.084 0.016
#> GSM711956     1  0.0693     0.8950 0.980 0.000 0.000 0.012 0.008
#> GSM711958     1  0.0290     0.8961 0.992 0.000 0.000 0.008 0.000
#> GSM711960     1  0.0451     0.8962 0.988 0.000 0.004 0.008 0.000
#> GSM711964     1  0.0510     0.8964 0.984 0.000 0.000 0.016 0.000
#> GSM711966     1  0.2723     0.8253 0.864 0.000 0.000 0.012 0.124
#> GSM711968     1  0.0693     0.8950 0.980 0.000 0.000 0.012 0.008
#> GSM711972     1  0.2723     0.8253 0.864 0.000 0.000 0.012 0.124
#> GSM711976     1  0.1300     0.8841 0.956 0.000 0.000 0.028 0.016
#> GSM711980     1  0.0404     0.8959 0.988 0.000 0.000 0.012 0.000
#> GSM711986     1  0.4316     0.7414 0.772 0.000 0.000 0.108 0.120
#> GSM711904     1  0.0693     0.8950 0.980 0.000 0.000 0.012 0.008
#> GSM711906     1  0.1408     0.8763 0.948 0.000 0.000 0.008 0.044
#> GSM711908     1  0.4457     0.7291 0.760 0.000 0.000 0.116 0.124
#> GSM711910     3  0.0510     0.8985 0.000 0.000 0.984 0.000 0.016
#> GSM711914     1  0.0510     0.8964 0.984 0.000 0.000 0.016 0.000
#> GSM711916     1  0.2723     0.8253 0.864 0.000 0.000 0.012 0.124
#> GSM711922     1  0.0693     0.8950 0.980 0.000 0.000 0.012 0.008
#> GSM711924     1  0.0290     0.8943 0.992 0.000 0.000 0.000 0.008
#> GSM711926     4  0.3690     0.4232 0.012 0.224 0.000 0.764 0.000
#> GSM711928     1  0.0693     0.8950 0.980 0.000 0.000 0.012 0.008
#> GSM711930     1  0.4457     0.7291 0.760 0.000 0.000 0.116 0.124
#> GSM711932     1  0.1493     0.8852 0.948 0.000 0.000 0.028 0.024
#> GSM711934     1  0.0693     0.8950 0.980 0.000 0.000 0.012 0.008
#> GSM711940     4  0.5165     0.4775 0.304 0.000 0.036 0.644 0.016
#> GSM711942     1  0.0290     0.8943 0.992 0.000 0.000 0.000 0.008
#> GSM711944     3  0.2536     0.7328 0.128 0.000 0.868 0.004 0.000
#> GSM711946     4  0.5064     0.5458 0.256 0.008 0.048 0.684 0.004
#> GSM711948     1  0.2464     0.8222 0.888 0.000 0.000 0.096 0.016
#> GSM711952     1  0.4361     0.7379 0.768 0.000 0.000 0.108 0.124
#> GSM711954     1  0.0807     0.8959 0.976 0.000 0.000 0.012 0.012
#> GSM711962     1  0.0404     0.8934 0.988 0.000 0.000 0.000 0.012
#> GSM711970     1  0.0807     0.8959 0.976 0.000 0.000 0.012 0.012
#> GSM711974     1  0.0290     0.8961 0.992 0.000 0.000 0.008 0.000
#> GSM711978     4  0.4467     0.5422 0.240 0.012 0.024 0.724 0.000
#> GSM711988     1  0.1386     0.8820 0.952 0.000 0.000 0.032 0.016
#> GSM711990     3  0.0854     0.8967 0.012 0.000 0.976 0.008 0.004
#> GSM711992     1  0.5697    -0.2805 0.480 0.068 0.000 0.448 0.004
#> GSM711982     1  0.2723     0.8253 0.864 0.000 0.000 0.012 0.124
#> GSM711984     2  0.0162     0.8766 0.000 0.996 0.000 0.000 0.004
#> GSM711912     1  0.4457     0.7291 0.760 0.000 0.000 0.116 0.124
#> GSM711918     1  0.4457     0.7291 0.760 0.000 0.000 0.116 0.124
#> GSM711920     1  0.0290     0.8943 0.992 0.000 0.000 0.000 0.008
#> GSM711937     2  0.2329     0.8018 0.000 0.876 0.000 0.124 0.000
#> GSM711939     2  0.0609     0.8728 0.000 0.980 0.000 0.020 0.000
#> GSM711951     4  0.4283     0.1751 0.000 0.456 0.000 0.544 0.000
#> GSM711957     5  0.5309     0.0000 0.060 0.000 0.000 0.364 0.576
#> GSM711959     2  0.0703     0.8715 0.000 0.976 0.000 0.024 0.000
#> GSM711961     2  0.0162     0.8766 0.000 0.996 0.000 0.000 0.004
#> GSM711965     4  0.5650     0.4924 0.244 0.000 0.084 0.652 0.020
#> GSM711967     1  0.0404     0.8934 0.988 0.000 0.000 0.000 0.012
#> GSM711969     2  0.2074     0.8199 0.000 0.896 0.000 0.104 0.000
#> GSM711973     3  0.4817     0.7479 0.016 0.000 0.728 0.052 0.204
#> GSM711977     3  0.3710     0.7956 0.000 0.000 0.784 0.024 0.192
#> GSM711981     4  0.4917     0.4773 0.104 0.140 0.008 0.744 0.004
#> GSM711987     2  0.0162     0.8766 0.000 0.996 0.000 0.000 0.004
#> GSM711905     2  0.0162     0.8766 0.000 0.996 0.000 0.000 0.004
#> GSM711907     2  0.4192     0.2465 0.000 0.596 0.000 0.404 0.000
#> GSM711909     3  0.0162     0.9015 0.000 0.000 0.996 0.000 0.004
#> GSM711911     3  0.0324     0.9013 0.000 0.000 0.992 0.004 0.004
#> GSM711915     3  0.3074     0.8100 0.000 0.000 0.804 0.000 0.196
#> GSM711917     2  0.1197     0.8588 0.000 0.952 0.000 0.048 0.000
#> GSM711923     4  0.5064     0.5458 0.256 0.008 0.048 0.684 0.004
#> GSM711925     2  0.0162     0.8766 0.000 0.996 0.000 0.000 0.004
#> GSM711927     3  0.0162     0.9015 0.000 0.000 0.996 0.000 0.004
#> GSM711929     2  0.0162     0.8766 0.000 0.996 0.000 0.000 0.004
#> GSM711931     4  0.3635     0.4109 0.004 0.248 0.000 0.748 0.000
#> GSM711933     1  0.1547     0.8798 0.948 0.000 0.004 0.032 0.016
#> GSM711935     2  0.0162     0.8766 0.000 0.996 0.000 0.000 0.004
#> GSM711941     4  0.5165     0.4775 0.304 0.000 0.036 0.644 0.016
#> GSM711943     4  0.5064     0.5458 0.256 0.008 0.048 0.684 0.004
#> GSM711945     4  0.5271     0.5376 0.240 0.008 0.060 0.684 0.008
#> GSM711947     2  0.8153    -0.0664 0.000 0.340 0.256 0.300 0.104
#> GSM711949     2  0.0162     0.8766 0.000 0.996 0.000 0.000 0.004
#> GSM711953     2  0.0162     0.8766 0.000 0.996 0.000 0.000 0.004
#> GSM711955     1  0.2568     0.8229 0.888 0.000 0.004 0.092 0.016
#> GSM711963     2  0.0162     0.8766 0.000 0.996 0.000 0.000 0.004
#> GSM711971     3  0.0854     0.8967 0.012 0.000 0.976 0.008 0.004
#> GSM711975     4  0.4283     0.1751 0.000 0.456 0.000 0.544 0.000
#> GSM711979     4  0.4467     0.5422 0.240 0.012 0.024 0.724 0.000
#> GSM711989     4  0.4283     0.1751 0.000 0.456 0.000 0.544 0.000
#> GSM711991     2  0.8158    -0.0845 0.000 0.332 0.256 0.308 0.104
#> GSM711993     4  0.3728     0.4152 0.008 0.244 0.000 0.748 0.000
#> GSM711983     3  0.0854     0.8967 0.012 0.000 0.976 0.008 0.004
#> GSM711985     2  0.0609     0.8728 0.000 0.980 0.000 0.020 0.000
#> GSM711913     3  0.3710     0.7956 0.000 0.000 0.784 0.024 0.192
#> GSM711919     3  0.0162     0.9015 0.000 0.000 0.996 0.000 0.004
#> GSM711921     3  0.0510     0.8985 0.000 0.000 0.984 0.000 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
#> GSM711936     2  0.3428     0.7272 0.000 0.696 0.000 0.304 NA 0.000
#> GSM711938     2  0.2631     0.8297 0.000 0.820 0.000 0.180 NA 0.000
#> GSM711950     1  0.1995     0.7833 0.912 0.000 0.000 0.052 NA 0.000
#> GSM711956     1  0.0508     0.8467 0.984 0.000 0.000 0.004 NA 0.000
#> GSM711958     1  0.0260     0.8467 0.992 0.000 0.000 0.000 NA 0.000
#> GSM711960     1  0.0405     0.8466 0.988 0.000 0.004 0.000 NA 0.000
#> GSM711964     1  0.0935     0.8465 0.964 0.000 0.000 0.004 NA 0.000
#> GSM711966     1  0.3482     0.6755 0.684 0.000 0.000 0.000 NA 0.000
#> GSM711968     1  0.0508     0.8467 0.984 0.000 0.000 0.004 NA 0.000
#> GSM711972     1  0.3499     0.6740 0.680 0.000 0.000 0.000 NA 0.000
#> GSM711976     1  0.0891     0.8321 0.968 0.000 0.000 0.008 NA 0.000
#> GSM711980     1  0.0405     0.8461 0.988 0.000 0.000 0.004 NA 0.000
#> GSM711986     1  0.3828     0.5393 0.560 0.000 0.000 0.000 NA 0.000
#> GSM711904     1  0.0692     0.8454 0.976 0.000 0.000 0.004 NA 0.000
#> GSM711906     1  0.2340     0.7953 0.852 0.000 0.000 0.000 NA 0.000
#> GSM711908     1  0.3867     0.4811 0.512 0.000 0.000 0.000 NA 0.000
#> GSM711910     3  0.0508     0.8767 0.000 0.000 0.984 0.000 NA 0.012
#> GSM711914     1  0.0935     0.8465 0.964 0.000 0.000 0.004 NA 0.000
#> GSM711916     1  0.3499     0.6740 0.680 0.000 0.000 0.000 NA 0.000
#> GSM711922     1  0.0405     0.8467 0.988 0.000 0.000 0.004 NA 0.000
#> GSM711924     1  0.0790     0.8451 0.968 0.000 0.000 0.000 NA 0.000
#> GSM711926     4  0.0972     0.4397 0.008 0.028 0.000 0.964 NA 0.000
#> GSM711928     1  0.0603     0.8467 0.980 0.000 0.000 0.004 NA 0.000
#> GSM711930     1  0.3867     0.4811 0.512 0.000 0.000 0.000 NA 0.000
#> GSM711932     1  0.1462     0.8362 0.936 0.000 0.000 0.008 NA 0.000
#> GSM711934     1  0.0405     0.8457 0.988 0.000 0.000 0.004 NA 0.000
#> GSM711940     4  0.5148     0.5075 0.316 0.000 0.028 0.604 NA 0.000
#> GSM711942     1  0.0790     0.8451 0.968 0.000 0.000 0.000 NA 0.000
#> GSM711944     3  0.2278     0.7342 0.128 0.000 0.868 0.000 NA 0.000
#> GSM711946     4  0.4879     0.5464 0.264 0.000 0.040 0.660 NA 0.000
#> GSM711948     1  0.2190     0.7711 0.900 0.000 0.000 0.060 NA 0.000
#> GSM711952     1  0.3851     0.5175 0.540 0.000 0.000 0.000 NA 0.000
#> GSM711954     1  0.0291     0.8459 0.992 0.000 0.000 0.004 NA 0.000
#> GSM711962     1  0.1204     0.8394 0.944 0.000 0.000 0.000 NA 0.000
#> GSM711970     1  0.0291     0.8459 0.992 0.000 0.000 0.004 NA 0.000
#> GSM711974     1  0.0260     0.8467 0.992 0.000 0.000 0.000 NA 0.000
#> GSM711978     4  0.3892     0.5436 0.236 0.000 0.024 0.732 NA 0.000
#> GSM711988     1  0.0972     0.8298 0.964 0.000 0.000 0.008 NA 0.000
#> GSM711990     3  0.1074     0.8754 0.012 0.000 0.960 0.000 NA 0.000
#> GSM711992     4  0.4127     0.2394 0.484 0.004 0.000 0.508 NA 0.000
#> GSM711982     1  0.3499     0.6740 0.680 0.000 0.000 0.000 NA 0.000
#> GSM711984     2  0.0146     0.8671 0.000 0.996 0.000 0.004 NA 0.000
#> GSM711912     1  0.3866     0.4870 0.516 0.000 0.000 0.000 NA 0.000
#> GSM711918     1  0.3866     0.4870 0.516 0.000 0.000 0.000 NA 0.000
#> GSM711920     1  0.0790     0.8451 0.968 0.000 0.000 0.000 NA 0.000
#> GSM711937     2  0.3428     0.7272 0.000 0.696 0.000 0.304 NA 0.000
#> GSM711939     2  0.2631     0.8297 0.000 0.820 0.000 0.180 NA 0.000
#> GSM711951     4  0.3175     0.3434 0.000 0.256 0.000 0.744 NA 0.000
#> GSM711957     6  0.2135     0.0000 0.000 0.000 0.000 0.128 NA 0.872
#> GSM711959     2  0.2793     0.8183 0.000 0.800 0.000 0.200 NA 0.000
#> GSM711961     2  0.0000     0.8674 0.000 1.000 0.000 0.000 NA 0.000
#> GSM711965     4  0.5676     0.5159 0.260 0.000 0.068 0.612 NA 0.004
#> GSM711967     1  0.1204     0.8394 0.944 0.000 0.000 0.000 NA 0.000
#> GSM711969     2  0.3330     0.7489 0.000 0.716 0.000 0.284 NA 0.000
#> GSM711973     3  0.5529     0.6930 0.024 0.000 0.672 0.060 NA 0.048
#> GSM711977     3  0.4610     0.7447 0.000 0.000 0.736 0.056 NA 0.048
#> GSM711981     4  0.2963     0.4978 0.100 0.016 0.008 0.860 NA 0.000
#> GSM711987     2  0.0000     0.8674 0.000 1.000 0.000 0.000 NA 0.000
#> GSM711905     2  0.0000     0.8674 0.000 1.000 0.000 0.000 NA 0.000
#> GSM711907     4  0.3756    -0.0624 0.000 0.400 0.000 0.600 NA 0.000
#> GSM711909     3  0.0146     0.8804 0.000 0.000 0.996 0.000 NA 0.004
#> GSM711911     3  0.0291     0.8802 0.000 0.000 0.992 0.000 NA 0.004
#> GSM711915     3  0.4289     0.7603 0.000 0.000 0.756 0.032 NA 0.052
#> GSM711917     2  0.2912     0.8091 0.000 0.784 0.000 0.216 NA 0.000
#> GSM711923     4  0.4879     0.5464 0.264 0.000 0.040 0.660 NA 0.000
#> GSM711925     2  0.0000     0.8674 0.000 1.000 0.000 0.000 NA 0.000
#> GSM711927     3  0.0146     0.8804 0.000 0.000 0.996 0.000 NA 0.004
#> GSM711929     2  0.0000     0.8674 0.000 1.000 0.000 0.000 NA 0.000
#> GSM711931     4  0.1075     0.4283 0.000 0.048 0.000 0.952 NA 0.000
#> GSM711933     1  0.1080     0.8281 0.960 0.000 0.004 0.004 NA 0.000
#> GSM711935     2  0.0000     0.8674 0.000 1.000 0.000 0.000 NA 0.000
#> GSM711941     4  0.5148     0.5075 0.316 0.000 0.028 0.604 NA 0.000
#> GSM711943     4  0.4879     0.5464 0.264 0.000 0.040 0.660 NA 0.000
#> GSM711945     4  0.5110     0.5426 0.248 0.000 0.052 0.660 NA 0.004
#> GSM711947     4  0.7977    -0.2853 0.000 0.052 0.256 0.312 NA 0.080
#> GSM711949     2  0.0000     0.8674 0.000 1.000 0.000 0.000 NA 0.000
#> GSM711953     2  0.0000     0.8674 0.000 1.000 0.000 0.000 NA 0.000
#> GSM711955     1  0.2272     0.7719 0.900 0.000 0.004 0.056 NA 0.000
#> GSM711963     2  0.0000     0.8674 0.000 1.000 0.000 0.000 NA 0.000
#> GSM711971     3  0.1074     0.8754 0.012 0.000 0.960 0.000 NA 0.000
#> GSM711975     4  0.3175     0.3434 0.000 0.256 0.000 0.744 NA 0.000
#> GSM711979     4  0.3892     0.5436 0.236 0.000 0.024 0.732 NA 0.000
#> GSM711989     4  0.3175     0.3434 0.000 0.256 0.000 0.744 NA 0.000
#> GSM711991     4  0.7894    -0.2824 0.000 0.044 0.256 0.316 NA 0.080
#> GSM711993     4  0.1152     0.4322 0.004 0.044 0.000 0.952 NA 0.000
#> GSM711983     3  0.1074     0.8754 0.012 0.000 0.960 0.000 NA 0.000
#> GSM711985     2  0.2562     0.8327 0.000 0.828 0.000 0.172 NA 0.000
#> GSM711913     3  0.4610     0.7447 0.000 0.000 0.736 0.056 NA 0.048
#> GSM711919     3  0.0146     0.8804 0.000 0.000 0.996 0.000 NA 0.004
#> GSM711921     3  0.0508     0.8767 0.000 0.000 0.984 0.000 NA 0.012

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

consensus_heatmap(res, k = 2)

plot of chunk tab-CV-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 tissue(p) disease.state(p) individual(p) k
#> CV:hclust 83  3.62e-04           0.2181         0.382 2
#> CV:hclust 70  1.90e-08           0.1587         0.643 3
#> CV:hclust 80  7.97e-09           0.2004         0.345 4
#> CV:hclust 75  2.02e-08           0.0888         0.359 5
#> CV:hclust 74  9.32e-08           0.0379         0.205 6

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


CV:kmeans**

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 27425 rows and 90 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 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-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 1.000           0.969       0.986         0.4063 0.604   0.604
#> 3 3 0.951           0.959       0.982         0.5604 0.736   0.572
#> 4 4 0.974           0.928       0.969         0.1387 0.869   0.660
#> 5 5 0.747           0.662       0.826         0.0756 0.918   0.722
#> 6 6 0.726           0.591       0.767         0.0437 0.931   0.715

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

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

There is also optional best \(k\) = 2 3 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
#> GSM711936     2  0.0376     0.9997 0.004 0.996
#> GSM711938     2  0.0376     0.9997 0.004 0.996
#> GSM711950     1  0.0000     0.9822 1.000 0.000
#> GSM711956     1  0.0000     0.9822 1.000 0.000
#> GSM711958     1  0.0000     0.9822 1.000 0.000
#> GSM711960     1  0.0376     0.9806 0.996 0.004
#> GSM711964     1  0.0000     0.9822 1.000 0.000
#> GSM711966     1  0.0000     0.9822 1.000 0.000
#> GSM711968     1  0.0000     0.9822 1.000 0.000
#> GSM711972     1  0.0000     0.9822 1.000 0.000
#> GSM711976     1  0.0000     0.9822 1.000 0.000
#> GSM711980     1  0.0000     0.9822 1.000 0.000
#> GSM711986     1  0.0000     0.9822 1.000 0.000
#> GSM711904     1  0.0000     0.9822 1.000 0.000
#> GSM711906     1  0.0000     0.9822 1.000 0.000
#> GSM711908     1  0.0000     0.9822 1.000 0.000
#> GSM711910     1  0.0376     0.9806 0.996 0.004
#> GSM711914     1  0.0000     0.9822 1.000 0.000
#> GSM711916     1  0.0000     0.9822 1.000 0.000
#> GSM711922     1  0.0000     0.9822 1.000 0.000
#> GSM711924     1  0.0000     0.9822 1.000 0.000
#> GSM711926     1  0.0938     0.9722 0.988 0.012
#> GSM711928     1  0.0000     0.9822 1.000 0.000
#> GSM711930     1  0.0000     0.9822 1.000 0.000
#> GSM711932     1  0.0000     0.9822 1.000 0.000
#> GSM711934     1  0.0000     0.9822 1.000 0.000
#> GSM711940     1  0.0000     0.9822 1.000 0.000
#> GSM711942     1  0.0000     0.9822 1.000 0.000
#> GSM711944     1  0.0376     0.9806 0.996 0.004
#> GSM711946     1  0.0376     0.9806 0.996 0.004
#> GSM711948     1  0.0000     0.9822 1.000 0.000
#> GSM711952     1  0.0000     0.9822 1.000 0.000
#> GSM711954     1  0.0000     0.9822 1.000 0.000
#> GSM711962     1  0.0000     0.9822 1.000 0.000
#> GSM711970     1  0.0000     0.9822 1.000 0.000
#> GSM711974     1  0.0000     0.9822 1.000 0.000
#> GSM711978     1  0.0000     0.9822 1.000 0.000
#> GSM711988     1  0.0000     0.9822 1.000 0.000
#> GSM711990     1  0.0376     0.9806 0.996 0.004
#> GSM711992     1  0.0000     0.9822 1.000 0.000
#> GSM711982     1  0.0000     0.9822 1.000 0.000
#> GSM711984     2  0.0376     0.9997 0.004 0.996
#> GSM711912     1  0.0000     0.9822 1.000 0.000
#> GSM711918     1  0.0000     0.9822 1.000 0.000
#> GSM711920     1  0.0000     0.9822 1.000 0.000
#> GSM711937     2  0.0376     0.9997 0.004 0.996
#> GSM711939     2  0.0376     0.9997 0.004 0.996
#> GSM711951     2  0.0376     0.9997 0.004 0.996
#> GSM711957     1  0.0000     0.9822 1.000 0.000
#> GSM711959     2  0.0376     0.9997 0.004 0.996
#> GSM711961     2  0.0376     0.9997 0.004 0.996
#> GSM711965     1  0.0376     0.9806 0.996 0.004
#> GSM711967     1  0.0000     0.9822 1.000 0.000
#> GSM711969     2  0.0376     0.9997 0.004 0.996
#> GSM711973     1  0.0376     0.9806 0.996 0.004
#> GSM711977     1  0.0376     0.9806 0.996 0.004
#> GSM711981     1  0.6973     0.7713 0.812 0.188
#> GSM711987     2  0.0376     0.9997 0.004 0.996
#> GSM711905     2  0.0376     0.9997 0.004 0.996
#> GSM711907     2  0.0376     0.9997 0.004 0.996
#> GSM711909     1  0.0376     0.9806 0.996 0.004
#> GSM711911     1  0.0376     0.9806 0.996 0.004
#> GSM711915     1  0.0376     0.9806 0.996 0.004
#> GSM711917     2  0.0376     0.9997 0.004 0.996
#> GSM711923     1  0.0000     0.9822 1.000 0.000
#> GSM711925     2  0.0376     0.9997 0.004 0.996
#> GSM711927     1  0.0376     0.9806 0.996 0.004
#> GSM711929     2  0.0376     0.9997 0.004 0.996
#> GSM711931     2  0.0376     0.9997 0.004 0.996
#> GSM711933     1  0.0000     0.9822 1.000 0.000
#> GSM711935     2  0.0376     0.9997 0.004 0.996
#> GSM711941     1  0.0000     0.9822 1.000 0.000
#> GSM711943     1  0.0000     0.9822 1.000 0.000
#> GSM711945     1  0.7056     0.7712 0.808 0.192
#> GSM711947     2  0.0376     0.9942 0.004 0.996
#> GSM711949     2  0.0376     0.9997 0.004 0.996
#> GSM711953     2  0.0376     0.9997 0.004 0.996
#> GSM711955     1  0.0376     0.9806 0.996 0.004
#> GSM711963     2  0.0376     0.9997 0.004 0.996
#> GSM711971     1  0.0376     0.9806 0.996 0.004
#> GSM711975     2  0.0376     0.9997 0.004 0.996
#> GSM711979     1  0.0000     0.9822 1.000 0.000
#> GSM711989     2  0.0376     0.9997 0.004 0.996
#> GSM711991     1  0.7056     0.7712 0.808 0.192
#> GSM711993     1  1.0000     0.0408 0.504 0.496
#> GSM711983     1  0.0376     0.9806 0.996 0.004
#> GSM711985     2  0.0376     0.9997 0.004 0.996
#> GSM711913     1  0.0376     0.9806 0.996 0.004
#> GSM711919     1  0.0376     0.9806 0.996 0.004
#> GSM711921     1  0.0376     0.9806 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
#> GSM711936     2   0.000      0.982 0.000 1.000 0.000
#> GSM711938     2   0.000      0.982 0.000 1.000 0.000
#> GSM711950     1   0.000      0.989 1.000 0.000 0.000
#> GSM711956     1   0.000      0.989 1.000 0.000 0.000
#> GSM711958     1   0.000      0.989 1.000 0.000 0.000
#> GSM711960     1   0.196      0.932 0.944 0.000 0.056
#> GSM711964     1   0.000      0.989 1.000 0.000 0.000
#> GSM711966     1   0.000      0.989 1.000 0.000 0.000
#> GSM711968     1   0.000      0.989 1.000 0.000 0.000
#> GSM711972     1   0.000      0.989 1.000 0.000 0.000
#> GSM711976     1   0.000      0.989 1.000 0.000 0.000
#> GSM711980     1   0.000      0.989 1.000 0.000 0.000
#> GSM711986     1   0.000      0.989 1.000 0.000 0.000
#> GSM711904     1   0.000      0.989 1.000 0.000 0.000
#> GSM711906     1   0.000      0.989 1.000 0.000 0.000
#> GSM711908     1   0.000      0.989 1.000 0.000 0.000
#> GSM711910     3   0.000      0.957 0.000 0.000 1.000
#> GSM711914     1   0.000      0.989 1.000 0.000 0.000
#> GSM711916     1   0.000      0.989 1.000 0.000 0.000
#> GSM711922     1   0.000      0.989 1.000 0.000 0.000
#> GSM711924     1   0.000      0.989 1.000 0.000 0.000
#> GSM711926     1   0.000      0.989 1.000 0.000 0.000
#> GSM711928     1   0.000      0.989 1.000 0.000 0.000
#> GSM711930     1   0.000      0.989 1.000 0.000 0.000
#> GSM711932     1   0.000      0.989 1.000 0.000 0.000
#> GSM711934     1   0.000      0.989 1.000 0.000 0.000
#> GSM711940     1   0.000      0.989 1.000 0.000 0.000
#> GSM711942     1   0.000      0.989 1.000 0.000 0.000
#> GSM711944     3   0.000      0.957 0.000 0.000 1.000
#> GSM711946     3   0.000      0.957 0.000 0.000 1.000
#> GSM711948     1   0.000      0.989 1.000 0.000 0.000
#> GSM711952     1   0.000      0.989 1.000 0.000 0.000
#> GSM711954     1   0.000      0.989 1.000 0.000 0.000
#> GSM711962     1   0.000      0.989 1.000 0.000 0.000
#> GSM711970     1   0.000      0.989 1.000 0.000 0.000
#> GSM711974     1   0.000      0.989 1.000 0.000 0.000
#> GSM711978     1   0.000      0.989 1.000 0.000 0.000
#> GSM711988     1   0.000      0.989 1.000 0.000 0.000
#> GSM711990     3   0.000      0.957 0.000 0.000 1.000
#> GSM711992     1   0.000      0.989 1.000 0.000 0.000
#> GSM711982     1   0.000      0.989 1.000 0.000 0.000
#> GSM711984     2   0.000      0.982 0.000 1.000 0.000
#> GSM711912     1   0.000      0.989 1.000 0.000 0.000
#> GSM711918     1   0.000      0.989 1.000 0.000 0.000
#> GSM711920     1   0.000      0.989 1.000 0.000 0.000
#> GSM711937     2   0.000      0.982 0.000 1.000 0.000
#> GSM711939     2   0.000      0.982 0.000 1.000 0.000
#> GSM711951     2   0.000      0.982 0.000 1.000 0.000
#> GSM711957     1   0.000      0.989 1.000 0.000 0.000
#> GSM711959     2   0.000      0.982 0.000 1.000 0.000
#> GSM711961     2   0.000      0.982 0.000 1.000 0.000
#> GSM711965     3   0.000      0.957 0.000 0.000 1.000
#> GSM711967     1   0.000      0.989 1.000 0.000 0.000
#> GSM711969     2   0.000      0.982 0.000 1.000 0.000
#> GSM711973     3   0.362      0.838 0.136 0.000 0.864
#> GSM711977     3   0.000      0.957 0.000 0.000 1.000
#> GSM711981     3   0.802      0.625 0.156 0.188 0.656
#> GSM711987     2   0.000      0.982 0.000 1.000 0.000
#> GSM711905     2   0.000      0.982 0.000 1.000 0.000
#> GSM711907     2   0.000      0.982 0.000 1.000 0.000
#> GSM711909     3   0.000      0.957 0.000 0.000 1.000
#> GSM711911     3   0.000      0.957 0.000 0.000 1.000
#> GSM711915     3   0.000      0.957 0.000 0.000 1.000
#> GSM711917     2   0.000      0.982 0.000 1.000 0.000
#> GSM711923     3   0.394      0.817 0.156 0.000 0.844
#> GSM711925     2   0.000      0.982 0.000 1.000 0.000
#> GSM711927     3   0.000      0.957 0.000 0.000 1.000
#> GSM711929     2   0.000      0.982 0.000 1.000 0.000
#> GSM711931     2   0.000      0.982 0.000 1.000 0.000
#> GSM711933     1   0.000      0.989 1.000 0.000 0.000
#> GSM711935     2   0.000      0.982 0.000 1.000 0.000
#> GSM711941     1   0.412      0.792 0.832 0.000 0.168
#> GSM711943     3   0.394      0.817 0.156 0.000 0.844
#> GSM711945     3   0.000      0.957 0.000 0.000 1.000
#> GSM711947     3   0.153      0.925 0.000 0.040 0.960
#> GSM711949     2   0.000      0.982 0.000 1.000 0.000
#> GSM711953     2   0.000      0.982 0.000 1.000 0.000
#> GSM711955     1   0.489      0.693 0.772 0.000 0.228
#> GSM711963     2   0.000      0.982 0.000 1.000 0.000
#> GSM711971     3   0.000      0.957 0.000 0.000 1.000
#> GSM711975     2   0.000      0.982 0.000 1.000 0.000
#> GSM711979     1   0.000      0.989 1.000 0.000 0.000
#> GSM711989     2   0.000      0.982 0.000 1.000 0.000
#> GSM711991     3   0.000      0.957 0.000 0.000 1.000
#> GSM711993     2   0.576      0.508 0.328 0.672 0.000
#> GSM711983     3   0.000      0.957 0.000 0.000 1.000
#> GSM711985     2   0.000      0.982 0.000 1.000 0.000
#> GSM711913     3   0.000      0.957 0.000 0.000 1.000
#> GSM711919     3   0.000      0.957 0.000 0.000 1.000
#> GSM711921     3   0.000      0.957 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711950     4  0.1302      0.866 0.044 0.000 0.000 0.956
#> GSM711956     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711958     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711960     1  0.0188      0.988 0.996 0.000 0.004 0.000
#> GSM711964     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711976     1  0.1867      0.920 0.928 0.000 0.000 0.072
#> GSM711980     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711906     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711910     3  0.0000      0.970 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711924     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711926     4  0.0336      0.894 0.008 0.000 0.000 0.992
#> GSM711928     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711932     1  0.1867      0.920 0.928 0.000 0.000 0.072
#> GSM711934     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711940     1  0.0592      0.978 0.984 0.000 0.000 0.016
#> GSM711942     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711944     3  0.0000      0.970 0.000 0.000 1.000 0.000
#> GSM711946     4  0.0336      0.890 0.000 0.000 0.008 0.992
#> GSM711948     4  0.4543      0.542 0.324 0.000 0.000 0.676
#> GSM711952     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711954     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711962     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711970     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711974     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0336      0.894 0.008 0.000 0.000 0.992
#> GSM711988     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711990     3  0.0000      0.970 0.000 0.000 1.000 0.000
#> GSM711992     4  0.0336      0.894 0.008 0.000 0.000 0.992
#> GSM711982     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711951     4  0.0469      0.886 0.000 0.012 0.000 0.988
#> GSM711957     1  0.2281      0.895 0.904 0.000 0.000 0.096
#> GSM711959     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711965     4  0.4643      0.430 0.000 0.000 0.344 0.656
#> GSM711967     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711969     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711973     4  0.4054      0.719 0.016 0.000 0.188 0.796
#> GSM711977     3  0.0188      0.968 0.000 0.000 0.996 0.004
#> GSM711981     4  0.0188      0.893 0.004 0.000 0.000 0.996
#> GSM711987     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711907     2  0.2281      0.883 0.000 0.904 0.000 0.096
#> GSM711909     3  0.0000      0.970 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000      0.970 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0188      0.968 0.000 0.000 0.996 0.004
#> GSM711917     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0376      0.893 0.004 0.000 0.004 0.992
#> GSM711925     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000      0.970 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711931     2  0.4746      0.466 0.000 0.632 0.000 0.368
#> GSM711933     1  0.0000      0.992 1.000 0.000 0.000 0.000
#> GSM711935     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0336      0.894 0.008 0.000 0.000 0.992
#> GSM711943     4  0.0376      0.893 0.004 0.000 0.004 0.992
#> GSM711945     4  0.0188      0.890 0.000 0.000 0.004 0.996
#> GSM711947     3  0.4285      0.773 0.000 0.156 0.804 0.040
#> GSM711949     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711955     4  0.5112      0.271 0.436 0.000 0.004 0.560
#> GSM711963     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0000      0.970 0.000 0.000 1.000 0.000
#> GSM711975     2  0.3907      0.712 0.000 0.768 0.000 0.232
#> GSM711979     4  0.0336      0.894 0.008 0.000 0.000 0.992
#> GSM711989     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711991     3  0.3569      0.759 0.000 0.000 0.804 0.196
#> GSM711993     4  0.0336      0.894 0.008 0.000 0.000 0.992
#> GSM711983     3  0.0000      0.970 0.000 0.000 1.000 0.000
#> GSM711985     2  0.0000      0.967 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0188      0.968 0.000 0.000 0.996 0.004
#> GSM711919     3  0.0000      0.970 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000      0.970 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.3563    0.83704 0.000 0.780 0.000 0.012 0.208
#> GSM711938     2  0.0000    0.89308 0.000 1.000 0.000 0.000 0.000
#> GSM711950     4  0.3994    0.71387 0.188 0.000 0.000 0.772 0.040
#> GSM711956     1  0.0963    0.62588 0.964 0.000 0.000 0.000 0.036
#> GSM711958     1  0.1792    0.61578 0.916 0.000 0.000 0.000 0.084
#> GSM711960     1  0.3191    0.59147 0.860 0.000 0.052 0.004 0.084
#> GSM711964     1  0.3636    0.00664 0.728 0.000 0.000 0.000 0.272
#> GSM711966     5  0.4273    0.98888 0.448 0.000 0.000 0.000 0.552
#> GSM711968     1  0.1792    0.58248 0.916 0.000 0.000 0.000 0.084
#> GSM711972     5  0.4273    0.98888 0.448 0.000 0.000 0.000 0.552
#> GSM711976     1  0.2777    0.55669 0.864 0.000 0.000 0.120 0.016
#> GSM711980     1  0.0000    0.64502 1.000 0.000 0.000 0.000 0.000
#> GSM711986     1  0.4283   -0.71857 0.544 0.000 0.000 0.000 0.456
#> GSM711904     1  0.3143    0.31242 0.796 0.000 0.000 0.000 0.204
#> GSM711906     5  0.4268    0.98648 0.444 0.000 0.000 0.000 0.556
#> GSM711908     5  0.4273    0.96941 0.448 0.000 0.000 0.000 0.552
#> GSM711910     3  0.0290    0.90377 0.000 0.000 0.992 0.000 0.008
#> GSM711914     1  0.3636    0.01167 0.728 0.000 0.000 0.000 0.272
#> GSM711916     5  0.4273    0.98888 0.448 0.000 0.000 0.000 0.552
#> GSM711922     1  0.0000    0.64502 1.000 0.000 0.000 0.000 0.000
#> GSM711924     1  0.2605    0.53322 0.852 0.000 0.000 0.000 0.148
#> GSM711926     4  0.2390    0.82316 0.020 0.000 0.000 0.896 0.084
#> GSM711928     1  0.2732    0.42917 0.840 0.000 0.000 0.000 0.160
#> GSM711930     5  0.4262    0.98032 0.440 0.000 0.000 0.000 0.560
#> GSM711932     1  0.1444    0.63147 0.948 0.000 0.000 0.040 0.012
#> GSM711934     1  0.0290    0.64521 0.992 0.000 0.000 0.000 0.008
#> GSM711940     1  0.4437    0.48423 0.760 0.000 0.000 0.140 0.100
#> GSM711942     1  0.2690    0.52353 0.844 0.000 0.000 0.000 0.156
#> GSM711944     3  0.5200    0.62953 0.228 0.000 0.688 0.012 0.072
#> GSM711946     4  0.1518    0.83927 0.004 0.000 0.004 0.944 0.048
#> GSM711948     1  0.4836    0.33290 0.652 0.000 0.000 0.304 0.044
#> GSM711952     1  0.4283   -0.71857 0.544 0.000 0.000 0.000 0.456
#> GSM711954     1  0.0324    0.64521 0.992 0.000 0.000 0.004 0.004
#> GSM711962     1  0.3336    0.36454 0.772 0.000 0.000 0.000 0.228
#> GSM711970     1  0.0162    0.64536 0.996 0.000 0.000 0.004 0.000
#> GSM711974     1  0.2377    0.56994 0.872 0.000 0.000 0.000 0.128
#> GSM711978     4  0.0865    0.85269 0.024 0.000 0.000 0.972 0.004
#> GSM711988     1  0.1195    0.63748 0.960 0.000 0.000 0.028 0.012
#> GSM711990     3  0.1357    0.90284 0.000 0.000 0.948 0.004 0.048
#> GSM711992     4  0.0955    0.85252 0.028 0.000 0.000 0.968 0.004
#> GSM711982     5  0.4273    0.98888 0.448 0.000 0.000 0.000 0.552
#> GSM711984     2  0.1544    0.88874 0.000 0.932 0.000 0.000 0.068
#> GSM711912     1  0.4291   -0.73949 0.536 0.000 0.000 0.000 0.464
#> GSM711918     1  0.4291   -0.73949 0.536 0.000 0.000 0.000 0.464
#> GSM711920     1  0.1043    0.63495 0.960 0.000 0.000 0.000 0.040
#> GSM711937     2  0.3421    0.84165 0.000 0.788 0.000 0.008 0.204
#> GSM711939     2  0.2020    0.88276 0.000 0.900 0.000 0.000 0.100
#> GSM711951     4  0.3663    0.72009 0.000 0.016 0.000 0.776 0.208
#> GSM711957     1  0.2446    0.60124 0.900 0.000 0.000 0.056 0.044
#> GSM711959     2  0.2074    0.88182 0.000 0.896 0.000 0.000 0.104
#> GSM711961     2  0.0000    0.89308 0.000 1.000 0.000 0.000 0.000
#> GSM711965     4  0.6308    0.22825 0.004 0.000 0.308 0.528 0.160
#> GSM711967     1  0.3300    0.41868 0.792 0.000 0.000 0.004 0.204
#> GSM711969     2  0.3455    0.83940 0.000 0.784 0.000 0.008 0.208
#> GSM711973     4  0.6220    0.61731 0.068 0.000 0.112 0.656 0.164
#> GSM711977     3  0.3449    0.85454 0.000 0.000 0.812 0.024 0.164
#> GSM711981     4  0.0566    0.84872 0.004 0.000 0.000 0.984 0.012
#> GSM711987     2  0.0000    0.89308 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000    0.89308 0.000 1.000 0.000 0.000 0.000
#> GSM711907     2  0.5958    0.61804 0.000 0.592 0.000 0.200 0.208
#> GSM711909     3  0.0290    0.90377 0.000 0.000 0.992 0.000 0.008
#> GSM711911     3  0.1282    0.90327 0.000 0.000 0.952 0.004 0.044
#> GSM711915     3  0.2969    0.86722 0.000 0.000 0.852 0.020 0.128
#> GSM711917     2  0.3421    0.84162 0.000 0.788 0.000 0.008 0.204
#> GSM711923     4  0.1403    0.84946 0.024 0.000 0.000 0.952 0.024
#> GSM711925     2  0.0000    0.89308 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0290    0.90377 0.000 0.000 0.992 0.000 0.008
#> GSM711929     2  0.0000    0.89308 0.000 1.000 0.000 0.000 0.000
#> GSM711931     4  0.6487    0.07059 0.000 0.316 0.000 0.476 0.208
#> GSM711933     1  0.1168    0.64431 0.960 0.000 0.000 0.008 0.032
#> GSM711935     2  0.0000    0.89308 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.1668    0.84606 0.028 0.000 0.000 0.940 0.032
#> GSM711943     4  0.0992    0.85296 0.024 0.000 0.000 0.968 0.008
#> GSM711945     4  0.1502    0.83846 0.000 0.000 0.004 0.940 0.056
#> GSM711947     3  0.4806    0.75922 0.000 0.092 0.776 0.056 0.076
#> GSM711949     2  0.0000    0.89308 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000    0.89308 0.000 1.000 0.000 0.000 0.000
#> GSM711955     1  0.5009    0.33469 0.652 0.000 0.000 0.288 0.060
#> GSM711963     2  0.0000    0.89308 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.1282    0.90327 0.000 0.000 0.952 0.004 0.044
#> GSM711975     2  0.6584    0.17817 0.000 0.412 0.000 0.380 0.208
#> GSM711979     4  0.0794    0.85250 0.028 0.000 0.000 0.972 0.000
#> GSM711989     2  0.4161    0.81668 0.000 0.752 0.000 0.040 0.208
#> GSM711991     3  0.3995    0.73067 0.000 0.000 0.776 0.180 0.044
#> GSM711993     4  0.2293    0.82341 0.016 0.000 0.000 0.900 0.084
#> GSM711983     3  0.1357    0.90284 0.000 0.000 0.948 0.004 0.048
#> GSM711985     2  0.1732    0.88698 0.000 0.920 0.000 0.000 0.080
#> GSM711913     3  0.3449    0.85454 0.000 0.000 0.812 0.024 0.164
#> GSM711919     3  0.0290    0.90377 0.000 0.000 0.992 0.000 0.008
#> GSM711921     3  0.0290    0.90377 0.000 0.000 0.992 0.000 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
#> GSM711936     2  0.3807     0.4461 0.000 0.628 0.000 0.004 0.368 0.000
#> GSM711938     2  0.0632     0.7797 0.024 0.976 0.000 0.000 0.000 0.000
#> GSM711950     4  0.4333     0.3218 0.376 0.000 0.000 0.596 0.028 0.000
#> GSM711956     1  0.4606     0.6207 0.656 0.000 0.000 0.000 0.076 0.268
#> GSM711958     1  0.5012     0.6119 0.576 0.000 0.000 0.000 0.088 0.336
#> GSM711960     1  0.5701     0.5884 0.612 0.000 0.060 0.000 0.084 0.244
#> GSM711964     6  0.5187    -0.1555 0.440 0.000 0.000 0.000 0.088 0.472
#> GSM711966     6  0.0291     0.6835 0.004 0.000 0.000 0.000 0.004 0.992
#> GSM711968     1  0.5030     0.5189 0.588 0.000 0.000 0.000 0.096 0.316
#> GSM711972     6  0.0291     0.6835 0.004 0.000 0.000 0.000 0.004 0.992
#> GSM711976     1  0.5392     0.6401 0.676 0.000 0.000 0.116 0.060 0.148
#> GSM711980     1  0.3189     0.6996 0.760 0.000 0.000 0.000 0.004 0.236
#> GSM711986     6  0.4204     0.6136 0.132 0.000 0.000 0.000 0.128 0.740
#> GSM711904     1  0.5217     0.3243 0.512 0.000 0.000 0.000 0.096 0.392
#> GSM711906     6  0.0603     0.6810 0.004 0.000 0.000 0.000 0.016 0.980
#> GSM711908     6  0.1908     0.6756 0.028 0.000 0.000 0.000 0.056 0.916
#> GSM711910     3  0.0291     0.8343 0.004 0.000 0.992 0.000 0.004 0.000
#> GSM711914     6  0.5226    -0.1836 0.444 0.000 0.000 0.000 0.092 0.464
#> GSM711916     6  0.0146     0.6850 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM711922     1  0.4059     0.6792 0.720 0.000 0.000 0.000 0.052 0.228
#> GSM711924     1  0.5260     0.4407 0.464 0.000 0.000 0.000 0.096 0.440
#> GSM711926     4  0.2389     0.6087 0.008 0.000 0.000 0.864 0.128 0.000
#> GSM711928     1  0.5112     0.3855 0.536 0.000 0.000 0.000 0.088 0.376
#> GSM711930     6  0.0458     0.6838 0.000 0.000 0.000 0.000 0.016 0.984
#> GSM711932     1  0.4678     0.6979 0.712 0.000 0.000 0.048 0.040 0.200
#> GSM711934     1  0.3617     0.7001 0.736 0.000 0.000 0.000 0.020 0.244
#> GSM711940     1  0.5816     0.5288 0.576 0.000 0.000 0.200 0.020 0.204
#> GSM711942     1  0.5260     0.4407 0.464 0.000 0.000 0.000 0.096 0.440
#> GSM711944     3  0.6109     0.3991 0.324 0.000 0.500 0.028 0.148 0.000
#> GSM711946     4  0.1334     0.7001 0.020 0.000 0.000 0.948 0.032 0.000
#> GSM711948     1  0.5093     0.4993 0.656 0.000 0.000 0.248 0.040 0.056
#> GSM711952     6  0.4204     0.6136 0.132 0.000 0.000 0.000 0.128 0.740
#> GSM711954     1  0.4050     0.6747 0.716 0.000 0.000 0.000 0.048 0.236
#> GSM711962     6  0.4949    -0.2643 0.380 0.000 0.000 0.000 0.072 0.548
#> GSM711970     1  0.3974     0.6939 0.728 0.000 0.000 0.000 0.048 0.224
#> GSM711974     1  0.5179     0.5383 0.516 0.000 0.000 0.000 0.092 0.392
#> GSM711978     4  0.1421     0.7025 0.028 0.000 0.000 0.944 0.028 0.000
#> GSM711988     1  0.4293     0.7006 0.728 0.000 0.000 0.036 0.024 0.212
#> GSM711990     3  0.2680     0.8348 0.048 0.000 0.880 0.012 0.060 0.000
#> GSM711992     4  0.1421     0.7025 0.028 0.000 0.000 0.944 0.028 0.000
#> GSM711982     6  0.0291     0.6835 0.004 0.000 0.000 0.000 0.004 0.992
#> GSM711984     2  0.2668     0.7151 0.004 0.828 0.000 0.000 0.168 0.000
#> GSM711912     6  0.4204     0.6136 0.132 0.000 0.000 0.000 0.128 0.740
#> GSM711918     6  0.4204     0.6136 0.132 0.000 0.000 0.000 0.128 0.740
#> GSM711920     1  0.4980     0.6413 0.608 0.000 0.000 0.000 0.100 0.292
#> GSM711937     2  0.3769     0.4750 0.000 0.640 0.000 0.004 0.356 0.000
#> GSM711939     2  0.3333     0.6967 0.024 0.784 0.000 0.000 0.192 0.000
#> GSM711951     4  0.3841    -0.0786 0.000 0.004 0.000 0.616 0.380 0.000
#> GSM711957     1  0.5249     0.6201 0.680 0.000 0.000 0.040 0.152 0.128
#> GSM711959     2  0.3023     0.6784 0.004 0.784 0.000 0.000 0.212 0.000
#> GSM711961     2  0.0858     0.7749 0.028 0.968 0.000 0.000 0.004 0.000
#> GSM711965     4  0.7055     0.1273 0.104 0.000 0.196 0.444 0.256 0.000
#> GSM711967     6  0.5209    -0.2347 0.360 0.000 0.000 0.004 0.088 0.548
#> GSM711969     2  0.3905     0.4701 0.004 0.636 0.000 0.004 0.356 0.000
#> GSM711973     4  0.6708     0.3229 0.188 0.000 0.052 0.472 0.284 0.004
#> GSM711977     3  0.5591     0.7033 0.108 0.000 0.596 0.028 0.268 0.000
#> GSM711981     4  0.1075     0.6925 0.000 0.000 0.000 0.952 0.048 0.000
#> GSM711987     2  0.0000     0.7807 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0858     0.7749 0.028 0.968 0.000 0.000 0.004 0.000
#> GSM711907     5  0.6100     0.8024 0.000 0.304 0.000 0.312 0.384 0.000
#> GSM711909     3  0.0146     0.8346 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM711911     3  0.2546     0.8354 0.040 0.000 0.888 0.012 0.060 0.000
#> GSM711915     3  0.5187     0.7225 0.092 0.000 0.628 0.016 0.264 0.000
#> GSM711917     2  0.3905     0.4701 0.004 0.636 0.000 0.004 0.356 0.000
#> GSM711923     4  0.1418     0.7058 0.032 0.000 0.000 0.944 0.024 0.000
#> GSM711925     2  0.0000     0.7807 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.0260     0.8348 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM711929     2  0.0858     0.7749 0.028 0.968 0.000 0.000 0.004 0.000
#> GSM711931     4  0.5555    -0.6572 0.000 0.140 0.000 0.480 0.380 0.000
#> GSM711933     1  0.4948     0.6746 0.648 0.000 0.000 0.008 0.092 0.252
#> GSM711935     2  0.0000     0.7807 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     4  0.1492     0.7005 0.036 0.000 0.000 0.940 0.024 0.000
#> GSM711943     4  0.0909     0.7080 0.020 0.000 0.000 0.968 0.012 0.000
#> GSM711945     4  0.1984     0.6811 0.032 0.000 0.000 0.912 0.056 0.000
#> GSM711947     3  0.4841     0.6996 0.032 0.032 0.752 0.068 0.116 0.000
#> GSM711949     2  0.0000     0.7807 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0858     0.7749 0.028 0.968 0.000 0.000 0.004 0.000
#> GSM711955     1  0.5021     0.5089 0.688 0.000 0.004 0.212 0.048 0.048
#> GSM711963     2  0.0000     0.7807 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.2614     0.8353 0.044 0.000 0.884 0.012 0.060 0.000
#> GSM711975     5  0.6026     0.8108 0.000 0.244 0.000 0.376 0.380 0.000
#> GSM711979     4  0.0713     0.7075 0.028 0.000 0.000 0.972 0.000 0.000
#> GSM711989     2  0.4343     0.3314 0.000 0.592 0.000 0.028 0.380 0.000
#> GSM711991     3  0.4614     0.6600 0.028 0.000 0.720 0.188 0.064 0.000
#> GSM711993     4  0.2377     0.6059 0.004 0.004 0.000 0.868 0.124 0.000
#> GSM711983     3  0.2680     0.8348 0.048 0.000 0.880 0.012 0.060 0.000
#> GSM711985     2  0.2362     0.7350 0.004 0.860 0.000 0.000 0.136 0.000
#> GSM711913     3  0.5591     0.7033 0.108 0.000 0.596 0.028 0.268 0.000
#> GSM711919     3  0.0363     0.8346 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM711921     3  0.0291     0.8343 0.004 0.000 0.992 0.000 0.004 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 tissue(p) disease.state(p) individual(p) k
#> CV:kmeans 89  3.70e-05            0.223         0.501 2
#> CV:kmeans 90  1.20e-10            0.312         0.574 3
#> CV:kmeans 87  4.74e-09            0.109         0.315 4
#> CV:kmeans 74  7.56e-07            0.124         0.143 5
#> CV:kmeans 70  9.17e-07            0.177         0.193 6

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


CV:skmeans**

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 27425 rows and 90 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 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-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 1.000           0.949       0.980         0.4846 0.515   0.515
#> 3 3 0.945           0.948       0.978         0.3524 0.768   0.574
#> 4 4 0.961           0.915       0.966         0.0906 0.930   0.800
#> 5 5 0.788           0.767       0.826         0.0944 0.898   0.660
#> 6 6 0.766           0.576       0.762         0.0426 0.982   0.913

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

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

There is also optional best \(k\) = 2 3 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
#> GSM711936     2   0.000      0.972 0.000 1.000
#> GSM711938     2   0.000      0.972 0.000 1.000
#> GSM711950     1   0.000      0.984 1.000 0.000
#> GSM711956     1   0.000      0.984 1.000 0.000
#> GSM711958     1   0.000      0.984 1.000 0.000
#> GSM711960     1   0.000      0.984 1.000 0.000
#> GSM711964     1   0.000      0.984 1.000 0.000
#> GSM711966     1   0.000      0.984 1.000 0.000
#> GSM711968     1   0.000      0.984 1.000 0.000
#> GSM711972     1   0.000      0.984 1.000 0.000
#> GSM711976     1   0.000      0.984 1.000 0.000
#> GSM711980     1   0.000      0.984 1.000 0.000
#> GSM711986     1   0.000      0.984 1.000 0.000
#> GSM711904     1   0.000      0.984 1.000 0.000
#> GSM711906     1   0.000      0.984 1.000 0.000
#> GSM711908     1   0.000      0.984 1.000 0.000
#> GSM711910     1   0.000      0.984 1.000 0.000
#> GSM711914     1   0.000      0.984 1.000 0.000
#> GSM711916     1   0.000      0.984 1.000 0.000
#> GSM711922     1   0.000      0.984 1.000 0.000
#> GSM711924     1   0.000      0.984 1.000 0.000
#> GSM711926     2   0.000      0.972 0.000 1.000
#> GSM711928     1   0.000      0.984 1.000 0.000
#> GSM711930     1   0.000      0.984 1.000 0.000
#> GSM711932     1   0.000      0.984 1.000 0.000
#> GSM711934     1   0.000      0.984 1.000 0.000
#> GSM711940     1   0.000      0.984 1.000 0.000
#> GSM711942     1   0.000      0.984 1.000 0.000
#> GSM711944     1   0.000      0.984 1.000 0.000
#> GSM711946     2   0.991      0.197 0.444 0.556
#> GSM711948     1   0.000      0.984 1.000 0.000
#> GSM711952     1   0.000      0.984 1.000 0.000
#> GSM711954     1   0.000      0.984 1.000 0.000
#> GSM711962     1   0.000      0.984 1.000 0.000
#> GSM711970     1   0.000      0.984 1.000 0.000
#> GSM711974     1   0.000      0.984 1.000 0.000
#> GSM711978     2   0.000      0.972 0.000 1.000
#> GSM711988     1   0.000      0.984 1.000 0.000
#> GSM711990     1   0.000      0.984 1.000 0.000
#> GSM711992     2   0.000      0.972 0.000 1.000
#> GSM711982     1   0.000      0.984 1.000 0.000
#> GSM711984     2   0.000      0.972 0.000 1.000
#> GSM711912     1   0.000      0.984 1.000 0.000
#> GSM711918     1   0.000      0.984 1.000 0.000
#> GSM711920     1   0.000      0.984 1.000 0.000
#> GSM711937     2   0.000      0.972 0.000 1.000
#> GSM711939     2   0.000      0.972 0.000 1.000
#> GSM711951     2   0.000      0.972 0.000 1.000
#> GSM711957     1   0.000      0.984 1.000 0.000
#> GSM711959     2   0.000      0.972 0.000 1.000
#> GSM711961     2   0.000      0.972 0.000 1.000
#> GSM711965     1   0.000      0.984 1.000 0.000
#> GSM711967     1   0.000      0.984 1.000 0.000
#> GSM711969     2   0.000      0.972 0.000 1.000
#> GSM711973     1   0.000      0.984 1.000 0.000
#> GSM711977     2   0.814      0.671 0.252 0.748
#> GSM711981     2   0.000      0.972 0.000 1.000
#> GSM711987     2   0.000      0.972 0.000 1.000
#> GSM711905     2   0.000      0.972 0.000 1.000
#> GSM711907     2   0.000      0.972 0.000 1.000
#> GSM711909     1   0.000      0.984 1.000 0.000
#> GSM711911     1   0.000      0.984 1.000 0.000
#> GSM711915     2   0.311      0.924 0.056 0.944
#> GSM711917     2   0.000      0.972 0.000 1.000
#> GSM711923     1   0.971      0.317 0.600 0.400
#> GSM711925     2   0.000      0.972 0.000 1.000
#> GSM711927     1   0.000      0.984 1.000 0.000
#> GSM711929     2   0.000      0.972 0.000 1.000
#> GSM711931     2   0.000      0.972 0.000 1.000
#> GSM711933     1   0.000      0.984 1.000 0.000
#> GSM711935     2   0.000      0.972 0.000 1.000
#> GSM711941     1   0.204      0.952 0.968 0.032
#> GSM711943     2   0.605      0.819 0.148 0.852
#> GSM711945     2   0.000      0.972 0.000 1.000
#> GSM711947     2   0.000      0.972 0.000 1.000
#> GSM711949     2   0.000      0.972 0.000 1.000
#> GSM711953     2   0.000      0.972 0.000 1.000
#> GSM711955     1   0.000      0.984 1.000 0.000
#> GSM711963     2   0.000      0.972 0.000 1.000
#> GSM711971     1   0.000      0.984 1.000 0.000
#> GSM711975     2   0.000      0.972 0.000 1.000
#> GSM711979     1   0.971      0.317 0.600 0.400
#> GSM711989     2   0.000      0.972 0.000 1.000
#> GSM711991     2   0.000      0.972 0.000 1.000
#> GSM711993     2   0.000      0.972 0.000 1.000
#> GSM711983     1   0.000      0.984 1.000 0.000
#> GSM711985     2   0.000      0.972 0.000 1.000
#> GSM711913     2   0.327      0.920 0.060 0.940
#> GSM711919     1   0.000      0.984 1.000 0.000
#> GSM711921     1   0.000      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
#> GSM711936     2   0.000      0.993 0.000 1.000 0.000
#> GSM711938     2   0.000      0.993 0.000 1.000 0.000
#> GSM711950     1   0.000      0.982 1.000 0.000 0.000
#> GSM711956     1   0.000      0.982 1.000 0.000 0.000
#> GSM711958     1   0.000      0.982 1.000 0.000 0.000
#> GSM711960     1   0.465      0.716 0.792 0.000 0.208
#> GSM711964     1   0.000      0.982 1.000 0.000 0.000
#> GSM711966     1   0.000      0.982 1.000 0.000 0.000
#> GSM711968     1   0.000      0.982 1.000 0.000 0.000
#> GSM711972     1   0.000      0.982 1.000 0.000 0.000
#> GSM711976     1   0.000      0.982 1.000 0.000 0.000
#> GSM711980     1   0.000      0.982 1.000 0.000 0.000
#> GSM711986     1   0.000      0.982 1.000 0.000 0.000
#> GSM711904     1   0.000      0.982 1.000 0.000 0.000
#> GSM711906     1   0.000      0.982 1.000 0.000 0.000
#> GSM711908     1   0.000      0.982 1.000 0.000 0.000
#> GSM711910     3   0.000      0.942 0.000 0.000 1.000
#> GSM711914     1   0.000      0.982 1.000 0.000 0.000
#> GSM711916     1   0.000      0.982 1.000 0.000 0.000
#> GSM711922     1   0.000      0.982 1.000 0.000 0.000
#> GSM711924     1   0.000      0.982 1.000 0.000 0.000
#> GSM711926     2   0.000      0.993 0.000 1.000 0.000
#> GSM711928     1   0.000      0.982 1.000 0.000 0.000
#> GSM711930     1   0.000      0.982 1.000 0.000 0.000
#> GSM711932     1   0.000      0.982 1.000 0.000 0.000
#> GSM711934     1   0.000      0.982 1.000 0.000 0.000
#> GSM711940     1   0.000      0.982 1.000 0.000 0.000
#> GSM711942     1   0.000      0.982 1.000 0.000 0.000
#> GSM711944     3   0.000      0.942 0.000 0.000 1.000
#> GSM711946     3   0.000      0.942 0.000 0.000 1.000
#> GSM711948     1   0.000      0.982 1.000 0.000 0.000
#> GSM711952     1   0.000      0.982 1.000 0.000 0.000
#> GSM711954     1   0.000      0.982 1.000 0.000 0.000
#> GSM711962     1   0.000      0.982 1.000 0.000 0.000
#> GSM711970     1   0.000      0.982 1.000 0.000 0.000
#> GSM711974     1   0.000      0.982 1.000 0.000 0.000
#> GSM711978     2   0.000      0.993 0.000 1.000 0.000
#> GSM711988     1   0.000      0.982 1.000 0.000 0.000
#> GSM711990     3   0.000      0.942 0.000 0.000 1.000
#> GSM711992     2   0.394      0.794 0.156 0.844 0.000
#> GSM711982     1   0.000      0.982 1.000 0.000 0.000
#> GSM711984     2   0.000      0.993 0.000 1.000 0.000
#> GSM711912     1   0.000      0.982 1.000 0.000 0.000
#> GSM711918     1   0.000      0.982 1.000 0.000 0.000
#> GSM711920     1   0.000      0.982 1.000 0.000 0.000
#> GSM711937     2   0.000      0.993 0.000 1.000 0.000
#> GSM711939     2   0.000      0.993 0.000 1.000 0.000
#> GSM711951     2   0.000      0.993 0.000 1.000 0.000
#> GSM711957     1   0.000      0.982 1.000 0.000 0.000
#> GSM711959     2   0.000      0.993 0.000 1.000 0.000
#> GSM711961     2   0.000      0.993 0.000 1.000 0.000
#> GSM711965     3   0.000      0.942 0.000 0.000 1.000
#> GSM711967     1   0.000      0.982 1.000 0.000 0.000
#> GSM711969     2   0.000      0.993 0.000 1.000 0.000
#> GSM711973     3   0.000      0.942 0.000 0.000 1.000
#> GSM711977     3   0.000      0.942 0.000 0.000 1.000
#> GSM711981     2   0.000      0.993 0.000 1.000 0.000
#> GSM711987     2   0.000      0.993 0.000 1.000 0.000
#> GSM711905     2   0.000      0.993 0.000 1.000 0.000
#> GSM711907     2   0.000      0.993 0.000 1.000 0.000
#> GSM711909     3   0.000      0.942 0.000 0.000 1.000
#> GSM711911     3   0.000      0.942 0.000 0.000 1.000
#> GSM711915     3   0.000      0.942 0.000 0.000 1.000
#> GSM711917     2   0.000      0.993 0.000 1.000 0.000
#> GSM711923     3   0.435      0.791 0.000 0.184 0.816
#> GSM711925     2   0.000      0.993 0.000 1.000 0.000
#> GSM711927     3   0.000      0.942 0.000 0.000 1.000
#> GSM711929     2   0.000      0.993 0.000 1.000 0.000
#> GSM711931     2   0.000      0.993 0.000 1.000 0.000
#> GSM711933     1   0.000      0.982 1.000 0.000 0.000
#> GSM711935     2   0.000      0.993 0.000 1.000 0.000
#> GSM711941     3   0.000      0.942 0.000 0.000 1.000
#> GSM711943     3   0.455      0.773 0.000 0.200 0.800
#> GSM711945     3   0.455      0.773 0.000 0.200 0.800
#> GSM711947     3   0.460      0.768 0.000 0.204 0.796
#> GSM711949     2   0.000      0.993 0.000 1.000 0.000
#> GSM711953     2   0.000      0.993 0.000 1.000 0.000
#> GSM711955     3   0.610      0.365 0.392 0.000 0.608
#> GSM711963     2   0.000      0.993 0.000 1.000 0.000
#> GSM711971     3   0.000      0.942 0.000 0.000 1.000
#> GSM711975     2   0.000      0.993 0.000 1.000 0.000
#> GSM711979     1   0.800      0.306 0.568 0.360 0.072
#> GSM711989     2   0.000      0.993 0.000 1.000 0.000
#> GSM711991     3   0.153      0.916 0.000 0.040 0.960
#> GSM711993     2   0.000      0.993 0.000 1.000 0.000
#> GSM711983     3   0.000      0.942 0.000 0.000 1.000
#> GSM711985     2   0.000      0.993 0.000 1.000 0.000
#> GSM711913     3   0.000      0.942 0.000 0.000 1.000
#> GSM711919     3   0.000      0.942 0.000 0.000 1.000
#> GSM711921     3   0.000      0.942 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711950     4  0.3907      0.646 0.232 0.000 0.000 0.768
#> GSM711956     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711958     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711960     1  0.4382      0.557 0.704 0.000 0.296 0.000
#> GSM711964     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711976     1  0.0188      0.973 0.996 0.000 0.000 0.004
#> GSM711980     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711906     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711910     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711924     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711926     4  0.2281      0.854 0.000 0.096 0.000 0.904
#> GSM711928     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711932     1  0.0469      0.966 0.988 0.000 0.000 0.012
#> GSM711934     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711940     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711942     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711944     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711946     3  0.4967      0.293 0.000 0.000 0.548 0.452
#> GSM711948     1  0.4985      0.104 0.532 0.000 0.000 0.468
#> GSM711952     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711954     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711962     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711970     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711974     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0000      0.945 0.000 0.000 0.000 1.000
#> GSM711988     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711990     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711992     4  0.0336      0.942 0.000 0.008 0.000 0.992
#> GSM711982     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711951     2  0.2973      0.824 0.000 0.856 0.000 0.144
#> GSM711957     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711959     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711965     3  0.0336      0.890 0.000 0.000 0.992 0.008
#> GSM711967     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711969     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711973     3  0.2216      0.828 0.000 0.000 0.908 0.092
#> GSM711977     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711981     4  0.0000      0.945 0.000 0.000 0.000 1.000
#> GSM711987     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711907     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711909     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0000      0.945 0.000 0.000 0.000 1.000
#> GSM711925     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711931     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711933     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM711935     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0000      0.945 0.000 0.000 0.000 1.000
#> GSM711943     4  0.0188      0.943 0.000 0.000 0.004 0.996
#> GSM711945     3  0.4972      0.283 0.000 0.000 0.544 0.456
#> GSM711947     3  0.4331      0.588 0.000 0.288 0.712 0.000
#> GSM711949     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711955     3  0.4973      0.432 0.348 0.000 0.644 0.008
#> GSM711963     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711975     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711979     4  0.0000      0.945 0.000 0.000 0.000 1.000
#> GSM711989     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711991     3  0.2988      0.807 0.000 0.012 0.876 0.112
#> GSM711993     4  0.0336      0.942 0.000 0.008 0.000 0.992
#> GSM711983     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711985     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711919     3  0.0000      0.895 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000      0.895 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711938     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711950     1  0.5426      0.430 0.640 0.000 0.000 0.108 0.252
#> GSM711956     1  0.1732      0.685 0.920 0.000 0.000 0.000 0.080
#> GSM711958     1  0.3876      0.177 0.684 0.000 0.000 0.000 0.316
#> GSM711960     1  0.6661      0.162 0.440 0.000 0.256 0.000 0.304
#> GSM711964     1  0.3143      0.548 0.796 0.000 0.000 0.000 0.204
#> GSM711966     5  0.3730      0.845 0.288 0.000 0.000 0.000 0.712
#> GSM711968     1  0.2471      0.643 0.864 0.000 0.000 0.000 0.136
#> GSM711972     5  0.3730      0.845 0.288 0.000 0.000 0.000 0.712
#> GSM711976     1  0.2424      0.669 0.868 0.000 0.000 0.000 0.132
#> GSM711980     1  0.1341      0.693 0.944 0.000 0.000 0.000 0.056
#> GSM711986     5  0.4283      0.665 0.456 0.000 0.000 0.000 0.544
#> GSM711904     1  0.2648      0.617 0.848 0.000 0.000 0.000 0.152
#> GSM711906     5  0.3707      0.843 0.284 0.000 0.000 0.000 0.716
#> GSM711908     5  0.3857      0.838 0.312 0.000 0.000 0.000 0.688
#> GSM711910     3  0.0000      0.852 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.3039      0.566 0.808 0.000 0.000 0.000 0.192
#> GSM711916     5  0.3816      0.841 0.304 0.000 0.000 0.000 0.696
#> GSM711922     1  0.1544      0.691 0.932 0.000 0.000 0.000 0.068
#> GSM711924     5  0.4307      0.556 0.496 0.000 0.000 0.000 0.504
#> GSM711926     4  0.1124      0.910 0.000 0.036 0.000 0.960 0.004
#> GSM711928     1  0.2471      0.635 0.864 0.000 0.000 0.000 0.136
#> GSM711930     5  0.3796      0.842 0.300 0.000 0.000 0.000 0.700
#> GSM711932     1  0.1608      0.680 0.928 0.000 0.000 0.000 0.072
#> GSM711934     1  0.1121      0.688 0.956 0.000 0.000 0.000 0.044
#> GSM711940     5  0.4321      0.722 0.396 0.000 0.000 0.004 0.600
#> GSM711942     5  0.4300      0.614 0.476 0.000 0.000 0.000 0.524
#> GSM711944     3  0.2390      0.784 0.084 0.000 0.896 0.000 0.020
#> GSM711946     3  0.6628      0.130 0.000 0.000 0.408 0.372 0.220
#> GSM711948     1  0.4479      0.488 0.700 0.000 0.000 0.036 0.264
#> GSM711952     5  0.4256      0.704 0.436 0.000 0.000 0.000 0.564
#> GSM711954     1  0.2179      0.662 0.888 0.000 0.000 0.000 0.112
#> GSM711962     5  0.4015      0.790 0.348 0.000 0.000 0.000 0.652
#> GSM711970     1  0.1410      0.688 0.940 0.000 0.000 0.000 0.060
#> GSM711974     1  0.4030      0.060 0.648 0.000 0.000 0.000 0.352
#> GSM711978     4  0.0162      0.935 0.000 0.000 0.000 0.996 0.004
#> GSM711988     1  0.1410      0.680 0.940 0.000 0.000 0.000 0.060
#> GSM711990     3  0.0000      0.852 0.000 0.000 1.000 0.000 0.000
#> GSM711992     4  0.0566      0.929 0.012 0.000 0.000 0.984 0.004
#> GSM711982     5  0.3730      0.845 0.288 0.000 0.000 0.000 0.712
#> GSM711984     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711912     5  0.4182      0.762 0.400 0.000 0.000 0.000 0.600
#> GSM711918     5  0.4219      0.740 0.416 0.000 0.000 0.000 0.584
#> GSM711920     1  0.3774      0.215 0.704 0.000 0.000 0.000 0.296
#> GSM711937     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711939     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711951     2  0.2377      0.843 0.000 0.872 0.000 0.128 0.000
#> GSM711957     1  0.1568      0.684 0.944 0.000 0.000 0.020 0.036
#> GSM711959     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711965     3  0.3521      0.749 0.000 0.000 0.764 0.004 0.232
#> GSM711967     5  0.3999      0.805 0.344 0.000 0.000 0.000 0.656
#> GSM711969     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711973     3  0.4090      0.714 0.000 0.000 0.716 0.016 0.268
#> GSM711977     3  0.3177      0.767 0.000 0.000 0.792 0.000 0.208
#> GSM711981     4  0.2891      0.857 0.000 0.000 0.000 0.824 0.176
#> GSM711987     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711907     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711909     3  0.0000      0.852 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.0000      0.852 0.000 0.000 1.000 0.000 0.000
#> GSM711915     3  0.0880      0.845 0.000 0.000 0.968 0.000 0.032
#> GSM711917     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711923     4  0.2074      0.900 0.000 0.000 0.000 0.896 0.104
#> GSM711925     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0000      0.852 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711931     2  0.3366      0.712 0.000 0.768 0.000 0.232 0.000
#> GSM711933     1  0.2280      0.632 0.880 0.000 0.000 0.000 0.120
#> GSM711935     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.3210      0.829 0.000 0.000 0.000 0.788 0.212
#> GSM711943     4  0.0290      0.935 0.000 0.000 0.000 0.992 0.008
#> GSM711945     3  0.6655      0.128 0.000 0.000 0.404 0.368 0.228
#> GSM711947     3  0.3612      0.580 0.000 0.268 0.732 0.000 0.000
#> GSM711949     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711955     1  0.5578      0.443 0.644 0.000 0.176 0.000 0.180
#> GSM711963     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0000      0.852 0.000 0.000 1.000 0.000 0.000
#> GSM711975     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711979     4  0.0000      0.936 0.000 0.000 0.000 1.000 0.000
#> GSM711989     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711991     3  0.2623      0.791 0.000 0.016 0.884 0.096 0.004
#> GSM711993     4  0.0000      0.936 0.000 0.000 0.000 1.000 0.000
#> GSM711983     3  0.0000      0.852 0.000 0.000 1.000 0.000 0.000
#> GSM711985     2  0.0000      0.983 0.000 1.000 0.000 0.000 0.000
#> GSM711913     3  0.3177      0.767 0.000 0.000 0.792 0.000 0.208
#> GSM711919     3  0.0000      0.852 0.000 0.000 1.000 0.000 0.000
#> GSM711921     3  0.0000      0.852 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711938     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711950     1  0.6331    0.35300 0.516 0.000 0.208 0.028 0.244 0.004
#> GSM711956     1  0.3420    0.60593 0.748 0.000 0.000 0.000 0.012 0.240
#> GSM711958     1  0.5368    0.05888 0.508 0.000 0.000 0.000 0.116 0.376
#> GSM711960     5  0.6122    0.09383 0.288 0.000 0.012 0.000 0.480 0.220
#> GSM711964     1  0.3890    0.43814 0.596 0.000 0.000 0.000 0.004 0.400
#> GSM711966     6  0.0146    0.71788 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM711968     1  0.3534    0.58124 0.716 0.000 0.000 0.000 0.008 0.276
#> GSM711972     6  0.0146    0.71788 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM711976     1  0.5059    0.57575 0.652 0.000 0.000 0.004 0.168 0.176
#> GSM711980     1  0.2668    0.63117 0.828 0.000 0.000 0.000 0.004 0.168
#> GSM711986     6  0.3634    0.40096 0.296 0.000 0.000 0.000 0.008 0.696
#> GSM711904     1  0.4052    0.48589 0.628 0.000 0.000 0.000 0.016 0.356
#> GSM711906     6  0.1285    0.69932 0.052 0.000 0.000 0.000 0.004 0.944
#> GSM711908     6  0.1398    0.68947 0.052 0.000 0.000 0.000 0.008 0.940
#> GSM711910     3  0.3862    0.24866 0.000 0.000 0.524 0.000 0.476 0.000
#> GSM711914     1  0.4066    0.44817 0.596 0.000 0.000 0.000 0.012 0.392
#> GSM711916     6  0.0363    0.71509 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711922     1  0.3133    0.61995 0.780 0.000 0.000 0.000 0.008 0.212
#> GSM711924     6  0.5353    0.20849 0.388 0.000 0.000 0.000 0.112 0.500
#> GSM711926     4  0.0858    0.83573 0.000 0.028 0.000 0.968 0.004 0.000
#> GSM711928     1  0.3905    0.54083 0.668 0.000 0.000 0.000 0.016 0.316
#> GSM711930     6  0.0363    0.71509 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711932     1  0.3834    0.58764 0.780 0.000 0.000 0.004 0.140 0.076
#> GSM711934     1  0.3108    0.61913 0.828 0.000 0.000 0.000 0.044 0.128
#> GSM711940     6  0.4061    0.52307 0.248 0.000 0.000 0.000 0.044 0.708
#> GSM711942     6  0.5250    0.29385 0.352 0.000 0.000 0.000 0.108 0.540
#> GSM711944     5  0.4932    0.01364 0.072 0.000 0.372 0.000 0.556 0.000
#> GSM711946     3  0.5896   -0.02129 0.024 0.000 0.564 0.168 0.244 0.000
#> GSM711948     1  0.5406    0.48583 0.624 0.000 0.104 0.012 0.252 0.008
#> GSM711952     6  0.3608    0.44919 0.272 0.000 0.000 0.000 0.012 0.716
#> GSM711954     1  0.3841    0.58826 0.716 0.000 0.000 0.000 0.028 0.256
#> GSM711962     6  0.3171    0.59753 0.204 0.000 0.000 0.000 0.012 0.784
#> GSM711970     1  0.3190    0.60579 0.820 0.000 0.000 0.000 0.044 0.136
#> GSM711974     1  0.5153    0.09962 0.464 0.000 0.000 0.000 0.084 0.452
#> GSM711978     4  0.0260    0.85213 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM711988     1  0.4338    0.60048 0.732 0.000 0.000 0.004 0.164 0.100
#> GSM711990     3  0.3860    0.24970 0.000 0.000 0.528 0.000 0.472 0.000
#> GSM711992     4  0.0405    0.84912 0.004 0.000 0.000 0.988 0.008 0.000
#> GSM711982     6  0.0146    0.71788 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM711984     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711912     6  0.3468    0.47111 0.264 0.000 0.000 0.000 0.008 0.728
#> GSM711918     6  0.3468    0.47015 0.264 0.000 0.000 0.000 0.008 0.728
#> GSM711920     1  0.5164    0.23512 0.584 0.000 0.000 0.000 0.116 0.300
#> GSM711937     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711939     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711951     2  0.2454    0.80588 0.000 0.840 0.000 0.160 0.000 0.000
#> GSM711957     1  0.3966    0.56732 0.792 0.000 0.000 0.028 0.116 0.064
#> GSM711959     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711961     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711965     3  0.2260    0.25110 0.000 0.000 0.860 0.000 0.140 0.000
#> GSM711967     6  0.3253    0.60585 0.192 0.000 0.000 0.000 0.020 0.788
#> GSM711969     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711973     3  0.2912    0.20037 0.000 0.000 0.784 0.000 0.216 0.000
#> GSM711977     3  0.0000    0.28576 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711981     4  0.4416    0.72516 0.000 0.004 0.212 0.708 0.076 0.000
#> GSM711987     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711909     3  0.3862    0.24866 0.000 0.000 0.524 0.000 0.476 0.000
#> GSM711911     3  0.3860    0.24970 0.000 0.000 0.528 0.000 0.472 0.000
#> GSM711915     3  0.2697    0.23041 0.000 0.000 0.812 0.000 0.188 0.000
#> GSM711917     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711923     4  0.4915    0.75953 0.024 0.000 0.092 0.692 0.192 0.000
#> GSM711925     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.3862    0.24866 0.000 0.000 0.524 0.000 0.476 0.000
#> GSM711929     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     2  0.3659    0.45348 0.000 0.636 0.000 0.364 0.000 0.000
#> GSM711933     1  0.4449    0.46393 0.712 0.000 0.000 0.000 0.124 0.164
#> GSM711935     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     4  0.6263    0.58349 0.028 0.000 0.176 0.480 0.316 0.000
#> GSM711943     4  0.3239    0.81530 0.024 0.000 0.004 0.808 0.164 0.000
#> GSM711945     3  0.5142   -0.00528 0.000 0.000 0.620 0.156 0.224 0.000
#> GSM711947     5  0.6013    0.07587 0.004 0.228 0.304 0.000 0.464 0.000
#> GSM711949     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     1  0.5242    0.34045 0.516 0.000 0.100 0.000 0.384 0.000
#> GSM711963     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.3860    0.24970 0.000 0.000 0.528 0.000 0.472 0.000
#> GSM711975     2  0.0547    0.95850 0.000 0.980 0.000 0.020 0.000 0.000
#> GSM711979     4  0.1049    0.85196 0.008 0.000 0.000 0.960 0.032 0.000
#> GSM711989     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711991     5  0.4818   -0.14983 0.004 0.004 0.388 0.040 0.564 0.000
#> GSM711993     4  0.0405    0.85230 0.000 0.004 0.000 0.988 0.008 0.000
#> GSM711983     3  0.3860    0.24970 0.000 0.000 0.528 0.000 0.472 0.000
#> GSM711985     2  0.0000    0.97486 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711913     3  0.0260    0.28571 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM711919     3  0.3862    0.24866 0.000 0.000 0.524 0.000 0.476 0.000
#> GSM711921     3  0.3862    0.24866 0.000 0.000 0.524 0.000 0.476 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-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 tissue(p) disease.state(p) individual(p) k
#> CV:skmeans 87  9.67e-07            0.475         0.831 2
#> CV:skmeans 88  1.71e-10            0.166         0.653 3
#> CV:skmeans 86  8.89e-10            0.258         0.304 4
#> CV:skmeans 81  1.85e-08            0.170         0.177 5
#> CV:skmeans 53  4.95e-06            0.398         0.184 6

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


CV:pam**

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

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

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

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

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

collect_plots(res)

plot of chunk 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.931           0.924       0.970         0.4329 0.585   0.585
#> 3 3 0.749           0.851       0.912         0.4943 0.690   0.497
#> 4 4 0.975           0.957       0.981         0.1463 0.911   0.742
#> 5 5 0.858           0.894       0.926         0.0754 0.886   0.600
#> 6 6 0.968           0.911       0.958         0.0213 0.982   0.911

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

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

There is also optional best \(k\) = 2 4 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
#> GSM711936     2  0.0000      0.987 0.000 1.000
#> GSM711938     2  0.0000      0.987 0.000 1.000
#> GSM711950     1  0.0000      0.960 1.000 0.000
#> GSM711956     1  0.0000      0.960 1.000 0.000
#> GSM711958     1  0.0000      0.960 1.000 0.000
#> GSM711960     1  0.0000      0.960 1.000 0.000
#> GSM711964     1  0.0000      0.960 1.000 0.000
#> GSM711966     1  0.0000      0.960 1.000 0.000
#> GSM711968     1  0.0000      0.960 1.000 0.000
#> GSM711972     1  0.0000      0.960 1.000 0.000
#> GSM711976     1  0.0000      0.960 1.000 0.000
#> GSM711980     1  0.0000      0.960 1.000 0.000
#> GSM711986     1  0.0000      0.960 1.000 0.000
#> GSM711904     1  0.0000      0.960 1.000 0.000
#> GSM711906     1  0.0000      0.960 1.000 0.000
#> GSM711908     1  0.0000      0.960 1.000 0.000
#> GSM711910     1  0.0000      0.960 1.000 0.000
#> GSM711914     1  0.0000      0.960 1.000 0.000
#> GSM711916     1  0.0000      0.960 1.000 0.000
#> GSM711922     1  0.0000      0.960 1.000 0.000
#> GSM711924     1  0.0000      0.960 1.000 0.000
#> GSM711926     2  0.8813      0.539 0.300 0.700
#> GSM711928     1  0.0000      0.960 1.000 0.000
#> GSM711930     1  0.0000      0.960 1.000 0.000
#> GSM711932     1  0.0000      0.960 1.000 0.000
#> GSM711934     1  0.0000      0.960 1.000 0.000
#> GSM711940     1  0.0000      0.960 1.000 0.000
#> GSM711942     1  0.0000      0.960 1.000 0.000
#> GSM711944     1  0.0000      0.960 1.000 0.000
#> GSM711946     1  0.0000      0.960 1.000 0.000
#> GSM711948     1  0.0000      0.960 1.000 0.000
#> GSM711952     1  0.0000      0.960 1.000 0.000
#> GSM711954     1  0.0000      0.960 1.000 0.000
#> GSM711962     1  0.0000      0.960 1.000 0.000
#> GSM711970     1  0.0000      0.960 1.000 0.000
#> GSM711974     1  0.0000      0.960 1.000 0.000
#> GSM711978     1  0.8555      0.623 0.720 0.280
#> GSM711988     1  0.0000      0.960 1.000 0.000
#> GSM711990     1  0.0000      0.960 1.000 0.000
#> GSM711992     1  0.7950      0.688 0.760 0.240
#> GSM711982     1  0.0000      0.960 1.000 0.000
#> GSM711984     2  0.0000      0.987 0.000 1.000
#> GSM711912     1  0.0000      0.960 1.000 0.000
#> GSM711918     1  0.0000      0.960 1.000 0.000
#> GSM711920     1  0.0000      0.960 1.000 0.000
#> GSM711937     2  0.0000      0.987 0.000 1.000
#> GSM711939     2  0.0000      0.987 0.000 1.000
#> GSM711951     2  0.0000      0.987 0.000 1.000
#> GSM711957     1  0.0000      0.960 1.000 0.000
#> GSM711959     2  0.0000      0.987 0.000 1.000
#> GSM711961     2  0.0000      0.987 0.000 1.000
#> GSM711965     1  0.0000      0.960 1.000 0.000
#> GSM711967     1  0.0000      0.960 1.000 0.000
#> GSM711969     2  0.0000      0.987 0.000 1.000
#> GSM711973     1  0.0000      0.960 1.000 0.000
#> GSM711977     1  0.0000      0.960 1.000 0.000
#> GSM711981     1  0.9909      0.255 0.556 0.444
#> GSM711987     2  0.0000      0.987 0.000 1.000
#> GSM711905     2  0.0000      0.987 0.000 1.000
#> GSM711907     2  0.0000      0.987 0.000 1.000
#> GSM711909     1  0.0000      0.960 1.000 0.000
#> GSM711911     1  0.0000      0.960 1.000 0.000
#> GSM711915     1  0.8713      0.603 0.708 0.292
#> GSM711917     2  0.0000      0.987 0.000 1.000
#> GSM711923     1  0.0000      0.960 1.000 0.000
#> GSM711925     2  0.0000      0.987 0.000 1.000
#> GSM711927     1  0.0000      0.960 1.000 0.000
#> GSM711929     2  0.0000      0.987 0.000 1.000
#> GSM711931     2  0.0000      0.987 0.000 1.000
#> GSM711933     1  0.0000      0.960 1.000 0.000
#> GSM711935     2  0.0000      0.987 0.000 1.000
#> GSM711941     1  0.0000      0.960 1.000 0.000
#> GSM711943     1  0.0376      0.957 0.996 0.004
#> GSM711945     1  0.9977      0.168 0.528 0.472
#> GSM711947     2  0.0000      0.987 0.000 1.000
#> GSM711949     2  0.0000      0.987 0.000 1.000
#> GSM711953     2  0.0000      0.987 0.000 1.000
#> GSM711955     1  0.0000      0.960 1.000 0.000
#> GSM711963     2  0.0000      0.987 0.000 1.000
#> GSM711971     1  0.0000      0.960 1.000 0.000
#> GSM711975     2  0.0000      0.987 0.000 1.000
#> GSM711979     1  0.0000      0.960 1.000 0.000
#> GSM711989     2  0.0000      0.987 0.000 1.000
#> GSM711991     1  0.9988      0.141 0.520 0.480
#> GSM711993     2  0.0000      0.987 0.000 1.000
#> GSM711983     1  0.0000      0.960 1.000 0.000
#> GSM711985     2  0.0000      0.987 0.000 1.000
#> GSM711913     1  0.7453      0.728 0.788 0.212
#> GSM711919     1  0.0000      0.960 1.000 0.000
#> GSM711921     1  0.0000      0.960 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
#> GSM711936     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711938     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711950     3  0.6095      0.607 0.392 0.000 0.608
#> GSM711956     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711958     1  0.5138      0.527 0.748 0.000 0.252
#> GSM711960     1  0.5327      0.586 0.728 0.000 0.272
#> GSM711964     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711966     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711968     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711972     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711976     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711980     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711986     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711904     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711906     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711908     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711910     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711914     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711916     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711922     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711924     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711926     3  0.7741      0.652 0.324 0.068 0.608
#> GSM711928     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711930     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711932     3  0.6095      0.607 0.392 0.000 0.608
#> GSM711934     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711940     3  0.6095      0.607 0.392 0.000 0.608
#> GSM711942     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711944     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711946     3  0.2711      0.784 0.088 0.000 0.912
#> GSM711948     3  0.6192      0.556 0.420 0.000 0.580
#> GSM711952     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711954     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711962     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711970     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711974     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711978     3  0.7683      0.650 0.328 0.064 0.608
#> GSM711988     1  0.4974      0.568 0.764 0.000 0.236
#> GSM711990     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711992     3  0.6451      0.614 0.384 0.008 0.608
#> GSM711982     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711984     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711912     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711918     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711920     1  0.0000      0.967 1.000 0.000 0.000
#> GSM711937     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711939     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711951     3  0.6095      0.437 0.000 0.392 0.608
#> GSM711957     3  0.6095      0.607 0.392 0.000 0.608
#> GSM711959     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711961     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711965     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711967     3  0.6095      0.607 0.392 0.000 0.608
#> GSM711969     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711973     3  0.5497      0.705 0.292 0.000 0.708
#> GSM711977     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711981     3  0.6018      0.692 0.308 0.008 0.684
#> GSM711987     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711905     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711907     2  0.0424      0.991 0.000 0.992 0.008
#> GSM711909     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711911     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711915     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711917     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711923     3  0.4353      0.771 0.156 0.008 0.836
#> GSM711925     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711927     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711929     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711931     2  0.0237      0.995 0.000 0.996 0.004
#> GSM711933     3  0.6140      0.586 0.404 0.000 0.596
#> GSM711935     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711941     3  0.4399      0.759 0.188 0.000 0.812
#> GSM711943     3  0.4353      0.771 0.156 0.008 0.836
#> GSM711945     3  0.2955      0.786 0.080 0.008 0.912
#> GSM711947     3  0.6291      0.256 0.000 0.468 0.532
#> GSM711949     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711955     3  0.5327      0.717 0.272 0.000 0.728
#> GSM711963     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711971     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711975     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711979     3  0.6129      0.678 0.324 0.008 0.668
#> GSM711989     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711991     3  0.0237      0.789 0.000 0.004 0.996
#> GSM711993     3  0.7850      0.562 0.076 0.316 0.608
#> GSM711983     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711985     2  0.0000      0.999 0.000 1.000 0.000
#> GSM711913     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711919     3  0.0000      0.790 0.000 0.000 1.000
#> GSM711921     3  0.0000      0.790 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711950     4  0.0188      0.951 0.004 0.000 0.000 0.996
#> GSM711956     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711958     1  0.4250      0.608 0.724 0.000 0.000 0.276
#> GSM711960     3  0.2760      0.848 0.128 0.000 0.872 0.000
#> GSM711964     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711976     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711980     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711906     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711910     3  0.0000      0.988 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711924     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711926     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711928     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711932     4  0.1302      0.918 0.044 0.000 0.000 0.956
#> GSM711934     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711940     4  0.0188      0.951 0.004 0.000 0.000 0.996
#> GSM711942     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711944     3  0.0376      0.982 0.004 0.000 0.992 0.004
#> GSM711946     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711948     4  0.3837      0.720 0.224 0.000 0.000 0.776
#> GSM711952     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711954     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711962     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711970     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711974     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711988     1  0.4103      0.646 0.744 0.000 0.000 0.256
#> GSM711990     3  0.0000      0.988 0.000 0.000 1.000 0.000
#> GSM711992     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711982     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711951     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711957     4  0.0188      0.951 0.004 0.000 0.000 0.996
#> GSM711959     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711965     4  0.0188      0.950 0.000 0.000 0.004 0.996
#> GSM711967     4  0.0188      0.951 0.004 0.000 0.000 0.996
#> GSM711969     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711973     4  0.4095      0.774 0.024 0.000 0.172 0.804
#> GSM711977     3  0.0000      0.988 0.000 0.000 1.000 0.000
#> GSM711981     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711987     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711907     2  0.0469      0.988 0.000 0.988 0.000 0.012
#> GSM711909     3  0.0000      0.988 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000      0.988 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0000      0.988 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711925     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000      0.988 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711931     2  0.0336      0.992 0.000 0.992 0.000 0.008
#> GSM711933     4  0.3311      0.785 0.172 0.000 0.000 0.828
#> GSM711935     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711943     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711945     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711947     4  0.4564      0.534 0.000 0.328 0.000 0.672
#> GSM711949     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711955     4  0.0376      0.949 0.004 0.000 0.004 0.992
#> GSM711963     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0000      0.988 0.000 0.000 1.000 0.000
#> GSM711975     2  0.0188      0.995 0.000 0.996 0.000 0.004
#> GSM711979     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711989     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711991     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711993     4  0.0000      0.952 0.000 0.000 0.000 1.000
#> GSM711983     3  0.0000      0.988 0.000 0.000 1.000 0.000
#> GSM711985     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0000      0.988 0.000 0.000 1.000 0.000
#> GSM711919     3  0.0000      0.988 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000      0.988 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.0880      0.960 0.000 0.968 0.000 0.032 0.000
#> GSM711938     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711950     4  0.2516      0.859 0.000 0.000 0.000 0.860 0.140
#> GSM711956     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711958     5  0.2516      0.890 0.140 0.000 0.000 0.000 0.860
#> GSM711960     5  0.2516      0.890 0.140 0.000 0.000 0.000 0.860
#> GSM711964     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711966     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711968     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711972     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711976     1  0.1197      0.910 0.952 0.000 0.000 0.048 0.000
#> GSM711980     5  0.2516      0.890 0.140 0.000 0.000 0.000 0.860
#> GSM711986     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711904     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711906     5  0.2516      0.890 0.140 0.000 0.000 0.000 0.860
#> GSM711908     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711910     3  0.0000      0.939 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711916     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711922     5  0.4074      0.623 0.364 0.000 0.000 0.000 0.636
#> GSM711924     5  0.2516      0.890 0.140 0.000 0.000 0.000 0.860
#> GSM711926     4  0.0000      0.897 0.000 0.000 0.000 1.000 0.000
#> GSM711928     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711930     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711932     5  0.2516      0.819 0.000 0.000 0.000 0.140 0.860
#> GSM711934     5  0.4060      0.628 0.360 0.000 0.000 0.000 0.640
#> GSM711940     4  0.2278      0.847 0.060 0.000 0.000 0.908 0.032
#> GSM711942     5  0.2516      0.890 0.140 0.000 0.000 0.000 0.860
#> GSM711944     5  0.0404      0.805 0.000 0.000 0.012 0.000 0.988
#> GSM711946     4  0.2516      0.859 0.000 0.000 0.000 0.860 0.140
#> GSM711948     5  0.3109      0.684 0.200 0.000 0.000 0.000 0.800
#> GSM711952     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711954     5  0.3336      0.822 0.228 0.000 0.000 0.000 0.772
#> GSM711962     5  0.2516      0.890 0.140 0.000 0.000 0.000 0.860
#> GSM711970     5  0.2891      0.869 0.176 0.000 0.000 0.000 0.824
#> GSM711974     1  0.4088      0.206 0.632 0.000 0.000 0.000 0.368
#> GSM711978     4  0.0000      0.897 0.000 0.000 0.000 1.000 0.000
#> GSM711988     5  0.3297      0.872 0.084 0.000 0.000 0.068 0.848
#> GSM711990     3  0.2929      0.878 0.000 0.000 0.820 0.000 0.180
#> GSM711992     4  0.0000      0.897 0.000 0.000 0.000 1.000 0.000
#> GSM711982     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711984     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711912     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711918     1  0.0000      0.969 1.000 0.000 0.000 0.000 0.000
#> GSM711920     5  0.3116      0.873 0.076 0.000 0.000 0.064 0.860
#> GSM711937     2  0.0880      0.960 0.000 0.968 0.000 0.032 0.000
#> GSM711939     2  0.0162      0.973 0.000 0.996 0.000 0.004 0.000
#> GSM711951     4  0.0000      0.897 0.000 0.000 0.000 1.000 0.000
#> GSM711957     5  0.2516      0.819 0.000 0.000 0.000 0.140 0.860
#> GSM711959     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711965     4  0.3445      0.834 0.000 0.000 0.036 0.824 0.140
#> GSM711967     5  0.2561      0.816 0.000 0.000 0.000 0.144 0.856
#> GSM711969     2  0.0794      0.962 0.000 0.972 0.000 0.028 0.000
#> GSM711973     4  0.5245      0.664 0.000 0.000 0.080 0.640 0.280
#> GSM711977     3  0.2798      0.899 0.000 0.000 0.852 0.008 0.140
#> GSM711981     4  0.0000      0.897 0.000 0.000 0.000 1.000 0.000
#> GSM711987     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711907     2  0.2561      0.862 0.000 0.856 0.000 0.144 0.000
#> GSM711909     3  0.0000      0.939 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.0000      0.939 0.000 0.000 1.000 0.000 0.000
#> GSM711915     3  0.2516      0.904 0.000 0.000 0.860 0.000 0.140
#> GSM711917     2  0.0162      0.973 0.000 0.996 0.000 0.004 0.000
#> GSM711923     4  0.0000      0.897 0.000 0.000 0.000 1.000 0.000
#> GSM711925     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0000      0.939 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711931     2  0.2891      0.825 0.000 0.824 0.000 0.176 0.000
#> GSM711933     5  0.2516      0.890 0.140 0.000 0.000 0.000 0.860
#> GSM711935     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.2179      0.873 0.000 0.000 0.000 0.888 0.112
#> GSM711943     4  0.0000      0.897 0.000 0.000 0.000 1.000 0.000
#> GSM711945     4  0.2516      0.859 0.000 0.000 0.000 0.860 0.140
#> GSM711947     4  0.6109      0.387 0.000 0.320 0.148 0.532 0.000
#> GSM711949     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711955     5  0.0000      0.802 0.000 0.000 0.000 0.000 1.000
#> GSM711963     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0000      0.939 0.000 0.000 1.000 0.000 0.000
#> GSM711975     2  0.1908      0.914 0.000 0.908 0.000 0.092 0.000
#> GSM711979     4  0.0290      0.893 0.000 0.000 0.000 0.992 0.008
#> GSM711989     2  0.0880      0.960 0.000 0.968 0.000 0.032 0.000
#> GSM711991     4  0.2516      0.859 0.000 0.000 0.000 0.860 0.140
#> GSM711993     4  0.0000      0.897 0.000 0.000 0.000 1.000 0.000
#> GSM711983     3  0.2338      0.913 0.000 0.000 0.884 0.004 0.112
#> GSM711985     2  0.0000      0.974 0.000 1.000 0.000 0.000 0.000
#> GSM711913     3  0.2516      0.904 0.000 0.000 0.860 0.000 0.140
#> GSM711919     3  0.0000      0.939 0.000 0.000 1.000 0.000 0.000
#> GSM711921     3  0.0000      0.939 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.1807      0.949 0.000 0.920 0.000 0.020 0.060 0.000
#> GSM711938     2  0.0260      0.963 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM711950     4  0.0000      0.970 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711956     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711958     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711960     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711964     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711966     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711968     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711972     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711976     6  0.0260      0.953 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM711980     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711986     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711904     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711906     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711908     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711910     3  0.0000      0.865 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711914     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711916     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711922     1  0.3076      0.690 0.760 0.000 0.000 0.000 0.000 0.240
#> GSM711924     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711926     4  0.0000      0.970 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711928     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711930     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711932     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711934     1  0.2941      0.721 0.780 0.000 0.000 0.000 0.000 0.220
#> GSM711940     4  0.1267      0.924 0.060 0.000 0.000 0.940 0.000 0.000
#> GSM711942     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711944     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711946     4  0.0937      0.960 0.000 0.000 0.000 0.960 0.040 0.000
#> GSM711948     1  0.2793      0.747 0.800 0.000 0.000 0.000 0.000 0.200
#> GSM711952     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711954     1  0.2135      0.825 0.872 0.000 0.000 0.000 0.000 0.128
#> GSM711962     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711970     1  0.0865      0.918 0.964 0.000 0.000 0.000 0.000 0.036
#> GSM711974     6  0.3869     -0.102 0.500 0.000 0.000 0.000 0.000 0.500
#> GSM711978     4  0.0000      0.970 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711988     1  0.0363      0.935 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM711990     3  0.2214      0.763 0.096 0.000 0.888 0.000 0.016 0.000
#> GSM711992     4  0.0000      0.970 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711982     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711984     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711912     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711918     6  0.0000      0.961 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711920     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711937     2  0.1807      0.949 0.000 0.920 0.000 0.020 0.060 0.000
#> GSM711939     2  0.1267      0.955 0.000 0.940 0.000 0.000 0.060 0.000
#> GSM711951     4  0.1814      0.908 0.000 0.000 0.000 0.900 0.100 0.000
#> GSM711957     1  0.0632      0.926 0.976 0.000 0.000 0.024 0.000 0.000
#> GSM711959     2  0.1267      0.955 0.000 0.940 0.000 0.000 0.060 0.000
#> GSM711961     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711965     4  0.1267      0.948 0.000 0.000 0.000 0.940 0.060 0.000
#> GSM711967     1  0.0937      0.913 0.960 0.000 0.000 0.040 0.000 0.000
#> GSM711969     2  0.1807      0.949 0.000 0.920 0.000 0.020 0.060 0.000
#> GSM711973     5  0.1349      0.907 0.000 0.000 0.004 0.056 0.940 0.000
#> GSM711977     5  0.1387      0.959 0.000 0.000 0.068 0.000 0.932 0.000
#> GSM711981     4  0.1007      0.959 0.000 0.000 0.000 0.956 0.044 0.000
#> GSM711987     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     2  0.2309      0.927 0.000 0.888 0.000 0.028 0.084 0.000
#> GSM711909     3  0.0000      0.865 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711911     3  0.1610      0.806 0.000 0.000 0.916 0.000 0.084 0.000
#> GSM711915     5  0.1267      0.965 0.000 0.000 0.060 0.000 0.940 0.000
#> GSM711917     2  0.1267      0.955 0.000 0.940 0.000 0.000 0.060 0.000
#> GSM711923     4  0.0000      0.970 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711925     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.0000      0.865 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711929     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     2  0.2512      0.919 0.000 0.880 0.000 0.060 0.060 0.000
#> GSM711933     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711935     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     4  0.0547      0.957 0.020 0.000 0.000 0.980 0.000 0.000
#> GSM711943     4  0.0000      0.970 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711945     4  0.0937      0.960 0.000 0.000 0.000 0.960 0.040 0.000
#> GSM711947     3  0.5031      0.496 0.000 0.196 0.680 0.024 0.100 0.000
#> GSM711949     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     1  0.0000      0.941 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711963     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.0000      0.865 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711975     2  0.1890      0.947 0.000 0.916 0.000 0.024 0.060 0.000
#> GSM711979     4  0.0260      0.966 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM711989     2  0.1807      0.949 0.000 0.920 0.000 0.020 0.060 0.000
#> GSM711991     4  0.1082      0.959 0.000 0.000 0.004 0.956 0.040 0.000
#> GSM711993     4  0.0000      0.970 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711983     3  0.3592      0.406 0.000 0.000 0.656 0.344 0.000 0.000
#> GSM711985     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711913     5  0.1267      0.965 0.000 0.000 0.060 0.000 0.940 0.000
#> GSM711919     3  0.0000      0.865 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711921     3  0.0000      0.865 0.000 0.000 1.000 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-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 tissue(p) disease.state(p) individual(p) k
#> CV:pam 87  2.74e-05            0.222         0.674 2
#> CV:pam 88  4.99e-11            0.404         0.753 3
#> CV:pam 90  3.70e-10            0.131         0.503 4
#> CV:pam 88  1.23e-08            0.102         0.298 5
#> CV:pam 87  4.00e-08            0.113         0.240 6

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


CV:mclust*

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

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

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

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

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

collect_plots(res)

plot of chunk CV-mclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.754           0.804       0.922         0.4445 0.594   0.594
#> 3 3 0.781           0.889       0.941         0.4665 0.713   0.529
#> 4 4 0.917           0.893       0.938         0.0926 0.886   0.690
#> 5 5 0.681           0.641       0.808         0.0748 0.911   0.709
#> 6 6 0.734           0.685       0.792         0.0485 0.884   0.571

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
#> GSM711936     2  0.0000      0.966 0.000 1.000
#> GSM711938     2  0.0000      0.966 0.000 1.000
#> GSM711950     1  0.0376      0.889 0.996 0.004
#> GSM711956     1  0.0000      0.891 1.000 0.000
#> GSM711958     1  0.0000      0.891 1.000 0.000
#> GSM711960     1  0.0000      0.891 1.000 0.000
#> GSM711964     1  0.0000      0.891 1.000 0.000
#> GSM711966     1  0.0000      0.891 1.000 0.000
#> GSM711968     1  0.0000      0.891 1.000 0.000
#> GSM711972     1  0.0000      0.891 1.000 0.000
#> GSM711976     1  0.0000      0.891 1.000 0.000
#> GSM711980     1  0.0000      0.891 1.000 0.000
#> GSM711986     1  0.0000      0.891 1.000 0.000
#> GSM711904     1  0.0000      0.891 1.000 0.000
#> GSM711906     1  0.0000      0.891 1.000 0.000
#> GSM711908     1  0.0000      0.891 1.000 0.000
#> GSM711910     1  0.9944      0.271 0.544 0.456
#> GSM711914     1  0.0000      0.891 1.000 0.000
#> GSM711916     1  0.0000      0.891 1.000 0.000
#> GSM711922     1  0.0000      0.891 1.000 0.000
#> GSM711924     1  0.0000      0.891 1.000 0.000
#> GSM711926     1  0.2778      0.864 0.952 0.048
#> GSM711928     1  0.0000      0.891 1.000 0.000
#> GSM711930     1  0.0000      0.891 1.000 0.000
#> GSM711932     1  0.0000      0.891 1.000 0.000
#> GSM711934     1  0.0000      0.891 1.000 0.000
#> GSM711940     1  0.0000      0.891 1.000 0.000
#> GSM711942     1  0.0000      0.891 1.000 0.000
#> GSM711944     1  0.0000      0.891 1.000 0.000
#> GSM711946     1  0.3431      0.855 0.936 0.064
#> GSM711948     1  0.0000      0.891 1.000 0.000
#> GSM711952     1  0.0000      0.891 1.000 0.000
#> GSM711954     1  0.0000      0.891 1.000 0.000
#> GSM711962     1  0.0000      0.891 1.000 0.000
#> GSM711970     1  0.0000      0.891 1.000 0.000
#> GSM711974     1  0.0000      0.891 1.000 0.000
#> GSM711978     1  0.2778      0.864 0.952 0.048
#> GSM711988     1  0.0000      0.891 1.000 0.000
#> GSM711990     1  0.9944      0.271 0.544 0.456
#> GSM711992     1  0.2778      0.864 0.952 0.048
#> GSM711982     1  0.0000      0.891 1.000 0.000
#> GSM711984     2  0.0000      0.966 0.000 1.000
#> GSM711912     1  0.0000      0.891 1.000 0.000
#> GSM711918     1  0.0000      0.891 1.000 0.000
#> GSM711920     1  0.0000      0.891 1.000 0.000
#> GSM711937     2  0.0000      0.966 0.000 1.000
#> GSM711939     2  0.0000      0.966 0.000 1.000
#> GSM711951     2  0.0000      0.966 0.000 1.000
#> GSM711957     1  0.0000      0.891 1.000 0.000
#> GSM711959     2  0.0000      0.966 0.000 1.000
#> GSM711961     2  0.0000      0.966 0.000 1.000
#> GSM711965     1  0.1184      0.884 0.984 0.016
#> GSM711967     1  0.0000      0.891 1.000 0.000
#> GSM711969     2  0.0000      0.966 0.000 1.000
#> GSM711973     1  0.0000      0.891 1.000 0.000
#> GSM711977     1  0.1633      0.879 0.976 0.024
#> GSM711981     1  0.9996      0.103 0.512 0.488
#> GSM711987     2  0.0000      0.966 0.000 1.000
#> GSM711905     2  0.0000      0.966 0.000 1.000
#> GSM711907     2  0.0000      0.966 0.000 1.000
#> GSM711909     1  0.9944      0.271 0.544 0.456
#> GSM711911     1  0.9944      0.271 0.544 0.456
#> GSM711915     1  0.9944      0.271 0.544 0.456
#> GSM711917     2  0.0000      0.966 0.000 1.000
#> GSM711923     1  0.2948      0.862 0.948 0.052
#> GSM711925     2  0.0000      0.966 0.000 1.000
#> GSM711927     1  0.9944      0.271 0.544 0.456
#> GSM711929     2  0.0000      0.966 0.000 1.000
#> GSM711931     2  0.0000      0.966 0.000 1.000
#> GSM711933     1  0.0000      0.891 1.000 0.000
#> GSM711935     2  0.0000      0.966 0.000 1.000
#> GSM711941     1  0.2778      0.864 0.952 0.048
#> GSM711943     1  0.2948      0.862 0.948 0.052
#> GSM711945     1  0.8763      0.597 0.704 0.296
#> GSM711947     2  1.0000     -0.205 0.500 0.500
#> GSM711949     2  0.0000      0.966 0.000 1.000
#> GSM711953     2  0.0000      0.966 0.000 1.000
#> GSM711955     1  0.0000      0.891 1.000 0.000
#> GSM711963     2  0.0000      0.966 0.000 1.000
#> GSM711971     1  0.9944      0.271 0.544 0.456
#> GSM711975     2  0.0000      0.966 0.000 1.000
#> GSM711979     1  0.2778      0.864 0.952 0.048
#> GSM711989     2  0.0000      0.966 0.000 1.000
#> GSM711991     1  1.0000      0.159 0.500 0.500
#> GSM711993     2  0.7056      0.715 0.192 0.808
#> GSM711983     1  0.9944      0.271 0.544 0.456
#> GSM711985     2  0.0000      0.966 0.000 1.000
#> GSM711913     1  0.2423      0.869 0.960 0.040
#> GSM711919     1  0.9944      0.271 0.544 0.456
#> GSM711921     1  0.9944      0.271 0.544 0.456

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM711936     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711938     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711950     3  0.5465     0.7241 0.288 0.000 0.712
#> GSM711956     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711958     1  0.0237     0.9591 0.996 0.000 0.004
#> GSM711960     3  0.6308     0.1251 0.492 0.000 0.508
#> GSM711964     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711966     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711968     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711972     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711976     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711980     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711986     1  0.0592     0.9553 0.988 0.000 0.012
#> GSM711904     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711906     1  0.1753     0.9307 0.952 0.000 0.048
#> GSM711908     1  0.1964     0.9234 0.944 0.000 0.056
#> GSM711910     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711914     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711916     1  0.1031     0.9488 0.976 0.000 0.024
#> GSM711922     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711924     1  0.1643     0.9341 0.956 0.000 0.044
#> GSM711926     3  0.4589     0.8532 0.172 0.008 0.820
#> GSM711928     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711930     1  0.2165     0.9187 0.936 0.000 0.064
#> GSM711932     1  0.5216     0.5637 0.740 0.000 0.260
#> GSM711934     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711940     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711942     1  0.0892     0.9511 0.980 0.000 0.020
#> GSM711944     3  0.2796     0.8564 0.092 0.000 0.908
#> GSM711946     3  0.4178     0.8544 0.172 0.000 0.828
#> GSM711948     1  0.2878     0.8571 0.904 0.000 0.096
#> GSM711952     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711954     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711962     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711970     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711974     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711978     3  0.4589     0.8532 0.172 0.008 0.820
#> GSM711988     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711990     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711992     3  0.4589     0.8532 0.172 0.008 0.820
#> GSM711982     1  0.0747     0.9533 0.984 0.000 0.016
#> GSM711984     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711912     1  0.1289     0.9432 0.968 0.000 0.032
#> GSM711918     1  0.1964     0.9234 0.944 0.000 0.056
#> GSM711920     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711937     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711939     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711951     2  0.3619     0.8192 0.000 0.864 0.136
#> GSM711957     3  0.5678     0.6706 0.316 0.000 0.684
#> GSM711959     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711961     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711965     3  0.3879     0.8609 0.152 0.000 0.848
#> GSM711967     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711969     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711973     3  0.4346     0.8349 0.184 0.000 0.816
#> GSM711977     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711981     3  0.6380     0.7702 0.076 0.164 0.760
#> GSM711987     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711905     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711907     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711909     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711911     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711915     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711917     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711923     3  0.4178     0.8544 0.172 0.000 0.828
#> GSM711925     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711927     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711929     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711931     2  0.5785     0.4508 0.000 0.668 0.332
#> GSM711933     1  0.0000     0.9607 1.000 0.000 0.000
#> GSM711935     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711941     3  0.4178     0.8544 0.172 0.000 0.828
#> GSM711943     3  0.4178     0.8544 0.172 0.000 0.828
#> GSM711945     3  0.4178     0.8544 0.172 0.000 0.828
#> GSM711947     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711949     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711953     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711955     1  0.6215     0.0275 0.572 0.000 0.428
#> GSM711963     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711971     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711975     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711979     3  0.4589     0.8532 0.172 0.008 0.820
#> GSM711989     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711991     3  0.0424     0.8695 0.008 0.000 0.992
#> GSM711993     3  0.6522     0.6307 0.032 0.272 0.696
#> GSM711983     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711985     2  0.0000     0.9764 0.000 1.000 0.000
#> GSM711913     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711919     3  0.0000     0.8700 0.000 0.000 1.000
#> GSM711921     3  0.0000     0.8700 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000      0.953 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000      0.953 0.000 1.000 0.000 0.000
#> GSM711950     4  0.2149      0.807 0.088 0.000 0.000 0.912
#> GSM711956     1  0.0336      0.954 0.992 0.000 0.000 0.008
#> GSM711958     1  0.0336      0.953 0.992 0.000 0.000 0.008
#> GSM711960     1  0.0469      0.952 0.988 0.000 0.000 0.012
#> GSM711964     1  0.1389      0.952 0.952 0.000 0.000 0.048
#> GSM711966     1  0.1302      0.953 0.956 0.000 0.000 0.044
#> GSM711968     1  0.1867      0.946 0.928 0.000 0.000 0.072
#> GSM711972     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM711976     1  0.3400      0.839 0.820 0.000 0.000 0.180
#> GSM711980     1  0.2011      0.943 0.920 0.000 0.000 0.080
#> GSM711986     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM711904     1  0.1637      0.949 0.940 0.000 0.000 0.060
#> GSM711906     1  0.0188      0.952 0.996 0.000 0.000 0.004
#> GSM711908     1  0.0188      0.952 0.996 0.000 0.000 0.004
#> GSM711910     3  0.0000      0.928 0.000 0.000 1.000 0.000
#> GSM711914     1  0.1118      0.954 0.964 0.000 0.000 0.036
#> GSM711916     1  0.0188      0.952 0.996 0.000 0.000 0.004
#> GSM711922     1  0.2011      0.943 0.920 0.000 0.000 0.080
#> GSM711924     1  0.0336      0.953 0.992 0.000 0.000 0.008
#> GSM711926     4  0.1863      0.850 0.004 0.040 0.012 0.944
#> GSM711928     1  0.2011      0.943 0.920 0.000 0.000 0.080
#> GSM711930     1  0.0188      0.952 0.996 0.000 0.000 0.004
#> GSM711932     4  0.4746      0.386 0.368 0.000 0.000 0.632
#> GSM711934     1  0.0188      0.952 0.996 0.000 0.000 0.004
#> GSM711940     1  0.2149      0.939 0.912 0.000 0.000 0.088
#> GSM711942     1  0.0188      0.952 0.996 0.000 0.000 0.004
#> GSM711944     1  0.4467      0.726 0.788 0.000 0.040 0.172
#> GSM711946     4  0.1716      0.853 0.000 0.000 0.064 0.936
#> GSM711948     1  0.2402      0.936 0.912 0.000 0.012 0.076
#> GSM711952     1  0.1474      0.951 0.948 0.000 0.000 0.052
#> GSM711954     1  0.2149      0.939 0.912 0.000 0.000 0.088
#> GSM711962     1  0.0707      0.954 0.980 0.000 0.000 0.020
#> GSM711970     1  0.2011      0.943 0.920 0.000 0.000 0.080
#> GSM711974     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM711978     4  0.1863      0.850 0.004 0.040 0.012 0.944
#> GSM711988     1  0.2011      0.943 0.920 0.000 0.000 0.080
#> GSM711990     3  0.4105      0.817 0.032 0.000 0.812 0.156
#> GSM711992     4  0.1863      0.850 0.004 0.040 0.012 0.944
#> GSM711982     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000      0.953 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0188      0.952 0.996 0.000 0.000 0.004
#> GSM711918     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000      0.953 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000      0.953 0.000 1.000 0.000 0.000
#> GSM711951     2  0.0336      0.950 0.000 0.992 0.000 0.008
#> GSM711957     4  0.3577      0.750 0.156 0.000 0.012 0.832
#> GSM711959     2  0.0000      0.953 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0188      0.953 0.000 0.996 0.000 0.004
#> GSM711965     4  0.1716      0.853 0.000 0.000 0.064 0.936
#> GSM711967     1  0.2081      0.941 0.916 0.000 0.000 0.084
#> GSM711969     2  0.0000      0.953 0.000 1.000 0.000 0.000
#> GSM711973     4  0.4237      0.761 0.152 0.000 0.040 0.808
#> GSM711977     4  0.4103      0.646 0.000 0.000 0.256 0.744
#> GSM711981     2  0.5417      0.294 0.000 0.572 0.016 0.412
#> GSM711987     2  0.1118      0.944 0.000 0.964 0.000 0.036
#> GSM711905     2  0.1118      0.944 0.000 0.964 0.000 0.036
#> GSM711907     2  0.0000      0.953 0.000 1.000 0.000 0.000
#> GSM711909     3  0.0000      0.928 0.000 0.000 1.000 0.000
#> GSM711911     3  0.3052      0.848 0.004 0.000 0.860 0.136
#> GSM711915     3  0.0000      0.928 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000      0.953 0.000 1.000 0.000 0.000
#> GSM711923     4  0.1743      0.856 0.004 0.000 0.056 0.940
#> GSM711925     2  0.1118      0.944 0.000 0.964 0.000 0.036
#> GSM711927     3  0.0000      0.928 0.000 0.000 1.000 0.000
#> GSM711929     2  0.1118      0.944 0.000 0.964 0.000 0.036
#> GSM711931     2  0.0336      0.950 0.000 0.992 0.000 0.008
#> GSM711933     1  0.1978      0.945 0.928 0.000 0.004 0.068
#> GSM711935     2  0.1118      0.944 0.000 0.964 0.000 0.036
#> GSM711941     4  0.1576      0.856 0.004 0.000 0.048 0.948
#> GSM711943     4  0.1824      0.855 0.004 0.000 0.060 0.936
#> GSM711945     4  0.1716      0.853 0.000 0.000 0.064 0.936
#> GSM711947     3  0.0000      0.928 0.000 0.000 1.000 0.000
#> GSM711949     2  0.1118      0.944 0.000 0.964 0.000 0.036
#> GSM711953     2  0.1118      0.944 0.000 0.964 0.000 0.036
#> GSM711955     1  0.2522      0.933 0.908 0.000 0.016 0.076
#> GSM711963     2  0.1118      0.944 0.000 0.964 0.000 0.036
#> GSM711971     3  0.3813      0.831 0.024 0.000 0.828 0.148
#> GSM711975     2  0.0188      0.952 0.000 0.996 0.000 0.004
#> GSM711979     4  0.1771      0.851 0.004 0.036 0.012 0.948
#> GSM711989     2  0.0000      0.953 0.000 1.000 0.000 0.000
#> GSM711991     3  0.0336      0.925 0.000 0.000 0.992 0.008
#> GSM711993     2  0.5093      0.454 0.000 0.640 0.012 0.348
#> GSM711983     3  0.3910      0.823 0.024 0.000 0.820 0.156
#> GSM711985     2  0.0000      0.953 0.000 1.000 0.000 0.000
#> GSM711913     4  0.4877      0.409 0.000 0.000 0.408 0.592
#> GSM711919     3  0.0188      0.926 0.004 0.000 0.996 0.000
#> GSM711921     3  0.0000      0.928 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.0510     0.9259 0.000 0.984 0.000 0.000 0.016
#> GSM711938     2  0.0671     0.9283 0.000 0.980 0.000 0.004 0.016
#> GSM711950     1  0.6307    -0.3075 0.464 0.000 0.008 0.408 0.120
#> GSM711956     1  0.1608     0.6470 0.928 0.000 0.000 0.000 0.072
#> GSM711958     1  0.3752     0.4382 0.708 0.000 0.000 0.000 0.292
#> GSM711960     1  0.4620     0.2057 0.612 0.000 0.012 0.004 0.372
#> GSM711964     1  0.2605     0.6128 0.852 0.000 0.000 0.000 0.148
#> GSM711966     1  0.3366     0.5239 0.768 0.000 0.000 0.000 0.232
#> GSM711968     1  0.1341     0.6485 0.944 0.000 0.000 0.000 0.056
#> GSM711972     1  0.2813     0.5963 0.832 0.000 0.000 0.000 0.168
#> GSM711976     1  0.2997     0.5218 0.840 0.000 0.000 0.012 0.148
#> GSM711980     1  0.0000     0.6539 1.000 0.000 0.000 0.000 0.000
#> GSM711986     5  0.4210     0.7715 0.412 0.000 0.000 0.000 0.588
#> GSM711904     1  0.4397    -0.3598 0.564 0.000 0.000 0.004 0.432
#> GSM711906     5  0.3774     0.8331 0.296 0.000 0.000 0.000 0.704
#> GSM711908     5  0.3461     0.7890 0.224 0.000 0.000 0.004 0.772
#> GSM711910     3  0.0000     0.8129 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.2074     0.6355 0.896 0.000 0.000 0.000 0.104
#> GSM711916     5  0.3707     0.8286 0.284 0.000 0.000 0.000 0.716
#> GSM711922     1  0.0609     0.6559 0.980 0.000 0.000 0.000 0.020
#> GSM711924     1  0.3730     0.4469 0.712 0.000 0.000 0.000 0.288
#> GSM711926     4  0.7564     0.5354 0.164 0.180 0.004 0.532 0.120
#> GSM711928     1  0.0609     0.6557 0.980 0.000 0.000 0.000 0.020
#> GSM711930     5  0.3461     0.7890 0.224 0.000 0.000 0.004 0.772
#> GSM711932     1  0.3565     0.4915 0.816 0.000 0.000 0.144 0.040
#> GSM711934     1  0.3534     0.4920 0.744 0.000 0.000 0.000 0.256
#> GSM711940     1  0.0324     0.6528 0.992 0.000 0.000 0.004 0.004
#> GSM711942     1  0.3707     0.4500 0.716 0.000 0.000 0.000 0.284
#> GSM711944     1  0.6831     0.1582 0.512 0.000 0.112 0.328 0.048
#> GSM711946     4  0.0566     0.6246 0.004 0.000 0.012 0.984 0.000
#> GSM711948     1  0.5406     0.3634 0.684 0.000 0.012 0.200 0.104
#> GSM711952     5  0.4278     0.7034 0.452 0.000 0.000 0.000 0.548
#> GSM711954     1  0.0771     0.6481 0.976 0.000 0.000 0.004 0.020
#> GSM711962     1  0.3274     0.5373 0.780 0.000 0.000 0.000 0.220
#> GSM711970     1  0.1124     0.6397 0.960 0.000 0.000 0.004 0.036
#> GSM711974     1  0.3752     0.4397 0.708 0.000 0.000 0.000 0.292
#> GSM711978     4  0.5253     0.6256 0.172 0.008 0.000 0.700 0.120
#> GSM711988     1  0.0451     0.6511 0.988 0.000 0.000 0.004 0.008
#> GSM711990     3  0.7050     0.3759 0.164 0.000 0.476 0.324 0.036
#> GSM711992     4  0.5441     0.6242 0.176 0.008 0.004 0.692 0.120
#> GSM711982     1  0.3586     0.4691 0.736 0.000 0.000 0.000 0.264
#> GSM711984     2  0.0000     0.9281 0.000 1.000 0.000 0.000 0.000
#> GSM711912     5  0.4114     0.8117 0.376 0.000 0.000 0.000 0.624
#> GSM711918     5  0.4150     0.8017 0.388 0.000 0.000 0.000 0.612
#> GSM711920     1  0.3452     0.5070 0.756 0.000 0.000 0.000 0.244
#> GSM711937     2  0.0510     0.9259 0.000 0.984 0.000 0.000 0.016
#> GSM711939     2  0.0290     0.9273 0.000 0.992 0.000 0.000 0.008
#> GSM711951     2  0.2777     0.8491 0.000 0.864 0.000 0.120 0.016
#> GSM711957     4  0.6620     0.5476 0.312 0.000 0.016 0.512 0.160
#> GSM711959     2  0.0000     0.9281 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0703     0.9280 0.000 0.976 0.000 0.000 0.024
#> GSM711965     4  0.3427     0.5616 0.108 0.000 0.056 0.836 0.000
#> GSM711967     1  0.1041     0.6389 0.964 0.000 0.000 0.004 0.032
#> GSM711969     2  0.0510     0.9259 0.000 0.984 0.000 0.000 0.016
#> GSM711973     4  0.5286     0.4965 0.220 0.000 0.036 0.696 0.048
#> GSM711977     4  0.4126     0.0755 0.000 0.000 0.380 0.620 0.000
#> GSM711981     4  0.6393     0.3966 0.024 0.296 0.000 0.560 0.120
#> GSM711987     2  0.2136     0.9149 0.000 0.904 0.000 0.008 0.088
#> GSM711905     2  0.2136     0.9149 0.000 0.904 0.000 0.008 0.088
#> GSM711907     2  0.0510     0.9259 0.000 0.984 0.000 0.000 0.016
#> GSM711909     3  0.0000     0.8129 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.5041     0.5524 0.016 0.000 0.632 0.328 0.024
#> GSM711915     3  0.0000     0.8129 0.000 0.000 1.000 0.000 0.000
#> GSM711917     2  0.0290     0.9273 0.000 0.992 0.000 0.000 0.008
#> GSM711923     4  0.0579     0.6266 0.008 0.000 0.008 0.984 0.000
#> GSM711925     2  0.2011     0.9159 0.000 0.908 0.000 0.004 0.088
#> GSM711927     3  0.0000     0.8129 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.2136     0.9149 0.000 0.904 0.000 0.008 0.088
#> GSM711931     2  0.2969     0.8210 0.000 0.852 0.000 0.020 0.128
#> GSM711933     1  0.2783     0.6195 0.868 0.000 0.012 0.004 0.116
#> GSM711935     2  0.2136     0.9149 0.000 0.904 0.000 0.008 0.088
#> GSM711941     4  0.6244     0.4535 0.364 0.000 0.008 0.508 0.120
#> GSM711943     4  0.0566     0.6246 0.004 0.000 0.012 0.984 0.000
#> GSM711945     4  0.0566     0.6246 0.004 0.000 0.012 0.984 0.000
#> GSM711947     3  0.0000     0.8129 0.000 0.000 1.000 0.000 0.000
#> GSM711949     2  0.2136     0.9149 0.000 0.904 0.000 0.008 0.088
#> GSM711953     2  0.2136     0.9149 0.000 0.904 0.000 0.008 0.088
#> GSM711955     1  0.3967     0.4439 0.724 0.000 0.012 0.264 0.000
#> GSM711963     2  0.2136     0.9149 0.000 0.904 0.000 0.008 0.088
#> GSM711971     3  0.5880     0.5219 0.060 0.000 0.588 0.324 0.028
#> GSM711975     2  0.1117     0.9212 0.000 0.964 0.000 0.020 0.016
#> GSM711979     4  0.5906     0.5867 0.268 0.008 0.000 0.604 0.120
#> GSM711989     2  0.0510     0.9259 0.000 0.984 0.000 0.000 0.016
#> GSM711991     3  0.0963     0.7939 0.000 0.000 0.964 0.036 0.000
#> GSM711993     2  0.7821    -0.0608 0.152 0.444 0.000 0.284 0.120
#> GSM711983     3  0.6765     0.3913 0.164 0.000 0.492 0.324 0.020
#> GSM711985     2  0.0404     0.9284 0.000 0.988 0.000 0.000 0.012
#> GSM711913     4  0.4307    -0.1464 0.000 0.000 0.496 0.504 0.000
#> GSM711919     3  0.0771     0.8014 0.004 0.000 0.976 0.000 0.020
#> GSM711921     3  0.0000     0.8129 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.0000     0.7765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711938     2  0.2941     0.4557 0.000 0.780 0.000 0.000 0.220 0.000
#> GSM711950     4  0.2261     0.7794 0.104 0.000 0.004 0.884 0.008 0.000
#> GSM711956     1  0.3213     0.7497 0.784 0.000 0.000 0.008 0.004 0.204
#> GSM711958     1  0.5806     0.5363 0.592 0.000 0.132 0.020 0.008 0.248
#> GSM711960     3  0.5918     0.0685 0.068 0.000 0.472 0.036 0.008 0.416
#> GSM711964     1  0.3023     0.7476 0.784 0.000 0.000 0.004 0.000 0.212
#> GSM711966     1  0.3109     0.7450 0.772 0.000 0.000 0.004 0.000 0.224
#> GSM711968     1  0.2838     0.7487 0.808 0.000 0.000 0.004 0.000 0.188
#> GSM711972     1  0.3050     0.7370 0.764 0.000 0.000 0.000 0.000 0.236
#> GSM711976     1  0.3292     0.4335 0.784 0.000 0.000 0.200 0.008 0.008
#> GSM711980     1  0.0692     0.6993 0.976 0.000 0.000 0.004 0.000 0.020
#> GSM711986     6  0.2996     0.7315 0.228 0.000 0.000 0.000 0.000 0.772
#> GSM711904     1  0.3684     0.6529 0.692 0.000 0.000 0.004 0.004 0.300
#> GSM711906     1  0.3769     0.5734 0.640 0.000 0.000 0.000 0.004 0.356
#> GSM711908     6  0.0458     0.6700 0.016 0.000 0.000 0.000 0.000 0.984
#> GSM711910     3  0.3699     0.7581 0.000 0.000 0.660 0.000 0.336 0.004
#> GSM711914     1  0.2912     0.7443 0.784 0.000 0.000 0.000 0.000 0.216
#> GSM711916     6  0.3999    -0.3255 0.496 0.000 0.000 0.000 0.004 0.500
#> GSM711922     1  0.0806     0.6869 0.972 0.000 0.000 0.020 0.008 0.000
#> GSM711924     1  0.3863     0.7292 0.728 0.000 0.000 0.020 0.008 0.244
#> GSM711926     4  0.0951     0.8003 0.008 0.004 0.000 0.968 0.020 0.000
#> GSM711928     1  0.1806     0.7264 0.908 0.000 0.000 0.004 0.000 0.088
#> GSM711930     6  0.0603     0.6696 0.016 0.000 0.000 0.000 0.004 0.980
#> GSM711932     1  0.3878     0.2746 0.688 0.000 0.000 0.296 0.008 0.008
#> GSM711934     1  0.4112     0.7325 0.728 0.000 0.008 0.024 0.008 0.232
#> GSM711940     1  0.1262     0.6804 0.956 0.000 0.000 0.020 0.008 0.016
#> GSM711942     1  0.3076     0.7339 0.760 0.000 0.000 0.000 0.000 0.240
#> GSM711944     3  0.4845     0.4811 0.204 0.000 0.700 0.072 0.008 0.016
#> GSM711946     4  0.3043     0.7334 0.000 0.000 0.196 0.796 0.004 0.004
#> GSM711948     4  0.5148     0.4901 0.332 0.000 0.060 0.592 0.008 0.008
#> GSM711952     6  0.3023     0.7278 0.232 0.000 0.000 0.000 0.000 0.768
#> GSM711954     1  0.0508     0.6848 0.984 0.000 0.000 0.004 0.000 0.012
#> GSM711962     1  0.3023     0.7392 0.768 0.000 0.000 0.000 0.000 0.232
#> GSM711970     1  0.0508     0.6848 0.984 0.000 0.000 0.004 0.000 0.012
#> GSM711974     1  0.3672     0.5371 0.632 0.000 0.000 0.000 0.000 0.368
#> GSM711978     4  0.0806     0.8009 0.008 0.000 0.000 0.972 0.020 0.000
#> GSM711988     1  0.1251     0.6800 0.956 0.000 0.000 0.024 0.008 0.012
#> GSM711990     3  0.2144     0.6730 0.004 0.000 0.908 0.068 0.008 0.012
#> GSM711992     4  0.0806     0.8009 0.008 0.000 0.000 0.972 0.020 0.000
#> GSM711982     1  0.3023     0.7381 0.768 0.000 0.000 0.000 0.000 0.232
#> GSM711984     2  0.1267     0.7561 0.000 0.940 0.000 0.000 0.060 0.000
#> GSM711912     6  0.2883     0.7384 0.212 0.000 0.000 0.000 0.000 0.788
#> GSM711918     6  0.2883     0.7387 0.212 0.000 0.000 0.000 0.000 0.788
#> GSM711920     1  0.3189     0.7373 0.760 0.000 0.000 0.004 0.000 0.236
#> GSM711937     2  0.0000     0.7765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711939     2  0.1007     0.7676 0.000 0.956 0.000 0.000 0.044 0.000
#> GSM711951     2  0.3810     0.1956 0.000 0.572 0.000 0.428 0.000 0.000
#> GSM711957     4  0.4154     0.7204 0.136 0.000 0.004 0.776 0.020 0.064
#> GSM711959     2  0.1075     0.7651 0.000 0.952 0.000 0.000 0.048 0.000
#> GSM711961     2  0.3126     0.3848 0.000 0.752 0.000 0.000 0.248 0.000
#> GSM711965     3  0.4084     0.1271 0.000 0.000 0.588 0.400 0.012 0.000
#> GSM711967     1  0.0405     0.6862 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM711969     2  0.0000     0.7765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711973     4  0.3538     0.7283 0.036 0.000 0.116 0.824 0.008 0.016
#> GSM711977     3  0.3419     0.7062 0.000 0.000 0.820 0.088 0.088 0.004
#> GSM711981     4  0.2734     0.7018 0.000 0.148 0.008 0.840 0.004 0.000
#> GSM711987     5  0.3737     0.9644 0.000 0.392 0.000 0.000 0.608 0.000
#> GSM711905     5  0.3684     0.9902 0.000 0.372 0.000 0.000 0.628 0.000
#> GSM711907     2  0.0000     0.7765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711909     3  0.3699     0.7581 0.000 0.000 0.660 0.000 0.336 0.004
#> GSM711911     3  0.1053     0.7052 0.000 0.000 0.964 0.020 0.004 0.012
#> GSM711915     3  0.3578     0.7579 0.000 0.000 0.660 0.000 0.340 0.000
#> GSM711917     2  0.0937     0.7694 0.000 0.960 0.000 0.000 0.040 0.000
#> GSM711923     4  0.3154     0.7412 0.000 0.000 0.184 0.800 0.012 0.004
#> GSM711925     5  0.3717     0.9770 0.000 0.384 0.000 0.000 0.616 0.000
#> GSM711927     3  0.3699     0.7581 0.000 0.000 0.660 0.000 0.336 0.004
#> GSM711929     5  0.3684     0.9902 0.000 0.372 0.000 0.000 0.628 0.000
#> GSM711931     2  0.3695     0.3366 0.000 0.624 0.000 0.376 0.000 0.000
#> GSM711933     1  0.5174     0.5149 0.712 0.000 0.136 0.056 0.008 0.088
#> GSM711935     5  0.3684     0.9902 0.000 0.372 0.000 0.000 0.628 0.000
#> GSM711941     4  0.1049     0.8019 0.032 0.000 0.000 0.960 0.008 0.000
#> GSM711943     4  0.3056     0.7421 0.000 0.000 0.184 0.804 0.008 0.004
#> GSM711945     4  0.3121     0.7366 0.000 0.000 0.192 0.796 0.008 0.004
#> GSM711947     3  0.5024     0.7223 0.000 0.000 0.572 0.088 0.340 0.000
#> GSM711949     5  0.3684     0.9902 0.000 0.372 0.000 0.000 0.628 0.000
#> GSM711953     5  0.3695     0.9874 0.000 0.376 0.000 0.000 0.624 0.000
#> GSM711955     4  0.6028     0.3527 0.356 0.000 0.148 0.480 0.008 0.008
#> GSM711963     5  0.3684     0.9902 0.000 0.372 0.000 0.000 0.628 0.000
#> GSM711971     3  0.1723     0.6915 0.004 0.000 0.932 0.048 0.004 0.012
#> GSM711975     2  0.1610     0.6964 0.000 0.916 0.000 0.084 0.000 0.000
#> GSM711979     4  0.0508     0.8022 0.004 0.000 0.000 0.984 0.012 0.000
#> GSM711989     2  0.0000     0.7765 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711991     3  0.5094     0.7188 0.000 0.000 0.568 0.096 0.336 0.000
#> GSM711993     4  0.3206     0.6703 0.008 0.172 0.004 0.808 0.008 0.000
#> GSM711983     3  0.2086     0.6750 0.004 0.000 0.912 0.064 0.008 0.012
#> GSM711985     2  0.2340     0.6258 0.000 0.852 0.000 0.000 0.148 0.000
#> GSM711913     3  0.3138     0.7188 0.000 0.000 0.840 0.060 0.096 0.004
#> GSM711919     3  0.3984     0.7569 0.000 0.000 0.648 0.000 0.336 0.016
#> GSM711921     3  0.3699     0.7581 0.000 0.000 0.660 0.000 0.336 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-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 tissue(p) disease.state(p) individual(p) k
#> CV:mclust 77  9.27e-07           0.3528         0.768 2
#> CV:mclust 87  1.24e-10           0.3713         0.568 3
#> CV:mclust 86  9.29e-10           0.1184         0.560 4
#> CV:mclust 69  1.07e-07           0.0452         0.491 5
#> CV:mclust 78  1.96e-08           0.0660         0.273 6

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


CV:NMF*

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 27425 rows and 90 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 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-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.999           0.964       0.985         0.4365 0.567   0.567
#> 3 3 0.970           0.957       0.981         0.4923 0.756   0.578
#> 4 4 0.937           0.904       0.959         0.1311 0.834   0.569
#> 5 5 0.799           0.809       0.866         0.0532 0.940   0.785
#> 6 6 0.864           0.748       0.892         0.0502 0.914   0.657

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

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

There is also optional best \(k\) = 2 3 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
#> GSM711936     2   0.000      0.982 0.000 1.000
#> GSM711938     2   0.000      0.982 0.000 1.000
#> GSM711950     1   0.000      0.986 1.000 0.000
#> GSM711956     1   0.000      0.986 1.000 0.000
#> GSM711958     1   0.000      0.986 1.000 0.000
#> GSM711960     1   0.000      0.986 1.000 0.000
#> GSM711964     1   0.000      0.986 1.000 0.000
#> GSM711966     1   0.000      0.986 1.000 0.000
#> GSM711968     1   0.000      0.986 1.000 0.000
#> GSM711972     1   0.000      0.986 1.000 0.000
#> GSM711976     1   0.000      0.986 1.000 0.000
#> GSM711980     1   0.000      0.986 1.000 0.000
#> GSM711986     1   0.000      0.986 1.000 0.000
#> GSM711904     1   0.000      0.986 1.000 0.000
#> GSM711906     1   0.000      0.986 1.000 0.000
#> GSM711908     1   0.000      0.986 1.000 0.000
#> GSM711910     1   0.000      0.986 1.000 0.000
#> GSM711914     1   0.000      0.986 1.000 0.000
#> GSM711916     1   0.000      0.986 1.000 0.000
#> GSM711922     1   0.000      0.986 1.000 0.000
#> GSM711924     1   0.000      0.986 1.000 0.000
#> GSM711926     2   0.402      0.907 0.080 0.920
#> GSM711928     1   0.000      0.986 1.000 0.000
#> GSM711930     1   0.000      0.986 1.000 0.000
#> GSM711932     1   0.000      0.986 1.000 0.000
#> GSM711934     1   0.000      0.986 1.000 0.000
#> GSM711940     1   0.000      0.986 1.000 0.000
#> GSM711942     1   0.000      0.986 1.000 0.000
#> GSM711944     1   0.000      0.986 1.000 0.000
#> GSM711946     1   0.224      0.954 0.964 0.036
#> GSM711948     1   0.000      0.986 1.000 0.000
#> GSM711952     1   0.000      0.986 1.000 0.000
#> GSM711954     1   0.000      0.986 1.000 0.000
#> GSM711962     1   0.000      0.986 1.000 0.000
#> GSM711970     1   0.000      0.986 1.000 0.000
#> GSM711974     1   0.000      0.986 1.000 0.000
#> GSM711978     1   0.482      0.881 0.896 0.104
#> GSM711988     1   0.000      0.986 1.000 0.000
#> GSM711990     1   0.000      0.986 1.000 0.000
#> GSM711992     1   0.295      0.938 0.948 0.052
#> GSM711982     1   0.000      0.986 1.000 0.000
#> GSM711984     2   0.000      0.982 0.000 1.000
#> GSM711912     1   0.000      0.986 1.000 0.000
#> GSM711918     1   0.000      0.986 1.000 0.000
#> GSM711920     1   0.000      0.986 1.000 0.000
#> GSM711937     2   0.000      0.982 0.000 1.000
#> GSM711939     2   0.000      0.982 0.000 1.000
#> GSM711951     2   0.000      0.982 0.000 1.000
#> GSM711957     1   0.000      0.986 1.000 0.000
#> GSM711959     2   0.000      0.982 0.000 1.000
#> GSM711961     2   0.000      0.982 0.000 1.000
#> GSM711965     1   0.000      0.986 1.000 0.000
#> GSM711967     1   0.000      0.986 1.000 0.000
#> GSM711969     2   0.000      0.982 0.000 1.000
#> GSM711973     1   0.000      0.986 1.000 0.000
#> GSM711977     1   0.000      0.986 1.000 0.000
#> GSM711981     2   0.343      0.924 0.064 0.936
#> GSM711987     2   0.000      0.982 0.000 1.000
#> GSM711905     2   0.000      0.982 0.000 1.000
#> GSM711907     2   0.000      0.982 0.000 1.000
#> GSM711909     1   0.000      0.986 1.000 0.000
#> GSM711911     1   0.000      0.986 1.000 0.000
#> GSM711915     1   0.000      0.986 1.000 0.000
#> GSM711917     2   0.000      0.982 0.000 1.000
#> GSM711923     1   0.141      0.969 0.980 0.020
#> GSM711925     2   0.000      0.982 0.000 1.000
#> GSM711927     1   0.000      0.986 1.000 0.000
#> GSM711929     2   0.000      0.982 0.000 1.000
#> GSM711931     2   0.000      0.982 0.000 1.000
#> GSM711933     1   0.000      0.986 1.000 0.000
#> GSM711935     2   0.000      0.982 0.000 1.000
#> GSM711941     1   0.000      0.986 1.000 0.000
#> GSM711943     1   0.653      0.797 0.832 0.168
#> GSM711945     2   0.904      0.523 0.320 0.680
#> GSM711947     2   0.000      0.982 0.000 1.000
#> GSM711949     2   0.000      0.982 0.000 1.000
#> GSM711953     2   0.000      0.982 0.000 1.000
#> GSM711955     1   0.000      0.986 1.000 0.000
#> GSM711963     2   0.000      0.982 0.000 1.000
#> GSM711971     1   0.000      0.986 1.000 0.000
#> GSM711975     2   0.000      0.982 0.000 1.000
#> GSM711979     1   0.141      0.969 0.980 0.020
#> GSM711989     2   0.000      0.982 0.000 1.000
#> GSM711991     1   0.994      0.153 0.544 0.456
#> GSM711993     2   0.000      0.982 0.000 1.000
#> GSM711983     1   0.000      0.986 1.000 0.000
#> GSM711985     2   0.000      0.982 0.000 1.000
#> GSM711913     1   0.000      0.986 1.000 0.000
#> GSM711919     1   0.000      0.986 1.000 0.000
#> GSM711921     1   0.000      0.986 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
#> GSM711936     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711938     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711950     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711956     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711958     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711960     3  0.4796      0.746 0.220 0.000 0.780
#> GSM711964     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711966     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711968     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711972     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711976     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711980     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711986     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711904     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711906     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711908     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711910     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711914     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711916     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711922     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711924     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711926     2  0.5988      0.403 0.368 0.632 0.000
#> GSM711928     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711930     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711932     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711934     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711940     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711942     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711944     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711946     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711948     1  0.0424      0.983 0.992 0.000 0.008
#> GSM711952     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711954     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711962     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711970     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711974     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711978     1  0.4291      0.780 0.820 0.180 0.000
#> GSM711988     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711990     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711992     1  0.1289      0.959 0.968 0.032 0.000
#> GSM711982     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711984     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711912     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711918     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711920     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711937     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711939     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711951     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711957     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711959     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711961     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711965     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711967     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711969     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711973     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711977     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711981     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711987     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711905     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711907     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711909     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711911     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711915     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711917     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711923     3  0.1753      0.923 0.000 0.048 0.952
#> GSM711925     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711927     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711929     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711931     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711933     1  0.0000      0.990 1.000 0.000 0.000
#> GSM711935     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711941     3  0.4842      0.743 0.224 0.000 0.776
#> GSM711943     3  0.3686      0.833 0.000 0.140 0.860
#> GSM711945     3  0.2261      0.906 0.000 0.068 0.932
#> GSM711947     3  0.1860      0.920 0.000 0.052 0.948
#> GSM711949     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711955     3  0.5254      0.681 0.264 0.000 0.736
#> GSM711963     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711971     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711975     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711979     1  0.3686      0.835 0.860 0.140 0.000
#> GSM711989     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711991     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711993     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711983     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711985     2  0.0000      0.982 0.000 1.000 0.000
#> GSM711913     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711919     3  0.0000      0.952 0.000 0.000 1.000
#> GSM711921     3  0.0000      0.952 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711950     4  0.0000      0.845 0.000 0.000 0.000 1.000
#> GSM711956     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711958     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711960     3  0.1118      0.934 0.036 0.000 0.964 0.000
#> GSM711964     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711976     4  0.4624      0.532 0.340 0.000 0.000 0.660
#> GSM711980     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711906     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711910     3  0.0000      0.969 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711924     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711926     4  0.1452      0.829 0.008 0.036 0.000 0.956
#> GSM711928     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711932     4  0.4431      0.586 0.304 0.000 0.000 0.696
#> GSM711934     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711940     4  0.4843      0.400 0.396 0.000 0.000 0.604
#> GSM711942     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711944     3  0.0000      0.969 0.000 0.000 1.000 0.000
#> GSM711946     4  0.0817      0.836 0.000 0.000 0.024 0.976
#> GSM711948     4  0.0188      0.844 0.004 0.000 0.000 0.996
#> GSM711952     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711954     1  0.0817      0.968 0.976 0.000 0.000 0.024
#> GSM711962     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711970     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711974     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0000      0.845 0.000 0.000 0.000 1.000
#> GSM711988     1  0.1211      0.951 0.960 0.000 0.000 0.040
#> GSM711990     3  0.0000      0.969 0.000 0.000 1.000 0.000
#> GSM711992     4  0.5000      0.107 0.496 0.000 0.000 0.504
#> GSM711982     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711951     4  0.0188      0.844 0.000 0.004 0.000 0.996
#> GSM711957     1  0.1118      0.956 0.964 0.000 0.000 0.036
#> GSM711959     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711965     4  0.0921      0.834 0.000 0.000 0.028 0.972
#> GSM711967     1  0.3266      0.776 0.832 0.000 0.000 0.168
#> GSM711969     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711973     4  0.3486      0.676 0.000 0.000 0.188 0.812
#> GSM711977     3  0.4304      0.598 0.000 0.000 0.716 0.284
#> GSM711981     4  0.0000      0.845 0.000 0.000 0.000 1.000
#> GSM711987     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711907     2  0.4040      0.647 0.000 0.752 0.000 0.248
#> GSM711909     3  0.0000      0.969 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000      0.969 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0000      0.969 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0000      0.845 0.000 0.000 0.000 1.000
#> GSM711925     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000      0.969 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711931     4  0.3172      0.735 0.000 0.160 0.000 0.840
#> GSM711933     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM711935     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0000      0.845 0.000 0.000 0.000 1.000
#> GSM711943     4  0.0000      0.845 0.000 0.000 0.000 1.000
#> GSM711945     4  0.0817      0.836 0.000 0.000 0.024 0.976
#> GSM711947     3  0.1940      0.898 0.000 0.076 0.924 0.000
#> GSM711949     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711955     4  0.5428      0.325 0.020 0.000 0.380 0.600
#> GSM711963     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0000      0.969 0.000 0.000 1.000 0.000
#> GSM711975     4  0.4661      0.444 0.000 0.348 0.000 0.652
#> GSM711979     4  0.0000      0.845 0.000 0.000 0.000 1.000
#> GSM711989     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711991     3  0.0000      0.969 0.000 0.000 1.000 0.000
#> GSM711993     4  0.0000      0.845 0.000 0.000 0.000 1.000
#> GSM711983     3  0.0000      0.969 0.000 0.000 1.000 0.000
#> GSM711985     2  0.0000      0.986 0.000 1.000 0.000 0.000
#> GSM711913     3  0.1118      0.942 0.000 0.000 0.964 0.036
#> GSM711919     3  0.0000      0.969 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000      0.969 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711938     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711950     4  0.4235     0.0628 0.000 0.000 0.000 0.576 0.424
#> GSM711956     1  0.3305     0.8156 0.776 0.000 0.000 0.000 0.224
#> GSM711958     1  0.3807     0.6523 0.748 0.000 0.240 0.000 0.012
#> GSM711960     3  0.0451     0.9787 0.008 0.000 0.988 0.000 0.004
#> GSM711964     1  0.0290     0.8749 0.992 0.000 0.000 0.000 0.008
#> GSM711966     1  0.0290     0.8740 0.992 0.000 0.000 0.000 0.008
#> GSM711968     1  0.3305     0.8156 0.776 0.000 0.000 0.000 0.224
#> GSM711972     1  0.0290     0.8740 0.992 0.000 0.000 0.000 0.008
#> GSM711976     1  0.5329     0.5941 0.656 0.000 0.000 0.236 0.108
#> GSM711980     1  0.3519     0.8160 0.776 0.000 0.000 0.008 0.216
#> GSM711986     1  0.0000     0.8744 1.000 0.000 0.000 0.000 0.000
#> GSM711904     1  0.3003     0.8286 0.812 0.000 0.000 0.000 0.188
#> GSM711906     1  0.0290     0.8740 0.992 0.000 0.000 0.000 0.008
#> GSM711908     1  0.0290     0.8740 0.992 0.000 0.000 0.000 0.008
#> GSM711910     3  0.0000     0.9927 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.0880     0.8734 0.968 0.000 0.000 0.000 0.032
#> GSM711916     1  0.0290     0.8740 0.992 0.000 0.000 0.000 0.008
#> GSM711922     1  0.4080     0.7903 0.728 0.000 0.000 0.020 0.252
#> GSM711924     1  0.3210     0.8380 0.860 0.000 0.008 0.040 0.092
#> GSM711926     4  0.2439     0.7011 0.000 0.004 0.000 0.876 0.120
#> GSM711928     1  0.1851     0.8630 0.912 0.000 0.000 0.000 0.088
#> GSM711930     1  0.0290     0.8740 0.992 0.000 0.000 0.000 0.008
#> GSM711932     4  0.4559     0.5833 0.152 0.000 0.000 0.748 0.100
#> GSM711934     1  0.3274     0.8171 0.780 0.000 0.000 0.000 0.220
#> GSM711940     4  0.2690     0.6795 0.156 0.000 0.000 0.844 0.000
#> GSM711942     1  0.2570     0.8489 0.888 0.000 0.000 0.028 0.084
#> GSM711944     3  0.0000     0.9927 0.000 0.000 1.000 0.000 0.000
#> GSM711946     4  0.3110     0.6996 0.000 0.000 0.060 0.860 0.080
#> GSM711948     4  0.3327     0.6910 0.028 0.000 0.000 0.828 0.144
#> GSM711952     1  0.0510     0.8750 0.984 0.000 0.000 0.000 0.016
#> GSM711954     1  0.4247     0.7849 0.776 0.000 0.000 0.132 0.092
#> GSM711962     1  0.0290     0.8740 0.992 0.000 0.000 0.000 0.008
#> GSM711970     1  0.5028     0.7477 0.668 0.000 0.000 0.072 0.260
#> GSM711974     1  0.0162     0.8741 0.996 0.000 0.000 0.000 0.004
#> GSM711978     4  0.0290     0.7543 0.000 0.000 0.000 0.992 0.008
#> GSM711988     1  0.1741     0.8663 0.936 0.000 0.000 0.040 0.024
#> GSM711990     3  0.0290     0.9856 0.000 0.000 0.992 0.000 0.008
#> GSM711992     4  0.2674     0.6927 0.140 0.000 0.000 0.856 0.004
#> GSM711982     1  0.0290     0.8740 0.992 0.000 0.000 0.000 0.008
#> GSM711984     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711912     1  0.0290     0.8749 0.992 0.000 0.000 0.000 0.008
#> GSM711918     1  0.0290     0.8751 0.992 0.000 0.000 0.000 0.008
#> GSM711920     1  0.4689     0.7627 0.688 0.000 0.000 0.048 0.264
#> GSM711937     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711951     4  0.2376     0.7276 0.000 0.052 0.000 0.904 0.044
#> GSM711957     1  0.6787     0.1900 0.380 0.000 0.000 0.332 0.288
#> GSM711959     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711965     5  0.4016     0.5890 0.000 0.000 0.012 0.272 0.716
#> GSM711967     1  0.4167     0.6610 0.724 0.000 0.000 0.252 0.024
#> GSM711969     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711973     5  0.4761     0.7118 0.000 0.000 0.104 0.168 0.728
#> GSM711977     5  0.4637     0.7413 0.000 0.000 0.196 0.076 0.728
#> GSM711981     4  0.3838     0.4978 0.000 0.004 0.000 0.716 0.280
#> GSM711987     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711907     2  0.3586     0.6160 0.000 0.736 0.000 0.264 0.000
#> GSM711909     3  0.0000     0.9927 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.0000     0.9927 0.000 0.000 1.000 0.000 0.000
#> GSM711915     5  0.4060     0.5178 0.000 0.000 0.360 0.000 0.640
#> GSM711917     2  0.0162     0.9665 0.000 0.996 0.000 0.004 0.000
#> GSM711923     4  0.0794     0.7525 0.000 0.000 0.000 0.972 0.028
#> GSM711925     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0000     0.9927 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711931     4  0.3132     0.6137 0.000 0.172 0.000 0.820 0.008
#> GSM711933     4  0.6712     0.3369 0.232 0.000 0.020 0.536 0.212
#> GSM711935     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.1341     0.7419 0.000 0.000 0.000 0.944 0.056
#> GSM711943     4  0.0798     0.7544 0.000 0.000 0.016 0.976 0.008
#> GSM711945     5  0.4632     0.2505 0.000 0.000 0.012 0.448 0.540
#> GSM711947     3  0.0963     0.9399 0.000 0.036 0.964 0.000 0.000
#> GSM711949     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711955     4  0.5973     0.1880 0.080 0.000 0.384 0.524 0.012
#> GSM711963     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0000     0.9927 0.000 0.000 1.000 0.000 0.000
#> GSM711975     2  0.3480     0.6573 0.000 0.752 0.000 0.248 0.000
#> GSM711979     4  0.0162     0.7546 0.000 0.000 0.000 0.996 0.004
#> GSM711989     2  0.0162     0.9665 0.000 0.996 0.000 0.004 0.000
#> GSM711991     3  0.0000     0.9927 0.000 0.000 1.000 0.000 0.000
#> GSM711993     4  0.0510     0.7549 0.000 0.000 0.000 0.984 0.016
#> GSM711983     3  0.0000     0.9927 0.000 0.000 1.000 0.000 0.000
#> GSM711985     2  0.0000     0.9695 0.000 1.000 0.000 0.000 0.000
#> GSM711913     5  0.4197     0.6986 0.000 0.000 0.244 0.028 0.728
#> GSM711919     3  0.0000     0.9927 0.000 0.000 1.000 0.000 0.000
#> GSM711921     3  0.0000     0.9927 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.0146     0.9621 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM711938     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711950     5  0.3961     0.2182 0.004 0.000 0.000 0.440 0.556 0.000
#> GSM711956     1  0.4167     0.5475 0.612 0.000 0.000 0.000 0.020 0.368
#> GSM711958     3  0.3450     0.6501 0.012 0.000 0.772 0.000 0.008 0.208
#> GSM711960     3  0.0000     0.9128 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711964     6  0.1176     0.8235 0.024 0.000 0.000 0.000 0.020 0.956
#> GSM711966     6  0.0146     0.8294 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM711968     1  0.3986     0.5920 0.664 0.000 0.000 0.000 0.020 0.316
#> GSM711972     6  0.0146     0.8294 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM711976     6  0.5509     0.0454 0.100 0.000 0.000 0.008 0.416 0.476
#> GSM711980     1  0.4415     0.4456 0.556 0.000 0.000 0.004 0.020 0.420
#> GSM711986     6  0.1257     0.8218 0.028 0.000 0.000 0.000 0.020 0.952
#> GSM711904     6  0.4322    -0.2166 0.452 0.000 0.000 0.000 0.020 0.528
#> GSM711906     6  0.0146     0.8294 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM711908     6  0.0146     0.8294 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM711910     3  0.0000     0.9128 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711914     6  0.1334     0.8198 0.032 0.000 0.000 0.000 0.020 0.948
#> GSM711916     6  0.0146     0.8294 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM711922     1  0.4105     0.5730 0.632 0.000 0.000 0.000 0.020 0.348
#> GSM711924     1  0.5023     0.2080 0.560 0.000 0.060 0.008 0.000 0.372
#> GSM711926     4  0.2149     0.8407 0.080 0.016 0.000 0.900 0.004 0.000
#> GSM711928     6  0.2581     0.7279 0.120 0.000 0.000 0.000 0.020 0.860
#> GSM711930     6  0.0291     0.8269 0.004 0.000 0.000 0.000 0.004 0.992
#> GSM711932     1  0.4315    -0.2751 0.524 0.000 0.000 0.460 0.008 0.008
#> GSM711934     1  0.4362     0.5079 0.584 0.000 0.000 0.004 0.020 0.392
#> GSM711940     4  0.0777     0.8875 0.004 0.000 0.000 0.972 0.000 0.024
#> GSM711942     6  0.3782     0.1328 0.412 0.000 0.000 0.000 0.000 0.588
#> GSM711944     3  0.1204     0.8784 0.056 0.000 0.944 0.000 0.000 0.000
#> GSM711946     4  0.0603     0.8953 0.000 0.000 0.004 0.980 0.016 0.000
#> GSM711948     4  0.3368     0.6152 0.012 0.000 0.000 0.756 0.232 0.000
#> GSM711952     6  0.1528     0.8128 0.048 0.000 0.000 0.000 0.016 0.936
#> GSM711954     6  0.5886     0.0803 0.160 0.000 0.000 0.292 0.016 0.532
#> GSM711962     6  0.0146     0.8294 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM711970     1  0.3534     0.6093 0.740 0.000 0.000 0.016 0.000 0.244
#> GSM711974     6  0.0363     0.8294 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711978     4  0.0000     0.9001 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711988     6  0.1974     0.8048 0.048 0.000 0.000 0.012 0.020 0.920
#> GSM711990     3  0.0146     0.9110 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM711992     4  0.0653     0.8959 0.012 0.004 0.000 0.980 0.000 0.004
#> GSM711982     6  0.0146     0.8294 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM711984     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711912     6  0.1088     0.8244 0.024 0.000 0.000 0.000 0.016 0.960
#> GSM711918     6  0.1074     0.8249 0.028 0.000 0.000 0.000 0.012 0.960
#> GSM711920     1  0.0837     0.4967 0.972 0.000 0.000 0.004 0.004 0.020
#> GSM711937     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711951     4  0.0520     0.8980 0.000 0.008 0.000 0.984 0.008 0.000
#> GSM711957     1  0.0520     0.4818 0.984 0.000 0.000 0.000 0.008 0.008
#> GSM711959     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711961     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711965     5  0.1245     0.8080 0.000 0.000 0.016 0.032 0.952 0.000
#> GSM711967     6  0.3166     0.6263 0.024 0.000 0.000 0.156 0.004 0.816
#> GSM711969     2  0.0146     0.9621 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM711973     5  0.0909     0.8110 0.000 0.000 0.020 0.012 0.968 0.000
#> GSM711977     5  0.0858     0.8110 0.000 0.000 0.028 0.004 0.968 0.000
#> GSM711981     4  0.3887     0.3261 0.008 0.000 0.000 0.632 0.360 0.000
#> GSM711987     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     2  0.3727     0.3313 0.000 0.612 0.000 0.388 0.000 0.000
#> GSM711909     3  0.0000     0.9128 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711911     3  0.0146     0.9115 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM711915     5  0.1327     0.7875 0.000 0.000 0.064 0.000 0.936 0.000
#> GSM711917     2  0.0146     0.9621 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM711923     4  0.0000     0.9001 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711925     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.0000     0.9128 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711929     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     4  0.3776     0.6329 0.052 0.188 0.000 0.760 0.000 0.000
#> GSM711933     3  0.5971     0.4475 0.152 0.000 0.564 0.256 0.004 0.024
#> GSM711935     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     4  0.0508     0.8982 0.004 0.000 0.000 0.984 0.012 0.000
#> GSM711943     4  0.0146     0.8998 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM711945     5  0.3782     0.3361 0.000 0.000 0.000 0.412 0.588 0.000
#> GSM711947     3  0.0405     0.9061 0.004 0.008 0.988 0.000 0.000 0.000
#> GSM711949     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     3  0.4495     0.3211 0.028 0.000 0.580 0.388 0.000 0.004
#> GSM711963     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.0000     0.9128 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711975     2  0.2941     0.7093 0.000 0.780 0.000 0.220 0.000 0.000
#> GSM711979     4  0.0363     0.8991 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM711989     2  0.0260     0.9591 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM711991     3  0.0146     0.9115 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM711993     4  0.0260     0.8994 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM711983     3  0.0000     0.9128 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711985     2  0.0146     0.9621 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM711913     5  0.0858     0.8110 0.000 0.000 0.028 0.004 0.968 0.000
#> GSM711919     3  0.0000     0.9128 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711921     3  0.0000     0.9128 0.000 0.000 1.000 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-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 tissue(p) disease.state(p) individual(p) k
#> CV:NMF 89  1.04e-05           0.1877         0.726 2
#> CV:NMF 89  3.41e-11           0.2443         0.695 3
#> CV:NMF 86  8.20e-08           0.1927         0.483 4
#> CV:NMF 84  4.64e-09           0.0432         0.307 5
#> CV:NMF 75  1.39e-06           0.1377         0.157 6

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


MAD:hclust*

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

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

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

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

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

collect_plots(res)

plot of chunk MAD-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.930           0.926       0.969         0.3676 0.626   0.626
#> 3 3 0.718           0.853       0.925         0.5958 0.792   0.668
#> 4 4 0.636           0.649       0.808         0.1517 0.921   0.812
#> 5 5 0.712           0.650       0.809         0.0828 0.880   0.660
#> 6 6 0.730           0.736       0.840         0.0503 0.917   0.690

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
#> GSM711936     2  0.1414      0.913 0.020 0.980
#> GSM711938     2  0.0000      0.923 0.000 1.000
#> GSM711950     1  0.0000      0.980 1.000 0.000
#> GSM711956     1  0.0000      0.980 1.000 0.000
#> GSM711958     1  0.0000      0.980 1.000 0.000
#> GSM711960     1  0.0000      0.980 1.000 0.000
#> GSM711964     1  0.0000      0.980 1.000 0.000
#> GSM711966     1  0.0000      0.980 1.000 0.000
#> GSM711968     1  0.0000      0.980 1.000 0.000
#> GSM711972     1  0.0000      0.980 1.000 0.000
#> GSM711976     1  0.0000      0.980 1.000 0.000
#> GSM711980     1  0.0000      0.980 1.000 0.000
#> GSM711986     1  0.0000      0.980 1.000 0.000
#> GSM711904     1  0.0000      0.980 1.000 0.000
#> GSM711906     1  0.0000      0.980 1.000 0.000
#> GSM711908     1  0.0000      0.980 1.000 0.000
#> GSM711910     1  0.0000      0.980 1.000 0.000
#> GSM711914     1  0.0000      0.980 1.000 0.000
#> GSM711916     1  0.0000      0.980 1.000 0.000
#> GSM711922     1  0.0000      0.980 1.000 0.000
#> GSM711924     1  0.0000      0.980 1.000 0.000
#> GSM711926     1  0.2423      0.944 0.960 0.040
#> GSM711928     1  0.0000      0.980 1.000 0.000
#> GSM711930     1  0.0000      0.980 1.000 0.000
#> GSM711932     1  0.0000      0.980 1.000 0.000
#> GSM711934     1  0.0000      0.980 1.000 0.000
#> GSM711940     1  0.0000      0.980 1.000 0.000
#> GSM711942     1  0.0000      0.980 1.000 0.000
#> GSM711944     1  0.0000      0.980 1.000 0.000
#> GSM711946     1  0.1633      0.960 0.976 0.024
#> GSM711948     1  0.0000      0.980 1.000 0.000
#> GSM711952     1  0.0000      0.980 1.000 0.000
#> GSM711954     1  0.0000      0.980 1.000 0.000
#> GSM711962     1  0.0000      0.980 1.000 0.000
#> GSM711970     1  0.0000      0.980 1.000 0.000
#> GSM711974     1  0.0000      0.980 1.000 0.000
#> GSM711978     1  0.0000      0.980 1.000 0.000
#> GSM711988     1  0.0000      0.980 1.000 0.000
#> GSM711990     1  0.0000      0.980 1.000 0.000
#> GSM711992     1  0.2043      0.952 0.968 0.032
#> GSM711982     1  0.0000      0.980 1.000 0.000
#> GSM711984     2  0.0000      0.923 0.000 1.000
#> GSM711912     1  0.0000      0.980 1.000 0.000
#> GSM711918     1  0.0000      0.980 1.000 0.000
#> GSM711920     1  0.0000      0.980 1.000 0.000
#> GSM711937     2  0.1414      0.913 0.020 0.980
#> GSM711939     2  0.0000      0.923 0.000 1.000
#> GSM711951     2  0.9775      0.360 0.412 0.588
#> GSM711957     1  0.0000      0.980 1.000 0.000
#> GSM711959     2  0.0000      0.923 0.000 1.000
#> GSM711961     2  0.0000      0.923 0.000 1.000
#> GSM711965     1  0.0000      0.980 1.000 0.000
#> GSM711967     1  0.0000      0.980 1.000 0.000
#> GSM711969     2  0.1414      0.913 0.020 0.980
#> GSM711973     1  0.0000      0.980 1.000 0.000
#> GSM711977     1  0.0000      0.980 1.000 0.000
#> GSM711981     1  0.4298      0.891 0.912 0.088
#> GSM711987     2  0.0000      0.923 0.000 1.000
#> GSM711905     2  0.0000      0.923 0.000 1.000
#> GSM711907     2  0.8016      0.678 0.244 0.756
#> GSM711909     1  0.0000      0.980 1.000 0.000
#> GSM711911     1  0.0000      0.980 1.000 0.000
#> GSM711915     1  0.0000      0.980 1.000 0.000
#> GSM711917     2  0.0000      0.923 0.000 1.000
#> GSM711923     1  0.0672      0.973 0.992 0.008
#> GSM711925     2  0.0000      0.923 0.000 1.000
#> GSM711927     1  0.0000      0.980 1.000 0.000
#> GSM711929     2  0.0000      0.923 0.000 1.000
#> GSM711931     1  0.9686      0.285 0.604 0.396
#> GSM711933     1  0.0000      0.980 1.000 0.000
#> GSM711935     2  0.0000      0.923 0.000 1.000
#> GSM711941     1  0.0000      0.980 1.000 0.000
#> GSM711943     1  0.0672      0.973 0.992 0.008
#> GSM711945     1  0.1633      0.960 0.976 0.024
#> GSM711947     1  0.7453      0.715 0.788 0.212
#> GSM711949     2  0.0000      0.923 0.000 1.000
#> GSM711953     2  0.0000      0.923 0.000 1.000
#> GSM711955     1  0.0000      0.980 1.000 0.000
#> GSM711963     2  0.0000      0.923 0.000 1.000
#> GSM711971     1  0.0000      0.980 1.000 0.000
#> GSM711975     2  0.9775      0.360 0.412 0.588
#> GSM711979     1  0.0000      0.980 1.000 0.000
#> GSM711989     2  0.9775      0.360 0.412 0.588
#> GSM711991     1  0.5737      0.830 0.864 0.136
#> GSM711993     1  0.8267      0.627 0.740 0.260
#> GSM711983     1  0.0000      0.980 1.000 0.000
#> GSM711985     2  0.0000      0.923 0.000 1.000
#> GSM711913     1  0.0000      0.980 1.000 0.000
#> GSM711919     1  0.0000      0.980 1.000 0.000
#> GSM711921     1  0.0000      0.980 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
#> GSM711936     2  0.0983      0.892 0.016 0.980 0.004
#> GSM711938     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711950     1  0.1860      0.907 0.948 0.000 0.052
#> GSM711956     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711958     1  0.1860      0.906 0.948 0.000 0.052
#> GSM711960     1  0.3686      0.857 0.860 0.000 0.140
#> GSM711964     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711966     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711968     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711972     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711976     1  0.1860      0.907 0.948 0.000 0.052
#> GSM711980     1  0.1860      0.907 0.948 0.000 0.052
#> GSM711986     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711904     1  0.0892      0.913 0.980 0.000 0.020
#> GSM711906     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711908     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711910     3  0.0237      0.923 0.004 0.000 0.996
#> GSM711914     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711916     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711922     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711924     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711926     1  0.5028      0.814 0.828 0.040 0.132
#> GSM711928     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711930     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711932     1  0.0237      0.915 0.996 0.000 0.004
#> GSM711934     1  0.1753      0.907 0.952 0.000 0.048
#> GSM711940     1  0.4504      0.806 0.804 0.000 0.196
#> GSM711942     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711944     3  0.2165      0.898 0.064 0.000 0.936
#> GSM711946     1  0.6180      0.710 0.716 0.024 0.260
#> GSM711948     1  0.1964      0.906 0.944 0.000 0.056
#> GSM711952     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711954     1  0.1860      0.907 0.948 0.000 0.052
#> GSM711962     1  0.0237      0.915 0.996 0.000 0.004
#> GSM711970     1  0.1411      0.911 0.964 0.000 0.036
#> GSM711974     1  0.1860      0.906 0.948 0.000 0.052
#> GSM711978     1  0.3412      0.851 0.876 0.000 0.124
#> GSM711988     1  0.1860      0.907 0.948 0.000 0.052
#> GSM711990     3  0.1643      0.913 0.044 0.000 0.956
#> GSM711992     1  0.4591      0.856 0.848 0.032 0.120
#> GSM711982     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711984     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711912     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711918     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711920     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711937     2  0.0983      0.892 0.016 0.980 0.004
#> GSM711939     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711951     2  0.8362      0.424 0.300 0.588 0.112
#> GSM711957     1  0.1289      0.909 0.968 0.000 0.032
#> GSM711959     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711961     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711965     1  0.4654      0.793 0.792 0.000 0.208
#> GSM711967     1  0.0237      0.915 0.996 0.000 0.004
#> GSM711969     2  0.0983      0.892 0.016 0.980 0.004
#> GSM711973     3  0.4002      0.801 0.160 0.000 0.840
#> GSM711977     3  0.0592      0.922 0.012 0.000 0.988
#> GSM711981     1  0.6079      0.766 0.784 0.088 0.128
#> GSM711987     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711905     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711907     2  0.6336      0.647 0.180 0.756 0.064
#> GSM711909     3  0.0237      0.923 0.004 0.000 0.996
#> GSM711911     3  0.0237      0.923 0.004 0.000 0.996
#> GSM711915     3  0.0237      0.923 0.004 0.000 0.996
#> GSM711917     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711923     1  0.5292      0.765 0.764 0.008 0.228
#> GSM711925     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711927     3  0.0237      0.923 0.004 0.000 0.996
#> GSM711929     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711931     1  0.8747      0.102 0.492 0.396 0.112
#> GSM711933     1  0.1860      0.907 0.948 0.000 0.052
#> GSM711935     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711941     1  0.4504      0.806 0.804 0.000 0.196
#> GSM711943     1  0.5247      0.770 0.768 0.008 0.224
#> GSM711945     1  0.6180      0.710 0.716 0.024 0.260
#> GSM711947     3  0.7762      0.585 0.120 0.212 0.668
#> GSM711949     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711955     1  0.1964      0.906 0.944 0.000 0.056
#> GSM711963     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711971     3  0.1643      0.913 0.044 0.000 0.956
#> GSM711975     2  0.8362      0.424 0.300 0.588 0.112
#> GSM711979     1  0.3412      0.851 0.876 0.000 0.124
#> GSM711989     2  0.8362      0.424 0.300 0.588 0.112
#> GSM711991     3  0.7739      0.620 0.188 0.136 0.676
#> GSM711993     1  0.8202      0.497 0.620 0.260 0.120
#> GSM711983     3  0.1643      0.913 0.044 0.000 0.956
#> GSM711985     2  0.0000      0.903 0.000 1.000 0.000
#> GSM711913     3  0.0592      0.922 0.012 0.000 0.988
#> GSM711919     3  0.0237      0.923 0.004 0.000 0.996
#> GSM711921     3  0.0237      0.923 0.004 0.000 0.996

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0779     0.8984 0.004 0.980 0.000 0.016
#> GSM711938     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711950     1  0.2197     0.7215 0.928 0.000 0.048 0.024
#> GSM711956     1  0.0592     0.7387 0.984 0.000 0.000 0.016
#> GSM711958     1  0.1938     0.7294 0.936 0.000 0.052 0.012
#> GSM711960     1  0.3377     0.6494 0.848 0.000 0.140 0.012
#> GSM711964     1  0.0592     0.7387 0.984 0.000 0.000 0.016
#> GSM711966     1  0.3975     0.6110 0.760 0.000 0.000 0.240
#> GSM711968     1  0.0592     0.7387 0.984 0.000 0.000 0.016
#> GSM711972     1  0.3907     0.6148 0.768 0.000 0.000 0.232
#> GSM711976     1  0.2089     0.7239 0.932 0.000 0.048 0.020
#> GSM711980     1  0.1975     0.7258 0.936 0.000 0.048 0.016
#> GSM711986     1  0.3801     0.6234 0.780 0.000 0.000 0.220
#> GSM711904     1  0.1520     0.7403 0.956 0.000 0.020 0.024
#> GSM711906     1  0.2469     0.6954 0.892 0.000 0.000 0.108
#> GSM711908     1  0.3975     0.6110 0.760 0.000 0.000 0.240
#> GSM711910     3  0.0000     0.9071 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0592     0.7387 0.984 0.000 0.000 0.016
#> GSM711916     1  0.3975     0.6110 0.760 0.000 0.000 0.240
#> GSM711922     1  0.0592     0.7387 0.984 0.000 0.000 0.016
#> GSM711924     1  0.0188     0.7393 0.996 0.000 0.000 0.004
#> GSM711926     4  0.7712     0.6909 0.348 0.040 0.100 0.512
#> GSM711928     1  0.0592     0.7387 0.984 0.000 0.000 0.016
#> GSM711930     1  0.3975     0.6110 0.760 0.000 0.000 0.240
#> GSM711932     1  0.1022     0.7294 0.968 0.000 0.000 0.032
#> GSM711934     1  0.1854     0.7276 0.940 0.000 0.048 0.012
#> GSM711940     1  0.7254    -0.2579 0.524 0.000 0.176 0.300
#> GSM711942     1  0.0188     0.7393 0.996 0.000 0.000 0.004
#> GSM711944     3  0.1716     0.8703 0.064 0.000 0.936 0.000
#> GSM711946     1  0.8232    -0.3832 0.464 0.024 0.232 0.280
#> GSM711948     1  0.3301     0.6759 0.876 0.000 0.048 0.076
#> GSM711952     1  0.3907     0.6148 0.768 0.000 0.000 0.232
#> GSM711954     1  0.2089     0.7242 0.932 0.000 0.048 0.020
#> GSM711962     1  0.0592     0.7394 0.984 0.000 0.000 0.016
#> GSM711970     1  0.1488     0.7337 0.956 0.000 0.032 0.012
#> GSM711974     1  0.1938     0.7294 0.936 0.000 0.052 0.012
#> GSM711978     4  0.6745     0.6054 0.428 0.000 0.092 0.480
#> GSM711988     1  0.2089     0.7239 0.932 0.000 0.048 0.020
#> GSM711990     3  0.1302     0.8893 0.044 0.000 0.956 0.000
#> GSM711992     1  0.7082     0.0746 0.612 0.032 0.092 0.264
#> GSM711982     1  0.3975     0.6110 0.760 0.000 0.000 0.240
#> GSM711984     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711912     1  0.3907     0.6148 0.768 0.000 0.000 0.232
#> GSM711918     1  0.3907     0.6148 0.768 0.000 0.000 0.232
#> GSM711920     1  0.0188     0.7393 0.996 0.000 0.000 0.004
#> GSM711937     2  0.0779     0.8984 0.004 0.980 0.000 0.016
#> GSM711939     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711951     2  0.7890     0.2256 0.108 0.588 0.084 0.220
#> GSM711957     4  0.4008     0.5915 0.244 0.000 0.000 0.756
#> GSM711959     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711965     1  0.7373    -0.3201 0.500 0.000 0.184 0.316
#> GSM711967     1  0.0336     0.7377 0.992 0.000 0.000 0.008
#> GSM711969     2  0.0779     0.8984 0.004 0.980 0.000 0.016
#> GSM711973     3  0.4163     0.7724 0.076 0.000 0.828 0.096
#> GSM711977     3  0.0336     0.9053 0.000 0.000 0.992 0.008
#> GSM711981     4  0.8297     0.7071 0.304 0.088 0.100 0.508
#> GSM711987     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711907     2  0.5837     0.6085 0.080 0.756 0.048 0.116
#> GSM711909     3  0.0000     0.9071 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000     0.9071 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0000     0.9071 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711923     1  0.7709    -0.3271 0.496 0.008 0.200 0.296
#> GSM711925     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000     0.9071 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711931     4  0.8626     0.2234 0.120 0.396 0.084 0.400
#> GSM711933     1  0.1975     0.7258 0.936 0.000 0.048 0.016
#> GSM711935     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711941     1  0.7254    -0.2579 0.524 0.000 0.176 0.300
#> GSM711943     1  0.7682    -0.3191 0.500 0.008 0.196 0.296
#> GSM711945     1  0.8232    -0.3832 0.464 0.024 0.232 0.280
#> GSM711947     3  0.7014     0.4008 0.108 0.212 0.644 0.036
#> GSM711949     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711955     1  0.3301     0.6759 0.876 0.000 0.048 0.076
#> GSM711963     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711971     3  0.1302     0.8893 0.044 0.000 0.956 0.000
#> GSM711975     2  0.7890     0.2256 0.108 0.588 0.084 0.220
#> GSM711979     4  0.6745     0.6054 0.428 0.000 0.092 0.480
#> GSM711989     2  0.7890     0.2256 0.108 0.588 0.084 0.220
#> GSM711991     3  0.7426     0.4122 0.128 0.136 0.648 0.088
#> GSM711993     4  0.9248     0.6026 0.248 0.260 0.092 0.400
#> GSM711983     3  0.1302     0.8893 0.044 0.000 0.956 0.000
#> GSM711985     2  0.0000     0.9094 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0336     0.9053 0.000 0.000 0.992 0.008
#> GSM711919     3  0.0000     0.9071 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000     0.9071 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.1205      0.890 0.000 0.956 0.000 0.040 0.004
#> GSM711938     2  0.0510      0.900 0.000 0.984 0.000 0.016 0.000
#> GSM711950     1  0.1960      0.738 0.928 0.000 0.048 0.020 0.004
#> GSM711956     1  0.0510      0.729 0.984 0.000 0.000 0.000 0.016
#> GSM711958     1  0.1717      0.743 0.936 0.000 0.052 0.008 0.004
#> GSM711960     1  0.2956      0.637 0.848 0.000 0.140 0.008 0.004
#> GSM711964     1  0.0510      0.729 0.984 0.000 0.000 0.000 0.016
#> GSM711966     5  0.4307      1.000 0.496 0.000 0.000 0.000 0.504
#> GSM711968     1  0.0703      0.723 0.976 0.000 0.000 0.000 0.024
#> GSM711972     1  0.4150     -0.667 0.612 0.000 0.000 0.000 0.388
#> GSM711976     1  0.1862      0.741 0.932 0.000 0.048 0.016 0.004
#> GSM711980     1  0.1757      0.743 0.936 0.000 0.048 0.012 0.004
#> GSM711986     1  0.4101     -0.609 0.628 0.000 0.000 0.000 0.372
#> GSM711904     1  0.1405      0.743 0.956 0.000 0.020 0.008 0.016
#> GSM711906     1  0.3242      0.199 0.784 0.000 0.000 0.000 0.216
#> GSM711908     5  0.4307      1.000 0.496 0.000 0.000 0.000 0.504
#> GSM711910     3  0.1041      0.876 0.000 0.000 0.964 0.004 0.032
#> GSM711914     1  0.0510      0.729 0.984 0.000 0.000 0.000 0.016
#> GSM711916     5  0.4307      1.000 0.496 0.000 0.000 0.000 0.504
#> GSM711922     1  0.0703      0.723 0.976 0.000 0.000 0.000 0.024
#> GSM711924     1  0.0162      0.739 0.996 0.000 0.000 0.000 0.004
#> GSM711926     4  0.3883      0.705 0.216 0.016 0.000 0.764 0.004
#> GSM711928     1  0.0510      0.729 0.984 0.000 0.000 0.000 0.016
#> GSM711930     5  0.4307      1.000 0.496 0.000 0.000 0.000 0.504
#> GSM711932     1  0.0955      0.735 0.968 0.000 0.000 0.028 0.004
#> GSM711934     1  0.1597      0.744 0.940 0.000 0.048 0.012 0.000
#> GSM711940     4  0.5908      0.664 0.404 0.000 0.080 0.508 0.008
#> GSM711942     1  0.0162      0.739 0.996 0.000 0.000 0.000 0.004
#> GSM711944     3  0.1478      0.855 0.064 0.000 0.936 0.000 0.000
#> GSM711946     4  0.6467      0.705 0.352 0.008 0.132 0.504 0.004
#> GSM711948     1  0.3126      0.679 0.868 0.000 0.048 0.076 0.008
#> GSM711952     1  0.4307     -0.985 0.504 0.000 0.000 0.000 0.496
#> GSM711954     1  0.2100      0.742 0.924 0.000 0.048 0.016 0.012
#> GSM711962     1  0.0771      0.735 0.976 0.000 0.000 0.004 0.020
#> GSM711970     1  0.1329      0.747 0.956 0.000 0.032 0.008 0.004
#> GSM711974     1  0.1717      0.743 0.936 0.000 0.052 0.008 0.004
#> GSM711978     4  0.3990      0.701 0.308 0.000 0.000 0.688 0.004
#> GSM711988     1  0.1862      0.741 0.932 0.000 0.048 0.016 0.004
#> GSM711990     3  0.1121      0.872 0.044 0.000 0.956 0.000 0.000
#> GSM711992     1  0.5628     -0.275 0.540 0.008 0.048 0.400 0.004
#> GSM711982     5  0.4307      1.000 0.496 0.000 0.000 0.000 0.504
#> GSM711984     2  0.0771      0.898 0.000 0.976 0.000 0.020 0.004
#> GSM711912     1  0.4307     -0.985 0.504 0.000 0.000 0.000 0.496
#> GSM711918     1  0.4307     -0.985 0.504 0.000 0.000 0.000 0.496
#> GSM711920     1  0.0162      0.739 0.996 0.000 0.000 0.000 0.004
#> GSM711937     2  0.1205      0.890 0.000 0.956 0.000 0.040 0.004
#> GSM711939     2  0.0510      0.900 0.000 0.984 0.000 0.016 0.000
#> GSM711951     2  0.4443      0.301 0.000 0.524 0.000 0.472 0.004
#> GSM711957     4  0.5510      0.275 0.072 0.000 0.000 0.548 0.380
#> GSM711959     2  0.0510      0.900 0.000 0.984 0.000 0.016 0.000
#> GSM711961     2  0.0162      0.900 0.000 0.996 0.000 0.000 0.004
#> GSM711965     4  0.5846      0.695 0.380 0.000 0.088 0.528 0.004
#> GSM711967     1  0.0451      0.741 0.988 0.000 0.000 0.004 0.008
#> GSM711969     2  0.1205      0.890 0.000 0.956 0.000 0.040 0.004
#> GSM711973     3  0.4547      0.758 0.076 0.000 0.792 0.088 0.044
#> GSM711977     3  0.1251      0.877 0.000 0.000 0.956 0.008 0.036
#> GSM711981     4  0.4114      0.674 0.176 0.044 0.000 0.776 0.004
#> GSM711987     2  0.0162      0.900 0.000 0.996 0.000 0.000 0.004
#> GSM711905     2  0.0162      0.900 0.000 0.996 0.000 0.000 0.004
#> GSM711907     2  0.4102      0.611 0.000 0.692 0.004 0.300 0.004
#> GSM711909     3  0.0000      0.885 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.0000      0.885 0.000 0.000 1.000 0.000 0.000
#> GSM711915     3  0.2286      0.841 0.000 0.000 0.888 0.004 0.108
#> GSM711917     2  0.0510      0.900 0.000 0.984 0.000 0.016 0.000
#> GSM711923     4  0.5958      0.703 0.372 0.004 0.100 0.524 0.000
#> GSM711925     2  0.0162      0.900 0.000 0.996 0.000 0.000 0.004
#> GSM711927     3  0.0000      0.885 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.0162      0.900 0.000 0.996 0.000 0.000 0.004
#> GSM711931     4  0.4253      0.092 0.004 0.332 0.000 0.660 0.004
#> GSM711933     1  0.1757      0.743 0.936 0.000 0.048 0.012 0.004
#> GSM711935     2  0.0162      0.900 0.000 0.996 0.000 0.000 0.004
#> GSM711941     4  0.5908      0.664 0.404 0.000 0.080 0.508 0.008
#> GSM711943     4  0.5924      0.701 0.376 0.004 0.096 0.524 0.000
#> GSM711945     4  0.6467      0.705 0.352 0.008 0.132 0.504 0.004
#> GSM711947     3  0.7425      0.288 0.000 0.148 0.472 0.304 0.076
#> GSM711949     2  0.0162      0.900 0.000 0.996 0.000 0.000 0.004
#> GSM711953     2  0.0162      0.900 0.000 0.996 0.000 0.000 0.004
#> GSM711955     1  0.3126      0.679 0.868 0.000 0.048 0.076 0.008
#> GSM711963     2  0.0162      0.900 0.000 0.996 0.000 0.000 0.004
#> GSM711971     3  0.1121      0.872 0.044 0.000 0.956 0.000 0.000
#> GSM711975     2  0.4443      0.301 0.000 0.524 0.000 0.472 0.004
#> GSM711979     4  0.3990      0.701 0.308 0.000 0.000 0.688 0.004
#> GSM711989     2  0.4443      0.301 0.000 0.524 0.000 0.472 0.004
#> GSM711991     3  0.7292      0.272 0.016 0.072 0.472 0.364 0.076
#> GSM711993     4  0.5457      0.494 0.132 0.196 0.000 0.668 0.004
#> GSM711983     3  0.1121      0.872 0.044 0.000 0.956 0.000 0.000
#> GSM711985     2  0.0510      0.900 0.000 0.984 0.000 0.016 0.000
#> GSM711913     3  0.1251      0.877 0.000 0.000 0.956 0.008 0.036
#> GSM711919     3  0.0000      0.885 0.000 0.000 1.000 0.000 0.000
#> GSM711921     3  0.1041      0.876 0.000 0.000 0.964 0.004 0.032

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.1398    0.92141 0.000 0.940 0.000 0.052 0.000 0.008
#> GSM711938     2  0.0547    0.94242 0.000 0.980 0.000 0.020 0.000 0.000
#> GSM711950     1  0.0405    0.88311 0.988 0.000 0.004 0.008 0.000 0.000
#> GSM711956     1  0.1714    0.88124 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM711958     1  0.0717    0.88946 0.976 0.000 0.008 0.000 0.000 0.016
#> GSM711960     1  0.1970    0.80135 0.900 0.000 0.092 0.000 0.000 0.008
#> GSM711964     1  0.1714    0.88124 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM711966     6  0.2003    0.92740 0.116 0.000 0.000 0.000 0.000 0.884
#> GSM711968     1  0.1863    0.87490 0.896 0.000 0.000 0.000 0.000 0.104
#> GSM711972     6  0.3126    0.77550 0.248 0.000 0.000 0.000 0.000 0.752
#> GSM711976     1  0.0291    0.88444 0.992 0.000 0.004 0.004 0.000 0.000
#> GSM711980     1  0.0146    0.88622 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM711986     6  0.3244    0.73792 0.268 0.000 0.000 0.000 0.000 0.732
#> GSM711904     1  0.1531    0.89068 0.928 0.000 0.004 0.000 0.000 0.068
#> GSM711906     1  0.3860   -0.03783 0.528 0.000 0.000 0.000 0.000 0.472
#> GSM711908     6  0.1863    0.92304 0.104 0.000 0.000 0.000 0.000 0.896
#> GSM711910     3  0.2452    0.84577 0.000 0.000 0.892 0.044 0.056 0.008
#> GSM711914     1  0.1714    0.88124 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM711916     6  0.2003    0.92740 0.116 0.000 0.000 0.000 0.000 0.884
#> GSM711922     1  0.1863    0.87490 0.896 0.000 0.000 0.000 0.000 0.104
#> GSM711924     1  0.1444    0.89054 0.928 0.000 0.000 0.000 0.000 0.072
#> GSM711926     4  0.2902    0.43499 0.196 0.000 0.000 0.800 0.000 0.004
#> GSM711928     1  0.1714    0.88124 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM711930     6  0.1863    0.92304 0.104 0.000 0.000 0.000 0.000 0.896
#> GSM711932     1  0.1845    0.88626 0.920 0.000 0.000 0.028 0.000 0.052
#> GSM711934     1  0.0405    0.88844 0.988 0.000 0.004 0.000 0.000 0.008
#> GSM711940     4  0.4808    0.45951 0.444 0.000 0.036 0.512 0.000 0.008
#> GSM711942     1  0.1444    0.89054 0.928 0.000 0.000 0.000 0.000 0.072
#> GSM711944     3  0.1471    0.86555 0.064 0.000 0.932 0.000 0.000 0.004
#> GSM711946     4  0.5589    0.52847 0.392 0.004 0.088 0.504 0.000 0.012
#> GSM711948     1  0.1674    0.82115 0.924 0.000 0.004 0.068 0.000 0.004
#> GSM711952     6  0.2048    0.92760 0.120 0.000 0.000 0.000 0.000 0.880
#> GSM711954     1  0.0862    0.88644 0.972 0.000 0.004 0.008 0.000 0.016
#> GSM711962     1  0.1663    0.88104 0.912 0.000 0.000 0.000 0.000 0.088
#> GSM711970     1  0.0922    0.89294 0.968 0.000 0.004 0.004 0.000 0.024
#> GSM711974     1  0.0717    0.88946 0.976 0.000 0.008 0.000 0.000 0.016
#> GSM711978     4  0.3489    0.45283 0.288 0.000 0.000 0.708 0.000 0.004
#> GSM711988     1  0.0291    0.88444 0.992 0.000 0.004 0.004 0.000 0.000
#> GSM711990     3  0.1152    0.88473 0.044 0.000 0.952 0.000 0.000 0.004
#> GSM711992     1  0.4063   -0.06977 0.572 0.000 0.004 0.420 0.000 0.004
#> GSM711982     6  0.2003    0.92740 0.116 0.000 0.000 0.000 0.000 0.884
#> GSM711984     2  0.0972    0.93570 0.000 0.964 0.000 0.028 0.000 0.008
#> GSM711912     6  0.2048    0.92760 0.120 0.000 0.000 0.000 0.000 0.880
#> GSM711918     6  0.2048    0.92760 0.120 0.000 0.000 0.000 0.000 0.880
#> GSM711920     1  0.1444    0.89054 0.928 0.000 0.000 0.000 0.000 0.072
#> GSM711937     2  0.1398    0.92141 0.000 0.940 0.000 0.052 0.000 0.008
#> GSM711939     2  0.0547    0.94242 0.000 0.980 0.000 0.020 0.000 0.000
#> GSM711951     4  0.4093    0.00081 0.000 0.476 0.000 0.516 0.000 0.008
#> GSM711957     5  0.3161    0.00000 0.008 0.000 0.000 0.216 0.776 0.000
#> GSM711959     2  0.0632    0.94154 0.000 0.976 0.000 0.024 0.000 0.000
#> GSM711961     2  0.0632    0.94320 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711965     4  0.4893    0.49639 0.416 0.000 0.044 0.532 0.000 0.008
#> GSM711967     1  0.1531    0.88950 0.928 0.000 0.000 0.004 0.000 0.068
#> GSM711969     2  0.1398    0.92141 0.000 0.940 0.000 0.052 0.000 0.008
#> GSM711973     3  0.5093    0.71765 0.084 0.000 0.728 0.128 0.028 0.032
#> GSM711977     3  0.2886    0.84242 0.000 0.000 0.872 0.060 0.028 0.040
#> GSM711981     4  0.2810    0.39693 0.156 0.008 0.000 0.832 0.000 0.004
#> GSM711987     2  0.0632    0.94320 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711905     2  0.0632    0.94320 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711907     2  0.3955    0.44434 0.000 0.648 0.000 0.340 0.004 0.008
#> GSM711909     3  0.0000    0.89230 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711911     3  0.0000    0.89230 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711915     3  0.5189    0.66506 0.000 0.000 0.676 0.072 0.200 0.052
#> GSM711917     2  0.0632    0.94154 0.000 0.976 0.000 0.024 0.000 0.000
#> GSM711923     4  0.5065    0.51581 0.404 0.004 0.056 0.532 0.000 0.004
#> GSM711925     2  0.0632    0.94320 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711927     3  0.0000    0.89230 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711929     2  0.0632    0.94320 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711931     4  0.3713    0.16052 0.004 0.284 0.000 0.704 0.000 0.008
#> GSM711933     1  0.0291    0.88552 0.992 0.000 0.004 0.004 0.000 0.000
#> GSM711935     2  0.0632    0.94320 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711941     4  0.4808    0.45951 0.444 0.000 0.036 0.512 0.000 0.008
#> GSM711943     4  0.5020    0.51147 0.408 0.004 0.052 0.532 0.000 0.004
#> GSM711945     4  0.5589    0.52847 0.392 0.004 0.088 0.504 0.000 0.012
#> GSM711947     4  0.7595   -0.15026 0.000 0.100 0.252 0.424 0.196 0.028
#> GSM711949     2  0.0632    0.94320 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711953     2  0.0632    0.94320 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711955     1  0.1674    0.82115 0.924 0.000 0.004 0.068 0.000 0.004
#> GSM711963     2  0.0632    0.94320 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711971     3  0.1152    0.88473 0.044 0.000 0.952 0.000 0.000 0.004
#> GSM711975     4  0.4093    0.00081 0.000 0.476 0.000 0.516 0.000 0.008
#> GSM711979     4  0.3489    0.45283 0.288 0.000 0.000 0.708 0.000 0.004
#> GSM711989     4  0.4093    0.00081 0.000 0.476 0.000 0.516 0.000 0.008
#> GSM711991     4  0.6844   -0.13696 0.004 0.024 0.252 0.496 0.196 0.028
#> GSM711993     4  0.4635    0.32434 0.132 0.148 0.000 0.712 0.000 0.008
#> GSM711983     3  0.1152    0.88473 0.044 0.000 0.952 0.000 0.000 0.004
#> GSM711985     2  0.0632    0.94154 0.000 0.976 0.000 0.024 0.000 0.000
#> GSM711913     3  0.2886    0.84242 0.000 0.000 0.872 0.060 0.028 0.040
#> GSM711919     3  0.0000    0.89230 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711921     3  0.2452    0.84577 0.000 0.000 0.892 0.044 0.056 0.008

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

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-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 tissue(p) disease.state(p) individual(p) k
#> MAD:hclust 86  8.01e-04            0.195         0.306 2
#> MAD:hclust 85  2.23e-07            0.121         0.486 3
#> MAD:hclust 76  1.23e-08            0.291         0.357 4
#> MAD:hclust 75  5.45e-07            0.126         0.279 5
#> MAD:hclust 72  8.66e-08            0.151         0.558 6

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


MAD:kmeans*

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 27425 rows and 90 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 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 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 1.000           0.966       0.987         0.4001 0.604   0.604
#> 3 3 0.965           0.924       0.970         0.6017 0.725   0.554
#> 4 4 0.916           0.870       0.945         0.1410 0.849   0.608
#> 5 5 0.732           0.695       0.757         0.0658 0.935   0.788
#> 6 6 0.707           0.613       0.760         0.0438 0.910   0.685

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

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

There is also optional best \(k\) = 2 3 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
#> GSM711936     2   0.000      0.983 0.000 1.000
#> GSM711938     2   0.000      0.983 0.000 1.000
#> GSM711950     1   0.000      0.987 1.000 0.000
#> GSM711956     1   0.000      0.987 1.000 0.000
#> GSM711958     1   0.000      0.987 1.000 0.000
#> GSM711960     1   0.000      0.987 1.000 0.000
#> GSM711964     1   0.000      0.987 1.000 0.000
#> GSM711966     1   0.000      0.987 1.000 0.000
#> GSM711968     1   0.000      0.987 1.000 0.000
#> GSM711972     1   0.000      0.987 1.000 0.000
#> GSM711976     1   0.000      0.987 1.000 0.000
#> GSM711980     1   0.000      0.987 1.000 0.000
#> GSM711986     1   0.000      0.987 1.000 0.000
#> GSM711904     1   0.000      0.987 1.000 0.000
#> GSM711906     1   0.000      0.987 1.000 0.000
#> GSM711908     1   0.000      0.987 1.000 0.000
#> GSM711910     1   0.000      0.987 1.000 0.000
#> GSM711914     1   0.000      0.987 1.000 0.000
#> GSM711916     1   0.000      0.987 1.000 0.000
#> GSM711922     1   0.000      0.987 1.000 0.000
#> GSM711924     1   0.000      0.987 1.000 0.000
#> GSM711926     1   0.814      0.661 0.748 0.252
#> GSM711928     1   0.000      0.987 1.000 0.000
#> GSM711930     1   0.000      0.987 1.000 0.000
#> GSM711932     1   0.000      0.987 1.000 0.000
#> GSM711934     1   0.000      0.987 1.000 0.000
#> GSM711940     1   0.000      0.987 1.000 0.000
#> GSM711942     1   0.000      0.987 1.000 0.000
#> GSM711944     1   0.000      0.987 1.000 0.000
#> GSM711946     1   0.000      0.987 1.000 0.000
#> GSM711948     1   0.000      0.987 1.000 0.000
#> GSM711952     1   0.000      0.987 1.000 0.000
#> GSM711954     1   0.000      0.987 1.000 0.000
#> GSM711962     1   0.000      0.987 1.000 0.000
#> GSM711970     1   0.000      0.987 1.000 0.000
#> GSM711974     1   0.000      0.987 1.000 0.000
#> GSM711978     1   0.000      0.987 1.000 0.000
#> GSM711988     1   0.000      0.987 1.000 0.000
#> GSM711990     1   0.000      0.987 1.000 0.000
#> GSM711992     1   0.000      0.987 1.000 0.000
#> GSM711982     1   0.000      0.987 1.000 0.000
#> GSM711984     2   0.000      0.983 0.000 1.000
#> GSM711912     1   0.000      0.987 1.000 0.000
#> GSM711918     1   0.000      0.987 1.000 0.000
#> GSM711920     1   0.000      0.987 1.000 0.000
#> GSM711937     2   0.000      0.983 0.000 1.000
#> GSM711939     2   0.000      0.983 0.000 1.000
#> GSM711951     2   0.000      0.983 0.000 1.000
#> GSM711957     1   0.000      0.987 1.000 0.000
#> GSM711959     2   0.000      0.983 0.000 1.000
#> GSM711961     2   0.000      0.983 0.000 1.000
#> GSM711965     1   0.000      0.987 1.000 0.000
#> GSM711967     1   0.000      0.987 1.000 0.000
#> GSM711969     2   0.000      0.983 0.000 1.000
#> GSM711973     1   0.000      0.987 1.000 0.000
#> GSM711977     1   0.000      0.987 1.000 0.000
#> GSM711981     1   0.529      0.858 0.880 0.120
#> GSM711987     2   0.000      0.983 0.000 1.000
#> GSM711905     2   0.000      0.983 0.000 1.000
#> GSM711907     2   0.000      0.983 0.000 1.000
#> GSM711909     1   0.000      0.987 1.000 0.000
#> GSM711911     1   0.000      0.987 1.000 0.000
#> GSM711915     1   0.000      0.987 1.000 0.000
#> GSM711917     2   0.000      0.983 0.000 1.000
#> GSM711923     1   0.000      0.987 1.000 0.000
#> GSM711925     2   0.000      0.983 0.000 1.000
#> GSM711927     1   0.000      0.987 1.000 0.000
#> GSM711929     2   0.000      0.983 0.000 1.000
#> GSM711931     2   0.000      0.983 0.000 1.000
#> GSM711933     1   0.000      0.987 1.000 0.000
#> GSM711935     2   0.000      0.983 0.000 1.000
#> GSM711941     1   0.000      0.987 1.000 0.000
#> GSM711943     1   0.000      0.987 1.000 0.000
#> GSM711945     1   0.141      0.969 0.980 0.020
#> GSM711947     2   0.955      0.376 0.376 0.624
#> GSM711949     2   0.000      0.983 0.000 1.000
#> GSM711953     2   0.000      0.983 0.000 1.000
#> GSM711955     1   0.000      0.987 1.000 0.000
#> GSM711963     2   0.000      0.983 0.000 1.000
#> GSM711971     1   0.000      0.987 1.000 0.000
#> GSM711975     2   0.000      0.983 0.000 1.000
#> GSM711979     1   0.000      0.987 1.000 0.000
#> GSM711989     2   0.000      0.983 0.000 1.000
#> GSM711991     1   0.141      0.969 0.980 0.020
#> GSM711993     1   0.975      0.308 0.592 0.408
#> GSM711983     1   0.000      0.987 1.000 0.000
#> GSM711985     2   0.000      0.983 0.000 1.000
#> GSM711913     1   0.000      0.987 1.000 0.000
#> GSM711919     1   0.000      0.987 1.000 0.000
#> GSM711921     1   0.000      0.987 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
#> GSM711936     2   0.000      0.977 0.000 1.000 0.000
#> GSM711938     2   0.000      0.977 0.000 1.000 0.000
#> GSM711950     1   0.000      0.982 1.000 0.000 0.000
#> GSM711956     1   0.000      0.982 1.000 0.000 0.000
#> GSM711958     1   0.000      0.982 1.000 0.000 0.000
#> GSM711960     3   0.622      0.308 0.432 0.000 0.568
#> GSM711964     1   0.000      0.982 1.000 0.000 0.000
#> GSM711966     1   0.000      0.982 1.000 0.000 0.000
#> GSM711968     1   0.000      0.982 1.000 0.000 0.000
#> GSM711972     1   0.000      0.982 1.000 0.000 0.000
#> GSM711976     1   0.000      0.982 1.000 0.000 0.000
#> GSM711980     1   0.000      0.982 1.000 0.000 0.000
#> GSM711986     1   0.000      0.982 1.000 0.000 0.000
#> GSM711904     1   0.000      0.982 1.000 0.000 0.000
#> GSM711906     1   0.000      0.982 1.000 0.000 0.000
#> GSM711908     1   0.000      0.982 1.000 0.000 0.000
#> GSM711910     3   0.000      0.921 0.000 0.000 1.000
#> GSM711914     1   0.000      0.982 1.000 0.000 0.000
#> GSM711916     1   0.000      0.982 1.000 0.000 0.000
#> GSM711922     1   0.000      0.982 1.000 0.000 0.000
#> GSM711924     1   0.000      0.982 1.000 0.000 0.000
#> GSM711926     1   0.502      0.667 0.760 0.240 0.000
#> GSM711928     1   0.000      0.982 1.000 0.000 0.000
#> GSM711930     1   0.000      0.982 1.000 0.000 0.000
#> GSM711932     1   0.000      0.982 1.000 0.000 0.000
#> GSM711934     1   0.000      0.982 1.000 0.000 0.000
#> GSM711940     1   0.000      0.982 1.000 0.000 0.000
#> GSM711942     1   0.000      0.982 1.000 0.000 0.000
#> GSM711944     3   0.000      0.921 0.000 0.000 1.000
#> GSM711946     3   0.000      0.921 0.000 0.000 1.000
#> GSM711948     1   0.000      0.982 1.000 0.000 0.000
#> GSM711952     1   0.000      0.982 1.000 0.000 0.000
#> GSM711954     1   0.000      0.982 1.000 0.000 0.000
#> GSM711962     1   0.000      0.982 1.000 0.000 0.000
#> GSM711970     1   0.000      0.982 1.000 0.000 0.000
#> GSM711974     1   0.000      0.982 1.000 0.000 0.000
#> GSM711978     1   0.000      0.982 1.000 0.000 0.000
#> GSM711988     1   0.000      0.982 1.000 0.000 0.000
#> GSM711990     3   0.000      0.921 0.000 0.000 1.000
#> GSM711992     1   0.000      0.982 1.000 0.000 0.000
#> GSM711982     1   0.000      0.982 1.000 0.000 0.000
#> GSM711984     2   0.000      0.977 0.000 1.000 0.000
#> GSM711912     1   0.000      0.982 1.000 0.000 0.000
#> GSM711918     1   0.000      0.982 1.000 0.000 0.000
#> GSM711920     1   0.000      0.982 1.000 0.000 0.000
#> GSM711937     2   0.000      0.977 0.000 1.000 0.000
#> GSM711939     2   0.000      0.977 0.000 1.000 0.000
#> GSM711951     2   0.000      0.977 0.000 1.000 0.000
#> GSM711957     1   0.000      0.982 1.000 0.000 0.000
#> GSM711959     2   0.000      0.977 0.000 1.000 0.000
#> GSM711961     2   0.000      0.977 0.000 1.000 0.000
#> GSM711965     3   0.000      0.921 0.000 0.000 1.000
#> GSM711967     1   0.000      0.982 1.000 0.000 0.000
#> GSM711969     2   0.000      0.977 0.000 1.000 0.000
#> GSM711973     3   0.493      0.708 0.232 0.000 0.768
#> GSM711977     3   0.000      0.921 0.000 0.000 1.000
#> GSM711981     3   0.888      0.511 0.212 0.212 0.576
#> GSM711987     2   0.000      0.977 0.000 1.000 0.000
#> GSM711905     2   0.000      0.977 0.000 1.000 0.000
#> GSM711907     2   0.000      0.977 0.000 1.000 0.000
#> GSM711909     3   0.000      0.921 0.000 0.000 1.000
#> GSM711911     3   0.000      0.921 0.000 0.000 1.000
#> GSM711915     3   0.000      0.921 0.000 0.000 1.000
#> GSM711917     2   0.000      0.977 0.000 1.000 0.000
#> GSM711923     3   0.196      0.883 0.056 0.000 0.944
#> GSM711925     2   0.000      0.977 0.000 1.000 0.000
#> GSM711927     3   0.000      0.921 0.000 0.000 1.000
#> GSM711929     2   0.000      0.977 0.000 1.000 0.000
#> GSM711931     2   0.000      0.977 0.000 1.000 0.000
#> GSM711933     1   0.000      0.982 1.000 0.000 0.000
#> GSM711935     2   0.000      0.977 0.000 1.000 0.000
#> GSM711941     1   0.620      0.179 0.576 0.000 0.424
#> GSM711943     3   0.263      0.861 0.084 0.000 0.916
#> GSM711945     3   0.000      0.921 0.000 0.000 1.000
#> GSM711947     3   0.103      0.903 0.000 0.024 0.976
#> GSM711949     2   0.000      0.977 0.000 1.000 0.000
#> GSM711953     2   0.000      0.977 0.000 1.000 0.000
#> GSM711955     3   0.608      0.429 0.388 0.000 0.612
#> GSM711963     2   0.000      0.977 0.000 1.000 0.000
#> GSM711971     3   0.000      0.921 0.000 0.000 1.000
#> GSM711975     2   0.000      0.977 0.000 1.000 0.000
#> GSM711979     1   0.000      0.982 1.000 0.000 0.000
#> GSM711989     2   0.000      0.977 0.000 1.000 0.000
#> GSM711991     3   0.000      0.921 0.000 0.000 1.000
#> GSM711993     2   0.619      0.258 0.420 0.580 0.000
#> GSM711983     3   0.000      0.921 0.000 0.000 1.000
#> GSM711985     2   0.000      0.977 0.000 1.000 0.000
#> GSM711913     3   0.000      0.921 0.000 0.000 1.000
#> GSM711919     3   0.000      0.921 0.000 0.000 1.000
#> GSM711921     3   0.000      0.921 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711950     4  0.1302      0.840 0.044 0.000 0.000 0.956
#> GSM711956     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> GSM711958     1  0.1022      0.945 0.968 0.000 0.000 0.032
#> GSM711960     1  0.2521      0.894 0.912 0.000 0.064 0.024
#> GSM711964     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711968     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711972     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711976     4  0.4994      0.119 0.480 0.000 0.000 0.520
#> GSM711980     1  0.0921      0.945 0.972 0.000 0.000 0.028
#> GSM711986     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711904     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711906     1  0.0336      0.951 0.992 0.000 0.000 0.008
#> GSM711908     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711910     3  0.0000      0.939 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711922     1  0.1022      0.944 0.968 0.000 0.000 0.032
#> GSM711924     1  0.1022      0.945 0.968 0.000 0.000 0.032
#> GSM711926     4  0.0188      0.857 0.004 0.000 0.000 0.996
#> GSM711928     1  0.0000      0.951 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711932     1  0.4888      0.244 0.588 0.000 0.000 0.412
#> GSM711934     1  0.1022      0.945 0.968 0.000 0.000 0.032
#> GSM711940     1  0.4843      0.294 0.604 0.000 0.000 0.396
#> GSM711942     1  0.1118      0.944 0.964 0.000 0.000 0.036
#> GSM711944     3  0.0817      0.918 0.000 0.000 0.976 0.024
#> GSM711946     4  0.1211      0.834 0.000 0.000 0.040 0.960
#> GSM711948     4  0.3726      0.700 0.212 0.000 0.000 0.788
#> GSM711952     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711954     1  0.1022      0.944 0.968 0.000 0.000 0.032
#> GSM711962     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711970     1  0.1022      0.944 0.968 0.000 0.000 0.032
#> GSM711974     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711978     4  0.0188      0.857 0.004 0.000 0.000 0.996
#> GSM711988     1  0.3528      0.745 0.808 0.000 0.000 0.192
#> GSM711990     3  0.0000      0.939 0.000 0.000 1.000 0.000
#> GSM711992     4  0.0188      0.857 0.004 0.000 0.000 0.996
#> GSM711982     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711984     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711918     1  0.0188      0.951 0.996 0.000 0.000 0.004
#> GSM711920     1  0.1118      0.944 0.964 0.000 0.000 0.036
#> GSM711937     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711951     4  0.1118      0.830 0.000 0.036 0.000 0.964
#> GSM711957     4  0.4888      0.321 0.412 0.000 0.000 0.588
#> GSM711959     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711965     3  0.4981      0.198 0.000 0.000 0.536 0.464
#> GSM711967     1  0.1211      0.942 0.960 0.000 0.000 0.040
#> GSM711969     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711973     4  0.3205      0.780 0.024 0.000 0.104 0.872
#> GSM711977     3  0.0000      0.939 0.000 0.000 1.000 0.000
#> GSM711981     4  0.0188      0.857 0.004 0.000 0.000 0.996
#> GSM711987     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711907     2  0.1940      0.908 0.000 0.924 0.000 0.076
#> GSM711909     3  0.0000      0.939 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000      0.939 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0000      0.939 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0188      0.856 0.000 0.000 0.004 0.996
#> GSM711925     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000      0.939 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711931     2  0.4804      0.428 0.000 0.616 0.000 0.384
#> GSM711933     1  0.1022      0.945 0.968 0.000 0.000 0.032
#> GSM711935     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0188      0.856 0.004 0.000 0.000 0.996
#> GSM711943     4  0.0000      0.857 0.000 0.000 0.000 1.000
#> GSM711945     4  0.1637      0.814 0.000 0.000 0.060 0.940
#> GSM711947     3  0.4621      0.770 0.000 0.128 0.796 0.076
#> GSM711949     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711955     4  0.6367      0.318 0.392 0.000 0.068 0.540
#> GSM711963     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0000      0.939 0.000 0.000 1.000 0.000
#> GSM711975     2  0.3266      0.808 0.000 0.832 0.000 0.168
#> GSM711979     4  0.0000      0.857 0.000 0.000 0.000 1.000
#> GSM711989     2  0.0921      0.948 0.000 0.972 0.000 0.028
#> GSM711991     3  0.3688      0.747 0.000 0.000 0.792 0.208
#> GSM711993     4  0.0188      0.856 0.000 0.004 0.000 0.996
#> GSM711983     3  0.0000      0.939 0.000 0.000 1.000 0.000
#> GSM711985     2  0.0000      0.968 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0000      0.939 0.000 0.000 1.000 0.000
#> GSM711919     3  0.0000      0.939 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000      0.939 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4 p5
#> GSM711936     2  0.4552    0.77464 0.000 0.696 0.000 0.040 NA
#> GSM711938     2  0.0000    0.87528 0.000 1.000 0.000 0.000 NA
#> GSM711950     4  0.5275    0.52041 0.276 0.000 0.000 0.640 NA
#> GSM711956     1  0.1121    0.73401 0.956 0.000 0.000 0.000 NA
#> GSM711958     1  0.1792    0.72694 0.916 0.000 0.000 0.000 NA
#> GSM711960     1  0.4351    0.64977 0.784 0.000 0.104 0.008 NA
#> GSM711964     1  0.4088    0.68107 0.632 0.000 0.000 0.000 NA
#> GSM711966     1  0.4294    0.65131 0.532 0.000 0.000 0.000 NA
#> GSM711968     1  0.2648    0.73125 0.848 0.000 0.000 0.000 NA
#> GSM711972     1  0.4291    0.64995 0.536 0.000 0.000 0.000 NA
#> GSM711976     1  0.4527    0.41150 0.700 0.000 0.000 0.260 NA
#> GSM711980     1  0.0404    0.72420 0.988 0.000 0.000 0.000 NA
#> GSM711986     1  0.4273    0.64896 0.552 0.000 0.000 0.000 NA
#> GSM711904     1  0.2813    0.72725 0.832 0.000 0.000 0.000 NA
#> GSM711906     1  0.4294    0.64766 0.532 0.000 0.000 0.000 NA
#> GSM711908     1  0.4287    0.64602 0.540 0.000 0.000 0.000 NA
#> GSM711910     3  0.0000    0.87440 0.000 0.000 1.000 0.000 NA
#> GSM711914     1  0.3895    0.69502 0.680 0.000 0.000 0.000 NA
#> GSM711916     1  0.4294    0.65131 0.532 0.000 0.000 0.000 NA
#> GSM711922     1  0.0162    0.72576 0.996 0.000 0.000 0.000 NA
#> GSM711924     1  0.1671    0.72999 0.924 0.000 0.000 0.000 NA
#> GSM711926     4  0.2233    0.75692 0.004 0.000 0.000 0.892 NA
#> GSM711928     1  0.2471    0.73175 0.864 0.000 0.000 0.000 NA
#> GSM711930     1  0.4297    0.64827 0.528 0.000 0.000 0.000 NA
#> GSM711932     1  0.4240    0.49124 0.736 0.000 0.000 0.228 NA
#> GSM711934     1  0.0963    0.72396 0.964 0.000 0.000 0.000 NA
#> GSM711940     1  0.5405    0.24343 0.596 0.000 0.000 0.328 NA
#> GSM711942     1  0.1478    0.73202 0.936 0.000 0.000 0.000 NA
#> GSM711944     3  0.7078    0.28377 0.340 0.000 0.484 0.064 NA
#> GSM711946     4  0.2871    0.75893 0.004 0.000 0.032 0.876 NA
#> GSM711948     1  0.5876   -0.09676 0.488 0.000 0.000 0.412 NA
#> GSM711952     1  0.4273    0.64896 0.552 0.000 0.000 0.000 NA
#> GSM711954     1  0.0798    0.72701 0.976 0.000 0.000 0.008 NA
#> GSM711962     1  0.2074    0.73569 0.896 0.000 0.000 0.000 NA
#> GSM711970     1  0.0671    0.72319 0.980 0.000 0.000 0.004 NA
#> GSM711974     1  0.2773    0.73453 0.836 0.000 0.000 0.000 NA
#> GSM711978     4  0.1386    0.79093 0.032 0.000 0.000 0.952 NA
#> GSM711988     1  0.3565    0.58399 0.816 0.000 0.000 0.144 NA
#> GSM711990     3  0.0703    0.87314 0.000 0.000 0.976 0.000 NA
#> GSM711992     4  0.1469    0.79072 0.036 0.000 0.000 0.948 NA
#> GSM711982     1  0.4294    0.65131 0.532 0.000 0.000 0.000 NA
#> GSM711984     2  0.1908    0.86564 0.000 0.908 0.000 0.000 NA
#> GSM711912     1  0.4273    0.64896 0.552 0.000 0.000 0.000 NA
#> GSM711918     1  0.4273    0.64896 0.552 0.000 0.000 0.000 NA
#> GSM711920     1  0.1410    0.73255 0.940 0.000 0.000 0.000 NA
#> GSM711937     2  0.4380    0.78433 0.000 0.708 0.000 0.032 NA
#> GSM711939     2  0.2516    0.85577 0.000 0.860 0.000 0.000 NA
#> GSM711951     4  0.3661    0.62834 0.000 0.000 0.000 0.724 NA
#> GSM711957     1  0.5304    0.34045 0.640 0.000 0.000 0.272 NA
#> GSM711959     2  0.2516    0.85577 0.000 0.860 0.000 0.000 NA
#> GSM711961     2  0.0000    0.87528 0.000 1.000 0.000 0.000 NA
#> GSM711965     3  0.6161    0.11056 0.000 0.000 0.444 0.424 NA
#> GSM711967     1  0.1830    0.73244 0.924 0.000 0.000 0.008 NA
#> GSM711969     2  0.4380    0.78433 0.000 0.708 0.000 0.032 NA
#> GSM711973     4  0.6554    0.51462 0.248 0.000 0.024 0.564 NA
#> GSM711977     3  0.2583    0.83564 0.000 0.000 0.864 0.004 NA
#> GSM711981     4  0.0963    0.78051 0.000 0.000 0.000 0.964 NA
#> GSM711987     2  0.0000    0.87528 0.000 1.000 0.000 0.000 NA
#> GSM711905     2  0.0000    0.87528 0.000 1.000 0.000 0.000 NA
#> GSM711907     2  0.6638    0.38756 0.000 0.452 0.000 0.272 NA
#> GSM711909     3  0.0000    0.87440 0.000 0.000 1.000 0.000 NA
#> GSM711911     3  0.0510    0.87393 0.000 0.000 0.984 0.000 NA
#> GSM711915     3  0.1792    0.85186 0.000 0.000 0.916 0.000 NA
#> GSM711917     2  0.4380    0.78433 0.000 0.708 0.000 0.032 NA
#> GSM711923     4  0.2344    0.77755 0.032 0.000 0.000 0.904 NA
#> GSM711925     2  0.0000    0.87528 0.000 1.000 0.000 0.000 NA
#> GSM711927     3  0.0000    0.87440 0.000 0.000 1.000 0.000 NA
#> GSM711929     2  0.0000    0.87528 0.000 1.000 0.000 0.000 NA
#> GSM711931     4  0.6518    0.18441 0.000 0.240 0.000 0.484 NA
#> GSM711933     1  0.2236    0.69646 0.908 0.000 0.000 0.024 NA
#> GSM711935     2  0.0000    0.87528 0.000 1.000 0.000 0.000 NA
#> GSM711941     4  0.2616    0.77135 0.036 0.000 0.000 0.888 NA
#> GSM711943     4  0.1386    0.78972 0.032 0.000 0.000 0.952 NA
#> GSM711945     4  0.2879    0.75624 0.000 0.000 0.032 0.868 NA
#> GSM711947     3  0.4875    0.72124 0.000 0.044 0.768 0.096 NA
#> GSM711949     2  0.0000    0.87528 0.000 1.000 0.000 0.000 NA
#> GSM711953     2  0.0000    0.87528 0.000 1.000 0.000 0.000 NA
#> GSM711955     1  0.6848   -0.00765 0.496 0.000 0.044 0.344 NA
#> GSM711963     2  0.0000    0.87528 0.000 1.000 0.000 0.000 NA
#> GSM711971     3  0.0609    0.87361 0.000 0.000 0.980 0.000 NA
#> GSM711975     4  0.6673    0.04679 0.000 0.284 0.000 0.440 NA
#> GSM711979     4  0.0963    0.79092 0.036 0.000 0.000 0.964 NA
#> GSM711989     2  0.5467    0.69875 0.000 0.624 0.000 0.100 NA
#> GSM711991     3  0.3988    0.70466 0.000 0.000 0.768 0.196 NA
#> GSM711993     4  0.2280    0.74834 0.000 0.000 0.000 0.880 NA
#> GSM711983     3  0.0703    0.87314 0.000 0.000 0.976 0.000 NA
#> GSM711985     2  0.2377    0.85885 0.000 0.872 0.000 0.000 NA
#> GSM711913     3  0.2583    0.83564 0.000 0.000 0.864 0.004 NA
#> GSM711919     3  0.0000    0.87440 0.000 0.000 1.000 0.000 NA
#> GSM711921     3  0.0000    0.87440 0.000 0.000 1.000 0.000 NA

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.4348     0.3961 0.000 0.600 0.000 0.016 0.376 0.008
#> GSM711938     2  0.1124     0.7901 0.000 0.956 0.000 0.000 0.036 0.008
#> GSM711950     4  0.6110     0.3229 0.292 0.000 0.000 0.544 0.104 0.060
#> GSM711956     1  0.2179     0.6547 0.900 0.000 0.000 0.000 0.064 0.036
#> GSM711958     1  0.2812     0.6439 0.856 0.000 0.000 0.000 0.048 0.096
#> GSM711960     1  0.5319     0.5586 0.688 0.000 0.112 0.004 0.048 0.148
#> GSM711964     1  0.4607    -0.0163 0.616 0.000 0.000 0.000 0.056 0.328
#> GSM711966     6  0.3784     0.8803 0.308 0.000 0.000 0.000 0.012 0.680
#> GSM711968     1  0.3883     0.5298 0.768 0.000 0.000 0.000 0.088 0.144
#> GSM711972     6  0.3650     0.8928 0.280 0.000 0.000 0.000 0.012 0.708
#> GSM711976     1  0.5418     0.5469 0.652 0.000 0.000 0.204 0.100 0.044
#> GSM711980     1  0.0520     0.6802 0.984 0.000 0.000 0.000 0.008 0.008
#> GSM711986     6  0.4671     0.8631 0.304 0.000 0.000 0.000 0.068 0.628
#> GSM711904     1  0.4046     0.4602 0.748 0.000 0.000 0.000 0.084 0.168
#> GSM711906     6  0.3383     0.8898 0.268 0.000 0.000 0.000 0.004 0.728
#> GSM711908     6  0.4190     0.8863 0.260 0.000 0.000 0.000 0.048 0.692
#> GSM711910     3  0.0692     0.8450 0.000 0.000 0.976 0.000 0.004 0.020
#> GSM711914     1  0.4652     0.1506 0.640 0.000 0.000 0.000 0.072 0.288
#> GSM711916     6  0.3766     0.8842 0.304 0.000 0.000 0.000 0.012 0.684
#> GSM711922     1  0.1921     0.6703 0.916 0.000 0.000 0.000 0.052 0.032
#> GSM711924     1  0.3225     0.6456 0.828 0.000 0.000 0.000 0.092 0.080
#> GSM711926     4  0.3244     0.2689 0.000 0.000 0.000 0.732 0.268 0.000
#> GSM711928     1  0.3551     0.5265 0.792 0.000 0.000 0.000 0.060 0.148
#> GSM711930     6  0.3448     0.8909 0.280 0.000 0.000 0.000 0.004 0.716
#> GSM711932     1  0.4517     0.6260 0.744 0.000 0.000 0.116 0.116 0.024
#> GSM711934     1  0.0914     0.6803 0.968 0.000 0.000 0.000 0.016 0.016
#> GSM711940     1  0.5791     0.3431 0.560 0.000 0.000 0.312 0.052 0.076
#> GSM711942     1  0.3225     0.6456 0.828 0.000 0.000 0.000 0.092 0.080
#> GSM711944     3  0.7761     0.1559 0.308 0.000 0.400 0.068 0.148 0.076
#> GSM711946     4  0.3768     0.5981 0.008 0.000 0.004 0.796 0.136 0.056
#> GSM711948     1  0.6386     0.1940 0.488 0.000 0.000 0.332 0.112 0.068
#> GSM711952     6  0.4829     0.8524 0.308 0.000 0.000 0.000 0.080 0.612
#> GSM711954     1  0.1777     0.6725 0.928 0.000 0.000 0.004 0.044 0.024
#> GSM711962     1  0.3385     0.5667 0.788 0.000 0.000 0.000 0.032 0.180
#> GSM711970     1  0.1320     0.6812 0.948 0.000 0.000 0.000 0.036 0.016
#> GSM711974     1  0.3352     0.5684 0.792 0.000 0.000 0.000 0.032 0.176
#> GSM711978     4  0.1531     0.5847 0.004 0.000 0.000 0.928 0.068 0.000
#> GSM711988     1  0.4271     0.6216 0.772 0.000 0.000 0.116 0.076 0.036
#> GSM711990     3  0.1672     0.8438 0.000 0.000 0.932 0.004 0.048 0.016
#> GSM711992     4  0.1643     0.5874 0.008 0.000 0.000 0.924 0.068 0.000
#> GSM711982     6  0.3766     0.8842 0.304 0.000 0.000 0.000 0.012 0.684
#> GSM711984     2  0.2771     0.7633 0.000 0.852 0.000 0.000 0.116 0.032
#> GSM711912     6  0.4735     0.8667 0.296 0.000 0.000 0.000 0.076 0.628
#> GSM711918     6  0.4735     0.8667 0.296 0.000 0.000 0.000 0.076 0.628
#> GSM711920     1  0.3167     0.6490 0.832 0.000 0.000 0.000 0.096 0.072
#> GSM711937     2  0.4034     0.4621 0.000 0.624 0.000 0.004 0.364 0.008
#> GSM711939     2  0.2768     0.7401 0.000 0.832 0.000 0.000 0.156 0.012
#> GSM711951     4  0.3774    -0.1717 0.000 0.000 0.000 0.592 0.408 0.000
#> GSM711957     1  0.6514     0.4412 0.524 0.000 0.000 0.180 0.228 0.068
#> GSM711959     2  0.2981     0.7372 0.000 0.820 0.000 0.000 0.160 0.020
#> GSM711961     2  0.0000     0.7943 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711965     4  0.7087     0.2642 0.004 0.000 0.208 0.460 0.232 0.096
#> GSM711967     1  0.3479     0.6397 0.820 0.000 0.000 0.008 0.084 0.088
#> GSM711969     2  0.4115     0.4655 0.000 0.624 0.000 0.004 0.360 0.012
#> GSM711973     4  0.6806     0.4085 0.148 0.000 0.000 0.480 0.272 0.100
#> GSM711977     3  0.4591     0.7430 0.000 0.000 0.688 0.004 0.224 0.084
#> GSM711981     4  0.1765     0.5674 0.000 0.000 0.000 0.904 0.096 0.000
#> GSM711987     2  0.0547     0.7934 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM711905     2  0.0000     0.7943 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     5  0.5963     0.7456 0.000 0.276 0.000 0.272 0.452 0.000
#> GSM711909     3  0.0291     0.8464 0.000 0.000 0.992 0.000 0.004 0.004
#> GSM711911     3  0.1226     0.8464 0.000 0.000 0.952 0.004 0.040 0.004
#> GSM711915     3  0.4174     0.7671 0.000 0.000 0.736 0.000 0.172 0.092
#> GSM711917     2  0.4115     0.4655 0.000 0.624 0.000 0.004 0.360 0.012
#> GSM711923     4  0.2978     0.6137 0.012 0.000 0.000 0.860 0.072 0.056
#> GSM711925     2  0.0260     0.7944 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM711927     3  0.0000     0.8472 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711929     2  0.0000     0.7943 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     4  0.5744    -0.7985 0.000 0.168 0.000 0.424 0.408 0.000
#> GSM711933     1  0.2765     0.6720 0.872 0.000 0.000 0.008 0.064 0.056
#> GSM711935     2  0.0632     0.7932 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711941     4  0.3439     0.6023 0.016 0.000 0.000 0.828 0.096 0.060
#> GSM711943     4  0.0976     0.6140 0.008 0.000 0.000 0.968 0.016 0.008
#> GSM711945     4  0.3685     0.5889 0.000 0.000 0.004 0.796 0.120 0.080
#> GSM711947     3  0.5637     0.6426 0.000 0.008 0.672 0.092 0.148 0.080
#> GSM711949     2  0.0632     0.7932 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711953     2  0.0000     0.7943 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     1  0.6535     0.2558 0.524 0.000 0.008 0.284 0.108 0.076
#> GSM711963     2  0.0632     0.7932 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM711971     3  0.1511     0.8453 0.000 0.000 0.940 0.004 0.044 0.012
#> GSM711975     5  0.5753     0.7254 0.000 0.172 0.000 0.384 0.444 0.000
#> GSM711979     4  0.0405     0.6133 0.008 0.000 0.000 0.988 0.004 0.000
#> GSM711989     2  0.5260    -0.2382 0.000 0.464 0.000 0.096 0.440 0.000
#> GSM711991     3  0.5355     0.6118 0.000 0.000 0.660 0.208 0.064 0.068
#> GSM711993     4  0.3198     0.3047 0.000 0.000 0.000 0.740 0.260 0.000
#> GSM711983     3  0.1672     0.8438 0.000 0.000 0.932 0.004 0.048 0.016
#> GSM711985     2  0.2730     0.7473 0.000 0.836 0.000 0.000 0.152 0.012
#> GSM711913     3  0.4591     0.7430 0.000 0.000 0.688 0.004 0.224 0.084
#> GSM711919     3  0.0000     0.8472 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711921     3  0.0692     0.8450 0.000 0.000 0.976 0.000 0.004 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-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 tissue(p) disease.state(p) individual(p) k
#> MAD:kmeans 88  6.08e-05            0.209         0.473 2
#> MAD:kmeans 86  3.75e-11            0.308         0.623 3
#> MAD:kmeans 83  5.91e-09            0.122         0.362 4
#> MAD:kmeans 79  4.70e-09            0.121         0.273 5
#> MAD:kmeans 70  9.12e-08            0.265         0.400 6

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


MAD:skmeans**

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

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

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

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

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

collect_plots(res)

plot of chunk MAD-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.976           0.939       0.977         0.4827 0.519   0.519
#> 3 3 1.000           0.947       0.980         0.3639 0.747   0.545
#> 4 4 0.893           0.890       0.956         0.0961 0.913   0.753
#> 5 5 0.792           0.668       0.852         0.0822 0.913   0.698
#> 6 6 0.766           0.601       0.785         0.0430 0.911   0.634

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
#> GSM711936     2  0.0000    0.97446 0.000 1.000
#> GSM711938     2  0.0000    0.97446 0.000 1.000
#> GSM711950     1  0.0000    0.97511 1.000 0.000
#> GSM711956     1  0.0000    0.97511 1.000 0.000
#> GSM711958     1  0.0000    0.97511 1.000 0.000
#> GSM711960     1  0.0000    0.97511 1.000 0.000
#> GSM711964     1  0.0000    0.97511 1.000 0.000
#> GSM711966     1  0.0000    0.97511 1.000 0.000
#> GSM711968     1  0.0000    0.97511 1.000 0.000
#> GSM711972     1  0.0000    0.97511 1.000 0.000
#> GSM711976     1  0.0000    0.97511 1.000 0.000
#> GSM711980     1  0.0000    0.97511 1.000 0.000
#> GSM711986     1  0.0000    0.97511 1.000 0.000
#> GSM711904     1  0.0000    0.97511 1.000 0.000
#> GSM711906     1  0.0000    0.97511 1.000 0.000
#> GSM711908     1  0.0000    0.97511 1.000 0.000
#> GSM711910     1  0.0000    0.97511 1.000 0.000
#> GSM711914     1  0.0000    0.97511 1.000 0.000
#> GSM711916     1  0.0000    0.97511 1.000 0.000
#> GSM711922     1  0.0000    0.97511 1.000 0.000
#> GSM711924     1  0.0000    0.97511 1.000 0.000
#> GSM711926     2  0.0000    0.97446 0.000 1.000
#> GSM711928     1  0.0000    0.97511 1.000 0.000
#> GSM711930     1  0.0000    0.97511 1.000 0.000
#> GSM711932     1  0.0000    0.97511 1.000 0.000
#> GSM711934     1  0.0000    0.97511 1.000 0.000
#> GSM711940     1  0.0000    0.97511 1.000 0.000
#> GSM711942     1  0.0000    0.97511 1.000 0.000
#> GSM711944     1  0.0000    0.97511 1.000 0.000
#> GSM711946     1  0.8443    0.62694 0.728 0.272
#> GSM711948     1  0.0000    0.97511 1.000 0.000
#> GSM711952     1  0.0000    0.97511 1.000 0.000
#> GSM711954     1  0.0000    0.97511 1.000 0.000
#> GSM711962     1  0.0000    0.97511 1.000 0.000
#> GSM711970     1  0.0000    0.97511 1.000 0.000
#> GSM711974     1  0.0000    0.97511 1.000 0.000
#> GSM711978     2  0.0000    0.97446 0.000 1.000
#> GSM711988     1  0.0000    0.97511 1.000 0.000
#> GSM711990     1  0.0000    0.97511 1.000 0.000
#> GSM711992     2  0.0000    0.97446 0.000 1.000
#> GSM711982     1  0.0000    0.97511 1.000 0.000
#> GSM711984     2  0.0000    0.97446 0.000 1.000
#> GSM711912     1  0.0000    0.97511 1.000 0.000
#> GSM711918     1  0.0000    0.97511 1.000 0.000
#> GSM711920     1  0.0000    0.97511 1.000 0.000
#> GSM711937     2  0.0000    0.97446 0.000 1.000
#> GSM711939     2  0.0000    0.97446 0.000 1.000
#> GSM711951     2  0.0000    0.97446 0.000 1.000
#> GSM711957     2  0.9209    0.48521 0.336 0.664
#> GSM711959     2  0.0000    0.97446 0.000 1.000
#> GSM711961     2  0.0000    0.97446 0.000 1.000
#> GSM711965     1  0.0000    0.97511 1.000 0.000
#> GSM711967     1  0.0000    0.97511 1.000 0.000
#> GSM711969     2  0.0000    0.97446 0.000 1.000
#> GSM711973     1  0.0000    0.97511 1.000 0.000
#> GSM711977     1  0.9710    0.34514 0.600 0.400
#> GSM711981     2  0.0000    0.97446 0.000 1.000
#> GSM711987     2  0.0000    0.97446 0.000 1.000
#> GSM711905     2  0.0000    0.97446 0.000 1.000
#> GSM711907     2  0.0000    0.97446 0.000 1.000
#> GSM711909     1  0.0000    0.97511 1.000 0.000
#> GSM711911     1  0.0000    0.97511 1.000 0.000
#> GSM711915     2  0.0376    0.97097 0.004 0.996
#> GSM711917     2  0.0000    0.97446 0.000 1.000
#> GSM711923     1  0.8861    0.56810 0.696 0.304
#> GSM711925     2  0.0000    0.97446 0.000 1.000
#> GSM711927     1  0.0000    0.97511 1.000 0.000
#> GSM711929     2  0.0000    0.97446 0.000 1.000
#> GSM711931     2  0.0000    0.97446 0.000 1.000
#> GSM711933     1  0.0000    0.97511 1.000 0.000
#> GSM711935     2  0.0000    0.97446 0.000 1.000
#> GSM711941     1  0.0000    0.97511 1.000 0.000
#> GSM711943     2  0.9993    0.00872 0.484 0.516
#> GSM711945     2  0.0000    0.97446 0.000 1.000
#> GSM711947     2  0.0000    0.97446 0.000 1.000
#> GSM711949     2  0.0000    0.97446 0.000 1.000
#> GSM711953     2  0.0000    0.97446 0.000 1.000
#> GSM711955     1  0.0000    0.97511 1.000 0.000
#> GSM711963     2  0.0000    0.97446 0.000 1.000
#> GSM711971     1  0.0000    0.97511 1.000 0.000
#> GSM711975     2  0.0000    0.97446 0.000 1.000
#> GSM711979     1  0.8909    0.56037 0.692 0.308
#> GSM711989     2  0.0000    0.97446 0.000 1.000
#> GSM711991     2  0.0000    0.97446 0.000 1.000
#> GSM711993     2  0.0000    0.97446 0.000 1.000
#> GSM711983     1  0.0000    0.97511 1.000 0.000
#> GSM711985     2  0.0000    0.97446 0.000 1.000
#> GSM711913     2  0.0376    0.97097 0.004 0.996
#> GSM711919     1  0.0000    0.97511 1.000 0.000
#> GSM711921     1  0.0000    0.97511 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
#> GSM711936     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711938     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711950     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711956     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711958     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711960     3   0.613    0.36297 0.400 0.000 0.600
#> GSM711964     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711966     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711968     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711972     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711976     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711980     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711986     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711904     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711906     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711908     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711910     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711914     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711916     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711922     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711924     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711926     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711928     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711930     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711932     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711934     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711940     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711942     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711944     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711946     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711948     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711952     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711954     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711962     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711970     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711974     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711978     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711988     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711990     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711992     2   0.631   -0.00082 0.496 0.504 0.000
#> GSM711982     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711984     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711912     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711918     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711920     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711937     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711939     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711951     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711957     1   0.236    0.91305 0.928 0.072 0.000
#> GSM711959     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711961     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711965     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711967     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711969     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711973     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711977     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711981     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711987     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711905     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711907     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711909     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711911     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711915     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711917     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711923     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711925     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711927     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711929     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711931     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711933     1   0.000    0.98853 1.000 0.000 0.000
#> GSM711935     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711941     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711943     3   0.116    0.93370 0.000 0.028 0.972
#> GSM711945     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711947     3   0.553    0.57601 0.000 0.296 0.704
#> GSM711949     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711953     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711955     3   0.455    0.74724 0.200 0.000 0.800
#> GSM711963     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711971     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711975     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711979     1   0.697    0.52145 0.668 0.288 0.044
#> GSM711989     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711991     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711993     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711983     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711985     2   0.000    0.97843 0.000 1.000 0.000
#> GSM711913     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711919     3   0.000    0.95709 0.000 0.000 1.000
#> GSM711921     3   0.000    0.95709 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711950     4  0.2760     0.7299 0.128 0.000 0.000 0.872
#> GSM711956     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711958     1  0.0188     0.9769 0.996 0.000 0.000 0.004
#> GSM711960     3  0.3942     0.6000 0.236 0.000 0.764 0.000
#> GSM711964     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711976     1  0.3074     0.8293 0.848 0.000 0.000 0.152
#> GSM711980     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711906     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711910     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711924     1  0.0188     0.9769 0.996 0.000 0.000 0.004
#> GSM711926     4  0.3837     0.6278 0.000 0.224 0.000 0.776
#> GSM711928     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711932     1  0.3219     0.8144 0.836 0.000 0.000 0.164
#> GSM711934     1  0.0188     0.9769 0.996 0.000 0.000 0.004
#> GSM711940     1  0.0707     0.9643 0.980 0.000 0.000 0.020
#> GSM711942     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711944     3  0.0188     0.8930 0.000 0.000 0.996 0.004
#> GSM711946     3  0.4713     0.4028 0.000 0.000 0.640 0.360
#> GSM711948     4  0.4804     0.3083 0.384 0.000 0.000 0.616
#> GSM711952     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711954     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711962     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711970     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711974     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0188     0.8255 0.000 0.004 0.000 0.996
#> GSM711988     1  0.3024     0.8342 0.852 0.000 0.000 0.148
#> GSM711990     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711992     4  0.0188     0.8247 0.004 0.000 0.000 0.996
#> GSM711982     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711951     2  0.3942     0.6729 0.000 0.764 0.000 0.236
#> GSM711957     1  0.3711     0.8174 0.836 0.024 0.000 0.140
#> GSM711959     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711965     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711967     1  0.0000     0.9793 1.000 0.000 0.000 0.000
#> GSM711969     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711973     3  0.3444     0.6972 0.000 0.000 0.816 0.184
#> GSM711977     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711981     4  0.0188     0.8255 0.000 0.004 0.000 0.996
#> GSM711987     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711907     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711909     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711923     4  0.2973     0.7275 0.000 0.000 0.144 0.856
#> GSM711925     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711931     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711933     1  0.0188     0.9769 0.996 0.000 0.000 0.004
#> GSM711935     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0000     0.8249 0.000 0.000 0.000 1.000
#> GSM711943     4  0.2973     0.7275 0.000 0.000 0.144 0.856
#> GSM711945     4  0.4996    -0.0228 0.000 0.000 0.484 0.516
#> GSM711947     3  0.4941     0.2635 0.000 0.436 0.564 0.000
#> GSM711949     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711955     3  0.3791     0.6518 0.200 0.000 0.796 0.004
#> GSM711963     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711975     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711979     4  0.0000     0.8249 0.000 0.000 0.000 1.000
#> GSM711989     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711991     3  0.2281     0.8191 0.000 0.000 0.904 0.096
#> GSM711993     4  0.0188     0.8255 0.000 0.004 0.000 0.996
#> GSM711983     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711985     2  0.0000     0.9885 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711919     3  0.0000     0.8957 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000     0.8957 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711938     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711950     5  0.1041     0.5045 0.004 0.000 0.000 0.032 0.964
#> GSM711956     1  0.4306    -0.1675 0.508 0.000 0.000 0.000 0.492
#> GSM711958     1  0.3857     0.4444 0.688 0.000 0.000 0.000 0.312
#> GSM711960     3  0.6824    -0.2670 0.324 0.000 0.344 0.000 0.332
#> GSM711964     1  0.3949     0.3532 0.668 0.000 0.000 0.000 0.332
#> GSM711966     1  0.0963     0.6991 0.964 0.000 0.000 0.000 0.036
#> GSM711968     1  0.4219     0.0351 0.584 0.000 0.000 0.000 0.416
#> GSM711972     1  0.0000     0.7005 1.000 0.000 0.000 0.000 0.000
#> GSM711976     5  0.3636     0.5601 0.272 0.000 0.000 0.000 0.728
#> GSM711980     5  0.4262     0.2773 0.440 0.000 0.000 0.000 0.560
#> GSM711986     1  0.0880     0.7031 0.968 0.000 0.000 0.000 0.032
#> GSM711904     1  0.4201     0.1001 0.592 0.000 0.000 0.000 0.408
#> GSM711906     1  0.0000     0.7005 1.000 0.000 0.000 0.000 0.000
#> GSM711908     1  0.0290     0.7012 0.992 0.000 0.000 0.000 0.008
#> GSM711910     3  0.0000     0.8231 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.3876     0.3887 0.684 0.000 0.000 0.000 0.316
#> GSM711916     1  0.1043     0.6984 0.960 0.000 0.000 0.000 0.040
#> GSM711922     5  0.4307     0.1362 0.496 0.000 0.000 0.000 0.504
#> GSM711924     1  0.3480     0.5349 0.752 0.000 0.000 0.000 0.248
#> GSM711926     4  0.1121     0.8747 0.000 0.044 0.000 0.956 0.000
#> GSM711928     1  0.4287    -0.0603 0.540 0.000 0.000 0.000 0.460
#> GSM711930     1  0.0510     0.7015 0.984 0.000 0.000 0.000 0.016
#> GSM711932     5  0.4850     0.5606 0.232 0.000 0.000 0.072 0.696
#> GSM711934     5  0.4182     0.3816 0.400 0.000 0.000 0.000 0.600
#> GSM711940     5  0.3966     0.4176 0.336 0.000 0.000 0.000 0.664
#> GSM711942     1  0.3242     0.5718 0.784 0.000 0.000 0.000 0.216
#> GSM711944     3  0.3003     0.7094 0.000 0.000 0.812 0.000 0.188
#> GSM711946     3  0.6354     0.3313 0.000 0.000 0.520 0.264 0.216
#> GSM711948     5  0.0579     0.5256 0.008 0.000 0.000 0.008 0.984
#> GSM711952     1  0.0880     0.7031 0.968 0.000 0.000 0.000 0.032
#> GSM711954     1  0.4300    -0.1344 0.524 0.000 0.000 0.000 0.476
#> GSM711962     1  0.1965     0.6768 0.904 0.000 0.000 0.000 0.096
#> GSM711970     5  0.4305     0.1492 0.488 0.000 0.000 0.000 0.512
#> GSM711974     1  0.3109     0.6107 0.800 0.000 0.000 0.000 0.200
#> GSM711978     4  0.0000     0.9033 0.000 0.000 0.000 1.000 0.000
#> GSM711988     5  0.3336     0.5784 0.228 0.000 0.000 0.000 0.772
#> GSM711990     3  0.0000     0.8231 0.000 0.000 1.000 0.000 0.000
#> GSM711992     4  0.0162     0.9029 0.000 0.000 0.000 0.996 0.004
#> GSM711982     1  0.0963     0.6991 0.964 0.000 0.000 0.000 0.036
#> GSM711984     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711912     1  0.0880     0.7026 0.968 0.000 0.000 0.000 0.032
#> GSM711918     1  0.0880     0.7026 0.968 0.000 0.000 0.000 0.032
#> GSM711920     1  0.3480     0.5395 0.752 0.000 0.000 0.000 0.248
#> GSM711937     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711951     2  0.3480     0.6537 0.000 0.752 0.000 0.248 0.000
#> GSM711957     5  0.6519     0.3982 0.300 0.004 0.000 0.196 0.500
#> GSM711959     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711965     3  0.3305     0.6950 0.000 0.000 0.776 0.000 0.224
#> GSM711967     1  0.1121     0.6918 0.956 0.000 0.000 0.000 0.044
#> GSM711969     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711973     3  0.4294     0.4495 0.000 0.000 0.532 0.000 0.468
#> GSM711977     3  0.1608     0.7977 0.000 0.000 0.928 0.000 0.072
#> GSM711981     4  0.1809     0.8896 0.000 0.012 0.000 0.928 0.060
#> GSM711987     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711907     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711909     3  0.0000     0.8231 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.0000     0.8231 0.000 0.000 1.000 0.000 0.000
#> GSM711915     3  0.0000     0.8231 0.000 0.000 1.000 0.000 0.000
#> GSM711917     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711923     4  0.4240     0.7580 0.000 0.000 0.036 0.736 0.228
#> GSM711925     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0000     0.8231 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711931     2  0.3684     0.6254 0.000 0.720 0.000 0.280 0.000
#> GSM711933     5  0.4101     0.4503 0.372 0.000 0.000 0.000 0.628
#> GSM711935     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.4210     0.6425 0.000 0.000 0.000 0.588 0.412
#> GSM711943     4  0.1740     0.8878 0.000 0.000 0.012 0.932 0.056
#> GSM711945     3  0.6588    -0.0459 0.000 0.000 0.396 0.396 0.208
#> GSM711947     3  0.3816     0.5045 0.000 0.304 0.696 0.000 0.000
#> GSM711949     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711955     5  0.2843     0.4653 0.008 0.000 0.144 0.000 0.848
#> GSM711963     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0000     0.8231 0.000 0.000 1.000 0.000 0.000
#> GSM711975     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711979     4  0.0000     0.9033 0.000 0.000 0.000 1.000 0.000
#> GSM711989     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711991     3  0.2286     0.7537 0.000 0.000 0.888 0.108 0.004
#> GSM711993     4  0.0162     0.9025 0.000 0.004 0.000 0.996 0.000
#> GSM711983     3  0.0000     0.8231 0.000 0.000 1.000 0.000 0.000
#> GSM711985     2  0.0000     0.9750 0.000 1.000 0.000 0.000 0.000
#> GSM711913     3  0.1608     0.7977 0.000 0.000 0.928 0.000 0.072
#> GSM711919     3  0.0000     0.8231 0.000 0.000 1.000 0.000 0.000
#> GSM711921     3  0.0000     0.8231 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711938     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711950     5  0.4260     0.0970 0.472 0.000 0.000 0.016 0.512 0.000
#> GSM711956     1  0.4180     0.4293 0.628 0.000 0.000 0.000 0.024 0.348
#> GSM711958     1  0.4660     0.0854 0.540 0.000 0.000 0.000 0.044 0.416
#> GSM711960     1  0.6868     0.1244 0.368 0.000 0.316 0.000 0.048 0.268
#> GSM711964     6  0.3860    -0.1071 0.472 0.000 0.000 0.000 0.000 0.528
#> GSM711966     6  0.1141     0.6472 0.052 0.000 0.000 0.000 0.000 0.948
#> GSM711968     1  0.3765     0.3504 0.596 0.000 0.000 0.000 0.000 0.404
#> GSM711972     6  0.0363     0.6544 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM711976     1  0.5475     0.4570 0.588 0.000 0.000 0.004 0.224 0.184
#> GSM711980     1  0.3404     0.5226 0.760 0.000 0.000 0.000 0.016 0.224
#> GSM711986     6  0.2912     0.5918 0.172 0.000 0.000 0.000 0.012 0.816
#> GSM711904     1  0.4456     0.2349 0.524 0.000 0.000 0.000 0.028 0.448
#> GSM711906     6  0.0260     0.6519 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM711908     6  0.2070     0.6309 0.092 0.000 0.000 0.000 0.012 0.896
#> GSM711910     3  0.0000     0.8533 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711914     6  0.4147    -0.0262 0.436 0.000 0.000 0.000 0.012 0.552
#> GSM711916     6  0.1075     0.6490 0.048 0.000 0.000 0.000 0.000 0.952
#> GSM711922     1  0.3175     0.4986 0.744 0.000 0.000 0.000 0.000 0.256
#> GSM711924     6  0.4986    -0.0111 0.444 0.000 0.000 0.000 0.068 0.488
#> GSM711926     4  0.0508     0.8956 0.004 0.012 0.000 0.984 0.000 0.000
#> GSM711928     1  0.4301     0.3530 0.584 0.000 0.000 0.000 0.024 0.392
#> GSM711930     6  0.0937     0.6507 0.040 0.000 0.000 0.000 0.000 0.960
#> GSM711932     1  0.4285     0.4988 0.772 0.000 0.000 0.040 0.116 0.072
#> GSM711934     1  0.4000     0.5152 0.724 0.000 0.000 0.000 0.048 0.228
#> GSM711940     1  0.5737     0.2410 0.460 0.000 0.000 0.000 0.172 0.368
#> GSM711942     6  0.4921     0.0590 0.420 0.000 0.000 0.000 0.064 0.516
#> GSM711944     3  0.3997     0.6049 0.108 0.000 0.760 0.000 0.132 0.000
#> GSM711946     5  0.5181     0.3597 0.020 0.000 0.308 0.068 0.604 0.000
#> GSM711948     5  0.3869     0.0338 0.500 0.000 0.000 0.000 0.500 0.000
#> GSM711952     6  0.2841     0.5906 0.164 0.000 0.000 0.000 0.012 0.824
#> GSM711954     1  0.3528     0.4688 0.700 0.000 0.000 0.000 0.004 0.296
#> GSM711962     6  0.3271     0.4864 0.232 0.000 0.000 0.000 0.008 0.760
#> GSM711970     1  0.3202     0.5024 0.800 0.000 0.000 0.000 0.024 0.176
#> GSM711974     6  0.4514     0.1545 0.372 0.000 0.000 0.000 0.040 0.588
#> GSM711978     4  0.0000     0.9075 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711988     1  0.4843     0.4683 0.652 0.000 0.000 0.000 0.232 0.116
#> GSM711990     3  0.0000     0.8533 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711992     4  0.0000     0.9075 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711982     6  0.1007     0.6496 0.044 0.000 0.000 0.000 0.000 0.956
#> GSM711984     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711912     6  0.2877     0.5852 0.168 0.000 0.000 0.000 0.012 0.820
#> GSM711918     6  0.2877     0.5852 0.168 0.000 0.000 0.000 0.012 0.820
#> GSM711920     1  0.4971     0.0278 0.508 0.000 0.000 0.000 0.068 0.424
#> GSM711937     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711951     2  0.3515     0.5321 0.000 0.676 0.000 0.324 0.000 0.000
#> GSM711957     1  0.5885     0.3859 0.636 0.004 0.000 0.144 0.068 0.148
#> GSM711959     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711961     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711965     5  0.3819     0.2124 0.004 0.000 0.372 0.000 0.624 0.000
#> GSM711967     6  0.3645     0.4514 0.236 0.000 0.000 0.000 0.024 0.740
#> GSM711969     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711973     5  0.4544     0.3306 0.052 0.000 0.292 0.004 0.652 0.000
#> GSM711977     3  0.3448     0.5799 0.004 0.000 0.716 0.000 0.280 0.000
#> GSM711981     4  0.2320     0.7996 0.000 0.004 0.000 0.864 0.132 0.000
#> GSM711987     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711909     3  0.0000     0.8533 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711911     3  0.0000     0.8533 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711915     3  0.2520     0.7440 0.004 0.000 0.844 0.000 0.152 0.000
#> GSM711917     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711923     5  0.4827    -0.0534 0.028 0.000 0.016 0.420 0.536 0.000
#> GSM711925     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.0000     0.8533 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711929     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     2  0.3923     0.3089 0.004 0.580 0.000 0.416 0.000 0.000
#> GSM711933     1  0.3983     0.4263 0.736 0.000 0.000 0.000 0.056 0.208
#> GSM711935     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     5  0.4380     0.3228 0.080 0.000 0.000 0.220 0.700 0.000
#> GSM711943     4  0.4235     0.5252 0.020 0.000 0.012 0.672 0.296 0.000
#> GSM711945     5  0.4530     0.4449 0.000 0.000 0.208 0.100 0.692 0.000
#> GSM711947     3  0.4348     0.4185 0.000 0.268 0.676 0.000 0.056 0.000
#> GSM711949     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     1  0.5514    -0.1962 0.464 0.000 0.112 0.000 0.420 0.004
#> GSM711963     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.0000     0.8533 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711975     2  0.0865     0.9322 0.000 0.964 0.000 0.036 0.000 0.000
#> GSM711979     4  0.0146     0.9061 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM711989     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711991     3  0.3541     0.5502 0.000 0.000 0.728 0.012 0.260 0.000
#> GSM711993     4  0.0000     0.9075 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711983     3  0.0146     0.8511 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM711985     2  0.0000     0.9638 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711913     3  0.3405     0.5939 0.004 0.000 0.724 0.000 0.272 0.000
#> GSM711919     3  0.0000     0.8533 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711921     3  0.0000     0.8533 0.000 0.000 1.000 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-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 tissue(p) disease.state(p) individual(p) k
#> MAD:skmeans 87  2.96e-06            0.521         0.864 2
#> MAD:skmeans 88  2.59e-10            0.172         0.735 3
#> MAD:skmeans 86  3.07e-09            0.346         0.328 4
#> MAD:skmeans 70  1.50e-07            0.170         0.198 5
#> MAD:skmeans 57  6.73e-06            0.174         0.395 6

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


MAD:pam*

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 27425 rows and 90 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 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 MAD-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.981       0.993         0.4182 0.585   0.585
#> 3 3 0.736           0.765       0.910         0.5516 0.741   0.561
#> 4 4 0.947           0.914       0.966         0.1332 0.856   0.614
#> 5 5 0.843           0.816       0.906         0.0873 0.893   0.622
#> 6 6 0.845           0.798       0.904         0.0206 0.982   0.910

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM711936     2  0.0000      0.991 0.000 1.000
#> GSM711938     2  0.0000      0.991 0.000 1.000
#> GSM711950     1  0.0000      0.993 1.000 0.000
#> GSM711956     1  0.0000      0.993 1.000 0.000
#> GSM711958     1  0.0000      0.993 1.000 0.000
#> GSM711960     1  0.0000      0.993 1.000 0.000
#> GSM711964     1  0.0000      0.993 1.000 0.000
#> GSM711966     1  0.0000      0.993 1.000 0.000
#> GSM711968     1  0.0000      0.993 1.000 0.000
#> GSM711972     1  0.0000      0.993 1.000 0.000
#> GSM711976     1  0.0000      0.993 1.000 0.000
#> GSM711980     1  0.0000      0.993 1.000 0.000
#> GSM711986     1  0.0000      0.993 1.000 0.000
#> GSM711904     1  0.0000      0.993 1.000 0.000
#> GSM711906     1  0.0000      0.993 1.000 0.000
#> GSM711908     1  0.0000      0.993 1.000 0.000
#> GSM711910     1  0.0000      0.993 1.000 0.000
#> GSM711914     1  0.0000      0.993 1.000 0.000
#> GSM711916     1  0.0000      0.993 1.000 0.000
#> GSM711922     1  0.0000      0.993 1.000 0.000
#> GSM711924     1  0.0000      0.993 1.000 0.000
#> GSM711926     2  0.1633      0.970 0.024 0.976
#> GSM711928     1  0.0000      0.993 1.000 0.000
#> GSM711930     1  0.0000      0.993 1.000 0.000
#> GSM711932     1  0.0000      0.993 1.000 0.000
#> GSM711934     1  0.0000      0.993 1.000 0.000
#> GSM711940     1  0.0000      0.993 1.000 0.000
#> GSM711942     1  0.0000      0.993 1.000 0.000
#> GSM711944     1  0.0000      0.993 1.000 0.000
#> GSM711946     1  0.0000      0.993 1.000 0.000
#> GSM711948     1  0.0000      0.993 1.000 0.000
#> GSM711952     1  0.0000      0.993 1.000 0.000
#> GSM711954     1  0.0000      0.993 1.000 0.000
#> GSM711962     1  0.0000      0.993 1.000 0.000
#> GSM711970     1  0.0000      0.993 1.000 0.000
#> GSM711974     1  0.0000      0.993 1.000 0.000
#> GSM711978     1  0.0000      0.993 1.000 0.000
#> GSM711988     1  0.0000      0.993 1.000 0.000
#> GSM711990     1  0.0000      0.993 1.000 0.000
#> GSM711992     1  0.0000      0.993 1.000 0.000
#> GSM711982     1  0.0000      0.993 1.000 0.000
#> GSM711984     2  0.0000      0.991 0.000 1.000
#> GSM711912     1  0.0000      0.993 1.000 0.000
#> GSM711918     1  0.0000      0.993 1.000 0.000
#> GSM711920     1  0.0000      0.993 1.000 0.000
#> GSM711937     2  0.0000      0.991 0.000 1.000
#> GSM711939     2  0.0000      0.991 0.000 1.000
#> GSM711951     2  0.0000      0.991 0.000 1.000
#> GSM711957     1  0.0000      0.993 1.000 0.000
#> GSM711959     2  0.0000      0.991 0.000 1.000
#> GSM711961     2  0.0000      0.991 0.000 1.000
#> GSM711965     1  0.0000      0.993 1.000 0.000
#> GSM711967     1  0.0000      0.993 1.000 0.000
#> GSM711969     2  0.0000      0.991 0.000 1.000
#> GSM711973     1  0.0000      0.993 1.000 0.000
#> GSM711977     1  0.0000      0.993 1.000 0.000
#> GSM711981     1  0.9754      0.301 0.592 0.408
#> GSM711987     2  0.0000      0.991 0.000 1.000
#> GSM711905     2  0.0000      0.991 0.000 1.000
#> GSM711907     2  0.0000      0.991 0.000 1.000
#> GSM711909     1  0.0000      0.993 1.000 0.000
#> GSM711911     1  0.0000      0.993 1.000 0.000
#> GSM711915     1  0.0376      0.989 0.996 0.004
#> GSM711917     2  0.0000      0.991 0.000 1.000
#> GSM711923     1  0.0000      0.993 1.000 0.000
#> GSM711925     2  0.0000      0.991 0.000 1.000
#> GSM711927     1  0.0000      0.993 1.000 0.000
#> GSM711929     2  0.0000      0.991 0.000 1.000
#> GSM711931     2  0.0000      0.991 0.000 1.000
#> GSM711933     1  0.0000      0.993 1.000 0.000
#> GSM711935     2  0.0000      0.991 0.000 1.000
#> GSM711941     1  0.0000      0.993 1.000 0.000
#> GSM711943     1  0.0000      0.993 1.000 0.000
#> GSM711945     1  0.0376      0.989 0.996 0.004
#> GSM711947     2  0.6801      0.779 0.180 0.820
#> GSM711949     2  0.0000      0.991 0.000 1.000
#> GSM711953     2  0.0000      0.991 0.000 1.000
#> GSM711955     1  0.0000      0.993 1.000 0.000
#> GSM711963     2  0.0000      0.991 0.000 1.000
#> GSM711971     1  0.0000      0.993 1.000 0.000
#> GSM711975     2  0.0000      0.991 0.000 1.000
#> GSM711979     1  0.0000      0.993 1.000 0.000
#> GSM711989     2  0.0000      0.991 0.000 1.000
#> GSM711991     1  0.2236      0.957 0.964 0.036
#> GSM711993     2  0.0672      0.985 0.008 0.992
#> GSM711983     1  0.0000      0.993 1.000 0.000
#> GSM711985     2  0.0000      0.991 0.000 1.000
#> GSM711913     1  0.0376      0.989 0.996 0.004
#> GSM711919     1  0.0000      0.993 1.000 0.000
#> GSM711921     1  0.0000      0.993 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
#> GSM711936     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711938     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711950     3  0.6309    0.01724 0.496 0.000 0.504
#> GSM711956     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711958     1  0.3752    0.76501 0.856 0.000 0.144
#> GSM711960     3  0.5968    0.45252 0.364 0.000 0.636
#> GSM711964     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711966     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711968     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711972     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711976     1  0.0747    0.88525 0.984 0.000 0.016
#> GSM711980     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711986     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711904     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711906     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711908     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711910     3  0.1031    0.85867 0.024 0.000 0.976
#> GSM711914     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711916     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711922     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711924     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711926     3  0.7394    0.05719 0.472 0.032 0.496
#> GSM711928     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711930     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711932     1  0.4555    0.69453 0.800 0.000 0.200
#> GSM711934     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711940     1  0.6308   -0.03890 0.508 0.000 0.492
#> GSM711942     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711944     3  0.2066    0.85029 0.060 0.000 0.940
#> GSM711946     3  0.0747    0.85393 0.016 0.000 0.984
#> GSM711948     1  0.6286    0.04046 0.536 0.000 0.464
#> GSM711952     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711954     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711962     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711970     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711974     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711978     1  0.6309   -0.06364 0.500 0.000 0.500
#> GSM711988     1  0.1860    0.85642 0.948 0.000 0.052
#> GSM711990     3  0.1031    0.85867 0.024 0.000 0.976
#> GSM711992     1  0.6309   -0.04835 0.504 0.000 0.496
#> GSM711982     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711984     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711912     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711918     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711920     1  0.0000    0.89655 1.000 0.000 0.000
#> GSM711937     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711939     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711951     2  0.6309    0.03483 0.000 0.504 0.496
#> GSM711957     1  0.5058    0.62810 0.756 0.000 0.244
#> GSM711959     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711961     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711965     3  0.0424    0.85265 0.008 0.000 0.992
#> GSM711967     1  0.5058    0.62810 0.756 0.000 0.244
#> GSM711969     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711973     3  0.5431    0.60921 0.284 0.000 0.716
#> GSM711977     3  0.0000    0.84905 0.000 0.000 1.000
#> GSM711981     3  0.8163    0.52625 0.124 0.248 0.628
#> GSM711987     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711905     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711907     2  0.4605    0.69114 0.000 0.796 0.204
#> GSM711909     3  0.1031    0.85867 0.024 0.000 0.976
#> GSM711911     3  0.1031    0.85867 0.024 0.000 0.976
#> GSM711915     3  0.0000    0.84905 0.000 0.000 1.000
#> GSM711917     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711923     3  0.2959    0.82144 0.100 0.000 0.900
#> GSM711925     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711927     3  0.1031    0.85867 0.024 0.000 0.976
#> GSM711929     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711931     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711933     1  0.4974    0.64125 0.764 0.000 0.236
#> GSM711935     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711941     3  0.3340    0.80637 0.120 0.000 0.880
#> GSM711943     3  0.3192    0.81360 0.112 0.000 0.888
#> GSM711945     3  0.0424    0.85265 0.008 0.000 0.992
#> GSM711947     2  0.6299    0.08555 0.000 0.524 0.476
#> GSM711949     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711953     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711955     3  0.3752    0.79496 0.144 0.000 0.856
#> GSM711963     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711971     3  0.1031    0.85867 0.024 0.000 0.976
#> GSM711975     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711979     3  0.6309    0.00134 0.500 0.000 0.500
#> GSM711989     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711991     3  0.0000    0.84905 0.000 0.000 1.000
#> GSM711993     2  0.6309    0.03483 0.000 0.504 0.496
#> GSM711983     3  0.1031    0.85867 0.024 0.000 0.976
#> GSM711985     2  0.0000    0.92132 0.000 1.000 0.000
#> GSM711913     3  0.0000    0.84905 0.000 0.000 1.000
#> GSM711919     3  0.1031    0.85867 0.024 0.000 0.976
#> GSM711921     3  0.1031    0.85867 0.024 0.000 0.976

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711950     4  0.0336     0.8954 0.008 0.000 0.000 0.992
#> GSM711956     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711958     1  0.2216     0.8838 0.908 0.000 0.000 0.092
#> GSM711960     3  0.1211     0.9158 0.040 0.000 0.960 0.000
#> GSM711964     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711976     1  0.0921     0.9542 0.972 0.000 0.000 0.028
#> GSM711980     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711906     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711910     3  0.0000     0.9563 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711924     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711926     4  0.0000     0.8987 0.000 0.000 0.000 1.000
#> GSM711928     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711932     1  0.4164     0.6306 0.736 0.000 0.000 0.264
#> GSM711934     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711940     4  0.0592     0.8911 0.016 0.000 0.000 0.984
#> GSM711942     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711944     3  0.4985     0.0668 0.000 0.000 0.532 0.468
#> GSM711946     4  0.0469     0.8938 0.000 0.000 0.012 0.988
#> GSM711948     4  0.4543     0.5456 0.324 0.000 0.000 0.676
#> GSM711952     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711954     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711962     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711970     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711974     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0000     0.8987 0.000 0.000 0.000 1.000
#> GSM711988     1  0.0817     0.9566 0.976 0.000 0.000 0.024
#> GSM711990     3  0.0000     0.9563 0.000 0.000 1.000 0.000
#> GSM711992     4  0.0000     0.8987 0.000 0.000 0.000 1.000
#> GSM711982     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000     0.9772 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711951     4  0.0000     0.8987 0.000 0.000 0.000 1.000
#> GSM711957     4  0.4817     0.3713 0.388 0.000 0.000 0.612
#> GSM711959     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711965     4  0.1302     0.8723 0.000 0.000 0.044 0.956
#> GSM711967     4  0.4855     0.3365 0.400 0.000 0.000 0.600
#> GSM711969     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711973     4  0.3311     0.7429 0.000 0.000 0.172 0.828
#> GSM711977     3  0.0592     0.9436 0.000 0.000 0.984 0.016
#> GSM711981     4  0.0000     0.8987 0.000 0.000 0.000 1.000
#> GSM711987     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711907     2  0.3688     0.7266 0.000 0.792 0.000 0.208
#> GSM711909     3  0.0000     0.9563 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000     0.9563 0.000 0.000 1.000 0.000
#> GSM711915     3  0.0000     0.9563 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0000     0.8987 0.000 0.000 0.000 1.000
#> GSM711925     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000     0.9563 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711931     2  0.0188     0.9851 0.000 0.996 0.000 0.004
#> GSM711933     1  0.3975     0.6650 0.760 0.000 0.000 0.240
#> GSM711935     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0000     0.8987 0.000 0.000 0.000 1.000
#> GSM711943     4  0.0000     0.8987 0.000 0.000 0.000 1.000
#> GSM711945     4  0.0000     0.8987 0.000 0.000 0.000 1.000
#> GSM711947     4  0.4136     0.7011 0.000 0.196 0.016 0.788
#> GSM711949     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711955     4  0.2988     0.8114 0.012 0.000 0.112 0.876
#> GSM711963     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0000     0.9563 0.000 0.000 1.000 0.000
#> GSM711975     2  0.0188     0.9851 0.000 0.996 0.000 0.004
#> GSM711979     4  0.0000     0.8987 0.000 0.000 0.000 1.000
#> GSM711989     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711991     4  0.0469     0.8938 0.000 0.000 0.012 0.988
#> GSM711993     4  0.0000     0.8987 0.000 0.000 0.000 1.000
#> GSM711983     3  0.0000     0.9563 0.000 0.000 1.000 0.000
#> GSM711985     2  0.0000     0.9886 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0000     0.9563 0.000 0.000 1.000 0.000
#> GSM711919     3  0.0000     0.9563 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000     0.9563 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.1965      0.891 0.000 0.904 0.000 0.096 0.000
#> GSM711938     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711950     4  0.3752      0.738 0.000 0.000 0.000 0.708 0.292
#> GSM711956     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711958     5  0.0162      0.797 0.004 0.000 0.000 0.000 0.996
#> GSM711960     5  0.1638      0.770 0.004 0.000 0.064 0.000 0.932
#> GSM711964     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711966     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711968     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711972     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711976     1  0.4475      0.485 0.692 0.000 0.000 0.032 0.276
#> GSM711980     5  0.3707      0.653 0.284 0.000 0.000 0.000 0.716
#> GSM711986     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711904     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711906     5  0.4262      0.383 0.440 0.000 0.000 0.000 0.560
#> GSM711908     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711910     3  0.0000      0.950 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711916     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711922     5  0.4307      0.169 0.500 0.000 0.000 0.000 0.500
#> GSM711924     5  0.0162      0.797 0.004 0.000 0.000 0.000 0.996
#> GSM711926     4  0.0000      0.802 0.000 0.000 0.000 1.000 0.000
#> GSM711928     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711930     1  0.0162      0.932 0.996 0.000 0.000 0.000 0.004
#> GSM711932     5  0.0880      0.789 0.000 0.000 0.000 0.032 0.968
#> GSM711934     1  0.3837      0.462 0.692 0.000 0.000 0.000 0.308
#> GSM711940     4  0.4390      0.560 0.004 0.000 0.000 0.568 0.428
#> GSM711942     5  0.3752      0.645 0.292 0.000 0.000 0.000 0.708
#> GSM711944     5  0.0000      0.795 0.000 0.000 0.000 0.000 1.000
#> GSM711946     4  0.3586      0.784 0.000 0.000 0.020 0.792 0.188
#> GSM711948     5  0.0000      0.795 0.000 0.000 0.000 0.000 1.000
#> GSM711952     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711954     5  0.4030      0.566 0.352 0.000 0.000 0.000 0.648
#> GSM711962     5  0.3586      0.671 0.264 0.000 0.000 0.000 0.736
#> GSM711970     5  0.3752      0.645 0.292 0.000 0.000 0.000 0.708
#> GSM711974     1  0.3816      0.456 0.696 0.000 0.000 0.000 0.304
#> GSM711978     4  0.0000      0.802 0.000 0.000 0.000 1.000 0.000
#> GSM711988     5  0.0162      0.795 0.000 0.000 0.000 0.004 0.996
#> GSM711990     3  0.1121      0.927 0.000 0.000 0.956 0.000 0.044
#> GSM711992     4  0.0000      0.802 0.000 0.000 0.000 1.000 0.000
#> GSM711982     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711984     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711912     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711918     1  0.0000      0.936 1.000 0.000 0.000 0.000 0.000
#> GSM711920     5  0.0880      0.789 0.000 0.000 0.000 0.032 0.968
#> GSM711937     2  0.0290      0.947 0.000 0.992 0.000 0.008 0.000
#> GSM711939     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711951     4  0.0000      0.802 0.000 0.000 0.000 1.000 0.000
#> GSM711957     5  0.1732      0.767 0.000 0.000 0.000 0.080 0.920
#> GSM711959     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711965     4  0.4025      0.734 0.000 0.000 0.008 0.700 0.292
#> GSM711967     5  0.1732      0.767 0.000 0.000 0.000 0.080 0.920
#> GSM711969     2  0.0162      0.949 0.000 0.996 0.000 0.004 0.000
#> GSM711973     4  0.4307      0.427 0.000 0.000 0.000 0.500 0.500
#> GSM711977     3  0.5037      0.590 0.000 0.000 0.684 0.088 0.228
#> GSM711981     4  0.0000      0.802 0.000 0.000 0.000 1.000 0.000
#> GSM711987     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711907     2  0.3452      0.763 0.000 0.756 0.000 0.244 0.000
#> GSM711909     3  0.0000      0.950 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.0000      0.950 0.000 0.000 1.000 0.000 0.000
#> GSM711915     3  0.0162      0.948 0.000 0.000 0.996 0.000 0.004
#> GSM711917     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711923     4  0.3177      0.770 0.000 0.000 0.000 0.792 0.208
#> GSM711925     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0000      0.950 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711931     2  0.3534      0.749 0.000 0.744 0.000 0.256 0.000
#> GSM711933     5  0.0162      0.797 0.004 0.000 0.000 0.000 0.996
#> GSM711935     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.3730      0.736 0.000 0.000 0.000 0.712 0.288
#> GSM711943     4  0.0000      0.802 0.000 0.000 0.000 1.000 0.000
#> GSM711945     4  0.0880      0.797 0.000 0.000 0.000 0.968 0.032
#> GSM711947     4  0.6386      0.298 0.000 0.188 0.320 0.492 0.000
#> GSM711949     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711955     5  0.0000      0.795 0.000 0.000 0.000 0.000 1.000
#> GSM711963     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0000      0.950 0.000 0.000 1.000 0.000 0.000
#> GSM711975     2  0.3336      0.780 0.000 0.772 0.000 0.228 0.000
#> GSM711979     4  0.3210      0.768 0.000 0.000 0.000 0.788 0.212
#> GSM711989     2  0.3274      0.788 0.000 0.780 0.000 0.220 0.000
#> GSM711991     4  0.4250      0.629 0.000 0.000 0.252 0.720 0.028
#> GSM711993     4  0.0000      0.802 0.000 0.000 0.000 1.000 0.000
#> GSM711983     3  0.0880      0.934 0.000 0.000 0.968 0.000 0.032
#> GSM711985     2  0.0000      0.951 0.000 1.000 0.000 0.000 0.000
#> GSM711913     3  0.2127      0.855 0.000 0.000 0.892 0.000 0.108
#> GSM711919     3  0.0000      0.950 0.000 0.000 1.000 0.000 0.000
#> GSM711921     3  0.0000      0.950 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.0622      0.936 0.000 0.980 0.000 0.008 0.012 0.000
#> GSM711938     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711950     4  0.4982      0.633 0.176 0.000 0.000 0.648 0.176 0.000
#> GSM711956     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711958     1  0.0000      0.814 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711960     1  0.0000      0.814 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711964     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711966     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711968     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711972     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711976     6  0.4515      0.457 0.056 0.000 0.000 0.304 0.000 0.640
#> GSM711980     1  0.2300      0.777 0.856 0.000 0.000 0.000 0.000 0.144
#> GSM711986     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711904     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711906     1  0.3547      0.572 0.668 0.000 0.000 0.000 0.000 0.332
#> GSM711908     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711910     3  0.0000      0.861 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711914     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711916     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711922     1  0.3717      0.437 0.616 0.000 0.000 0.000 0.000 0.384
#> GSM711924     1  0.0000      0.814 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711926     4  0.0790      0.763 0.000 0.000 0.000 0.968 0.032 0.000
#> GSM711928     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711930     6  0.0146      0.919 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM711932     1  0.2300      0.763 0.856 0.000 0.000 0.144 0.000 0.000
#> GSM711934     6  0.3620      0.370 0.352 0.000 0.000 0.000 0.000 0.648
#> GSM711940     4  0.3869      0.283 0.500 0.000 0.000 0.500 0.000 0.000
#> GSM711942     1  0.2597      0.759 0.824 0.000 0.000 0.000 0.000 0.176
#> GSM711944     1  0.0000      0.814 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711946     4  0.5035      0.629 0.168 0.000 0.000 0.640 0.192 0.000
#> GSM711948     1  0.0000      0.814 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711952     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711954     1  0.3221      0.685 0.736 0.000 0.000 0.000 0.000 0.264
#> GSM711962     1  0.0790      0.809 0.968 0.000 0.000 0.000 0.000 0.032
#> GSM711970     1  0.2597      0.759 0.824 0.000 0.000 0.000 0.000 0.176
#> GSM711974     6  0.3797      0.173 0.420 0.000 0.000 0.000 0.000 0.580
#> GSM711978     4  0.0000      0.770 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711988     1  0.0000      0.814 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711990     3  0.4953      0.484 0.172 0.000 0.652 0.000 0.176 0.000
#> GSM711992     4  0.0790      0.763 0.000 0.000 0.000 0.968 0.032 0.000
#> GSM711982     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711984     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711912     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711918     6  0.0000      0.923 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711920     1  0.2300      0.763 0.856 0.000 0.000 0.144 0.000 0.000
#> GSM711937     2  0.0146      0.946 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711939     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711951     4  0.1075      0.764 0.000 0.000 0.000 0.952 0.048 0.000
#> GSM711957     1  0.3499      0.579 0.680 0.000 0.000 0.320 0.000 0.000
#> GSM711959     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711961     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711965     4  0.5093      0.625 0.176 0.000 0.000 0.632 0.192 0.000
#> GSM711967     1  0.3515      0.573 0.676 0.000 0.000 0.324 0.000 0.000
#> GSM711969     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711973     5  0.0790      0.945 0.000 0.000 0.000 0.032 0.968 0.000
#> GSM711977     5  0.1075      0.961 0.000 0.000 0.048 0.000 0.952 0.000
#> GSM711981     4  0.1075      0.764 0.000 0.000 0.000 0.952 0.048 0.000
#> GSM711987     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     2  0.4313      0.587 0.000 0.668 0.000 0.284 0.048 0.000
#> GSM711909     3  0.0000      0.861 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711911     3  0.0000      0.861 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711915     5  0.0790      0.975 0.000 0.000 0.032 0.000 0.968 0.000
#> GSM711917     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711923     4  0.1151      0.764 0.032 0.000 0.000 0.956 0.012 0.000
#> GSM711925     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.0000      0.861 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711929     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     2  0.4319      0.512 0.000 0.620 0.000 0.348 0.032 0.000
#> GSM711933     1  0.0000      0.814 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711935     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     4  0.4235      0.677 0.084 0.000 0.000 0.724 0.192 0.000
#> GSM711943     4  0.0000      0.770 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711945     4  0.4843      0.633 0.144 0.000 0.000 0.664 0.192 0.000
#> GSM711947     3  0.4681      0.534 0.000 0.188 0.708 0.088 0.016 0.000
#> GSM711949     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     1  0.2378      0.664 0.848 0.000 0.000 0.000 0.152 0.000
#> GSM711963     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.0000      0.861 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711975     2  0.3139      0.784 0.000 0.816 0.000 0.152 0.032 0.000
#> GSM711979     4  0.0790      0.765 0.032 0.000 0.000 0.968 0.000 0.000
#> GSM711989     2  0.1789      0.892 0.000 0.924 0.000 0.044 0.032 0.000
#> GSM711991     4  0.5620      0.611 0.136 0.000 0.040 0.632 0.192 0.000
#> GSM711993     4  0.0790      0.763 0.000 0.000 0.000 0.968 0.032 0.000
#> GSM711983     3  0.4728      0.515 0.144 0.000 0.680 0.000 0.176 0.000
#> GSM711985     2  0.0000      0.949 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711913     5  0.0790      0.975 0.000 0.000 0.032 0.000 0.968 0.000
#> GSM711919     3  0.0000      0.861 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711921     3  0.0000      0.861 0.000 0.000 1.000 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 tissue(p) disease.state(p) individual(p) k
#> MAD:pam 89  5.55e-05            0.219         0.616 2
#> MAD:pam 79  2.25e-10            0.343         0.657 3
#> MAD:pam 87  7.89e-10            0.131         0.413 4
#> MAD:pam 83  8.12e-08            0.145         0.221 5
#> MAD:pam 84  2.21e-08            0.178         0.197 6

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


MAD:mclust**

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 27425 rows and 90 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 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 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 1.000           0.975       0.986         0.4092 0.594   0.594
#> 3 3 0.790           0.859       0.914         0.5566 0.716   0.533
#> 4 4 0.961           0.920       0.968         0.1266 0.931   0.802
#> 5 5 0.796           0.790       0.889         0.0595 0.909   0.705
#> 6 6 0.725           0.611       0.759         0.0520 0.928   0.714

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM711936     2   0.000      0.987 0.000 1.000
#> GSM711938     2   0.000      0.987 0.000 1.000
#> GSM711950     1   0.000      0.984 1.000 0.000
#> GSM711956     1   0.000      0.984 1.000 0.000
#> GSM711958     1   0.000      0.984 1.000 0.000
#> GSM711960     1   0.000      0.984 1.000 0.000
#> GSM711964     1   0.000      0.984 1.000 0.000
#> GSM711966     1   0.000      0.984 1.000 0.000
#> GSM711968     1   0.000      0.984 1.000 0.000
#> GSM711972     1   0.000      0.984 1.000 0.000
#> GSM711976     1   0.000      0.984 1.000 0.000
#> GSM711980     1   0.000      0.984 1.000 0.000
#> GSM711986     1   0.000      0.984 1.000 0.000
#> GSM711904     1   0.000      0.984 1.000 0.000
#> GSM711906     1   0.000      0.984 1.000 0.000
#> GSM711908     1   0.000      0.984 1.000 0.000
#> GSM711910     1   0.343      0.948 0.936 0.064
#> GSM711914     1   0.000      0.984 1.000 0.000
#> GSM711916     1   0.000      0.984 1.000 0.000
#> GSM711922     1   0.000      0.984 1.000 0.000
#> GSM711924     1   0.000      0.984 1.000 0.000
#> GSM711926     1   0.000      0.984 1.000 0.000
#> GSM711928     1   0.000      0.984 1.000 0.000
#> GSM711930     1   0.000      0.984 1.000 0.000
#> GSM711932     1   0.000      0.984 1.000 0.000
#> GSM711934     1   0.000      0.984 1.000 0.000
#> GSM711940     1   0.000      0.984 1.000 0.000
#> GSM711942     1   0.000      0.984 1.000 0.000
#> GSM711944     1   0.000      0.984 1.000 0.000
#> GSM711946     1   0.311      0.953 0.944 0.056
#> GSM711948     1   0.000      0.984 1.000 0.000
#> GSM711952     1   0.000      0.984 1.000 0.000
#> GSM711954     1   0.000      0.984 1.000 0.000
#> GSM711962     1   0.000      0.984 1.000 0.000
#> GSM711970     1   0.000      0.984 1.000 0.000
#> GSM711974     1   0.000      0.984 1.000 0.000
#> GSM711978     1   0.000      0.984 1.000 0.000
#> GSM711988     1   0.000      0.984 1.000 0.000
#> GSM711990     1   0.242      0.964 0.960 0.040
#> GSM711992     1   0.000      0.984 1.000 0.000
#> GSM711982     1   0.000      0.984 1.000 0.000
#> GSM711984     2   0.000      0.987 0.000 1.000
#> GSM711912     1   0.000      0.984 1.000 0.000
#> GSM711918     1   0.000      0.984 1.000 0.000
#> GSM711920     1   0.000      0.984 1.000 0.000
#> GSM711937     2   0.000      0.987 0.000 1.000
#> GSM711939     2   0.000      0.987 0.000 1.000
#> GSM711951     2   0.000      0.987 0.000 1.000
#> GSM711957     1   0.000      0.984 1.000 0.000
#> GSM711959     2   0.000      0.987 0.000 1.000
#> GSM711961     2   0.000      0.987 0.000 1.000
#> GSM711965     1   0.118      0.977 0.984 0.016
#> GSM711967     1   0.000      0.984 1.000 0.000
#> GSM711969     2   0.000      0.987 0.000 1.000
#> GSM711973     1   0.000      0.984 1.000 0.000
#> GSM711977     1   0.295      0.956 0.948 0.052
#> GSM711981     2   0.644      0.806 0.164 0.836
#> GSM711987     2   0.000      0.987 0.000 1.000
#> GSM711905     2   0.000      0.987 0.000 1.000
#> GSM711907     2   0.000      0.987 0.000 1.000
#> GSM711909     1   0.343      0.948 0.936 0.064
#> GSM711911     1   0.343      0.948 0.936 0.064
#> GSM711915     1   0.343      0.948 0.936 0.064
#> GSM711917     2   0.000      0.987 0.000 1.000
#> GSM711923     1   0.000      0.984 1.000 0.000
#> GSM711925     2   0.000      0.987 0.000 1.000
#> GSM711927     1   0.343      0.948 0.936 0.064
#> GSM711929     2   0.000      0.987 0.000 1.000
#> GSM711931     2   0.000      0.987 0.000 1.000
#> GSM711933     1   0.000      0.984 1.000 0.000
#> GSM711935     2   0.000      0.987 0.000 1.000
#> GSM711941     1   0.000      0.984 1.000 0.000
#> GSM711943     1   0.204      0.968 0.968 0.032
#> GSM711945     1   0.224      0.966 0.964 0.036
#> GSM711947     1   0.343      0.948 0.936 0.064
#> GSM711949     2   0.000      0.987 0.000 1.000
#> GSM711953     2   0.000      0.987 0.000 1.000
#> GSM711955     1   0.000      0.984 1.000 0.000
#> GSM711963     2   0.000      0.987 0.000 1.000
#> GSM711971     1   0.343      0.948 0.936 0.064
#> GSM711975     2   0.000      0.987 0.000 1.000
#> GSM711979     1   0.000      0.984 1.000 0.000
#> GSM711989     2   0.000      0.987 0.000 1.000
#> GSM711991     1   0.343      0.948 0.936 0.064
#> GSM711993     2   0.574      0.846 0.136 0.864
#> GSM711983     1   0.343      0.948 0.936 0.064
#> GSM711985     2   0.000      0.987 0.000 1.000
#> GSM711913     1   0.295      0.956 0.948 0.052
#> GSM711919     1   0.343      0.948 0.936 0.064
#> GSM711921     1   0.343      0.948 0.936 0.064

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM711936     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711938     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711950     3  0.5968      0.699 0.364 0.000 0.636
#> GSM711956     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711958     1  0.1643      0.954 0.956 0.000 0.044
#> GSM711960     1  0.2711      0.922 0.912 0.000 0.088
#> GSM711964     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711966     1  0.0237      0.950 0.996 0.000 0.004
#> GSM711968     1  0.0424      0.951 0.992 0.000 0.008
#> GSM711972     1  0.1643      0.954 0.956 0.000 0.044
#> GSM711976     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711980     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711986     1  0.1860      0.951 0.948 0.000 0.052
#> GSM711904     1  0.1643      0.954 0.956 0.000 0.044
#> GSM711906     1  0.1860      0.951 0.948 0.000 0.052
#> GSM711908     1  0.1860      0.951 0.948 0.000 0.052
#> GSM711910     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711914     1  0.1643      0.954 0.956 0.000 0.044
#> GSM711916     1  0.1860      0.951 0.948 0.000 0.052
#> GSM711922     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711924     1  0.1860      0.951 0.948 0.000 0.052
#> GSM711926     3  0.6126      0.713 0.352 0.004 0.644
#> GSM711928     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711930     1  0.1860      0.951 0.948 0.000 0.052
#> GSM711932     1  0.4974      0.558 0.764 0.000 0.236
#> GSM711934     1  0.0424      0.951 0.992 0.000 0.008
#> GSM711940     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711942     1  0.1860      0.951 0.948 0.000 0.052
#> GSM711944     3  0.5560      0.710 0.300 0.000 0.700
#> GSM711946     3  0.5882      0.718 0.348 0.000 0.652
#> GSM711948     1  0.1411      0.921 0.964 0.000 0.036
#> GSM711952     1  0.1860      0.951 0.948 0.000 0.052
#> GSM711954     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711962     1  0.1643      0.954 0.956 0.000 0.044
#> GSM711970     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711974     1  0.1643      0.954 0.956 0.000 0.044
#> GSM711978     3  0.6126      0.713 0.352 0.004 0.644
#> GSM711988     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711990     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711992     3  0.6126      0.713 0.352 0.004 0.644
#> GSM711982     1  0.1860      0.951 0.948 0.000 0.052
#> GSM711984     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711912     1  0.1860      0.951 0.948 0.000 0.052
#> GSM711918     1  0.1860      0.951 0.948 0.000 0.052
#> GSM711920     1  0.1643      0.954 0.956 0.000 0.044
#> GSM711937     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711939     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711951     2  0.6079      0.315 0.000 0.612 0.388
#> GSM711957     3  0.5835      0.660 0.340 0.000 0.660
#> GSM711959     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711961     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711965     3  0.5882      0.718 0.348 0.000 0.652
#> GSM711967     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711969     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711973     3  0.5591      0.707 0.304 0.000 0.696
#> GSM711977     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711981     3  0.7778      0.577 0.092 0.264 0.644
#> GSM711987     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711905     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711907     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711909     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711911     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711915     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711917     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711923     3  0.5905      0.714 0.352 0.000 0.648
#> GSM711925     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711927     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711929     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711931     2  0.6045      0.337 0.000 0.620 0.380
#> GSM711933     1  0.0000      0.949 1.000 0.000 0.000
#> GSM711935     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711941     3  0.5926      0.710 0.356 0.000 0.644
#> GSM711943     3  0.5905      0.714 0.352 0.000 0.648
#> GSM711945     3  0.5882      0.718 0.348 0.000 0.652
#> GSM711947     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711949     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711955     1  0.4002      0.733 0.840 0.000 0.160
#> GSM711963     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711971     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711975     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711979     3  0.6126      0.713 0.352 0.004 0.644
#> GSM711989     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711991     3  0.0592      0.779 0.012 0.000 0.988
#> GSM711993     3  0.7558      0.546 0.072 0.284 0.644
#> GSM711983     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711985     2  0.0000      0.961 0.000 1.000 0.000
#> GSM711913     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711919     3  0.0000      0.778 0.000 0.000 1.000
#> GSM711921     3  0.0000      0.778 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711950     4  0.0336     0.9469 0.008 0.000 0.000 0.992
#> GSM711956     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711958     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711960     1  0.0921     0.9323 0.972 0.000 0.000 0.028
#> GSM711964     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711976     1  0.1211     0.9238 0.960 0.000 0.000 0.040
#> GSM711980     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711906     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711910     3  0.0000     0.9410 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711924     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711926     4  0.0188     0.9514 0.000 0.004 0.000 0.996
#> GSM711928     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711932     1  0.4916     0.2462 0.576 0.000 0.000 0.424
#> GSM711934     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711940     1  0.0817     0.9373 0.976 0.000 0.000 0.024
#> GSM711942     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711944     1  0.5510     0.0197 0.504 0.000 0.016 0.480
#> GSM711946     4  0.0188     0.9516 0.000 0.000 0.004 0.996
#> GSM711948     1  0.2647     0.8428 0.880 0.000 0.000 0.120
#> GSM711952     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711954     1  0.0469     0.9465 0.988 0.000 0.000 0.012
#> GSM711962     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711970     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711974     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0188     0.9514 0.000 0.004 0.000 0.996
#> GSM711988     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711990     3  0.0921     0.9251 0.000 0.000 0.972 0.028
#> GSM711992     4  0.0188     0.9514 0.000 0.004 0.000 0.996
#> GSM711982     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711951     2  0.0188     0.9952 0.000 0.996 0.000 0.004
#> GSM711957     4  0.3751     0.7263 0.196 0.000 0.004 0.800
#> GSM711959     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711965     4  0.0188     0.9516 0.000 0.000 0.004 0.996
#> GSM711967     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711969     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711973     4  0.4012     0.7344 0.184 0.000 0.016 0.800
#> GSM711977     3  0.4543     0.5501 0.000 0.000 0.676 0.324
#> GSM711981     4  0.0469     0.9458 0.000 0.012 0.000 0.988
#> GSM711987     2  0.0188     0.9971 0.000 0.996 0.000 0.004
#> GSM711905     2  0.0188     0.9971 0.000 0.996 0.000 0.004
#> GSM711907     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711909     3  0.0000     0.9410 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0188     0.9395 0.000 0.000 0.996 0.004
#> GSM711915     3  0.0000     0.9410 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0188     0.9516 0.000 0.000 0.004 0.996
#> GSM711925     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000     0.9410 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0188     0.9971 0.000 0.996 0.000 0.004
#> GSM711931     2  0.0188     0.9952 0.000 0.996 0.000 0.004
#> GSM711933     1  0.0000     0.9553 1.000 0.000 0.000 0.000
#> GSM711935     2  0.0188     0.9971 0.000 0.996 0.000 0.004
#> GSM711941     4  0.0188     0.9516 0.000 0.000 0.004 0.996
#> GSM711943     4  0.0188     0.9516 0.000 0.000 0.004 0.996
#> GSM711945     4  0.0188     0.9516 0.000 0.000 0.004 0.996
#> GSM711947     3  0.0000     0.9410 0.000 0.000 1.000 0.000
#> GSM711949     2  0.0188     0.9971 0.000 0.996 0.000 0.004
#> GSM711953     2  0.0188     0.9971 0.000 0.996 0.000 0.004
#> GSM711955     1  0.4925     0.2493 0.572 0.000 0.000 0.428
#> GSM711963     2  0.0188     0.9971 0.000 0.996 0.000 0.004
#> GSM711971     3  0.0336     0.9377 0.000 0.000 0.992 0.008
#> GSM711975     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711979     4  0.0188     0.9514 0.000 0.004 0.000 0.996
#> GSM711989     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711991     3  0.0000     0.9410 0.000 0.000 1.000 0.000
#> GSM711993     4  0.1637     0.8956 0.000 0.060 0.000 0.940
#> GSM711983     3  0.1022     0.9229 0.000 0.000 0.968 0.032
#> GSM711985     2  0.0000     0.9984 0.000 1.000 0.000 0.000
#> GSM711913     3  0.4543     0.5501 0.000 0.000 0.676 0.324
#> GSM711919     3  0.0000     0.9410 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000     0.9410 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.0290     0.9649 0.000 0.992 0.000 0.008 0.000
#> GSM711938     2  0.0000     0.9671 0.000 1.000 0.000 0.000 0.000
#> GSM711950     1  0.2707     0.7663 0.876 0.000 0.000 0.100 0.024
#> GSM711956     1  0.0510     0.8636 0.984 0.000 0.000 0.000 0.016
#> GSM711958     1  0.3395     0.6516 0.764 0.000 0.000 0.000 0.236
#> GSM711960     5  0.3300     0.7629 0.204 0.000 0.004 0.000 0.792
#> GSM711964     1  0.0162     0.8648 0.996 0.000 0.000 0.000 0.004
#> GSM711966     1  0.1121     0.8569 0.956 0.000 0.000 0.000 0.044
#> GSM711968     1  0.0880     0.8613 0.968 0.000 0.000 0.000 0.032
#> GSM711972     1  0.1341     0.8550 0.944 0.000 0.000 0.000 0.056
#> GSM711976     1  0.0703     0.8539 0.976 0.000 0.000 0.000 0.024
#> GSM711980     1  0.0162     0.8653 0.996 0.000 0.000 0.000 0.004
#> GSM711986     1  0.3452     0.6421 0.756 0.000 0.000 0.000 0.244
#> GSM711904     1  0.4138     0.1090 0.616 0.000 0.000 0.000 0.384
#> GSM711906     5  0.2127     0.7875 0.108 0.000 0.000 0.000 0.892
#> GSM711908     5  0.1851     0.7746 0.088 0.000 0.000 0.000 0.912
#> GSM711910     3  0.0000     0.7802 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.1197     0.8543 0.952 0.000 0.000 0.000 0.048
#> GSM711916     5  0.2773     0.7940 0.164 0.000 0.000 0.000 0.836
#> GSM711922     1  0.0000     0.8646 1.000 0.000 0.000 0.000 0.000
#> GSM711924     1  0.1851     0.8377 0.912 0.000 0.000 0.000 0.088
#> GSM711926     4  0.3207     0.8386 0.056 0.048 0.000 0.872 0.024
#> GSM711928     1  0.0000     0.8646 1.000 0.000 0.000 0.000 0.000
#> GSM711930     5  0.1851     0.7746 0.088 0.000 0.000 0.000 0.912
#> GSM711932     1  0.1386     0.8408 0.952 0.000 0.000 0.032 0.016
#> GSM711934     1  0.1121     0.8562 0.956 0.000 0.000 0.000 0.044
#> GSM711940     1  0.0000     0.8646 1.000 0.000 0.000 0.000 0.000
#> GSM711942     1  0.2179     0.8234 0.888 0.000 0.000 0.000 0.112
#> GSM711944     1  0.6784     0.0603 0.488 0.000 0.036 0.356 0.120
#> GSM711946     4  0.0771     0.8654 0.020 0.000 0.004 0.976 0.000
#> GSM711948     1  0.2230     0.8308 0.912 0.000 0.000 0.044 0.044
#> GSM711952     5  0.4307     0.2269 0.500 0.000 0.000 0.000 0.500
#> GSM711954     1  0.0000     0.8646 1.000 0.000 0.000 0.000 0.000
#> GSM711962     1  0.1732     0.8440 0.920 0.000 0.000 0.000 0.080
#> GSM711970     1  0.0000     0.8646 1.000 0.000 0.000 0.000 0.000
#> GSM711974     1  0.3796     0.5205 0.700 0.000 0.000 0.000 0.300
#> GSM711978     4  0.1943     0.8554 0.056 0.000 0.000 0.924 0.020
#> GSM711988     1  0.0000     0.8646 1.000 0.000 0.000 0.000 0.000
#> GSM711990     3  0.6152     0.3192 0.008 0.000 0.524 0.356 0.112
#> GSM711992     4  0.1628     0.8579 0.056 0.000 0.000 0.936 0.008
#> GSM711982     1  0.2329     0.8184 0.876 0.000 0.000 0.000 0.124
#> GSM711984     2  0.0000     0.9671 0.000 1.000 0.000 0.000 0.000
#> GSM711912     5  0.3796     0.7196 0.300 0.000 0.000 0.000 0.700
#> GSM711918     5  0.3684     0.7437 0.280 0.000 0.000 0.000 0.720
#> GSM711920     1  0.1792     0.8415 0.916 0.000 0.000 0.000 0.084
#> GSM711937     2  0.0000     0.9671 0.000 1.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.9671 0.000 1.000 0.000 0.000 0.000
#> GSM711951     2  0.1851     0.9112 0.000 0.912 0.000 0.088 0.000
#> GSM711957     4  0.4528     0.7147 0.104 0.000 0.000 0.752 0.144
#> GSM711959     2  0.0000     0.9671 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0162     0.9670 0.000 0.996 0.000 0.000 0.004
#> GSM711965     4  0.1082     0.8631 0.028 0.000 0.008 0.964 0.000
#> GSM711967     1  0.0290     0.8652 0.992 0.000 0.000 0.000 0.008
#> GSM711969     2  0.0000     0.9671 0.000 1.000 0.000 0.000 0.000
#> GSM711973     4  0.5505     0.5394 0.208 0.000 0.004 0.660 0.128
#> GSM711977     3  0.4305     0.2443 0.000 0.000 0.512 0.488 0.000
#> GSM711981     4  0.3601     0.7699 0.024 0.124 0.000 0.832 0.020
#> GSM711987     2  0.2171     0.9469 0.000 0.912 0.000 0.024 0.064
#> GSM711905     2  0.2171     0.9469 0.000 0.912 0.000 0.024 0.064
#> GSM711907     2  0.0290     0.9649 0.000 0.992 0.000 0.008 0.000
#> GSM711909     3  0.0000     0.7802 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.3983     0.5111 0.000 0.000 0.660 0.340 0.000
#> GSM711915     3  0.0000     0.7802 0.000 0.000 1.000 0.000 0.000
#> GSM711917     2  0.0000     0.9671 0.000 1.000 0.000 0.000 0.000
#> GSM711923     4  0.0865     0.8659 0.024 0.000 0.004 0.972 0.000
#> GSM711925     2  0.1410     0.9552 0.000 0.940 0.000 0.000 0.060
#> GSM711927     3  0.0000     0.7802 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.2171     0.9469 0.000 0.912 0.000 0.024 0.064
#> GSM711931     2  0.1012     0.9526 0.000 0.968 0.000 0.012 0.020
#> GSM711933     1  0.1270     0.8542 0.948 0.000 0.000 0.000 0.052
#> GSM711935     2  0.2171     0.9469 0.000 0.912 0.000 0.024 0.064
#> GSM711941     1  0.3779     0.6482 0.776 0.000 0.000 0.200 0.024
#> GSM711943     4  0.0771     0.8654 0.020 0.000 0.004 0.976 0.000
#> GSM711945     4  0.0771     0.8654 0.020 0.000 0.004 0.976 0.000
#> GSM711947     3  0.0963     0.7688 0.000 0.000 0.964 0.036 0.000
#> GSM711949     2  0.2171     0.9469 0.000 0.912 0.000 0.024 0.064
#> GSM711953     2  0.2171     0.9469 0.000 0.912 0.000 0.024 0.064
#> GSM711955     1  0.2585     0.8284 0.896 0.000 0.004 0.064 0.036
#> GSM711963     2  0.2171     0.9469 0.000 0.912 0.000 0.024 0.064
#> GSM711971     3  0.4425     0.6716 0.004 0.000 0.772 0.112 0.112
#> GSM711975     2  0.0404     0.9639 0.000 0.988 0.000 0.012 0.000
#> GSM711979     1  0.4086     0.5923 0.736 0.000 0.000 0.240 0.024
#> GSM711989     2  0.0290     0.9649 0.000 0.992 0.000 0.008 0.000
#> GSM711991     3  0.2516     0.7326 0.000 0.000 0.860 0.140 0.000
#> GSM711993     4  0.4320     0.7568 0.052 0.132 0.000 0.792 0.024
#> GSM711983     3  0.6152     0.3192 0.008 0.000 0.524 0.356 0.112
#> GSM711985     2  0.0000     0.9671 0.000 1.000 0.000 0.000 0.000
#> GSM711913     3  0.4291     0.2998 0.000 0.000 0.536 0.464 0.000
#> GSM711919     3  0.0404     0.7777 0.000 0.000 0.988 0.000 0.012
#> GSM711921     3  0.0000     0.7802 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.0146    0.78240 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711938     2  0.0547    0.77826 0.000 0.980 0.000 0.000 0.020 0.000
#> GSM711950     4  0.6130    0.46921 0.272 0.000 0.000 0.432 0.292 0.004
#> GSM711956     1  0.0000    0.76211 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711958     1  0.2164    0.71513 0.900 0.000 0.000 0.032 0.000 0.068
#> GSM711960     6  0.6584    0.25830 0.284 0.000 0.256 0.032 0.000 0.428
#> GSM711964     1  0.0000    0.76211 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711966     1  0.0000    0.76211 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711968     1  0.0000    0.76211 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711972     1  0.0547    0.75376 0.980 0.000 0.000 0.000 0.000 0.020
#> GSM711976     1  0.2846    0.72792 0.856 0.000 0.000 0.060 0.000 0.084
#> GSM711980     1  0.1663    0.75421 0.912 0.000 0.000 0.000 0.000 0.088
#> GSM711986     6  0.3810    0.58931 0.428 0.000 0.000 0.000 0.000 0.572
#> GSM711904     1  0.4697    0.24386 0.688 0.000 0.000 0.004 0.108 0.200
#> GSM711906     6  0.3595    0.66849 0.288 0.000 0.000 0.000 0.008 0.704
#> GSM711908     6  0.1610    0.56556 0.084 0.000 0.000 0.000 0.000 0.916
#> GSM711910     3  0.0000    0.83433 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711914     1  0.0000    0.76211 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711916     6  0.3890    0.39024 0.400 0.000 0.000 0.000 0.004 0.596
#> GSM711922     1  0.2060    0.75186 0.900 0.000 0.000 0.016 0.000 0.084
#> GSM711924     1  0.1257    0.75070 0.952 0.000 0.000 0.020 0.000 0.028
#> GSM711926     4  0.4086    0.67486 0.000 0.008 0.000 0.528 0.464 0.000
#> GSM711928     1  0.1610    0.75266 0.916 0.000 0.000 0.000 0.000 0.084
#> GSM711930     6  0.1610    0.56556 0.084 0.000 0.000 0.000 0.000 0.916
#> GSM711932     1  0.7028   -0.18841 0.384 0.000 0.000 0.340 0.192 0.084
#> GSM711934     1  0.1755    0.74256 0.932 0.000 0.000 0.032 0.008 0.028
#> GSM711940     1  0.2639    0.74511 0.876 0.000 0.000 0.032 0.008 0.084
#> GSM711942     1  0.1610    0.70097 0.916 0.000 0.000 0.000 0.000 0.084
#> GSM711944     1  0.6632   -0.05076 0.460 0.000 0.336 0.112 0.000 0.092
#> GSM711946     4  0.0000    0.66881 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711948     1  0.5338    0.12156 0.508 0.000 0.000 0.416 0.044 0.032
#> GSM711952     6  0.4697    0.60912 0.404 0.000 0.000 0.000 0.048 0.548
#> GSM711954     1  0.1610    0.75266 0.916 0.000 0.000 0.000 0.000 0.084
#> GSM711962     1  0.0363    0.75749 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM711970     1  0.1610    0.75266 0.916 0.000 0.000 0.000 0.000 0.084
#> GSM711974     1  0.3515    0.28435 0.676 0.000 0.000 0.000 0.000 0.324
#> GSM711978     4  0.3126    0.70434 0.000 0.000 0.000 0.752 0.248 0.000
#> GSM711988     1  0.2527    0.74621 0.880 0.000 0.000 0.032 0.004 0.084
#> GSM711990     3  0.3508    0.77637 0.000 0.000 0.800 0.132 0.000 0.068
#> GSM711992     4  0.3101    0.70420 0.000 0.000 0.000 0.756 0.244 0.000
#> GSM711982     1  0.3482    0.30493 0.684 0.000 0.000 0.000 0.000 0.316
#> GSM711984     2  0.1075    0.74744 0.000 0.952 0.000 0.000 0.048 0.000
#> GSM711912     6  0.3975    0.63218 0.392 0.000 0.000 0.000 0.008 0.600
#> GSM711918     6  0.4301    0.63068 0.392 0.000 0.000 0.000 0.024 0.584
#> GSM711920     1  0.1007    0.74061 0.956 0.000 0.000 0.000 0.000 0.044
#> GSM711937     2  0.0000    0.78404 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711939     2  0.0260    0.78333 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM711951     2  0.4131    0.19155 0.000 0.624 0.000 0.356 0.020 0.000
#> GSM711957     4  0.5786    0.62510 0.020 0.000 0.000 0.440 0.436 0.104
#> GSM711959     2  0.0632    0.77284 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM711961     2  0.3266    0.19201 0.000 0.728 0.000 0.000 0.272 0.000
#> GSM711965     4  0.3489    0.00522 0.000 0.000 0.288 0.708 0.004 0.000
#> GSM711967     1  0.1918    0.75400 0.904 0.000 0.000 0.000 0.008 0.088
#> GSM711969     2  0.0260    0.78333 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM711973     4  0.5875    0.62069 0.100 0.000 0.000 0.624 0.188 0.088
#> GSM711977     3  0.3864    0.46938 0.000 0.000 0.520 0.480 0.000 0.000
#> GSM711981     4  0.4712    0.67947 0.000 0.052 0.000 0.564 0.384 0.000
#> GSM711987     5  0.3860    0.71857 0.000 0.472 0.000 0.000 0.528 0.000
#> GSM711905     5  0.3860    0.71857 0.000 0.472 0.000 0.000 0.528 0.000
#> GSM711907     2  0.0146    0.78240 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711909     3  0.0363    0.83627 0.000 0.000 0.988 0.012 0.000 0.000
#> GSM711911     3  0.3446    0.67791 0.000 0.000 0.692 0.308 0.000 0.000
#> GSM711915     3  0.0000    0.83433 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711917     2  0.0000    0.78404 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711923     4  0.0000    0.66881 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711925     2  0.3782   -0.41943 0.000 0.588 0.000 0.000 0.412 0.000
#> GSM711927     3  0.0363    0.83627 0.000 0.000 0.988 0.012 0.000 0.000
#> GSM711929     5  0.3860    0.71857 0.000 0.472 0.000 0.000 0.528 0.000
#> GSM711931     2  0.4915    0.30557 0.000 0.632 0.000 0.108 0.260 0.000
#> GSM711933     1  0.2177    0.72529 0.908 0.000 0.000 0.052 0.008 0.032
#> GSM711935     5  0.3860    0.71857 0.000 0.472 0.000 0.000 0.528 0.000
#> GSM711941     4  0.5549    0.60780 0.168 0.000 0.000 0.536 0.296 0.000
#> GSM711943     4  0.1714    0.68970 0.000 0.000 0.000 0.908 0.092 0.000
#> GSM711945     4  0.1074    0.66428 0.000 0.000 0.012 0.960 0.028 0.000
#> GSM711947     3  0.1349    0.80918 0.000 0.000 0.940 0.056 0.004 0.000
#> GSM711949     5  0.3860    0.71857 0.000 0.472 0.000 0.000 0.528 0.000
#> GSM711953     5  0.3860    0.71857 0.000 0.472 0.000 0.000 0.528 0.000
#> GSM711955     1  0.5580    0.23113 0.552 0.000 0.064 0.344 0.000 0.040
#> GSM711963     5  0.3860    0.71857 0.000 0.472 0.000 0.000 0.528 0.000
#> GSM711971     3  0.3013    0.80100 0.000 0.000 0.844 0.088 0.000 0.068
#> GSM711975     2  0.2263    0.64884 0.000 0.884 0.000 0.100 0.016 0.000
#> GSM711979     4  0.5276    0.65089 0.124 0.000 0.000 0.564 0.312 0.000
#> GSM711989     2  0.0000    0.78404 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711991     3  0.3215    0.70993 0.000 0.000 0.756 0.240 0.004 0.000
#> GSM711993     5  0.5387   -0.66962 0.000 0.112 0.000 0.424 0.464 0.000
#> GSM711983     3  0.3508    0.77637 0.000 0.000 0.800 0.132 0.000 0.068
#> GSM711985     2  0.1141    0.74396 0.000 0.948 0.000 0.000 0.052 0.000
#> GSM711913     3  0.3862    0.47581 0.000 0.000 0.524 0.476 0.000 0.000
#> GSM711919     3  0.0547    0.83162 0.000 0.000 0.980 0.000 0.000 0.020
#> GSM711921     3  0.0000    0.83433 0.000 0.000 1.000 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-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 tissue(p) disease.state(p) individual(p) k
#> MAD:mclust 90  2.27e-05           0.1428         0.530 2
#> MAD:mclust 88  4.17e-10           0.4595         0.513 3
#> MAD:mclust 87  1.42e-10           0.1061         0.527 4
#> MAD:mclust 83  2.10e-08           0.0328         0.381 5
#> MAD:mclust 72  3.14e-07           0.0460         0.200 6

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


MAD:NMF**

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

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

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

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

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

collect_plots(res)

plot of chunk MAD-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 1.000           0.977       0.990         0.4276 0.575   0.575
#> 3 3 1.000           0.977       0.990         0.5303 0.758   0.584
#> 4 4 0.874           0.872       0.942         0.1352 0.844   0.587
#> 5 5 0.772           0.724       0.863         0.0479 0.942   0.789
#> 6 6 0.857           0.765       0.890         0.0443 0.900   0.613

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
#> GSM711936     2  0.0000      0.989 0.000 1.000
#> GSM711938     2  0.0000      0.989 0.000 1.000
#> GSM711950     1  0.0000      0.990 1.000 0.000
#> GSM711956     1  0.0000      0.990 1.000 0.000
#> GSM711958     1  0.0000      0.990 1.000 0.000
#> GSM711960     1  0.0000      0.990 1.000 0.000
#> GSM711964     1  0.0000      0.990 1.000 0.000
#> GSM711966     1  0.0000      0.990 1.000 0.000
#> GSM711968     1  0.0000      0.990 1.000 0.000
#> GSM711972     1  0.0000      0.990 1.000 0.000
#> GSM711976     1  0.0000      0.990 1.000 0.000
#> GSM711980     1  0.0000      0.990 1.000 0.000
#> GSM711986     1  0.0000      0.990 1.000 0.000
#> GSM711904     1  0.0000      0.990 1.000 0.000
#> GSM711906     1  0.0000      0.990 1.000 0.000
#> GSM711908     1  0.0000      0.990 1.000 0.000
#> GSM711910     1  0.0000      0.990 1.000 0.000
#> GSM711914     1  0.0000      0.990 1.000 0.000
#> GSM711916     1  0.0000      0.990 1.000 0.000
#> GSM711922     1  0.0000      0.990 1.000 0.000
#> GSM711924     1  0.0000      0.990 1.000 0.000
#> GSM711926     2  0.2948      0.939 0.052 0.948
#> GSM711928     1  0.0000      0.990 1.000 0.000
#> GSM711930     1  0.0000      0.990 1.000 0.000
#> GSM711932     1  0.0000      0.990 1.000 0.000
#> GSM711934     1  0.0000      0.990 1.000 0.000
#> GSM711940     1  0.0000      0.990 1.000 0.000
#> GSM711942     1  0.0000      0.990 1.000 0.000
#> GSM711944     1  0.0000      0.990 1.000 0.000
#> GSM711946     1  0.0000      0.990 1.000 0.000
#> GSM711948     1  0.0000      0.990 1.000 0.000
#> GSM711952     1  0.0000      0.990 1.000 0.000
#> GSM711954     1  0.0000      0.990 1.000 0.000
#> GSM711962     1  0.0000      0.990 1.000 0.000
#> GSM711970     1  0.0000      0.990 1.000 0.000
#> GSM711974     1  0.0000      0.990 1.000 0.000
#> GSM711978     1  0.1843      0.963 0.972 0.028
#> GSM711988     1  0.0000      0.990 1.000 0.000
#> GSM711990     1  0.0000      0.990 1.000 0.000
#> GSM711992     1  0.0000      0.990 1.000 0.000
#> GSM711982     1  0.0000      0.990 1.000 0.000
#> GSM711984     2  0.0000      0.989 0.000 1.000
#> GSM711912     1  0.0000      0.990 1.000 0.000
#> GSM711918     1  0.0000      0.990 1.000 0.000
#> GSM711920     1  0.0000      0.990 1.000 0.000
#> GSM711937     2  0.0000      0.989 0.000 1.000
#> GSM711939     2  0.0000      0.989 0.000 1.000
#> GSM711951     2  0.0000      0.989 0.000 1.000
#> GSM711957     1  0.0000      0.990 1.000 0.000
#> GSM711959     2  0.0000      0.989 0.000 1.000
#> GSM711961     2  0.0000      0.989 0.000 1.000
#> GSM711965     1  0.0000      0.990 1.000 0.000
#> GSM711967     1  0.0000      0.990 1.000 0.000
#> GSM711969     2  0.0000      0.989 0.000 1.000
#> GSM711973     1  0.0000      0.990 1.000 0.000
#> GSM711977     1  0.0000      0.990 1.000 0.000
#> GSM711981     2  0.7815      0.695 0.232 0.768
#> GSM711987     2  0.0000      0.989 0.000 1.000
#> GSM711905     2  0.0000      0.989 0.000 1.000
#> GSM711907     2  0.0000      0.989 0.000 1.000
#> GSM711909     1  0.0000      0.990 1.000 0.000
#> GSM711911     1  0.0000      0.990 1.000 0.000
#> GSM711915     1  0.0000      0.990 1.000 0.000
#> GSM711917     2  0.0000      0.989 0.000 1.000
#> GSM711923     1  0.0000      0.990 1.000 0.000
#> GSM711925     2  0.0000      0.989 0.000 1.000
#> GSM711927     1  0.0000      0.990 1.000 0.000
#> GSM711929     2  0.0000      0.989 0.000 1.000
#> GSM711931     2  0.0000      0.989 0.000 1.000
#> GSM711933     1  0.0000      0.990 1.000 0.000
#> GSM711935     2  0.0000      0.989 0.000 1.000
#> GSM711941     1  0.0000      0.990 1.000 0.000
#> GSM711943     1  0.1184      0.975 0.984 0.016
#> GSM711945     1  0.9000      0.538 0.684 0.316
#> GSM711947     2  0.0000      0.989 0.000 1.000
#> GSM711949     2  0.0000      0.989 0.000 1.000
#> GSM711953     2  0.0000      0.989 0.000 1.000
#> GSM711955     1  0.0000      0.990 1.000 0.000
#> GSM711963     2  0.0000      0.989 0.000 1.000
#> GSM711971     1  0.0000      0.990 1.000 0.000
#> GSM711975     2  0.0000      0.989 0.000 1.000
#> GSM711979     1  0.0000      0.990 1.000 0.000
#> GSM711989     2  0.0000      0.989 0.000 1.000
#> GSM711991     1  0.7883      0.690 0.764 0.236
#> GSM711993     2  0.0672      0.982 0.008 0.992
#> GSM711983     1  0.0000      0.990 1.000 0.000
#> GSM711985     2  0.0000      0.989 0.000 1.000
#> GSM711913     1  0.0000      0.990 1.000 0.000
#> GSM711919     1  0.0000      0.990 1.000 0.000
#> GSM711921     1  0.0000      0.990 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
#> GSM711936     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711938     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711950     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711956     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711958     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711960     3  0.2537      0.910 0.080 0.000 0.920
#> GSM711964     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711966     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711968     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711972     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711976     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711980     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711986     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711904     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711906     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711908     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711910     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711914     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711916     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711922     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711924     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711926     2  0.4452      0.757 0.192 0.808 0.000
#> GSM711928     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711930     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711932     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711934     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711940     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711942     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711944     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711946     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711948     1  0.2066      0.931 0.940 0.000 0.060
#> GSM711952     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711954     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711962     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711970     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711974     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711978     1  0.4235      0.788 0.824 0.176 0.000
#> GSM711988     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711990     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711992     1  0.0592      0.980 0.988 0.012 0.000
#> GSM711982     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711984     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711912     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711918     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711920     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711937     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711939     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711951     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711957     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711959     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711961     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711965     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711967     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711969     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711973     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711977     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711981     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711987     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711905     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711907     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711909     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711911     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711915     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711917     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711923     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711925     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711927     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711929     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711931     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711933     1  0.0000      0.991 1.000 0.000 0.000
#> GSM711935     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711941     3  0.2356      0.918 0.072 0.000 0.928
#> GSM711943     3  0.1753      0.940 0.000 0.048 0.952
#> GSM711945     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711947     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711949     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711955     3  0.4452      0.776 0.192 0.000 0.808
#> GSM711963     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711971     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711975     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711979     1  0.2878      0.893 0.904 0.096 0.000
#> GSM711989     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711991     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711993     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711983     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711985     2  0.0000      0.991 0.000 1.000 0.000
#> GSM711913     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711919     3  0.0000      0.981 0.000 0.000 1.000
#> GSM711921     3  0.0000      0.981 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711950     4  0.0469      0.842 0.012 0.000 0.000 0.988
#> GSM711956     1  0.0336      0.962 0.992 0.000 0.000 0.008
#> GSM711958     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711960     3  0.0895      0.895 0.020 0.000 0.976 0.004
#> GSM711964     1  0.0188      0.963 0.996 0.000 0.000 0.004
#> GSM711966     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0336      0.962 0.992 0.000 0.000 0.008
#> GSM711972     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711976     4  0.3266      0.770 0.168 0.000 0.000 0.832
#> GSM711980     1  0.0188      0.963 0.996 0.000 0.000 0.004
#> GSM711986     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0336      0.962 0.992 0.000 0.000 0.008
#> GSM711906     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711910     3  0.0188      0.908 0.000 0.000 0.996 0.004
#> GSM711914     1  0.0188      0.963 0.996 0.000 0.000 0.004
#> GSM711916     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0336      0.961 0.992 0.000 0.000 0.008
#> GSM711924     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711926     4  0.1792      0.831 0.000 0.068 0.000 0.932
#> GSM711928     1  0.0188      0.963 0.996 0.000 0.000 0.004
#> GSM711930     1  0.0188      0.961 0.996 0.000 0.000 0.004
#> GSM711932     4  0.3074      0.781 0.152 0.000 0.000 0.848
#> GSM711934     1  0.0188      0.963 0.996 0.000 0.000 0.004
#> GSM711940     4  0.4605      0.535 0.336 0.000 0.000 0.664
#> GSM711942     1  0.0188      0.962 0.996 0.000 0.000 0.004
#> GSM711944     3  0.0592      0.904 0.000 0.000 0.984 0.016
#> GSM711946     3  0.4972      0.261 0.000 0.000 0.544 0.456
#> GSM711948     4  0.0524      0.841 0.008 0.000 0.004 0.988
#> GSM711952     1  0.0188      0.963 0.996 0.000 0.000 0.004
#> GSM711954     1  0.2589      0.855 0.884 0.000 0.000 0.116
#> GSM711962     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711970     1  0.2345      0.876 0.900 0.000 0.000 0.100
#> GSM711974     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711978     4  0.1411      0.844 0.020 0.020 0.000 0.960
#> GSM711988     1  0.5000     -0.120 0.500 0.000 0.000 0.500
#> GSM711990     3  0.0188      0.909 0.000 0.000 0.996 0.004
#> GSM711992     4  0.4761      0.539 0.332 0.004 0.000 0.664
#> GSM711982     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000      0.963 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0336      0.962 0.992 0.000 0.000 0.008
#> GSM711937     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711951     4  0.2149      0.821 0.000 0.088 0.000 0.912
#> GSM711957     4  0.4008      0.693 0.244 0.000 0.000 0.756
#> GSM711959     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711965     4  0.4543      0.404 0.000 0.000 0.324 0.676
#> GSM711967     1  0.1867      0.902 0.928 0.000 0.000 0.072
#> GSM711969     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711973     4  0.3356      0.709 0.000 0.000 0.176 0.824
#> GSM711977     3  0.3123      0.790 0.000 0.000 0.844 0.156
#> GSM711981     4  0.0921      0.841 0.000 0.028 0.000 0.972
#> GSM711987     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711907     2  0.1792      0.920 0.000 0.932 0.000 0.068
#> GSM711909     3  0.0000      0.909 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0188      0.909 0.000 0.000 0.996 0.004
#> GSM711915     3  0.0000      0.909 0.000 0.000 1.000 0.000
#> GSM711917     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0469      0.837 0.000 0.000 0.012 0.988
#> GSM711925     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000      0.909 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711931     4  0.3528      0.744 0.000 0.192 0.000 0.808
#> GSM711933     1  0.3074      0.804 0.848 0.000 0.000 0.152
#> GSM711935     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711941     4  0.0524      0.839 0.004 0.000 0.008 0.988
#> GSM711943     4  0.1284      0.836 0.000 0.012 0.024 0.964
#> GSM711945     3  0.5000      0.116 0.000 0.000 0.500 0.500
#> GSM711947     3  0.1004      0.894 0.000 0.024 0.972 0.004
#> GSM711949     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711955     3  0.5184      0.552 0.024 0.000 0.672 0.304
#> GSM711963     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0000      0.909 0.000 0.000 1.000 0.000
#> GSM711975     4  0.4356      0.607 0.000 0.292 0.000 0.708
#> GSM711979     4  0.0524      0.842 0.008 0.004 0.000 0.988
#> GSM711989     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711991     3  0.0000      0.909 0.000 0.000 1.000 0.000
#> GSM711993     4  0.1022      0.841 0.000 0.032 0.000 0.968
#> GSM711983     3  0.0188      0.909 0.000 0.000 0.996 0.004
#> GSM711985     2  0.0000      0.996 0.000 1.000 0.000 0.000
#> GSM711913     3  0.1118      0.893 0.000 0.000 0.964 0.036
#> GSM711919     3  0.0188      0.908 0.000 0.000 0.996 0.004
#> GSM711921     3  0.0188      0.908 0.000 0.000 0.996 0.004

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711938     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711950     4  0.3177    0.64273 0.000 0.000 0.000 0.792 0.208
#> GSM711956     1  0.2648    0.78460 0.848 0.000 0.000 0.000 0.152
#> GSM711958     1  0.4321    0.30400 0.600 0.000 0.396 0.000 0.004
#> GSM711960     3  0.0955    0.88063 0.028 0.000 0.968 0.000 0.004
#> GSM711964     1  0.0000    0.82438 1.000 0.000 0.000 0.000 0.000
#> GSM711966     1  0.0404    0.82359 0.988 0.000 0.000 0.000 0.012
#> GSM711968     1  0.3177    0.75371 0.792 0.000 0.000 0.000 0.208
#> GSM711972     1  0.0290    0.82389 0.992 0.000 0.000 0.000 0.008
#> GSM711976     1  0.5467    0.29692 0.548 0.000 0.000 0.384 0.068
#> GSM711980     1  0.2136    0.80823 0.904 0.000 0.000 0.008 0.088
#> GSM711986     1  0.0000    0.82438 1.000 0.000 0.000 0.000 0.000
#> GSM711904     1  0.2377    0.79534 0.872 0.000 0.000 0.000 0.128
#> GSM711906     1  0.0404    0.82359 0.988 0.000 0.000 0.000 0.012
#> GSM711908     1  0.0404    0.82359 0.988 0.000 0.000 0.000 0.012
#> GSM711910     3  0.0000    0.91534 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.0290    0.82459 0.992 0.000 0.000 0.000 0.008
#> GSM711916     1  0.0404    0.82359 0.988 0.000 0.000 0.000 0.012
#> GSM711922     1  0.3671    0.73041 0.756 0.000 0.000 0.008 0.236
#> GSM711924     1  0.4416    0.57763 0.632 0.000 0.000 0.012 0.356
#> GSM711926     4  0.4498    0.44794 0.000 0.032 0.000 0.688 0.280
#> GSM711928     1  0.0703    0.82274 0.976 0.000 0.000 0.000 0.024
#> GSM711930     1  0.0404    0.82359 0.988 0.000 0.000 0.000 0.012
#> GSM711932     5  0.6320   -0.03533 0.156 0.000 0.000 0.404 0.440
#> GSM711934     1  0.2329    0.79714 0.876 0.000 0.000 0.000 0.124
#> GSM711940     4  0.2732    0.61443 0.160 0.000 0.000 0.840 0.000
#> GSM711942     1  0.4066    0.63294 0.672 0.000 0.000 0.004 0.324
#> GSM711944     3  0.0992    0.89264 0.000 0.000 0.968 0.008 0.024
#> GSM711946     4  0.3543    0.65122 0.000 0.000 0.112 0.828 0.060
#> GSM711948     4  0.2233    0.71691 0.004 0.000 0.000 0.892 0.104
#> GSM711952     1  0.1608    0.81291 0.928 0.000 0.000 0.000 0.072
#> GSM711954     1  0.3829    0.67223 0.776 0.000 0.000 0.196 0.028
#> GSM711962     1  0.0404    0.82359 0.988 0.000 0.000 0.000 0.012
#> GSM711970     1  0.5441    0.60110 0.624 0.000 0.000 0.096 0.280
#> GSM711974     1  0.0404    0.82359 0.988 0.000 0.000 0.000 0.012
#> GSM711978     4  0.1412    0.73644 0.004 0.008 0.000 0.952 0.036
#> GSM711988     1  0.4413    0.61141 0.724 0.000 0.000 0.232 0.044
#> GSM711990     3  0.0000    0.91534 0.000 0.000 1.000 0.000 0.000
#> GSM711992     4  0.2921    0.62107 0.148 0.004 0.000 0.844 0.004
#> GSM711982     1  0.0404    0.82359 0.988 0.000 0.000 0.000 0.012
#> GSM711984     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711912     1  0.0290    0.82428 0.992 0.000 0.000 0.000 0.008
#> GSM711918     1  0.0510    0.82490 0.984 0.000 0.000 0.000 0.016
#> GSM711920     1  0.4924    0.50241 0.552 0.000 0.000 0.028 0.420
#> GSM711937     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711939     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711951     4  0.2020    0.69983 0.000 0.100 0.000 0.900 0.000
#> GSM711957     5  0.6236    0.14529 0.208 0.000 0.000 0.248 0.544
#> GSM711959     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711965     4  0.5071    0.23677 0.000 0.000 0.036 0.540 0.424
#> GSM711967     1  0.5979    0.22698 0.520 0.000 0.000 0.360 0.120
#> GSM711969     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711973     5  0.5630   -0.00640 0.000 0.000 0.088 0.352 0.560
#> GSM711977     5  0.6002    0.23892 0.000 0.000 0.308 0.140 0.552
#> GSM711981     4  0.3882    0.62377 0.000 0.020 0.000 0.756 0.224
#> GSM711987     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711907     2  0.2230    0.84495 0.000 0.884 0.000 0.116 0.000
#> GSM711909     3  0.0000    0.91534 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.0000    0.91534 0.000 0.000 1.000 0.000 0.000
#> GSM711915     3  0.4268    0.13820 0.000 0.000 0.556 0.000 0.444
#> GSM711917     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711923     4  0.0162    0.74293 0.000 0.000 0.000 0.996 0.004
#> GSM711925     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0000    0.91534 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711931     4  0.6220    0.26241 0.000 0.272 0.000 0.540 0.188
#> GSM711933     1  0.7359   -0.00661 0.384 0.000 0.028 0.324 0.264
#> GSM711935     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.0162    0.74259 0.000 0.000 0.000 0.996 0.004
#> GSM711943     4  0.1768    0.71879 0.000 0.000 0.072 0.924 0.004
#> GSM711945     4  0.4025    0.51509 0.000 0.000 0.008 0.700 0.292
#> GSM711947     3  0.0794    0.88395 0.000 0.028 0.972 0.000 0.000
#> GSM711949     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711955     3  0.5676    0.26013 0.048 0.000 0.620 0.300 0.032
#> GSM711963     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0000    0.91534 0.000 0.000 1.000 0.000 0.000
#> GSM711975     2  0.3635    0.63989 0.000 0.748 0.000 0.248 0.004
#> GSM711979     4  0.1544    0.72518 0.000 0.000 0.000 0.932 0.068
#> GSM711989     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711991     3  0.0000    0.91534 0.000 0.000 1.000 0.000 0.000
#> GSM711993     4  0.0693    0.74344 0.000 0.008 0.000 0.980 0.012
#> GSM711983     3  0.0000    0.91534 0.000 0.000 1.000 0.000 0.000
#> GSM711985     2  0.0000    0.97867 0.000 1.000 0.000 0.000 0.000
#> GSM711913     5  0.5177   -0.13695 0.000 0.000 0.472 0.040 0.488
#> GSM711919     3  0.0000    0.91534 0.000 0.000 1.000 0.000 0.000
#> GSM711921     3  0.0000    0.91534 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.0260     0.9739 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM711938     2  0.0000     0.9754 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711950     5  0.4046     0.4114 0.008 0.000 0.000 0.368 0.620 0.004
#> GSM711956     1  0.3804     0.3662 0.656 0.000 0.000 0.000 0.008 0.336
#> GSM711958     3  0.3292     0.6940 0.200 0.000 0.784 0.008 0.008 0.000
#> GSM711960     3  0.0924     0.9163 0.008 0.000 0.972 0.008 0.008 0.004
#> GSM711964     1  0.0508     0.8525 0.984 0.000 0.000 0.000 0.012 0.004
#> GSM711966     1  0.1049     0.8403 0.960 0.000 0.000 0.000 0.008 0.032
#> GSM711968     6  0.4091     0.2736 0.472 0.000 0.000 0.000 0.008 0.520
#> GSM711972     1  0.0405     0.8526 0.988 0.000 0.000 0.000 0.004 0.008
#> GSM711976     5  0.5373    -0.0507 0.392 0.000 0.000 0.016 0.520 0.072
#> GSM711980     1  0.3714     0.3690 0.656 0.000 0.000 0.000 0.004 0.340
#> GSM711986     1  0.0458     0.8519 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM711904     1  0.3470     0.5841 0.740 0.000 0.000 0.000 0.012 0.248
#> GSM711906     1  0.0622     0.8491 0.980 0.000 0.000 0.000 0.008 0.012
#> GSM711908     1  0.0146     0.8527 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM711910     3  0.0000     0.9233 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711914     1  0.1124     0.8472 0.956 0.000 0.000 0.000 0.008 0.036
#> GSM711916     1  0.1151     0.8418 0.956 0.000 0.000 0.000 0.012 0.032
#> GSM711922     6  0.3823     0.4007 0.436 0.000 0.000 0.000 0.000 0.564
#> GSM711924     6  0.4236     0.6426 0.184 0.000 0.056 0.000 0.016 0.744
#> GSM711926     4  0.3791     0.6385 0.000 0.032 0.000 0.732 0.000 0.236
#> GSM711928     1  0.1225     0.8459 0.952 0.000 0.000 0.000 0.012 0.036
#> GSM711930     1  0.1297     0.8317 0.948 0.000 0.000 0.000 0.012 0.040
#> GSM711932     6  0.3962     0.4303 0.044 0.000 0.000 0.196 0.008 0.752
#> GSM711934     1  0.3133     0.6502 0.780 0.000 0.000 0.000 0.008 0.212
#> GSM711940     4  0.1410     0.8001 0.044 0.000 0.000 0.944 0.004 0.008
#> GSM711942     6  0.3672     0.6254 0.304 0.000 0.000 0.000 0.008 0.688
#> GSM711944     3  0.1900     0.8836 0.000 0.000 0.916 0.008 0.008 0.068
#> GSM711946     4  0.1296     0.8073 0.000 0.000 0.032 0.952 0.012 0.004
#> GSM711948     4  0.4126     0.3224 0.008 0.000 0.000 0.624 0.360 0.008
#> GSM711952     1  0.1556     0.8211 0.920 0.000 0.000 0.000 0.000 0.080
#> GSM711954     1  0.4493     0.2430 0.596 0.000 0.000 0.364 0.000 0.040
#> GSM711962     1  0.0717     0.8478 0.976 0.000 0.000 0.000 0.008 0.016
#> GSM711970     6  0.5028     0.5573 0.340 0.000 0.000 0.060 0.012 0.588
#> GSM711974     1  0.0870     0.8498 0.972 0.000 0.004 0.000 0.012 0.012
#> GSM711978     4  0.0260     0.8227 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM711988     1  0.3499     0.7135 0.812 0.000 0.000 0.044 0.012 0.132
#> GSM711990     3  0.0405     0.9218 0.000 0.000 0.988 0.004 0.008 0.000
#> GSM711992     4  0.0767     0.8209 0.008 0.012 0.000 0.976 0.004 0.000
#> GSM711982     1  0.0972     0.8410 0.964 0.000 0.000 0.000 0.008 0.028
#> GSM711984     2  0.0260     0.9739 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM711912     1  0.1075     0.8424 0.952 0.000 0.000 0.000 0.000 0.048
#> GSM711918     1  0.1075     0.8430 0.952 0.000 0.000 0.000 0.000 0.048
#> GSM711920     6  0.2112     0.6372 0.088 0.000 0.000 0.000 0.016 0.896
#> GSM711937     2  0.0146     0.9748 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM711939     2  0.0000     0.9754 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711951     4  0.1285     0.7938 0.000 0.052 0.000 0.944 0.004 0.000
#> GSM711957     6  0.1010     0.5936 0.036 0.000 0.004 0.000 0.000 0.960
#> GSM711959     2  0.0260     0.9739 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM711961     2  0.0000     0.9754 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711965     5  0.1088     0.7399 0.000 0.000 0.016 0.024 0.960 0.000
#> GSM711967     4  0.4751     0.1303 0.400 0.000 0.000 0.556 0.008 0.036
#> GSM711969     2  0.0260     0.9739 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM711973     5  0.1078     0.7370 0.000 0.000 0.016 0.012 0.964 0.008
#> GSM711977     5  0.1082     0.7367 0.000 0.000 0.040 0.000 0.956 0.004
#> GSM711981     5  0.4280     0.2706 0.000 0.008 0.000 0.428 0.556 0.008
#> GSM711987     2  0.0000     0.9754 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.9754 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     2  0.2527     0.7901 0.000 0.832 0.000 0.168 0.000 0.000
#> GSM711909     3  0.0000     0.9233 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711911     3  0.0508     0.9204 0.000 0.000 0.984 0.000 0.004 0.012
#> GSM711915     5  0.1714     0.7101 0.000 0.000 0.092 0.000 0.908 0.000
#> GSM711917     2  0.0260     0.9739 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM711923     4  0.0405     0.8218 0.000 0.000 0.008 0.988 0.000 0.004
#> GSM711925     2  0.0000     0.9754 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.0146     0.9230 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM711929     2  0.0000     0.9754 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     4  0.5501     0.3548 0.000 0.320 0.000 0.552 0.008 0.120
#> GSM711933     3  0.6022     0.5041 0.032 0.000 0.592 0.208 0.008 0.160
#> GSM711935     2  0.0000     0.9754 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     4  0.1151     0.8145 0.000 0.000 0.000 0.956 0.032 0.012
#> GSM711943     4  0.0363     0.8211 0.000 0.000 0.012 0.988 0.000 0.000
#> GSM711945     5  0.3490     0.5796 0.000 0.000 0.008 0.268 0.724 0.000
#> GSM711947     3  0.0603     0.9141 0.000 0.016 0.980 0.000 0.000 0.004
#> GSM711949     2  0.0000     0.9754 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9754 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     3  0.4494     0.6059 0.012 0.000 0.700 0.244 0.036 0.008
#> GSM711963     2  0.0000     0.9754 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.0291     0.9228 0.000 0.000 0.992 0.004 0.004 0.000
#> GSM711975     2  0.3023     0.7208 0.000 0.784 0.000 0.212 0.000 0.004
#> GSM711979     4  0.0692     0.8214 0.000 0.000 0.000 0.976 0.004 0.020
#> GSM711989     2  0.0547     0.9659 0.000 0.980 0.000 0.020 0.000 0.000
#> GSM711991     3  0.0291     0.9230 0.000 0.000 0.992 0.004 0.000 0.004
#> GSM711993     4  0.0665     0.8219 0.000 0.008 0.000 0.980 0.004 0.008
#> GSM711983     3  0.0551     0.9220 0.000 0.000 0.984 0.008 0.004 0.004
#> GSM711985     2  0.0260     0.9739 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM711913     5  0.1007     0.7364 0.000 0.000 0.044 0.000 0.956 0.000
#> GSM711919     3  0.0146     0.9230 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM711921     3  0.0000     0.9233 0.000 0.000 1.000 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-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 tissue(p) disease.state(p) individual(p) k
#> MAD:NMF 90  3.47e-05            0.176         0.644 2
#> MAD:NMF 90  9.16e-11            0.259         0.733 3
#> MAD:NMF 86  3.48e-08            0.185         0.329 4
#> MAD:NMF 76  7.56e-09            0.225         0.259 5
#> MAD:NMF 78  1.77e-07            0.266         0.200 6

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


ATC:hclust*

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

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

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

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

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

collect_plots(res)

plot of chunk ATC-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.910           0.957       0.981          0.375 0.626   0.626
#> 3 3 0.814           0.874       0.937          0.121 0.986   0.977
#> 4 4 0.745           0.827       0.919          0.183 0.931   0.887
#> 5 5 0.585           0.698       0.852          0.130 0.907   0.832
#> 6 6 0.638           0.630       0.777          0.198 0.828   0.628

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
#> GSM711936     2  0.0000      0.961 0.000 1.000
#> GSM711938     2  0.0000      0.961 0.000 1.000
#> GSM711950     1  0.0000      0.985 1.000 0.000
#> GSM711956     1  0.0000      0.985 1.000 0.000
#> GSM711958     1  0.0000      0.985 1.000 0.000
#> GSM711960     1  0.0000      0.985 1.000 0.000
#> GSM711964     1  0.0000      0.985 1.000 0.000
#> GSM711966     1  0.0000      0.985 1.000 0.000
#> GSM711968     1  0.0000      0.985 1.000 0.000
#> GSM711972     1  0.0000      0.985 1.000 0.000
#> GSM711976     1  0.0000      0.985 1.000 0.000
#> GSM711980     1  0.0000      0.985 1.000 0.000
#> GSM711986     1  0.0000      0.985 1.000 0.000
#> GSM711904     1  0.0000      0.985 1.000 0.000
#> GSM711906     1  0.0000      0.985 1.000 0.000
#> GSM711908     1  0.0000      0.985 1.000 0.000
#> GSM711910     1  0.0000      0.985 1.000 0.000
#> GSM711914     1  0.0000      0.985 1.000 0.000
#> GSM711916     1  0.0000      0.985 1.000 0.000
#> GSM711922     1  0.0000      0.985 1.000 0.000
#> GSM711924     1  0.0000      0.985 1.000 0.000
#> GSM711926     1  0.0938      0.974 0.988 0.012
#> GSM711928     1  0.0000      0.985 1.000 0.000
#> GSM711930     1  0.0000      0.985 1.000 0.000
#> GSM711932     1  0.0000      0.985 1.000 0.000
#> GSM711934     1  0.0000      0.985 1.000 0.000
#> GSM711940     1  0.0000      0.985 1.000 0.000
#> GSM711942     1  0.0000      0.985 1.000 0.000
#> GSM711944     1  0.0000      0.985 1.000 0.000
#> GSM711946     1  0.0000      0.985 1.000 0.000
#> GSM711948     1  0.0000      0.985 1.000 0.000
#> GSM711952     1  0.0000      0.985 1.000 0.000
#> GSM711954     1  0.0000      0.985 1.000 0.000
#> GSM711962     1  0.0000      0.985 1.000 0.000
#> GSM711970     1  0.0000      0.985 1.000 0.000
#> GSM711974     1  0.0000      0.985 1.000 0.000
#> GSM711978     1  0.0000      0.985 1.000 0.000
#> GSM711988     1  0.0000      0.985 1.000 0.000
#> GSM711990     1  0.0000      0.985 1.000 0.000
#> GSM711992     1  0.0000      0.985 1.000 0.000
#> GSM711982     1  0.0000      0.985 1.000 0.000
#> GSM711984     2  0.0000      0.961 0.000 1.000
#> GSM711912     1  0.0000      0.985 1.000 0.000
#> GSM711918     1  0.0000      0.985 1.000 0.000
#> GSM711920     1  0.0000      0.985 1.000 0.000
#> GSM711937     2  0.0000      0.961 0.000 1.000
#> GSM711939     2  0.0000      0.961 0.000 1.000
#> GSM711951     1  0.8555      0.606 0.720 0.280
#> GSM711957     1  0.0000      0.985 1.000 0.000
#> GSM711959     2  0.0000      0.961 0.000 1.000
#> GSM711961     2  0.0000      0.961 0.000 1.000
#> GSM711965     1  0.0000      0.985 1.000 0.000
#> GSM711967     1  0.0000      0.985 1.000 0.000
#> GSM711969     2  0.0000      0.961 0.000 1.000
#> GSM711973     1  0.0000      0.985 1.000 0.000
#> GSM711977     1  0.0000      0.985 1.000 0.000
#> GSM711981     1  0.0000      0.985 1.000 0.000
#> GSM711987     2  0.0000      0.961 0.000 1.000
#> GSM711905     2  0.0000      0.961 0.000 1.000
#> GSM711907     2  0.7139      0.785 0.196 0.804
#> GSM711909     1  0.0000      0.985 1.000 0.000
#> GSM711911     1  0.0000      0.985 1.000 0.000
#> GSM711915     2  0.7139      0.785 0.196 0.804
#> GSM711917     2  0.0000      0.961 0.000 1.000
#> GSM711923     1  0.0000      0.985 1.000 0.000
#> GSM711925     2  0.0000      0.961 0.000 1.000
#> GSM711927     1  0.0000      0.985 1.000 0.000
#> GSM711929     2  0.0000      0.961 0.000 1.000
#> GSM711931     1  0.8443      0.621 0.728 0.272
#> GSM711933     1  0.0000      0.985 1.000 0.000
#> GSM711935     2  0.0000      0.961 0.000 1.000
#> GSM711941     1  0.0000      0.985 1.000 0.000
#> GSM711943     1  0.0000      0.985 1.000 0.000
#> GSM711945     1  0.0938      0.974 0.988 0.012
#> GSM711947     2  0.7139      0.785 0.196 0.804
#> GSM711949     2  0.0000      0.961 0.000 1.000
#> GSM711953     2  0.0000      0.961 0.000 1.000
#> GSM711955     1  0.0000      0.985 1.000 0.000
#> GSM711963     2  0.0000      0.961 0.000 1.000
#> GSM711971     1  0.0000      0.985 1.000 0.000
#> GSM711975     1  0.8555      0.606 0.720 0.280
#> GSM711979     1  0.0000      0.985 1.000 0.000
#> GSM711989     2  0.7219      0.774 0.200 0.800
#> GSM711991     1  0.4815      0.875 0.896 0.104
#> GSM711993     1  0.0000      0.985 1.000 0.000
#> GSM711983     1  0.0000      0.985 1.000 0.000
#> GSM711985     2  0.0000      0.961 0.000 1.000
#> GSM711913     1  0.0000      0.985 1.000 0.000
#> GSM711919     1  0.0000      0.985 1.000 0.000
#> GSM711921     1  0.0000      0.985 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
#> GSM711936     2  0.6111     0.5078 0.000 0.604 0.396
#> GSM711938     2  0.4291     0.7235 0.000 0.820 0.180
#> GSM711950     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711956     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711958     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711960     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711964     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711966     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711968     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711972     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711976     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711980     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711986     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711904     1  0.1289     0.9423 0.968 0.000 0.032
#> GSM711906     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711908     1  0.4504     0.7758 0.804 0.000 0.196
#> GSM711910     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711914     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711916     1  0.4504     0.7758 0.804 0.000 0.196
#> GSM711922     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711924     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711926     1  0.0592     0.9577 0.988 0.000 0.012
#> GSM711928     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711930     1  0.4504     0.7758 0.804 0.000 0.196
#> GSM711932     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711934     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711940     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711942     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711944     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711946     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711948     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711952     1  0.4452     0.7808 0.808 0.000 0.192
#> GSM711954     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711962     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711970     1  0.4452     0.7808 0.808 0.000 0.192
#> GSM711974     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711978     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711988     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711990     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711992     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711982     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711984     2  0.0000     0.7719 0.000 1.000 0.000
#> GSM711912     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711918     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711920     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711937     2  0.6111     0.5078 0.000 0.604 0.396
#> GSM711939     2  0.4291     0.7235 0.000 0.820 0.180
#> GSM711951     1  0.6621     0.6274 0.720 0.052 0.228
#> GSM711957     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711959     2  0.0000     0.7719 0.000 1.000 0.000
#> GSM711961     2  0.0000     0.7719 0.000 1.000 0.000
#> GSM711965     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711967     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711969     2  0.6111     0.5078 0.000 0.604 0.396
#> GSM711973     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711977     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711981     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711987     2  0.4291     0.7235 0.000 0.820 0.180
#> GSM711905     2  0.0000     0.7719 0.000 1.000 0.000
#> GSM711907     3  0.5621     0.8576 0.000 0.308 0.692
#> GSM711909     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711911     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711915     3  0.3752     0.7651 0.000 0.144 0.856
#> GSM711917     2  0.6111     0.5078 0.000 0.604 0.396
#> GSM711923     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711925     2  0.0000     0.7719 0.000 1.000 0.000
#> GSM711927     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711929     2  0.0000     0.7719 0.000 1.000 0.000
#> GSM711931     1  0.6535     0.6410 0.728 0.052 0.220
#> GSM711933     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711935     2  0.0000     0.7719 0.000 1.000 0.000
#> GSM711941     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711943     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711945     1  0.0592     0.9580 0.988 0.000 0.012
#> GSM711947     3  0.5621     0.8576 0.000 0.308 0.692
#> GSM711949     2  0.0000     0.7719 0.000 1.000 0.000
#> GSM711953     2  0.0000     0.7719 0.000 1.000 0.000
#> GSM711955     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711963     2  0.0000     0.7719 0.000 1.000 0.000
#> GSM711971     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711975     1  0.6621     0.6274 0.720 0.052 0.228
#> GSM711979     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711989     2  0.9602     0.0292 0.200 0.404 0.396
#> GSM711991     1  0.5363     0.6608 0.724 0.000 0.276
#> GSM711993     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711983     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711985     2  0.4291     0.7235 0.000 0.820 0.180
#> GSM711913     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711919     1  0.0000     0.9671 1.000 0.000 0.000
#> GSM711921     1  0.0000     0.9671 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
#> GSM711936     2  0.7113      0.520 0.000 0.552 0.172 0.276
#> GSM711938     2  0.3907      0.734 0.000 0.768 0.000 0.232
#> GSM711950     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711956     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711958     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711960     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711964     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711976     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711980     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711904     1  0.1022      0.925 0.968 0.000 0.032 0.000
#> GSM711906     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711908     1  0.3569      0.765 0.804 0.000 0.196 0.000
#> GSM711910     1  0.0188      0.943 0.996 0.000 0.000 0.004
#> GSM711914     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711916     1  0.3569      0.765 0.804 0.000 0.196 0.000
#> GSM711922     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711924     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711926     1  0.4500      0.580 0.684 0.000 0.000 0.316
#> GSM711928     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711930     1  0.3569      0.765 0.804 0.000 0.196 0.000
#> GSM711932     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711934     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711940     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711942     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711944     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711946     1  0.1637      0.911 0.940 0.000 0.000 0.060
#> GSM711948     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711952     1  0.3528      0.770 0.808 0.000 0.192 0.000
#> GSM711954     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711962     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711970     1  0.3528      0.770 0.808 0.000 0.192 0.000
#> GSM711974     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711978     1  0.3074      0.829 0.848 0.000 0.000 0.152
#> GSM711988     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711990     1  0.0188      0.943 0.996 0.000 0.000 0.004
#> GSM711992     1  0.1637      0.911 0.940 0.000 0.000 0.060
#> GSM711982     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711984     2  0.0000      0.803 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711920     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711937     2  0.7113      0.520 0.000 0.552 0.172 0.276
#> GSM711939     2  0.3907      0.734 0.000 0.768 0.000 0.232
#> GSM711951     4  0.0524      0.541 0.008 0.000 0.004 0.988
#> GSM711957     4  0.4331      0.205 0.288 0.000 0.000 0.712
#> GSM711959     2  0.0000      0.803 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.803 0.000 1.000 0.000 0.000
#> GSM711965     1  0.0188      0.943 0.996 0.000 0.000 0.004
#> GSM711967     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711969     2  0.7113      0.520 0.000 0.552 0.172 0.276
#> GSM711973     1  0.1716      0.907 0.936 0.000 0.000 0.064
#> GSM711977     1  0.2704      0.855 0.876 0.000 0.000 0.124
#> GSM711981     1  0.4072      0.693 0.748 0.000 0.000 0.252
#> GSM711987     2  0.3907      0.734 0.000 0.768 0.000 0.232
#> GSM711905     2  0.0000      0.803 0.000 1.000 0.000 0.000
#> GSM711907     3  0.4462      0.838 0.000 0.164 0.792 0.044
#> GSM711909     1  0.0188      0.943 0.996 0.000 0.000 0.004
#> GSM711911     1  0.0188      0.943 0.996 0.000 0.000 0.004
#> GSM711915     3  0.0000      0.686 0.000 0.000 1.000 0.000
#> GSM711917     2  0.7113      0.520 0.000 0.552 0.172 0.276
#> GSM711923     1  0.3024      0.833 0.852 0.000 0.000 0.148
#> GSM711925     2  0.0000      0.803 0.000 1.000 0.000 0.000
#> GSM711927     1  0.0188      0.943 0.996 0.000 0.000 0.004
#> GSM711929     2  0.0000      0.803 0.000 1.000 0.000 0.000
#> GSM711931     4  0.0188      0.543 0.004 0.000 0.000 0.996
#> GSM711933     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711935     2  0.0000      0.803 0.000 1.000 0.000 0.000
#> GSM711941     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711943     1  0.1637      0.911 0.940 0.000 0.000 0.060
#> GSM711945     1  0.2101      0.903 0.928 0.000 0.012 0.060
#> GSM711947     3  0.4462      0.838 0.000 0.164 0.792 0.044
#> GSM711949     2  0.0000      0.803 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000      0.803 0.000 1.000 0.000 0.000
#> GSM711955     1  0.0000      0.944 1.000 0.000 0.000 0.000
#> GSM711963     2  0.0000      0.803 0.000 1.000 0.000 0.000
#> GSM711971     1  0.0188      0.943 0.996 0.000 0.000 0.004
#> GSM711975     4  0.0188      0.538 0.000 0.000 0.004 0.996
#> GSM711979     1  0.3975      0.710 0.760 0.000 0.000 0.240
#> GSM711989     4  0.7384     -0.241 0.000 0.352 0.172 0.476
#> GSM711991     1  0.5742      0.571 0.664 0.000 0.276 0.060
#> GSM711993     1  0.4072      0.693 0.748 0.000 0.000 0.252
#> GSM711983     1  0.0188      0.943 0.996 0.000 0.000 0.004
#> GSM711985     2  0.3907      0.734 0.000 0.768 0.000 0.232
#> GSM711913     1  0.2704      0.855 0.876 0.000 0.000 0.124
#> GSM711919     1  0.0188      0.943 0.996 0.000 0.000 0.004
#> GSM711921     1  0.0188      0.943 0.996 0.000 0.000 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
#> GSM711936     5  0.6671    -0.2978 0.000 0.372 0.000 0.232 0.396
#> GSM711938     2  0.3849     0.7283 0.000 0.752 0.000 0.232 0.016
#> GSM711950     1  0.0324     0.8732 0.992 0.000 0.000 0.004 0.004
#> GSM711956     1  0.0162     0.8733 0.996 0.000 0.000 0.000 0.004
#> GSM711958     1  0.0162     0.8733 0.996 0.000 0.000 0.000 0.004
#> GSM711960     1  0.0794     0.8690 0.972 0.000 0.000 0.000 0.028
#> GSM711964     1  0.0794     0.8687 0.972 0.000 0.000 0.000 0.028
#> GSM711966     1  0.0162     0.8733 0.996 0.000 0.000 0.000 0.004
#> GSM711968     1  0.0290     0.8721 0.992 0.000 0.000 0.000 0.008
#> GSM711972     1  0.0162     0.8733 0.996 0.000 0.000 0.000 0.004
#> GSM711976     1  0.0324     0.8732 0.992 0.000 0.000 0.004 0.004
#> GSM711980     1  0.0290     0.8721 0.992 0.000 0.000 0.000 0.008
#> GSM711986     1  0.0162     0.8733 0.996 0.000 0.000 0.000 0.004
#> GSM711904     1  0.3796     0.5551 0.700 0.000 0.000 0.000 0.300
#> GSM711906     1  0.0162     0.8733 0.996 0.000 0.000 0.000 0.004
#> GSM711908     5  0.4300     0.1601 0.476 0.000 0.000 0.000 0.524
#> GSM711910     1  0.2690     0.7844 0.844 0.000 0.000 0.000 0.156
#> GSM711914     1  0.0162     0.8733 0.996 0.000 0.000 0.000 0.004
#> GSM711916     5  0.4300     0.1601 0.476 0.000 0.000 0.000 0.524
#> GSM711922     1  0.0290     0.8721 0.992 0.000 0.000 0.000 0.008
#> GSM711924     1  0.0324     0.8732 0.992 0.000 0.000 0.004 0.004
#> GSM711926     1  0.4987     0.3840 0.616 0.000 0.000 0.340 0.044
#> GSM711928     1  0.0290     0.8721 0.992 0.000 0.000 0.000 0.008
#> GSM711930     5  0.4300     0.1601 0.476 0.000 0.000 0.000 0.524
#> GSM711932     1  0.0324     0.8732 0.992 0.000 0.000 0.004 0.004
#> GSM711934     1  0.0404     0.8712 0.988 0.000 0.000 0.000 0.012
#> GSM711940     1  0.0703     0.8687 0.976 0.000 0.000 0.000 0.024
#> GSM711942     1  0.0290     0.8727 0.992 0.000 0.000 0.000 0.008
#> GSM711944     1  0.0324     0.8732 0.992 0.000 0.000 0.004 0.004
#> GSM711946     1  0.3825     0.7603 0.804 0.000 0.000 0.060 0.136
#> GSM711948     1  0.0324     0.8732 0.992 0.000 0.000 0.004 0.004
#> GSM711952     5  0.4302     0.1483 0.480 0.000 0.000 0.000 0.520
#> GSM711954     1  0.0963     0.8667 0.964 0.000 0.000 0.000 0.036
#> GSM711962     1  0.0162     0.8733 0.996 0.000 0.000 0.000 0.004
#> GSM711970     5  0.4302     0.1483 0.480 0.000 0.000 0.000 0.520
#> GSM711974     1  0.0794     0.8690 0.972 0.000 0.000 0.000 0.028
#> GSM711978     1  0.4096     0.7057 0.772 0.000 0.000 0.176 0.052
#> GSM711988     1  0.0324     0.8732 0.992 0.000 0.000 0.004 0.004
#> GSM711990     1  0.2561     0.7966 0.856 0.000 0.000 0.000 0.144
#> GSM711992     1  0.3493     0.7900 0.832 0.000 0.000 0.060 0.108
#> GSM711982     1  0.0162     0.8733 0.996 0.000 0.000 0.000 0.004
#> GSM711984     2  0.0000     0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM711912     1  0.0609     0.8696 0.980 0.000 0.000 0.000 0.020
#> GSM711918     1  0.0609     0.8696 0.980 0.000 0.000 0.000 0.020
#> GSM711920     1  0.0324     0.8732 0.992 0.000 0.000 0.004 0.004
#> GSM711937     5  0.6671    -0.2978 0.000 0.372 0.000 0.232 0.396
#> GSM711939     2  0.3849     0.7283 0.000 0.752 0.000 0.232 0.016
#> GSM711951     4  0.1557     0.6434 0.008 0.000 0.000 0.940 0.052
#> GSM711957     4  0.4385     0.3195 0.180 0.000 0.000 0.752 0.068
#> GSM711959     2  0.0000     0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0000     0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM711965     1  0.2561     0.7966 0.856 0.000 0.000 0.000 0.144
#> GSM711967     1  0.0324     0.8732 0.992 0.000 0.000 0.004 0.004
#> GSM711969     5  0.6671    -0.2978 0.000 0.372 0.000 0.232 0.396
#> GSM711973     1  0.2707     0.8040 0.876 0.000 0.000 0.100 0.024
#> GSM711977     1  0.3449     0.7296 0.812 0.000 0.000 0.164 0.024
#> GSM711981     1  0.4603     0.4952 0.668 0.000 0.000 0.300 0.032
#> GSM711987     2  0.3849     0.7283 0.000 0.752 0.000 0.232 0.016
#> GSM711905     2  0.0000     0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM711907     3  0.4126     0.7790 0.000 0.000 0.620 0.000 0.380
#> GSM711909     1  0.2690     0.7844 0.844 0.000 0.000 0.000 0.156
#> GSM711911     1  0.2690     0.7844 0.844 0.000 0.000 0.000 0.156
#> GSM711915     3  0.0000     0.5758 0.000 0.000 1.000 0.000 0.000
#> GSM711917     5  0.6671    -0.2978 0.000 0.372 0.000 0.232 0.396
#> GSM711923     1  0.4430     0.6927 0.752 0.000 0.000 0.172 0.076
#> GSM711925     2  0.0000     0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM711927     1  0.2690     0.7844 0.844 0.000 0.000 0.000 0.156
#> GSM711929     2  0.0000     0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM711931     4  0.1121     0.6439 0.000 0.000 0.000 0.956 0.044
#> GSM711933     1  0.0404     0.8712 0.988 0.000 0.000 0.000 0.012
#> GSM711935     2  0.0000     0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM711941     1  0.0324     0.8732 0.992 0.000 0.000 0.004 0.004
#> GSM711943     1  0.3825     0.7603 0.804 0.000 0.000 0.060 0.136
#> GSM711945     1  0.4421     0.7210 0.772 0.000 0.012 0.060 0.156
#> GSM711947     3  0.4126     0.7790 0.000 0.000 0.620 0.000 0.380
#> GSM711949     2  0.0000     0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM711955     1  0.0404     0.8712 0.988 0.000 0.000 0.000 0.012
#> GSM711963     2  0.0000     0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM711971     1  0.2516     0.7980 0.860 0.000 0.000 0.000 0.140
#> GSM711975     4  0.1270     0.6440 0.000 0.000 0.000 0.948 0.052
#> GSM711979     1  0.4452     0.5450 0.696 0.000 0.000 0.272 0.032
#> GSM711989     4  0.6415     0.0346 0.000 0.172 0.000 0.428 0.400
#> GSM711991     1  0.7195     0.0885 0.508 0.000 0.276 0.060 0.156
#> GSM711993     1  0.4603     0.4952 0.668 0.000 0.000 0.300 0.032
#> GSM711983     1  0.2516     0.7980 0.860 0.000 0.000 0.000 0.140
#> GSM711985     2  0.3849     0.7283 0.000 0.752 0.000 0.232 0.016
#> GSM711913     1  0.3449     0.7296 0.812 0.000 0.000 0.164 0.024
#> GSM711919     1  0.2690     0.7844 0.844 0.000 0.000 0.000 0.156
#> GSM711921     1  0.2690     0.7844 0.844 0.000 0.000 0.000 0.156

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     6  0.5971  -0.059700 0.000 0.344 0.000 0.232 0.000 0.424
#> GSM711938     2  0.3964   0.689049 0.000 0.724 0.000 0.232 0.000 0.044
#> GSM711950     1  0.0405   0.817068 0.988 0.000 0.008 0.000 0.000 0.004
#> GSM711956     1  0.0000   0.819171 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711958     1  0.0000   0.819171 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711960     1  0.1176   0.798197 0.956 0.000 0.020 0.000 0.000 0.024
#> GSM711964     1  0.1720   0.770090 0.928 0.000 0.040 0.000 0.000 0.032
#> GSM711966     1  0.0000   0.819171 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711968     1  0.0820   0.810020 0.972 0.000 0.016 0.000 0.000 0.012
#> GSM711972     1  0.0000   0.819171 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711976     1  0.0405   0.817068 0.988 0.000 0.008 0.000 0.000 0.004
#> GSM711980     1  0.0520   0.814634 0.984 0.000 0.008 0.000 0.000 0.008
#> GSM711986     1  0.0000   0.819171 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711904     3  0.5962   0.436480 0.364 0.000 0.412 0.000 0.000 0.224
#> GSM711906     1  0.0000   0.819171 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711908     6  0.5576   0.338783 0.144 0.000 0.376 0.000 0.000 0.480
#> GSM711910     3  0.3717   0.869447 0.384 0.000 0.616 0.000 0.000 0.000
#> GSM711914     1  0.0000   0.819171 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711916     6  0.5576   0.338783 0.144 0.000 0.376 0.000 0.000 0.480
#> GSM711922     1  0.0520   0.814634 0.984 0.000 0.008 0.000 0.000 0.008
#> GSM711924     1  0.0291   0.818374 0.992 0.000 0.004 0.000 0.000 0.004
#> GSM711926     1  0.6418  -0.006389 0.464 0.000 0.228 0.280 0.000 0.028
#> GSM711928     1  0.0909   0.807248 0.968 0.000 0.020 0.000 0.000 0.012
#> GSM711930     6  0.5576   0.338783 0.144 0.000 0.376 0.000 0.000 0.480
#> GSM711932     1  0.0405   0.817068 0.988 0.000 0.008 0.000 0.000 0.004
#> GSM711934     1  0.0508   0.815231 0.984 0.000 0.004 0.000 0.000 0.012
#> GSM711940     1  0.0858   0.807227 0.968 0.000 0.004 0.000 0.000 0.028
#> GSM711942     1  0.0146   0.818345 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM711944     1  0.0291   0.818374 0.992 0.000 0.004 0.000 0.000 0.004
#> GSM711946     3  0.3607   0.834211 0.348 0.000 0.652 0.000 0.000 0.000
#> GSM711948     1  0.0405   0.817068 0.988 0.000 0.008 0.000 0.000 0.004
#> GSM711952     6  0.5603   0.330355 0.148 0.000 0.376 0.000 0.000 0.476
#> GSM711954     1  0.2457   0.699905 0.880 0.000 0.084 0.000 0.000 0.036
#> GSM711962     1  0.0000   0.819171 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711970     6  0.5603   0.330355 0.148 0.000 0.376 0.000 0.000 0.476
#> GSM711974     1  0.1176   0.798197 0.956 0.000 0.020 0.000 0.000 0.024
#> GSM711978     1  0.5642  -0.411811 0.468 0.000 0.420 0.096 0.000 0.016
#> GSM711988     1  0.0405   0.817068 0.988 0.000 0.008 0.000 0.000 0.004
#> GSM711990     3  0.3937   0.843247 0.424 0.000 0.572 0.000 0.000 0.004
#> GSM711992     3  0.4115   0.815929 0.360 0.000 0.624 0.004 0.000 0.012
#> GSM711982     1  0.0000   0.819171 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711984     2  0.0000   0.894919 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711912     1  0.1461   0.774963 0.940 0.000 0.044 0.000 0.000 0.016
#> GSM711918     1  0.1088   0.798659 0.960 0.000 0.024 0.000 0.000 0.016
#> GSM711920     1  0.0291   0.818374 0.992 0.000 0.004 0.000 0.000 0.004
#> GSM711937     6  0.5971  -0.059700 0.000 0.344 0.000 0.232 0.000 0.424
#> GSM711939     2  0.3964   0.689049 0.000 0.724 0.000 0.232 0.000 0.044
#> GSM711951     4  0.1625   0.674410 0.000 0.000 0.060 0.928 0.000 0.012
#> GSM711957     4  0.5528   0.328872 0.036 0.000 0.252 0.616 0.000 0.096
#> GSM711959     2  0.0000   0.894919 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711961     2  0.0000   0.894919 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711965     3  0.3937   0.843247 0.424 0.000 0.572 0.000 0.000 0.004
#> GSM711967     1  0.0291   0.818374 0.992 0.000 0.004 0.000 0.000 0.004
#> GSM711969     6  0.5971  -0.059700 0.000 0.344 0.000 0.232 0.000 0.424
#> GSM711973     1  0.5033  -0.000292 0.596 0.000 0.336 0.044 0.000 0.024
#> GSM711977     1  0.5765  -0.248045 0.504 0.000 0.372 0.100 0.000 0.024
#> GSM711981     1  0.6226   0.094452 0.516 0.000 0.232 0.224 0.000 0.028
#> GSM711987     2  0.3964   0.689049 0.000 0.724 0.000 0.232 0.000 0.044
#> GSM711905     2  0.0000   0.894919 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     5  0.3706   0.772371 0.000 0.000 0.000 0.000 0.620 0.380
#> GSM711909     3  0.3727   0.869720 0.388 0.000 0.612 0.000 0.000 0.000
#> GSM711911     3  0.3756   0.864356 0.400 0.000 0.600 0.000 0.000 0.000
#> GSM711915     5  0.0000   0.550722 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM711917     6  0.5971  -0.059700 0.000 0.344 0.000 0.232 0.000 0.424
#> GSM711923     1  0.5353  -0.466404 0.464 0.000 0.440 0.092 0.000 0.004
#> GSM711925     2  0.0000   0.894919 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.3727   0.869720 0.388 0.000 0.612 0.000 0.000 0.000
#> GSM711929     2  0.0000   0.894919 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711931     4  0.1411   0.676001 0.000 0.000 0.060 0.936 0.000 0.004
#> GSM711933     1  0.0993   0.802407 0.964 0.000 0.024 0.000 0.000 0.012
#> GSM711935     2  0.0000   0.894919 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     1  0.0405   0.817068 0.988 0.000 0.008 0.000 0.000 0.004
#> GSM711943     3  0.3607   0.834211 0.348 0.000 0.652 0.000 0.000 0.000
#> GSM711945     3  0.3784   0.810041 0.308 0.000 0.680 0.000 0.012 0.000
#> GSM711947     5  0.3706   0.772371 0.000 0.000 0.000 0.000 0.620 0.380
#> GSM711949     2  0.0000   0.894919 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.0000   0.894919 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     1  0.0508   0.815231 0.984 0.000 0.004 0.000 0.000 0.012
#> GSM711963     2  0.0000   0.894919 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.3823   0.827364 0.436 0.000 0.564 0.000 0.000 0.000
#> GSM711975     4  0.1500   0.676792 0.000 0.000 0.052 0.936 0.000 0.012
#> GSM711979     1  0.6069   0.142034 0.548 0.000 0.212 0.212 0.000 0.028
#> GSM711989     4  0.5612   0.043801 0.000 0.144 0.000 0.432 0.000 0.424
#> GSM711991     3  0.5207   0.311322 0.132 0.000 0.592 0.000 0.276 0.000
#> GSM711993     1  0.6226   0.094452 0.516 0.000 0.232 0.224 0.000 0.028
#> GSM711983     3  0.3823   0.827364 0.436 0.000 0.564 0.000 0.000 0.000
#> GSM711985     2  0.3964   0.689049 0.000 0.724 0.000 0.232 0.000 0.044
#> GSM711913     1  0.5765  -0.248045 0.504 0.000 0.372 0.100 0.000 0.024
#> GSM711919     3  0.3727   0.869720 0.388 0.000 0.612 0.000 0.000 0.000
#> GSM711921     3  0.3717   0.869447 0.384 0.000 0.616 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-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 tissue(p) disease.state(p) individual(p) k
#> ATC:hclust 90  2.34e-04            0.285         0.363 2
#> ATC:hclust 89  6.25e-04            0.273         0.311 3
#> ATC:hclust 88  1.53e-04            0.442         0.428 4
#> ATC:hclust 75  3.66e-04            0.675         0.413 5
#> ATC:hclust 68  3.69e-07            0.444         0.554 6

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


ATC:kmeans**

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

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

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

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

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

collect_plots(res)

plot of chunk ATC-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.992       0.997         0.3884 0.615   0.615
#> 3 3 0.602           0.787       0.879         0.5714 0.722   0.553
#> 4 4 0.626           0.778       0.849         0.1500 0.895   0.714
#> 5 5 0.699           0.693       0.770         0.0840 0.951   0.831
#> 6 6 0.752           0.581       0.751         0.0531 0.975   0.899

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
#> GSM711936     2   0.000      1.000 0.000 1.000
#> GSM711938     2   0.000      1.000 0.000 1.000
#> GSM711950     1   0.000      0.996 1.000 0.000
#> GSM711956     1   0.000      0.996 1.000 0.000
#> GSM711958     1   0.000      0.996 1.000 0.000
#> GSM711960     1   0.000      0.996 1.000 0.000
#> GSM711964     1   0.000      0.996 1.000 0.000
#> GSM711966     1   0.000      0.996 1.000 0.000
#> GSM711968     1   0.000      0.996 1.000 0.000
#> GSM711972     1   0.000      0.996 1.000 0.000
#> GSM711976     1   0.000      0.996 1.000 0.000
#> GSM711980     1   0.000      0.996 1.000 0.000
#> GSM711986     1   0.000      0.996 1.000 0.000
#> GSM711904     1   0.000      0.996 1.000 0.000
#> GSM711906     1   0.000      0.996 1.000 0.000
#> GSM711908     1   0.000      0.996 1.000 0.000
#> GSM711910     1   0.000      0.996 1.000 0.000
#> GSM711914     1   0.000      0.996 1.000 0.000
#> GSM711916     1   0.000      0.996 1.000 0.000
#> GSM711922     1   0.000      0.996 1.000 0.000
#> GSM711924     1   0.000      0.996 1.000 0.000
#> GSM711926     1   0.000      0.996 1.000 0.000
#> GSM711928     1   0.000      0.996 1.000 0.000
#> GSM711930     1   0.000      0.996 1.000 0.000
#> GSM711932     1   0.000      0.996 1.000 0.000
#> GSM711934     1   0.000      0.996 1.000 0.000
#> GSM711940     1   0.000      0.996 1.000 0.000
#> GSM711942     1   0.000      0.996 1.000 0.000
#> GSM711944     1   0.000      0.996 1.000 0.000
#> GSM711946     1   0.000      0.996 1.000 0.000
#> GSM711948     1   0.000      0.996 1.000 0.000
#> GSM711952     1   0.000      0.996 1.000 0.000
#> GSM711954     1   0.000      0.996 1.000 0.000
#> GSM711962     1   0.000      0.996 1.000 0.000
#> GSM711970     1   0.000      0.996 1.000 0.000
#> GSM711974     1   0.000      0.996 1.000 0.000
#> GSM711978     1   0.000      0.996 1.000 0.000
#> GSM711988     1   0.000      0.996 1.000 0.000
#> GSM711990     1   0.000      0.996 1.000 0.000
#> GSM711992     1   0.000      0.996 1.000 0.000
#> GSM711982     1   0.000      0.996 1.000 0.000
#> GSM711984     2   0.000      1.000 0.000 1.000
#> GSM711912     1   0.000      0.996 1.000 0.000
#> GSM711918     1   0.000      0.996 1.000 0.000
#> GSM711920     1   0.000      0.996 1.000 0.000
#> GSM711937     2   0.000      1.000 0.000 1.000
#> GSM711939     2   0.000      1.000 0.000 1.000
#> GSM711951     1   0.861      0.603 0.716 0.284
#> GSM711957     1   0.000      0.996 1.000 0.000
#> GSM711959     2   0.000      1.000 0.000 1.000
#> GSM711961     2   0.000      1.000 0.000 1.000
#> GSM711965     1   0.000      0.996 1.000 0.000
#> GSM711967     1   0.000      0.996 1.000 0.000
#> GSM711969     2   0.000      1.000 0.000 1.000
#> GSM711973     1   0.000      0.996 1.000 0.000
#> GSM711977     1   0.000      0.996 1.000 0.000
#> GSM711981     1   0.000      0.996 1.000 0.000
#> GSM711987     2   0.000      1.000 0.000 1.000
#> GSM711905     2   0.000      1.000 0.000 1.000
#> GSM711907     2   0.000      1.000 0.000 1.000
#> GSM711909     1   0.000      0.996 1.000 0.000
#> GSM711911     1   0.000      0.996 1.000 0.000
#> GSM711915     2   0.000      1.000 0.000 1.000
#> GSM711917     2   0.000      1.000 0.000 1.000
#> GSM711923     1   0.000      0.996 1.000 0.000
#> GSM711925     2   0.000      1.000 0.000 1.000
#> GSM711927     1   0.000      0.996 1.000 0.000
#> GSM711929     2   0.000      1.000 0.000 1.000
#> GSM711931     1   0.000      0.996 1.000 0.000
#> GSM711933     1   0.000      0.996 1.000 0.000
#> GSM711935     2   0.000      1.000 0.000 1.000
#> GSM711941     1   0.000      0.996 1.000 0.000
#> GSM711943     1   0.000      0.996 1.000 0.000
#> GSM711945     1   0.000      0.996 1.000 0.000
#> GSM711947     2   0.000      1.000 0.000 1.000
#> GSM711949     2   0.000      1.000 0.000 1.000
#> GSM711953     2   0.000      1.000 0.000 1.000
#> GSM711955     1   0.000      0.996 1.000 0.000
#> GSM711963     2   0.000      1.000 0.000 1.000
#> GSM711971     1   0.000      0.996 1.000 0.000
#> GSM711975     2   0.000      1.000 0.000 1.000
#> GSM711979     1   0.000      0.996 1.000 0.000
#> GSM711989     2   0.000      1.000 0.000 1.000
#> GSM711991     1   0.000      0.996 1.000 0.000
#> GSM711993     1   0.000      0.996 1.000 0.000
#> GSM711983     1   0.000      0.996 1.000 0.000
#> GSM711985     2   0.000      1.000 0.000 1.000
#> GSM711913     1   0.000      0.996 1.000 0.000
#> GSM711919     1   0.000      0.996 1.000 0.000
#> GSM711921     1   0.000      0.996 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM711936     2  0.3038      0.914 0.000 0.896 0.104
#> GSM711938     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711950     1  0.0592      0.916 0.988 0.000 0.012
#> GSM711956     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711958     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711960     1  0.4399      0.655 0.812 0.000 0.188
#> GSM711964     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711966     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711968     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711972     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711976     1  0.0237      0.921 0.996 0.000 0.004
#> GSM711980     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711986     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711904     3  0.6299      0.477 0.476 0.000 0.524
#> GSM711906     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711908     3  0.6309      0.417 0.500 0.000 0.500
#> GSM711910     3  0.6008      0.642 0.372 0.000 0.628
#> GSM711914     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711916     1  0.4887      0.570 0.772 0.000 0.228
#> GSM711922     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711924     1  0.0237      0.921 0.996 0.000 0.004
#> GSM711926     3  0.4605      0.708 0.204 0.000 0.796
#> GSM711928     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711930     3  0.6305      0.458 0.484 0.000 0.516
#> GSM711932     1  0.0237      0.921 0.996 0.000 0.004
#> GSM711934     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711940     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711942     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711944     1  0.0592      0.916 0.988 0.000 0.012
#> GSM711946     3  0.3816      0.729 0.148 0.000 0.852
#> GSM711948     1  0.0592      0.916 0.988 0.000 0.012
#> GSM711952     1  0.4291      0.652 0.820 0.000 0.180
#> GSM711954     1  0.4235      0.662 0.824 0.000 0.176
#> GSM711962     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711970     3  0.6168      0.596 0.412 0.000 0.588
#> GSM711974     1  0.0237      0.920 0.996 0.000 0.004
#> GSM711978     3  0.5016      0.711 0.240 0.000 0.760
#> GSM711988     1  0.0237      0.921 0.996 0.000 0.004
#> GSM711990     1  0.6309     -0.417 0.504 0.000 0.496
#> GSM711992     3  0.4178      0.722 0.172 0.000 0.828
#> GSM711982     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711984     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711912     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711918     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711920     1  0.0237      0.921 0.996 0.000 0.004
#> GSM711937     2  0.0237      0.951 0.000 0.996 0.004
#> GSM711939     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711951     3  0.0000      0.622 0.000 0.000 1.000
#> GSM711957     3  0.6307      0.310 0.488 0.000 0.512
#> GSM711959     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711961     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711965     3  0.5926      0.654 0.356 0.000 0.644
#> GSM711967     1  0.0237      0.921 0.996 0.000 0.004
#> GSM711969     2  0.3116      0.912 0.000 0.892 0.108
#> GSM711973     1  0.2625      0.835 0.916 0.000 0.084
#> GSM711977     3  0.5497      0.703 0.292 0.000 0.708
#> GSM711981     3  0.5016      0.711 0.240 0.000 0.760
#> GSM711987     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711905     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711907     2  0.3551      0.900 0.000 0.868 0.132
#> GSM711909     3  0.6008      0.642 0.372 0.000 0.628
#> GSM711911     3  0.6291      0.473 0.468 0.000 0.532
#> GSM711915     3  0.4002      0.480 0.000 0.160 0.840
#> GSM711917     2  0.3116      0.912 0.000 0.892 0.108
#> GSM711923     3  0.5216      0.708 0.260 0.000 0.740
#> GSM711925     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711927     3  0.6045      0.632 0.380 0.000 0.620
#> GSM711929     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711931     3  0.3116      0.652 0.108 0.000 0.892
#> GSM711933     1  0.0000      0.923 1.000 0.000 0.000
#> GSM711935     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711941     1  0.1964      0.870 0.944 0.000 0.056
#> GSM711943     3  0.3551      0.725 0.132 0.000 0.868
#> GSM711945     3  0.0237      0.628 0.004 0.000 0.996
#> GSM711947     2  0.4062      0.878 0.000 0.836 0.164
#> GSM711949     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711955     1  0.0424      0.918 0.992 0.000 0.008
#> GSM711963     2  0.0000      0.952 0.000 1.000 0.000
#> GSM711971     1  0.5591      0.372 0.696 0.000 0.304
#> GSM711975     2  0.6302      0.444 0.000 0.520 0.480
#> GSM711979     1  0.4002      0.706 0.840 0.000 0.160
#> GSM711989     2  0.3686      0.895 0.000 0.860 0.140
#> GSM711991     3  0.0237      0.624 0.004 0.000 0.996
#> GSM711993     3  0.5497      0.668 0.292 0.000 0.708
#> GSM711983     1  0.3752      0.747 0.856 0.000 0.144
#> GSM711985     2  0.0237      0.951 0.000 0.996 0.004
#> GSM711913     3  0.3816      0.729 0.148 0.000 0.852
#> GSM711919     3  0.6308      0.415 0.492 0.000 0.508
#> GSM711921     3  0.6008      0.642 0.372 0.000 0.628

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.5631      0.826 0.000 0.700 0.076 0.224
#> GSM711938     2  0.2450      0.871 0.000 0.912 0.016 0.072
#> GSM711950     1  0.2949      0.855 0.888 0.000 0.024 0.088
#> GSM711956     1  0.0000      0.904 1.000 0.000 0.000 0.000
#> GSM711958     1  0.0657      0.901 0.984 0.000 0.004 0.012
#> GSM711960     3  0.4477      0.713 0.312 0.000 0.688 0.000
#> GSM711964     1  0.0707      0.899 0.980 0.000 0.020 0.000
#> GSM711966     1  0.0469      0.902 0.988 0.000 0.012 0.000
#> GSM711968     1  0.0707      0.899 0.980 0.000 0.020 0.000
#> GSM711972     1  0.0188      0.904 0.996 0.000 0.000 0.004
#> GSM711976     1  0.2197      0.875 0.916 0.000 0.004 0.080
#> GSM711980     1  0.0000      0.904 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0592      0.901 0.984 0.000 0.016 0.000
#> GSM711904     3  0.4283      0.761 0.256 0.000 0.740 0.004
#> GSM711906     1  0.0336      0.903 0.992 0.000 0.008 0.000
#> GSM711908     3  0.4482      0.753 0.264 0.000 0.728 0.008
#> GSM711910     3  0.3557      0.781 0.108 0.000 0.856 0.036
#> GSM711914     1  0.0000      0.904 1.000 0.000 0.000 0.000
#> GSM711916     3  0.4632      0.715 0.308 0.000 0.688 0.004
#> GSM711922     1  0.0000      0.904 1.000 0.000 0.000 0.000
#> GSM711924     1  0.1743      0.887 0.940 0.000 0.004 0.056
#> GSM711926     4  0.5265      0.785 0.092 0.000 0.160 0.748
#> GSM711928     1  0.0707      0.899 0.980 0.000 0.020 0.000
#> GSM711930     3  0.4283      0.761 0.256 0.000 0.740 0.004
#> GSM711932     1  0.2197      0.875 0.916 0.000 0.004 0.080
#> GSM711934     1  0.0000      0.904 1.000 0.000 0.000 0.000
#> GSM711940     1  0.0469      0.902 0.988 0.000 0.012 0.000
#> GSM711942     1  0.0000      0.904 1.000 0.000 0.000 0.000
#> GSM711944     1  0.2949      0.855 0.888 0.000 0.024 0.088
#> GSM711946     3  0.3999      0.636 0.036 0.000 0.824 0.140
#> GSM711948     1  0.2949      0.855 0.888 0.000 0.024 0.088
#> GSM711952     1  0.5147     -0.209 0.536 0.000 0.460 0.004
#> GSM711954     1  0.5147     -0.209 0.536 0.000 0.460 0.004
#> GSM711962     1  0.0188      0.904 0.996 0.000 0.004 0.000
#> GSM711970     3  0.4328      0.765 0.244 0.000 0.748 0.008
#> GSM711974     1  0.0921      0.894 0.972 0.000 0.028 0.000
#> GSM711978     4  0.5265      0.785 0.092 0.000 0.160 0.748
#> GSM711988     1  0.2197      0.875 0.916 0.000 0.004 0.080
#> GSM711990     3  0.3763      0.797 0.144 0.000 0.832 0.024
#> GSM711992     4  0.5240      0.772 0.072 0.000 0.188 0.740
#> GSM711982     1  0.0469      0.902 0.988 0.000 0.012 0.000
#> GSM711984     2  0.0000      0.868 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0707      0.899 0.980 0.000 0.020 0.000
#> GSM711918     1  0.0707      0.899 0.980 0.000 0.020 0.000
#> GSM711920     1  0.1902      0.884 0.932 0.000 0.004 0.064
#> GSM711937     2  0.5432      0.833 0.000 0.716 0.068 0.216
#> GSM711939     2  0.5180      0.841 0.000 0.740 0.064 0.196
#> GSM711951     4  0.2216      0.655 0.000 0.000 0.092 0.908
#> GSM711957     4  0.5327      0.673 0.220 0.000 0.060 0.720
#> GSM711959     2  0.0000      0.868 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.868 0.000 1.000 0.000 0.000
#> GSM711965     3  0.3978      0.775 0.108 0.000 0.836 0.056
#> GSM711967     1  0.1902      0.884 0.932 0.000 0.004 0.064
#> GSM711969     2  0.5631      0.826 0.000 0.700 0.076 0.224
#> GSM711973     1  0.4617      0.703 0.764 0.000 0.032 0.204
#> GSM711977     4  0.6946      0.610 0.212 0.000 0.200 0.588
#> GSM711981     4  0.5265      0.785 0.092 0.000 0.160 0.748
#> GSM711987     2  0.2450      0.871 0.000 0.912 0.016 0.072
#> GSM711905     2  0.0000      0.868 0.000 1.000 0.000 0.000
#> GSM711907     2  0.6397      0.794 0.000 0.648 0.144 0.208
#> GSM711909     3  0.3842      0.795 0.128 0.000 0.836 0.036
#> GSM711911     3  0.4307      0.784 0.144 0.000 0.808 0.048
#> GSM711915     3  0.3074      0.515 0.000 0.000 0.848 0.152
#> GSM711917     2  0.5631      0.826 0.000 0.700 0.076 0.224
#> GSM711923     4  0.5551      0.770 0.112 0.000 0.160 0.728
#> GSM711925     2  0.0000      0.868 0.000 1.000 0.000 0.000
#> GSM711927     3  0.3842      0.795 0.128 0.000 0.836 0.036
#> GSM711929     2  0.0000      0.868 0.000 1.000 0.000 0.000
#> GSM711931     4  0.1209      0.679 0.004 0.000 0.032 0.964
#> GSM711933     1  0.0000      0.904 1.000 0.000 0.000 0.000
#> GSM711935     2  0.0000      0.868 0.000 1.000 0.000 0.000
#> GSM711941     1  0.3485      0.824 0.856 0.000 0.028 0.116
#> GSM711943     4  0.5359      0.686 0.036 0.000 0.288 0.676
#> GSM711945     4  0.4522      0.672 0.000 0.000 0.320 0.680
#> GSM711947     2  0.7010      0.722 0.000 0.576 0.184 0.240
#> GSM711949     2  0.0000      0.868 0.000 1.000 0.000 0.000
#> GSM711953     2  0.2376      0.871 0.000 0.916 0.016 0.068
#> GSM711955     1  0.1284      0.894 0.964 0.000 0.024 0.012
#> GSM711963     2  0.0000      0.868 0.000 1.000 0.000 0.000
#> GSM711971     3  0.5912      0.344 0.440 0.000 0.524 0.036
#> GSM711975     4  0.4104      0.514 0.000 0.080 0.088 0.832
#> GSM711979     1  0.4993      0.604 0.712 0.000 0.028 0.260
#> GSM711989     2  0.5935      0.803 0.000 0.664 0.080 0.256
#> GSM711991     3  0.4222      0.310 0.000 0.000 0.728 0.272
#> GSM711993     4  0.5247      0.748 0.148 0.000 0.100 0.752
#> GSM711983     1  0.4290      0.732 0.800 0.000 0.164 0.036
#> GSM711985     2  0.5218      0.840 0.000 0.736 0.064 0.200
#> GSM711913     4  0.5912      0.435 0.036 0.000 0.440 0.524
#> GSM711919     3  0.3749      0.796 0.128 0.000 0.840 0.032
#> GSM711921     3  0.3876      0.792 0.124 0.000 0.836 0.040

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.5925    0.76395 0.000 0.584 0.004 0.124 0.288
#> GSM711938     2  0.4010    0.80683 0.000 0.792 0.000 0.072 0.136
#> GSM711950     1  0.2102    0.79069 0.916 0.000 0.012 0.068 0.004
#> GSM711956     1  0.1502    0.81067 0.940 0.000 0.004 0.000 0.056
#> GSM711958     1  0.1041    0.80525 0.964 0.000 0.004 0.032 0.000
#> GSM711960     3  0.6215   -0.57341 0.152 0.000 0.500 0.000 0.348
#> GSM711964     1  0.4768    0.34381 0.592 0.000 0.024 0.000 0.384
#> GSM711966     1  0.2286    0.78897 0.888 0.000 0.004 0.000 0.108
#> GSM711968     1  0.4768    0.34763 0.592 0.000 0.024 0.000 0.384
#> GSM711972     1  0.0566    0.81062 0.984 0.000 0.000 0.004 0.012
#> GSM711976     1  0.1864    0.79538 0.924 0.000 0.004 0.068 0.004
#> GSM711980     1  0.1704    0.80799 0.928 0.000 0.004 0.000 0.068
#> GSM711986     1  0.2719    0.76190 0.852 0.000 0.004 0.000 0.144
#> GSM711904     5  0.6152    0.88878 0.112 0.000 0.356 0.008 0.524
#> GSM711906     1  0.2179    0.79362 0.896 0.000 0.004 0.000 0.100
#> GSM711908     5  0.6152    0.88878 0.112 0.000 0.356 0.008 0.524
#> GSM711910     3  0.1205    0.71405 0.040 0.000 0.956 0.000 0.004
#> GSM711914     1  0.1502    0.81067 0.940 0.000 0.004 0.000 0.056
#> GSM711916     5  0.5974    0.86608 0.132 0.000 0.320 0.000 0.548
#> GSM711922     1  0.1341    0.81123 0.944 0.000 0.000 0.000 0.056
#> GSM711924     1  0.1638    0.79810 0.932 0.000 0.004 0.064 0.000
#> GSM711926     4  0.3342    0.82032 0.048 0.000 0.100 0.848 0.004
#> GSM711928     1  0.4768    0.34381 0.592 0.000 0.024 0.000 0.384
#> GSM711930     5  0.5942    0.88289 0.116 0.000 0.360 0.000 0.524
#> GSM711932     1  0.1864    0.79538 0.924 0.000 0.004 0.068 0.004
#> GSM711934     1  0.1571    0.80995 0.936 0.000 0.004 0.000 0.060
#> GSM711940     1  0.2338    0.78675 0.884 0.000 0.004 0.000 0.112
#> GSM711942     1  0.1704    0.80799 0.928 0.000 0.004 0.000 0.068
#> GSM711944     1  0.1942    0.79278 0.920 0.000 0.012 0.068 0.000
#> GSM711946     3  0.2339    0.67017 0.004 0.000 0.892 0.100 0.004
#> GSM711948     1  0.1942    0.79278 0.920 0.000 0.012 0.068 0.000
#> GSM711952     5  0.6408    0.82315 0.188 0.000 0.256 0.008 0.548
#> GSM711954     5  0.6518    0.78551 0.212 0.000 0.248 0.008 0.532
#> GSM711962     1  0.1768    0.80665 0.924 0.000 0.004 0.000 0.072
#> GSM711970     5  0.6152    0.88878 0.112 0.000 0.356 0.008 0.524
#> GSM711974     1  0.6132    0.00461 0.508 0.000 0.140 0.000 0.352
#> GSM711978     4  0.3466    0.82037 0.048 0.000 0.100 0.844 0.008
#> GSM711988     1  0.1704    0.79678 0.928 0.000 0.004 0.068 0.000
#> GSM711990     3  0.1774    0.69639 0.052 0.000 0.932 0.000 0.016
#> GSM711992     4  0.3404    0.80941 0.024 0.000 0.124 0.840 0.012
#> GSM711982     1  0.2286    0.78897 0.888 0.000 0.004 0.000 0.108
#> GSM711984     2  0.0162    0.79878 0.000 0.996 0.004 0.000 0.000
#> GSM711912     1  0.4779    0.33757 0.588 0.000 0.024 0.000 0.388
#> GSM711918     1  0.4768    0.34763 0.592 0.000 0.024 0.000 0.384
#> GSM711920     1  0.1638    0.79810 0.932 0.000 0.004 0.064 0.000
#> GSM711937     2  0.5754    0.76632 0.000 0.588 0.000 0.120 0.292
#> GSM711939     2  0.5579    0.77798 0.000 0.620 0.000 0.116 0.264
#> GSM711951     4  0.2984    0.70992 0.000 0.000 0.032 0.860 0.108
#> GSM711957     4  0.3682    0.75641 0.120 0.000 0.040 0.828 0.012
#> GSM711959     2  0.0162    0.79878 0.000 0.996 0.004 0.000 0.000
#> GSM711961     2  0.0510    0.80010 0.000 0.984 0.000 0.000 0.016
#> GSM711965     3  0.1285    0.71475 0.036 0.000 0.956 0.004 0.004
#> GSM711967     1  0.1638    0.79845 0.932 0.000 0.000 0.064 0.004
#> GSM711969     2  0.5925    0.76395 0.000 0.584 0.004 0.124 0.288
#> GSM711973     1  0.3219    0.72810 0.840 0.000 0.020 0.136 0.004
#> GSM711977     3  0.6264   -0.10543 0.128 0.000 0.460 0.408 0.004
#> GSM711981     4  0.3237    0.81996 0.048 0.000 0.104 0.848 0.000
#> GSM711987     2  0.4010    0.80683 0.000 0.792 0.000 0.072 0.136
#> GSM711905     2  0.0000    0.79872 0.000 1.000 0.000 0.000 0.000
#> GSM711907     2  0.6547    0.67736 0.000 0.484 0.032 0.096 0.388
#> GSM711909     3  0.1205    0.71405 0.040 0.000 0.956 0.000 0.004
#> GSM711911     3  0.1628    0.70773 0.056 0.000 0.936 0.008 0.000
#> GSM711915     3  0.5215    0.31769 0.000 0.000 0.576 0.052 0.372
#> GSM711917     2  0.5925    0.76395 0.000 0.584 0.004 0.124 0.288
#> GSM711923     4  0.4835    0.73711 0.084 0.000 0.188 0.724 0.004
#> GSM711925     2  0.0162    0.79878 0.000 0.996 0.004 0.000 0.000
#> GSM711927     3  0.1205    0.71405 0.040 0.000 0.956 0.000 0.004
#> GSM711929     2  0.0000    0.79872 0.000 1.000 0.000 0.000 0.000
#> GSM711931     4  0.1981    0.75062 0.000 0.000 0.028 0.924 0.048
#> GSM711933     1  0.2046    0.80455 0.916 0.000 0.016 0.000 0.068
#> GSM711935     2  0.0000    0.79872 0.000 1.000 0.000 0.000 0.000
#> GSM711941     1  0.2429    0.77994 0.900 0.000 0.020 0.076 0.004
#> GSM711943     4  0.4122    0.63198 0.004 0.000 0.304 0.688 0.004
#> GSM711945     4  0.4132    0.68392 0.000 0.000 0.260 0.720 0.020
#> GSM711947     2  0.7294    0.60665 0.000 0.420 0.080 0.108 0.392
#> GSM711949     2  0.0000    0.79872 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.4010    0.80683 0.000 0.792 0.000 0.072 0.136
#> GSM711955     1  0.1836    0.80958 0.932 0.000 0.032 0.000 0.036
#> GSM711963     2  0.0162    0.79878 0.000 0.996 0.004 0.000 0.000
#> GSM711971     3  0.3696    0.47746 0.212 0.000 0.772 0.000 0.016
#> GSM711975     4  0.4516    0.49228 0.000 0.016 0.012 0.696 0.276
#> GSM711979     1  0.3742    0.66815 0.788 0.000 0.020 0.188 0.004
#> GSM711989     2  0.6308    0.72502 0.000 0.528 0.004 0.160 0.308
#> GSM711991     3  0.5382    0.40670 0.000 0.000 0.644 0.252 0.104
#> GSM711993     4  0.3362    0.80249 0.080 0.000 0.076 0.844 0.000
#> GSM711983     1  0.4836    0.22841 0.568 0.000 0.412 0.008 0.012
#> GSM711985     2  0.5579    0.77798 0.000 0.620 0.000 0.116 0.264
#> GSM711913     3  0.4434    0.26184 0.008 0.000 0.640 0.348 0.004
#> GSM711919     3  0.1357    0.70953 0.048 0.000 0.948 0.000 0.004
#> GSM711921     3  0.1124    0.71564 0.036 0.000 0.960 0.004 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.6169     0.4406 0.000 0.480 0.000 0.016 0.296 0.208
#> GSM711938     2  0.4915     0.5926 0.000 0.676 0.000 0.008 0.128 0.188
#> GSM711950     1  0.4170     0.6613 0.660 0.000 0.000 0.032 0.308 0.000
#> GSM711956     1  0.0146     0.7083 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM711958     1  0.3104     0.6967 0.800 0.000 0.000 0.016 0.184 0.000
#> GSM711960     3  0.6069    -0.3574 0.324 0.000 0.440 0.000 0.004 0.232
#> GSM711964     1  0.4032    -0.1112 0.572 0.000 0.008 0.000 0.000 0.420
#> GSM711966     1  0.0777     0.6967 0.972 0.000 0.000 0.000 0.004 0.024
#> GSM711968     1  0.4364    -0.1279 0.556 0.000 0.008 0.000 0.012 0.424
#> GSM711972     1  0.2772     0.6990 0.816 0.000 0.000 0.000 0.180 0.004
#> GSM711976     1  0.4289     0.6622 0.660 0.000 0.000 0.032 0.304 0.004
#> GSM711980     1  0.0363     0.7059 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM711986     1  0.1320     0.6886 0.948 0.000 0.000 0.000 0.016 0.036
#> GSM711904     6  0.4503     0.8538 0.084 0.000 0.232 0.000 0.000 0.684
#> GSM711906     1  0.1003     0.7019 0.964 0.000 0.000 0.000 0.020 0.016
#> GSM711908     6  0.4743     0.8543 0.088 0.000 0.224 0.000 0.008 0.680
#> GSM711910     3  0.0260     0.7449 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM711914     1  0.0363     0.7039 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM711916     6  0.5491     0.7777 0.232 0.000 0.180 0.000 0.004 0.584
#> GSM711922     1  0.0291     0.7086 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM711924     1  0.4099     0.6770 0.696 0.000 0.000 0.024 0.272 0.008
#> GSM711926     4  0.0653     0.8614 0.004 0.000 0.012 0.980 0.000 0.004
#> GSM711928     1  0.4045    -0.1291 0.564 0.000 0.008 0.000 0.000 0.428
#> GSM711930     6  0.4525     0.8558 0.088 0.000 0.228 0.000 0.000 0.684
#> GSM711932     1  0.4428     0.6587 0.648 0.000 0.000 0.032 0.312 0.008
#> GSM711934     1  0.0260     0.7055 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM711940     1  0.0972     0.6948 0.964 0.000 0.000 0.000 0.008 0.028
#> GSM711942     1  0.0622     0.7073 0.980 0.000 0.000 0.000 0.012 0.008
#> GSM711944     1  0.4152     0.6626 0.664 0.000 0.000 0.032 0.304 0.000
#> GSM711946     3  0.1333     0.7223 0.000 0.000 0.944 0.048 0.008 0.000
#> GSM711948     1  0.4170     0.6613 0.660 0.000 0.000 0.032 0.308 0.000
#> GSM711952     6  0.4878     0.8245 0.164 0.000 0.144 0.000 0.008 0.684
#> GSM711954     6  0.5324     0.6616 0.340 0.000 0.120 0.000 0.000 0.540
#> GSM711962     1  0.0291     0.7076 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM711970     6  0.4503     0.8538 0.084 0.000 0.232 0.000 0.000 0.684
#> GSM711974     1  0.5630    -0.1740 0.560 0.000 0.196 0.000 0.004 0.240
#> GSM711978     4  0.0748     0.8627 0.004 0.000 0.016 0.976 0.004 0.000
#> GSM711988     1  0.4135     0.6639 0.668 0.000 0.000 0.032 0.300 0.000
#> GSM711990     3  0.1036     0.7447 0.024 0.000 0.964 0.000 0.004 0.008
#> GSM711992     4  0.0922     0.8619 0.004 0.000 0.024 0.968 0.004 0.000
#> GSM711982     1  0.0777     0.6967 0.972 0.000 0.000 0.000 0.004 0.024
#> GSM711984     2  0.0000     0.6373 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711912     1  0.4380    -0.1546 0.544 0.000 0.008 0.000 0.012 0.436
#> GSM711918     1  0.4457    -0.1502 0.544 0.000 0.008 0.000 0.016 0.432
#> GSM711920     1  0.4193     0.6745 0.688 0.000 0.000 0.028 0.276 0.008
#> GSM711937     2  0.6116     0.4450 0.000 0.480 0.000 0.012 0.292 0.216
#> GSM711939     2  0.6024     0.4644 0.000 0.492 0.000 0.008 0.268 0.232
#> GSM711951     4  0.1624     0.8287 0.000 0.000 0.004 0.936 0.040 0.020
#> GSM711957     4  0.3106     0.7608 0.016 0.000 0.000 0.840 0.120 0.024
#> GSM711959     2  0.0291     0.6366 0.000 0.992 0.000 0.000 0.004 0.004
#> GSM711961     2  0.1934     0.6308 0.000 0.916 0.000 0.000 0.044 0.040
#> GSM711965     3  0.0653     0.7494 0.012 0.000 0.980 0.004 0.004 0.000
#> GSM711967     1  0.4173     0.6758 0.692 0.000 0.000 0.028 0.272 0.008
#> GSM711969     2  0.6243     0.4355 0.000 0.476 0.000 0.020 0.296 0.208
#> GSM711973     1  0.5603     0.5728 0.544 0.000 0.000 0.120 0.324 0.012
#> GSM711977     3  0.6458    -0.0216 0.012 0.000 0.396 0.388 0.192 0.012
#> GSM711981     4  0.0603     0.8628 0.004 0.000 0.016 0.980 0.000 0.000
#> GSM711987     2  0.4915     0.5926 0.000 0.676 0.000 0.008 0.128 0.188
#> GSM711905     2  0.0000     0.6373 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711907     5  0.5164     0.3770 0.000 0.268 0.008 0.004 0.628 0.092
#> GSM711909     3  0.0458     0.7504 0.016 0.000 0.984 0.000 0.000 0.000
#> GSM711911     3  0.1592     0.7403 0.020 0.000 0.940 0.000 0.032 0.008
#> GSM711915     5  0.6130     0.1767 0.000 0.000 0.292 0.004 0.432 0.272
#> GSM711917     2  0.6243     0.4355 0.000 0.476 0.000 0.020 0.296 0.208
#> GSM711923     4  0.3405     0.7729 0.012 0.000 0.136 0.816 0.036 0.000
#> GSM711925     2  0.0000     0.6373 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711927     3  0.0458     0.7504 0.016 0.000 0.984 0.000 0.000 0.000
#> GSM711929     2  0.0146     0.6373 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM711931     4  0.1148     0.8396 0.000 0.000 0.004 0.960 0.016 0.020
#> GSM711933     1  0.0508     0.7028 0.984 0.000 0.004 0.000 0.000 0.012
#> GSM711935     2  0.0000     0.6373 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711941     1  0.4476     0.6482 0.640 0.000 0.000 0.052 0.308 0.000
#> GSM711943     4  0.3012     0.7368 0.000 0.000 0.196 0.796 0.008 0.000
#> GSM711945     4  0.2980     0.7444 0.000 0.000 0.192 0.800 0.008 0.000
#> GSM711947     5  0.5968     0.4948 0.000 0.208 0.064 0.012 0.624 0.092
#> GSM711949     2  0.0000     0.6373 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711953     2  0.4915     0.5926 0.000 0.676 0.000 0.008 0.128 0.188
#> GSM711955     1  0.1382     0.7054 0.948 0.000 0.008 0.000 0.036 0.008
#> GSM711963     2  0.0000     0.6373 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.2791     0.6773 0.096 0.000 0.864 0.000 0.032 0.008
#> GSM711975     4  0.5462     0.2514 0.000 0.000 0.004 0.592 0.204 0.200
#> GSM711979     1  0.5474     0.5751 0.552 0.000 0.000 0.132 0.312 0.004
#> GSM711989     2  0.7396     0.1851 0.000 0.364 0.004 0.112 0.312 0.208
#> GSM711991     3  0.6590     0.0758 0.000 0.000 0.424 0.292 0.252 0.032
#> GSM711993     4  0.0653     0.8617 0.004 0.000 0.012 0.980 0.004 0.000
#> GSM711983     3  0.4901     0.4313 0.260 0.000 0.648 0.000 0.084 0.008
#> GSM711985     2  0.6024     0.4644 0.000 0.492 0.000 0.008 0.268 0.232
#> GSM711913     3  0.4358     0.3005 0.000 0.000 0.620 0.352 0.020 0.008
#> GSM711919     3  0.0837     0.7480 0.020 0.000 0.972 0.000 0.004 0.004
#> GSM711921     3  0.0458     0.7504 0.016 0.000 0.984 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-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 tissue(p) disease.state(p) individual(p) k
#> ATC:kmeans 90  1.10e-04           0.2961         0.417 2
#> ATC:kmeans 80  3.20e-07           0.5042         0.488 3
#> ATC:kmeans 85  5.03e-06           0.3688         0.383 4
#> ATC:kmeans 76  4.61e-06           0.0658         0.272 5
#> ATC:kmeans 68  5.00e-05           0.1443         0.473 6

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


ATC:skmeans*

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 27425 rows and 90 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 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-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.987       0.995         0.4388 0.558   0.558
#> 3 3 0.656           0.811       0.876         0.4076 0.773   0.601
#> 4 4 0.780           0.826       0.897         0.1722 0.794   0.494
#> 5 5 0.903           0.891       0.943         0.0587 0.847   0.523
#> 6 6 0.825           0.783       0.877         0.0274 0.968   0.866

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

suggest_best_k(res)
#> [1] 5
#> 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
#> GSM711936     2   0.000      0.985 0.000 1.000
#> GSM711938     2   0.000      0.985 0.000 1.000
#> GSM711950     1   0.000      1.000 1.000 0.000
#> GSM711956     1   0.000      1.000 1.000 0.000
#> GSM711958     1   0.000      1.000 1.000 0.000
#> GSM711960     1   0.000      1.000 1.000 0.000
#> GSM711964     1   0.000      1.000 1.000 0.000
#> GSM711966     1   0.000      1.000 1.000 0.000
#> GSM711968     1   0.000      1.000 1.000 0.000
#> GSM711972     1   0.000      1.000 1.000 0.000
#> GSM711976     1   0.000      1.000 1.000 0.000
#> GSM711980     1   0.000      1.000 1.000 0.000
#> GSM711986     1   0.000      1.000 1.000 0.000
#> GSM711904     1   0.000      1.000 1.000 0.000
#> GSM711906     1   0.000      1.000 1.000 0.000
#> GSM711908     1   0.000      1.000 1.000 0.000
#> GSM711910     1   0.000      1.000 1.000 0.000
#> GSM711914     1   0.000      1.000 1.000 0.000
#> GSM711916     1   0.000      1.000 1.000 0.000
#> GSM711922     1   0.000      1.000 1.000 0.000
#> GSM711924     1   0.000      1.000 1.000 0.000
#> GSM711926     2   0.000      0.985 0.000 1.000
#> GSM711928     1   0.000      1.000 1.000 0.000
#> GSM711930     1   0.000      1.000 1.000 0.000
#> GSM711932     1   0.000      1.000 1.000 0.000
#> GSM711934     1   0.000      1.000 1.000 0.000
#> GSM711940     1   0.000      1.000 1.000 0.000
#> GSM711942     1   0.000      1.000 1.000 0.000
#> GSM711944     1   0.000      1.000 1.000 0.000
#> GSM711946     1   0.000      1.000 1.000 0.000
#> GSM711948     1   0.000      1.000 1.000 0.000
#> GSM711952     1   0.000      1.000 1.000 0.000
#> GSM711954     1   0.000      1.000 1.000 0.000
#> GSM711962     1   0.000      1.000 1.000 0.000
#> GSM711970     1   0.000      1.000 1.000 0.000
#> GSM711974     1   0.000      1.000 1.000 0.000
#> GSM711978     1   0.000      1.000 1.000 0.000
#> GSM711988     1   0.000      1.000 1.000 0.000
#> GSM711990     1   0.000      1.000 1.000 0.000
#> GSM711992     2   0.983      0.264 0.424 0.576
#> GSM711982     1   0.000      1.000 1.000 0.000
#> GSM711984     2   0.000      0.985 0.000 1.000
#> GSM711912     1   0.000      1.000 1.000 0.000
#> GSM711918     1   0.000      1.000 1.000 0.000
#> GSM711920     1   0.000      1.000 1.000 0.000
#> GSM711937     2   0.000      0.985 0.000 1.000
#> GSM711939     2   0.000      0.985 0.000 1.000
#> GSM711951     2   0.000      0.985 0.000 1.000
#> GSM711957     1   0.000      1.000 1.000 0.000
#> GSM711959     2   0.000      0.985 0.000 1.000
#> GSM711961     2   0.000      0.985 0.000 1.000
#> GSM711965     1   0.000      1.000 1.000 0.000
#> GSM711967     1   0.000      1.000 1.000 0.000
#> GSM711969     2   0.000      0.985 0.000 1.000
#> GSM711973     1   0.000      1.000 1.000 0.000
#> GSM711977     1   0.000      1.000 1.000 0.000
#> GSM711981     1   0.000      1.000 1.000 0.000
#> GSM711987     2   0.000      0.985 0.000 1.000
#> GSM711905     2   0.000      0.985 0.000 1.000
#> GSM711907     2   0.000      0.985 0.000 1.000
#> GSM711909     1   0.000      1.000 1.000 0.000
#> GSM711911     1   0.000      1.000 1.000 0.000
#> GSM711915     2   0.000      0.985 0.000 1.000
#> GSM711917     2   0.000      0.985 0.000 1.000
#> GSM711923     1   0.000      1.000 1.000 0.000
#> GSM711925     2   0.000      0.985 0.000 1.000
#> GSM711927     1   0.000      1.000 1.000 0.000
#> GSM711929     2   0.000      0.985 0.000 1.000
#> GSM711931     2   0.000      0.985 0.000 1.000
#> GSM711933     1   0.000      1.000 1.000 0.000
#> GSM711935     2   0.000      0.985 0.000 1.000
#> GSM711941     1   0.000      1.000 1.000 0.000
#> GSM711943     1   0.000      1.000 1.000 0.000
#> GSM711945     2   0.000      0.985 0.000 1.000
#> GSM711947     2   0.000      0.985 0.000 1.000
#> GSM711949     2   0.000      0.985 0.000 1.000
#> GSM711953     2   0.000      0.985 0.000 1.000
#> GSM711955     1   0.000      1.000 1.000 0.000
#> GSM711963     2   0.000      0.985 0.000 1.000
#> GSM711971     1   0.000      1.000 1.000 0.000
#> GSM711975     2   0.000      0.985 0.000 1.000
#> GSM711979     1   0.000      1.000 1.000 0.000
#> GSM711989     2   0.000      0.985 0.000 1.000
#> GSM711991     2   0.000      0.985 0.000 1.000
#> GSM711993     1   0.000      1.000 1.000 0.000
#> GSM711983     1   0.000      1.000 1.000 0.000
#> GSM711985     2   0.000      0.985 0.000 1.000
#> GSM711913     1   0.000      1.000 1.000 0.000
#> GSM711919     1   0.000      1.000 1.000 0.000
#> GSM711921     1   0.000      1.000 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
#> GSM711936     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711938     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711950     1  0.4178      0.846 0.828 0.000 0.172
#> GSM711956     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711958     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711960     3  0.0237      0.804 0.004 0.000 0.996
#> GSM711964     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711966     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711968     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711972     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711976     1  0.4121      0.847 0.832 0.000 0.168
#> GSM711980     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711986     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711904     3  0.6026      0.194 0.376 0.000 0.624
#> GSM711906     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711908     3  0.6126      0.087 0.400 0.000 0.600
#> GSM711910     3  0.0000      0.806 0.000 0.000 1.000
#> GSM711914     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711916     3  0.5948      0.252 0.360 0.000 0.640
#> GSM711922     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711924     1  0.5138      0.878 0.748 0.000 0.252
#> GSM711926     2  0.5327      0.713 0.272 0.728 0.000
#> GSM711928     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711930     3  0.4291      0.650 0.180 0.000 0.820
#> GSM711932     1  0.4121      0.847 0.832 0.000 0.168
#> GSM711934     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711940     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711942     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711944     1  0.4178      0.846 0.828 0.000 0.172
#> GSM711946     3  0.0000      0.806 0.000 0.000 1.000
#> GSM711948     1  0.4178      0.846 0.828 0.000 0.172
#> GSM711952     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711954     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711962     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711970     3  0.4974      0.562 0.236 0.000 0.764
#> GSM711974     3  0.5988      0.225 0.368 0.000 0.632
#> GSM711978     1  0.0000      0.680 1.000 0.000 0.000
#> GSM711988     1  0.4121      0.847 0.832 0.000 0.168
#> GSM711990     3  0.0000      0.806 0.000 0.000 1.000
#> GSM711992     1  0.1163      0.651 0.972 0.028 0.000
#> GSM711982     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711984     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711912     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711918     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711920     1  0.4452      0.858 0.808 0.000 0.192
#> GSM711937     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711939     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711951     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711957     1  0.0000      0.680 1.000 0.000 0.000
#> GSM711959     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711961     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711965     3  0.0000      0.806 0.000 0.000 1.000
#> GSM711967     1  0.4121      0.847 0.832 0.000 0.168
#> GSM711969     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711973     1  0.4178      0.846 0.828 0.000 0.172
#> GSM711977     3  0.6225      0.202 0.432 0.000 0.568
#> GSM711981     1  0.0424      0.674 0.992 0.000 0.008
#> GSM711987     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711905     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711907     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711909     3  0.0000      0.806 0.000 0.000 1.000
#> GSM711911     3  0.0000      0.806 0.000 0.000 1.000
#> GSM711915     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711917     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711923     1  0.2711      0.737 0.912 0.000 0.088
#> GSM711925     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711927     3  0.0000      0.806 0.000 0.000 1.000
#> GSM711929     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711931     2  0.3551      0.857 0.132 0.868 0.000
#> GSM711933     1  0.5327      0.883 0.728 0.000 0.272
#> GSM711935     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711941     1  0.4178      0.846 0.828 0.000 0.172
#> GSM711943     3  0.5760      0.581 0.328 0.000 0.672
#> GSM711945     2  0.6783      0.437 0.016 0.588 0.396
#> GSM711947     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711949     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711955     1  0.5363      0.880 0.724 0.000 0.276
#> GSM711963     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711971     3  0.0000      0.806 0.000 0.000 1.000
#> GSM711975     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711979     1  0.0237      0.678 0.996 0.000 0.004
#> GSM711989     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711991     2  0.6095      0.463 0.000 0.608 0.392
#> GSM711993     1  0.0237      0.678 0.996 0.000 0.004
#> GSM711983     3  0.2448      0.755 0.076 0.000 0.924
#> GSM711985     2  0.0000      0.958 0.000 1.000 0.000
#> GSM711913     3  0.3038      0.722 0.104 0.000 0.896
#> GSM711919     3  0.0000      0.806 0.000 0.000 1.000
#> GSM711921     3  0.0000      0.806 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711950     4  0.4776      0.763 0.376 0.000 0.000 0.624
#> GSM711956     1  0.0469      0.886 0.988 0.000 0.000 0.012
#> GSM711958     1  0.2530      0.742 0.888 0.000 0.000 0.112
#> GSM711960     1  0.4406      0.619 0.700 0.000 0.300 0.000
#> GSM711964     1  0.0000      0.886 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0336      0.887 0.992 0.000 0.000 0.008
#> GSM711968     1  0.0000      0.886 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0469      0.886 0.988 0.000 0.000 0.012
#> GSM711976     4  0.4776      0.763 0.376 0.000 0.000 0.624
#> GSM711980     1  0.0469      0.886 0.988 0.000 0.000 0.012
#> GSM711986     1  0.0336      0.887 0.992 0.000 0.000 0.008
#> GSM711904     1  0.4103      0.681 0.744 0.000 0.256 0.000
#> GSM711906     1  0.0469      0.886 0.988 0.000 0.000 0.012
#> GSM711908     1  0.4103      0.681 0.744 0.000 0.256 0.000
#> GSM711910     3  0.0000      0.871 0.000 0.000 1.000 0.000
#> GSM711914     1  0.0469      0.886 0.988 0.000 0.000 0.012
#> GSM711916     1  0.4222      0.661 0.728 0.000 0.272 0.000
#> GSM711922     1  0.0469      0.886 0.988 0.000 0.000 0.012
#> GSM711924     4  0.4972      0.637 0.456 0.000 0.000 0.544
#> GSM711926     4  0.0336      0.641 0.000 0.008 0.000 0.992
#> GSM711928     1  0.0000      0.886 1.000 0.000 0.000 0.000
#> GSM711930     1  0.4250      0.655 0.724 0.000 0.276 0.000
#> GSM711932     4  0.4776      0.763 0.376 0.000 0.000 0.624
#> GSM711934     1  0.0469      0.886 0.988 0.000 0.000 0.012
#> GSM711940     1  0.0469      0.886 0.988 0.000 0.000 0.012
#> GSM711942     1  0.0469      0.886 0.988 0.000 0.000 0.012
#> GSM711944     4  0.4776      0.763 0.376 0.000 0.000 0.624
#> GSM711946     3  0.0000      0.871 0.000 0.000 1.000 0.000
#> GSM711948     4  0.4776      0.763 0.376 0.000 0.000 0.624
#> GSM711952     1  0.0592      0.877 0.984 0.000 0.016 0.000
#> GSM711954     1  0.0188      0.884 0.996 0.000 0.004 0.000
#> GSM711962     1  0.0469      0.886 0.988 0.000 0.000 0.012
#> GSM711970     1  0.4222      0.661 0.728 0.000 0.272 0.000
#> GSM711974     1  0.4134      0.676 0.740 0.000 0.260 0.000
#> GSM711978     4  0.0000      0.649 0.000 0.000 0.000 1.000
#> GSM711988     4  0.4776      0.763 0.376 0.000 0.000 0.624
#> GSM711990     3  0.0000      0.871 0.000 0.000 1.000 0.000
#> GSM711992     4  0.0188      0.645 0.000 0.004 0.000 0.996
#> GSM711982     1  0.0336      0.887 0.992 0.000 0.000 0.008
#> GSM711984     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000      0.886 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000      0.886 1.000 0.000 0.000 0.000
#> GSM711920     4  0.4967      0.645 0.452 0.000 0.000 0.548
#> GSM711937     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711951     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711957     4  0.0188      0.651 0.004 0.000 0.000 0.996
#> GSM711959     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711965     3  0.0000      0.871 0.000 0.000 1.000 0.000
#> GSM711967     4  0.4830      0.743 0.392 0.000 0.000 0.608
#> GSM711969     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711973     4  0.4761      0.764 0.372 0.000 0.000 0.628
#> GSM711977     4  0.6691      0.705 0.236 0.000 0.152 0.612
#> GSM711981     4  0.0000      0.649 0.000 0.000 0.000 1.000
#> GSM711987     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711905     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711907     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711909     3  0.0000      0.871 0.000 0.000 1.000 0.000
#> GSM711911     3  0.0000      0.871 0.000 0.000 1.000 0.000
#> GSM711915     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711917     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711923     4  0.3791      0.757 0.200 0.000 0.004 0.796
#> GSM711925     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000      0.871 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711931     2  0.4730      0.540 0.000 0.636 0.000 0.364
#> GSM711933     1  0.0469      0.886 0.988 0.000 0.000 0.012
#> GSM711935     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711941     4  0.4761      0.764 0.372 0.000 0.000 0.628
#> GSM711943     3  0.6475      0.490 0.172 0.000 0.644 0.184
#> GSM711945     3  0.5132      0.237 0.000 0.448 0.548 0.004
#> GSM711947     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711949     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711955     1  0.0937      0.879 0.976 0.000 0.012 0.012
#> GSM711963     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711971     3  0.0188      0.868 0.004 0.000 0.996 0.000
#> GSM711975     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711979     4  0.3400      0.749 0.180 0.000 0.000 0.820
#> GSM711989     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711991     3  0.4981      0.195 0.000 0.464 0.536 0.000
#> GSM711993     4  0.0000      0.649 0.000 0.000 0.000 1.000
#> GSM711983     3  0.3907      0.569 0.232 0.000 0.768 0.000
#> GSM711985     2  0.0000      0.985 0.000 1.000 0.000 0.000
#> GSM711913     3  0.0657      0.861 0.012 0.000 0.984 0.004
#> GSM711919     3  0.0000      0.871 0.000 0.000 1.000 0.000
#> GSM711921     3  0.0000      0.871 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711938     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711950     1  0.0963     0.9248 0.964 0.000 0.000 0.036 0.000
#> GSM711956     1  0.1043     0.9339 0.960 0.000 0.000 0.000 0.040
#> GSM711958     1  0.0290     0.9352 0.992 0.000 0.000 0.000 0.008
#> GSM711960     5  0.4465     0.5878 0.024 0.000 0.304 0.000 0.672
#> GSM711964     5  0.2516     0.8503 0.140 0.000 0.000 0.000 0.860
#> GSM711966     1  0.1608     0.9161 0.928 0.000 0.000 0.000 0.072
#> GSM711968     5  0.3143     0.8073 0.204 0.000 0.000 0.000 0.796
#> GSM711972     1  0.0703     0.9356 0.976 0.000 0.000 0.000 0.024
#> GSM711976     1  0.0880     0.9267 0.968 0.000 0.000 0.032 0.000
#> GSM711980     1  0.1121     0.9331 0.956 0.000 0.000 0.000 0.044
#> GSM711986     1  0.3366     0.7018 0.768 0.000 0.000 0.000 0.232
#> GSM711904     5  0.0992     0.8570 0.008 0.000 0.024 0.000 0.968
#> GSM711906     1  0.1608     0.9162 0.928 0.000 0.000 0.000 0.072
#> GSM711908     5  0.0955     0.8552 0.004 0.000 0.028 0.000 0.968
#> GSM711910     3  0.0162     0.9083 0.000 0.000 0.996 0.000 0.004
#> GSM711914     1  0.1121     0.9331 0.956 0.000 0.000 0.000 0.044
#> GSM711916     5  0.1041     0.8544 0.004 0.000 0.032 0.000 0.964
#> GSM711922     1  0.1121     0.9331 0.956 0.000 0.000 0.000 0.044
#> GSM711924     1  0.0162     0.9349 0.996 0.000 0.000 0.000 0.004
#> GSM711926     4  0.0290     0.9765 0.008 0.000 0.000 0.992 0.000
#> GSM711928     5  0.2891     0.8340 0.176 0.000 0.000 0.000 0.824
#> GSM711930     5  0.0955     0.8552 0.004 0.000 0.028 0.000 0.968
#> GSM711932     1  0.0963     0.9248 0.964 0.000 0.000 0.036 0.000
#> GSM711934     1  0.1121     0.9331 0.956 0.000 0.000 0.000 0.044
#> GSM711940     1  0.1544     0.9192 0.932 0.000 0.000 0.000 0.068
#> GSM711942     1  0.1121     0.9331 0.956 0.000 0.000 0.000 0.044
#> GSM711944     1  0.0880     0.9267 0.968 0.000 0.000 0.032 0.000
#> GSM711946     3  0.0290     0.9025 0.000 0.000 0.992 0.000 0.008
#> GSM711948     1  0.0880     0.9267 0.968 0.000 0.000 0.032 0.000
#> GSM711952     5  0.0963     0.8615 0.036 0.000 0.000 0.000 0.964
#> GSM711954     5  0.1043     0.8623 0.040 0.000 0.000 0.000 0.960
#> GSM711962     1  0.1121     0.9331 0.956 0.000 0.000 0.000 0.044
#> GSM711970     5  0.0955     0.8552 0.004 0.000 0.028 0.000 0.968
#> GSM711974     5  0.4555     0.7739 0.200 0.000 0.068 0.000 0.732
#> GSM711978     4  0.0290     0.9765 0.008 0.000 0.000 0.992 0.000
#> GSM711988     1  0.0880     0.9267 0.968 0.000 0.000 0.032 0.000
#> GSM711990     3  0.0162     0.9083 0.000 0.000 0.996 0.000 0.004
#> GSM711992     4  0.0693     0.9721 0.008 0.000 0.000 0.980 0.012
#> GSM711982     1  0.2127     0.8813 0.892 0.000 0.000 0.000 0.108
#> GSM711984     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711912     5  0.2773     0.8401 0.164 0.000 0.000 0.000 0.836
#> GSM711918     5  0.2966     0.8262 0.184 0.000 0.000 0.000 0.816
#> GSM711920     1  0.0162     0.9339 0.996 0.000 0.000 0.004 0.000
#> GSM711937     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711951     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711957     4  0.0963     0.9516 0.036 0.000 0.000 0.964 0.000
#> GSM711959     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711961     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711965     3  0.0162     0.9083 0.000 0.000 0.996 0.000 0.004
#> GSM711967     1  0.0162     0.9339 0.996 0.000 0.000 0.004 0.000
#> GSM711969     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711973     1  0.1197     0.9175 0.952 0.000 0.000 0.048 0.000
#> GSM711977     3  0.3255     0.7721 0.100 0.000 0.848 0.052 0.000
#> GSM711981     4  0.0290     0.9765 0.008 0.000 0.000 0.992 0.000
#> GSM711987     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711907     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711909     3  0.0162     0.9083 0.000 0.000 0.996 0.000 0.004
#> GSM711911     3  0.0162     0.9083 0.000 0.000 0.996 0.000 0.004
#> GSM711915     2  0.0898     0.9536 0.000 0.972 0.000 0.008 0.020
#> GSM711917     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711923     1  0.2583     0.8386 0.864 0.000 0.004 0.132 0.000
#> GSM711925     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0162     0.9083 0.000 0.000 0.996 0.000 0.004
#> GSM711929     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711931     4  0.1544     0.9015 0.000 0.068 0.000 0.932 0.000
#> GSM711933     1  0.1121     0.9331 0.956 0.000 0.000 0.000 0.044
#> GSM711935     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711941     1  0.1197     0.9175 0.952 0.000 0.000 0.048 0.000
#> GSM711943     3  0.5125     0.5955 0.184 0.000 0.708 0.100 0.008
#> GSM711945     3  0.5710     0.0875 0.000 0.448 0.492 0.028 0.032
#> GSM711947     2  0.0290     0.9702 0.000 0.992 0.000 0.008 0.000
#> GSM711949     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711955     1  0.0290     0.9352 0.992 0.000 0.000 0.000 0.008
#> GSM711963     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0162     0.9083 0.000 0.000 0.996 0.000 0.004
#> GSM711975     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711979     1  0.3774     0.5996 0.704 0.000 0.000 0.296 0.000
#> GSM711989     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711991     2  0.5286     0.0413 0.000 0.516 0.444 0.008 0.032
#> GSM711993     4  0.0290     0.9765 0.008 0.000 0.000 0.992 0.000
#> GSM711983     3  0.1544     0.8476 0.068 0.000 0.932 0.000 0.000
#> GSM711985     2  0.0000     0.9764 0.000 1.000 0.000 0.000 0.000
#> GSM711913     3  0.0162     0.9046 0.000 0.000 0.996 0.004 0.000
#> GSM711919     3  0.0162     0.9083 0.000 0.000 0.996 0.000 0.004
#> GSM711921     3  0.0162     0.9083 0.000 0.000 0.996 0.000 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
#> GSM711936     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711938     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711950     1  0.3318     0.7508 0.796 0.000 0.000 0.032 0.172 0.000
#> GSM711956     1  0.1444     0.7857 0.928 0.000 0.000 0.000 0.000 0.072
#> GSM711958     1  0.0865     0.7912 0.964 0.000 0.000 0.000 0.036 0.000
#> GSM711960     3  0.5614     0.3041 0.112 0.000 0.568 0.000 0.020 0.300
#> GSM711964     6  0.3690     0.6803 0.308 0.000 0.000 0.000 0.008 0.684
#> GSM711966     1  0.2118     0.7646 0.888 0.000 0.000 0.000 0.008 0.104
#> GSM711968     6  0.3907     0.5386 0.408 0.000 0.000 0.000 0.004 0.588
#> GSM711972     1  0.1075     0.7895 0.952 0.000 0.000 0.000 0.000 0.048
#> GSM711976     1  0.3168     0.7552 0.804 0.000 0.000 0.024 0.172 0.000
#> GSM711980     1  0.1858     0.7762 0.904 0.000 0.000 0.000 0.004 0.092
#> GSM711986     1  0.2442     0.7244 0.852 0.000 0.000 0.000 0.004 0.144
#> GSM711904     6  0.0000     0.7370 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711906     1  0.2053     0.7663 0.888 0.000 0.000 0.000 0.004 0.108
#> GSM711908     6  0.0260     0.7320 0.000 0.000 0.000 0.000 0.008 0.992
#> GSM711910     3  0.0260     0.8633 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM711914     1  0.1644     0.7844 0.920 0.000 0.000 0.000 0.004 0.076
#> GSM711916     6  0.0717     0.7376 0.008 0.000 0.000 0.000 0.016 0.976
#> GSM711922     1  0.1501     0.7844 0.924 0.000 0.000 0.000 0.000 0.076
#> GSM711924     1  0.2048     0.7801 0.880 0.000 0.000 0.000 0.120 0.000
#> GSM711926     4  0.0000     0.9394 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711928     6  0.3934     0.6010 0.376 0.000 0.000 0.000 0.008 0.616
#> GSM711930     6  0.0363     0.7345 0.000 0.000 0.000 0.000 0.012 0.988
#> GSM711932     1  0.3279     0.7520 0.796 0.000 0.000 0.028 0.176 0.000
#> GSM711934     1  0.1858     0.7762 0.904 0.000 0.000 0.000 0.004 0.092
#> GSM711940     1  0.2405     0.7630 0.880 0.000 0.004 0.000 0.016 0.100
#> GSM711942     1  0.1714     0.7777 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM711944     1  0.3088     0.7569 0.808 0.000 0.000 0.020 0.172 0.000
#> GSM711946     3  0.2003     0.7993 0.000 0.000 0.884 0.000 0.116 0.000
#> GSM711948     1  0.3245     0.7531 0.800 0.000 0.000 0.028 0.172 0.000
#> GSM711952     6  0.0000     0.7370 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711954     6  0.1918     0.7367 0.088 0.000 0.000 0.000 0.008 0.904
#> GSM711962     1  0.1714     0.7780 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM711970     6  0.0000     0.7370 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711974     1  0.5294    -0.2055 0.508 0.000 0.056 0.000 0.020 0.416
#> GSM711978     4  0.0260     0.9397 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM711988     1  0.3245     0.7531 0.800 0.000 0.000 0.028 0.172 0.000
#> GSM711990     3  0.0458     0.8608 0.000 0.000 0.984 0.000 0.016 0.000
#> GSM711992     4  0.1444     0.9064 0.000 0.000 0.000 0.928 0.072 0.000
#> GSM711982     1  0.2302     0.7487 0.872 0.000 0.000 0.000 0.008 0.120
#> GSM711984     2  0.0146     0.9721 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711912     6  0.3684     0.6556 0.332 0.000 0.000 0.000 0.004 0.664
#> GSM711918     6  0.3881     0.5622 0.396 0.000 0.000 0.000 0.004 0.600
#> GSM711920     1  0.2135     0.7787 0.872 0.000 0.000 0.000 0.128 0.000
#> GSM711937     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711951     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711957     4  0.2579     0.8293 0.040 0.000 0.000 0.872 0.088 0.000
#> GSM711959     2  0.0146     0.9721 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711961     2  0.0146     0.9721 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711965     3  0.0260     0.8623 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM711967     1  0.2048     0.7808 0.880 0.000 0.000 0.000 0.120 0.000
#> GSM711969     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711973     1  0.4117     0.6934 0.716 0.000 0.000 0.056 0.228 0.000
#> GSM711977     3  0.5762     0.4602 0.104 0.000 0.608 0.052 0.236 0.000
#> GSM711981     4  0.0146     0.9402 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM711987     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     2  0.0146     0.9721 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711907     2  0.0865     0.9345 0.000 0.964 0.000 0.000 0.036 0.000
#> GSM711909     3  0.0260     0.8633 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM711911     3  0.0146     0.8635 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM711915     5  0.3915     0.4460 0.000 0.412 0.004 0.000 0.584 0.000
#> GSM711917     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711923     1  0.5373     0.5614 0.596 0.000 0.004 0.152 0.248 0.000
#> GSM711925     2  0.0146     0.9721 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711927     3  0.0260     0.8633 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM711929     2  0.0146     0.9721 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711931     4  0.1444     0.8505 0.000 0.072 0.000 0.928 0.000 0.000
#> GSM711933     1  0.1858     0.7762 0.904 0.000 0.000 0.000 0.004 0.092
#> GSM711935     2  0.0146     0.9721 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711941     1  0.3646     0.7371 0.776 0.000 0.000 0.052 0.172 0.000
#> GSM711943     3  0.6210     0.4669 0.108 0.000 0.596 0.132 0.164 0.000
#> GSM711945     5  0.4523     0.6343 0.000 0.084 0.112 0.048 0.756 0.000
#> GSM711947     2  0.3717     0.0541 0.000 0.616 0.000 0.000 0.384 0.000
#> GSM711949     2  0.0146     0.9721 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM711953     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     1  0.1382     0.7914 0.948 0.000 0.008 0.000 0.036 0.008
#> GSM711963     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711971     3  0.0363     0.8615 0.000 0.000 0.988 0.000 0.012 0.000
#> GSM711975     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711979     1  0.5645     0.3340 0.508 0.000 0.000 0.320 0.172 0.000
#> GSM711989     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711991     5  0.4308     0.7080 0.000 0.152 0.120 0.000 0.728 0.000
#> GSM711993     4  0.0260     0.9401 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM711983     3  0.2134     0.8028 0.052 0.000 0.904 0.000 0.044 0.000
#> GSM711985     2  0.0000     0.9732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711913     3  0.2333     0.7932 0.004 0.000 0.872 0.004 0.120 0.000
#> GSM711919     3  0.0146     0.8632 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM711921     3  0.0260     0.8633 0.000 0.000 0.992 0.000 0.008 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-skmeans-collect-classes

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

test_to_known_factors(res)
#>              n tissue(p) disease.state(p) individual(p) k
#> ATC:skmeans 89  1.99e-05            0.227         0.726 2
#> ATC:skmeans 83  5.53e-06            0.131         0.319 3
#> ATC:skmeans 87  1.01e-08            0.127         0.585 4
#> ATC:skmeans 88  4.44e-08            0.239         0.369 5
#> ATC:skmeans 83  4.02e-07            0.147         0.333 6

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


ATC:pam**

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

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

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

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

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

collect_plots(res)

plot of chunk ATC-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           1.000       1.000         0.4063 0.594   0.594
#> 3 3 0.848           0.858       0.943         0.4147 0.787   0.649
#> 4 4 0.969           0.936       0.975         0.0928 0.944   0.867
#> 5 5 0.650           0.772       0.857         0.1401 0.898   0.734
#> 6 6 0.762           0.784       0.829         0.1124 0.821   0.448

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM711936     2  0.0000      1.000 0.000 1.000
#> GSM711938     2  0.0000      1.000 0.000 1.000
#> GSM711950     1  0.0000      1.000 1.000 0.000
#> GSM711956     1  0.0000      1.000 1.000 0.000
#> GSM711958     1  0.0000      1.000 1.000 0.000
#> GSM711960     1  0.0000      1.000 1.000 0.000
#> GSM711964     1  0.0000      1.000 1.000 0.000
#> GSM711966     1  0.0000      1.000 1.000 0.000
#> GSM711968     1  0.0000      1.000 1.000 0.000
#> GSM711972     1  0.0000      1.000 1.000 0.000
#> GSM711976     1  0.0000      1.000 1.000 0.000
#> GSM711980     1  0.0000      1.000 1.000 0.000
#> GSM711986     1  0.0000      1.000 1.000 0.000
#> GSM711904     1  0.0000      1.000 1.000 0.000
#> GSM711906     1  0.0000      1.000 1.000 0.000
#> GSM711908     1  0.0000      1.000 1.000 0.000
#> GSM711910     1  0.0000      1.000 1.000 0.000
#> GSM711914     1  0.0000      1.000 1.000 0.000
#> GSM711916     1  0.0000      1.000 1.000 0.000
#> GSM711922     1  0.0000      1.000 1.000 0.000
#> GSM711924     1  0.0000      1.000 1.000 0.000
#> GSM711926     1  0.0000      1.000 1.000 0.000
#> GSM711928     1  0.0000      1.000 1.000 0.000
#> GSM711930     1  0.0000      1.000 1.000 0.000
#> GSM711932     1  0.0000      1.000 1.000 0.000
#> GSM711934     1  0.0000      1.000 1.000 0.000
#> GSM711940     1  0.0000      1.000 1.000 0.000
#> GSM711942     1  0.0000      1.000 1.000 0.000
#> GSM711944     1  0.0000      1.000 1.000 0.000
#> GSM711946     1  0.0000      1.000 1.000 0.000
#> GSM711948     1  0.0000      1.000 1.000 0.000
#> GSM711952     1  0.0000      1.000 1.000 0.000
#> GSM711954     1  0.0000      1.000 1.000 0.000
#> GSM711962     1  0.0000      1.000 1.000 0.000
#> GSM711970     1  0.0000      1.000 1.000 0.000
#> GSM711974     1  0.0000      1.000 1.000 0.000
#> GSM711978     1  0.0000      1.000 1.000 0.000
#> GSM711988     1  0.0000      1.000 1.000 0.000
#> GSM711990     1  0.0000      1.000 1.000 0.000
#> GSM711992     1  0.0000      1.000 1.000 0.000
#> GSM711982     1  0.0000      1.000 1.000 0.000
#> GSM711984     2  0.0000      1.000 0.000 1.000
#> GSM711912     1  0.0000      1.000 1.000 0.000
#> GSM711918     1  0.0000      1.000 1.000 0.000
#> GSM711920     1  0.0000      1.000 1.000 0.000
#> GSM711937     2  0.0000      1.000 0.000 1.000
#> GSM711939     2  0.0000      1.000 0.000 1.000
#> GSM711951     2  0.0000      1.000 0.000 1.000
#> GSM711957     1  0.0000      1.000 1.000 0.000
#> GSM711959     2  0.0000      1.000 0.000 1.000
#> GSM711961     2  0.0000      1.000 0.000 1.000
#> GSM711965     1  0.0000      1.000 1.000 0.000
#> GSM711967     1  0.0000      1.000 1.000 0.000
#> GSM711969     2  0.0000      1.000 0.000 1.000
#> GSM711973     1  0.0000      1.000 1.000 0.000
#> GSM711977     1  0.0000      1.000 1.000 0.000
#> GSM711981     1  0.0000      1.000 1.000 0.000
#> GSM711987     2  0.0000      1.000 0.000 1.000
#> GSM711905     2  0.0000      1.000 0.000 1.000
#> GSM711907     2  0.0000      1.000 0.000 1.000
#> GSM711909     1  0.0000      1.000 1.000 0.000
#> GSM711911     1  0.0000      1.000 1.000 0.000
#> GSM711915     2  0.0376      0.996 0.004 0.996
#> GSM711917     2  0.0000      1.000 0.000 1.000
#> GSM711923     1  0.0000      1.000 1.000 0.000
#> GSM711925     2  0.0000      1.000 0.000 1.000
#> GSM711927     1  0.0000      1.000 1.000 0.000
#> GSM711929     2  0.0000      1.000 0.000 1.000
#> GSM711931     2  0.0000      1.000 0.000 1.000
#> GSM711933     1  0.0000      1.000 1.000 0.000
#> GSM711935     2  0.0000      1.000 0.000 1.000
#> GSM711941     1  0.0000      1.000 1.000 0.000
#> GSM711943     1  0.0000      1.000 1.000 0.000
#> GSM711945     1  0.0000      1.000 1.000 0.000
#> GSM711947     2  0.0000      1.000 0.000 1.000
#> GSM711949     2  0.0000      1.000 0.000 1.000
#> GSM711953     2  0.0000      1.000 0.000 1.000
#> GSM711955     1  0.0000      1.000 1.000 0.000
#> GSM711963     2  0.0000      1.000 0.000 1.000
#> GSM711971     1  0.0000      1.000 1.000 0.000
#> GSM711975     2  0.0000      1.000 0.000 1.000
#> GSM711979     1  0.0000      1.000 1.000 0.000
#> GSM711989     2  0.0000      1.000 0.000 1.000
#> GSM711991     1  0.0000      1.000 1.000 0.000
#> GSM711993     1  0.0000      1.000 1.000 0.000
#> GSM711983     1  0.0000      1.000 1.000 0.000
#> GSM711985     2  0.0000      1.000 0.000 1.000
#> GSM711913     1  0.0000      1.000 1.000 0.000
#> GSM711919     1  0.0000      1.000 1.000 0.000
#> GSM711921     1  0.0000      1.000 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
#> GSM711936     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711938     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711950     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711956     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711958     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711960     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711964     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711966     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711968     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711972     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711976     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711980     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711986     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711904     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711906     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711908     1  0.6180     0.0854 0.584 0.000 0.416
#> GSM711910     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711914     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711916     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711922     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711924     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711926     3  0.0000     0.7228 0.000 0.000 1.000
#> GSM711928     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711930     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711932     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711934     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711940     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711942     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711944     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711946     1  0.5291     0.5391 0.732 0.000 0.268
#> GSM711948     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711952     3  0.6180     0.4398 0.416 0.000 0.584
#> GSM711954     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711962     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711970     3  0.6180     0.4398 0.416 0.000 0.584
#> GSM711974     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711978     3  0.0000     0.7228 0.000 0.000 1.000
#> GSM711988     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711990     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711992     3  0.0000     0.7228 0.000 0.000 1.000
#> GSM711982     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711984     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711912     1  0.1964     0.9176 0.944 0.000 0.056
#> GSM711918     1  0.0424     0.9730 0.992 0.000 0.008
#> GSM711920     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711937     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711939     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711951     3  0.0000     0.7228 0.000 0.000 1.000
#> GSM711957     3  0.4002     0.6822 0.160 0.000 0.840
#> GSM711959     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711961     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711965     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711967     1  0.1289     0.9465 0.968 0.000 0.032
#> GSM711969     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711973     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711977     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711981     3  0.0000     0.7228 0.000 0.000 1.000
#> GSM711987     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711905     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711907     2  0.6180     0.4332 0.000 0.584 0.416
#> GSM711909     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711911     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711915     3  0.5291     0.3724 0.000 0.268 0.732
#> GSM711917     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711923     3  0.6180     0.4398 0.416 0.000 0.584
#> GSM711925     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711927     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711929     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711931     3  0.0000     0.7228 0.000 0.000 1.000
#> GSM711933     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711935     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711941     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711943     3  0.6180     0.4398 0.416 0.000 0.584
#> GSM711945     3  0.0000     0.7228 0.000 0.000 1.000
#> GSM711947     2  0.6180     0.4332 0.000 0.584 0.416
#> GSM711949     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711953     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711955     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711963     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711971     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711975     3  0.6045     0.0861 0.000 0.380 0.620
#> GSM711979     3  0.6180     0.4398 0.416 0.000 0.584
#> GSM711989     2  0.6180     0.4332 0.000 0.584 0.416
#> GSM711991     3  0.0000     0.7228 0.000 0.000 1.000
#> GSM711993     3  0.0000     0.7228 0.000 0.000 1.000
#> GSM711983     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711985     2  0.0000     0.9351 0.000 1.000 0.000
#> GSM711913     3  0.5098     0.6390 0.248 0.000 0.752
#> GSM711919     1  0.0000     0.9812 1.000 0.000 0.000
#> GSM711921     1  0.0000     0.9812 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
#> GSM711936     2  0.0000      0.963 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0000      0.963 0.000 1.000 0.000 0.000
#> GSM711950     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711956     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711958     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711960     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711964     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711966     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711968     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711976     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711980     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711906     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711908     4  0.3726      0.641 0.212 0.000 0.000 0.788
#> GSM711910     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711914     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711922     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711924     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711926     4  0.0000      0.929 0.000 0.000 0.000 1.000
#> GSM711928     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711932     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711934     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711940     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711942     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711944     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711946     1  0.4304      0.582 0.716 0.000 0.000 0.284
#> GSM711948     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711952     4  0.0817      0.920 0.024 0.000 0.000 0.976
#> GSM711954     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711962     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711970     4  0.0817      0.920 0.024 0.000 0.000 0.976
#> GSM711974     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711978     4  0.0000      0.929 0.000 0.000 0.000 1.000
#> GSM711988     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711990     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711992     4  0.0000      0.929 0.000 0.000 0.000 1.000
#> GSM711982     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711984     3  0.0000      0.996 0.000 0.000 1.000 0.000
#> GSM711912     1  0.4713      0.423 0.640 0.000 0.000 0.360
#> GSM711918     1  0.3074      0.807 0.848 0.000 0.000 0.152
#> GSM711920     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711937     2  0.0000      0.963 0.000 1.000 0.000 0.000
#> GSM711939     2  0.0000      0.963 0.000 1.000 0.000 0.000
#> GSM711951     4  0.0000      0.929 0.000 0.000 0.000 1.000
#> GSM711957     4  0.0188      0.928 0.004 0.000 0.000 0.996
#> GSM711959     2  0.2814      0.849 0.000 0.868 0.132 0.000
#> GSM711961     2  0.1302      0.935 0.000 0.956 0.044 0.000
#> GSM711965     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711967     1  0.4193      0.623 0.732 0.000 0.000 0.268
#> GSM711969     2  0.0000      0.963 0.000 1.000 0.000 0.000
#> GSM711973     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711977     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711981     4  0.0000      0.929 0.000 0.000 0.000 1.000
#> GSM711987     2  0.0000      0.963 0.000 1.000 0.000 0.000
#> GSM711905     3  0.0000      0.996 0.000 0.000 1.000 0.000
#> GSM711907     2  0.0817      0.954 0.000 0.976 0.000 0.024
#> GSM711909     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711911     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711915     2  0.3837      0.720 0.000 0.776 0.000 0.224
#> GSM711917     2  0.0000      0.963 0.000 1.000 0.000 0.000
#> GSM711923     4  0.0817      0.920 0.024 0.000 0.000 0.976
#> GSM711925     3  0.0000      0.996 0.000 0.000 1.000 0.000
#> GSM711927     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711929     3  0.0817      0.978 0.000 0.024 0.976 0.000
#> GSM711931     4  0.0000      0.929 0.000 0.000 0.000 1.000
#> GSM711933     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711935     3  0.0000      0.996 0.000 0.000 1.000 0.000
#> GSM711941     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711943     4  0.0817      0.920 0.024 0.000 0.000 0.976
#> GSM711945     4  0.0000      0.929 0.000 0.000 0.000 1.000
#> GSM711947     2  0.0817      0.954 0.000 0.976 0.000 0.024
#> GSM711949     3  0.0000      0.996 0.000 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.963 0.000 1.000 0.000 0.000
#> GSM711955     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711963     3  0.0000      0.996 0.000 0.000 1.000 0.000
#> GSM711971     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711975     2  0.1211      0.943 0.000 0.960 0.000 0.040
#> GSM711979     4  0.0817      0.920 0.024 0.000 0.000 0.976
#> GSM711989     2  0.0817      0.954 0.000 0.976 0.000 0.024
#> GSM711991     4  0.0000      0.929 0.000 0.000 0.000 1.000
#> GSM711993     4  0.0000      0.929 0.000 0.000 0.000 1.000
#> GSM711983     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711985     2  0.0000      0.963 0.000 1.000 0.000 0.000
#> GSM711913     4  0.4643      0.423 0.344 0.000 0.000 0.656
#> GSM711919     1  0.0000      0.976 1.000 0.000 0.000 0.000
#> GSM711921     1  0.0000      0.976 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
#> GSM711936     2  0.2377     0.8670 0.000 0.872 0.128 0.000 0.000
#> GSM711938     2  0.0000     0.8794 0.000 1.000 0.000 0.000 0.000
#> GSM711950     1  0.2674     0.8230 0.856 0.000 0.004 0.140 0.000
#> GSM711956     1  0.2471     0.8255 0.864 0.000 0.000 0.136 0.000
#> GSM711958     1  0.0404     0.8375 0.988 0.000 0.012 0.000 0.000
#> GSM711960     1  0.0000     0.8355 1.000 0.000 0.000 0.000 0.000
#> GSM711964     1  0.1851     0.8148 0.912 0.000 0.088 0.000 0.000
#> GSM711966     1  0.1851     0.8148 0.912 0.000 0.088 0.000 0.000
#> GSM711968     1  0.1608     0.8220 0.928 0.000 0.072 0.000 0.000
#> GSM711972     1  0.4334     0.7927 0.768 0.000 0.092 0.140 0.000
#> GSM711976     1  0.2674     0.8230 0.856 0.000 0.004 0.140 0.000
#> GSM711980     1  0.0000     0.8355 1.000 0.000 0.000 0.000 0.000
#> GSM711986     1  0.4334     0.7927 0.768 0.000 0.092 0.140 0.000
#> GSM711904     1  0.1608     0.8220 0.928 0.000 0.072 0.000 0.000
#> GSM711906     1  0.1121     0.8331 0.956 0.000 0.044 0.000 0.000
#> GSM711908     4  0.6323     0.2898 0.220 0.000 0.252 0.528 0.000
#> GSM711910     3  0.4060     0.7996 0.360 0.000 0.640 0.000 0.000
#> GSM711914     1  0.4104     0.8043 0.788 0.000 0.088 0.124 0.000
#> GSM711916     1  0.1851     0.8148 0.912 0.000 0.088 0.000 0.000
#> GSM711922     1  0.2909     0.8219 0.848 0.000 0.012 0.140 0.000
#> GSM711924     1  0.2674     0.8230 0.856 0.000 0.004 0.140 0.000
#> GSM711926     4  0.2516     0.7936 0.000 0.000 0.140 0.860 0.000
#> GSM711928     1  0.1608     0.8220 0.928 0.000 0.072 0.000 0.000
#> GSM711930     3  0.3895     0.7077 0.320 0.000 0.680 0.000 0.000
#> GSM711932     1  0.2674     0.8230 0.856 0.000 0.004 0.140 0.000
#> GSM711934     1  0.0162     0.8361 0.996 0.000 0.004 0.000 0.000
#> GSM711940     1  0.0000     0.8355 1.000 0.000 0.000 0.000 0.000
#> GSM711942     1  0.0000     0.8355 1.000 0.000 0.000 0.000 0.000
#> GSM711944     1  0.2674     0.8230 0.856 0.000 0.004 0.140 0.000
#> GSM711946     1  0.4249     0.0269 0.568 0.000 0.000 0.432 0.000
#> GSM711948     1  0.2674     0.8230 0.856 0.000 0.004 0.140 0.000
#> GSM711952     4  0.4054     0.6831 0.140 0.000 0.072 0.788 0.000
#> GSM711954     1  0.1608     0.8220 0.928 0.000 0.072 0.000 0.000
#> GSM711962     1  0.0510     0.8362 0.984 0.000 0.016 0.000 0.000
#> GSM711970     4  0.6220     0.0476 0.140 0.000 0.428 0.432 0.000
#> GSM711974     1  0.0000     0.8355 1.000 0.000 0.000 0.000 0.000
#> GSM711978     4  0.2516     0.7936 0.000 0.000 0.140 0.860 0.000
#> GSM711988     1  0.2674     0.8230 0.856 0.000 0.004 0.140 0.000
#> GSM711990     3  0.4192     0.7588 0.404 0.000 0.596 0.000 0.000
#> GSM711992     4  0.2516     0.7936 0.000 0.000 0.140 0.860 0.000
#> GSM711982     1  0.1851     0.8148 0.912 0.000 0.088 0.000 0.000
#> GSM711984     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000
#> GSM711912     1  0.3416     0.7530 0.840 0.000 0.088 0.072 0.000
#> GSM711918     1  0.3962     0.8099 0.800 0.000 0.088 0.112 0.000
#> GSM711920     1  0.2674     0.8230 0.856 0.000 0.004 0.140 0.000
#> GSM711937     2  0.0000     0.8794 0.000 1.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.8794 0.000 1.000 0.000 0.000 0.000
#> GSM711951     4  0.3612     0.7066 0.000 0.000 0.268 0.732 0.000
#> GSM711957     4  0.0000     0.7672 0.000 0.000 0.000 1.000 0.000
#> GSM711959     2  0.2852     0.7573 0.000 0.828 0.000 0.000 0.172
#> GSM711961     2  0.0794     0.8643 0.000 0.972 0.000 0.000 0.028
#> GSM711965     1  0.3039     0.5638 0.808 0.000 0.192 0.000 0.000
#> GSM711967     1  0.3724     0.7783 0.776 0.000 0.020 0.204 0.000
#> GSM711969     2  0.2377     0.8670 0.000 0.872 0.128 0.000 0.000
#> GSM711973     1  0.2674     0.8230 0.856 0.000 0.004 0.140 0.000
#> GSM711977     1  0.3928     0.6544 0.700 0.000 0.004 0.296 0.000
#> GSM711981     4  0.0000     0.7672 0.000 0.000 0.000 1.000 0.000
#> GSM711987     2  0.0000     0.8794 0.000 1.000 0.000 0.000 0.000
#> GSM711905     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000
#> GSM711907     2  0.4268     0.7929 0.000 0.708 0.268 0.024 0.000
#> GSM711909     3  0.4060     0.7996 0.360 0.000 0.640 0.000 0.000
#> GSM711911     3  0.4227     0.7316 0.420 0.000 0.580 0.000 0.000
#> GSM711915     3  0.2260     0.3706 0.000 0.064 0.908 0.028 0.000
#> GSM711917     2  0.2377     0.8670 0.000 0.872 0.128 0.000 0.000
#> GSM711923     4  0.2773     0.7133 0.164 0.000 0.000 0.836 0.000
#> GSM711925     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000
#> GSM711927     3  0.4060     0.7996 0.360 0.000 0.640 0.000 0.000
#> GSM711929     5  0.2732     0.8185 0.000 0.160 0.000 0.000 0.840
#> GSM711931     4  0.2516     0.7936 0.000 0.000 0.140 0.860 0.000
#> GSM711933     1  0.0000     0.8355 1.000 0.000 0.000 0.000 0.000
#> GSM711935     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000
#> GSM711941     1  0.2674     0.8230 0.856 0.000 0.004 0.140 0.000
#> GSM711943     4  0.2773     0.7133 0.164 0.000 0.000 0.836 0.000
#> GSM711945     4  0.2516     0.7936 0.000 0.000 0.140 0.860 0.000
#> GSM711947     2  0.4268     0.7929 0.000 0.708 0.268 0.024 0.000
#> GSM711949     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000
#> GSM711953     2  0.0000     0.8794 0.000 1.000 0.000 0.000 0.000
#> GSM711955     1  0.0000     0.8355 1.000 0.000 0.000 0.000 0.000
#> GSM711963     5  0.0000     0.9735 0.000 0.000 0.000 0.000 1.000
#> GSM711971     1  0.2690     0.6418 0.844 0.000 0.156 0.000 0.000
#> GSM711975     2  0.4350     0.7897 0.000 0.704 0.268 0.028 0.000
#> GSM711979     4  0.0865     0.7482 0.024 0.000 0.004 0.972 0.000
#> GSM711989     2  0.4268     0.7929 0.000 0.708 0.268 0.024 0.000
#> GSM711991     3  0.4114    -0.0741 0.000 0.000 0.624 0.376 0.000
#> GSM711993     4  0.0000     0.7672 0.000 0.000 0.000 1.000 0.000
#> GSM711983     1  0.0000     0.8355 1.000 0.000 0.000 0.000 0.000
#> GSM711985     2  0.0000     0.8794 0.000 1.000 0.000 0.000 0.000
#> GSM711913     3  0.4973     0.4216 0.048 0.000 0.632 0.320 0.000
#> GSM711919     3  0.4060     0.7996 0.360 0.000 0.640 0.000 0.000
#> GSM711921     3  0.4060     0.7996 0.360 0.000 0.640 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
#> GSM711936     2  0.3364     0.7655 0.000 0.780 0.024 0.000 0.196 0.000
#> GSM711938     2  0.0000     0.7933 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711950     5  0.2823     0.9174 0.204 0.000 0.000 0.000 0.796 0.000
#> GSM711956     5  0.3390     0.8510 0.296 0.000 0.000 0.000 0.704 0.000
#> GSM711958     5  0.2996     0.9083 0.228 0.000 0.000 0.000 0.772 0.000
#> GSM711960     1  0.0632     0.8835 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM711964     1  0.0000     0.8898 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711966     1  0.0146     0.8895 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM711968     1  0.0260     0.8890 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM711972     5  0.2854     0.9135 0.208 0.000 0.000 0.000 0.792 0.000
#> GSM711976     5  0.2762     0.9172 0.196 0.000 0.000 0.000 0.804 0.000
#> GSM711980     5  0.3672     0.7501 0.368 0.000 0.000 0.000 0.632 0.000
#> GSM711986     1  0.1444     0.8433 0.928 0.000 0.000 0.000 0.072 0.000
#> GSM711904     1  0.0000     0.8898 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711906     1  0.0790     0.8844 0.968 0.000 0.000 0.000 0.032 0.000
#> GSM711908     1  0.4209     0.6253 0.736 0.000 0.160 0.104 0.000 0.000
#> GSM711910     3  0.0632     0.8623 0.000 0.000 0.976 0.000 0.024 0.000
#> GSM711914     1  0.0937     0.8762 0.960 0.000 0.000 0.000 0.040 0.000
#> GSM711916     1  0.0000     0.8898 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711922     5  0.2854     0.9158 0.208 0.000 0.000 0.000 0.792 0.000
#> GSM711924     5  0.2793     0.9173 0.200 0.000 0.000 0.000 0.800 0.000
#> GSM711926     4  0.0000     0.7738 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711928     1  0.0260     0.8890 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM711930     1  0.3390     0.5343 0.704 0.000 0.296 0.000 0.000 0.000
#> GSM711932     5  0.2762     0.9172 0.196 0.000 0.000 0.000 0.804 0.000
#> GSM711934     1  0.3747     0.0397 0.604 0.000 0.000 0.000 0.396 0.000
#> GSM711940     1  0.0713     0.8813 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM711942     1  0.0937     0.8798 0.960 0.000 0.000 0.000 0.040 0.000
#> GSM711944     5  0.2854     0.9172 0.208 0.000 0.000 0.000 0.792 0.000
#> GSM711946     4  0.5460     0.4528 0.072 0.000 0.256 0.624 0.048 0.000
#> GSM711948     5  0.2762     0.9172 0.196 0.000 0.000 0.000 0.804 0.000
#> GSM711952     1  0.3595     0.5223 0.704 0.000 0.000 0.288 0.008 0.000
#> GSM711954     1  0.0000     0.8898 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711962     1  0.1814     0.8045 0.900 0.000 0.000 0.000 0.100 0.000
#> GSM711970     1  0.3547     0.5250 0.696 0.000 0.300 0.004 0.000 0.000
#> GSM711974     1  0.0632     0.8835 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM711978     4  0.0000     0.7738 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711988     5  0.2823     0.9174 0.204 0.000 0.000 0.000 0.796 0.000
#> GSM711990     3  0.1890     0.8389 0.060 0.000 0.916 0.000 0.024 0.000
#> GSM711992     4  0.0000     0.7738 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711982     1  0.0260     0.8902 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM711984     6  0.0000     0.9535 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711912     1  0.0260     0.8890 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM711918     1  0.0260     0.8890 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM711920     5  0.2793     0.9157 0.200 0.000 0.000 0.000 0.800 0.000
#> GSM711937     2  0.0146     0.7934 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.7933 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711951     4  0.3284     0.5596 0.000 0.000 0.020 0.784 0.196 0.000
#> GSM711957     4  0.3351     0.6561 0.000 0.000 0.000 0.712 0.288 0.000
#> GSM711959     2  0.2854     0.6341 0.000 0.792 0.000 0.000 0.000 0.208
#> GSM711961     2  0.0547     0.7809 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM711965     3  0.3743     0.6372 0.252 0.000 0.724 0.000 0.024 0.000
#> GSM711967     5  0.2762     0.9172 0.196 0.000 0.000 0.000 0.804 0.000
#> GSM711969     2  0.3364     0.7655 0.000 0.780 0.024 0.000 0.196 0.000
#> GSM711973     5  0.2823     0.9174 0.204 0.000 0.000 0.000 0.796 0.000
#> GSM711977     5  0.3287     0.9033 0.220 0.000 0.000 0.012 0.768 0.000
#> GSM711981     4  0.3659     0.5282 0.000 0.000 0.000 0.636 0.364 0.000
#> GSM711987     2  0.0000     0.7933 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711905     6  0.0000     0.9535 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711907     2  0.6193     0.6071 0.000 0.504 0.024 0.276 0.196 0.000
#> GSM711909     3  0.0632     0.8623 0.000 0.000 0.976 0.000 0.024 0.000
#> GSM711911     3  0.1890     0.8321 0.060 0.000 0.916 0.000 0.024 0.000
#> GSM711915     3  0.0000     0.8372 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM711917     2  0.3364     0.7655 0.000 0.780 0.024 0.000 0.196 0.000
#> GSM711923     4  0.3351     0.6561 0.000 0.000 0.000 0.712 0.288 0.000
#> GSM711925     6  0.0000     0.9535 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711927     3  0.0632     0.8623 0.000 0.000 0.976 0.000 0.024 0.000
#> GSM711929     6  0.3221     0.6442 0.000 0.264 0.000 0.000 0.000 0.736
#> GSM711931     4  0.0000     0.7738 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711933     1  0.0632     0.8835 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM711935     6  0.0000     0.9535 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711941     5  0.2823     0.9174 0.204 0.000 0.000 0.000 0.796 0.000
#> GSM711943     4  0.0000     0.7738 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711945     4  0.0000     0.7738 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM711947     2  0.6231     0.5956 0.000 0.492 0.024 0.288 0.196 0.000
#> GSM711949     6  0.0000     0.9535 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711953     2  0.0000     0.7933 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711955     5  0.3371     0.8543 0.292 0.000 0.000 0.000 0.708 0.000
#> GSM711963     6  0.0000     0.9535 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM711971     3  0.3897     0.5963 0.280 0.000 0.696 0.000 0.024 0.000
#> GSM711975     2  0.6254     0.5847 0.000 0.484 0.024 0.296 0.196 0.000
#> GSM711979     5  0.2996     0.5230 0.000 0.000 0.000 0.228 0.772 0.000
#> GSM711989     2  0.6231     0.5956 0.000 0.492 0.024 0.288 0.196 0.000
#> GSM711991     3  0.3151     0.5964 0.000 0.000 0.748 0.252 0.000 0.000
#> GSM711993     4  0.3351     0.6561 0.000 0.000 0.000 0.712 0.288 0.000
#> GSM711983     5  0.3371     0.8543 0.292 0.000 0.000 0.000 0.708 0.000
#> GSM711985     2  0.0000     0.7933 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711913     5  0.4471     0.0392 0.000 0.000 0.472 0.028 0.500 0.000
#> GSM711919     3  0.0632     0.8623 0.000 0.000 0.976 0.000 0.024 0.000
#> GSM711921     3  0.0632     0.8623 0.000 0.000 0.976 0.000 0.024 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-pam-collect-classes

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

test_to_known_factors(res)
#>          n tissue(p) disease.state(p) individual(p) k
#> ATC:pam 90  2.27e-05           0.2329         0.530 2
#> ATC:pam 79  5.23e-05           0.5878         0.417 3
#> ATC:pam 88  4.96e-05           0.0964         0.465 4
#> ATC:pam 84  2.02e-05           0.0221         0.175 5
#> ATC:pam 87  2.04e-07           0.0785         0.324 6

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


ATC:mclust**

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

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

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

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

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

collect_plots(res)

plot of chunk ATC-mclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.989       0.995         0.4289 0.575   0.575
#> 3 3 0.774           0.893       0.947         0.4474 0.766   0.610
#> 4 4 0.855           0.857       0.930         0.1590 0.853   0.630
#> 5 5 0.753           0.767       0.862         0.0498 0.912   0.707
#> 6 6 0.806           0.695       0.856         0.0530 0.897   0.631

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
#> GSM711936     2  0.0000      1.000 0.000 1.000
#> GSM711938     2  0.0000      1.000 0.000 1.000
#> GSM711950     1  0.0000      0.993 1.000 0.000
#> GSM711956     1  0.0000      0.993 1.000 0.000
#> GSM711958     1  0.0000      0.993 1.000 0.000
#> GSM711960     1  0.0000      0.993 1.000 0.000
#> GSM711964     1  0.0000      0.993 1.000 0.000
#> GSM711966     1  0.0000      0.993 1.000 0.000
#> GSM711968     1  0.0000      0.993 1.000 0.000
#> GSM711972     1  0.0000      0.993 1.000 0.000
#> GSM711976     1  0.0000      0.993 1.000 0.000
#> GSM711980     1  0.0000      0.993 1.000 0.000
#> GSM711986     1  0.0000      0.993 1.000 0.000
#> GSM711904     1  0.0000      0.993 1.000 0.000
#> GSM711906     1  0.0000      0.993 1.000 0.000
#> GSM711908     1  0.0000      0.993 1.000 0.000
#> GSM711910     1  0.9209      0.496 0.664 0.336
#> GSM711914     1  0.0000      0.993 1.000 0.000
#> GSM711916     1  0.0000      0.993 1.000 0.000
#> GSM711922     1  0.0000      0.993 1.000 0.000
#> GSM711924     1  0.0000      0.993 1.000 0.000
#> GSM711926     1  0.0000      0.993 1.000 0.000
#> GSM711928     1  0.0000      0.993 1.000 0.000
#> GSM711930     1  0.0000      0.993 1.000 0.000
#> GSM711932     1  0.0000      0.993 1.000 0.000
#> GSM711934     1  0.0000      0.993 1.000 0.000
#> GSM711940     1  0.0000      0.993 1.000 0.000
#> GSM711942     1  0.0000      0.993 1.000 0.000
#> GSM711944     1  0.0000      0.993 1.000 0.000
#> GSM711946     1  0.0000      0.993 1.000 0.000
#> GSM711948     1  0.0000      0.993 1.000 0.000
#> GSM711952     1  0.0000      0.993 1.000 0.000
#> GSM711954     1  0.0000      0.993 1.000 0.000
#> GSM711962     1  0.0000      0.993 1.000 0.000
#> GSM711970     1  0.0000      0.993 1.000 0.000
#> GSM711974     1  0.0000      0.993 1.000 0.000
#> GSM711978     1  0.0000      0.993 1.000 0.000
#> GSM711988     1  0.0000      0.993 1.000 0.000
#> GSM711990     1  0.0000      0.993 1.000 0.000
#> GSM711992     1  0.0000      0.993 1.000 0.000
#> GSM711982     1  0.0000      0.993 1.000 0.000
#> GSM711984     2  0.0000      1.000 0.000 1.000
#> GSM711912     1  0.0000      0.993 1.000 0.000
#> GSM711918     1  0.0000      0.993 1.000 0.000
#> GSM711920     1  0.0000      0.993 1.000 0.000
#> GSM711937     2  0.0000      1.000 0.000 1.000
#> GSM711939     2  0.0000      1.000 0.000 1.000
#> GSM711951     2  0.0000      1.000 0.000 1.000
#> GSM711957     1  0.0000      0.993 1.000 0.000
#> GSM711959     2  0.0000      1.000 0.000 1.000
#> GSM711961     2  0.0000      1.000 0.000 1.000
#> GSM711965     1  0.0000      0.993 1.000 0.000
#> GSM711967     1  0.0000      0.993 1.000 0.000
#> GSM711969     2  0.0000      1.000 0.000 1.000
#> GSM711973     1  0.0000      0.993 1.000 0.000
#> GSM711977     1  0.0000      0.993 1.000 0.000
#> GSM711981     1  0.0376      0.990 0.996 0.004
#> GSM711987     2  0.0000      1.000 0.000 1.000
#> GSM711905     2  0.0000      1.000 0.000 1.000
#> GSM711907     2  0.0000      1.000 0.000 1.000
#> GSM711909     1  0.0376      0.990 0.996 0.004
#> GSM711911     1  0.0000      0.993 1.000 0.000
#> GSM711915     2  0.0000      1.000 0.000 1.000
#> GSM711917     2  0.0000      1.000 0.000 1.000
#> GSM711923     1  0.0000      0.993 1.000 0.000
#> GSM711925     2  0.0000      1.000 0.000 1.000
#> GSM711927     1  0.0000      0.993 1.000 0.000
#> GSM711929     2  0.0000      1.000 0.000 1.000
#> GSM711931     2  0.0000      1.000 0.000 1.000
#> GSM711933     1  0.0000      0.993 1.000 0.000
#> GSM711935     2  0.0000      1.000 0.000 1.000
#> GSM711941     1  0.0000      0.993 1.000 0.000
#> GSM711943     1  0.0000      0.993 1.000 0.000
#> GSM711945     2  0.0000      1.000 0.000 1.000
#> GSM711947     2  0.0000      1.000 0.000 1.000
#> GSM711949     2  0.0000      1.000 0.000 1.000
#> GSM711953     2  0.0000      1.000 0.000 1.000
#> GSM711955     1  0.0000      0.993 1.000 0.000
#> GSM711963     2  0.0000      1.000 0.000 1.000
#> GSM711971     1  0.0000      0.993 1.000 0.000
#> GSM711975     2  0.0000      1.000 0.000 1.000
#> GSM711979     1  0.0000      0.993 1.000 0.000
#> GSM711989     2  0.0000      1.000 0.000 1.000
#> GSM711991     2  0.0000      1.000 0.000 1.000
#> GSM711993     1  0.0000      0.993 1.000 0.000
#> GSM711983     1  0.0000      0.993 1.000 0.000
#> GSM711985     2  0.0000      1.000 0.000 1.000
#> GSM711913     1  0.3733      0.919 0.928 0.072
#> GSM711919     1  0.0000      0.993 1.000 0.000
#> GSM711921     1  0.0000      0.993 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
#> GSM711936     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711938     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711950     1  0.5016      0.740 0.760 0.000 0.240
#> GSM711956     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711958     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711960     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711964     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711966     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711968     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711972     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711976     1  0.2165      0.888 0.936 0.000 0.064
#> GSM711980     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711986     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711904     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711906     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711908     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711910     3  0.0000      0.968 0.000 0.000 1.000
#> GSM711914     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711916     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711922     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711924     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711926     1  0.8853      0.457 0.568 0.168 0.264
#> GSM711928     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711930     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711932     1  0.3941      0.822 0.844 0.000 0.156
#> GSM711934     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711940     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711942     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711944     1  0.3752      0.832 0.856 0.000 0.144
#> GSM711946     3  0.0000      0.968 0.000 0.000 1.000
#> GSM711948     1  0.3941      0.822 0.844 0.000 0.156
#> GSM711952     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711954     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711962     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711970     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711974     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711978     1  0.5254      0.712 0.736 0.000 0.264
#> GSM711988     1  0.0237      0.922 0.996 0.000 0.004
#> GSM711990     3  0.3482      0.841 0.128 0.000 0.872
#> GSM711992     1  0.5812      0.700 0.724 0.012 0.264
#> GSM711982     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711984     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711912     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711918     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711920     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711937     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711939     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711951     2  0.4504      0.754 0.000 0.804 0.196
#> GSM711957     1  0.5216      0.717 0.740 0.000 0.260
#> GSM711959     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711961     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711965     3  0.4121      0.784 0.168 0.000 0.832
#> GSM711967     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711969     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711973     1  0.5098      0.731 0.752 0.000 0.248
#> GSM711977     3  0.0237      0.965 0.004 0.000 0.996
#> GSM711981     2  0.6452      0.602 0.032 0.704 0.264
#> GSM711987     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711905     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711907     2  0.4346      0.785 0.000 0.816 0.184
#> GSM711909     3  0.0000      0.968 0.000 0.000 1.000
#> GSM711911     3  0.1964      0.918 0.056 0.000 0.944
#> GSM711915     3  0.0892      0.952 0.000 0.020 0.980
#> GSM711917     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711923     1  0.5254      0.712 0.736 0.000 0.264
#> GSM711925     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711927     3  0.0000      0.968 0.000 0.000 1.000
#> GSM711929     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711931     2  0.3412      0.842 0.000 0.876 0.124
#> GSM711933     1  0.0000      0.924 1.000 0.000 0.000
#> GSM711935     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711941     1  0.5058      0.736 0.756 0.000 0.244
#> GSM711943     1  0.5254      0.712 0.736 0.000 0.264
#> GSM711945     3  0.0000      0.968 0.000 0.000 1.000
#> GSM711947     3  0.0892      0.952 0.000 0.020 0.980
#> GSM711949     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711953     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711955     1  0.1411      0.905 0.964 0.000 0.036
#> GSM711963     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711971     3  0.0000      0.968 0.000 0.000 1.000
#> GSM711975     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711979     1  0.5216      0.717 0.740 0.000 0.260
#> GSM711989     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711991     3  0.0000      0.968 0.000 0.000 1.000
#> GSM711993     2  0.5480      0.640 0.004 0.732 0.264
#> GSM711983     3  0.0000      0.968 0.000 0.000 1.000
#> GSM711985     2  0.0000      0.951 0.000 1.000 0.000
#> GSM711913     3  0.0000      0.968 0.000 0.000 1.000
#> GSM711919     3  0.0000      0.968 0.000 0.000 1.000
#> GSM711921     3  0.0000      0.968 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.0000    0.97866 0.000 1.000 0.000 0.000
#> GSM711938     2  0.0336    0.97844 0.000 0.992 0.000 0.008
#> GSM711950     4  0.4431    0.69829 0.304 0.000 0.000 0.696
#> GSM711956     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711958     1  0.0469    0.94801 0.988 0.000 0.000 0.012
#> GSM711960     1  0.1022    0.93327 0.968 0.000 0.000 0.032
#> GSM711964     1  0.0707    0.94294 0.980 0.000 0.000 0.020
#> GSM711966     1  0.0469    0.94801 0.988 0.000 0.000 0.012
#> GSM711968     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711972     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711976     4  0.4730    0.62466 0.364 0.000 0.000 0.636
#> GSM711980     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711986     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711904     1  0.0336    0.94980 0.992 0.000 0.000 0.008
#> GSM711906     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711908     1  0.0336    0.94980 0.992 0.000 0.000 0.008
#> GSM711910     3  0.0188    0.89370 0.004 0.000 0.996 0.000
#> GSM711914     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711916     1  0.0921    0.93660 0.972 0.000 0.000 0.028
#> GSM711922     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711924     1  0.4564    0.35451 0.672 0.000 0.000 0.328
#> GSM711926     4  0.0000    0.74372 0.000 0.000 0.000 1.000
#> GSM711928     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711930     1  0.0921    0.93660 0.972 0.000 0.000 0.028
#> GSM711932     4  0.4522    0.68305 0.320 0.000 0.000 0.680
#> GSM711934     1  0.0469    0.94801 0.988 0.000 0.000 0.012
#> GSM711940     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711942     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711944     4  0.4746    0.61708 0.368 0.000 0.000 0.632
#> GSM711946     3  0.1743    0.87973 0.004 0.000 0.940 0.056
#> GSM711948     4  0.4477    0.69101 0.312 0.000 0.000 0.688
#> GSM711952     1  0.0336    0.94980 0.992 0.000 0.000 0.008
#> GSM711954     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711962     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711970     1  0.0336    0.94980 0.992 0.000 0.000 0.008
#> GSM711974     1  0.1022    0.93327 0.968 0.000 0.000 0.032
#> GSM711978     4  0.0000    0.74372 0.000 0.000 0.000 1.000
#> GSM711988     4  0.4804    0.58558 0.384 0.000 0.000 0.616
#> GSM711990     3  0.5497    0.56797 0.284 0.000 0.672 0.044
#> GSM711992     4  0.0469    0.74228 0.000 0.000 0.012 0.988
#> GSM711982     1  0.0921    0.93660 0.972 0.000 0.000 0.028
#> GSM711984     2  0.0000    0.97866 0.000 1.000 0.000 0.000
#> GSM711912     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711918     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711920     4  0.4992    0.35549 0.476 0.000 0.000 0.524
#> GSM711937     2  0.0336    0.97844 0.000 0.992 0.000 0.008
#> GSM711939     2  0.0336    0.97844 0.000 0.992 0.000 0.008
#> GSM711951     2  0.3958    0.81822 0.000 0.816 0.024 0.160
#> GSM711957     4  0.0469    0.74772 0.012 0.000 0.000 0.988
#> GSM711959     2  0.0000    0.97866 0.000 1.000 0.000 0.000
#> GSM711961     2  0.0000    0.97866 0.000 1.000 0.000 0.000
#> GSM711965     3  0.5498    0.58233 0.272 0.000 0.680 0.048
#> GSM711967     1  0.4898   -0.00181 0.584 0.000 0.000 0.416
#> GSM711969     2  0.0336    0.97844 0.000 0.992 0.000 0.008
#> GSM711973     4  0.3873    0.73706 0.228 0.000 0.000 0.772
#> GSM711977     3  0.0188    0.89341 0.000 0.000 0.996 0.004
#> GSM711981     4  0.0817    0.73878 0.000 0.000 0.024 0.976
#> GSM711987     2  0.0336    0.97844 0.000 0.992 0.000 0.008
#> GSM711905     2  0.0000    0.97866 0.000 1.000 0.000 0.000
#> GSM711907     2  0.0188    0.97658 0.000 0.996 0.004 0.000
#> GSM711909     3  0.0188    0.89253 0.000 0.000 0.996 0.004
#> GSM711911     3  0.4877    0.69237 0.204 0.000 0.752 0.044
#> GSM711915     3  0.0817    0.88229 0.000 0.024 0.976 0.000
#> GSM711917     2  0.0336    0.97844 0.000 0.992 0.000 0.008
#> GSM711923     4  0.1388    0.74258 0.012 0.000 0.028 0.960
#> GSM711925     2  0.0000    0.97866 0.000 1.000 0.000 0.000
#> GSM711927     3  0.0000    0.89204 0.000 0.000 1.000 0.000
#> GSM711929     2  0.0000    0.97866 0.000 1.000 0.000 0.000
#> GSM711931     2  0.4387    0.77131 0.000 0.776 0.024 0.200
#> GSM711933     1  0.0000    0.95109 1.000 0.000 0.000 0.000
#> GSM711935     2  0.0000    0.97866 0.000 1.000 0.000 0.000
#> GSM711941     4  0.4431    0.69829 0.304 0.000 0.000 0.696
#> GSM711943     4  0.0921    0.73732 0.000 0.000 0.028 0.972
#> GSM711945     3  0.1211    0.88587 0.000 0.000 0.960 0.040
#> GSM711947     3  0.0817    0.88229 0.000 0.024 0.976 0.000
#> GSM711949     2  0.0000    0.97866 0.000 1.000 0.000 0.000
#> GSM711953     2  0.0336    0.97844 0.000 0.992 0.000 0.008
#> GSM711955     1  0.3569    0.69380 0.804 0.000 0.000 0.196
#> GSM711963     2  0.0000    0.97866 0.000 1.000 0.000 0.000
#> GSM711971     3  0.2385    0.86827 0.052 0.000 0.920 0.028
#> GSM711975     2  0.1151    0.95959 0.000 0.968 0.024 0.008
#> GSM711979     4  0.0188    0.74604 0.004 0.000 0.000 0.996
#> GSM711989     2  0.0336    0.97844 0.000 0.992 0.000 0.008
#> GSM711991     3  0.0188    0.89161 0.000 0.004 0.996 0.000
#> GSM711993     4  0.0000    0.74372 0.000 0.000 0.000 1.000
#> GSM711983     3  0.3803    0.79001 0.132 0.000 0.836 0.032
#> GSM711985     2  0.0336    0.97844 0.000 0.992 0.000 0.008
#> GSM711913     3  0.0469    0.89318 0.000 0.000 0.988 0.012
#> GSM711919     3  0.2300    0.87100 0.048 0.000 0.924 0.028
#> GSM711921     3  0.0188    0.89253 0.000 0.000 0.996 0.004

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM711936     5  0.3932     0.8530 0.000 0.328 0.000 0.000 0.672
#> GSM711938     2  0.2966     0.7632 0.000 0.848 0.000 0.016 0.136
#> GSM711950     4  0.4367     0.4798 0.372 0.000 0.008 0.620 0.000
#> GSM711956     1  0.0000     0.8490 1.000 0.000 0.000 0.000 0.000
#> GSM711958     1  0.0290     0.8470 0.992 0.000 0.000 0.008 0.000
#> GSM711960     1  0.3459     0.8007 0.844 0.000 0.004 0.080 0.072
#> GSM711964     1  0.2338     0.8139 0.884 0.000 0.000 0.004 0.112
#> GSM711966     1  0.0000     0.8490 1.000 0.000 0.000 0.000 0.000
#> GSM711968     1  0.1892     0.8316 0.916 0.000 0.000 0.004 0.080
#> GSM711972     1  0.2020     0.8196 0.900 0.000 0.000 0.000 0.100
#> GSM711976     1  0.3983     0.3387 0.660 0.000 0.000 0.340 0.000
#> GSM711980     1  0.0000     0.8490 1.000 0.000 0.000 0.000 0.000
#> GSM711986     1  0.2233     0.8172 0.892 0.000 0.000 0.004 0.104
#> GSM711904     1  0.3048     0.7770 0.820 0.000 0.000 0.004 0.176
#> GSM711906     1  0.2233     0.8172 0.892 0.000 0.000 0.004 0.104
#> GSM711908     1  0.3838     0.7242 0.716 0.000 0.000 0.004 0.280
#> GSM711910     3  0.0000     0.9314 0.000 0.000 1.000 0.000 0.000
#> GSM711914     1  0.0000     0.8490 1.000 0.000 0.000 0.000 0.000
#> GSM711916     1  0.2890     0.7870 0.836 0.000 0.000 0.004 0.160
#> GSM711922     1  0.0000     0.8490 1.000 0.000 0.000 0.000 0.000
#> GSM711924     1  0.0290     0.8469 0.992 0.000 0.000 0.008 0.000
#> GSM711926     4  0.0290     0.7759 0.000 0.000 0.008 0.992 0.000
#> GSM711928     1  0.0609     0.8468 0.980 0.000 0.000 0.000 0.020
#> GSM711930     1  0.3048     0.7770 0.820 0.000 0.000 0.004 0.176
#> GSM711932     1  0.4283    -0.0882 0.544 0.000 0.000 0.456 0.000
#> GSM711934     1  0.0000     0.8490 1.000 0.000 0.000 0.000 0.000
#> GSM711940     1  0.0162     0.8485 0.996 0.000 0.004 0.000 0.000
#> GSM711942     1  0.0000     0.8490 1.000 0.000 0.000 0.000 0.000
#> GSM711944     1  0.4557    -0.1026 0.516 0.000 0.008 0.476 0.000
#> GSM711946     3  0.0510     0.9284 0.000 0.000 0.984 0.016 0.000
#> GSM711948     4  0.4560     0.1411 0.484 0.000 0.008 0.508 0.000
#> GSM711952     1  0.3838     0.7242 0.716 0.000 0.000 0.004 0.280
#> GSM711954     1  0.3048     0.7770 0.820 0.000 0.000 0.004 0.176
#> GSM711962     1  0.0000     0.8490 1.000 0.000 0.000 0.000 0.000
#> GSM711970     1  0.3048     0.7770 0.820 0.000 0.000 0.004 0.176
#> GSM711974     1  0.0162     0.8484 0.996 0.000 0.004 0.000 0.000
#> GSM711978     4  0.0404     0.7760 0.000 0.000 0.012 0.988 0.000
#> GSM711988     1  0.4009     0.4053 0.684 0.000 0.004 0.312 0.000
#> GSM711990     3  0.5233     0.5872 0.192 0.000 0.680 0.000 0.128
#> GSM711992     4  0.0404     0.7760 0.000 0.000 0.012 0.988 0.000
#> GSM711982     1  0.0000     0.8490 1.000 0.000 0.000 0.000 0.000
#> GSM711984     2  0.0404     0.8757 0.000 0.988 0.000 0.000 0.012
#> GSM711912     1  0.3635     0.7511 0.748 0.000 0.000 0.004 0.248
#> GSM711918     1  0.2930     0.8013 0.832 0.000 0.000 0.004 0.164
#> GSM711920     1  0.2377     0.7437 0.872 0.000 0.000 0.128 0.000
#> GSM711937     5  0.4738     0.5411 0.000 0.464 0.000 0.016 0.520
#> GSM711939     2  0.3789     0.5904 0.000 0.760 0.000 0.016 0.224
#> GSM711951     5  0.5400     0.7931 0.000 0.220 0.008 0.100 0.672
#> GSM711957     4  0.2625     0.7184 0.108 0.000 0.000 0.876 0.016
#> GSM711959     2  0.2813     0.6707 0.000 0.832 0.000 0.000 0.168
#> GSM711961     2  0.1638     0.8556 0.000 0.932 0.000 0.004 0.064
#> GSM711965     3  0.4994     0.6545 0.152 0.000 0.720 0.004 0.124
#> GSM711967     1  0.1018     0.8440 0.968 0.000 0.000 0.016 0.016
#> GSM711969     5  0.4329     0.8625 0.000 0.312 0.000 0.016 0.672
#> GSM711973     4  0.3759     0.7113 0.220 0.000 0.016 0.764 0.000
#> GSM711977     3  0.0290     0.9305 0.000 0.000 0.992 0.008 0.000
#> GSM711981     4  0.0451     0.7750 0.000 0.000 0.008 0.988 0.004
#> GSM711987     2  0.1549     0.8649 0.000 0.944 0.000 0.016 0.040
#> GSM711905     2  0.0000     0.8792 0.000 1.000 0.000 0.000 0.000
#> GSM711907     5  0.4003     0.8357 0.000 0.288 0.008 0.000 0.704
#> GSM711909     3  0.0000     0.9314 0.000 0.000 1.000 0.000 0.000
#> GSM711911     3  0.1732     0.8627 0.080 0.000 0.920 0.000 0.000
#> GSM711915     3  0.1591     0.9035 0.000 0.004 0.940 0.004 0.052
#> GSM711917     5  0.4290     0.8678 0.000 0.304 0.000 0.016 0.680
#> GSM711923     4  0.1571     0.7614 0.000 0.000 0.060 0.936 0.004
#> GSM711925     2  0.0000     0.8792 0.000 1.000 0.000 0.000 0.000
#> GSM711927     3  0.0000     0.9314 0.000 0.000 1.000 0.000 0.000
#> GSM711929     2  0.0000     0.8792 0.000 1.000 0.000 0.000 0.000
#> GSM711931     5  0.5781     0.6738 0.000 0.164 0.004 0.200 0.632
#> GSM711933     1  0.0000     0.8490 1.000 0.000 0.000 0.000 0.000
#> GSM711935     2  0.0000     0.8792 0.000 1.000 0.000 0.000 0.000
#> GSM711941     4  0.4613     0.5009 0.360 0.000 0.020 0.620 0.000
#> GSM711943     4  0.1430     0.7640 0.000 0.000 0.052 0.944 0.004
#> GSM711945     3  0.0609     0.9270 0.000 0.000 0.980 0.020 0.000
#> GSM711947     3  0.2424     0.8386 0.000 0.000 0.868 0.000 0.132
#> GSM711949     2  0.0000     0.8792 0.000 1.000 0.000 0.000 0.000
#> GSM711953     2  0.1774     0.8564 0.000 0.932 0.000 0.016 0.052
#> GSM711955     1  0.4430     0.3152 0.628 0.000 0.012 0.360 0.000
#> GSM711963     2  0.0000     0.8792 0.000 1.000 0.000 0.000 0.000
#> GSM711971     3  0.0290     0.9301 0.008 0.000 0.992 0.000 0.000
#> GSM711975     5  0.4617     0.8672 0.000 0.304 0.004 0.024 0.668
#> GSM711979     4  0.3013     0.7379 0.160 0.000 0.008 0.832 0.000
#> GSM711989     5  0.4290     0.8678 0.000 0.304 0.000 0.016 0.680
#> GSM711991     3  0.0162     0.9307 0.000 0.000 0.996 0.004 0.000
#> GSM711993     4  0.0324     0.7747 0.000 0.000 0.004 0.992 0.004
#> GSM711983     3  0.0609     0.9234 0.020 0.000 0.980 0.000 0.000
#> GSM711985     2  0.4161     0.4413 0.000 0.704 0.000 0.016 0.280
#> GSM711913     3  0.0290     0.9305 0.000 0.000 0.992 0.008 0.000
#> GSM711919     3  0.0290     0.9301 0.008 0.000 0.992 0.000 0.000
#> GSM711921     3  0.0000     0.9314 0.000 0.000 1.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.2491      0.585 0.000 0.836 0.000 0.000 0.164 0.000
#> GSM711938     2  0.3810      0.535 0.000 0.572 0.000 0.000 0.428 0.000
#> GSM711950     4  0.4454      0.612 0.348 0.000 0.004 0.616 0.000 0.032
#> GSM711956     1  0.0000      0.792 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711958     1  0.2221      0.695 0.896 0.000 0.000 0.072 0.000 0.032
#> GSM711960     1  0.3998     -0.389 0.504 0.000 0.004 0.492 0.000 0.000
#> GSM711964     1  0.0458      0.783 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM711966     1  0.0000      0.792 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711968     1  0.3756     -0.186 0.600 0.000 0.000 0.000 0.000 0.400
#> GSM711972     1  0.3789     -0.284 0.584 0.000 0.000 0.000 0.000 0.416
#> GSM711976     1  0.0458      0.783 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM711980     1  0.0000      0.792 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711986     6  0.3817      0.588 0.432 0.000 0.000 0.000 0.000 0.568
#> GSM711904     1  0.3634      0.385 0.644 0.000 0.000 0.000 0.000 0.356
#> GSM711906     6  0.3857      0.520 0.468 0.000 0.000 0.000 0.000 0.532
#> GSM711908     6  0.1151      0.513 0.012 0.000 0.000 0.032 0.000 0.956
#> GSM711910     3  0.0146      0.960 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM711914     1  0.0000      0.792 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711916     1  0.3405      0.492 0.724 0.000 0.000 0.004 0.000 0.272
#> GSM711922     1  0.0146      0.790 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM711924     1  0.0000      0.792 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711926     4  0.2001      0.625 0.092 0.004 0.004 0.900 0.000 0.000
#> GSM711928     1  0.0146      0.790 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM711930     1  0.4461      0.273 0.564 0.000 0.000 0.032 0.000 0.404
#> GSM711932     1  0.0260      0.788 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM711934     1  0.0000      0.792 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711940     1  0.0291      0.788 0.992 0.000 0.004 0.004 0.000 0.000
#> GSM711942     1  0.0146      0.790 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM711944     4  0.4454      0.612 0.348 0.000 0.004 0.616 0.000 0.032
#> GSM711946     3  0.0260      0.959 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM711948     4  0.4454      0.612 0.348 0.000 0.004 0.616 0.000 0.032
#> GSM711952     6  0.1151      0.513 0.012 0.000 0.000 0.032 0.000 0.956
#> GSM711954     1  0.3634      0.385 0.644 0.000 0.000 0.000 0.000 0.356
#> GSM711962     1  0.0000      0.792 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711970     1  0.4400      0.322 0.592 0.000 0.000 0.032 0.000 0.376
#> GSM711974     1  0.0260      0.789 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM711978     4  0.2101      0.625 0.100 0.004 0.004 0.892 0.000 0.000
#> GSM711988     1  0.2726      0.643 0.856 0.000 0.000 0.112 0.000 0.032
#> GSM711990     3  0.1370      0.936 0.012 0.000 0.948 0.004 0.000 0.036
#> GSM711992     4  0.1958      0.623 0.100 0.004 0.000 0.896 0.000 0.000
#> GSM711982     1  0.0000      0.792 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711984     5  0.0000      0.999 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM711912     6  0.3499      0.671 0.320 0.000 0.000 0.000 0.000 0.680
#> GSM711918     6  0.3647      0.658 0.360 0.000 0.000 0.000 0.000 0.640
#> GSM711920     1  0.0000      0.792 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711937     2  0.3804      0.538 0.000 0.576 0.000 0.000 0.424 0.000
#> GSM711939     2  0.3810      0.535 0.000 0.572 0.000 0.000 0.428 0.000
#> GSM711951     2  0.1082      0.677 0.000 0.956 0.004 0.040 0.000 0.000
#> GSM711957     1  0.4199      0.299 0.600 0.000 0.000 0.380 0.000 0.020
#> GSM711959     5  0.0000      0.999 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM711961     2  0.3810      0.535 0.000 0.572 0.000 0.000 0.428 0.000
#> GSM711965     3  0.1265      0.936 0.000 0.000 0.948 0.008 0.000 0.044
#> GSM711967     1  0.0363      0.786 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM711969     2  0.0000      0.683 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711973     4  0.4532      0.619 0.340 0.000 0.008 0.620 0.000 0.032
#> GSM711977     3  0.3198      0.714 0.000 0.000 0.740 0.260 0.000 0.000
#> GSM711981     4  0.0665      0.641 0.004 0.008 0.008 0.980 0.000 0.000
#> GSM711987     2  0.3847      0.483 0.000 0.544 0.000 0.000 0.456 0.000
#> GSM711905     5  0.0000      0.999 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM711907     2  0.4072      0.534 0.000 0.756 0.004 0.040 0.188 0.012
#> GSM711909     3  0.0146      0.960 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM711911     3  0.0405      0.955 0.008 0.000 0.988 0.004 0.000 0.000
#> GSM711915     3  0.2403      0.910 0.000 0.032 0.904 0.044 0.008 0.012
#> GSM711917     2  0.0000      0.683 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM711923     4  0.1462      0.633 0.000 0.008 0.056 0.936 0.000 0.000
#> GSM711925     5  0.0000      0.999 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM711927     3  0.0146      0.960 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM711929     5  0.0146      0.994 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM711931     2  0.1219      0.674 0.000 0.948 0.004 0.048 0.000 0.000
#> GSM711933     1  0.0000      0.792 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM711935     5  0.0000      0.999 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM711941     4  0.4624      0.618 0.340 0.000 0.012 0.616 0.000 0.032
#> GSM711943     4  0.1668      0.632 0.004 0.008 0.060 0.928 0.000 0.000
#> GSM711945     3  0.0937      0.941 0.000 0.000 0.960 0.040 0.000 0.000
#> GSM711947     3  0.2360      0.905 0.000 0.044 0.900 0.044 0.000 0.012
#> GSM711949     5  0.0000      0.999 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM711953     2  0.3810      0.535 0.000 0.572 0.000 0.000 0.428 0.000
#> GSM711955     4  0.3996      0.608 0.352 0.000 0.004 0.636 0.000 0.008
#> GSM711963     5  0.0000      0.999 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM711971     3  0.0146      0.960 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM711975     2  0.1082      0.677 0.000 0.956 0.004 0.040 0.000 0.000
#> GSM711979     4  0.3690      0.631 0.308 0.000 0.008 0.684 0.000 0.000
#> GSM711989     2  0.0508      0.683 0.000 0.984 0.004 0.012 0.000 0.000
#> GSM711991     3  0.1082      0.940 0.000 0.000 0.956 0.040 0.000 0.004
#> GSM711993     4  0.0665      0.641 0.004 0.008 0.008 0.980 0.000 0.000
#> GSM711983     3  0.0146      0.960 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM711985     2  0.3810      0.535 0.000 0.572 0.000 0.000 0.428 0.000
#> GSM711913     3  0.0260      0.959 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM711919     3  0.0146      0.960 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM711921     3  0.0146      0.960 0.000 0.000 0.996 0.004 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-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 tissue(p) disease.state(p) individual(p) k
#> ATC:mclust 89  5.58e-06           0.2370         0.672 2
#> ATC:mclust 89  2.72e-09           0.1055         0.405 3
#> ATC:mclust 87  3.52e-09           0.1548         0.466 4
#> ATC:mclust 82  3.16e-09           0.3893         0.178 5
#> ATC:mclust 80  2.89e-07           0.0544         0.197 6

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


ATC:NMF**

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

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

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

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

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

collect_plots(res)

plot of chunk ATC-NMF-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.985       0.994         0.4124 0.585   0.585
#> 3 3 0.720           0.855       0.913         0.4303 0.788   0.644
#> 4 4 0.725           0.591       0.796         0.2134 0.697   0.394
#> 5 5 0.666           0.617       0.815         0.0471 0.877   0.645
#> 6 6 0.691           0.699       0.831         0.0408 0.914   0.699

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
#> GSM711936     2   0.000      0.982 0.000 1.000
#> GSM711938     2   0.000      0.982 0.000 1.000
#> GSM711950     1   0.000      0.999 1.000 0.000
#> GSM711956     1   0.000      0.999 1.000 0.000
#> GSM711958     1   0.000      0.999 1.000 0.000
#> GSM711960     1   0.000      0.999 1.000 0.000
#> GSM711964     1   0.000      0.999 1.000 0.000
#> GSM711966     1   0.000      0.999 1.000 0.000
#> GSM711968     1   0.000      0.999 1.000 0.000
#> GSM711972     1   0.000      0.999 1.000 0.000
#> GSM711976     1   0.000      0.999 1.000 0.000
#> GSM711980     1   0.000      0.999 1.000 0.000
#> GSM711986     1   0.000      0.999 1.000 0.000
#> GSM711904     1   0.000      0.999 1.000 0.000
#> GSM711906     1   0.000      0.999 1.000 0.000
#> GSM711908     1   0.000      0.999 1.000 0.000
#> GSM711910     1   0.000      0.999 1.000 0.000
#> GSM711914     1   0.000      0.999 1.000 0.000
#> GSM711916     1   0.000      0.999 1.000 0.000
#> GSM711922     1   0.000      0.999 1.000 0.000
#> GSM711924     1   0.000      0.999 1.000 0.000
#> GSM711926     1   0.224      0.962 0.964 0.036
#> GSM711928     1   0.000      0.999 1.000 0.000
#> GSM711930     1   0.000      0.999 1.000 0.000
#> GSM711932     1   0.000      0.999 1.000 0.000
#> GSM711934     1   0.000      0.999 1.000 0.000
#> GSM711940     1   0.000      0.999 1.000 0.000
#> GSM711942     1   0.000      0.999 1.000 0.000
#> GSM711944     1   0.000      0.999 1.000 0.000
#> GSM711946     1   0.000      0.999 1.000 0.000
#> GSM711948     1   0.000      0.999 1.000 0.000
#> GSM711952     1   0.000      0.999 1.000 0.000
#> GSM711954     1   0.000      0.999 1.000 0.000
#> GSM711962     1   0.000      0.999 1.000 0.000
#> GSM711970     1   0.000      0.999 1.000 0.000
#> GSM711974     1   0.000      0.999 1.000 0.000
#> GSM711978     1   0.000      0.999 1.000 0.000
#> GSM711988     1   0.000      0.999 1.000 0.000
#> GSM711990     1   0.000      0.999 1.000 0.000
#> GSM711992     1   0.000      0.999 1.000 0.000
#> GSM711982     1   0.000      0.999 1.000 0.000
#> GSM711984     2   0.000      0.982 0.000 1.000
#> GSM711912     1   0.000      0.999 1.000 0.000
#> GSM711918     1   0.000      0.999 1.000 0.000
#> GSM711920     1   0.000      0.999 1.000 0.000
#> GSM711937     2   0.000      0.982 0.000 1.000
#> GSM711939     2   0.000      0.982 0.000 1.000
#> GSM711951     2   0.000      0.982 0.000 1.000
#> GSM711957     1   0.000      0.999 1.000 0.000
#> GSM711959     2   0.000      0.982 0.000 1.000
#> GSM711961     2   0.000      0.982 0.000 1.000
#> GSM711965     1   0.000      0.999 1.000 0.000
#> GSM711967     1   0.000      0.999 1.000 0.000
#> GSM711969     2   0.000      0.982 0.000 1.000
#> GSM711973     1   0.000      0.999 1.000 0.000
#> GSM711977     1   0.000      0.999 1.000 0.000
#> GSM711981     1   0.000      0.999 1.000 0.000
#> GSM711987     2   0.000      0.982 0.000 1.000
#> GSM711905     2   0.000      0.982 0.000 1.000
#> GSM711907     2   0.000      0.982 0.000 1.000
#> GSM711909     1   0.000      0.999 1.000 0.000
#> GSM711911     1   0.000      0.999 1.000 0.000
#> GSM711915     2   0.000      0.982 0.000 1.000
#> GSM711917     2   0.000      0.982 0.000 1.000
#> GSM711923     1   0.000      0.999 1.000 0.000
#> GSM711925     2   0.000      0.982 0.000 1.000
#> GSM711927     1   0.000      0.999 1.000 0.000
#> GSM711929     2   0.000      0.982 0.000 1.000
#> GSM711931     2   0.000      0.982 0.000 1.000
#> GSM711933     1   0.000      0.999 1.000 0.000
#> GSM711935     2   0.000      0.982 0.000 1.000
#> GSM711941     1   0.000      0.999 1.000 0.000
#> GSM711943     1   0.000      0.999 1.000 0.000
#> GSM711945     1   0.204      0.967 0.968 0.032
#> GSM711947     2   0.000      0.982 0.000 1.000
#> GSM711949     2   0.000      0.982 0.000 1.000
#> GSM711953     2   0.000      0.982 0.000 1.000
#> GSM711955     1   0.000      0.999 1.000 0.000
#> GSM711963     2   0.000      0.982 0.000 1.000
#> GSM711971     1   0.000      0.999 1.000 0.000
#> GSM711975     2   0.000      0.982 0.000 1.000
#> GSM711979     1   0.000      0.999 1.000 0.000
#> GSM711989     2   0.000      0.982 0.000 1.000
#> GSM711991     2   0.990      0.211 0.440 0.560
#> GSM711993     1   0.000      0.999 1.000 0.000
#> GSM711983     1   0.000      0.999 1.000 0.000
#> GSM711985     2   0.000      0.982 0.000 1.000
#> GSM711913     1   0.000      0.999 1.000 0.000
#> GSM711919     1   0.000      0.999 1.000 0.000
#> GSM711921     1   0.000      0.999 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
#> GSM711936     2  0.0747      0.961 0.000 0.984 0.016
#> GSM711938     2  0.0000      0.962 0.000 1.000 0.000
#> GSM711950     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711956     1  0.0237      0.915 0.996 0.000 0.004
#> GSM711958     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711960     3  0.5016      0.880 0.240 0.000 0.760
#> GSM711964     1  0.6045      0.191 0.620 0.000 0.380
#> GSM711966     1  0.1163      0.911 0.972 0.000 0.028
#> GSM711968     1  0.1411      0.906 0.964 0.000 0.036
#> GSM711972     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711976     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711980     1  0.0892      0.914 0.980 0.000 0.020
#> GSM711986     1  0.0892      0.914 0.980 0.000 0.020
#> GSM711904     3  0.4702      0.901 0.212 0.000 0.788
#> GSM711906     1  0.0892      0.914 0.980 0.000 0.020
#> GSM711908     3  0.3340      0.855 0.120 0.000 0.880
#> GSM711910     3  0.4121      0.891 0.168 0.000 0.832
#> GSM711914     1  0.0892      0.914 0.980 0.000 0.020
#> GSM711916     3  0.4796      0.899 0.220 0.000 0.780
#> GSM711922     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711924     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711926     1  0.7015      0.291 0.584 0.392 0.024
#> GSM711928     1  0.2165      0.883 0.936 0.000 0.064
#> GSM711930     3  0.4178      0.893 0.172 0.000 0.828
#> GSM711932     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711934     1  0.1031      0.912 0.976 0.000 0.024
#> GSM711940     1  0.1163      0.911 0.972 0.000 0.028
#> GSM711942     1  0.1289      0.909 0.968 0.000 0.032
#> GSM711944     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711946     1  0.3116      0.833 0.892 0.000 0.108
#> GSM711948     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711952     3  0.4887      0.892 0.228 0.000 0.772
#> GSM711954     1  0.3816      0.777 0.852 0.000 0.148
#> GSM711962     1  0.0892      0.914 0.980 0.000 0.020
#> GSM711970     3  0.4178      0.893 0.172 0.000 0.828
#> GSM711974     3  0.6309      0.293 0.496 0.000 0.504
#> GSM711978     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711988     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711990     3  0.4796      0.899 0.220 0.000 0.780
#> GSM711992     1  0.1411      0.890 0.964 0.036 0.000
#> GSM711982     1  0.1289      0.909 0.968 0.000 0.032
#> GSM711984     2  0.2878      0.929 0.000 0.904 0.096
#> GSM711912     1  0.1753      0.897 0.952 0.000 0.048
#> GSM711918     1  0.1289      0.909 0.968 0.000 0.032
#> GSM711920     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711937     2  0.0000      0.962 0.000 1.000 0.000
#> GSM711939     2  0.0000      0.962 0.000 1.000 0.000
#> GSM711951     2  0.1031      0.955 0.000 0.976 0.024
#> GSM711957     1  0.1031      0.899 0.976 0.000 0.024
#> GSM711959     2  0.2625      0.936 0.000 0.916 0.084
#> GSM711961     2  0.0747      0.961 0.000 0.984 0.016
#> GSM711965     3  0.5138      0.865 0.252 0.000 0.748
#> GSM711967     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711969     2  0.0592      0.960 0.000 0.988 0.012
#> GSM711973     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711977     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711981     1  0.1620      0.888 0.964 0.012 0.024
#> GSM711987     2  0.0892      0.957 0.000 0.980 0.020
#> GSM711905     2  0.2959      0.927 0.000 0.900 0.100
#> GSM711907     2  0.5948      0.628 0.000 0.640 0.360
#> GSM711909     3  0.4605      0.901 0.204 0.000 0.796
#> GSM711911     1  0.5560      0.458 0.700 0.000 0.300
#> GSM711915     3  0.1031      0.702 0.000 0.024 0.976
#> GSM711917     2  0.0237      0.962 0.000 0.996 0.004
#> GSM711923     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711925     2  0.1964      0.948 0.000 0.944 0.056
#> GSM711927     3  0.4654      0.901 0.208 0.000 0.792
#> GSM711929     2  0.0747      0.961 0.000 0.984 0.016
#> GSM711931     2  0.1620      0.948 0.012 0.964 0.024
#> GSM711933     1  0.1289      0.909 0.968 0.000 0.032
#> GSM711935     2  0.1964      0.948 0.000 0.944 0.056
#> GSM711941     1  0.0237      0.914 0.996 0.000 0.004
#> GSM711943     1  0.0000      0.915 1.000 0.000 0.000
#> GSM711945     1  0.9822     -0.259 0.428 0.280 0.292
#> GSM711947     3  0.2959      0.621 0.000 0.100 0.900
#> GSM711949     2  0.2796      0.932 0.000 0.908 0.092
#> GSM711953     2  0.0237      0.962 0.000 0.996 0.004
#> GSM711955     1  0.1163      0.911 0.972 0.000 0.028
#> GSM711963     2  0.0424      0.962 0.000 0.992 0.008
#> GSM711971     1  0.6062      0.174 0.616 0.000 0.384
#> GSM711975     2  0.1031      0.955 0.000 0.976 0.024
#> GSM711979     1  0.1031      0.899 0.976 0.000 0.024
#> GSM711989     2  0.0592      0.960 0.000 0.988 0.012
#> GSM711991     3  0.4270      0.848 0.116 0.024 0.860
#> GSM711993     1  0.4045      0.772 0.872 0.104 0.024
#> GSM711983     1  0.0892      0.914 0.980 0.000 0.020
#> GSM711985     2  0.0592      0.960 0.000 0.988 0.012
#> GSM711913     1  0.3267      0.821 0.884 0.000 0.116
#> GSM711919     3  0.4796      0.899 0.220 0.000 0.780
#> GSM711921     3  0.4842      0.896 0.224 0.000 0.776

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM711936     2  0.4817     0.5820 0.000 0.612 0.000 0.388
#> GSM711938     2  0.4804     0.5857 0.000 0.616 0.000 0.384
#> GSM711950     2  0.7892    -0.4961 0.292 0.368 0.340 0.000
#> GSM711956     1  0.0188     0.8632 0.996 0.000 0.004 0.000
#> GSM711958     1  0.1004     0.8528 0.972 0.024 0.004 0.000
#> GSM711960     3  0.4332     0.5735 0.032 0.000 0.792 0.176
#> GSM711964     1  0.0188     0.8631 0.996 0.000 0.000 0.004
#> GSM711966     1  0.0188     0.8632 0.996 0.000 0.004 0.000
#> GSM711968     1  0.0188     0.8631 0.996 0.000 0.000 0.004
#> GSM711972     1  0.0188     0.8632 0.996 0.000 0.004 0.000
#> GSM711976     1  0.2334     0.8132 0.908 0.088 0.004 0.000
#> GSM711980     1  0.0188     0.8632 0.996 0.000 0.004 0.000
#> GSM711986     1  0.0188     0.8631 0.996 0.000 0.000 0.004
#> GSM711904     1  0.6119     0.6152 0.680 0.000 0.152 0.168
#> GSM711906     1  0.0188     0.8631 0.996 0.000 0.000 0.004
#> GSM711908     1  0.6869     0.5211 0.596 0.000 0.180 0.224
#> GSM711910     3  0.3266     0.5919 0.000 0.000 0.832 0.168
#> GSM711914     1  0.0000     0.8632 1.000 0.000 0.000 0.000
#> GSM711916     1  0.6583     0.5610 0.632 0.000 0.192 0.176
#> GSM711922     1  0.0188     0.8631 0.996 0.000 0.000 0.004
#> GSM711924     1  0.0336     0.8617 0.992 0.008 0.000 0.000
#> GSM711926     2  0.5250     0.2036 0.080 0.744 0.000 0.176
#> GSM711928     1  0.0188     0.8631 0.996 0.000 0.000 0.004
#> GSM711930     1  0.7566     0.3367 0.480 0.000 0.292 0.228
#> GSM711932     1  0.3306     0.7611 0.840 0.156 0.004 0.000
#> GSM711934     1  0.0188     0.8632 0.996 0.000 0.004 0.000
#> GSM711940     1  0.0336     0.8619 0.992 0.000 0.008 0.000
#> GSM711942     1  0.0188     0.8631 0.996 0.000 0.000 0.004
#> GSM711944     3  0.7020     0.6576 0.136 0.332 0.532 0.000
#> GSM711946     3  0.4769     0.7487 0.008 0.308 0.684 0.000
#> GSM711948     1  0.7912    -0.2379 0.356 0.336 0.308 0.000
#> GSM711952     1  0.0188     0.8631 0.996 0.000 0.000 0.004
#> GSM711954     1  0.0188     0.8631 0.996 0.000 0.000 0.004
#> GSM711962     1  0.0000     0.8632 1.000 0.000 0.000 0.000
#> GSM711970     1  0.7627     0.3317 0.472 0.000 0.272 0.256
#> GSM711974     1  0.5165     0.6940 0.752 0.000 0.168 0.080
#> GSM711978     1  0.5010     0.6691 0.728 0.244 0.012 0.016
#> GSM711988     1  0.6618     0.4410 0.604 0.272 0.124 0.000
#> GSM711990     3  0.3024     0.6114 0.000 0.000 0.852 0.148
#> GSM711992     1  0.6731     0.3497 0.608 0.236 0.000 0.156
#> GSM711982     1  0.0188     0.8632 0.996 0.000 0.004 0.000
#> GSM711984     4  0.4624     0.2793 0.000 0.340 0.000 0.660
#> GSM711912     1  0.0188     0.8631 0.996 0.000 0.000 0.004
#> GSM711918     1  0.0188     0.8631 0.996 0.000 0.000 0.004
#> GSM711920     1  0.0336     0.8617 0.992 0.008 0.000 0.000
#> GSM711937     2  0.4804     0.5857 0.000 0.616 0.000 0.384
#> GSM711939     2  0.4804     0.5857 0.000 0.616 0.000 0.384
#> GSM711951     2  0.4730     0.5656 0.000 0.636 0.000 0.364
#> GSM711957     1  0.2647     0.7941 0.880 0.120 0.000 0.000
#> GSM711959     4  0.4697     0.2379 0.000 0.356 0.000 0.644
#> GSM711961     2  0.4817     0.5820 0.000 0.612 0.000 0.388
#> GSM711965     3  0.1305     0.6775 0.000 0.004 0.960 0.036
#> GSM711967     1  0.0336     0.8617 0.992 0.008 0.000 0.000
#> GSM711969     2  0.4804     0.5857 0.000 0.616 0.000 0.384
#> GSM711973     3  0.5769     0.7187 0.036 0.376 0.588 0.000
#> GSM711977     3  0.5085     0.7309 0.008 0.376 0.616 0.000
#> GSM711981     2  0.4837    -0.4099 0.004 0.648 0.348 0.000
#> GSM711987     2  0.4804     0.5857 0.000 0.616 0.000 0.384
#> GSM711905     4  0.4454     0.3082 0.000 0.308 0.000 0.692
#> GSM711907     4  0.3583     0.3306 0.000 0.180 0.004 0.816
#> GSM711909     3  0.2814     0.6249 0.000 0.000 0.868 0.132
#> GSM711911     3  0.4103     0.7496 0.000 0.256 0.744 0.000
#> GSM711915     4  0.4866    -0.0631 0.000 0.000 0.404 0.596
#> GSM711917     2  0.4817     0.5820 0.000 0.612 0.000 0.388
#> GSM711923     3  0.5204     0.7305 0.012 0.376 0.612 0.000
#> GSM711925     2  0.4948     0.4531 0.000 0.560 0.000 0.440
#> GSM711927     3  0.2469     0.6410 0.000 0.000 0.892 0.108
#> GSM711929     2  0.4817     0.5820 0.000 0.612 0.000 0.388
#> GSM711931     2  0.1792     0.2035 0.000 0.932 0.000 0.068
#> GSM711933     1  0.0188     0.8632 0.996 0.000 0.004 0.000
#> GSM711935     4  0.4948    -0.1036 0.000 0.440 0.000 0.560
#> GSM711941     3  0.6804     0.6669 0.104 0.376 0.520 0.000
#> GSM711943     3  0.5143     0.7376 0.012 0.360 0.628 0.000
#> GSM711945     3  0.4737     0.7472 0.004 0.296 0.696 0.004
#> GSM711947     4  0.6498    -0.0189 0.000 0.072 0.440 0.488
#> GSM711949     4  0.4643     0.2720 0.000 0.344 0.000 0.656
#> GSM711953     2  0.4804     0.5857 0.000 0.616 0.000 0.384
#> GSM711955     3  0.6189     0.7240 0.092 0.268 0.640 0.000
#> GSM711963     2  0.4817     0.5820 0.000 0.612 0.000 0.388
#> GSM711971     3  0.3448     0.7373 0.004 0.168 0.828 0.000
#> GSM711975     2  0.4679     0.5486 0.000 0.648 0.000 0.352
#> GSM711979     1  0.7466     0.0802 0.436 0.388 0.176 0.000
#> GSM711989     2  0.4790     0.5826 0.000 0.620 0.000 0.380
#> GSM711991     3  0.2647     0.6356 0.000 0.000 0.880 0.120
#> GSM711993     2  0.4764    -0.1596 0.032 0.748 0.220 0.000
#> GSM711983     3  0.5186     0.7412 0.016 0.344 0.640 0.000
#> GSM711985     2  0.4804     0.5857 0.000 0.616 0.000 0.384
#> GSM711913     3  0.4800     0.7438 0.004 0.340 0.656 0.000
#> GSM711919     3  0.2814     0.6249 0.000 0.000 0.868 0.132
#> GSM711921     3  0.1004     0.6962 0.000 0.024 0.972 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
#> GSM711936     2  0.0162     0.8969 0.000 0.996 0.000 0.000 0.004
#> GSM711938     2  0.0000     0.8972 0.000 1.000 0.000 0.000 0.000
#> GSM711950     1  0.6994     0.0367 0.440 0.000 0.220 0.324 0.016
#> GSM711956     1  0.0566     0.8050 0.984 0.000 0.012 0.000 0.004
#> GSM711958     1  0.3069     0.7653 0.864 0.000 0.104 0.016 0.016
#> GSM711960     3  0.5532     0.4573 0.224 0.000 0.664 0.012 0.100
#> GSM711964     1  0.1772     0.7990 0.940 0.000 0.020 0.008 0.032
#> GSM711966     1  0.2403     0.7877 0.904 0.000 0.072 0.012 0.012
#> GSM711968     1  0.1012     0.7995 0.968 0.000 0.000 0.012 0.020
#> GSM711972     1  0.0451     0.8048 0.988 0.000 0.004 0.000 0.008
#> GSM711976     1  0.2321     0.7900 0.912 0.000 0.024 0.056 0.008
#> GSM711980     1  0.1808     0.7978 0.936 0.000 0.044 0.008 0.012
#> GSM711986     1  0.0404     0.8032 0.988 0.000 0.000 0.000 0.012
#> GSM711904     1  0.4422     0.5283 0.680 0.000 0.016 0.004 0.300
#> GSM711906     1  0.0404     0.8026 0.988 0.000 0.000 0.000 0.012
#> GSM711908     1  0.4166     0.4213 0.648 0.000 0.000 0.004 0.348
#> GSM711910     3  0.2305     0.7322 0.000 0.000 0.896 0.012 0.092
#> GSM711914     1  0.0693     0.8037 0.980 0.000 0.000 0.008 0.012
#> GSM711916     1  0.4912     0.5499 0.688 0.000 0.048 0.008 0.256
#> GSM711922     1  0.0771     0.8011 0.976 0.000 0.000 0.004 0.020
#> GSM711924     1  0.2464     0.7588 0.892 0.000 0.004 0.092 0.012
#> GSM711926     4  0.5476     0.0754 0.032 0.448 0.000 0.504 0.016
#> GSM711928     1  0.1280     0.8028 0.960 0.000 0.008 0.008 0.024
#> GSM711930     1  0.5076     0.3528 0.592 0.000 0.028 0.008 0.372
#> GSM711932     4  0.4921     0.2144 0.360 0.000 0.000 0.604 0.036
#> GSM711934     1  0.2747     0.7756 0.884 0.000 0.088 0.016 0.012
#> GSM711940     1  0.4275     0.7186 0.796 0.000 0.128 0.052 0.024
#> GSM711942     1  0.0898     0.8016 0.972 0.000 0.000 0.008 0.020
#> GSM711944     3  0.6315     0.3439 0.148 0.000 0.608 0.216 0.028
#> GSM711946     3  0.2234     0.7230 0.032 0.000 0.920 0.036 0.012
#> GSM711948     1  0.7011    -0.0158 0.436 0.000 0.224 0.324 0.016
#> GSM711952     1  0.1469     0.7928 0.948 0.000 0.000 0.016 0.036
#> GSM711954     1  0.2158     0.7920 0.920 0.000 0.020 0.008 0.052
#> GSM711962     1  0.0955     0.8047 0.968 0.000 0.028 0.000 0.004
#> GSM711970     5  0.4737     0.0569 0.380 0.000 0.016 0.004 0.600
#> GSM711974     1  0.4617     0.5080 0.660 0.000 0.316 0.008 0.016
#> GSM711978     1  0.7037     0.2030 0.512 0.096 0.048 0.332 0.012
#> GSM711988     1  0.5328     0.6348 0.716 0.000 0.096 0.160 0.028
#> GSM711990     3  0.2456     0.7366 0.024 0.000 0.904 0.008 0.064
#> GSM711992     1  0.8279    -0.1760 0.348 0.236 0.060 0.332 0.024
#> GSM711982     1  0.2291     0.7892 0.908 0.000 0.072 0.008 0.012
#> GSM711984     2  0.3530     0.7501 0.000 0.784 0.000 0.012 0.204
#> GSM711912     1  0.0865     0.8003 0.972 0.000 0.000 0.004 0.024
#> GSM711918     1  0.1018     0.7983 0.968 0.000 0.000 0.016 0.016
#> GSM711920     1  0.4295     0.5953 0.740 0.000 0.000 0.216 0.044
#> GSM711937     2  0.0000     0.8972 0.000 1.000 0.000 0.000 0.000
#> GSM711939     2  0.0000     0.8972 0.000 1.000 0.000 0.000 0.000
#> GSM711951     2  0.3969     0.4853 0.000 0.692 0.000 0.304 0.004
#> GSM711957     4  0.4851     0.2243 0.340 0.000 0.000 0.624 0.036
#> GSM711959     2  0.3355     0.7721 0.000 0.804 0.000 0.012 0.184
#> GSM711961     2  0.0290     0.8961 0.000 0.992 0.000 0.008 0.000
#> GSM711965     3  0.3421     0.7129 0.000 0.000 0.840 0.080 0.080
#> GSM711967     1  0.0566     0.8030 0.984 0.000 0.000 0.012 0.004
#> GSM711969     2  0.0000     0.8972 0.000 1.000 0.000 0.000 0.000
#> GSM711973     4  0.3154     0.4688 0.012 0.000 0.104 0.860 0.024
#> GSM711977     4  0.4920     0.1666 0.000 0.000 0.384 0.584 0.032
#> GSM711981     4  0.6827     0.4036 0.012 0.228 0.204 0.544 0.012
#> GSM711987     2  0.0000     0.8972 0.000 1.000 0.000 0.000 0.000
#> GSM711905     2  0.3720     0.7189 0.000 0.760 0.000 0.012 0.228
#> GSM711907     5  0.4653     0.1357 0.000 0.324 0.008 0.016 0.652
#> GSM711909     3  0.1894     0.7377 0.000 0.000 0.920 0.008 0.072
#> GSM711911     3  0.3012     0.7006 0.000 0.000 0.860 0.104 0.036
#> GSM711915     5  0.2929     0.2979 0.000 0.000 0.152 0.008 0.840
#> GSM711917     2  0.0510     0.8902 0.000 0.984 0.000 0.016 0.000
#> GSM711923     3  0.5955     0.2765 0.088 0.000 0.560 0.340 0.012
#> GSM711925     2  0.0771     0.8912 0.000 0.976 0.000 0.004 0.020
#> GSM711927     3  0.2473     0.7318 0.000 0.000 0.896 0.032 0.072
#> GSM711929     2  0.1012     0.8875 0.000 0.968 0.000 0.012 0.020
#> GSM711931     4  0.3690     0.4216 0.000 0.200 0.000 0.780 0.020
#> GSM711933     1  0.1442     0.8025 0.952 0.000 0.032 0.004 0.012
#> GSM711935     2  0.2522     0.8345 0.000 0.880 0.000 0.012 0.108
#> GSM711941     4  0.6609     0.0730 0.136 0.000 0.400 0.448 0.016
#> GSM711943     3  0.5924     0.3284 0.080 0.004 0.588 0.316 0.012
#> GSM711945     3  0.5508     0.3516 0.000 0.048 0.616 0.316 0.020
#> GSM711947     3  0.6977     0.0220 0.000 0.324 0.444 0.016 0.216
#> GSM711949     2  0.3355     0.7710 0.000 0.804 0.000 0.012 0.184
#> GSM711953     2  0.0000     0.8972 0.000 1.000 0.000 0.000 0.000
#> GSM711955     3  0.2906     0.6889 0.080 0.000 0.880 0.028 0.012
#> GSM711963     2  0.0162     0.8967 0.000 0.996 0.000 0.004 0.000
#> GSM711971     3  0.1074     0.7406 0.012 0.000 0.968 0.016 0.004
#> GSM711975     2  0.3491     0.6351 0.000 0.768 0.000 0.228 0.004
#> GSM711979     4  0.3326     0.4280 0.152 0.000 0.024 0.824 0.000
#> GSM711989     2  0.2338     0.8012 0.000 0.884 0.000 0.112 0.004
#> GSM711991     3  0.2171     0.7330 0.008 0.020 0.928 0.012 0.032
#> GSM711993     4  0.5758     0.3968 0.016 0.304 0.064 0.612 0.004
#> GSM711983     3  0.2494     0.7210 0.032 0.000 0.908 0.044 0.016
#> GSM711985     2  0.0000     0.8972 0.000 1.000 0.000 0.000 0.000
#> GSM711913     4  0.4902     0.1154 0.000 0.000 0.408 0.564 0.028
#> GSM711919     3  0.2228     0.7428 0.008 0.000 0.916 0.020 0.056
#> GSM711921     3  0.2992     0.7197 0.000 0.000 0.868 0.064 0.068

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM711936     2  0.0146     0.9441 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM711938     2  0.0146     0.9441 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM711950     4  0.5932     0.3424 0.272 0.000 0.096 0.580 0.048 0.004
#> GSM711956     1  0.1088     0.8867 0.960 0.000 0.024 0.000 0.016 0.000
#> GSM711958     1  0.2976     0.8289 0.844 0.000 0.128 0.008 0.016 0.004
#> GSM711960     3  0.4650     0.5038 0.232 0.000 0.696 0.052 0.004 0.016
#> GSM711964     1  0.0806     0.8852 0.972 0.000 0.000 0.008 0.000 0.020
#> GSM711966     1  0.1608     0.8798 0.940 0.000 0.036 0.016 0.004 0.004
#> GSM711968     1  0.2136     0.8740 0.908 0.000 0.000 0.016 0.064 0.012
#> GSM711972     1  0.0837     0.8852 0.972 0.000 0.004 0.004 0.020 0.000
#> GSM711976     1  0.1857     0.8814 0.928 0.000 0.012 0.028 0.032 0.000
#> GSM711980     1  0.1985     0.8780 0.916 0.000 0.008 0.064 0.004 0.008
#> GSM711986     1  0.0862     0.8854 0.972 0.000 0.000 0.004 0.008 0.016
#> GSM711904     1  0.3584     0.7266 0.740 0.000 0.000 0.012 0.004 0.244
#> GSM711906     1  0.0692     0.8847 0.976 0.000 0.000 0.004 0.020 0.000
#> GSM711908     1  0.3489     0.6577 0.708 0.000 0.000 0.000 0.004 0.288
#> GSM711910     3  0.1779     0.7710 0.000 0.000 0.920 0.000 0.016 0.064
#> GSM711914     1  0.1226     0.8841 0.952 0.000 0.004 0.004 0.040 0.000
#> GSM711916     1  0.2841     0.8534 0.864 0.000 0.012 0.032 0.000 0.092
#> GSM711922     1  0.1262     0.8863 0.956 0.000 0.000 0.020 0.016 0.008
#> GSM711924     1  0.3512     0.6963 0.740 0.000 0.008 0.004 0.248 0.000
#> GSM711926     4  0.6093     0.1951 0.012 0.312 0.000 0.476 0.200 0.000
#> GSM711928     1  0.1649     0.8829 0.932 0.000 0.000 0.036 0.000 0.032
#> GSM711930     1  0.3073     0.7831 0.788 0.000 0.000 0.008 0.000 0.204
#> GSM711932     5  0.2612     0.3739 0.108 0.000 0.016 0.008 0.868 0.000
#> GSM711934     1  0.2747     0.8545 0.876 0.000 0.036 0.076 0.004 0.008
#> GSM711940     1  0.4460     0.6516 0.716 0.000 0.052 0.216 0.004 0.012
#> GSM711942     1  0.1956     0.8725 0.908 0.000 0.000 0.004 0.080 0.008
#> GSM711944     3  0.6402     0.1910 0.160 0.000 0.496 0.048 0.296 0.000
#> GSM711946     3  0.3530     0.6509 0.012 0.000 0.776 0.200 0.004 0.008
#> GSM711948     4  0.6829     0.1435 0.380 0.000 0.100 0.396 0.124 0.000
#> GSM711952     1  0.3149     0.8442 0.852 0.000 0.000 0.020 0.052 0.076
#> GSM711954     1  0.2817     0.8638 0.872 0.000 0.004 0.076 0.008 0.040
#> GSM711962     1  0.1149     0.8841 0.960 0.000 0.024 0.008 0.008 0.000
#> GSM711970     6  0.3852     0.6577 0.108 0.000 0.012 0.068 0.008 0.804
#> GSM711974     1  0.3938     0.5777 0.672 0.000 0.312 0.012 0.004 0.000
#> GSM711978     4  0.3832     0.4787 0.180 0.024 0.000 0.776 0.012 0.008
#> GSM711988     1  0.2968     0.8590 0.868 0.000 0.044 0.032 0.056 0.000
#> GSM711990     3  0.1894     0.7815 0.016 0.000 0.928 0.040 0.004 0.012
#> GSM711992     4  0.4556     0.4475 0.184 0.076 0.004 0.724 0.000 0.012
#> GSM711982     1  0.1586     0.8789 0.940 0.000 0.040 0.012 0.004 0.004
#> GSM711984     2  0.2706     0.8570 0.000 0.832 0.000 0.000 0.008 0.160
#> GSM711912     1  0.1738     0.8799 0.928 0.000 0.000 0.004 0.052 0.016
#> GSM711918     1  0.2408     0.8527 0.876 0.000 0.000 0.004 0.108 0.012
#> GSM711920     5  0.4300    -0.0796 0.456 0.000 0.012 0.004 0.528 0.000
#> GSM711937     2  0.0405     0.9431 0.000 0.988 0.000 0.008 0.004 0.000
#> GSM711939     2  0.0146     0.9441 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM711951     4  0.3937     0.2693 0.000 0.424 0.000 0.572 0.004 0.000
#> GSM711957     5  0.1672     0.3904 0.048 0.000 0.004 0.016 0.932 0.000
#> GSM711959     2  0.2146     0.8929 0.000 0.880 0.000 0.000 0.004 0.116
#> GSM711961     2  0.0806     0.9401 0.000 0.972 0.000 0.020 0.000 0.008
#> GSM711965     4  0.5405    -0.0676 0.000 0.000 0.436 0.480 0.020 0.064
#> GSM711967     1  0.1349     0.8806 0.940 0.000 0.000 0.004 0.056 0.000
#> GSM711969     2  0.0508     0.9419 0.000 0.984 0.000 0.012 0.004 0.000
#> GSM711973     5  0.4950     0.2993 0.000 0.000 0.080 0.344 0.576 0.000
#> GSM711977     5  0.5528     0.3916 0.000 0.000 0.252 0.192 0.556 0.000
#> GSM711981     4  0.3659     0.4557 0.000 0.060 0.032 0.820 0.088 0.000
#> GSM711987     2  0.0291     0.9438 0.000 0.992 0.000 0.004 0.004 0.000
#> GSM711905     2  0.3222     0.8482 0.000 0.824 0.000 0.024 0.012 0.140
#> GSM711907     6  0.4586     0.6732 0.000 0.036 0.024 0.236 0.004 0.700
#> GSM711909     3  0.0717     0.7930 0.000 0.000 0.976 0.000 0.008 0.016
#> GSM711911     3  0.2666     0.7405 0.000 0.000 0.872 0.028 0.092 0.008
#> GSM711915     6  0.2937     0.6983 0.000 0.000 0.100 0.044 0.004 0.852
#> GSM711917     2  0.0547     0.9389 0.000 0.980 0.000 0.020 0.000 0.000
#> GSM711923     4  0.3478     0.5171 0.064 0.000 0.108 0.820 0.004 0.004
#> GSM711925     2  0.0458     0.9427 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM711927     3  0.0914     0.7927 0.000 0.000 0.968 0.000 0.016 0.016
#> GSM711929     2  0.1480     0.9286 0.000 0.940 0.000 0.020 0.000 0.040
#> GSM711931     5  0.5004     0.1136 0.000 0.084 0.000 0.348 0.568 0.000
#> GSM711933     1  0.2693     0.8729 0.884 0.000 0.036 0.052 0.028 0.000
#> GSM711935     2  0.2020     0.9050 0.000 0.896 0.000 0.000 0.008 0.096
#> GSM711941     4  0.6067     0.3722 0.120 0.000 0.124 0.616 0.140 0.000
#> GSM711943     4  0.4354     0.4650 0.052 0.000 0.236 0.704 0.008 0.000
#> GSM711945     4  0.3369     0.4855 0.008 0.012 0.140 0.824 0.008 0.008
#> GSM711947     3  0.5030     0.4712 0.000 0.200 0.696 0.036 0.008 0.060
#> GSM711949     2  0.2846     0.8650 0.000 0.840 0.000 0.016 0.004 0.140
#> GSM711953     2  0.0260     0.9441 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM711955     3  0.5158     0.4177 0.276 0.000 0.624 0.088 0.008 0.004
#> GSM711963     2  0.0653     0.9435 0.000 0.980 0.000 0.004 0.004 0.012
#> GSM711971     3  0.0862     0.7941 0.008 0.000 0.972 0.016 0.004 0.000
#> GSM711975     2  0.2201     0.8737 0.000 0.896 0.000 0.076 0.028 0.000
#> GSM711979     4  0.5008     0.3164 0.108 0.000 0.000 0.612 0.280 0.000
#> GSM711989     2  0.1556     0.8921 0.000 0.920 0.000 0.080 0.000 0.000
#> GSM711991     3  0.2128     0.7669 0.000 0.004 0.908 0.056 0.000 0.032
#> GSM711993     4  0.4156     0.4430 0.004 0.160 0.004 0.756 0.076 0.000
#> GSM711983     3  0.1457     0.7870 0.028 0.000 0.948 0.016 0.004 0.004
#> GSM711985     2  0.0146     0.9441 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM711913     5  0.6289     0.2550 0.000 0.000 0.320 0.280 0.392 0.008
#> GSM711919     3  0.0964     0.7953 0.004 0.000 0.968 0.016 0.012 0.000
#> GSM711921     3  0.2136     0.7652 0.000 0.000 0.908 0.016 0.064 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-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 tissue(p) disease.state(p) individual(p) k
#> ATC:NMF 89  1.62e-05            0.236         0.559 2
#> ATC:NMF 84  9.89e-05            0.232         0.142 3
#> ATC:NMF 70  1.13e-08            0.197         0.526 4
#> ATC:NMF 63  1.58e-08            0.185         0.506 5
#> ATC:NMF 67  3.43e-07            0.363         0.782 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