cola Report for GDS3837

Date: 2019-12-25 21:00:09 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 51941 rows and 120 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] 51941   120

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:NMF 3 0.998 0.949 0.974 **
MAD:skmeans 6 0.982 0.944 0.964 ** 2,4,5
SD:pam 2 0.966 0.969 0.987 **
CV:mclust 2 0.965 0.941 0.972 **
CV:skmeans 6 0.954 0.887 0.944 ** 2,4,5
MAD:NMF 3 0.953 0.944 0.977 **
ATC:skmeans 4 0.953 0.909 0.962 ** 2,3
SD:skmeans 6 0.940 0.870 0.918 * 2,4,5
ATC:pam 6 0.935 0.896 0.957 * 2
CV:NMF 3 0.931 0.929 0.970 *
ATC:hclust 2 0.915 0.947 0.976 *
SD:mclust 6 0.915 0.885 0.949 * 3,4
MAD:mclust 6 0.906 0.884 0.945 * 3
MAD:pam 6 0.903 0.854 0.912 * 2
ATC:NMF 2 0.898 0.937 0.973
CV:kmeans 4 0.781 0.854 0.885
MAD:kmeans 4 0.758 0.892 0.890
ATC:kmeans 4 0.697 0.782 0.874
CV:pam 2 0.686 0.840 0.930
SD:hclust 5 0.656 0.697 0.782
MAD:hclust 4 0.629 0.819 0.847
SD:kmeans 2 0.483 0.807 0.872
ATC:mclust 2 0.473 0.875 0.904
CV:hclust 2 0.256 0.802 0.876

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

CDF of consensus matrices

Cumulative distribution function curves of consensus matrix for all methods.

collect_plots(res_list, fun = plot_ecdf)

plot of chunk collect-plots

Consensus heatmap

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

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

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

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

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

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

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

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

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

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

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

Membership heatmap

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

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

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

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

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

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

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

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

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

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

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

Signature heatmap

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

Note in following heatmaps, rows are scaled.

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

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

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

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

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

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

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

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

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

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

Statistics table

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

get_stats(res_list, k = 2)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      2 0.520           0.736       0.893          0.493 0.519   0.519
#> CV:NMF      2 0.629           0.859       0.931          0.501 0.499   0.499
#> MAD:NMF     2 0.707           0.870       0.943          0.492 0.503   0.503
#> ATC:NMF     2 0.898           0.937       0.973          0.477 0.516   0.516
#> SD:skmeans  2 1.000           0.987       0.994          0.505 0.496   0.496
#> CV:skmeans  2 1.000           0.980       0.986          0.504 0.496   0.496
#> MAD:skmeans 2 1.000           0.991       0.994          0.504 0.496   0.496
#> ATC:skmeans 2 1.000           0.958       0.983          0.479 0.519   0.519
#> SD:mclust   2 0.368           0.826       0.860          0.385 0.658   0.658
#> CV:mclust   2 0.965           0.941       0.972          0.344 0.667   0.667
#> MAD:mclust  2 0.499           0.846       0.891          0.364 0.688   0.688
#> ATC:mclust  2 0.473           0.875       0.904          0.460 0.497   0.497
#> SD:kmeans   2 0.483           0.807       0.872          0.503 0.496   0.496
#> CV:kmeans   2 0.487           0.636       0.783          0.501 0.496   0.496
#> MAD:kmeans  2 0.495           0.768       0.854          0.502 0.496   0.496
#> ATC:kmeans  2 0.858           0.964       0.977          0.342 0.630   0.630
#> SD:pam      2 0.966           0.969       0.987          0.504 0.496   0.496
#> CV:pam      2 0.686           0.840       0.930          0.502 0.496   0.496
#> MAD:pam     2 1.000           0.972       0.990          0.504 0.496   0.496
#> ATC:pam     2 1.000           0.988       0.996          0.176 0.832   0.832
#> SD:hclust   2 0.154           0.483       0.729          0.422 0.564   0.564
#> CV:hclust   2 0.256           0.802       0.876          0.475 0.497   0.497
#> MAD:hclust  2 0.322           0.703       0.813          0.484 0.498   0.498
#> ATC:hclust  2 0.915           0.947       0.976          0.217 0.792   0.792
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.998           0.949       0.974          0.315 0.743   0.544
#> CV:NMF      3 0.931           0.929       0.970          0.326 0.681   0.447
#> MAD:NMF     3 0.953           0.944       0.977          0.324 0.636   0.401
#> ATC:NMF     3 0.649           0.841       0.895          0.367 0.687   0.461
#> SD:skmeans  3 0.707           0.852       0.877          0.302 0.741   0.526
#> CV:skmeans  3 0.731           0.830       0.897          0.326 0.720   0.494
#> MAD:skmeans 3 0.706           0.878       0.832          0.301 0.752   0.542
#> ATC:skmeans 3 0.944           0.946       0.975          0.403 0.769   0.571
#> SD:mclust   3 0.926           0.917       0.963          0.674 0.663   0.501
#> CV:mclust   3 0.687           0.807       0.894          0.858 0.676   0.519
#> MAD:mclust  3 0.909           0.896       0.944          0.768 0.661   0.511
#> ATC:mclust  3 0.813           0.725       0.883          0.340 0.861   0.731
#> SD:kmeans   3 0.567           0.599       0.744          0.298 0.824   0.656
#> CV:kmeans   3 0.503           0.660       0.771          0.316 0.841   0.685
#> MAD:kmeans  3 0.596           0.512       0.731          0.300 0.725   0.500
#> ATC:kmeans  3 0.543           0.730       0.857          0.686 0.725   0.594
#> SD:pam      3 0.866           0.867       0.945          0.300 0.782   0.588
#> CV:pam      3 0.758           0.718       0.874          0.321 0.824   0.656
#> MAD:pam     3 0.853           0.837       0.939          0.287 0.774   0.575
#> ATC:pam     3 0.783           0.842       0.939          2.110 0.649   0.578
#> SD:hclust   3 0.361           0.622       0.759          0.398 0.689   0.502
#> CV:hclust   3 0.436           0.701       0.836          0.282 0.852   0.707
#> MAD:hclust  3 0.521           0.735       0.814          0.273 0.798   0.616
#> ATC:hclust  3 0.439           0.760       0.857          1.086 0.690   0.613
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.849           0.861       0.937         0.1280 0.792   0.494
#> CV:NMF      4 0.875           0.882       0.945         0.1264 0.754   0.406
#> MAD:NMF     4 0.695           0.748       0.862         0.1165 0.867   0.651
#> ATC:NMF     4 0.655           0.542       0.761         0.1016 0.754   0.424
#> SD:skmeans  4 0.966           0.959       0.981         0.1505 0.827   0.541
#> CV:skmeans  4 1.000           0.994       0.997         0.1308 0.815   0.512
#> MAD:skmeans 4 1.000           0.983       0.993         0.1502 0.828   0.545
#> ATC:skmeans 4 0.953           0.909       0.962         0.1073 0.896   0.697
#> SD:mclust   4 0.927           0.930       0.951         0.1197 0.898   0.720
#> CV:mclust   4 0.883           0.906       0.955         0.1365 0.867   0.651
#> MAD:mclust  4 0.736           0.870       0.896         0.1310 0.883   0.688
#> ATC:mclust  4 0.627           0.801       0.871         0.0841 0.858   0.662
#> SD:kmeans   4 0.753           0.860       0.861         0.1291 0.816   0.528
#> CV:kmeans   4 0.781           0.854       0.885         0.1270 0.866   0.634
#> MAD:kmeans  4 0.758           0.892       0.890         0.1361 0.834   0.551
#> ATC:kmeans  4 0.697           0.782       0.874         0.2327 0.770   0.520
#> SD:pam      4 0.768           0.858       0.901         0.0871 0.876   0.678
#> CV:pam      4 0.736           0.825       0.855         0.1087 0.857   0.617
#> MAD:pam     4 0.760           0.780       0.859         0.0998 0.922   0.782
#> ATC:pam     4 0.800           0.835       0.935         0.2775 0.815   0.615
#> SD:hclust   4 0.587           0.567       0.780         0.1580 0.840   0.621
#> CV:hclust   4 0.545           0.604       0.711         0.1500 0.824   0.582
#> MAD:hclust  4 0.629           0.819       0.847         0.1833 0.870   0.641
#> ATC:hclust  4 0.574           0.759       0.881         0.2304 0.918   0.842
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.656           0.626       0.799         0.0405 0.830   0.492
#> CV:NMF      5 0.648           0.630       0.806         0.0541 0.808   0.405
#> MAD:NMF     5 0.648           0.668       0.817         0.0698 0.838   0.514
#> ATC:NMF     5 0.631           0.587       0.783         0.0706 0.834   0.512
#> SD:skmeans  5 0.957           0.952       0.964         0.0487 0.956   0.823
#> CV:skmeans  5 0.989           0.961       0.976         0.0509 0.955   0.817
#> MAD:skmeans 5 0.932           0.871       0.886         0.0500 0.949   0.799
#> ATC:skmeans 5 0.864           0.819       0.912         0.0642 0.925   0.717
#> SD:mclust   5 0.730           0.761       0.858         0.0806 0.845   0.516
#> CV:mclust   5 0.723           0.772       0.857         0.0763 0.905   0.665
#> MAD:mclust  5 0.851           0.754       0.893         0.0807 0.876   0.586
#> ATC:mclust  5 0.798           0.812       0.907         0.1697 0.881   0.622
#> SD:kmeans   5 0.814           0.705       0.819         0.0703 0.942   0.773
#> CV:kmeans   5 0.837           0.818       0.875         0.0655 0.951   0.805
#> MAD:kmeans  5 0.841           0.695       0.833         0.0643 0.963   0.856
#> ATC:kmeans  5 0.695           0.678       0.814         0.0897 0.912   0.700
#> SD:pam      5 0.803           0.771       0.877         0.0738 0.941   0.804
#> CV:pam      5 0.760           0.784       0.852         0.0648 0.881   0.591
#> MAD:pam     5 0.864           0.802       0.879         0.0815 0.854   0.557
#> ATC:pam     5 0.890           0.871       0.945         0.1081 0.910   0.706
#> SD:hclust   5 0.656           0.697       0.782         0.1066 0.849   0.554
#> CV:hclust   5 0.700           0.747       0.836         0.0880 0.849   0.550
#> MAD:hclust  5 0.772           0.818       0.874         0.0725 0.955   0.823
#> ATC:hclust  5 0.602           0.730       0.863         0.0606 0.953   0.898
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.713           0.693       0.837         0.0501 0.868   0.535
#> CV:NMF      6 0.733           0.684       0.825         0.0368 0.883   0.538
#> MAD:NMF     6 0.663           0.625       0.786         0.0302 0.913   0.658
#> ATC:NMF     6 0.608           0.498       0.705         0.0579 0.871   0.522
#> SD:skmeans  6 0.940           0.870       0.918         0.0394 0.960   0.813
#> CV:skmeans  6 0.954           0.887       0.944         0.0394 0.967   0.842
#> MAD:skmeans 6 0.982           0.944       0.964         0.0373 0.954   0.788
#> ATC:skmeans 6 0.794           0.705       0.809         0.0381 0.949   0.766
#> SD:mclust   6 0.915           0.885       0.949         0.0428 0.893   0.578
#> CV:mclust   6 0.871           0.860       0.933         0.0247 0.883   0.546
#> MAD:mclust  6 0.906           0.884       0.945         0.0412 0.886   0.541
#> ATC:mclust  6 0.844           0.817       0.899         0.0255 0.929   0.705
#> SD:kmeans   6 0.798           0.691       0.801         0.0396 0.928   0.684
#> CV:kmeans   6 0.835           0.717       0.801         0.0387 0.936   0.709
#> MAD:kmeans  6 0.796           0.723       0.810         0.0407 0.914   0.652
#> ATC:kmeans  6 0.733           0.563       0.752         0.0539 0.909   0.629
#> SD:pam      6 0.847           0.837       0.911         0.0690 0.883   0.568
#> CV:pam      6 0.834           0.825       0.907         0.0478 0.936   0.719
#> MAD:pam     6 0.903           0.854       0.912         0.0566 0.908   0.628
#> ATC:pam     6 0.935           0.896       0.957         0.0456 0.957   0.811
#> SD:hclust   6 0.681           0.640       0.755         0.0333 0.955   0.803
#> CV:hclust   6 0.718           0.615       0.779         0.0565 0.968   0.856
#> MAD:hclust  6 0.808           0.740       0.803         0.0344 0.956   0.806
#> ATC:hclust  6 0.527           0.501       0.710         0.2188 0.822   0.583

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

collect_stats(res_list, k = 2)

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

collect_stats(res_list, k = 3)

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

collect_stats(res_list, k = 4)

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

collect_stats(res_list, k = 5)

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

collect_stats(res_list, k = 6)

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

Partition from all methods

Collect partitions from all methods:

collect_classes(res_list, k = 2)

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

collect_classes(res_list, k = 3)

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

collect_classes(res_list, k = 4)

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

collect_classes(res_list, k = 5)

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

collect_classes(res_list, k = 6)

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

Top rows overlap

Overlap of top rows from different top-row methods:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Heatmaps of the top rows:

top_rows_heatmap(res_list, top_n = 1000)

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

top_rows_heatmap(res_list, top_n = 2000)

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

top_rows_heatmap(res_list, top_n = 3000)

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

top_rows_heatmap(res_list, top_n = 4000)

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

top_rows_heatmap(res_list, top_n = 5000)

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

Test to known annotations

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

test_to_known_factors(res_list, k = 2)
#>               n disease.state(p)   age(p) other(p) individual(p) k
#> SD:NMF       96         2.48e-13 0.941536 2.34e-09      9.48e-01 2
#> CV:NMF      115         3.85e-03 0.079188 3.26e-02      2.19e-02 2
#> MAD:NMF     115         1.15e-02 0.046946 9.39e-02      1.13e-02 2
#> ATC:NMF     117         4.64e-05 0.754632 2.76e-03      1.72e-01 2
#> SD:skmeans  120         6.85e-20 0.999779 2.52e-15      1.00e+00 2
#> CV:skmeans  119         1.96e-20 0.999969 1.17e-15      1.00e+00 2
#> MAD:skmeans 120         6.85e-20 0.999779 2.52e-15      1.00e+00 2
#> ATC:skmeans 116         7.11e-06 0.551181 1.57e-03      2.08e-01 2
#> SD:mclust   119         9.62e-01 0.007797 9.42e-01      1.37e-05 2
#> CV:mclust   118         9.24e-01 0.007416 9.41e-01      1.77e-05 2
#> MAD:mclust  117         8.91e-01 0.004934 9.09e-01      2.40e-05 2
#> ATC:mclust  113         4.02e-19 0.999606 1.78e-14      1.00e+00 2
#> SD:kmeans   120         6.85e-20 0.999779 2.52e-15      1.00e+00 2
#> CV:kmeans   119         1.96e-20 0.999969 1.17e-15      1.00e+00 2
#> MAD:kmeans  119         1.96e-20 0.999896 1.13e-15      1.00e+00 2
#> ATC:kmeans  120         1.05e-02 0.080773 4.26e-02      1.63e-02 2
#> SD:pam      118         5.93e-21 0.999847 2.36e-16      1.00e+00 2
#> CV:pam      114         2.49e-19 0.999598 7.73e-15      1.00e+00 2
#> MAD:pam     118         5.93e-21 0.999967 3.67e-16      1.00e+00 2
#> ATC:pam     119         5.08e-01 0.000108 1.29e-01      5.32e-04 2
#> SD:hclust    72         4.35e-04 0.113142 6.64e-03      4.51e-02 2
#> CV:hclust   118         2.73e-01 0.000385 4.78e-02      6.94e-04 2
#> MAD:hclust  114         1.00e+00 0.001879 2.47e-01      6.98e-04 2
#> ATC:hclust  119         7.50e-01 0.000109 2.26e-01      7.43e-05 2
test_to_known_factors(res_list, k = 3)
#>               n disease.state(p)  age(p) other(p) individual(p) k
#> SD:NMF      117         8.48e-20 0.96440 3.24e-17       0.98166 3
#> CV:NMF      117         1.01e-17 0.82156 5.65e-15       0.82568 3
#> MAD:NMF     116         2.34e-18 0.82674 2.68e-14       0.97068 3
#> ATC:NMF     114         9.01e-04 0.04506 7.06e-04       0.01087 3
#> SD:skmeans  116         7.06e-17 0.32247 4.98e-11       0.82550 3
#> CV:skmeans  118         1.33e-16 0.64299 1.23e-14       0.73618 3
#> MAD:skmeans 120         1.72e-16 0.27929 9.68e-11       0.78513 3
#> ATC:skmeans 118         5.54e-04 0.03684 4.60e-02       0.00177 3
#> SD:mclust   115         2.31e-15 0.21937 1.31e-08       0.09662 3
#> CV:mclust   118         8.52e-16 0.33030 6.72e-09       0.13595 3
#> MAD:mclust  117         2.76e-14 0.13997 1.74e-08       0.05949 3
#> ATC:mclust   97         1.08e-15 0.28974 1.69e-10       0.59637 3
#> SD:kmeans   110         2.59e-19 0.87885 2.43e-15       0.98811 3
#> CV:kmeans   113         4.86e-20 0.92557 1.13e-17       0.98689 3
#> MAD:kmeans   69         2.83e-11 0.82833 2.71e-07       0.93753 3
#> ATC:kmeans  107         1.63e-07 0.02230 2.43e-05       0.04458 3
#> SD:pam      107         8.29e-16 0.23120 1.01e-09       0.72816 3
#> CV:pam       93         9.01e-14 0.24581 1.16e-07       0.66794 3
#> MAD:pam     106         2.21e-15 0.29615 3.48e-09       0.81641 3
#> ATC:pam     107         3.13e-03 0.00651 8.34e-02       0.00214 3
#> SD:hclust    96         2.45e-15 0.49189 1.99e-12       0.69062 3
#> CV:hclust   101         2.19e-07 0.01564 4.83e-05       0.12862 3
#> MAD:hclust  112         3.44e-08 0.02495 1.13e-04       0.06181 3
#> ATC:hclust  109         9.34e-06 0.00656 9.59e-04       0.01149 3
test_to_known_factors(res_list, k = 4)
#>               n disease.state(p)   age(p) other(p) individual(p) k
#> SD:NMF      114         4.48e-14 0.443315 3.97e-11       0.22495 4
#> CV:NMF      114         6.18e-12 0.267553 2.12e-09       0.18720 4
#> MAD:NMF     107         7.27e-16 0.656635 4.01e-12       0.48113 4
#> ATC:NMF      81         1.98e-13 0.483791 1.39e-11       0.54995 4
#> SD:skmeans  119         7.86e-19 0.430340 1.03e-12       0.85827 4
#> CV:skmeans  120         8.49e-20 0.516577 9.69e-14       0.91540 4
#> MAD:skmeans 119         9.13e-19 0.396978 1.08e-12       0.87957 4
#> ATC:skmeans 113         3.40e-07 0.033298 3.62e-05       0.01305 4
#> SD:mclust   118         9.27e-16 0.089804 3.60e-12       0.03421 4
#> CV:mclust   116         1.14e-15 0.112949 1.24e-13       0.05760 4
#> MAD:mclust  118         1.13e-15 0.077163 1.22e-12       0.03983 4
#> ATC:mclust  114         4.40e-17 0.258187 2.18e-09       0.55786 4
#> SD:kmeans   116         4.96e-19 0.335604 8.57e-13       0.85473 4
#> CV:kmeans   112         3.02e-18 0.299403 1.82e-12       0.78068 4
#> MAD:kmeans  117         2.40e-18 0.366054 6.29e-12       0.85119 4
#> ATC:kmeans  110         1.38e-04 0.000444 2.47e-02       0.00217 4
#> SD:pam      118         5.04e-14 0.118754 1.33e-07       0.25619 4
#> CV:pam      117         2.33e-18 0.532704 9.89e-14       0.85218 4
#> MAD:pam     115         1.50e-14 0.087089 2.89e-07       0.27636 4
#> ATC:pam     113         3.72e-06 0.027122 1.23e-03       0.01188 4
#> SD:hclust    87         3.19e-13 0.161896 3.08e-10       0.35175 4
#> CV:hclust    91         2.20e-06 0.029381 3.22e-05       0.06148 4
#> MAD:hclust  113         3.34e-18 0.525985 7.62e-12       0.85983 4
#> ATC:hclust  108         1.59e-06 0.076707 1.77e-03       0.01581 4
test_to_known_factors(res_list, k = 5)
#>               n disease.state(p)   age(p) other(p) individual(p) k
#> SD:NMF       87         1.54e-11 0.681752 7.13e-09      0.662625 5
#> CV:NMF       92         8.22e-09 0.153688 1.49e-05      0.049332 5
#> MAD:NMF     101         2.43e-09 0.238651 4.23e-06      0.095413 5
#> ATC:NMF      94         1.56e-11 0.073832 3.60e-08      0.012861 5
#> SD:skmeans  120         1.26e-18 0.360595 1.23e-13      0.663885 5
#> CV:skmeans  120         2.43e-19 0.470799 2.03e-14      0.750314 5
#> MAD:skmeans 113         5.48e-19 0.499380 1.06e-13      0.800393 5
#> ATC:skmeans 113         1.02e-12 0.304692 1.99e-08      0.277791 5
#> SD:mclust   110         2.13e-16 0.345940 2.04e-09      0.413340 5
#> CV:mclust   115         4.42e-15 0.115212 2.24e-11      0.072011 5
#> MAD:mclust  106         6.80e-14 0.177956 8.41e-10      0.102737 5
#> ATC:mclust  113         1.94e-15 0.238354 4.91e-09      0.269105 5
#> SD:kmeans    93         9.15e-15 0.041751 2.54e-11      0.381143 5
#> CV:kmeans   113         3.93e-17 0.358563 1.21e-12      0.656204 5
#> MAD:kmeans  100         3.84e-16 0.297335 7.29e-13      0.643774 5
#> ATC:kmeans  102         3.61e-07 0.007388 6.24e-06      0.009919 5
#> SD:pam      113         1.38e-14 0.002421 1.82e-08      0.078827 5
#> CV:pam      106         1.20e-14 0.217817 3.98e-08      0.323999 5
#> MAD:pam     112         1.32e-15 0.151879 9.87e-09      0.379272 5
#> ATC:pam     112         1.51e-05 0.000879 3.70e-03      0.000176 5
#> SD:hclust   103         6.73e-16 0.089787 2.08e-11      0.394215 5
#> CV:hclust   102         4.92e-15 0.103337 1.16e-11      0.555458 5
#> MAD:hclust  113         1.79e-16 0.067424 1.27e-11      0.556265 5
#> ATC:hclust   99         9.45e-06 0.193496 5.88e-04      0.008916 5
test_to_known_factors(res_list, k = 6)
#>               n disease.state(p)  age(p) other(p) individual(p) k
#> SD:NMF       98         4.81e-12 0.26112 6.65e-08      0.215615 6
#> CV:NMF      100         3.81e-11 0.13537 2.25e-07      0.088745 6
#> MAD:NMF      92         2.71e-09 0.40360 6.05e-06      0.127400 6
#> ATC:NMF      74         1.36e-06 0.00700 1.94e-05      0.002183 6
#> SD:skmeans  113         1.21e-16 0.20065 5.16e-10      0.383068 6
#> CV:skmeans  113         2.21e-17 0.26004 8.09e-11      0.394416 6
#> MAD:skmeans 119         8.23e-17 0.04182 1.16e-10      0.266173 6
#> ATC:skmeans 101         4.89e-12 0.18787 5.82e-09      0.208864 6
#> SD:mclust   115         1.90e-18 0.54474 2.10e-11      0.727994 6
#> CV:mclust   115         1.52e-17 0.53558 9.96e-12      0.717142 6
#> MAD:mclust  115         8.46e-17 0.24931 1.53e-11      0.533989 6
#> ATC:mclust  112         1.80e-15 0.04079 2.07e-08      0.546154 6
#> SD:kmeans   103         1.30e-15 0.21014 4.09e-09      0.399855 6
#> CV:kmeans   104         6.65e-16 0.39102 2.38e-09      0.413781 6
#> MAD:kmeans  103         4.77e-15 0.16788 2.02e-09      0.340241 6
#> ATC:kmeans   72         2.39e-07 0.08283 4.48e-06      0.074066 6
#> SD:pam      113         8.12e-16 0.06685 1.00e-10      0.267430 6
#> CV:pam      110         3.48e-15 0.12676 2.71e-11      0.257196 6
#> MAD:pam     116         1.37e-14 0.00521 3.52e-09      0.108328 6
#> ATC:pam     115         8.39e-07 0.00311 1.29e-04      0.000371 6
#> SD:hclust    90         6.11e-13 0.14151 4.47e-11      0.558449 6
#> CV:hclust    88         1.09e-12 0.13380 1.29e-11      0.493639 6
#> MAD:hclust  114         3.82e-16 0.11265 2.06e-12      0.503893 6
#> ATC:hclust   74         2.90e-06 0.03415 3.43e-04      0.077764 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 51941 rows and 120 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 5.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-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.154           0.483       0.729         0.4219 0.564   0.564
#> 3 3 0.361           0.622       0.759         0.3982 0.689   0.502
#> 4 4 0.587           0.567       0.780         0.1580 0.840   0.621
#> 5 5 0.656           0.697       0.782         0.1066 0.849   0.554
#> 6 6 0.681           0.640       0.755         0.0333 0.955   0.803

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

suggest_best_k(res)
#> [1] 5

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM494565     2  0.9988     0.0486 0.480 0.520
#> GSM494594     2  0.0000     0.7090 0.000 1.000
#> GSM494604     1  0.5178     0.5707 0.884 0.116
#> GSM494564     2  0.6973     0.7241 0.188 0.812
#> GSM494591     2  0.0000     0.7090 0.000 1.000
#> GSM494567     2  0.6247     0.7355 0.156 0.844
#> GSM494602     1  0.5294     0.5636 0.880 0.120
#> GSM494613     2  0.5519     0.7457 0.128 0.872
#> GSM494589     2  0.6973     0.7241 0.188 0.812
#> GSM494598     1  0.5408     0.5646 0.876 0.124
#> GSM494593     1  0.5178     0.5707 0.884 0.116
#> GSM494583     1  0.9944     0.2051 0.544 0.456
#> GSM494612     1  0.5059     0.5605 0.888 0.112
#> GSM494558     2  0.9552     0.1056 0.376 0.624
#> GSM494556     2  0.5519     0.7457 0.128 0.872
#> GSM494559     2  0.6148     0.7452 0.152 0.848
#> GSM494571     2  0.0000     0.7090 0.000 1.000
#> GSM494614     2  0.5519     0.7457 0.128 0.872
#> GSM494603     2  0.9977    -0.1885 0.472 0.528
#> GSM494568     2  0.9977    -0.1885 0.472 0.528
#> GSM494572     2  0.0000     0.7090 0.000 1.000
#> GSM494600     2  0.6973     0.7241 0.188 0.812
#> GSM494562     1  0.5408     0.5646 0.876 0.124
#> GSM494615     2  0.5519     0.7457 0.128 0.872
#> GSM494582     1  0.5059     0.5605 0.888 0.112
#> GSM494599     1  0.5178     0.5707 0.884 0.116
#> GSM494610     1  0.5408     0.5646 0.876 0.124
#> GSM494587     1  0.9427     0.4045 0.640 0.360
#> GSM494581     1  0.9795     0.2997 0.584 0.416
#> GSM494580     2  0.6247     0.7355 0.156 0.844
#> GSM494563     2  0.9358     0.4672 0.352 0.648
#> GSM494576     1  0.8909     0.4666 0.692 0.308
#> GSM494605     1  0.7950     0.5542 0.760 0.240
#> GSM494584     2  0.7056     0.7108 0.192 0.808
#> GSM494586     1  0.6048     0.5586 0.852 0.148
#> GSM494578     2  0.6247     0.7355 0.156 0.844
#> GSM494585     1  0.9209     0.4357 0.664 0.336
#> GSM494611     1  0.5059     0.5605 0.888 0.112
#> GSM494560     2  0.6973     0.7241 0.188 0.812
#> GSM494595     1  0.7745     0.5322 0.772 0.228
#> GSM494570     2  0.7056     0.7192 0.192 0.808
#> GSM494597     2  0.5737     0.6931 0.136 0.864
#> GSM494607     1  0.5178     0.5707 0.884 0.116
#> GSM494561     2  0.6247     0.7443 0.156 0.844
#> GSM494569     1  0.9988     0.2834 0.520 0.480
#> GSM494592     1  0.5178     0.5707 0.884 0.116
#> GSM494577     1  0.9323     0.4150 0.652 0.348
#> GSM494588     2  0.6973     0.7241 0.188 0.812
#> GSM494590     2  0.0000     0.7090 0.000 1.000
#> GSM494609     1  0.9795     0.2997 0.584 0.416
#> GSM494608     1  1.0000     0.0250 0.504 0.496
#> GSM494606     1  0.5178     0.5707 0.884 0.116
#> GSM494574     1  0.5408     0.5646 0.876 0.124
#> GSM494573     2  0.6973     0.7241 0.188 0.812
#> GSM494566     1  0.9686     0.3591 0.604 0.396
#> GSM494601     1  0.8555     0.4744 0.720 0.280
#> GSM494557     2  0.5519     0.7457 0.128 0.872
#> GSM494579     1  0.9248     0.4384 0.660 0.340
#> GSM494596     2  0.0000     0.7090 0.000 1.000
#> GSM494575     1  0.5059     0.5605 0.888 0.112
#> GSM494625     1  0.9983     0.2946 0.524 0.476
#> GSM494654     2  0.0376     0.7075 0.004 0.996
#> GSM494664     1  0.7950     0.5542 0.760 0.240
#> GSM494624     1  0.9983     0.2946 0.524 0.476
#> GSM494651     1  0.9983     0.2946 0.524 0.476
#> GSM494662     1  0.9970     0.3072 0.532 0.468
#> GSM494627     2  0.9998    -0.2422 0.492 0.508
#> GSM494673     1  0.0000     0.6022 1.000 0.000
#> GSM494649     1  0.9983     0.2946 0.524 0.476
#> GSM494658     1  0.0000     0.6022 1.000 0.000
#> GSM494653     1  0.0000     0.6022 1.000 0.000
#> GSM494643     1  0.9983     0.2946 0.524 0.476
#> GSM494672     1  0.0000     0.6022 1.000 0.000
#> GSM494618     1  0.9983     0.2946 0.524 0.476
#> GSM494631     2  0.9087     0.4588 0.324 0.676
#> GSM494619     1  0.9983     0.2946 0.524 0.476
#> GSM494674     1  0.0000     0.6022 1.000 0.000
#> GSM494616     1  0.9983     0.2946 0.524 0.476
#> GSM494663     2  0.9998    -0.2422 0.492 0.508
#> GSM494628     1  1.0000     0.2430 0.504 0.496
#> GSM494632     1  0.9427     0.4446 0.640 0.360
#> GSM494660     1  0.9983     0.2946 0.524 0.476
#> GSM494622     2  1.0000    -0.2548 0.496 0.504
#> GSM494642     1  0.0000     0.6022 1.000 0.000
#> GSM494647     1  0.0000     0.6022 1.000 0.000
#> GSM494659     1  0.0000     0.6022 1.000 0.000
#> GSM494670     1  0.0000     0.6022 1.000 0.000
#> GSM494675     2  0.5737     0.6931 0.136 0.864
#> GSM494641     1  0.0000     0.6022 1.000 0.000
#> GSM494636     1  0.9881     0.3527 0.564 0.436
#> GSM494640     1  0.9983     0.2946 0.524 0.476
#> GSM494623     1  0.9983     0.2946 0.524 0.476
#> GSM494644     1  0.7950     0.5542 0.760 0.240
#> GSM494646     1  0.7950     0.5542 0.760 0.240
#> GSM494665     1  0.7950     0.5542 0.760 0.240
#> GSM494638     1  0.9933     0.3302 0.548 0.452
#> GSM494645     1  0.7950     0.5542 0.760 0.240
#> GSM494671     1  0.0000     0.6022 1.000 0.000
#> GSM494655     1  0.0000     0.6022 1.000 0.000
#> GSM494620     1  0.9983     0.2946 0.524 0.476
#> GSM494630     1  0.9983     0.2946 0.524 0.476
#> GSM494657     2  0.0000     0.7090 0.000 1.000
#> GSM494667     1  0.0000     0.6022 1.000 0.000
#> GSM494621     1  0.9983     0.2946 0.524 0.476
#> GSM494629     1  0.9988     0.2834 0.520 0.480
#> GSM494637     1  0.9983     0.2946 0.524 0.476
#> GSM494652     1  0.0000     0.6022 1.000 0.000
#> GSM494648     1  0.9983     0.2946 0.524 0.476
#> GSM494650     1  0.9998     0.2601 0.508 0.492
#> GSM494669     1  0.0000     0.6022 1.000 0.000
#> GSM494666     1  0.7950     0.5542 0.760 0.240
#> GSM494668     1  0.0000     0.6022 1.000 0.000
#> GSM494633     1  0.9983     0.2946 0.524 0.476
#> GSM494634     1  0.0000     0.6022 1.000 0.000
#> GSM494639     1  0.9881     0.3527 0.564 0.436
#> GSM494661     1  0.7950     0.5542 0.760 0.240
#> GSM494617     1  0.9983     0.2946 0.524 0.476
#> GSM494626     1  0.9983     0.2946 0.524 0.476
#> GSM494656     2  0.0376     0.7075 0.004 0.996
#> GSM494635     1  0.7950     0.5542 0.760 0.240

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM494565     2  0.9136     0.2229 0.264 0.540 0.196
#> GSM494594     3  0.1529     0.5704 0.040 0.000 0.960
#> GSM494604     2  0.3500     0.7100 0.116 0.880 0.004
#> GSM494564     3  0.9719     0.6458 0.360 0.224 0.416
#> GSM494591     3  0.1529     0.5704 0.040 0.000 0.960
#> GSM494567     3  0.9090     0.6984 0.332 0.156 0.512
#> GSM494602     2  0.1411     0.7603 0.036 0.964 0.000
#> GSM494613     3  0.8798     0.7095 0.356 0.124 0.520
#> GSM494589     3  0.9719     0.6458 0.360 0.224 0.416
#> GSM494598     2  0.1411     0.7567 0.000 0.964 0.036
#> GSM494593     2  0.1989     0.7595 0.048 0.948 0.004
#> GSM494583     2  0.8300     0.4334 0.244 0.620 0.136
#> GSM494612     2  0.0424     0.7557 0.000 0.992 0.008
#> GSM494558     1  0.4235     0.4840 0.824 0.000 0.176
#> GSM494556     3  0.8798     0.7095 0.356 0.124 0.520
#> GSM494559     3  0.8957     0.6967 0.376 0.132 0.492
#> GSM494571     3  0.1529     0.5704 0.040 0.000 0.960
#> GSM494614     3  0.8798     0.7095 0.356 0.124 0.520
#> GSM494603     1  0.2448     0.6609 0.924 0.000 0.076
#> GSM494568     1  0.2448     0.6609 0.924 0.000 0.076
#> GSM494572     3  0.1529     0.5704 0.040 0.000 0.960
#> GSM494600     3  0.9719     0.6458 0.360 0.224 0.416
#> GSM494562     2  0.1411     0.7567 0.000 0.964 0.036
#> GSM494615     3  0.8798     0.7095 0.356 0.124 0.520
#> GSM494582     2  0.0424     0.7557 0.000 0.992 0.008
#> GSM494599     2  0.1989     0.7595 0.048 0.948 0.004
#> GSM494610     2  0.1411     0.7567 0.000 0.964 0.036
#> GSM494587     2  0.6962     0.6129 0.184 0.724 0.092
#> GSM494581     2  0.7906     0.5243 0.220 0.656 0.124
#> GSM494580     3  0.9090     0.6984 0.332 0.156 0.512
#> GSM494563     2  0.9924    -0.3168 0.320 0.392 0.288
#> GSM494576     2  0.6007     0.6489 0.184 0.768 0.048
#> GSM494605     1  0.4974     0.6631 0.764 0.236 0.000
#> GSM494584     3  0.9465     0.6631 0.332 0.196 0.472
#> GSM494586     2  0.1919     0.7598 0.020 0.956 0.024
#> GSM494578     3  0.9090     0.6984 0.332 0.156 0.512
#> GSM494585     2  0.6737     0.6406 0.156 0.744 0.100
#> GSM494611     2  0.0424     0.7557 0.000 0.992 0.008
#> GSM494560     3  0.9719     0.6458 0.360 0.224 0.416
#> GSM494595     2  0.3826     0.7281 0.124 0.868 0.008
#> GSM494570     3  0.9724     0.6417 0.364 0.224 0.412
#> GSM494597     3  0.8043     0.6054 0.228 0.128 0.644
#> GSM494607     2  0.3500     0.7100 0.116 0.880 0.004
#> GSM494561     3  0.8967     0.6933 0.380 0.132 0.488
#> GSM494569     1  0.0237     0.7221 0.996 0.000 0.004
#> GSM494592     2  0.1989     0.7595 0.048 0.948 0.004
#> GSM494577     2  0.6541     0.6026 0.212 0.732 0.056
#> GSM494588     3  0.9719     0.6458 0.360 0.224 0.416
#> GSM494590     3  0.1529     0.5704 0.040 0.000 0.960
#> GSM494609     2  0.7906     0.5243 0.220 0.656 0.124
#> GSM494608     2  0.9537     0.2059 0.256 0.488 0.256
#> GSM494606     2  0.1989     0.7595 0.048 0.948 0.004
#> GSM494574     2  0.1411     0.7567 0.000 0.964 0.036
#> GSM494573     3  0.9719     0.6458 0.360 0.224 0.416
#> GSM494566     2  0.8293     0.4963 0.272 0.608 0.120
#> GSM494601     2  0.6012     0.6867 0.088 0.788 0.124
#> GSM494557     3  0.8798     0.7095 0.356 0.124 0.520
#> GSM494579     2  0.7677     0.5837 0.244 0.660 0.096
#> GSM494596     3  0.1529     0.5704 0.040 0.000 0.960
#> GSM494575     2  0.0424     0.7557 0.000 0.992 0.008
#> GSM494625     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494654     3  0.1753     0.5683 0.048 0.000 0.952
#> GSM494664     1  0.4974     0.6631 0.764 0.236 0.000
#> GSM494624     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494651     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494662     1  0.0424     0.7263 0.992 0.008 0.000
#> GSM494627     1  0.1964     0.6858 0.944 0.000 0.056
#> GSM494673     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494649     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494658     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494653     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494643     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494672     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494618     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494631     1  0.7557    -0.0221 0.656 0.080 0.264
#> GSM494619     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494674     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494616     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494663     1  0.1964     0.6858 0.944 0.000 0.056
#> GSM494628     1  0.1163     0.7056 0.972 0.000 0.028
#> GSM494632     1  0.3267     0.7153 0.884 0.116 0.000
#> GSM494660     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494622     1  0.1753     0.6928 0.952 0.000 0.048
#> GSM494642     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494647     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494659     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494670     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494675     3  0.8043     0.6054 0.228 0.128 0.644
#> GSM494641     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494636     1  0.1529     0.7256 0.960 0.040 0.000
#> GSM494640     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494623     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494644     1  0.4974     0.6631 0.764 0.236 0.000
#> GSM494646     1  0.4974     0.6631 0.764 0.236 0.000
#> GSM494665     1  0.4974     0.6631 0.764 0.236 0.000
#> GSM494638     1  0.1031     0.7267 0.976 0.024 0.000
#> GSM494645     1  0.4974     0.6631 0.764 0.236 0.000
#> GSM494671     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494655     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494620     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494630     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494657     3  0.1529     0.5704 0.040 0.000 0.960
#> GSM494667     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494621     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494629     1  0.0237     0.7221 0.996 0.000 0.004
#> GSM494637     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494652     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494648     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494650     1  0.0747     0.7129 0.984 0.000 0.016
#> GSM494669     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494666     1  0.4974     0.6631 0.764 0.236 0.000
#> GSM494668     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494633     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494634     1  0.6669     0.4312 0.524 0.468 0.008
#> GSM494639     1  0.1529     0.7256 0.960 0.040 0.000
#> GSM494661     1  0.4974     0.6631 0.764 0.236 0.000
#> GSM494617     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494626     1  0.0000     0.7253 1.000 0.000 0.000
#> GSM494656     3  0.1753     0.5683 0.048 0.000 0.952
#> GSM494635     1  0.4974     0.6631 0.764 0.236 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     3  0.7382     0.3697 0.120 0.308 0.552 0.020
#> GSM494594     1  0.3668     0.9785 0.808 0.000 0.188 0.004
#> GSM494604     2  0.3477     0.6055 0.008 0.872 0.032 0.088
#> GSM494564     3  0.0895     0.7541 0.000 0.004 0.976 0.020
#> GSM494591     1  0.3688     0.9793 0.792 0.000 0.208 0.000
#> GSM494567     3  0.3965     0.7412 0.120 0.032 0.840 0.008
#> GSM494602     2  0.1516     0.6167 0.008 0.960 0.016 0.016
#> GSM494613     3  0.3278     0.7441 0.116 0.000 0.864 0.020
#> GSM494589     3  0.0895     0.7541 0.000 0.004 0.976 0.020
#> GSM494598     2  0.4123     0.5856 0.136 0.820 0.044 0.000
#> GSM494593     2  0.1624     0.6173 0.000 0.952 0.028 0.020
#> GSM494583     3  0.6425     0.1632 0.056 0.436 0.504 0.004
#> GSM494612     2  0.2521     0.6045 0.064 0.912 0.024 0.000
#> GSM494558     4  0.4565     0.6336 0.140 0.000 0.064 0.796
#> GSM494556     3  0.3335     0.7414 0.120 0.000 0.860 0.020
#> GSM494559     3  0.3107     0.7544 0.080 0.000 0.884 0.036
#> GSM494571     1  0.3528     0.9807 0.808 0.000 0.192 0.000
#> GSM494614     3  0.3278     0.7441 0.116 0.000 0.864 0.020
#> GSM494603     4  0.2871     0.7481 0.072 0.000 0.032 0.896
#> GSM494568     4  0.2871     0.7481 0.072 0.000 0.032 0.896
#> GSM494572     1  0.3649     0.9839 0.796 0.000 0.204 0.000
#> GSM494600     3  0.0895     0.7541 0.000 0.004 0.976 0.020
#> GSM494562     2  0.4123     0.5856 0.136 0.820 0.044 0.000
#> GSM494615     3  0.3278     0.7441 0.116 0.000 0.864 0.020
#> GSM494582     2  0.2596     0.6029 0.068 0.908 0.024 0.000
#> GSM494599     2  0.1624     0.6173 0.000 0.952 0.028 0.020
#> GSM494610     2  0.4123     0.5856 0.136 0.820 0.044 0.000
#> GSM494587     2  0.4995     0.2759 0.004 0.648 0.344 0.004
#> GSM494581     2  0.5355     0.0991 0.004 0.580 0.408 0.008
#> GSM494580     3  0.3965     0.7412 0.120 0.032 0.840 0.008
#> GSM494563     3  0.5188     0.6089 0.148 0.056 0.776 0.020
#> GSM494576     2  0.7008     0.2583 0.136 0.572 0.288 0.004
#> GSM494605     4  0.4516     0.6171 0.012 0.252 0.000 0.736
#> GSM494584     3  0.4599     0.7263 0.108 0.072 0.812 0.008
#> GSM494586     2  0.4834     0.5578 0.120 0.784 0.096 0.000
#> GSM494578     3  0.3965     0.7412 0.120 0.032 0.840 0.008
#> GSM494585     2  0.5033     0.3180 0.008 0.664 0.324 0.004
#> GSM494611     2  0.2521     0.6045 0.064 0.912 0.024 0.000
#> GSM494560     3  0.0895     0.7541 0.000 0.004 0.976 0.020
#> GSM494595     2  0.5590     0.3995 0.064 0.692 0.244 0.000
#> GSM494570     3  0.1004     0.7525 0.000 0.004 0.972 0.024
#> GSM494597     3  0.6103     0.2139 0.452 0.020 0.512 0.016
#> GSM494607     2  0.3477     0.6055 0.008 0.872 0.032 0.088
#> GSM494561     3  0.3198     0.7527 0.080 0.000 0.880 0.040
#> GSM494569     4  0.0927     0.7988 0.008 0.000 0.016 0.976
#> GSM494592     2  0.1624     0.6173 0.000 0.952 0.028 0.020
#> GSM494577     2  0.7324     0.0502 0.140 0.488 0.368 0.004
#> GSM494588     3  0.0895     0.7541 0.000 0.004 0.976 0.020
#> GSM494590     1  0.3649     0.9839 0.796 0.000 0.204 0.000
#> GSM494609     2  0.5355     0.0991 0.004 0.580 0.408 0.008
#> GSM494608     3  0.7638     0.1937 0.084 0.416 0.460 0.040
#> GSM494606     2  0.1624     0.6173 0.000 0.952 0.028 0.020
#> GSM494574     2  0.4123     0.5856 0.136 0.820 0.044 0.000
#> GSM494573     3  0.0895     0.7541 0.000 0.004 0.976 0.020
#> GSM494566     2  0.6849     0.2100 0.016 0.540 0.376 0.068
#> GSM494601     2  0.4431     0.4503 0.004 0.740 0.252 0.004
#> GSM494557     3  0.3278     0.7441 0.116 0.000 0.864 0.020
#> GSM494579     2  0.8368     0.2692 0.128 0.488 0.316 0.068
#> GSM494596     1  0.3649     0.9839 0.796 0.000 0.204 0.000
#> GSM494575     2  0.2521     0.6045 0.064 0.912 0.024 0.000
#> GSM494625     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494654     1  0.3768     0.9716 0.808 0.000 0.184 0.008
#> GSM494664     4  0.4516     0.6171 0.012 0.252 0.000 0.736
#> GSM494624     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494651     4  0.0804     0.7998 0.008 0.000 0.012 0.980
#> GSM494662     4  0.0524     0.7983 0.000 0.008 0.004 0.988
#> GSM494627     4  0.2443     0.7665 0.060 0.000 0.024 0.916
#> GSM494673     4  0.5862     0.1082 0.032 0.484 0.000 0.484
#> GSM494649     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494658     4  0.5862     0.1082 0.032 0.484 0.000 0.484
#> GSM494653     4  0.5862     0.1082 0.032 0.484 0.000 0.484
#> GSM494643     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494672     2  0.5862    -0.1507 0.032 0.484 0.000 0.484
#> GSM494618     4  0.0804     0.7998 0.008 0.000 0.012 0.980
#> GSM494631     3  0.6948     0.1870 0.096 0.004 0.484 0.416
#> GSM494619     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494674     4  0.5862     0.1082 0.032 0.484 0.000 0.484
#> GSM494616     4  0.0804     0.7998 0.008 0.000 0.012 0.980
#> GSM494663     4  0.2443     0.7665 0.060 0.000 0.024 0.916
#> GSM494628     4  0.1610     0.7866 0.032 0.000 0.016 0.952
#> GSM494632     4  0.3196     0.7237 0.008 0.136 0.000 0.856
#> GSM494660     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494622     4  0.2174     0.7737 0.052 0.000 0.020 0.928
#> GSM494642     4  0.5862     0.1082 0.032 0.484 0.000 0.484
#> GSM494647     4  0.5862     0.1082 0.032 0.484 0.000 0.484
#> GSM494659     2  0.5862    -0.1507 0.032 0.484 0.000 0.484
#> GSM494670     2  0.5862    -0.1507 0.032 0.484 0.000 0.484
#> GSM494675     3  0.6103     0.2139 0.452 0.020 0.512 0.016
#> GSM494641     2  0.5862    -0.1507 0.032 0.484 0.000 0.484
#> GSM494636     4  0.1824     0.7742 0.004 0.060 0.000 0.936
#> GSM494640     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494623     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494644     4  0.4516     0.6171 0.012 0.252 0.000 0.736
#> GSM494646     4  0.4516     0.6171 0.012 0.252 0.000 0.736
#> GSM494665     4  0.4516     0.6171 0.012 0.252 0.000 0.736
#> GSM494638     4  0.1305     0.7854 0.004 0.036 0.000 0.960
#> GSM494645     4  0.4516     0.6171 0.012 0.252 0.000 0.736
#> GSM494671     4  0.5862     0.1082 0.032 0.484 0.000 0.484
#> GSM494655     4  0.5862     0.1082 0.032 0.484 0.000 0.484
#> GSM494620     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494630     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494657     1  0.3649     0.9839 0.796 0.000 0.204 0.000
#> GSM494667     2  0.5862    -0.1507 0.032 0.484 0.000 0.484
#> GSM494621     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494629     4  0.0779     0.8000 0.004 0.000 0.016 0.980
#> GSM494637     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494652     2  0.5862    -0.1507 0.032 0.484 0.000 0.484
#> GSM494648     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494650     4  0.1297     0.7919 0.020 0.000 0.016 0.964
#> GSM494669     2  0.5862    -0.1507 0.032 0.484 0.000 0.484
#> GSM494666     4  0.4516     0.6171 0.012 0.252 0.000 0.736
#> GSM494668     2  0.5862    -0.1507 0.032 0.484 0.000 0.484
#> GSM494633     4  0.0469     0.8020 0.000 0.000 0.012 0.988
#> GSM494634     2  0.5862    -0.1507 0.032 0.484 0.000 0.484
#> GSM494639     4  0.1824     0.7742 0.004 0.060 0.000 0.936
#> GSM494661     4  0.4516     0.6171 0.012 0.252 0.000 0.736
#> GSM494617     4  0.0804     0.7998 0.008 0.000 0.012 0.980
#> GSM494626     4  0.0804     0.7998 0.008 0.000 0.012 0.980
#> GSM494656     1  0.3768     0.9716 0.808 0.000 0.184 0.008
#> GSM494635     4  0.4516     0.6171 0.012 0.252 0.000 0.736

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     5  0.5514     0.0719 0.008 0.420 0.048 0.000 0.524
#> GSM494594     3  0.4222     0.9533 0.028 0.016 0.792 0.008 0.156
#> GSM494604     1  0.4974    -0.1731 0.560 0.408 0.000 0.000 0.032
#> GSM494564     5  0.0566     0.7737 0.012 0.004 0.000 0.000 0.984
#> GSM494591     3  0.2732     0.9679 0.000 0.000 0.840 0.000 0.160
#> GSM494567     5  0.3892     0.7635 0.016 0.040 0.116 0.004 0.824
#> GSM494602     2  0.4048     0.7131 0.196 0.772 0.016 0.000 0.016
#> GSM494613     5  0.2972     0.7712 0.004 0.024 0.108 0.000 0.864
#> GSM494589     5  0.0566     0.7737 0.012 0.004 0.000 0.000 0.984
#> GSM494598     2  0.2872     0.7180 0.060 0.884 0.048 0.000 0.008
#> GSM494593     2  0.3929     0.7105 0.208 0.764 0.000 0.000 0.028
#> GSM494583     2  0.5831     0.1931 0.024 0.472 0.044 0.000 0.460
#> GSM494612     2  0.3346     0.7086 0.064 0.844 0.092 0.000 0.000
#> GSM494558     4  0.4274     0.6770 0.024 0.016 0.084 0.820 0.056
#> GSM494556     5  0.2915     0.7670 0.000 0.024 0.116 0.000 0.860
#> GSM494559     5  0.2434     0.7781 0.012 0.004 0.064 0.012 0.908
#> GSM494571     3  0.3170     0.9672 0.008 0.000 0.828 0.004 0.160
#> GSM494614     5  0.2972     0.7712 0.004 0.024 0.108 0.000 0.864
#> GSM494603     4  0.2569     0.8112 0.032 0.016 0.012 0.912 0.028
#> GSM494568     4  0.2569     0.8112 0.032 0.016 0.012 0.912 0.028
#> GSM494572     3  0.2690     0.9712 0.000 0.000 0.844 0.000 0.156
#> GSM494600     5  0.0566     0.7737 0.012 0.004 0.000 0.000 0.984
#> GSM494562     2  0.2872     0.7180 0.060 0.884 0.048 0.000 0.008
#> GSM494615     5  0.2972     0.7712 0.004 0.024 0.108 0.000 0.864
#> GSM494582     2  0.4121     0.6887 0.112 0.788 0.100 0.000 0.000
#> GSM494599     2  0.3929     0.7105 0.208 0.764 0.000 0.000 0.028
#> GSM494610     2  0.2872     0.7180 0.060 0.884 0.048 0.000 0.008
#> GSM494587     2  0.5036     0.5621 0.040 0.648 0.008 0.000 0.304
#> GSM494581     2  0.5632     0.4248 0.080 0.528 0.000 0.000 0.392
#> GSM494580     5  0.3892     0.7635 0.016 0.040 0.116 0.004 0.824
#> GSM494563     5  0.4533     0.5981 0.020 0.148 0.060 0.000 0.772
#> GSM494576     2  0.5544     0.5691 0.040 0.664 0.048 0.000 0.248
#> GSM494605     1  0.4192     0.5583 0.596 0.000 0.000 0.404 0.000
#> GSM494584     5  0.4431     0.7468 0.020 0.076 0.104 0.004 0.796
#> GSM494586     2  0.4280     0.7151 0.056 0.812 0.072 0.000 0.060
#> GSM494578     5  0.3892     0.7635 0.016 0.040 0.116 0.004 0.824
#> GSM494585     2  0.5015     0.5771 0.048 0.652 0.004 0.000 0.296
#> GSM494611     2  0.3346     0.7086 0.064 0.844 0.092 0.000 0.000
#> GSM494560     5  0.0566     0.7737 0.012 0.004 0.000 0.000 0.984
#> GSM494595     2  0.6206     0.6058 0.064 0.648 0.096 0.000 0.192
#> GSM494570     5  0.0727     0.7721 0.012 0.004 0.000 0.004 0.980
#> GSM494597     5  0.6077     0.1281 0.012 0.084 0.432 0.000 0.472
#> GSM494607     1  0.4974    -0.1731 0.560 0.408 0.000 0.000 0.032
#> GSM494561     5  0.2538     0.7774 0.012 0.004 0.064 0.016 0.904
#> GSM494569     4  0.1041     0.8729 0.032 0.000 0.000 0.964 0.004
#> GSM494592     2  0.3929     0.7105 0.208 0.764 0.000 0.000 0.028
#> GSM494577     2  0.5777     0.4385 0.028 0.592 0.052 0.000 0.328
#> GSM494588     5  0.0566     0.7737 0.012 0.004 0.000 0.000 0.984
#> GSM494590     3  0.2690     0.9712 0.000 0.000 0.844 0.000 0.156
#> GSM494609     2  0.5632     0.4248 0.080 0.528 0.000 0.000 0.392
#> GSM494608     5  0.7566    -0.0702 0.084 0.368 0.068 0.028 0.452
#> GSM494606     2  0.3929     0.7105 0.208 0.764 0.000 0.000 0.028
#> GSM494574     2  0.2872     0.7180 0.060 0.884 0.048 0.000 0.008
#> GSM494573     5  0.0566     0.7737 0.012 0.004 0.000 0.000 0.984
#> GSM494566     2  0.7011     0.2705 0.272 0.364 0.008 0.000 0.356
#> GSM494601     2  0.5578     0.6343 0.104 0.648 0.008 0.000 0.240
#> GSM494557     5  0.2972     0.7712 0.004 0.024 0.108 0.000 0.864
#> GSM494579     2  0.7576     0.3267 0.260 0.408 0.048 0.000 0.284
#> GSM494596     3  0.2690     0.9712 0.000 0.000 0.844 0.000 0.156
#> GSM494575     2  0.3346     0.7086 0.064 0.844 0.092 0.000 0.000
#> GSM494625     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494654     3  0.4390     0.9481 0.028 0.016 0.788 0.016 0.152
#> GSM494664     1  0.4192     0.5583 0.596 0.000 0.000 0.404 0.000
#> GSM494624     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494651     4  0.0404     0.8698 0.012 0.000 0.000 0.988 0.000
#> GSM494662     4  0.2773     0.7576 0.164 0.000 0.000 0.836 0.000
#> GSM494627     4  0.2073     0.8316 0.032 0.016 0.008 0.932 0.012
#> GSM494673     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494649     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494658     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494653     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494643     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494672     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494618     4  0.0404     0.8698 0.012 0.000 0.000 0.988 0.000
#> GSM494631     5  0.6492     0.1976 0.016 0.020 0.068 0.420 0.476
#> GSM494619     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494674     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494616     4  0.0404     0.8698 0.012 0.000 0.000 0.988 0.000
#> GSM494663     4  0.2073     0.8316 0.032 0.016 0.008 0.932 0.012
#> GSM494628     4  0.1121     0.8550 0.016 0.008 0.004 0.968 0.004
#> GSM494632     4  0.4287    -0.1360 0.460 0.000 0.000 0.540 0.000
#> GSM494660     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494622     4  0.1770     0.8399 0.028 0.012 0.008 0.944 0.008
#> GSM494642     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494647     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494659     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494670     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494675     5  0.6077     0.1281 0.012 0.084 0.432 0.000 0.472
#> GSM494641     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494636     4  0.4126     0.2331 0.380 0.000 0.000 0.620 0.000
#> GSM494640     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494623     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494644     1  0.4201     0.5502 0.592 0.000 0.000 0.408 0.000
#> GSM494646     1  0.4201     0.5502 0.592 0.000 0.000 0.408 0.000
#> GSM494665     1  0.4192     0.5583 0.596 0.000 0.000 0.404 0.000
#> GSM494638     4  0.3837     0.4572 0.308 0.000 0.000 0.692 0.000
#> GSM494645     1  0.4201     0.5502 0.592 0.000 0.000 0.408 0.000
#> GSM494671     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494655     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494620     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494630     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494657     3  0.2690     0.9712 0.000 0.000 0.844 0.000 0.156
#> GSM494667     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494621     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494629     4  0.1571     0.8777 0.060 0.000 0.000 0.936 0.004
#> GSM494637     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494652     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494648     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494650     4  0.0671     0.8613 0.016 0.000 0.000 0.980 0.004
#> GSM494669     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494666     1  0.4192     0.5583 0.596 0.000 0.000 0.404 0.000
#> GSM494668     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494633     4  0.1478     0.8790 0.064 0.000 0.000 0.936 0.000
#> GSM494634     1  0.2536     0.8220 0.868 0.004 0.000 0.128 0.000
#> GSM494639     4  0.4126     0.2331 0.380 0.000 0.000 0.620 0.000
#> GSM494661     1  0.4192     0.5583 0.596 0.000 0.000 0.404 0.000
#> GSM494617     4  0.0404     0.8698 0.012 0.000 0.000 0.988 0.000
#> GSM494626     4  0.0404     0.8698 0.012 0.000 0.000 0.988 0.000
#> GSM494656     3  0.4390     0.9481 0.028 0.016 0.788 0.016 0.152
#> GSM494635     1  0.4201     0.5502 0.592 0.000 0.000 0.408 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
#> GSM494565     3  0.6032   -0.04146 0.000 0.288 0.424 0.000 0.288 0.000
#> GSM494594     6  0.2384    0.91521 0.004 0.000 0.032 0.016 0.044 0.904
#> GSM494604     1  0.4913   -0.13747 0.540 0.408 0.040 0.000 0.012 0.000
#> GSM494564     5  0.0458    0.88893 0.000 0.000 0.016 0.000 0.984 0.000
#> GSM494591     6  0.2201    0.94294 0.000 0.000 0.052 0.000 0.048 0.900
#> GSM494567     3  0.5328    0.49062 0.000 0.016 0.564 0.004 0.352 0.064
#> GSM494602     2  0.3461    0.68025 0.152 0.804 0.036 0.000 0.000 0.008
#> GSM494613     3  0.4648    0.45362 0.000 0.000 0.548 0.000 0.408 0.044
#> GSM494589     5  0.0000    0.89188 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494598     2  0.3197    0.66789 0.004 0.800 0.184 0.000 0.008 0.004
#> GSM494593     2  0.3464    0.67425 0.140 0.812 0.032 0.000 0.016 0.000
#> GSM494583     3  0.5784   -0.26111 0.000 0.404 0.420 0.000 0.176 0.000
#> GSM494612     2  0.1861    0.67569 0.036 0.928 0.016 0.000 0.000 0.020
#> GSM494558     4  0.3419    0.68408 0.000 0.000 0.072 0.828 0.012 0.088
#> GSM494556     3  0.4893    0.45740 0.000 0.000 0.536 0.000 0.400 0.064
#> GSM494559     5  0.2687    0.80073 0.000 0.000 0.072 0.008 0.876 0.044
#> GSM494571     6  0.2314    0.93703 0.000 0.000 0.036 0.008 0.056 0.900
#> GSM494614     3  0.4634    0.45648 0.000 0.000 0.556 0.000 0.400 0.044
#> GSM494603     4  0.1973    0.80192 0.004 0.000 0.036 0.924 0.008 0.028
#> GSM494568     4  0.1973    0.80192 0.004 0.000 0.036 0.924 0.008 0.028
#> GSM494572     6  0.2136    0.94617 0.000 0.000 0.048 0.000 0.048 0.904
#> GSM494600     5  0.0000    0.89188 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494562     2  0.3197    0.66789 0.004 0.800 0.184 0.000 0.008 0.004
#> GSM494615     3  0.4648    0.45362 0.000 0.000 0.548 0.000 0.408 0.044
#> GSM494582     2  0.3483    0.62886 0.088 0.832 0.044 0.000 0.000 0.036
#> GSM494599     2  0.3444    0.67419 0.140 0.812 0.036 0.000 0.012 0.000
#> GSM494610     2  0.3197    0.66789 0.004 0.800 0.184 0.000 0.008 0.004
#> GSM494587     2  0.5323    0.48839 0.012 0.632 0.204 0.000 0.152 0.000
#> GSM494581     2  0.6230    0.35862 0.036 0.532 0.232 0.000 0.200 0.000
#> GSM494580     3  0.5328    0.49062 0.000 0.016 0.564 0.004 0.352 0.064
#> GSM494563     5  0.3986    0.43341 0.000 0.020 0.316 0.000 0.664 0.000
#> GSM494576     2  0.5095    0.47841 0.004 0.508 0.428 0.000 0.056 0.004
#> GSM494605     1  0.3717    0.55381 0.616 0.000 0.000 0.384 0.000 0.000
#> GSM494584     3  0.5831    0.47241 0.000 0.056 0.540 0.004 0.344 0.056
#> GSM494586     2  0.3468    0.65712 0.004 0.784 0.192 0.000 0.012 0.008
#> GSM494578     3  0.5328    0.49062 0.000 0.016 0.564 0.004 0.352 0.064
#> GSM494585     2  0.5198    0.51013 0.012 0.652 0.168 0.000 0.168 0.000
#> GSM494611     2  0.1861    0.67569 0.036 0.928 0.016 0.000 0.000 0.020
#> GSM494560     5  0.0000    0.89188 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494595     2  0.6235    0.49832 0.084 0.608 0.220 0.000 0.052 0.036
#> GSM494570     5  0.0692    0.88638 0.000 0.000 0.020 0.004 0.976 0.000
#> GSM494597     3  0.5731   -0.14794 0.000 0.004 0.508 0.004 0.136 0.348
#> GSM494607     1  0.4913   -0.13747 0.540 0.408 0.040 0.000 0.012 0.000
#> GSM494561     5  0.2787    0.79769 0.000 0.000 0.072 0.012 0.872 0.044
#> GSM494569     4  0.1010    0.85635 0.036 0.000 0.000 0.960 0.000 0.004
#> GSM494592     2  0.3444    0.67419 0.140 0.812 0.036 0.000 0.012 0.000
#> GSM494577     3  0.5108   -0.42636 0.000 0.436 0.484 0.000 0.080 0.000
#> GSM494588     5  0.0547    0.88736 0.000 0.000 0.020 0.000 0.980 0.000
#> GSM494590     6  0.2136    0.94617 0.000 0.000 0.048 0.000 0.048 0.904
#> GSM494609     2  0.6230    0.35862 0.036 0.532 0.232 0.000 0.200 0.000
#> GSM494608     2  0.7836    0.00992 0.036 0.368 0.324 0.024 0.204 0.044
#> GSM494606     2  0.3464    0.67425 0.140 0.812 0.032 0.000 0.016 0.000
#> GSM494574     2  0.3197    0.66789 0.004 0.800 0.184 0.000 0.008 0.004
#> GSM494573     5  0.0000    0.89188 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494566     2  0.7586    0.10825 0.248 0.348 0.196 0.000 0.208 0.000
#> GSM494601     2  0.5399    0.56952 0.052 0.672 0.136 0.000 0.140 0.000
#> GSM494557     3  0.4648    0.45362 0.000 0.000 0.548 0.000 0.408 0.044
#> GSM494579     3  0.7508   -0.21121 0.236 0.296 0.324 0.000 0.144 0.000
#> GSM494596     6  0.2136    0.94617 0.000 0.000 0.048 0.000 0.048 0.904
#> GSM494575     2  0.1861    0.67569 0.036 0.928 0.016 0.000 0.000 0.020
#> GSM494625     4  0.1757    0.86089 0.076 0.000 0.008 0.916 0.000 0.000
#> GSM494654     6  0.2554    0.90815 0.004 0.000 0.032 0.024 0.044 0.896
#> GSM494664     1  0.3717    0.55381 0.616 0.000 0.000 0.384 0.000 0.000
#> GSM494624     4  0.1757    0.86089 0.076 0.000 0.008 0.916 0.000 0.000
#> GSM494651     4  0.0632    0.85352 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM494662     4  0.2882    0.74241 0.180 0.000 0.008 0.812 0.000 0.000
#> GSM494627     4  0.1485    0.81894 0.004 0.000 0.028 0.944 0.000 0.024
#> GSM494673     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494649     4  0.1812    0.85995 0.080 0.000 0.008 0.912 0.000 0.000
#> GSM494658     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494653     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494643     4  0.1812    0.85995 0.080 0.000 0.008 0.912 0.000 0.000
#> GSM494672     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494618     4  0.0632    0.85352 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM494631     4  0.7117   -0.15018 0.004 0.000 0.300 0.424 0.180 0.092
#> GSM494619     4  0.1757    0.86089 0.076 0.000 0.008 0.916 0.000 0.000
#> GSM494674     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494616     4  0.0632    0.85352 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM494663     4  0.1485    0.81894 0.004 0.000 0.028 0.944 0.000 0.024
#> GSM494628     4  0.1086    0.83953 0.012 0.000 0.012 0.964 0.000 0.012
#> GSM494632     4  0.3862   -0.12843 0.476 0.000 0.000 0.524 0.000 0.000
#> GSM494660     4  0.1812    0.85995 0.080 0.000 0.008 0.912 0.000 0.000
#> GSM494622     4  0.1434    0.82666 0.008 0.000 0.024 0.948 0.000 0.020
#> GSM494642     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494647     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494659     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494670     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494675     3  0.5731   -0.14794 0.000 0.004 0.508 0.004 0.136 0.348
#> GSM494641     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494636     4  0.3747    0.23059 0.396 0.000 0.000 0.604 0.000 0.000
#> GSM494640     4  0.1812    0.85995 0.080 0.000 0.008 0.912 0.000 0.000
#> GSM494623     4  0.1757    0.86089 0.076 0.000 0.008 0.916 0.000 0.000
#> GSM494644     1  0.3737    0.53829 0.608 0.000 0.000 0.392 0.000 0.000
#> GSM494646     1  0.3737    0.53829 0.608 0.000 0.000 0.392 0.000 0.000
#> GSM494665     1  0.3717    0.55381 0.616 0.000 0.000 0.384 0.000 0.000
#> GSM494638     4  0.3515    0.44754 0.324 0.000 0.000 0.676 0.000 0.000
#> GSM494645     1  0.3737    0.53829 0.608 0.000 0.000 0.392 0.000 0.000
#> GSM494671     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494655     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494620     4  0.1757    0.86089 0.076 0.000 0.008 0.916 0.000 0.000
#> GSM494630     4  0.1812    0.85995 0.080 0.000 0.008 0.912 0.000 0.000
#> GSM494657     6  0.2136    0.94617 0.000 0.000 0.048 0.000 0.048 0.904
#> GSM494667     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494621     4  0.1757    0.86089 0.076 0.000 0.008 0.916 0.000 0.000
#> GSM494629     4  0.1674    0.86021 0.068 0.000 0.004 0.924 0.000 0.004
#> GSM494637     4  0.1812    0.85995 0.080 0.000 0.008 0.912 0.000 0.000
#> GSM494652     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494648     4  0.1757    0.86089 0.076 0.000 0.008 0.916 0.000 0.000
#> GSM494650     4  0.0976    0.84602 0.016 0.000 0.008 0.968 0.000 0.008
#> GSM494669     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494666     1  0.3717    0.55381 0.616 0.000 0.000 0.384 0.000 0.000
#> GSM494668     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494633     4  0.1812    0.85995 0.080 0.000 0.008 0.912 0.000 0.000
#> GSM494634     1  0.1765    0.81954 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM494639     4  0.3747    0.23059 0.396 0.000 0.000 0.604 0.000 0.000
#> GSM494661     1  0.3717    0.55381 0.616 0.000 0.000 0.384 0.000 0.000
#> GSM494617     4  0.0632    0.85352 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM494626     4  0.0632    0.85352 0.024 0.000 0.000 0.976 0.000 0.000
#> GSM494656     6  0.2554    0.90815 0.004 0.000 0.032 0.024 0.044 0.896
#> GSM494635     1  0.3737    0.53829 0.608 0.000 0.000 0.392 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-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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 5)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-hclust-collect-classes

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

test_to_known_factors(res)
#>             n disease.state(p) age(p) other(p) individual(p) k
#> SD:hclust  72         4.35e-04 0.1131 6.64e-03        0.0451 2
#> SD:hclust  96         2.45e-15 0.4919 1.99e-12        0.6906 3
#> SD:hclust  87         3.19e-13 0.1619 3.08e-10        0.3517 4
#> SD:hclust 103         6.73e-16 0.0898 2.08e-11        0.3942 5
#> SD:hclust  90         6.11e-13 0.1415 4.47e-11        0.5584 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 51941 rows and 120 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.483           0.807       0.872         0.5026 0.496   0.496
#> 3 3 0.567           0.599       0.744         0.2976 0.824   0.656
#> 4 4 0.753           0.860       0.861         0.1291 0.816   0.528
#> 5 5 0.814           0.705       0.819         0.0703 0.942   0.773
#> 6 6 0.798           0.691       0.801         0.0396 0.928   0.684

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
#> GSM494565     2  0.8386      0.849 0.268 0.732
#> GSM494594     2  0.8386      0.849 0.268 0.732
#> GSM494604     1  0.9323      0.737 0.652 0.348
#> GSM494564     2  0.8386      0.849 0.268 0.732
#> GSM494591     2  0.8386      0.849 0.268 0.732
#> GSM494567     2  0.8386      0.849 0.268 0.732
#> GSM494602     2  0.0672      0.766 0.008 0.992
#> GSM494613     2  0.8386      0.849 0.268 0.732
#> GSM494589     2  0.8386      0.849 0.268 0.732
#> GSM494598     2  0.0672      0.766 0.008 0.992
#> GSM494593     2  0.0672      0.766 0.008 0.992
#> GSM494583     2  0.8386      0.849 0.268 0.732
#> GSM494612     2  0.0672      0.766 0.008 0.992
#> GSM494558     2  0.8386      0.849 0.268 0.732
#> GSM494556     2  0.8386      0.849 0.268 0.732
#> GSM494559     2  0.8386      0.849 0.268 0.732
#> GSM494571     2  0.8386      0.849 0.268 0.732
#> GSM494614     2  0.8386      0.849 0.268 0.732
#> GSM494603     2  0.8386      0.849 0.268 0.732
#> GSM494568     1  0.6531      0.568 0.832 0.168
#> GSM494572     2  0.8386      0.849 0.268 0.732
#> GSM494600     2  0.8386      0.849 0.268 0.732
#> GSM494562     2  0.0000      0.769 0.000 1.000
#> GSM494615     2  0.8386      0.849 0.268 0.732
#> GSM494582     2  0.0672      0.766 0.008 0.992
#> GSM494599     2  0.0672      0.766 0.008 0.992
#> GSM494610     2  0.0672      0.766 0.008 0.992
#> GSM494587     2  0.0672      0.773 0.008 0.992
#> GSM494581     2  0.0672      0.773 0.008 0.992
#> GSM494580     2  0.8386      0.849 0.268 0.732
#> GSM494563     2  0.8386      0.849 0.268 0.732
#> GSM494576     2  0.6531      0.827 0.168 0.832
#> GSM494605     1  0.8386      0.814 0.732 0.268
#> GSM494584     2  0.8386      0.849 0.268 0.732
#> GSM494586     2  0.0000      0.769 0.000 1.000
#> GSM494578     2  0.8386      0.849 0.268 0.732
#> GSM494585     2  0.0672      0.773 0.008 0.992
#> GSM494611     2  0.0672      0.766 0.008 0.992
#> GSM494560     2  0.8386      0.849 0.268 0.732
#> GSM494595     2  0.0672      0.766 0.008 0.992
#> GSM494570     2  0.8386      0.849 0.268 0.732
#> GSM494597     2  0.8386      0.849 0.268 0.732
#> GSM494607     2  0.2948      0.722 0.052 0.948
#> GSM494561     2  0.8386      0.849 0.268 0.732
#> GSM494569     1  0.0672      0.806 0.992 0.008
#> GSM494592     2  0.0672      0.766 0.008 0.992
#> GSM494577     2  0.6531      0.827 0.168 0.832
#> GSM494588     2  0.8386      0.849 0.268 0.732
#> GSM494590     2  0.8386      0.849 0.268 0.732
#> GSM494609     2  0.0672      0.766 0.008 0.992
#> GSM494608     2  0.0672      0.766 0.008 0.992
#> GSM494606     2  0.0672      0.766 0.008 0.992
#> GSM494574     2  0.0672      0.766 0.008 0.992
#> GSM494573     2  0.8386      0.849 0.268 0.732
#> GSM494566     2  0.6801      0.830 0.180 0.820
#> GSM494601     2  0.0672      0.766 0.008 0.992
#> GSM494557     2  0.8386      0.849 0.268 0.732
#> GSM494579     2  0.0672      0.773 0.008 0.992
#> GSM494596     2  0.8386      0.849 0.268 0.732
#> GSM494575     2  0.0672      0.766 0.008 0.992
#> GSM494625     1  0.0672      0.806 0.992 0.008
#> GSM494654     2  0.9896      0.626 0.440 0.560
#> GSM494664     1  0.8386      0.814 0.732 0.268
#> GSM494624     1  0.0000      0.809 1.000 0.000
#> GSM494651     1  0.0672      0.806 0.992 0.008
#> GSM494662     1  0.0000      0.809 1.000 0.000
#> GSM494627     1  0.0672      0.806 0.992 0.008
#> GSM494673     1  0.8386      0.814 0.732 0.268
#> GSM494649     1  0.0672      0.806 0.992 0.008
#> GSM494658     1  0.8386      0.814 0.732 0.268
#> GSM494653     1  0.8386      0.814 0.732 0.268
#> GSM494643     1  0.0000      0.809 1.000 0.000
#> GSM494672     1  0.8386      0.814 0.732 0.268
#> GSM494618     1  0.0672      0.806 0.992 0.008
#> GSM494631     2  0.9896      0.626 0.440 0.560
#> GSM494619     1  0.0000      0.809 1.000 0.000
#> GSM494674     1  0.8386      0.814 0.732 0.268
#> GSM494616     1  0.0672      0.806 0.992 0.008
#> GSM494663     1  0.0672      0.806 0.992 0.008
#> GSM494628     1  0.0672      0.806 0.992 0.008
#> GSM494632     1  0.8386      0.814 0.732 0.268
#> GSM494660     1  0.0672      0.806 0.992 0.008
#> GSM494622     1  0.0672      0.806 0.992 0.008
#> GSM494642     1  0.8386      0.814 0.732 0.268
#> GSM494647     1  0.8386      0.814 0.732 0.268
#> GSM494659     1  0.8386      0.814 0.732 0.268
#> GSM494670     1  0.8386      0.814 0.732 0.268
#> GSM494675     2  0.8386      0.849 0.268 0.732
#> GSM494641     1  0.8386      0.814 0.732 0.268
#> GSM494636     1  0.0000      0.809 1.000 0.000
#> GSM494640     1  0.0672      0.806 0.992 0.008
#> GSM494623     1  0.0000      0.809 1.000 0.000
#> GSM494644     1  0.8386      0.814 0.732 0.268
#> GSM494646     1  0.8386      0.814 0.732 0.268
#> GSM494665     1  0.8386      0.814 0.732 0.268
#> GSM494638     1  0.0000      0.809 1.000 0.000
#> GSM494645     1  0.8386      0.814 0.732 0.268
#> GSM494671     1  0.8386      0.814 0.732 0.268
#> GSM494655     1  0.8386      0.814 0.732 0.268
#> GSM494620     1  0.0000      0.809 1.000 0.000
#> GSM494630     1  0.0000      0.809 1.000 0.000
#> GSM494657     2  0.8386      0.849 0.268 0.732
#> GSM494667     1  0.8386      0.814 0.732 0.268
#> GSM494621     1  0.0000      0.809 1.000 0.000
#> GSM494629     1  0.0672      0.806 0.992 0.008
#> GSM494637     1  0.0672      0.806 0.992 0.008
#> GSM494652     1  0.8386      0.814 0.732 0.268
#> GSM494648     1  0.0000      0.809 1.000 0.000
#> GSM494650     1  0.0672      0.806 0.992 0.008
#> GSM494669     1  0.8386      0.814 0.732 0.268
#> GSM494666     1  0.8386      0.814 0.732 0.268
#> GSM494668     1  0.8386      0.814 0.732 0.268
#> GSM494633     1  0.0672      0.806 0.992 0.008
#> GSM494634     1  0.8386      0.814 0.732 0.268
#> GSM494639     1  0.8386      0.814 0.732 0.268
#> GSM494661     1  0.8386      0.814 0.732 0.268
#> GSM494617     1  0.0000      0.809 1.000 0.000
#> GSM494626     1  0.0000      0.809 1.000 0.000
#> GSM494656     2  0.8386      0.849 0.268 0.732
#> GSM494635     1  0.8386      0.814 0.732 0.268

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM494565     3  0.6192     -0.266 0.000 0.420 0.580
#> GSM494594     3  0.1031      0.734 0.000 0.024 0.976
#> GSM494604     1  0.6244     -0.263 0.560 0.440 0.000
#> GSM494564     3  0.2711      0.655 0.000 0.088 0.912
#> GSM494591     3  0.0000      0.727 0.000 0.000 1.000
#> GSM494567     3  0.1031      0.734 0.000 0.024 0.976
#> GSM494602     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494613     3  0.0424      0.731 0.000 0.008 0.992
#> GSM494589     3  0.1643      0.695 0.000 0.044 0.956
#> GSM494598     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494593     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494583     2  0.6509      0.535 0.004 0.524 0.472
#> GSM494612     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494558     3  0.5591      0.558 0.000 0.304 0.696
#> GSM494556     3  0.0237      0.729 0.000 0.004 0.996
#> GSM494559     3  0.2959      0.639 0.000 0.100 0.900
#> GSM494571     3  0.5016      0.600 0.000 0.240 0.760
#> GSM494614     3  0.2796      0.642 0.000 0.092 0.908
#> GSM494603     3  0.6742      0.532 0.028 0.316 0.656
#> GSM494568     3  0.7484      0.258 0.036 0.460 0.504
#> GSM494572     3  0.1031      0.734 0.000 0.024 0.976
#> GSM494600     3  0.2711      0.655 0.000 0.088 0.912
#> GSM494562     2  0.7256      0.582 0.028 0.532 0.440
#> GSM494615     3  0.1289      0.730 0.000 0.032 0.968
#> GSM494582     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494599     2  0.9111      0.578 0.292 0.532 0.176
#> GSM494610     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494587     2  0.6659      0.557 0.008 0.532 0.460
#> GSM494581     2  0.6659      0.557 0.008 0.532 0.460
#> GSM494580     3  0.1031      0.734 0.000 0.024 0.976
#> GSM494563     3  0.6302     -0.439 0.000 0.480 0.520
#> GSM494576     2  0.6500      0.551 0.004 0.532 0.464
#> GSM494605     1  0.3551      0.732 0.868 0.132 0.000
#> GSM494584     3  0.6154     -0.247 0.000 0.408 0.592
#> GSM494586     2  0.6659      0.557 0.008 0.532 0.460
#> GSM494578     3  0.0892      0.733 0.000 0.020 0.980
#> GSM494585     2  0.6659      0.557 0.008 0.532 0.460
#> GSM494611     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494560     3  0.2959      0.639 0.000 0.100 0.900
#> GSM494595     2  0.8825      0.676 0.132 0.532 0.336
#> GSM494570     3  0.4654      0.643 0.000 0.208 0.792
#> GSM494597     3  0.0237      0.729 0.000 0.004 0.996
#> GSM494607     2  0.8180      0.478 0.392 0.532 0.076
#> GSM494561     3  0.6867      0.520 0.028 0.336 0.636
#> GSM494569     1  0.8210      0.698 0.468 0.460 0.072
#> GSM494592     2  0.8949      0.551 0.320 0.532 0.148
#> GSM494577     2  0.6500      0.551 0.004 0.532 0.464
#> GSM494588     3  0.6204     -0.278 0.000 0.424 0.576
#> GSM494590     3  0.1031      0.734 0.000 0.024 0.976
#> GSM494609     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494608     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494606     2  0.9236      0.645 0.220 0.532 0.248
#> GSM494574     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494573     3  0.2959      0.639 0.000 0.100 0.900
#> GSM494566     2  0.6500      0.551 0.004 0.532 0.464
#> GSM494601     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494557     3  0.0000      0.727 0.000 0.000 1.000
#> GSM494579     2  0.6799      0.563 0.012 0.532 0.456
#> GSM494596     3  0.0237      0.729 0.000 0.004 0.996
#> GSM494575     2  0.9027      0.694 0.160 0.532 0.308
#> GSM494625     2  0.8070     -0.715 0.468 0.468 0.064
#> GSM494654     3  0.5810      0.534 0.000 0.336 0.664
#> GSM494664     1  0.3879      0.736 0.848 0.152 0.000
#> GSM494624     1  0.6291      0.731 0.532 0.468 0.000
#> GSM494651     1  0.8210      0.698 0.468 0.460 0.072
#> GSM494662     1  0.6654      0.732 0.536 0.456 0.008
#> GSM494627     1  0.8210      0.698 0.468 0.460 0.072
#> GSM494673     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494649     2  0.8070     -0.715 0.468 0.468 0.064
#> GSM494658     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494653     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494643     1  0.6286      0.732 0.536 0.464 0.000
#> GSM494672     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494618     1  0.8210      0.698 0.468 0.460 0.072
#> GSM494631     3  0.5810      0.534 0.000 0.336 0.664
#> GSM494619     1  0.6286      0.732 0.536 0.464 0.000
#> GSM494674     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494616     1  0.8210      0.698 0.468 0.460 0.072
#> GSM494663     1  0.8210      0.698 0.468 0.460 0.072
#> GSM494628     1  0.8210      0.698 0.468 0.460 0.072
#> GSM494632     1  0.4235      0.738 0.824 0.176 0.000
#> GSM494660     1  0.8070      0.699 0.468 0.468 0.064
#> GSM494622     1  0.8210      0.698 0.468 0.460 0.072
#> GSM494642     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494647     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494659     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494670     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494675     3  0.0424      0.731 0.000 0.008 0.992
#> GSM494641     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494636     1  0.6654      0.732 0.536 0.456 0.008
#> GSM494640     1  0.8210      0.698 0.468 0.460 0.072
#> GSM494623     1  0.6286      0.732 0.536 0.464 0.000
#> GSM494644     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494646     1  0.3879      0.736 0.848 0.152 0.000
#> GSM494665     1  0.0237      0.696 0.996 0.004 0.000
#> GSM494638     1  0.6654      0.732 0.536 0.456 0.008
#> GSM494645     1  0.3879      0.736 0.848 0.152 0.000
#> GSM494671     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494655     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494620     1  0.6286      0.732 0.536 0.464 0.000
#> GSM494630     1  0.6286      0.732 0.536 0.464 0.000
#> GSM494657     3  0.1031      0.734 0.000 0.024 0.976
#> GSM494667     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494621     1  0.6286      0.732 0.536 0.464 0.000
#> GSM494629     2  0.8581     -0.696 0.444 0.460 0.096
#> GSM494637     1  0.8210      0.698 0.468 0.460 0.072
#> GSM494652     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494648     1  0.6286      0.732 0.536 0.464 0.000
#> GSM494650     1  0.8210      0.698 0.468 0.460 0.072
#> GSM494669     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494666     1  0.3879      0.736 0.848 0.152 0.000
#> GSM494668     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494633     1  0.6944      0.725 0.516 0.468 0.016
#> GSM494634     1  0.0000      0.694 1.000 0.000 0.000
#> GSM494639     1  0.4062      0.737 0.836 0.164 0.000
#> GSM494661     1  0.3686      0.734 0.860 0.140 0.000
#> GSM494617     1  0.6654      0.732 0.536 0.456 0.008
#> GSM494626     1  0.6659      0.731 0.532 0.460 0.008
#> GSM494656     3  0.5621      0.555 0.000 0.308 0.692
#> GSM494635     1  0.3879      0.736 0.848 0.152 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     2  0.6702      0.573 0.000 0.616 0.216 0.168
#> GSM494594     3  0.2089      0.859 0.000 0.020 0.932 0.048
#> GSM494604     1  0.4643      0.465 0.656 0.344 0.000 0.000
#> GSM494564     3  0.6310      0.670 0.000 0.188 0.660 0.152
#> GSM494591     3  0.2494      0.866 0.000 0.036 0.916 0.048
#> GSM494567     3  0.1388      0.870 0.000 0.028 0.960 0.012
#> GSM494602     2  0.0524      0.903 0.008 0.988 0.000 0.004
#> GSM494613     3  0.1452      0.870 0.000 0.036 0.956 0.008
#> GSM494589     3  0.4149      0.818 0.000 0.036 0.812 0.152
#> GSM494598     2  0.1452      0.903 0.008 0.956 0.000 0.036
#> GSM494593     2  0.0336      0.903 0.008 0.992 0.000 0.000
#> GSM494583     2  0.5533      0.734 0.000 0.732 0.136 0.132
#> GSM494612     2  0.0524      0.903 0.008 0.988 0.000 0.004
#> GSM494558     3  0.1356      0.853 0.008 0.000 0.960 0.032
#> GSM494556     3  0.2408      0.864 0.000 0.036 0.920 0.044
#> GSM494559     3  0.6664      0.601 0.000 0.232 0.616 0.152
#> GSM494571     3  0.1637      0.850 0.000 0.000 0.940 0.060
#> GSM494614     3  0.6341      0.651 0.000 0.212 0.652 0.136
#> GSM494603     4  0.4228      0.497 0.008 0.000 0.232 0.760
#> GSM494568     4  0.4635      0.778 0.080 0.000 0.124 0.796
#> GSM494572     3  0.2319      0.865 0.000 0.036 0.924 0.040
#> GSM494600     3  0.4562      0.805 0.000 0.056 0.792 0.152
#> GSM494562     2  0.1820      0.901 0.000 0.944 0.020 0.036
#> GSM494615     3  0.1767      0.865 0.000 0.012 0.944 0.044
#> GSM494582     2  0.1452      0.903 0.008 0.956 0.000 0.036
#> GSM494599     2  0.0817      0.895 0.024 0.976 0.000 0.000
#> GSM494610     2  0.1452      0.903 0.008 0.956 0.000 0.036
#> GSM494587     2  0.1256      0.900 0.000 0.964 0.028 0.008
#> GSM494581     2  0.1706      0.894 0.000 0.948 0.036 0.016
#> GSM494580     3  0.1584      0.870 0.000 0.036 0.952 0.012
#> GSM494563     2  0.6678      0.589 0.000 0.620 0.208 0.172
#> GSM494576     2  0.2300      0.895 0.000 0.924 0.028 0.048
#> GSM494605     1  0.0376      0.947 0.992 0.004 0.004 0.000
#> GSM494584     2  0.6164      0.585 0.000 0.656 0.240 0.104
#> GSM494586     2  0.2032      0.897 0.000 0.936 0.028 0.036
#> GSM494578     3  0.1584      0.870 0.000 0.036 0.952 0.012
#> GSM494585     2  0.1109      0.900 0.000 0.968 0.028 0.004
#> GSM494611     2  0.0524      0.903 0.008 0.988 0.000 0.004
#> GSM494560     3  0.6917      0.490 0.000 0.288 0.568 0.144
#> GSM494595     2  0.1706      0.902 0.000 0.948 0.016 0.036
#> GSM494570     3  0.5452      0.521 0.000 0.016 0.556 0.428
#> GSM494597     3  0.2816      0.867 0.000 0.036 0.900 0.064
#> GSM494607     2  0.3448      0.745 0.168 0.828 0.000 0.004
#> GSM494561     4  0.4899      0.262 0.004 0.008 0.300 0.688
#> GSM494569     4  0.5056      0.926 0.224 0.000 0.044 0.732
#> GSM494592     2  0.0921      0.892 0.028 0.972 0.000 0.000
#> GSM494577     2  0.3542      0.859 0.000 0.852 0.028 0.120
#> GSM494588     2  0.6724      0.541 0.000 0.612 0.224 0.164
#> GSM494590     3  0.2319      0.865 0.000 0.036 0.924 0.040
#> GSM494609     2  0.1262      0.902 0.008 0.968 0.008 0.016
#> GSM494608     2  0.1262      0.902 0.008 0.968 0.008 0.016
#> GSM494606     2  0.0707      0.897 0.020 0.980 0.000 0.000
#> GSM494574     2  0.1452      0.903 0.008 0.956 0.000 0.036
#> GSM494573     3  0.6310      0.670 0.000 0.188 0.660 0.152
#> GSM494566     2  0.3745      0.837 0.000 0.852 0.060 0.088
#> GSM494601     2  0.0336      0.903 0.008 0.992 0.000 0.000
#> GSM494557     3  0.1584      0.870 0.000 0.036 0.952 0.012
#> GSM494579     2  0.3278      0.864 0.000 0.864 0.020 0.116
#> GSM494596     3  0.2494      0.866 0.000 0.036 0.916 0.048
#> GSM494575     2  0.0524      0.903 0.008 0.988 0.000 0.004
#> GSM494625     4  0.4086      0.926 0.216 0.008 0.000 0.776
#> GSM494654     3  0.3649      0.719 0.000 0.000 0.796 0.204
#> GSM494664     1  0.0672      0.934 0.984 0.000 0.008 0.008
#> GSM494624     4  0.4086      0.926 0.216 0.008 0.000 0.776
#> GSM494651     4  0.5056      0.926 0.224 0.000 0.044 0.732
#> GSM494662     4  0.4453      0.923 0.244 0.000 0.012 0.744
#> GSM494627     4  0.4888      0.926 0.224 0.000 0.036 0.740
#> GSM494673     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494649     4  0.4086      0.926 0.216 0.008 0.000 0.776
#> GSM494658     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494653     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494643     4  0.4228      0.927 0.232 0.008 0.000 0.760
#> GSM494672     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494618     4  0.5056      0.926 0.224 0.000 0.044 0.732
#> GSM494631     3  0.3528      0.716 0.000 0.000 0.808 0.192
#> GSM494619     4  0.4086      0.926 0.216 0.008 0.000 0.776
#> GSM494674     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494616     4  0.5056      0.926 0.224 0.000 0.044 0.732
#> GSM494663     4  0.4888      0.926 0.224 0.000 0.036 0.740
#> GSM494628     4  0.4974      0.926 0.224 0.000 0.040 0.736
#> GSM494632     1  0.4328      0.512 0.748 0.000 0.008 0.244
#> GSM494660     4  0.4086      0.926 0.216 0.008 0.000 0.776
#> GSM494622     4  0.5056      0.926 0.224 0.000 0.044 0.732
#> GSM494642     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494647     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494659     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494670     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494675     3  0.2739      0.864 0.000 0.036 0.904 0.060
#> GSM494641     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494636     4  0.4453      0.923 0.244 0.000 0.012 0.744
#> GSM494640     4  0.4399      0.930 0.224 0.000 0.016 0.760
#> GSM494623     4  0.4086      0.926 0.216 0.008 0.000 0.776
#> GSM494644     1  0.0592      0.954 0.984 0.016 0.000 0.000
#> GSM494646     1  0.0672      0.934 0.984 0.000 0.008 0.008
#> GSM494665     1  0.0657      0.951 0.984 0.012 0.004 0.000
#> GSM494638     4  0.4903      0.921 0.248 0.000 0.028 0.724
#> GSM494645     1  0.0188      0.944 0.996 0.000 0.004 0.000
#> GSM494671     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494655     1  0.0592      0.954 0.984 0.016 0.000 0.000
#> GSM494620     4  0.4086      0.926 0.216 0.008 0.000 0.776
#> GSM494630     4  0.4086      0.926 0.216 0.008 0.000 0.776
#> GSM494657     3  0.2319      0.865 0.000 0.036 0.924 0.040
#> GSM494667     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494621     4  0.4086      0.926 0.216 0.008 0.000 0.776
#> GSM494629     4  0.5212      0.904 0.192 0.000 0.068 0.740
#> GSM494637     4  0.4468      0.929 0.232 0.000 0.016 0.752
#> GSM494652     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494648     4  0.4086      0.926 0.216 0.008 0.000 0.776
#> GSM494650     4  0.5056      0.926 0.224 0.000 0.044 0.732
#> GSM494669     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494666     1  0.0672      0.934 0.984 0.000 0.008 0.008
#> GSM494668     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494633     4  0.4086      0.926 0.216 0.008 0.000 0.776
#> GSM494634     1  0.0707      0.956 0.980 0.020 0.000 0.000
#> GSM494639     1  0.3300      0.739 0.848 0.000 0.008 0.144
#> GSM494661     1  0.0376      0.947 0.992 0.004 0.004 0.000
#> GSM494617     4  0.4872      0.921 0.244 0.000 0.028 0.728
#> GSM494626     4  0.4900      0.922 0.236 0.000 0.032 0.732
#> GSM494656     3  0.1792      0.846 0.000 0.000 0.932 0.068
#> GSM494635     1  0.0188      0.944 0.996 0.000 0.004 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
#> GSM494565     5  0.4434      0.443 0.000 0.208 0.056 0.000 0.736
#> GSM494594     3  0.4192      0.748 0.000 0.000 0.596 0.000 0.404
#> GSM494604     1  0.3612      0.725 0.784 0.204 0.004 0.004 0.004
#> GSM494564     5  0.2446      0.498 0.000 0.044 0.056 0.000 0.900
#> GSM494591     3  0.4219      0.737 0.000 0.000 0.584 0.000 0.416
#> GSM494567     5  0.4718     -0.439 0.000 0.000 0.444 0.016 0.540
#> GSM494602     2  0.0000      0.910 0.000 1.000 0.000 0.000 0.000
#> GSM494613     5  0.4735     -0.481 0.000 0.000 0.460 0.016 0.524
#> GSM494589     5  0.0609      0.471 0.000 0.020 0.000 0.000 0.980
#> GSM494598     2  0.2079      0.898 0.000 0.916 0.064 0.020 0.000
#> GSM494593     2  0.0000      0.910 0.000 1.000 0.000 0.000 0.000
#> GSM494583     2  0.5845      0.455 0.000 0.572 0.052 0.028 0.348
#> GSM494612     2  0.0162      0.910 0.000 0.996 0.000 0.004 0.000
#> GSM494558     3  0.6672      0.372 0.000 0.000 0.440 0.288 0.272
#> GSM494556     5  0.4717     -0.336 0.000 0.000 0.396 0.020 0.584
#> GSM494559     5  0.2520      0.499 0.000 0.048 0.056 0.000 0.896
#> GSM494571     3  0.4192      0.748 0.000 0.000 0.596 0.000 0.404
#> GSM494614     5  0.3454      0.466 0.000 0.076 0.044 0.024 0.856
#> GSM494603     4  0.4508      0.311 0.000 0.000 0.020 0.648 0.332
#> GSM494568     4  0.2297      0.764 0.008 0.000 0.020 0.912 0.060
#> GSM494572     3  0.4192      0.748 0.000 0.000 0.596 0.000 0.404
#> GSM494600     5  0.0703      0.475 0.000 0.024 0.000 0.000 0.976
#> GSM494562     2  0.2144      0.896 0.000 0.912 0.068 0.020 0.000
#> GSM494615     5  0.4726     -0.337 0.000 0.000 0.400 0.020 0.580
#> GSM494582     2  0.2171      0.897 0.000 0.912 0.064 0.024 0.000
#> GSM494599     2  0.0162      0.909 0.000 0.996 0.000 0.000 0.004
#> GSM494610     2  0.2079      0.898 0.000 0.916 0.064 0.020 0.000
#> GSM494587     2  0.0693      0.909 0.000 0.980 0.008 0.012 0.000
#> GSM494581     2  0.1310      0.896 0.000 0.956 0.000 0.020 0.024
#> GSM494580     5  0.4718     -0.439 0.000 0.000 0.444 0.016 0.540
#> GSM494563     5  0.4998      0.431 0.000 0.208 0.068 0.012 0.712
#> GSM494576     2  0.2694      0.891 0.000 0.892 0.068 0.032 0.008
#> GSM494605     1  0.0162      0.960 0.996 0.000 0.000 0.004 0.000
#> GSM494584     5  0.4767      0.157 0.000 0.420 0.000 0.020 0.560
#> GSM494586     2  0.2144      0.896 0.000 0.912 0.068 0.020 0.000
#> GSM494578     5  0.4718     -0.439 0.000 0.000 0.444 0.016 0.540
#> GSM494585     2  0.0404      0.908 0.000 0.988 0.000 0.012 0.000
#> GSM494611     2  0.0162      0.910 0.000 0.996 0.000 0.004 0.000
#> GSM494560     5  0.2563      0.496 0.000 0.120 0.008 0.000 0.872
#> GSM494595     2  0.2012      0.899 0.000 0.920 0.060 0.020 0.000
#> GSM494570     5  0.3596      0.421 0.000 0.000 0.200 0.016 0.784
#> GSM494597     3  0.4533      0.686 0.000 0.000 0.544 0.008 0.448
#> GSM494607     2  0.1526      0.874 0.040 0.948 0.004 0.004 0.004
#> GSM494561     5  0.5737      0.280 0.000 0.000 0.288 0.120 0.592
#> GSM494569     4  0.1197      0.847 0.048 0.000 0.000 0.952 0.000
#> GSM494592     2  0.0162      0.909 0.000 0.996 0.000 0.000 0.004
#> GSM494577     2  0.5575      0.651 0.000 0.664 0.068 0.028 0.240
#> GSM494588     5  0.4219      0.474 0.000 0.156 0.072 0.000 0.772
#> GSM494590     3  0.4201      0.749 0.000 0.000 0.592 0.000 0.408
#> GSM494609     2  0.1117      0.900 0.000 0.964 0.000 0.020 0.016
#> GSM494608     2  0.1117      0.900 0.000 0.964 0.000 0.020 0.016
#> GSM494606     2  0.0000      0.910 0.000 1.000 0.000 0.000 0.000
#> GSM494574     2  0.2079      0.898 0.000 0.916 0.064 0.020 0.000
#> GSM494573     5  0.1121      0.489 0.000 0.044 0.000 0.000 0.956
#> GSM494566     2  0.4804      0.453 0.000 0.624 0.004 0.024 0.348
#> GSM494601     2  0.0000      0.910 0.000 1.000 0.000 0.000 0.000
#> GSM494557     5  0.4735     -0.481 0.000 0.000 0.460 0.016 0.524
#> GSM494579     2  0.5748      0.625 0.000 0.644 0.068 0.032 0.256
#> GSM494596     3  0.4227      0.739 0.000 0.000 0.580 0.000 0.420
#> GSM494575     2  0.0162      0.910 0.000 0.996 0.000 0.004 0.000
#> GSM494625     4  0.5272      0.776 0.048 0.000 0.328 0.616 0.008
#> GSM494654     3  0.5896      0.555 0.000 0.000 0.600 0.216 0.184
#> GSM494664     1  0.0162      0.960 0.996 0.000 0.000 0.004 0.000
#> GSM494624     4  0.5556      0.771 0.048 0.000 0.328 0.604 0.020
#> GSM494651     4  0.1197      0.847 0.048 0.000 0.000 0.952 0.000
#> GSM494662     4  0.1872      0.847 0.052 0.000 0.020 0.928 0.000
#> GSM494627     4  0.1357      0.847 0.048 0.000 0.004 0.948 0.000
#> GSM494673     1  0.0324      0.960 0.992 0.000 0.004 0.000 0.004
#> GSM494649     4  0.5272      0.776 0.048 0.000 0.328 0.616 0.008
#> GSM494658     1  0.0324      0.960 0.992 0.000 0.004 0.000 0.004
#> GSM494653     1  0.0324      0.960 0.992 0.000 0.004 0.000 0.004
#> GSM494643     4  0.4563      0.800 0.048 0.000 0.244 0.708 0.000
#> GSM494672     1  0.0324      0.960 0.992 0.000 0.004 0.000 0.004
#> GSM494618     4  0.1197      0.847 0.048 0.000 0.000 0.952 0.000
#> GSM494631     3  0.6734      0.343 0.000 0.000 0.388 0.356 0.256
#> GSM494619     4  0.5556      0.771 0.048 0.000 0.328 0.604 0.020
#> GSM494674     1  0.0000      0.961 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.1197      0.847 0.048 0.000 0.000 0.952 0.000
#> GSM494663     4  0.1357      0.847 0.048 0.000 0.004 0.948 0.000
#> GSM494628     4  0.1197      0.847 0.048 0.000 0.000 0.952 0.000
#> GSM494632     1  0.4060      0.369 0.640 0.000 0.000 0.360 0.000
#> GSM494660     4  0.5272      0.776 0.048 0.000 0.328 0.616 0.008
#> GSM494622     4  0.1357      0.845 0.048 0.000 0.004 0.948 0.000
#> GSM494642     1  0.0000      0.961 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.961 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0324      0.960 0.992 0.000 0.004 0.000 0.004
#> GSM494670     1  0.0324      0.960 0.992 0.000 0.004 0.000 0.004
#> GSM494675     5  0.4401     -0.186 0.000 0.000 0.328 0.016 0.656
#> GSM494641     1  0.0000      0.961 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.1800      0.847 0.048 0.000 0.020 0.932 0.000
#> GSM494640     4  0.1981      0.847 0.048 0.000 0.028 0.924 0.000
#> GSM494623     4  0.5556      0.771 0.048 0.000 0.328 0.604 0.020
#> GSM494644     1  0.0000      0.961 1.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.0609      0.946 0.980 0.000 0.000 0.020 0.000
#> GSM494665     1  0.0162      0.960 0.996 0.000 0.000 0.004 0.000
#> GSM494638     4  0.1270      0.845 0.052 0.000 0.000 0.948 0.000
#> GSM494645     1  0.0000      0.961 1.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0324      0.960 0.992 0.000 0.004 0.000 0.004
#> GSM494655     1  0.0000      0.961 1.000 0.000 0.000 0.000 0.000
#> GSM494620     4  0.5556      0.771 0.048 0.000 0.328 0.604 0.020
#> GSM494630     4  0.5556      0.771 0.048 0.000 0.328 0.604 0.020
#> GSM494657     3  0.4201      0.749 0.000 0.000 0.592 0.000 0.408
#> GSM494667     1  0.0000      0.961 1.000 0.000 0.000 0.000 0.000
#> GSM494621     4  0.5556      0.771 0.048 0.000 0.328 0.604 0.020
#> GSM494629     4  0.1357      0.847 0.048 0.000 0.004 0.948 0.000
#> GSM494637     4  0.1981      0.847 0.048 0.000 0.028 0.924 0.000
#> GSM494652     1  0.0162      0.961 0.996 0.000 0.000 0.000 0.004
#> GSM494648     4  0.5556      0.771 0.048 0.000 0.328 0.604 0.020
#> GSM494650     4  0.1357      0.845 0.048 0.000 0.004 0.948 0.000
#> GSM494669     1  0.0000      0.961 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0162      0.960 0.996 0.000 0.000 0.004 0.000
#> GSM494668     1  0.0324      0.960 0.992 0.000 0.004 0.000 0.004
#> GSM494633     4  0.5556      0.771 0.048 0.000 0.328 0.604 0.020
#> GSM494634     1  0.0324      0.960 0.992 0.000 0.004 0.000 0.004
#> GSM494639     1  0.3752      0.537 0.708 0.000 0.000 0.292 0.000
#> GSM494661     1  0.0000      0.961 1.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.1197      0.847 0.048 0.000 0.000 0.952 0.000
#> GSM494626     4  0.1197      0.847 0.048 0.000 0.000 0.952 0.000
#> GSM494656     3  0.5740      0.646 0.000 0.000 0.600 0.128 0.272
#> GSM494635     1  0.0000      0.961 1.000 0.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM494565     5  0.3264     0.7533 0.000 0.088 0.076 0.004 0.832 0.000
#> GSM494594     3  0.0000     0.7709 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.4035     0.7182 0.760 0.192 0.000 0.020 0.016 0.012
#> GSM494564     5  0.3569     0.7623 0.000 0.032 0.128 0.004 0.816 0.020
#> GSM494591     3  0.0603     0.7668 0.000 0.000 0.980 0.016 0.004 0.000
#> GSM494567     3  0.4693     0.6709 0.000 0.000 0.684 0.140 0.176 0.000
#> GSM494602     2  0.0000     0.8420 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494613     3  0.4704     0.6810 0.000 0.004 0.696 0.140 0.160 0.000
#> GSM494589     5  0.3109     0.7359 0.000 0.016 0.168 0.004 0.812 0.000
#> GSM494598     2  0.3491     0.8019 0.000 0.804 0.000 0.148 0.040 0.008
#> GSM494593     2  0.0458     0.8414 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM494583     5  0.6066     0.1474 0.000 0.388 0.040 0.104 0.468 0.000
#> GSM494612     2  0.0000     0.8420 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     4  0.5163     0.1449 0.000 0.000 0.268 0.628 0.088 0.016
#> GSM494556     3  0.5598     0.4828 0.000 0.004 0.552 0.164 0.280 0.000
#> GSM494559     5  0.4031     0.7564 0.000 0.044 0.124 0.020 0.796 0.016
#> GSM494571     3  0.0000     0.7709 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494614     5  0.5962     0.5285 0.000 0.040 0.212 0.164 0.584 0.000
#> GSM494603     4  0.5051     0.4043 0.000 0.000 0.004 0.648 0.208 0.140
#> GSM494568     4  0.4403     0.5310 0.000 0.000 0.000 0.708 0.096 0.196
#> GSM494572     3  0.0146     0.7708 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494600     5  0.3158     0.7414 0.000 0.020 0.164 0.004 0.812 0.000
#> GSM494562     2  0.3551     0.7930 0.000 0.784 0.000 0.168 0.048 0.000
#> GSM494615     3  0.5974     0.4321 0.000 0.004 0.484 0.244 0.268 0.000
#> GSM494582     2  0.3172     0.8063 0.000 0.816 0.000 0.148 0.036 0.000
#> GSM494599     2  0.0436     0.8402 0.004 0.988 0.000 0.004 0.004 0.000
#> GSM494610     2  0.3621     0.7981 0.000 0.796 0.000 0.148 0.048 0.008
#> GSM494587     2  0.1584     0.8369 0.000 0.928 0.000 0.064 0.008 0.000
#> GSM494581     2  0.2905     0.7682 0.000 0.852 0.000 0.084 0.064 0.000
#> GSM494580     3  0.4662     0.6720 0.000 0.000 0.688 0.140 0.172 0.000
#> GSM494563     5  0.4431     0.7038 0.000 0.092 0.064 0.076 0.768 0.000
#> GSM494576     2  0.4503     0.7431 0.000 0.696 0.000 0.204 0.100 0.000
#> GSM494605     1  0.2122     0.8954 0.900 0.000 0.000 0.024 0.076 0.000
#> GSM494584     5  0.6923     0.2493 0.000 0.372 0.080 0.172 0.376 0.000
#> GSM494586     2  0.3516     0.7948 0.000 0.788 0.000 0.164 0.048 0.000
#> GSM494578     3  0.4830     0.6677 0.000 0.004 0.680 0.140 0.176 0.000
#> GSM494585     2  0.1333     0.8335 0.000 0.944 0.000 0.048 0.008 0.000
#> GSM494611     2  0.0260     0.8428 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM494560     5  0.3254     0.7652 0.000 0.056 0.124 0.000 0.820 0.000
#> GSM494595     2  0.2726     0.8197 0.000 0.856 0.000 0.112 0.032 0.000
#> GSM494570     5  0.3762     0.7086 0.000 0.000 0.080 0.012 0.800 0.108
#> GSM494597     3  0.2074     0.7481 0.000 0.000 0.912 0.048 0.036 0.004
#> GSM494607     2  0.2781     0.7999 0.048 0.884 0.000 0.044 0.012 0.012
#> GSM494561     5  0.5400     0.2893 0.000 0.000 0.020 0.064 0.488 0.428
#> GSM494569     4  0.4651     0.7036 0.012 0.000 0.000 0.588 0.028 0.372
#> GSM494592     2  0.0436     0.8402 0.004 0.988 0.000 0.004 0.004 0.000
#> GSM494577     2  0.5834     0.3308 0.000 0.468 0.000 0.204 0.328 0.000
#> GSM494588     5  0.3687     0.7624 0.000 0.072 0.072 0.004 0.824 0.028
#> GSM494590     3  0.0363     0.7693 0.000 0.000 0.988 0.012 0.000 0.000
#> GSM494609     2  0.2331     0.7965 0.000 0.888 0.000 0.080 0.032 0.000
#> GSM494608     2  0.2331     0.7965 0.000 0.888 0.000 0.080 0.032 0.000
#> GSM494606     2  0.0806     0.8393 0.000 0.972 0.000 0.020 0.008 0.000
#> GSM494574     2  0.3621     0.7981 0.000 0.796 0.000 0.148 0.048 0.008
#> GSM494573     5  0.3280     0.7531 0.000 0.032 0.152 0.004 0.812 0.000
#> GSM494566     2  0.5974    -0.0906 0.000 0.428 0.000 0.236 0.336 0.000
#> GSM494601     2  0.0458     0.8414 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM494557     3  0.4768     0.6751 0.000 0.004 0.688 0.140 0.168 0.000
#> GSM494579     2  0.5870     0.3016 0.000 0.460 0.000 0.212 0.328 0.000
#> GSM494596     3  0.0508     0.7682 0.000 0.000 0.984 0.012 0.004 0.000
#> GSM494575     2  0.0000     0.8420 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     6  0.0653     0.7638 0.012 0.000 0.000 0.004 0.004 0.980
#> GSM494654     3  0.2376     0.6937 0.000 0.000 0.884 0.096 0.012 0.008
#> GSM494664     1  0.2122     0.8954 0.900 0.000 0.000 0.024 0.076 0.000
#> GSM494624     6  0.0622     0.7649 0.012 0.000 0.000 0.000 0.008 0.980
#> GSM494651     4  0.4651     0.7043 0.012 0.000 0.000 0.588 0.028 0.372
#> GSM494662     6  0.5877    -0.4731 0.020 0.000 0.000 0.420 0.116 0.444
#> GSM494627     4  0.4697     0.6766 0.012 0.000 0.000 0.568 0.028 0.392
#> GSM494673     1  0.0520     0.9275 0.984 0.000 0.000 0.008 0.008 0.000
#> GSM494649     6  0.0767     0.7618 0.012 0.000 0.000 0.008 0.004 0.976
#> GSM494658     1  0.1275     0.9166 0.956 0.000 0.000 0.016 0.016 0.012
#> GSM494653     1  0.0520     0.9275 0.984 0.000 0.000 0.008 0.008 0.000
#> GSM494643     6  0.3299     0.6073 0.012 0.000 0.000 0.092 0.060 0.836
#> GSM494672     1  0.0862     0.9242 0.972 0.000 0.000 0.016 0.008 0.004
#> GSM494618     4  0.4651     0.7043 0.012 0.000 0.000 0.588 0.028 0.372
#> GSM494631     4  0.5546     0.0795 0.000 0.000 0.300 0.588 0.068 0.044
#> GSM494619     6  0.0622     0.7649 0.012 0.000 0.000 0.000 0.008 0.980
#> GSM494674     1  0.0000     0.9287 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.4717     0.7024 0.012 0.000 0.000 0.584 0.032 0.372
#> GSM494663     4  0.4763     0.6717 0.012 0.000 0.000 0.564 0.032 0.392
#> GSM494628     4  0.4323     0.7052 0.012 0.000 0.000 0.612 0.012 0.364
#> GSM494632     1  0.6424     0.3255 0.548 0.000 0.000 0.108 0.108 0.236
#> GSM494660     6  0.0767     0.7618 0.012 0.000 0.000 0.008 0.004 0.976
#> GSM494622     4  0.4345     0.6987 0.012 0.000 0.000 0.628 0.016 0.344
#> GSM494642     1  0.0000     0.9287 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0146     0.9287 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM494659     1  0.0520     0.9275 0.984 0.000 0.000 0.008 0.008 0.000
#> GSM494670     1  0.0964     0.9237 0.968 0.000 0.000 0.012 0.016 0.004
#> GSM494675     3  0.5623     0.4113 0.000 0.000 0.532 0.152 0.312 0.004
#> GSM494641     1  0.0000     0.9287 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     6  0.5731    -0.4962 0.012 0.000 0.000 0.432 0.116 0.440
#> GSM494640     6  0.5148    -0.3983 0.012 0.000 0.000 0.424 0.056 0.508
#> GSM494623     6  0.0622     0.7649 0.012 0.000 0.000 0.000 0.008 0.980
#> GSM494644     1  0.0260     0.9276 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494646     1  0.3416     0.8432 0.832 0.000 0.000 0.040 0.100 0.028
#> GSM494665     1  0.2122     0.8954 0.900 0.000 0.000 0.024 0.076 0.000
#> GSM494638     4  0.5875     0.5872 0.024 0.000 0.000 0.488 0.112 0.376
#> GSM494645     1  0.1075     0.9160 0.952 0.000 0.000 0.000 0.048 0.000
#> GSM494671     1  0.0862     0.9242 0.972 0.000 0.000 0.016 0.008 0.004
#> GSM494655     1  0.0000     0.9287 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.0622     0.7649 0.012 0.000 0.000 0.000 0.008 0.980
#> GSM494630     6  0.0767     0.7631 0.012 0.000 0.000 0.004 0.008 0.976
#> GSM494657     3  0.0146     0.7708 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494667     1  0.0146     0.9287 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM494621     6  0.0622     0.7649 0.012 0.000 0.000 0.000 0.008 0.980
#> GSM494629     4  0.4713     0.6655 0.012 0.000 0.000 0.560 0.028 0.400
#> GSM494637     6  0.5276    -0.3891 0.012 0.000 0.000 0.412 0.068 0.508
#> GSM494652     1  0.0520     0.9275 0.984 0.000 0.000 0.008 0.008 0.000
#> GSM494648     6  0.0622     0.7649 0.012 0.000 0.000 0.000 0.008 0.980
#> GSM494650     4  0.4323     0.7052 0.012 0.000 0.000 0.612 0.012 0.364
#> GSM494669     1  0.0000     0.9287 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.2122     0.8954 0.900 0.000 0.000 0.024 0.076 0.000
#> GSM494668     1  0.0436     0.9283 0.988 0.000 0.000 0.004 0.004 0.004
#> GSM494633     6  0.0767     0.7631 0.012 0.000 0.000 0.004 0.008 0.976
#> GSM494634     1  0.0622     0.9266 0.980 0.000 0.000 0.012 0.008 0.000
#> GSM494639     1  0.5609     0.5145 0.632 0.000 0.000 0.052 0.100 0.216
#> GSM494661     1  0.1387     0.9094 0.932 0.000 0.000 0.000 0.068 0.000
#> GSM494617     4  0.5062     0.6770 0.012 0.000 0.000 0.560 0.056 0.372
#> GSM494626     4  0.4780     0.6984 0.012 0.000 0.000 0.580 0.036 0.372
#> GSM494656     3  0.1644     0.7212 0.000 0.000 0.920 0.076 0.004 0.000
#> GSM494635     1  0.2060     0.8958 0.900 0.000 0.000 0.016 0.084 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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 5)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-kmeans-collect-classes

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

test_to_known_factors(res)
#>             n disease.state(p) age(p) other(p) individual(p) k
#> SD:kmeans 120         6.85e-20 0.9998 2.52e-15         1.000 2
#> SD:kmeans 110         2.59e-19 0.8788 2.43e-15         0.988 3
#> SD:kmeans 116         4.96e-19 0.3356 8.57e-13         0.855 4
#> SD:kmeans  93         9.15e-15 0.0418 2.54e-11         0.381 5
#> SD:kmeans 103         1.30e-15 0.2101 4.09e-09         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.


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 51941 rows and 120 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 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 SD-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.987       0.994         0.5046 0.496   0.496
#> 3 3 0.707           0.852       0.877         0.3024 0.741   0.526
#> 4 4 0.966           0.959       0.981         0.1505 0.827   0.541
#> 5 5 0.957           0.952       0.964         0.0487 0.956   0.823
#> 6 6 0.940           0.870       0.918         0.0394 0.960   0.813

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 5

There is also optional best \(k\) = 2 4 5 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
#> GSM494565     2   0.000      0.991 0.000 1.000
#> GSM494594     2   0.000      0.991 0.000 1.000
#> GSM494604     1   0.416      0.908 0.916 0.084
#> GSM494564     2   0.000      0.991 0.000 1.000
#> GSM494591     2   0.000      0.991 0.000 1.000
#> GSM494567     2   0.000      0.991 0.000 1.000
#> GSM494602     2   0.000      0.991 0.000 1.000
#> GSM494613     2   0.000      0.991 0.000 1.000
#> GSM494589     2   0.000      0.991 0.000 1.000
#> GSM494598     2   0.000      0.991 0.000 1.000
#> GSM494593     2   0.000      0.991 0.000 1.000
#> GSM494583     2   0.000      0.991 0.000 1.000
#> GSM494612     2   0.000      0.991 0.000 1.000
#> GSM494558     2   0.000      0.991 0.000 1.000
#> GSM494556     2   0.000      0.991 0.000 1.000
#> GSM494559     2   0.000      0.991 0.000 1.000
#> GSM494571     2   0.000      0.991 0.000 1.000
#> GSM494614     2   0.000      0.991 0.000 1.000
#> GSM494603     2   0.000      0.991 0.000 1.000
#> GSM494568     1   0.402      0.913 0.920 0.080
#> GSM494572     2   0.000      0.991 0.000 1.000
#> GSM494600     2   0.000      0.991 0.000 1.000
#> GSM494562     2   0.000      0.991 0.000 1.000
#> GSM494615     2   0.000      0.991 0.000 1.000
#> GSM494582     2   0.000      0.991 0.000 1.000
#> GSM494599     2   0.000      0.991 0.000 1.000
#> GSM494610     2   0.000      0.991 0.000 1.000
#> GSM494587     2   0.000      0.991 0.000 1.000
#> GSM494581     2   0.000      0.991 0.000 1.000
#> GSM494580     2   0.000      0.991 0.000 1.000
#> GSM494563     2   0.000      0.991 0.000 1.000
#> GSM494576     2   0.000      0.991 0.000 1.000
#> GSM494605     1   0.000      0.997 1.000 0.000
#> GSM494584     2   0.000      0.991 0.000 1.000
#> GSM494586     2   0.000      0.991 0.000 1.000
#> GSM494578     2   0.000      0.991 0.000 1.000
#> GSM494585     2   0.000      0.991 0.000 1.000
#> GSM494611     2   0.000      0.991 0.000 1.000
#> GSM494560     2   0.000      0.991 0.000 1.000
#> GSM494595     2   0.000      0.991 0.000 1.000
#> GSM494570     2   0.000      0.991 0.000 1.000
#> GSM494597     2   0.000      0.991 0.000 1.000
#> GSM494607     2   0.358      0.923 0.068 0.932
#> GSM494561     2   0.000      0.991 0.000 1.000
#> GSM494569     1   0.000      0.997 1.000 0.000
#> GSM494592     2   0.000      0.991 0.000 1.000
#> GSM494577     2   0.000      0.991 0.000 1.000
#> GSM494588     2   0.000      0.991 0.000 1.000
#> GSM494590     2   0.000      0.991 0.000 1.000
#> GSM494609     2   0.000      0.991 0.000 1.000
#> GSM494608     2   0.000      0.991 0.000 1.000
#> GSM494606     2   0.000      0.991 0.000 1.000
#> GSM494574     2   0.000      0.991 0.000 1.000
#> GSM494573     2   0.000      0.991 0.000 1.000
#> GSM494566     2   0.000      0.991 0.000 1.000
#> GSM494601     2   0.000      0.991 0.000 1.000
#> GSM494557     2   0.000      0.991 0.000 1.000
#> GSM494579     2   0.000      0.991 0.000 1.000
#> GSM494596     2   0.000      0.991 0.000 1.000
#> GSM494575     2   0.000      0.991 0.000 1.000
#> GSM494625     1   0.000      0.997 1.000 0.000
#> GSM494654     2   0.855      0.617 0.280 0.720
#> GSM494664     1   0.000      0.997 1.000 0.000
#> GSM494624     1   0.000      0.997 1.000 0.000
#> GSM494651     1   0.000      0.997 1.000 0.000
#> GSM494662     1   0.000      0.997 1.000 0.000
#> GSM494627     1   0.000      0.997 1.000 0.000
#> GSM494673     1   0.000      0.997 1.000 0.000
#> GSM494649     1   0.000      0.997 1.000 0.000
#> GSM494658     1   0.000      0.997 1.000 0.000
#> GSM494653     1   0.000      0.997 1.000 0.000
#> GSM494643     1   0.000      0.997 1.000 0.000
#> GSM494672     1   0.000      0.997 1.000 0.000
#> GSM494618     1   0.000      0.997 1.000 0.000
#> GSM494631     2   0.689      0.777 0.184 0.816
#> GSM494619     1   0.000      0.997 1.000 0.000
#> GSM494674     1   0.000      0.997 1.000 0.000
#> GSM494616     1   0.000      0.997 1.000 0.000
#> GSM494663     1   0.000      0.997 1.000 0.000
#> GSM494628     1   0.000      0.997 1.000 0.000
#> GSM494632     1   0.000      0.997 1.000 0.000
#> GSM494660     1   0.000      0.997 1.000 0.000
#> GSM494622     1   0.000      0.997 1.000 0.000
#> GSM494642     1   0.000      0.997 1.000 0.000
#> GSM494647     1   0.000      0.997 1.000 0.000
#> GSM494659     1   0.000      0.997 1.000 0.000
#> GSM494670     1   0.000      0.997 1.000 0.000
#> GSM494675     2   0.000      0.991 0.000 1.000
#> GSM494641     1   0.000      0.997 1.000 0.000
#> GSM494636     1   0.000      0.997 1.000 0.000
#> GSM494640     1   0.000      0.997 1.000 0.000
#> GSM494623     1   0.000      0.997 1.000 0.000
#> GSM494644     1   0.000      0.997 1.000 0.000
#> GSM494646     1   0.000      0.997 1.000 0.000
#> GSM494665     1   0.000      0.997 1.000 0.000
#> GSM494638     1   0.000      0.997 1.000 0.000
#> GSM494645     1   0.000      0.997 1.000 0.000
#> GSM494671     1   0.000      0.997 1.000 0.000
#> GSM494655     1   0.000      0.997 1.000 0.000
#> GSM494620     1   0.000      0.997 1.000 0.000
#> GSM494630     1   0.000      0.997 1.000 0.000
#> GSM494657     2   0.000      0.991 0.000 1.000
#> GSM494667     1   0.000      0.997 1.000 0.000
#> GSM494621     1   0.000      0.997 1.000 0.000
#> GSM494629     1   0.000      0.997 1.000 0.000
#> GSM494637     1   0.000      0.997 1.000 0.000
#> GSM494652     1   0.000      0.997 1.000 0.000
#> GSM494648     1   0.000      0.997 1.000 0.000
#> GSM494650     1   0.000      0.997 1.000 0.000
#> GSM494669     1   0.000      0.997 1.000 0.000
#> GSM494666     1   0.000      0.997 1.000 0.000
#> GSM494668     1   0.000      0.997 1.000 0.000
#> GSM494633     1   0.000      0.997 1.000 0.000
#> GSM494634     1   0.000      0.997 1.000 0.000
#> GSM494639     1   0.000      0.997 1.000 0.000
#> GSM494661     1   0.000      0.997 1.000 0.000
#> GSM494617     1   0.000      0.997 1.000 0.000
#> GSM494626     1   0.000      0.997 1.000 0.000
#> GSM494656     2   0.000      0.991 0.000 1.000
#> GSM494635     1   0.000      0.997 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
#> GSM494565     2  0.4178      0.890 0.172 0.828 0.000
#> GSM494594     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494604     1  0.4702      0.718 0.788 0.212 0.000
#> GSM494564     2  0.4702      0.885 0.212 0.788 0.000
#> GSM494591     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494567     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494602     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494613     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494589     2  0.4702      0.885 0.212 0.788 0.000
#> GSM494598     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494593     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494583     2  0.0237      0.887 0.004 0.996 0.000
#> GSM494612     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494558     3  0.4702      0.740 0.212 0.000 0.788
#> GSM494556     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494559     2  0.4702      0.885 0.212 0.788 0.000
#> GSM494571     3  0.6541      0.689 0.212 0.056 0.732
#> GSM494614     2  0.4702      0.885 0.212 0.788 0.000
#> GSM494603     3  0.4702      0.740 0.212 0.000 0.788
#> GSM494568     3  0.4702      0.740 0.212 0.000 0.788
#> GSM494572     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494600     2  0.4702      0.885 0.212 0.788 0.000
#> GSM494562     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494615     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494582     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494599     1  0.6079      0.487 0.612 0.388 0.000
#> GSM494610     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494587     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494581     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494580     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494563     2  0.3816      0.892 0.148 0.852 0.000
#> GSM494576     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494605     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494584     2  0.3192      0.892 0.112 0.888 0.000
#> GSM494586     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494578     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494585     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494611     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494560     2  0.4702      0.885 0.212 0.788 0.000
#> GSM494595     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494570     3  0.9653     -0.099 0.212 0.364 0.424
#> GSM494597     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494607     1  0.5058      0.690 0.756 0.244 0.000
#> GSM494561     3  0.4702      0.740 0.212 0.000 0.788
#> GSM494569     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494592     1  0.5988      0.525 0.632 0.368 0.000
#> GSM494577     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494588     2  0.4121      0.891 0.168 0.832 0.000
#> GSM494590     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494609     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494608     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494606     1  0.6274      0.329 0.544 0.456 0.000
#> GSM494574     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494573     2  0.4702      0.885 0.212 0.788 0.000
#> GSM494566     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494601     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494557     2  0.5551      0.879 0.212 0.768 0.020
#> GSM494579     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494596     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494575     2  0.0000      0.886 0.000 1.000 0.000
#> GSM494625     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494654     3  0.4702      0.740 0.212 0.000 0.788
#> GSM494664     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494624     3  0.1289      0.869 0.032 0.000 0.968
#> GSM494651     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494662     3  0.1289      0.869 0.032 0.000 0.968
#> GSM494627     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494673     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494649     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494658     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494653     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494643     3  0.1289      0.869 0.032 0.000 0.968
#> GSM494672     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494618     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494631     3  0.4702      0.740 0.212 0.000 0.788
#> GSM494619     3  0.1289      0.869 0.032 0.000 0.968
#> GSM494674     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494616     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494663     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494628     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494632     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494660     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494622     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494642     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494647     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494659     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494670     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494675     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494641     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494636     3  0.1289      0.869 0.032 0.000 0.968
#> GSM494640     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494623     3  0.1289      0.869 0.032 0.000 0.968
#> GSM494644     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494646     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494665     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494638     3  0.6244     -0.176 0.440 0.000 0.560
#> GSM494645     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494671     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494655     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494620     3  0.1289      0.869 0.032 0.000 0.968
#> GSM494630     3  0.1289      0.869 0.032 0.000 0.968
#> GSM494657     2  0.5921      0.875 0.212 0.756 0.032
#> GSM494667     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494621     3  0.1289      0.869 0.032 0.000 0.968
#> GSM494629     3  0.0747      0.872 0.016 0.000 0.984
#> GSM494637     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494652     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494648     3  0.1289      0.869 0.032 0.000 0.968
#> GSM494650     3  0.0000      0.881 0.000 0.000 1.000
#> GSM494669     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494666     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494668     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494633     3  0.1163      0.870 0.028 0.000 0.972
#> GSM494634     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494639     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494661     1  0.4702      0.930 0.788 0.000 0.212
#> GSM494617     3  0.1289      0.869 0.032 0.000 0.968
#> GSM494626     3  0.0747      0.876 0.016 0.000 0.984
#> GSM494656     3  0.4702      0.740 0.212 0.000 0.788
#> GSM494635     1  0.4702      0.930 0.788 0.000 0.212

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     2   0.480      0.444 0.000 0.616 0.384 0.000
#> GSM494594     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494604     1   0.349      0.772 0.812 0.188 0.000 0.000
#> GSM494564     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494591     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494567     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494602     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494613     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494589     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494598     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494593     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494583     2   0.259      0.857 0.000 0.884 0.116 0.000
#> GSM494612     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494558     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494556     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494559     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494571     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494614     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494603     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494568     4   0.380      0.712 0.000 0.000 0.220 0.780
#> GSM494572     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494600     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494562     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494615     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494582     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494599     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494610     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494587     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494581     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494580     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494563     2   0.443      0.610 0.000 0.696 0.304 0.000
#> GSM494576     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494605     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494584     2   0.349      0.778 0.000 0.812 0.188 0.000
#> GSM494586     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494578     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494585     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494611     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494560     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494595     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494570     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494597     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494607     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494561     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494569     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494592     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494577     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494588     2   0.450      0.588 0.000 0.684 0.316 0.000
#> GSM494590     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494609     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494608     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494606     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494574     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494573     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494566     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494601     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494557     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494579     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494596     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494575     2   0.000      0.956 0.000 1.000 0.000 0.000
#> GSM494625     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494654     3   0.312      0.812 0.000 0.000 0.844 0.156
#> GSM494664     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494624     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494651     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494662     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494627     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494673     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494649     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494658     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494653     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494643     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494672     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494618     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494631     3   0.331      0.790 0.000 0.000 0.828 0.172
#> GSM494619     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494674     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494616     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494663     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494628     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494632     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494660     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494622     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494642     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494647     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494659     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494670     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494675     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494641     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494636     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494640     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494623     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494644     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494646     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494665     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494638     4   0.340      0.777 0.180 0.000 0.000 0.820
#> GSM494645     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494671     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494655     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494620     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494630     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494657     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494667     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494621     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494629     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494637     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494652     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494648     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494650     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494669     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494666     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494668     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494633     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494634     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494639     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494661     1   0.000      0.993 1.000 0.000 0.000 0.000
#> GSM494617     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494626     4   0.000      0.986 0.000 0.000 0.000 1.000
#> GSM494656     3   0.000      0.988 0.000 0.000 1.000 0.000
#> GSM494635     1   0.000      0.993 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
#> GSM494565     5  0.2482      0.938 0.000 0.024 0.084 0.000 0.892
#> GSM494594     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494604     1  0.3039      0.748 0.808 0.192 0.000 0.000 0.000
#> GSM494564     5  0.1851      0.945 0.000 0.000 0.088 0.000 0.912
#> GSM494591     3  0.0162      0.969 0.000 0.000 0.996 0.000 0.004
#> GSM494567     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494602     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494613     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494589     5  0.2127      0.942 0.000 0.000 0.108 0.000 0.892
#> GSM494598     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494593     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494583     2  0.3051      0.842 0.000 0.852 0.028 0.000 0.120
#> GSM494612     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494558     3  0.2074      0.904 0.000 0.000 0.920 0.044 0.036
#> GSM494556     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494559     5  0.1851      0.945 0.000 0.000 0.088 0.000 0.912
#> GSM494571     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494614     5  0.3932      0.647 0.000 0.000 0.328 0.000 0.672
#> GSM494603     5  0.2378      0.846 0.000 0.000 0.048 0.048 0.904
#> GSM494568     4  0.3620      0.843 0.000 0.000 0.068 0.824 0.108
#> GSM494572     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494600     5  0.2127      0.942 0.000 0.000 0.108 0.000 0.892
#> GSM494562     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494615     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494582     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494599     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494610     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494587     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494581     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494580     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494563     5  0.2535      0.932 0.000 0.032 0.076 0.000 0.892
#> GSM494576     2  0.0404      0.971 0.000 0.988 0.000 0.000 0.012
#> GSM494605     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494584     2  0.3180      0.842 0.000 0.856 0.076 0.000 0.068
#> GSM494586     2  0.0162      0.976 0.000 0.996 0.000 0.000 0.004
#> GSM494578     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494585     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494611     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494560     5  0.2304      0.943 0.000 0.008 0.100 0.000 0.892
#> GSM494595     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494570     5  0.1544      0.936 0.000 0.000 0.068 0.000 0.932
#> GSM494597     3  0.1544      0.907 0.000 0.000 0.932 0.000 0.068
#> GSM494607     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494561     5  0.1628      0.923 0.000 0.000 0.056 0.008 0.936
#> GSM494569     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494592     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494577     2  0.2020      0.897 0.000 0.900 0.000 0.000 0.100
#> GSM494588     5  0.1671      0.941 0.000 0.000 0.076 0.000 0.924
#> GSM494590     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494609     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494608     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494606     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494574     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494573     5  0.2127      0.942 0.000 0.000 0.108 0.000 0.892
#> GSM494566     2  0.1197      0.944 0.000 0.952 0.000 0.000 0.048
#> GSM494601     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494557     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494579     2  0.1965      0.901 0.000 0.904 0.000 0.000 0.096
#> GSM494596     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494575     2  0.0000      0.979 0.000 1.000 0.000 0.000 0.000
#> GSM494625     4  0.1197      0.940 0.000 0.000 0.000 0.952 0.048
#> GSM494654     3  0.1914      0.906 0.000 0.000 0.924 0.016 0.060
#> GSM494664     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494624     4  0.1197      0.940 0.000 0.000 0.000 0.952 0.048
#> GSM494651     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494662     4  0.0000      0.945 0.000 0.000 0.000 1.000 0.000
#> GSM494627     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494673     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.1197      0.940 0.000 0.000 0.000 0.952 0.048
#> GSM494658     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.0794      0.942 0.000 0.000 0.000 0.972 0.028
#> GSM494672     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494631     3  0.1914      0.906 0.000 0.000 0.924 0.016 0.060
#> GSM494619     4  0.1197      0.940 0.000 0.000 0.000 0.952 0.048
#> GSM494674     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494663     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494628     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494632     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494660     4  0.1197      0.940 0.000 0.000 0.000 0.952 0.048
#> GSM494622     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494642     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494675     3  0.1544      0.907 0.000 0.000 0.932 0.000 0.068
#> GSM494641     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.0000      0.945 0.000 0.000 0.000 1.000 0.000
#> GSM494640     4  0.0000      0.945 0.000 0.000 0.000 1.000 0.000
#> GSM494623     4  0.1197      0.940 0.000 0.000 0.000 0.952 0.048
#> GSM494644     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494665     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494638     4  0.3305      0.708 0.224 0.000 0.000 0.776 0.000
#> GSM494645     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494620     4  0.1197      0.940 0.000 0.000 0.000 0.952 0.048
#> GSM494630     4  0.1197      0.940 0.000 0.000 0.000 0.952 0.048
#> GSM494657     3  0.0000      0.972 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494621     4  0.1197      0.940 0.000 0.000 0.000 0.952 0.048
#> GSM494629     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494637     4  0.0000      0.945 0.000 0.000 0.000 1.000 0.000
#> GSM494652     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494648     4  0.1197      0.940 0.000 0.000 0.000 0.952 0.048
#> GSM494650     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494669     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494633     4  0.1197      0.940 0.000 0.000 0.000 0.952 0.048
#> GSM494634     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494661     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494626     4  0.1410      0.941 0.000 0.000 0.000 0.940 0.060
#> GSM494656     3  0.1300      0.937 0.000 0.000 0.956 0.016 0.028
#> GSM494635     1  0.0000      0.992 1.000 0.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM494565     5  0.0405     0.9392 0.000 0.004 0.008 0.000 0.988 0.000
#> GSM494594     3  0.0000     0.9812 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.3168     0.7355 0.792 0.192 0.000 0.016 0.000 0.000
#> GSM494564     5  0.0508     0.9416 0.000 0.000 0.012 0.000 0.984 0.004
#> GSM494591     3  0.0363     0.9736 0.000 0.000 0.988 0.000 0.012 0.000
#> GSM494567     3  0.0000     0.9812 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494602     2  0.0260     0.9182 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM494613     3  0.0146     0.9809 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494589     5  0.0458     0.9421 0.000 0.000 0.016 0.000 0.984 0.000
#> GSM494598     2  0.1265     0.9120 0.000 0.948 0.000 0.044 0.008 0.000
#> GSM494593     2  0.0260     0.9182 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM494583     2  0.4367     0.5064 0.000 0.604 0.000 0.032 0.364 0.000
#> GSM494612     2  0.0363     0.9177 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494558     4  0.4183     0.0258 0.000 0.000 0.480 0.508 0.012 0.000
#> GSM494556     3  0.0146     0.9809 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494559     5  0.0777     0.9359 0.000 0.000 0.024 0.000 0.972 0.004
#> GSM494571     3  0.0000     0.9812 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494614     5  0.3440     0.7346 0.000 0.000 0.196 0.028 0.776 0.000
#> GSM494603     4  0.4440     0.1787 0.000 0.000 0.016 0.556 0.420 0.008
#> GSM494568     4  0.2001     0.8327 0.000 0.000 0.016 0.920 0.020 0.044
#> GSM494572     3  0.0146     0.9809 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494600     5  0.0458     0.9421 0.000 0.000 0.016 0.000 0.984 0.000
#> GSM494562     2  0.1461     0.9096 0.000 0.940 0.000 0.044 0.016 0.000
#> GSM494615     3  0.0146     0.9809 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494582     2  0.0972     0.9155 0.000 0.964 0.000 0.028 0.008 0.000
#> GSM494599     2  0.0363     0.9177 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494610     2  0.1367     0.9111 0.000 0.944 0.000 0.044 0.012 0.000
#> GSM494587     2  0.1168     0.9137 0.000 0.956 0.000 0.028 0.016 0.000
#> GSM494581     2  0.0363     0.9177 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494580     3  0.0000     0.9812 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494563     5  0.0665     0.9349 0.000 0.004 0.008 0.008 0.980 0.000
#> GSM494576     2  0.1934     0.8971 0.000 0.916 0.000 0.044 0.040 0.000
#> GSM494605     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494584     2  0.4702     0.5926 0.000 0.644 0.020 0.036 0.300 0.000
#> GSM494586     2  0.1461     0.9096 0.000 0.940 0.000 0.044 0.016 0.000
#> GSM494578     3  0.0146     0.9809 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494585     2  0.0603     0.9186 0.000 0.980 0.000 0.016 0.004 0.000
#> GSM494611     2  0.0000     0.9185 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494560     5  0.0508     0.9413 0.000 0.004 0.012 0.000 0.984 0.000
#> GSM494595     2  0.0891     0.9159 0.000 0.968 0.000 0.024 0.008 0.000
#> GSM494570     5  0.0603     0.9406 0.000 0.000 0.016 0.000 0.980 0.004
#> GSM494597     3  0.2176     0.8890 0.000 0.000 0.896 0.024 0.080 0.000
#> GSM494607     2  0.0692     0.9163 0.004 0.976 0.000 0.020 0.000 0.000
#> GSM494561     5  0.3922     0.5212 0.000 0.000 0.016 0.000 0.664 0.320
#> GSM494569     4  0.1387     0.8580 0.000 0.000 0.000 0.932 0.000 0.068
#> GSM494592     2  0.0363     0.9177 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494577     2  0.4453     0.5599 0.000 0.624 0.000 0.044 0.332 0.000
#> GSM494588     5  0.0405     0.9403 0.000 0.000 0.008 0.000 0.988 0.004
#> GSM494590     3  0.0000     0.9812 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     2  0.0363     0.9177 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494608     2  0.0363     0.9177 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494606     2  0.0363     0.9177 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494574     2  0.1367     0.9111 0.000 0.944 0.000 0.044 0.012 0.000
#> GSM494573     5  0.0458     0.9421 0.000 0.000 0.016 0.000 0.984 0.000
#> GSM494566     2  0.3980     0.7182 0.000 0.732 0.000 0.052 0.216 0.000
#> GSM494601     2  0.0260     0.9182 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM494557     3  0.0146     0.9809 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494579     2  0.4371     0.6306 0.000 0.664 0.000 0.052 0.284 0.000
#> GSM494596     3  0.0000     0.9812 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0260     0.9182 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM494625     6  0.0000     0.8555 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0405     0.9735 0.000 0.000 0.988 0.004 0.008 0.000
#> GSM494664     1  0.0260     0.9834 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM494624     6  0.0000     0.8555 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494651     4  0.1387     0.8580 0.000 0.000 0.000 0.932 0.000 0.068
#> GSM494662     6  0.3955     0.3051 0.000 0.000 0.000 0.436 0.004 0.560
#> GSM494627     4  0.1866     0.8533 0.000 0.000 0.000 0.908 0.008 0.084
#> GSM494673     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     6  0.0260     0.8546 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM494658     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     6  0.0405     0.8530 0.000 0.000 0.000 0.008 0.004 0.988
#> GSM494672     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.1387     0.8580 0.000 0.000 0.000 0.932 0.000 0.068
#> GSM494631     3  0.1462     0.9306 0.000 0.000 0.936 0.056 0.008 0.000
#> GSM494619     6  0.0000     0.8555 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.1387     0.8580 0.000 0.000 0.000 0.932 0.000 0.068
#> GSM494663     4  0.1970     0.8482 0.000 0.000 0.000 0.900 0.008 0.092
#> GSM494628     4  0.1757     0.8560 0.000 0.000 0.000 0.916 0.008 0.076
#> GSM494632     1  0.0858     0.9639 0.968 0.000 0.000 0.028 0.004 0.000
#> GSM494660     6  0.0260     0.8546 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM494622     4  0.1701     0.8549 0.000 0.000 0.000 0.920 0.008 0.072
#> GSM494642     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494675     3  0.2176     0.8890 0.000 0.000 0.896 0.024 0.080 0.000
#> GSM494641     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     6  0.3996     0.1704 0.000 0.000 0.000 0.484 0.004 0.512
#> GSM494640     6  0.3955     0.3051 0.000 0.000 0.000 0.436 0.004 0.560
#> GSM494623     6  0.0000     0.8555 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494644     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.0508     0.9774 0.984 0.000 0.000 0.012 0.004 0.000
#> GSM494665     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494638     4  0.5493     0.2585 0.396 0.000 0.000 0.488 0.004 0.112
#> GSM494645     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.0000     0.8555 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494630     6  0.0260     0.8546 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM494657     3  0.0000     0.9812 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0000     0.8555 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494629     4  0.1814     0.8322 0.000 0.000 0.000 0.900 0.000 0.100
#> GSM494637     6  0.3955     0.3051 0.000 0.000 0.000 0.436 0.004 0.560
#> GSM494652     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.0000     0.8555 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494650     4  0.1757     0.8560 0.000 0.000 0.000 0.916 0.008 0.076
#> GSM494669     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     6  0.0260     0.8546 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM494634     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.0603     0.9745 0.980 0.000 0.000 0.016 0.004 0.000
#> GSM494661     1  0.0000     0.9890 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.1387     0.8580 0.000 0.000 0.000 0.932 0.000 0.068
#> GSM494626     4  0.1387     0.8580 0.000 0.000 0.000 0.932 0.000 0.068
#> GSM494656     3  0.0260     0.9763 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM494635     1  0.0146     0.9864 0.996 0.000 0.000 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-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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 4)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-skmeans-collect-classes

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

test_to_known_factors(res)
#>              n disease.state(p) age(p) other(p) individual(p) k
#> SD:skmeans 120         6.85e-20  1.000 2.52e-15         1.000 2
#> SD:skmeans 116         7.06e-17  0.322 4.98e-11         0.826 3
#> SD:skmeans 119         7.86e-19  0.430 1.03e-12         0.858 4
#> SD:skmeans 120         1.26e-18  0.361 1.23e-13         0.664 5
#> SD:skmeans 113         1.21e-16  0.201 5.16e-10         0.383 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 51941 rows and 120 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.966           0.969       0.987         0.5043 0.496   0.496
#> 3 3 0.866           0.867       0.945         0.2995 0.782   0.588
#> 4 4 0.768           0.858       0.901         0.0871 0.876   0.678
#> 5 5 0.803           0.771       0.877         0.0738 0.941   0.804
#> 6 6 0.847           0.837       0.911         0.0690 0.883   0.568

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
#> GSM494565     2   0.000      0.976 0.000 1.000
#> GSM494594     2   0.000      0.976 0.000 1.000
#> GSM494604     1   0.000      0.996 1.000 0.000
#> GSM494564     2   0.000      0.976 0.000 1.000
#> GSM494591     2   0.000      0.976 0.000 1.000
#> GSM494567     2   0.000      0.976 0.000 1.000
#> GSM494602     2   0.000      0.976 0.000 1.000
#> GSM494613     2   0.000      0.976 0.000 1.000
#> GSM494589     2   0.000      0.976 0.000 1.000
#> GSM494598     2   0.000      0.976 0.000 1.000
#> GSM494593     2   0.000      0.976 0.000 1.000
#> GSM494583     2   0.000      0.976 0.000 1.000
#> GSM494612     2   0.000      0.976 0.000 1.000
#> GSM494558     2   0.615      0.817 0.152 0.848
#> GSM494556     2   0.000      0.976 0.000 1.000
#> GSM494559     2   0.000      0.976 0.000 1.000
#> GSM494571     2   0.000      0.976 0.000 1.000
#> GSM494614     2   0.000      0.976 0.000 1.000
#> GSM494603     2   0.000      0.976 0.000 1.000
#> GSM494568     1   0.506      0.871 0.888 0.112
#> GSM494572     2   0.000      0.976 0.000 1.000
#> GSM494600     2   0.000      0.976 0.000 1.000
#> GSM494562     2   0.000      0.976 0.000 1.000
#> GSM494615     2   0.000      0.976 0.000 1.000
#> GSM494582     2   0.000      0.976 0.000 1.000
#> GSM494599     2   0.662      0.791 0.172 0.828
#> GSM494610     2   0.000      0.976 0.000 1.000
#> GSM494587     2   0.000      0.976 0.000 1.000
#> GSM494581     2   0.000      0.976 0.000 1.000
#> GSM494580     2   0.000      0.976 0.000 1.000
#> GSM494563     2   0.000      0.976 0.000 1.000
#> GSM494576     2   0.000      0.976 0.000 1.000
#> GSM494605     1   0.000      0.996 1.000 0.000
#> GSM494584     2   0.000      0.976 0.000 1.000
#> GSM494586     2   0.000      0.976 0.000 1.000
#> GSM494578     2   0.000      0.976 0.000 1.000
#> GSM494585     2   0.000      0.976 0.000 1.000
#> GSM494611     2   0.000      0.976 0.000 1.000
#> GSM494560     2   0.000      0.976 0.000 1.000
#> GSM494595     2   0.000      0.976 0.000 1.000
#> GSM494570     2   0.000      0.976 0.000 1.000
#> GSM494597     2   0.000      0.976 0.000 1.000
#> GSM494607     2   0.000      0.976 0.000 1.000
#> GSM494561     2   0.949      0.435 0.368 0.632
#> GSM494569     1   0.000      0.996 1.000 0.000
#> GSM494592     2   0.000      0.976 0.000 1.000
#> GSM494577     2   0.000      0.976 0.000 1.000
#> GSM494588     2   0.000      0.976 0.000 1.000
#> GSM494590     2   0.000      0.976 0.000 1.000
#> GSM494609     2   0.000      0.976 0.000 1.000
#> GSM494608     2   0.909      0.533 0.324 0.676
#> GSM494606     2   0.000      0.976 0.000 1.000
#> GSM494574     2   0.000      0.976 0.000 1.000
#> GSM494573     2   0.000      0.976 0.000 1.000
#> GSM494566     2   0.000      0.976 0.000 1.000
#> GSM494601     2   0.000      0.976 0.000 1.000
#> GSM494557     2   0.000      0.976 0.000 1.000
#> GSM494579     2   0.000      0.976 0.000 1.000
#> GSM494596     2   0.000      0.976 0.000 1.000
#> GSM494575     2   0.000      0.976 0.000 1.000
#> GSM494625     1   0.000      0.996 1.000 0.000
#> GSM494654     1   0.506      0.871 0.888 0.112
#> GSM494664     1   0.000      0.996 1.000 0.000
#> GSM494624     1   0.000      0.996 1.000 0.000
#> GSM494651     1   0.000      0.996 1.000 0.000
#> GSM494662     1   0.000      0.996 1.000 0.000
#> GSM494627     1   0.000      0.996 1.000 0.000
#> GSM494673     1   0.000      0.996 1.000 0.000
#> GSM494649     1   0.000      0.996 1.000 0.000
#> GSM494658     1   0.000      0.996 1.000 0.000
#> GSM494653     1   0.000      0.996 1.000 0.000
#> GSM494643     1   0.000      0.996 1.000 0.000
#> GSM494672     1   0.000      0.996 1.000 0.000
#> GSM494618     1   0.000      0.996 1.000 0.000
#> GSM494631     2   0.936      0.470 0.352 0.648
#> GSM494619     1   0.000      0.996 1.000 0.000
#> GSM494674     1   0.000      0.996 1.000 0.000
#> GSM494616     1   0.000      0.996 1.000 0.000
#> GSM494663     1   0.000      0.996 1.000 0.000
#> GSM494628     1   0.000      0.996 1.000 0.000
#> GSM494632     1   0.000      0.996 1.000 0.000
#> GSM494660     1   0.000      0.996 1.000 0.000
#> GSM494622     1   0.000      0.996 1.000 0.000
#> GSM494642     1   0.000      0.996 1.000 0.000
#> GSM494647     1   0.000      0.996 1.000 0.000
#> GSM494659     1   0.000      0.996 1.000 0.000
#> GSM494670     1   0.000      0.996 1.000 0.000
#> GSM494675     2   0.000      0.976 0.000 1.000
#> GSM494641     1   0.000      0.996 1.000 0.000
#> GSM494636     1   0.000      0.996 1.000 0.000
#> GSM494640     1   0.000      0.996 1.000 0.000
#> GSM494623     1   0.000      0.996 1.000 0.000
#> GSM494644     1   0.000      0.996 1.000 0.000
#> GSM494646     1   0.000      0.996 1.000 0.000
#> GSM494665     1   0.000      0.996 1.000 0.000
#> GSM494638     1   0.000      0.996 1.000 0.000
#> GSM494645     1   0.000      0.996 1.000 0.000
#> GSM494671     1   0.000      0.996 1.000 0.000
#> GSM494655     1   0.000      0.996 1.000 0.000
#> GSM494620     1   0.000      0.996 1.000 0.000
#> GSM494630     1   0.000      0.996 1.000 0.000
#> GSM494657     2   0.000      0.976 0.000 1.000
#> GSM494667     1   0.000      0.996 1.000 0.000
#> GSM494621     1   0.000      0.996 1.000 0.000
#> GSM494629     1   0.000      0.996 1.000 0.000
#> GSM494637     1   0.000      0.996 1.000 0.000
#> GSM494652     1   0.000      0.996 1.000 0.000
#> GSM494648     1   0.000      0.996 1.000 0.000
#> GSM494650     1   0.000      0.996 1.000 0.000
#> GSM494669     1   0.000      0.996 1.000 0.000
#> GSM494666     1   0.000      0.996 1.000 0.000
#> GSM494668     1   0.000      0.996 1.000 0.000
#> GSM494633     1   0.000      0.996 1.000 0.000
#> GSM494634     1   0.000      0.996 1.000 0.000
#> GSM494639     1   0.000      0.996 1.000 0.000
#> GSM494661     1   0.000      0.996 1.000 0.000
#> GSM494617     1   0.000      0.996 1.000 0.000
#> GSM494626     1   0.000      0.996 1.000 0.000
#> GSM494656     2   0.000      0.976 0.000 1.000
#> GSM494635     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
#> GSM494565     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494594     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494604     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494564     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494591     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494567     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494602     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494613     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494589     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494598     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494593     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494583     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494612     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494558     3  0.4452     0.6934 0.000 0.192 0.808
#> GSM494556     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494559     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494571     2  0.6079     0.3987 0.000 0.612 0.388
#> GSM494614     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494603     2  0.6095     0.3898 0.000 0.608 0.392
#> GSM494568     3  0.0747     0.8640 0.000 0.016 0.984
#> GSM494572     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494600     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494562     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494615     2  0.1163     0.9447 0.000 0.972 0.028
#> GSM494582     2  0.0424     0.9630 0.008 0.992 0.000
#> GSM494599     1  0.3816     0.7912 0.852 0.148 0.000
#> GSM494610     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494587     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494581     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494580     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494563     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494576     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494605     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494584     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494586     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494578     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494585     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494611     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494560     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494595     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494570     2  0.5431     0.6090 0.000 0.716 0.284
#> GSM494597     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494607     1  0.4346     0.7445 0.816 0.184 0.000
#> GSM494561     3  0.5926     0.3799 0.000 0.356 0.644
#> GSM494569     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494592     1  0.0592     0.9466 0.988 0.012 0.000
#> GSM494577     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494588     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494590     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494609     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494608     1  0.6518     0.6992 0.752 0.168 0.080
#> GSM494606     2  0.5948     0.4248 0.360 0.640 0.000
#> GSM494574     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494573     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494566     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494601     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494557     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494579     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494596     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494575     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494625     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494654     3  0.0424     0.8695 0.000 0.008 0.992
#> GSM494664     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494624     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494651     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494662     3  0.6095     0.4285 0.392 0.000 0.608
#> GSM494627     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494673     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494649     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494658     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494653     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494643     3  0.0237     0.8727 0.004 0.000 0.996
#> GSM494672     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494618     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494631     3  0.2537     0.8169 0.000 0.080 0.920
#> GSM494619     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494674     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494616     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494663     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494628     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494632     3  0.6095     0.4285 0.392 0.000 0.608
#> GSM494660     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494622     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494642     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494647     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494659     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494670     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494675     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494641     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494636     3  0.0424     0.8710 0.008 0.000 0.992
#> GSM494640     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494623     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494644     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494646     1  0.6204     0.0937 0.576 0.000 0.424
#> GSM494665     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494638     3  0.6095     0.4285 0.392 0.000 0.608
#> GSM494645     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494671     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494655     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494620     3  0.6095     0.4285 0.392 0.000 0.608
#> GSM494630     3  0.6095     0.4285 0.392 0.000 0.608
#> GSM494657     2  0.0000     0.9703 0.000 1.000 0.000
#> GSM494667     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494621     3  0.0747     0.8669 0.016 0.000 0.984
#> GSM494629     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494637     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494652     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494648     3  0.6095     0.4285 0.392 0.000 0.608
#> GSM494650     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494669     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494666     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494668     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494633     3  0.0000     0.8740 0.000 0.000 1.000
#> GSM494634     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494639     3  0.6095     0.4285 0.392 0.000 0.608
#> GSM494661     1  0.0000     0.9582 1.000 0.000 0.000
#> GSM494617     3  0.0747     0.8669 0.016 0.000 0.984
#> GSM494626     3  0.0237     0.8727 0.004 0.000 0.996
#> GSM494656     3  0.3551     0.7591 0.000 0.132 0.868
#> GSM494635     3  0.6308     0.1523 0.492 0.000 0.508

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494594     2  0.3870      0.881 0.000 0.788 0.004 0.208
#> GSM494604     1  0.3074      0.820 0.848 0.152 0.000 0.000
#> GSM494564     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494591     2  0.3870      0.881 0.000 0.788 0.004 0.208
#> GSM494567     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494602     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494613     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494589     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494598     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494593     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494583     2  0.3402      0.894 0.000 0.832 0.004 0.164
#> GSM494612     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494558     3  0.3311      0.737 0.000 0.000 0.828 0.172
#> GSM494556     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494559     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494571     2  0.7325      0.526 0.000 0.528 0.264 0.208
#> GSM494614     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494603     3  0.4379      0.702 0.000 0.036 0.792 0.172
#> GSM494568     3  0.1557      0.842 0.000 0.000 0.944 0.056
#> GSM494572     2  0.3870      0.881 0.000 0.788 0.004 0.208
#> GSM494600     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494562     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494615     3  0.6439      0.505 0.000 0.180 0.648 0.172
#> GSM494582     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494599     1  0.3764      0.758 0.784 0.216 0.000 0.000
#> GSM494610     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494587     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494581     2  0.0336      0.877 0.000 0.992 0.000 0.008
#> GSM494580     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494563     2  0.3448      0.894 0.000 0.828 0.004 0.168
#> GSM494576     2  0.0188      0.876 0.000 0.996 0.000 0.004
#> GSM494605     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494584     2  0.3355      0.894 0.000 0.836 0.004 0.160
#> GSM494586     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494578     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494585     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494611     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494560     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494595     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494570     4  0.1211      0.663 0.000 0.040 0.000 0.960
#> GSM494597     2  0.3831      0.882 0.000 0.792 0.004 0.204
#> GSM494607     1  0.3764      0.758 0.784 0.216 0.000 0.000
#> GSM494561     4  0.1661      0.700 0.000 0.004 0.052 0.944
#> GSM494569     3  0.0188      0.883 0.004 0.000 0.996 0.000
#> GSM494592     1  0.3356      0.800 0.824 0.176 0.000 0.000
#> GSM494577     2  0.0336      0.877 0.000 0.992 0.000 0.008
#> GSM494588     2  0.5163      0.487 0.000 0.516 0.004 0.480
#> GSM494590     2  0.3870      0.881 0.000 0.788 0.004 0.208
#> GSM494609     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494608     1  0.6110      0.664 0.720 0.176 0.064 0.040
#> GSM494606     2  0.1940      0.815 0.076 0.924 0.000 0.000
#> GSM494574     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494573     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494566     2  0.0895      0.880 0.000 0.976 0.004 0.020
#> GSM494601     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494557     2  0.3494      0.893 0.000 0.824 0.004 0.172
#> GSM494579     2  0.2831      0.892 0.000 0.876 0.004 0.120
#> GSM494596     2  0.3870      0.881 0.000 0.788 0.004 0.208
#> GSM494575     2  0.0000      0.875 0.000 1.000 0.000 0.000
#> GSM494625     4  0.3688      0.934 0.000 0.000 0.208 0.792
#> GSM494654     3  0.3688      0.712 0.000 0.000 0.792 0.208
#> GSM494664     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494624     4  0.3688      0.934 0.000 0.000 0.208 0.792
#> GSM494651     3  0.0188      0.883 0.004 0.000 0.996 0.000
#> GSM494662     1  0.3688      0.750 0.792 0.000 0.208 0.000
#> GSM494627     3  0.0188      0.882 0.000 0.000 0.996 0.004
#> GSM494673     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494649     4  0.3688      0.934 0.000 0.000 0.208 0.792
#> GSM494658     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494643     4  0.4661      0.742 0.000 0.000 0.348 0.652
#> GSM494672     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494618     3  0.0188      0.883 0.004 0.000 0.996 0.000
#> GSM494631     2  0.5386      0.520 0.000 0.632 0.344 0.024
#> GSM494619     4  0.3688      0.934 0.000 0.000 0.208 0.792
#> GSM494674     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494616     3  0.0188      0.883 0.004 0.000 0.996 0.000
#> GSM494663     3  0.0188      0.882 0.000 0.000 0.996 0.004
#> GSM494628     3  0.0188      0.882 0.000 0.000 0.996 0.004
#> GSM494632     1  0.3688      0.750 0.792 0.000 0.208 0.000
#> GSM494660     4  0.3688      0.934 0.000 0.000 0.208 0.792
#> GSM494622     3  0.0188      0.883 0.004 0.000 0.996 0.000
#> GSM494642     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494675     2  0.3636      0.892 0.000 0.820 0.008 0.172
#> GSM494641     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494636     1  0.4776      0.497 0.624 0.000 0.376 0.000
#> GSM494640     3  0.0336      0.879 0.000 0.000 0.992 0.008
#> GSM494623     4  0.3688      0.934 0.000 0.000 0.208 0.792
#> GSM494644     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494646     1  0.1389      0.892 0.952 0.000 0.048 0.000
#> GSM494665     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494638     1  0.3688      0.750 0.792 0.000 0.208 0.000
#> GSM494645     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494620     4  0.3688      0.934 0.000 0.000 0.208 0.792
#> GSM494630     4  0.3688      0.934 0.000 0.000 0.208 0.792
#> GSM494657     2  0.3870      0.881 0.000 0.788 0.004 0.208
#> GSM494667     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494621     4  0.3688      0.934 0.000 0.000 0.208 0.792
#> GSM494629     3  0.0188      0.882 0.000 0.000 0.996 0.004
#> GSM494637     3  0.1489      0.842 0.004 0.000 0.952 0.044
#> GSM494652     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494648     4  0.3688      0.934 0.000 0.000 0.208 0.792
#> GSM494650     3  0.0188      0.883 0.004 0.000 0.996 0.000
#> GSM494669     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494633     4  0.3688      0.934 0.000 0.000 0.208 0.792
#> GSM494634     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494639     1  0.3688      0.750 0.792 0.000 0.208 0.000
#> GSM494661     1  0.0000      0.922 1.000 0.000 0.000 0.000
#> GSM494617     3  0.0817      0.863 0.024 0.000 0.976 0.000
#> GSM494626     3  0.0188      0.883 0.004 0.000 0.996 0.000
#> GSM494656     3  0.4137      0.702 0.000 0.012 0.780 0.208
#> GSM494635     1  0.3311      0.789 0.828 0.000 0.172 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
#> GSM494565     2  0.4588    0.60402 0.000 0.604 0.380 0.000 0.016
#> GSM494594     3  0.0000    0.89651 0.000 0.000 1.000 0.000 0.000
#> GSM494604     1  0.2966    0.77300 0.816 0.184 0.000 0.000 0.000
#> GSM494564     2  0.4171    0.59898 0.000 0.604 0.396 0.000 0.000
#> GSM494591     3  0.0510    0.88070 0.000 0.000 0.984 0.000 0.016
#> GSM494567     2  0.4278    0.50155 0.000 0.548 0.452 0.000 0.000
#> GSM494602     2  0.0000    0.72512 0.000 1.000 0.000 0.000 0.000
#> GSM494613     2  0.4171    0.59898 0.000 0.604 0.396 0.000 0.000
#> GSM494589     2  0.4171    0.59898 0.000 0.604 0.396 0.000 0.000
#> GSM494598     2  0.0963    0.72550 0.000 0.964 0.000 0.000 0.036
#> GSM494593     2  0.0000    0.72512 0.000 1.000 0.000 0.000 0.000
#> GSM494583     2  0.4551    0.61079 0.000 0.616 0.368 0.000 0.016
#> GSM494612     2  0.0000    0.72512 0.000 1.000 0.000 0.000 0.000
#> GSM494558     4  0.3242    0.64947 0.000 0.000 0.216 0.784 0.000
#> GSM494556     2  0.4171    0.59898 0.000 0.604 0.396 0.000 0.000
#> GSM494559     2  0.4138    0.60585 0.000 0.616 0.384 0.000 0.000
#> GSM494571     3  0.0000    0.89651 0.000 0.000 1.000 0.000 0.000
#> GSM494614     2  0.4060    0.62209 0.000 0.640 0.360 0.000 0.000
#> GSM494603     4  0.3242    0.64947 0.000 0.000 0.216 0.784 0.000
#> GSM494568     4  0.1341    0.87448 0.000 0.000 0.056 0.944 0.000
#> GSM494572     3  0.0000    0.89651 0.000 0.000 1.000 0.000 0.000
#> GSM494600     2  0.4505    0.60321 0.000 0.604 0.384 0.000 0.012
#> GSM494562     2  0.0963    0.72550 0.000 0.964 0.000 0.000 0.036
#> GSM494615     4  0.4171    0.21585 0.000 0.000 0.396 0.604 0.000
#> GSM494582     2  0.0404    0.72477 0.000 0.988 0.000 0.000 0.012
#> GSM494599     1  0.4291    0.42541 0.536 0.464 0.000 0.000 0.000
#> GSM494610     2  0.0963    0.72550 0.000 0.964 0.000 0.000 0.036
#> GSM494587     2  0.0794    0.72796 0.000 0.972 0.028 0.000 0.000
#> GSM494581     2  0.0703    0.72797 0.000 0.976 0.024 0.000 0.000
#> GSM494580     2  0.4268    0.51814 0.000 0.556 0.444 0.000 0.000
#> GSM494563     2  0.4921    0.60991 0.000 0.604 0.360 0.000 0.036
#> GSM494576     2  0.1106    0.72784 0.000 0.964 0.012 0.000 0.024
#> GSM494605     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494584     2  0.4126    0.61298 0.000 0.620 0.380 0.000 0.000
#> GSM494586     2  0.0963    0.72550 0.000 0.964 0.000 0.000 0.036
#> GSM494578     2  0.4171    0.59898 0.000 0.604 0.396 0.000 0.000
#> GSM494585     2  0.0000    0.72512 0.000 1.000 0.000 0.000 0.000
#> GSM494611     2  0.0404    0.72477 0.000 0.988 0.000 0.000 0.012
#> GSM494560     2  0.4171    0.59898 0.000 0.604 0.396 0.000 0.000
#> GSM494595     2  0.0000    0.72512 0.000 1.000 0.000 0.000 0.000
#> GSM494570     5  0.3305    0.63283 0.000 0.000 0.224 0.000 0.776
#> GSM494597     3  0.3961    0.45900 0.000 0.248 0.736 0.000 0.016
#> GSM494607     1  0.4467    0.58861 0.640 0.344 0.000 0.000 0.016
#> GSM494561     5  0.3318    0.68656 0.000 0.008 0.192 0.000 0.800
#> GSM494569     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494592     1  0.4291    0.42541 0.536 0.464 0.000 0.000 0.000
#> GSM494577     2  0.0963    0.72550 0.000 0.964 0.000 0.000 0.036
#> GSM494588     3  0.6824   -0.00931 0.000 0.332 0.344 0.000 0.324
#> GSM494590     3  0.0000    0.89651 0.000 0.000 1.000 0.000 0.000
#> GSM494609     2  0.0000    0.72512 0.000 1.000 0.000 0.000 0.000
#> GSM494608     1  0.6460    0.34034 0.496 0.388 0.040 0.076 0.000
#> GSM494606     2  0.0963    0.69274 0.036 0.964 0.000 0.000 0.000
#> GSM494574     2  0.0963    0.72550 0.000 0.964 0.000 0.000 0.036
#> GSM494573     2  0.4310    0.60070 0.000 0.604 0.392 0.000 0.004
#> GSM494566     2  0.3336    0.67514 0.000 0.772 0.228 0.000 0.000
#> GSM494601     2  0.0000    0.72512 0.000 1.000 0.000 0.000 0.000
#> GSM494557     2  0.4171    0.59898 0.000 0.604 0.396 0.000 0.000
#> GSM494579     2  0.3655    0.69223 0.000 0.804 0.160 0.000 0.036
#> GSM494596     3  0.0000    0.89651 0.000 0.000 1.000 0.000 0.000
#> GSM494575     2  0.0000    0.72512 0.000 1.000 0.000 0.000 0.000
#> GSM494625     5  0.0963    0.92727 0.000 0.000 0.000 0.036 0.964
#> GSM494654     3  0.0000    0.89651 0.000 0.000 1.000 0.000 0.000
#> GSM494664     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494624     5  0.0963    0.92727 0.000 0.000 0.000 0.036 0.964
#> GSM494651     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494662     1  0.3242    0.74966 0.784 0.000 0.000 0.216 0.000
#> GSM494627     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494673     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494649     5  0.0963    0.92727 0.000 0.000 0.000 0.036 0.964
#> GSM494658     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494643     5  0.3242    0.76116 0.000 0.000 0.000 0.216 0.784
#> GSM494672     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494631     2  0.5874    0.52829 0.000 0.604 0.208 0.188 0.000
#> GSM494619     5  0.0963    0.92727 0.000 0.000 0.000 0.036 0.964
#> GSM494674     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494663     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494628     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494632     1  0.3242    0.74966 0.784 0.000 0.000 0.216 0.000
#> GSM494660     5  0.3003    0.79561 0.000 0.000 0.000 0.188 0.812
#> GSM494622     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494642     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494675     2  0.5639    0.47290 0.000 0.524 0.396 0.080 0.000
#> GSM494641     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494636     1  0.3242    0.74966 0.784 0.000 0.000 0.216 0.000
#> GSM494640     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494623     5  0.0963    0.92727 0.000 0.000 0.000 0.036 0.964
#> GSM494644     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.0880    0.88468 0.968 0.000 0.000 0.032 0.000
#> GSM494665     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494638     1  0.3242    0.74966 0.784 0.000 0.000 0.216 0.000
#> GSM494645     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494620     5  0.0963    0.92727 0.000 0.000 0.000 0.036 0.964
#> GSM494630     5  0.0963    0.92727 0.000 0.000 0.000 0.036 0.964
#> GSM494657     3  0.0000    0.89651 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494621     5  0.0963    0.92727 0.000 0.000 0.000 0.036 0.964
#> GSM494629     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494637     4  0.0794    0.90143 0.000 0.000 0.000 0.972 0.028
#> GSM494652     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494648     5  0.0963    0.92727 0.000 0.000 0.000 0.036 0.964
#> GSM494650     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494669     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494633     5  0.0963    0.92727 0.000 0.000 0.000 0.036 0.964
#> GSM494634     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.3242    0.74966 0.784 0.000 0.000 0.216 0.000
#> GSM494661     1  0.0000    0.90132 1.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494626     4  0.0000    0.92478 0.000 0.000 0.000 1.000 0.000
#> GSM494656     3  0.0000    0.89651 0.000 0.000 1.000 0.000 0.000
#> GSM494635     1  0.2929    0.78143 0.820 0.000 0.000 0.180 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
#> GSM494565     5  0.2048      0.844 0.000 0.000 0.120 0.000 0.880 0.000
#> GSM494594     3  0.0000      0.924 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.2346      0.847 0.868 0.124 0.000 0.000 0.008 0.000
#> GSM494564     5  0.2697      0.849 0.000 0.000 0.188 0.000 0.812 0.000
#> GSM494591     3  0.1267      0.863 0.000 0.000 0.940 0.000 0.060 0.000
#> GSM494567     3  0.0790      0.904 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM494602     2  0.0000      0.848 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494613     2  0.4494      0.261 0.000 0.544 0.424 0.000 0.032 0.000
#> GSM494589     5  0.2697      0.849 0.000 0.000 0.188 0.000 0.812 0.000
#> GSM494598     2  0.2762      0.809 0.000 0.804 0.000 0.000 0.196 0.000
#> GSM494593     2  0.0000      0.848 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494583     5  0.2311      0.792 0.000 0.104 0.016 0.000 0.880 0.000
#> GSM494612     2  0.0000      0.848 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     4  0.2941      0.686 0.000 0.000 0.220 0.780 0.000 0.000
#> GSM494556     5  0.3672      0.610 0.000 0.000 0.368 0.000 0.632 0.000
#> GSM494559     5  0.3423      0.820 0.000 0.100 0.088 0.000 0.812 0.000
#> GSM494571     3  0.0000      0.924 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494614     5  0.3672      0.610 0.000 0.000 0.368 0.000 0.632 0.000
#> GSM494603     4  0.2941      0.686 0.000 0.000 0.220 0.780 0.000 0.000
#> GSM494568     4  0.1267      0.861 0.000 0.000 0.060 0.940 0.000 0.000
#> GSM494572     3  0.0000      0.924 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494600     5  0.2092      0.846 0.000 0.000 0.124 0.000 0.876 0.000
#> GSM494562     2  0.2941      0.802 0.000 0.780 0.000 0.000 0.220 0.000
#> GSM494615     4  0.3672      0.448 0.000 0.000 0.368 0.632 0.000 0.000
#> GSM494582     2  0.1814      0.831 0.000 0.900 0.000 0.000 0.100 0.000
#> GSM494599     2  0.0000      0.848 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494610     2  0.2941      0.802 0.000 0.780 0.000 0.000 0.220 0.000
#> GSM494587     2  0.2815      0.777 0.000 0.848 0.120 0.000 0.032 0.000
#> GSM494581     2  0.2384      0.797 0.000 0.884 0.084 0.000 0.032 0.000
#> GSM494580     3  0.0790      0.904 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM494563     5  0.0000      0.771 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494576     2  0.3672      0.788 0.000 0.776 0.056 0.000 0.168 0.000
#> GSM494605     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494584     2  0.4958      0.340 0.000 0.560 0.364 0.000 0.076 0.000
#> GSM494586     2  0.2941      0.802 0.000 0.780 0.000 0.000 0.220 0.000
#> GSM494578     3  0.0790      0.904 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM494585     2  0.0790      0.841 0.000 0.968 0.000 0.000 0.032 0.000
#> GSM494611     2  0.1814      0.831 0.000 0.900 0.000 0.000 0.100 0.000
#> GSM494560     5  0.2697      0.849 0.000 0.000 0.188 0.000 0.812 0.000
#> GSM494595     2  0.0000      0.848 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494570     5  0.3585      0.835 0.000 0.000 0.172 0.000 0.780 0.048
#> GSM494597     3  0.1556      0.851 0.000 0.000 0.920 0.000 0.080 0.000
#> GSM494607     2  0.5374      0.250 0.380 0.504 0.000 0.000 0.116 0.000
#> GSM494561     6  0.3508      0.744 0.000 0.068 0.132 0.000 0.000 0.800
#> GSM494569     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494592     2  0.0000      0.848 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494577     5  0.0000      0.771 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494588     5  0.3673      0.818 0.000 0.100 0.088 0.000 0.804 0.008
#> GSM494590     3  0.0000      0.924 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     2  0.0000      0.848 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494608     2  0.1367      0.819 0.044 0.944 0.000 0.012 0.000 0.000
#> GSM494606     2  0.0000      0.848 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494574     2  0.2697      0.810 0.000 0.812 0.000 0.000 0.188 0.000
#> GSM494573     5  0.2664      0.851 0.000 0.000 0.184 0.000 0.816 0.000
#> GSM494566     2  0.6358      0.274 0.000 0.496 0.244 0.228 0.032 0.000
#> GSM494601     2  0.0000      0.848 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494557     3  0.4508      0.171 0.000 0.396 0.568 0.000 0.036 0.000
#> GSM494579     2  0.3348      0.798 0.000 0.768 0.016 0.000 0.216 0.000
#> GSM494596     3  0.0000      0.924 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0000      0.848 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     6  0.0000      0.942 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0000      0.924 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494664     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494624     6  0.0000      0.942 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494651     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494662     1  0.2941      0.774 0.780 0.000 0.000 0.220 0.000 0.000
#> GSM494627     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494673     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     6  0.0000      0.942 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494658     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     6  0.2941      0.729 0.000 0.000 0.000 0.220 0.000 0.780
#> GSM494672     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494631     4  0.3385      0.722 0.000 0.000 0.180 0.788 0.032 0.000
#> GSM494619     6  0.0000      0.942 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494663     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494628     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494632     1  0.2941      0.774 0.780 0.000 0.000 0.220 0.000 0.000
#> GSM494660     6  0.2664      0.777 0.000 0.000 0.000 0.184 0.000 0.816
#> GSM494622     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494642     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494675     4  0.5285      0.270 0.000 0.000 0.368 0.524 0.108 0.000
#> GSM494641     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     1  0.2941      0.774 0.780 0.000 0.000 0.220 0.000 0.000
#> GSM494640     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494623     6  0.0000      0.942 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494644     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.0937      0.925 0.960 0.000 0.000 0.040 0.000 0.000
#> GSM494665     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494638     1  0.2941      0.774 0.780 0.000 0.000 0.220 0.000 0.000
#> GSM494645     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.0000      0.942 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494630     6  0.0000      0.942 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494657     3  0.0000      0.924 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0000      0.942 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494629     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494637     4  0.0713      0.881 0.000 0.000 0.000 0.972 0.000 0.028
#> GSM494652     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.0000      0.942 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494650     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494669     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     6  0.0000      0.942 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.2941      0.774 0.780 0.000 0.000 0.220 0.000 0.000
#> GSM494661     1  0.0000      0.950 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494626     4  0.0000      0.900 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494656     3  0.0000      0.924 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494635     1  0.2631      0.813 0.820 0.000 0.000 0.180 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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 5)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-pam-collect-classes

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

test_to_known_factors(res)
#>          n disease.state(p)  age(p) other(p) individual(p) k
#> SD:pam 118         5.93e-21 0.99985 2.36e-16        1.0000 2
#> SD:pam 107         8.29e-16 0.23120 1.01e-09        0.7282 3
#> SD:pam 118         5.04e-14 0.11875 1.33e-07        0.2562 4
#> SD:pam 113         1.38e-14 0.00242 1.82e-08        0.0788 5
#> SD:pam 113         8.12e-16 0.06685 1.00e-10        0.2674 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 51941 rows and 120 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 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 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.368           0.826       0.860         0.3849 0.658   0.658
#> 3 3 0.926           0.917       0.963         0.6739 0.663   0.501
#> 4 4 0.927           0.930       0.951         0.1197 0.898   0.720
#> 5 5 0.730           0.761       0.858         0.0806 0.845   0.516
#> 6 6 0.915           0.885       0.949         0.0428 0.893   0.578

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] 3 4

There is also optional best \(k\) = 3 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
#> GSM494565     2  0.6887      0.899 0.184 0.816
#> GSM494594     1  0.7602      0.618 0.780 0.220
#> GSM494604     1  0.2043      0.863 0.968 0.032
#> GSM494564     2  0.6887      0.899 0.184 0.816
#> GSM494591     1  0.7602      0.618 0.780 0.220
#> GSM494567     1  0.0000      0.863 1.000 0.000
#> GSM494602     1  0.0000      0.863 1.000 0.000
#> GSM494613     1  0.0000      0.863 1.000 0.000
#> GSM494589     2  0.6887      0.899 0.184 0.816
#> GSM494598     1  0.0000      0.863 1.000 0.000
#> GSM494593     1  0.0000      0.863 1.000 0.000
#> GSM494583     1  0.0938      0.857 0.988 0.012
#> GSM494612     1  0.0000      0.863 1.000 0.000
#> GSM494558     1  0.7602      0.618 0.780 0.220
#> GSM494556     1  0.0000      0.863 1.000 0.000
#> GSM494559     2  0.6887      0.899 0.184 0.816
#> GSM494571     1  0.7602      0.618 0.780 0.220
#> GSM494614     1  0.0000      0.863 1.000 0.000
#> GSM494603     2  0.7528      0.877 0.216 0.784
#> GSM494568     1  0.6712      0.735 0.824 0.176
#> GSM494572     1  0.7602      0.618 0.780 0.220
#> GSM494600     2  0.6887      0.899 0.184 0.816
#> GSM494562     1  0.0000      0.863 1.000 0.000
#> GSM494615     1  0.0000      0.863 1.000 0.000
#> GSM494582     1  0.0000      0.863 1.000 0.000
#> GSM494599     1  0.0000      0.863 1.000 0.000
#> GSM494610     1  0.0000      0.863 1.000 0.000
#> GSM494587     1  0.0000      0.863 1.000 0.000
#> GSM494581     1  0.0000      0.863 1.000 0.000
#> GSM494580     1  0.0672      0.858 0.992 0.008
#> GSM494563     2  0.6887      0.899 0.184 0.816
#> GSM494576     1  0.0000      0.863 1.000 0.000
#> GSM494605     1  0.6887      0.847 0.816 0.184
#> GSM494584     1  0.0000      0.863 1.000 0.000
#> GSM494586     1  0.0000      0.863 1.000 0.000
#> GSM494578     1  0.0000      0.863 1.000 0.000
#> GSM494585     1  0.0000      0.863 1.000 0.000
#> GSM494611     1  0.0000      0.863 1.000 0.000
#> GSM494560     2  0.6887      0.899 0.184 0.816
#> GSM494595     1  0.0000      0.863 1.000 0.000
#> GSM494570     2  0.6887      0.899 0.184 0.816
#> GSM494597     1  0.7528      0.625 0.784 0.216
#> GSM494607     1  0.0000      0.863 1.000 0.000
#> GSM494561     2  0.6887      0.899 0.184 0.816
#> GSM494569     1  0.6048      0.855 0.852 0.148
#> GSM494592     1  0.0000      0.863 1.000 0.000
#> GSM494577     1  0.3879      0.807 0.924 0.076
#> GSM494588     2  0.6887      0.899 0.184 0.816
#> GSM494590     1  0.7602      0.618 0.780 0.220
#> GSM494609     1  0.0000      0.863 1.000 0.000
#> GSM494608     1  0.0000      0.863 1.000 0.000
#> GSM494606     1  0.0000      0.863 1.000 0.000
#> GSM494574     1  0.0000      0.863 1.000 0.000
#> GSM494573     2  0.6887      0.899 0.184 0.816
#> GSM494566     1  0.0000      0.863 1.000 0.000
#> GSM494601     1  0.0000      0.863 1.000 0.000
#> GSM494557     1  0.0000      0.863 1.000 0.000
#> GSM494579     1  0.0000      0.863 1.000 0.000
#> GSM494596     1  0.7602      0.618 0.780 0.220
#> GSM494575     1  0.0000      0.863 1.000 0.000
#> GSM494625     2  0.4161      0.901 0.084 0.916
#> GSM494654     1  0.7674      0.620 0.776 0.224
#> GSM494664     1  0.6887      0.847 0.816 0.184
#> GSM494624     2  0.4161      0.901 0.084 0.916
#> GSM494651     1  0.6048      0.855 0.852 0.148
#> GSM494662     1  0.6148      0.854 0.848 0.152
#> GSM494627     2  0.9996     -0.282 0.488 0.512
#> GSM494673     1  0.6887      0.847 0.816 0.184
#> GSM494649     2  0.4161      0.901 0.084 0.916
#> GSM494658     1  0.4690      0.857 0.900 0.100
#> GSM494653     1  0.6887      0.847 0.816 0.184
#> GSM494643     2  0.6247      0.842 0.156 0.844
#> GSM494672     1  0.6887      0.847 0.816 0.184
#> GSM494618     1  0.6048      0.855 0.852 0.148
#> GSM494631     1  0.1414      0.863 0.980 0.020
#> GSM494619     2  0.4161      0.901 0.084 0.916
#> GSM494674     1  0.6887      0.847 0.816 0.184
#> GSM494616     1  0.6048      0.855 0.852 0.148
#> GSM494663     2  0.7674      0.751 0.224 0.776
#> GSM494628     1  0.6887      0.844 0.816 0.184
#> GSM494632     1  0.6801      0.848 0.820 0.180
#> GSM494660     2  0.4161      0.901 0.084 0.916
#> GSM494622     1  0.4690      0.857 0.900 0.100
#> GSM494642     1  0.6887      0.847 0.816 0.184
#> GSM494647     1  0.6887      0.847 0.816 0.184
#> GSM494659     1  0.6887      0.847 0.816 0.184
#> GSM494670     1  0.6712      0.849 0.824 0.176
#> GSM494675     1  0.7883      0.576 0.764 0.236
#> GSM494641     1  0.6887      0.847 0.816 0.184
#> GSM494636     1  0.6887      0.847 0.816 0.184
#> GSM494640     1  0.9000      0.712 0.684 0.316
#> GSM494623     2  0.4161      0.901 0.084 0.916
#> GSM494644     1  0.6887      0.847 0.816 0.184
#> GSM494646     1  0.6887      0.847 0.816 0.184
#> GSM494665     1  0.6712      0.849 0.824 0.176
#> GSM494638     1  0.5946      0.856 0.856 0.144
#> GSM494645     1  0.6887      0.847 0.816 0.184
#> GSM494671     1  0.6887      0.847 0.816 0.184
#> GSM494655     1  0.6887      0.847 0.816 0.184
#> GSM494620     2  0.4161      0.901 0.084 0.916
#> GSM494630     2  0.4161      0.901 0.084 0.916
#> GSM494657     1  0.7602      0.618 0.780 0.220
#> GSM494667     1  0.6887      0.847 0.816 0.184
#> GSM494621     2  0.4161      0.901 0.084 0.916
#> GSM494629     1  0.8267      0.784 0.740 0.260
#> GSM494637     1  0.8267      0.781 0.740 0.260
#> GSM494652     1  0.6887      0.847 0.816 0.184
#> GSM494648     2  0.4161      0.901 0.084 0.916
#> GSM494650     1  0.6048      0.855 0.852 0.148
#> GSM494669     1  0.6887      0.847 0.816 0.184
#> GSM494666     1  0.6887      0.847 0.816 0.184
#> GSM494668     1  0.6887      0.847 0.816 0.184
#> GSM494633     2  0.4161      0.901 0.084 0.916
#> GSM494634     1  0.6887      0.847 0.816 0.184
#> GSM494639     1  0.6887      0.847 0.816 0.184
#> GSM494661     1  0.6887      0.847 0.816 0.184
#> GSM494617     1  0.6048      0.855 0.852 0.148
#> GSM494626     1  0.6048      0.855 0.852 0.148
#> GSM494656     1  0.7602      0.618 0.780 0.220
#> GSM494635     1  0.6887      0.847 0.816 0.184

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM494565     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494594     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494604     1  0.6225     0.2656 0.568 0.432 0.000
#> GSM494564     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494591     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494567     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494602     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494613     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494589     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494598     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494593     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494583     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494612     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494558     2  0.7801     0.0922 0.428 0.520 0.052
#> GSM494556     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494559     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494571     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494614     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494603     3  0.9378     0.1724 0.336 0.184 0.480
#> GSM494568     1  0.9098     0.4123 0.540 0.276 0.184
#> GSM494572     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494600     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494562     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494615     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494582     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494599     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494610     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494587     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494581     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494580     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494563     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494576     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494605     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494584     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494586     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494578     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494585     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494611     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494560     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494595     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494570     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494597     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494607     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494561     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494569     1  0.1643     0.9150 0.956 0.000 0.044
#> GSM494592     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494577     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494588     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494590     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494609     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494608     2  0.2711     0.8883 0.088 0.912 0.000
#> GSM494606     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494574     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494573     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494566     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494601     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494557     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494579     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494596     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494575     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494625     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494654     2  0.4002     0.8019 0.160 0.840 0.000
#> GSM494664     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494624     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494651     1  0.1643     0.9150 0.956 0.000 0.044
#> GSM494662     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494627     1  0.4504     0.7702 0.804 0.000 0.196
#> GSM494673     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494649     3  0.0237     0.9737 0.004 0.000 0.996
#> GSM494658     1  0.4931     0.6761 0.768 0.232 0.000
#> GSM494653     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494643     1  0.6045     0.4504 0.620 0.000 0.380
#> GSM494672     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494618     1  0.1643     0.9150 0.956 0.000 0.044
#> GSM494631     2  0.4602     0.8277 0.108 0.852 0.040
#> GSM494619     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494674     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494616     1  0.1643     0.9150 0.956 0.000 0.044
#> GSM494663     1  0.5733     0.5688 0.676 0.000 0.324
#> GSM494628     1  0.2625     0.8865 0.916 0.000 0.084
#> GSM494632     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494660     3  0.0237     0.9737 0.004 0.000 0.996
#> GSM494622     1  0.3875     0.8635 0.888 0.068 0.044
#> GSM494642     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494647     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494659     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494670     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494675     2  0.2066     0.9203 0.000 0.940 0.060
#> GSM494641     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494636     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494640     1  0.4291     0.7896 0.820 0.000 0.180
#> GSM494623     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494644     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494646     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494665     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494638     1  0.1529     0.9170 0.960 0.000 0.040
#> GSM494645     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494671     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494655     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494620     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494630     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494657     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494667     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494621     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494629     1  0.2261     0.8992 0.932 0.000 0.068
#> GSM494637     1  0.4235     0.7944 0.824 0.000 0.176
#> GSM494652     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494648     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494650     1  0.1643     0.9150 0.956 0.000 0.044
#> GSM494669     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494666     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494668     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494633     3  0.0000     0.9772 0.000 0.000 1.000
#> GSM494634     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494639     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494661     1  0.0000     0.9334 1.000 0.000 0.000
#> GSM494617     1  0.1031     0.9243 0.976 0.000 0.024
#> GSM494626     1  0.1163     0.9226 0.972 0.000 0.028
#> GSM494656     2  0.0000     0.9784 0.000 1.000 0.000
#> GSM494635     1  0.0000     0.9334 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
#> GSM494565     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494594     3  0.1022      0.825 0.000 0.032 0.968 0.000
#> GSM494604     2  0.3494      0.690 0.172 0.824 0.004 0.000
#> GSM494564     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494591     3  0.1118      0.825 0.000 0.036 0.964 0.000
#> GSM494567     3  0.4222      0.817 0.000 0.272 0.728 0.000
#> GSM494602     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494613     3  0.4193      0.820 0.000 0.268 0.732 0.000
#> GSM494589     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494598     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494593     2  0.0188      0.978 0.000 0.996 0.004 0.000
#> GSM494583     2  0.0336      0.975 0.000 0.992 0.008 0.000
#> GSM494612     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494558     3  0.3873      0.829 0.000 0.228 0.772 0.000
#> GSM494556     3  0.4222      0.817 0.000 0.272 0.728 0.000
#> GSM494559     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494571     3  0.1022      0.825 0.000 0.032 0.968 0.000
#> GSM494614     3  0.4776      0.669 0.000 0.376 0.624 0.000
#> GSM494603     4  0.8656      0.193 0.172 0.080 0.252 0.496
#> GSM494568     3  0.8396      0.485 0.172 0.076 0.536 0.216
#> GSM494572     3  0.1118      0.825 0.000 0.036 0.964 0.000
#> GSM494600     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494562     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494615     3  0.4222      0.817 0.000 0.272 0.728 0.000
#> GSM494582     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494599     2  0.0188      0.978 0.000 0.996 0.004 0.000
#> GSM494610     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494587     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494581     2  0.0469      0.973 0.000 0.988 0.012 0.000
#> GSM494580     3  0.4222      0.817 0.000 0.272 0.728 0.000
#> GSM494563     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494576     2  0.0336      0.975 0.000 0.992 0.008 0.000
#> GSM494605     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494584     2  0.2760      0.806 0.000 0.872 0.128 0.000
#> GSM494586     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494578     3  0.4222      0.817 0.000 0.272 0.728 0.000
#> GSM494585     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494611     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494560     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494595     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494570     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494597     3  0.3907      0.830 0.000 0.232 0.768 0.000
#> GSM494607     2  0.0188      0.978 0.000 0.996 0.004 0.000
#> GSM494561     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494569     1  0.0336      0.981 0.992 0.000 0.008 0.000
#> GSM494592     2  0.0188      0.978 0.000 0.996 0.004 0.000
#> GSM494577     2  0.0336      0.975 0.000 0.992 0.008 0.000
#> GSM494588     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494590     3  0.1118      0.825 0.000 0.036 0.964 0.000
#> GSM494609     2  0.0336      0.976 0.000 0.992 0.008 0.000
#> GSM494608     2  0.0188      0.978 0.000 0.996 0.004 0.000
#> GSM494606     2  0.0188      0.978 0.000 0.996 0.004 0.000
#> GSM494574     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494573     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494566     2  0.1118      0.947 0.000 0.964 0.036 0.000
#> GSM494601     2  0.0188      0.978 0.000 0.996 0.004 0.000
#> GSM494557     3  0.4193      0.820 0.000 0.268 0.732 0.000
#> GSM494579     2  0.0336      0.975 0.000 0.992 0.008 0.000
#> GSM494596     3  0.1118      0.825 0.000 0.036 0.964 0.000
#> GSM494575     2  0.0000      0.979 0.000 1.000 0.000 0.000
#> GSM494625     4  0.0188      0.973 0.000 0.000 0.004 0.996
#> GSM494654     3  0.1022      0.825 0.000 0.032 0.968 0.000
#> GSM494664     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494624     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494651     1  0.0817      0.972 0.976 0.000 0.024 0.000
#> GSM494662     1  0.0188      0.981 0.996 0.000 0.004 0.000
#> GSM494627     1  0.0895      0.973 0.976 0.000 0.004 0.020
#> GSM494673     1  0.0817      0.977 0.976 0.000 0.024 0.000
#> GSM494649     4  0.0376      0.970 0.004 0.000 0.004 0.992
#> GSM494658     1  0.0336      0.979 0.992 0.008 0.000 0.000
#> GSM494653     1  0.0707      0.978 0.980 0.000 0.020 0.000
#> GSM494643     1  0.4372      0.641 0.728 0.000 0.004 0.268
#> GSM494672     1  0.0817      0.977 0.976 0.000 0.024 0.000
#> GSM494618     1  0.0188      0.981 0.996 0.000 0.004 0.000
#> GSM494631     3  0.4134      0.822 0.000 0.260 0.740 0.000
#> GSM494619     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0817      0.977 0.976 0.000 0.024 0.000
#> GSM494616     1  0.0336      0.981 0.992 0.000 0.008 0.000
#> GSM494663     1  0.2999      0.851 0.864 0.000 0.004 0.132
#> GSM494628     1  0.0524      0.980 0.988 0.000 0.004 0.008
#> GSM494632     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494660     4  0.0524      0.965 0.008 0.000 0.004 0.988
#> GSM494622     1  0.0376      0.980 0.992 0.004 0.004 0.000
#> GSM494642     1  0.0817      0.977 0.976 0.000 0.024 0.000
#> GSM494647     1  0.0817      0.977 0.976 0.000 0.024 0.000
#> GSM494659     1  0.0817      0.977 0.976 0.000 0.024 0.000
#> GSM494670     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494675     3  0.5599      0.774 0.000 0.288 0.664 0.048
#> GSM494641     1  0.0469      0.980 0.988 0.000 0.012 0.000
#> GSM494636     1  0.0188      0.981 0.996 0.000 0.004 0.000
#> GSM494640     1  0.0524      0.980 0.988 0.000 0.004 0.008
#> GSM494623     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494644     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494646     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494665     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494638     1  0.0376      0.980 0.992 0.004 0.004 0.000
#> GSM494645     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494671     1  0.0817      0.977 0.976 0.000 0.024 0.000
#> GSM494655     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494620     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494630     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494657     3  0.1118      0.825 0.000 0.036 0.964 0.000
#> GSM494667     1  0.0817      0.977 0.976 0.000 0.024 0.000
#> GSM494621     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494629     1  0.0524      0.980 0.988 0.000 0.004 0.008
#> GSM494637     1  0.0524      0.980 0.988 0.000 0.004 0.008
#> GSM494652     1  0.0817      0.977 0.976 0.000 0.024 0.000
#> GSM494648     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494650     1  0.0817      0.972 0.976 0.000 0.024 0.000
#> GSM494669     1  0.0817      0.977 0.976 0.000 0.024 0.000
#> GSM494666     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494633     4  0.0000      0.976 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0817      0.977 0.976 0.000 0.024 0.000
#> GSM494639     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494661     1  0.0000      0.982 1.000 0.000 0.000 0.000
#> GSM494617     1  0.0336      0.981 0.992 0.000 0.008 0.000
#> GSM494626     1  0.0336      0.981 0.992 0.000 0.008 0.000
#> GSM494656     3  0.1022      0.825 0.000 0.032 0.968 0.000
#> GSM494635     1  0.0000      0.982 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
#> GSM494565     5  0.0290      1.000 0.000 0.000 0.008 0.000 0.992
#> GSM494594     3  0.0794      0.834 0.000 0.000 0.972 0.028 0.000
#> GSM494604     2  0.0963      0.816 0.000 0.964 0.036 0.000 0.000
#> GSM494564     5  0.0290      1.000 0.000 0.000 0.008 0.000 0.992
#> GSM494591     3  0.3146      0.841 0.000 0.128 0.844 0.028 0.000
#> GSM494567     3  0.3151      0.839 0.000 0.144 0.836 0.020 0.000
#> GSM494602     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494613     3  0.3016      0.844 0.000 0.132 0.848 0.020 0.000
#> GSM494589     5  0.0290      1.000 0.000 0.000 0.008 0.000 0.992
#> GSM494598     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494593     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494583     2  0.4318      0.664 0.000 0.688 0.292 0.020 0.000
#> GSM494612     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494558     3  0.3106      0.841 0.000 0.140 0.840 0.020 0.000
#> GSM494556     3  0.4132      0.674 0.000 0.260 0.720 0.020 0.000
#> GSM494559     5  0.0290      1.000 0.000 0.000 0.008 0.000 0.992
#> GSM494571     3  0.0794      0.834 0.000 0.000 0.972 0.028 0.000
#> GSM494614     2  0.4651      0.525 0.000 0.608 0.372 0.020 0.000
#> GSM494603     2  0.5460      0.591 0.000 0.620 0.316 0.024 0.040
#> GSM494568     2  0.5367      0.578 0.000 0.616 0.328 0.024 0.032
#> GSM494572     3  0.0794      0.834 0.000 0.000 0.972 0.028 0.000
#> GSM494600     5  0.0290      1.000 0.000 0.000 0.008 0.000 0.992
#> GSM494562     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494615     3  0.3690      0.776 0.000 0.200 0.780 0.020 0.000
#> GSM494582     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494599     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494610     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494587     2  0.1851      0.802 0.000 0.912 0.088 0.000 0.000
#> GSM494581     2  0.4318      0.664 0.000 0.688 0.292 0.020 0.000
#> GSM494580     3  0.4054      0.698 0.000 0.248 0.732 0.020 0.000
#> GSM494563     5  0.0290      1.000 0.000 0.000 0.008 0.000 0.992
#> GSM494576     2  0.4297      0.669 0.000 0.692 0.288 0.020 0.000
#> GSM494605     1  0.2773      0.889 0.868 0.020 0.000 0.112 0.000
#> GSM494584     2  0.4318      0.664 0.000 0.688 0.292 0.020 0.000
#> GSM494586     2  0.1410      0.811 0.000 0.940 0.060 0.000 0.000
#> GSM494578     3  0.3151      0.839 0.000 0.144 0.836 0.020 0.000
#> GSM494585     2  0.1410      0.811 0.000 0.940 0.060 0.000 0.000
#> GSM494611     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494560     5  0.0290      1.000 0.000 0.000 0.008 0.000 0.992
#> GSM494595     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494570     5  0.0290      1.000 0.000 0.000 0.008 0.000 0.992
#> GSM494597     3  0.3399      0.816 0.000 0.168 0.812 0.020 0.000
#> GSM494607     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494561     5  0.0290      1.000 0.000 0.000 0.008 0.000 0.992
#> GSM494569     4  0.3058      0.674 0.044 0.000 0.096 0.860 0.000
#> GSM494592     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494577     2  0.4297      0.669 0.000 0.692 0.288 0.020 0.000
#> GSM494588     5  0.0290      1.000 0.000 0.000 0.008 0.000 0.992
#> GSM494590     3  0.0794      0.834 0.000 0.000 0.972 0.028 0.000
#> GSM494609     2  0.3707      0.687 0.000 0.716 0.284 0.000 0.000
#> GSM494608     2  0.3177      0.742 0.000 0.792 0.208 0.000 0.000
#> GSM494606     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494574     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494573     5  0.0290      1.000 0.000 0.000 0.008 0.000 0.992
#> GSM494566     2  0.4297      0.669 0.000 0.692 0.288 0.020 0.000
#> GSM494601     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494557     3  0.3016      0.844 0.000 0.132 0.848 0.020 0.000
#> GSM494579     2  0.3707      0.687 0.000 0.716 0.284 0.000 0.000
#> GSM494596     3  0.0794      0.834 0.000 0.000 0.972 0.028 0.000
#> GSM494575     2  0.0000      0.821 0.000 1.000 0.000 0.000 0.000
#> GSM494625     4  0.3707      0.562 0.000 0.000 0.000 0.716 0.284
#> GSM494654     3  0.0794      0.834 0.000 0.000 0.972 0.028 0.000
#> GSM494664     1  0.3882      0.803 0.756 0.020 0.000 0.224 0.000
#> GSM494624     4  0.4302      0.362 0.000 0.000 0.000 0.520 0.480
#> GSM494651     4  0.0963      0.720 0.036 0.000 0.000 0.964 0.000
#> GSM494662     4  0.2852      0.639 0.172 0.000 0.000 0.828 0.000
#> GSM494627     4  0.0794      0.721 0.028 0.000 0.000 0.972 0.000
#> GSM494673     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.3636      0.575 0.000 0.000 0.000 0.728 0.272
#> GSM494658     2  0.4735      0.658 0.048 0.680 0.272 0.000 0.000
#> GSM494653     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.0794      0.721 0.028 0.000 0.000 0.972 0.000
#> GSM494672     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0963      0.720 0.036 0.000 0.000 0.964 0.000
#> GSM494631     3  0.3106      0.841 0.000 0.140 0.840 0.020 0.000
#> GSM494619     4  0.4302      0.362 0.000 0.000 0.000 0.520 0.480
#> GSM494674     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0963      0.720 0.036 0.000 0.000 0.964 0.000
#> GSM494663     4  0.0794      0.721 0.028 0.000 0.000 0.972 0.000
#> GSM494628     4  0.0794      0.721 0.028 0.000 0.000 0.972 0.000
#> GSM494632     1  0.4639      0.562 0.612 0.020 0.000 0.368 0.000
#> GSM494660     4  0.3636      0.575 0.000 0.000 0.000 0.728 0.272
#> GSM494622     3  0.6497      0.561 0.028 0.136 0.568 0.268 0.000
#> GSM494642     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.2773      0.889 0.868 0.020 0.000 0.112 0.000
#> GSM494675     2  0.5284      0.583 0.000 0.620 0.328 0.020 0.032
#> GSM494641     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.2813      0.644 0.168 0.000 0.000 0.832 0.000
#> GSM494640     4  0.0794      0.721 0.028 0.000 0.000 0.972 0.000
#> GSM494623     4  0.4302      0.362 0.000 0.000 0.000 0.520 0.480
#> GSM494644     1  0.2773      0.889 0.868 0.020 0.000 0.112 0.000
#> GSM494646     1  0.3999      0.786 0.740 0.020 0.000 0.240 0.000
#> GSM494665     1  0.2773      0.889 0.868 0.020 0.000 0.112 0.000
#> GSM494638     4  0.6624      0.244 0.164 0.012 0.336 0.488 0.000
#> GSM494645     1  0.2824      0.887 0.864 0.020 0.000 0.116 0.000
#> GSM494671     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.2773      0.889 0.868 0.020 0.000 0.112 0.000
#> GSM494620     4  0.4302      0.362 0.000 0.000 0.000 0.520 0.480
#> GSM494630     4  0.4300      0.366 0.000 0.000 0.000 0.524 0.476
#> GSM494657     3  0.0794      0.834 0.000 0.000 0.972 0.028 0.000
#> GSM494667     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494621     4  0.4302      0.362 0.000 0.000 0.000 0.520 0.480
#> GSM494629     4  0.4982      0.144 0.032 0.000 0.412 0.556 0.000
#> GSM494637     4  0.0794      0.721 0.028 0.000 0.000 0.972 0.000
#> GSM494652     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494648     4  0.4302      0.362 0.000 0.000 0.000 0.520 0.480
#> GSM494650     4  0.3192      0.663 0.040 0.000 0.112 0.848 0.000
#> GSM494669     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.3106      0.872 0.840 0.020 0.000 0.140 0.000
#> GSM494668     1  0.2773      0.889 0.868 0.020 0.000 0.112 0.000
#> GSM494633     4  0.4249      0.421 0.000 0.000 0.000 0.568 0.432
#> GSM494634     1  0.0000      0.895 1.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.3999      0.786 0.740 0.020 0.000 0.240 0.000
#> GSM494661     1  0.2773      0.889 0.868 0.020 0.000 0.112 0.000
#> GSM494617     4  0.3109      0.605 0.200 0.000 0.000 0.800 0.000
#> GSM494626     4  0.2230      0.691 0.116 0.000 0.000 0.884 0.000
#> GSM494656     3  0.0794      0.834 0.000 0.000 0.972 0.028 0.000
#> GSM494635     1  0.3942      0.794 0.748 0.020 0.000 0.232 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
#> GSM494565     5  0.0000     0.9655 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494594     3  0.0000     0.9278 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     2  0.4196     0.6753 0.144 0.740 0.000 0.116 0.000 0.000
#> GSM494564     5  0.0000     0.9655 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494591     3  0.0000     0.9278 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     3  0.0508     0.9265 0.000 0.012 0.984 0.004 0.000 0.000
#> GSM494602     2  0.0363     0.9691 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494613     3  0.0363     0.9265 0.000 0.012 0.988 0.000 0.000 0.000
#> GSM494589     5  0.0000     0.9655 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494598     2  0.0363     0.9691 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494593     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494583     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494612     2  0.0363     0.9691 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494558     3  0.0820     0.9210 0.000 0.012 0.972 0.016 0.000 0.000
#> GSM494556     3  0.0725     0.9236 0.000 0.012 0.976 0.012 0.000 0.000
#> GSM494559     5  0.0000     0.9655 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494571     3  0.0000     0.9278 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494614     3  0.3866     0.0773 0.000 0.484 0.516 0.000 0.000 0.000
#> GSM494603     4  0.6154     0.3258 0.000 0.296 0.180 0.504 0.016 0.004
#> GSM494568     4  0.0622     0.8936 0.000 0.008 0.000 0.980 0.012 0.000
#> GSM494572     3  0.0000     0.9278 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494600     5  0.0000     0.9655 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494562     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494615     3  0.1367     0.8969 0.000 0.012 0.944 0.044 0.000 0.000
#> GSM494582     2  0.0363     0.9691 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494599     2  0.0363     0.9691 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494610     2  0.0363     0.9691 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494587     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494581     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494580     3  0.0622     0.9255 0.000 0.012 0.980 0.008 0.000 0.000
#> GSM494563     5  0.0000     0.9655 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494576     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494605     4  0.3695     0.4485 0.376 0.000 0.000 0.624 0.000 0.000
#> GSM494584     2  0.0146     0.9684 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM494586     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494578     3  0.0622     0.9255 0.000 0.012 0.980 0.008 0.000 0.000
#> GSM494585     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494611     2  0.0363     0.9691 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494560     5  0.0000     0.9655 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494595     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494570     5  0.0146     0.9614 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM494597     3  0.0000     0.9278 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494607     2  0.0363     0.9691 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494561     5  0.3652     0.5043 0.000 0.000 0.004 0.000 0.672 0.324
#> GSM494569     4  0.0363     0.8987 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM494592     2  0.0363     0.9691 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494577     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494588     5  0.0000     0.9655 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494590     3  0.0000     0.9278 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494608     2  0.0146     0.9684 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM494606     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494574     2  0.0363     0.9691 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494573     5  0.0000     0.9655 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494566     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494601     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494557     3  0.0363     0.9265 0.000 0.012 0.988 0.000 0.000 0.000
#> GSM494579     2  0.0000     0.9709 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494596     3  0.0000     0.9278 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0363     0.9691 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM494625     6  0.0146     0.9429 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM494654     3  0.0146     0.9281 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM494664     4  0.3126     0.6849 0.248 0.000 0.000 0.752 0.000 0.000
#> GSM494624     6  0.0000     0.9438 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494651     4  0.0363     0.8987 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM494662     4  0.0363     0.9014 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM494627     4  0.0458     0.8973 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM494673     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     6  0.2697     0.7477 0.000 0.000 0.000 0.188 0.000 0.812
#> GSM494658     2  0.5375     0.4089 0.208 0.588 0.000 0.204 0.000 0.000
#> GSM494653     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.1714     0.8407 0.000 0.000 0.000 0.908 0.000 0.092
#> GSM494672     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0363     0.9014 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM494631     3  0.3564     0.6069 0.000 0.012 0.724 0.264 0.000 0.000
#> GSM494619     6  0.0000     0.9438 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0363     0.8987 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM494663     4  0.0458     0.8973 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM494628     4  0.0458     0.8973 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM494632     4  0.0363     0.9014 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM494660     6  0.2697     0.7477 0.000 0.000 0.000 0.188 0.000 0.812
#> GSM494622     4  0.0363     0.9014 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM494642     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.2048     0.8579 0.880 0.000 0.000 0.120 0.000 0.000
#> GSM494675     3  0.3420     0.6980 0.000 0.204 0.776 0.008 0.012 0.000
#> GSM494641     1  0.0146     0.9358 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494636     4  0.0405     0.9011 0.008 0.000 0.000 0.988 0.000 0.004
#> GSM494640     4  0.0458     0.8973 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM494623     6  0.0000     0.9438 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494644     1  0.2260     0.8357 0.860 0.000 0.000 0.140 0.000 0.000
#> GSM494646     4  0.1501     0.8671 0.076 0.000 0.000 0.924 0.000 0.000
#> GSM494665     4  0.3756     0.3884 0.400 0.000 0.000 0.600 0.000 0.000
#> GSM494638     4  0.0363     0.9014 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM494645     1  0.3499     0.5031 0.680 0.000 0.000 0.320 0.000 0.000
#> GSM494671     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.1957     0.8642 0.888 0.000 0.000 0.112 0.000 0.000
#> GSM494620     6  0.0000     0.9438 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494630     6  0.0146     0.9429 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM494657     3  0.0000     0.9278 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0000     0.9438 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494629     4  0.0508     0.9012 0.012 0.000 0.000 0.984 0.000 0.004
#> GSM494637     4  0.0458     0.8973 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM494652     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.0000     0.9438 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494650     4  0.0405     0.9011 0.008 0.000 0.000 0.988 0.000 0.004
#> GSM494669     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     4  0.3244     0.6581 0.268 0.000 0.000 0.732 0.000 0.000
#> GSM494668     1  0.2048     0.8579 0.880 0.000 0.000 0.120 0.000 0.000
#> GSM494633     6  0.0146     0.9429 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM494634     1  0.0000     0.9378 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     4  0.0790     0.8931 0.032 0.000 0.000 0.968 0.000 0.000
#> GSM494661     4  0.3266     0.6520 0.272 0.000 0.000 0.728 0.000 0.000
#> GSM494617     4  0.0363     0.9014 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM494626     4  0.0363     0.9014 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM494656     3  0.0146     0.9281 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM494635     4  0.1910     0.8422 0.108 0.000 0.000 0.892 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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 3)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 4)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 5)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-mclust-collect-classes

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

test_to_known_factors(res)
#>             n disease.state(p) age(p) other(p) individual(p) k
#> SD:mclust 119         9.62e-01 0.0078 9.42e-01      1.37e-05 2
#> SD:mclust 115         2.31e-15 0.2194 1.31e-08      9.66e-02 3
#> SD:mclust 118         9.27e-16 0.0898 3.60e-12      3.42e-02 4
#> SD:mclust 110         2.13e-16 0.3459 2.04e-09      4.13e-01 5
#> SD:mclust 115         1.90e-18 0.5447 2.10e-11      7.28e-01 6

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


SD: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 51941 rows and 120 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 0.520           0.736       0.893         0.4929 0.519   0.519
#> 3 3 0.998           0.949       0.974         0.3147 0.743   0.544
#> 4 4 0.849           0.861       0.937         0.1280 0.792   0.494
#> 5 5 0.656           0.626       0.799         0.0405 0.830   0.492
#> 6 6 0.713           0.693       0.837         0.0501 0.868   0.535

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
#> GSM494565     2  0.0000     0.8927 0.000 1.000
#> GSM494594     2  0.0000     0.8927 0.000 1.000
#> GSM494604     1  0.0000     0.8460 1.000 0.000
#> GSM494564     2  0.0000     0.8927 0.000 1.000
#> GSM494591     2  0.0000     0.8927 0.000 1.000
#> GSM494567     2  0.0000     0.8927 0.000 1.000
#> GSM494602     1  0.9686     0.3644 0.604 0.396
#> GSM494613     2  0.0000     0.8927 0.000 1.000
#> GSM494589     2  0.0000     0.8927 0.000 1.000
#> GSM494598     1  0.9732     0.3452 0.596 0.404
#> GSM494593     1  0.9775     0.3242 0.588 0.412
#> GSM494583     2  0.0000     0.8927 0.000 1.000
#> GSM494612     1  0.9608     0.3896 0.616 0.384
#> GSM494558     2  0.0000     0.8927 0.000 1.000
#> GSM494556     2  0.0000     0.8927 0.000 1.000
#> GSM494559     2  0.0000     0.8927 0.000 1.000
#> GSM494571     2  0.0000     0.8927 0.000 1.000
#> GSM494614     2  0.0000     0.8927 0.000 1.000
#> GSM494603     2  0.0000     0.8927 0.000 1.000
#> GSM494568     2  0.1843     0.8703 0.028 0.972
#> GSM494572     2  0.0000     0.8927 0.000 1.000
#> GSM494600     2  0.0000     0.8927 0.000 1.000
#> GSM494562     2  0.8443     0.5802 0.272 0.728
#> GSM494615     2  0.0000     0.8927 0.000 1.000
#> GSM494582     1  0.9710     0.3553 0.600 0.400
#> GSM494599     1  0.9248     0.4730 0.660 0.340
#> GSM494610     1  0.9710     0.3553 0.600 0.400
#> GSM494587     2  0.3274     0.8445 0.060 0.940
#> GSM494581     2  0.9491     0.3803 0.368 0.632
#> GSM494580     2  0.0000     0.8927 0.000 1.000
#> GSM494563     2  0.0672     0.8873 0.008 0.992
#> GSM494576     2  0.0000     0.8927 0.000 1.000
#> GSM494605     1  0.0000     0.8460 1.000 0.000
#> GSM494584     2  0.0000     0.8927 0.000 1.000
#> GSM494586     2  0.9209     0.4560 0.336 0.664
#> GSM494578     2  0.0000     0.8927 0.000 1.000
#> GSM494585     2  0.7376     0.6779 0.208 0.792
#> GSM494611     1  0.9710     0.3553 0.600 0.400
#> GSM494560     2  0.0000     0.8927 0.000 1.000
#> GSM494595     2  0.9963     0.0802 0.464 0.536
#> GSM494570     2  0.0000     0.8927 0.000 1.000
#> GSM494597     2  0.0000     0.8927 0.000 1.000
#> GSM494607     1  0.7528     0.6574 0.784 0.216
#> GSM494561     2  0.8861     0.4720 0.304 0.696
#> GSM494569     1  0.3274     0.8079 0.940 0.060
#> GSM494592     1  0.8555     0.5710 0.720 0.280
#> GSM494577     2  0.0000     0.8927 0.000 1.000
#> GSM494588     2  0.8207     0.6073 0.256 0.744
#> GSM494590     2  0.0000     0.8927 0.000 1.000
#> GSM494609     1  0.9661     0.3730 0.608 0.392
#> GSM494608     1  0.0000     0.8460 1.000 0.000
#> GSM494606     1  0.7745     0.6427 0.772 0.228
#> GSM494574     1  0.9710     0.3553 0.600 0.400
#> GSM494573     2  0.0000     0.8927 0.000 1.000
#> GSM494566     2  0.7883     0.6385 0.236 0.764
#> GSM494601     1  0.9686     0.3644 0.604 0.396
#> GSM494557     2  0.0000     0.8927 0.000 1.000
#> GSM494579     2  0.9358     0.4196 0.352 0.648
#> GSM494596     2  0.0000     0.8927 0.000 1.000
#> GSM494575     1  0.9710     0.3553 0.600 0.400
#> GSM494625     1  0.8555     0.5735 0.720 0.280
#> GSM494654     2  0.9358     0.3662 0.352 0.648
#> GSM494664     1  0.0000     0.8460 1.000 0.000
#> GSM494624     1  0.0000     0.8460 1.000 0.000
#> GSM494651     1  0.9000     0.5160 0.684 0.316
#> GSM494662     1  0.0000     0.8460 1.000 0.000
#> GSM494627     1  0.9954     0.1797 0.540 0.460
#> GSM494673     1  0.0000     0.8460 1.000 0.000
#> GSM494649     1  0.8267     0.6025 0.740 0.260
#> GSM494658     1  0.0000     0.8460 1.000 0.000
#> GSM494653     1  0.0000     0.8460 1.000 0.000
#> GSM494643     1  0.0000     0.8460 1.000 0.000
#> GSM494672     1  0.0000     0.8460 1.000 0.000
#> GSM494618     1  0.6247     0.7254 0.844 0.156
#> GSM494631     2  0.7528     0.6332 0.216 0.784
#> GSM494619     1  0.0000     0.8460 1.000 0.000
#> GSM494674     1  0.0000     0.8460 1.000 0.000
#> GSM494616     1  0.7745     0.6451 0.772 0.228
#> GSM494663     1  0.2043     0.8271 0.968 0.032
#> GSM494628     1  0.9129     0.4952 0.672 0.328
#> GSM494632     1  0.0000     0.8460 1.000 0.000
#> GSM494660     1  0.9248     0.4729 0.660 0.340
#> GSM494622     1  0.5629     0.7503 0.868 0.132
#> GSM494642     1  0.0000     0.8460 1.000 0.000
#> GSM494647     1  0.0000     0.8460 1.000 0.000
#> GSM494659     1  0.0000     0.8460 1.000 0.000
#> GSM494670     1  0.0000     0.8460 1.000 0.000
#> GSM494675     2  0.0000     0.8927 0.000 1.000
#> GSM494641     1  0.0000     0.8460 1.000 0.000
#> GSM494636     1  0.0000     0.8460 1.000 0.000
#> GSM494640     1  0.9323     0.4573 0.652 0.348
#> GSM494623     1  0.0000     0.8460 1.000 0.000
#> GSM494644     1  0.0000     0.8460 1.000 0.000
#> GSM494646     1  0.0000     0.8460 1.000 0.000
#> GSM494665     1  0.0000     0.8460 1.000 0.000
#> GSM494638     1  0.0000     0.8460 1.000 0.000
#> GSM494645     1  0.0000     0.8460 1.000 0.000
#> GSM494671     1  0.0000     0.8460 1.000 0.000
#> GSM494655     1  0.0000     0.8460 1.000 0.000
#> GSM494620     1  0.0000     0.8460 1.000 0.000
#> GSM494630     1  0.0000     0.8460 1.000 0.000
#> GSM494657     2  0.0000     0.8927 0.000 1.000
#> GSM494667     1  0.0000     0.8460 1.000 0.000
#> GSM494621     1  0.0000     0.8460 1.000 0.000
#> GSM494629     2  0.9686     0.2555 0.396 0.604
#> GSM494637     1  0.7815     0.6396 0.768 0.232
#> GSM494652     1  0.0000     0.8460 1.000 0.000
#> GSM494648     1  0.0000     0.8460 1.000 0.000
#> GSM494650     1  0.9460     0.4247 0.636 0.364
#> GSM494669     1  0.0000     0.8460 1.000 0.000
#> GSM494666     1  0.0000     0.8460 1.000 0.000
#> GSM494668     1  0.0000     0.8460 1.000 0.000
#> GSM494633     1  0.1184     0.8369 0.984 0.016
#> GSM494634     1  0.0000     0.8460 1.000 0.000
#> GSM494639     1  0.0000     0.8460 1.000 0.000
#> GSM494661     1  0.0000     0.8460 1.000 0.000
#> GSM494617     1  0.0000     0.8460 1.000 0.000
#> GSM494626     1  0.0000     0.8460 1.000 0.000
#> GSM494656     2  0.1184     0.8805 0.016 0.984
#> GSM494635     1  0.0000     0.8460 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
#> GSM494565     2  0.1289      0.962 0.000 0.968 0.032
#> GSM494594     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494604     2  0.2711      0.874 0.088 0.912 0.000
#> GSM494564     3  0.1753      0.923 0.000 0.048 0.952
#> GSM494591     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494567     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494602     2  0.0000      0.967 0.000 1.000 0.000
#> GSM494613     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494589     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494598     2  0.0424      0.968 0.000 0.992 0.008
#> GSM494593     2  0.0237      0.968 0.000 0.996 0.004
#> GSM494583     2  0.1163      0.965 0.000 0.972 0.028
#> GSM494612     2  0.0000      0.967 0.000 1.000 0.000
#> GSM494558     3  0.0747      0.955 0.016 0.000 0.984
#> GSM494556     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494559     3  0.6140      0.299 0.000 0.404 0.596
#> GSM494571     3  0.0237      0.959 0.004 0.000 0.996
#> GSM494614     2  0.2711      0.910 0.000 0.912 0.088
#> GSM494603     3  0.0424      0.958 0.008 0.000 0.992
#> GSM494568     3  0.0892      0.953 0.020 0.000 0.980
#> GSM494572     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494600     3  0.1163      0.941 0.000 0.028 0.972
#> GSM494562     2  0.0892      0.968 0.000 0.980 0.020
#> GSM494615     3  0.0424      0.958 0.008 0.000 0.992
#> GSM494582     2  0.0000      0.967 0.000 1.000 0.000
#> GSM494599     2  0.0000      0.967 0.000 1.000 0.000
#> GSM494610     2  0.0424      0.968 0.000 0.992 0.008
#> GSM494587     2  0.1031      0.967 0.000 0.976 0.024
#> GSM494581     2  0.0892      0.968 0.000 0.980 0.020
#> GSM494580     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494563     2  0.1163      0.965 0.000 0.972 0.028
#> GSM494576     2  0.0892      0.968 0.000 0.980 0.020
#> GSM494605     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494584     2  0.1163      0.965 0.000 0.972 0.028
#> GSM494586     2  0.0892      0.968 0.000 0.980 0.020
#> GSM494578     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494585     2  0.0892      0.968 0.000 0.980 0.020
#> GSM494611     2  0.0000      0.967 0.000 1.000 0.000
#> GSM494560     2  0.2066      0.939 0.000 0.940 0.060
#> GSM494595     2  0.0892      0.968 0.000 0.980 0.020
#> GSM494570     3  0.0892      0.953 0.020 0.000 0.980
#> GSM494597     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494607     2  0.0000      0.967 0.000 1.000 0.000
#> GSM494561     3  0.0892      0.953 0.020 0.000 0.980
#> GSM494569     1  0.1031      0.966 0.976 0.000 0.024
#> GSM494592     2  0.0000      0.967 0.000 1.000 0.000
#> GSM494577     2  0.1031      0.967 0.000 0.976 0.024
#> GSM494588     2  0.1289      0.962 0.000 0.968 0.032
#> GSM494590     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494609     2  0.0000      0.967 0.000 1.000 0.000
#> GSM494608     2  0.5926      0.428 0.356 0.644 0.000
#> GSM494606     2  0.0000      0.967 0.000 1.000 0.000
#> GSM494574     2  0.0237      0.968 0.000 0.996 0.004
#> GSM494573     3  0.3686      0.818 0.000 0.140 0.860
#> GSM494566     2  0.0892      0.968 0.000 0.980 0.020
#> GSM494601     2  0.0000      0.967 0.000 1.000 0.000
#> GSM494557     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494579     2  0.0892      0.968 0.000 0.980 0.020
#> GSM494596     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494575     2  0.0000      0.967 0.000 1.000 0.000
#> GSM494625     1  0.0237      0.980 0.996 0.000 0.004
#> GSM494654     3  0.0892      0.953 0.020 0.000 0.980
#> GSM494664     1  0.0424      0.981 0.992 0.008 0.000
#> GSM494624     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494651     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494662     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494627     3  0.5431      0.609 0.284 0.000 0.716
#> GSM494673     1  0.1031      0.977 0.976 0.024 0.000
#> GSM494649     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494658     1  0.1529      0.966 0.960 0.040 0.000
#> GSM494653     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494643     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494672     1  0.1163      0.975 0.972 0.028 0.000
#> GSM494618     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494631     3  0.0892      0.953 0.020 0.000 0.980
#> GSM494619     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494674     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494616     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494663     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494628     1  0.0592      0.975 0.988 0.000 0.012
#> GSM494632     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494660     1  0.0592      0.975 0.988 0.000 0.012
#> GSM494622     1  0.1411      0.955 0.964 0.000 0.036
#> GSM494642     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494647     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494659     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494670     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494675     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494641     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494636     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494640     1  0.5810      0.481 0.664 0.000 0.336
#> GSM494623     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494644     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494646     1  0.0237      0.981 0.996 0.004 0.000
#> GSM494665     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494638     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494645     1  0.0747      0.980 0.984 0.016 0.000
#> GSM494671     1  0.1163      0.975 0.972 0.028 0.000
#> GSM494655     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494620     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494630     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494657     3  0.0000      0.960 0.000 0.000 1.000
#> GSM494667     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494621     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494629     3  0.1860      0.925 0.052 0.000 0.948
#> GSM494637     1  0.0237      0.980 0.996 0.000 0.004
#> GSM494652     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494648     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494650     1  0.2448      0.912 0.924 0.000 0.076
#> GSM494669     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494666     1  0.0424      0.981 0.992 0.008 0.000
#> GSM494668     1  0.0892      0.979 0.980 0.020 0.000
#> GSM494633     1  0.0237      0.980 0.996 0.000 0.004
#> GSM494634     1  0.1163      0.975 0.972 0.028 0.000
#> GSM494639     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494661     1  0.0747      0.980 0.984 0.016 0.000
#> GSM494617     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494626     1  0.0000      0.981 1.000 0.000 0.000
#> GSM494656     3  0.0892      0.953 0.020 0.000 0.980
#> GSM494635     1  0.0747      0.980 0.984 0.016 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494594     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494604     1  0.0000      0.861 1.000 0.000 0.000 0.000
#> GSM494564     2  0.0592      0.937 0.000 0.984 0.000 0.016
#> GSM494591     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494567     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494602     1  0.0817      0.851 0.976 0.024 0.000 0.000
#> GSM494613     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494589     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494598     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494593     1  0.3942      0.620 0.764 0.236 0.000 0.000
#> GSM494583     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494612     1  0.0707      0.853 0.980 0.020 0.000 0.000
#> GSM494558     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494556     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494559     2  0.0592      0.937 0.000 0.984 0.000 0.016
#> GSM494571     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494614     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494603     2  0.1733      0.914 0.000 0.948 0.024 0.028
#> GSM494568     3  0.2741      0.859 0.000 0.012 0.892 0.096
#> GSM494572     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494600     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494562     2  0.2647      0.844 0.120 0.880 0.000 0.000
#> GSM494615     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494582     1  0.1940      0.815 0.924 0.076 0.000 0.000
#> GSM494599     1  0.0188      0.861 0.996 0.004 0.000 0.000
#> GSM494610     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494587     2  0.4072      0.663 0.252 0.748 0.000 0.000
#> GSM494581     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494580     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494563     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494576     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494605     4  0.1557      0.917 0.056 0.000 0.000 0.944
#> GSM494584     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494586     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494578     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494585     2  0.1716      0.901 0.064 0.936 0.000 0.000
#> GSM494611     1  0.2011      0.814 0.920 0.080 0.000 0.000
#> GSM494560     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494595     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494570     2  0.1118      0.921 0.000 0.964 0.000 0.036
#> GSM494597     3  0.3172      0.789 0.000 0.160 0.840 0.000
#> GSM494607     1  0.0000      0.861 1.000 0.000 0.000 0.000
#> GSM494561     4  0.1211      0.907 0.000 0.040 0.000 0.960
#> GSM494569     3  0.5231      0.333 0.012 0.000 0.604 0.384
#> GSM494592     1  0.0188      0.861 0.996 0.004 0.000 0.000
#> GSM494577     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494588     2  0.0592      0.937 0.000 0.984 0.000 0.016
#> GSM494590     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494609     2  0.4804      0.407 0.384 0.616 0.000 0.000
#> GSM494608     1  0.1389      0.847 0.952 0.000 0.000 0.048
#> GSM494606     1  0.0000      0.861 1.000 0.000 0.000 0.000
#> GSM494574     2  0.0817      0.930 0.024 0.976 0.000 0.000
#> GSM494573     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494566     2  0.5161      0.354 0.400 0.592 0.008 0.000
#> GSM494601     1  0.0592      0.855 0.984 0.016 0.000 0.000
#> GSM494557     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494579     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM494596     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494575     1  0.1389      0.835 0.952 0.048 0.000 0.000
#> GSM494625     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494664     4  0.1211      0.926 0.040 0.000 0.000 0.960
#> GSM494624     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494651     3  0.4155      0.667 0.004 0.000 0.756 0.240
#> GSM494662     4  0.0469      0.934 0.012 0.000 0.000 0.988
#> GSM494627     4  0.0469      0.928 0.000 0.000 0.012 0.988
#> GSM494673     1  0.1211      0.850 0.960 0.000 0.000 0.040
#> GSM494649     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494658     1  0.4977      0.160 0.540 0.000 0.000 0.460
#> GSM494653     4  0.4103      0.679 0.256 0.000 0.000 0.744
#> GSM494643     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494672     1  0.0000      0.861 1.000 0.000 0.000 0.000
#> GSM494618     4  0.0657      0.933 0.012 0.000 0.004 0.984
#> GSM494631     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494619     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494674     4  0.3764      0.745 0.216 0.000 0.000 0.784
#> GSM494616     4  0.4452      0.648 0.008 0.000 0.260 0.732
#> GSM494663     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494628     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494632     4  0.0817      0.932 0.024 0.000 0.000 0.976
#> GSM494660     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494622     4  0.5125      0.366 0.008 0.000 0.388 0.604
#> GSM494642     4  0.3266      0.811 0.168 0.000 0.000 0.832
#> GSM494647     1  0.3837      0.706 0.776 0.000 0.000 0.224
#> GSM494659     1  0.4331      0.604 0.712 0.000 0.000 0.288
#> GSM494670     4  0.3444      0.790 0.184 0.000 0.000 0.816
#> GSM494675     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494641     4  0.3172      0.821 0.160 0.000 0.000 0.840
#> GSM494636     4  0.0469      0.934 0.012 0.000 0.000 0.988
#> GSM494640     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494623     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494644     4  0.1302      0.924 0.044 0.000 0.000 0.956
#> GSM494646     4  0.0707      0.933 0.020 0.000 0.000 0.980
#> GSM494665     4  0.4477      0.565 0.312 0.000 0.000 0.688
#> GSM494638     4  0.0921      0.931 0.028 0.000 0.000 0.972
#> GSM494645     4  0.1022      0.929 0.032 0.000 0.000 0.968
#> GSM494671     1  0.0000      0.861 1.000 0.000 0.000 0.000
#> GSM494655     4  0.1389      0.922 0.048 0.000 0.000 0.952
#> GSM494620     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494630     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494657     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494667     1  0.3801      0.710 0.780 0.000 0.000 0.220
#> GSM494621     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494629     3  0.1867      0.885 0.000 0.000 0.928 0.072
#> GSM494637     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494652     1  0.3764      0.715 0.784 0.000 0.000 0.216
#> GSM494648     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494650     3  0.2408      0.851 0.000 0.000 0.896 0.104
#> GSM494669     1  0.4961      0.203 0.552 0.000 0.000 0.448
#> GSM494666     4  0.1302      0.924 0.044 0.000 0.000 0.956
#> GSM494668     4  0.2081      0.896 0.084 0.000 0.000 0.916
#> GSM494633     4  0.0000      0.933 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.861 1.000 0.000 0.000 0.000
#> GSM494639     4  0.0707      0.933 0.020 0.000 0.000 0.980
#> GSM494661     4  0.2081      0.896 0.084 0.000 0.000 0.916
#> GSM494617     4  0.0817      0.932 0.024 0.000 0.000 0.976
#> GSM494626     4  0.0707      0.933 0.020 0.000 0.000 0.980
#> GSM494656     3  0.0000      0.944 0.000 0.000 1.000 0.000
#> GSM494635     4  0.0592      0.933 0.016 0.000 0.000 0.984

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     5  0.3932     0.3919 0.000 0.328 0.000 0.000 0.672
#> GSM494594     3  0.0703     0.7843 0.000 0.024 0.976 0.000 0.000
#> GSM494604     1  0.2046     0.5758 0.916 0.000 0.000 0.016 0.068
#> GSM494564     5  0.1792     0.7198 0.000 0.084 0.000 0.000 0.916
#> GSM494591     3  0.0290     0.7868 0.000 0.008 0.992 0.000 0.000
#> GSM494567     3  0.2329     0.7417 0.000 0.124 0.876 0.000 0.000
#> GSM494602     1  0.3612     0.3983 0.732 0.268 0.000 0.000 0.000
#> GSM494613     3  0.4974     0.3603 0.000 0.408 0.560 0.000 0.032
#> GSM494589     5  0.2280     0.7119 0.000 0.120 0.000 0.000 0.880
#> GSM494598     1  0.5849     0.3515 0.508 0.100 0.000 0.000 0.392
#> GSM494593     2  0.2583     0.6679 0.132 0.864 0.000 0.000 0.004
#> GSM494583     2  0.2813     0.6470 0.000 0.832 0.000 0.000 0.168
#> GSM494612     2  0.4331     0.3255 0.400 0.596 0.000 0.004 0.000
#> GSM494558     3  0.4339     0.4076 0.000 0.012 0.652 0.000 0.336
#> GSM494556     3  0.3531     0.7066 0.000 0.148 0.816 0.000 0.036
#> GSM494559     2  0.2381     0.6806 0.008 0.912 0.008 0.012 0.060
#> GSM494571     3  0.0162     0.7872 0.000 0.004 0.996 0.000 0.000
#> GSM494614     2  0.2920     0.6584 0.000 0.852 0.016 0.000 0.132
#> GSM494603     5  0.1205     0.6950 0.004 0.040 0.000 0.000 0.956
#> GSM494568     5  0.3269     0.6400 0.004 0.012 0.144 0.004 0.836
#> GSM494572     3  0.0880     0.7836 0.000 0.032 0.968 0.000 0.000
#> GSM494600     5  0.2280     0.7127 0.000 0.120 0.000 0.000 0.880
#> GSM494562     1  0.5715     0.4315 0.564 0.100 0.000 0.000 0.336
#> GSM494615     3  0.3226     0.7376 0.000 0.088 0.852 0.000 0.060
#> GSM494582     1  0.4201     0.1822 0.664 0.328 0.000 0.000 0.008
#> GSM494599     1  0.1117     0.5643 0.964 0.020 0.000 0.016 0.000
#> GSM494610     1  0.5844     0.3044 0.484 0.096 0.000 0.000 0.420
#> GSM494587     2  0.2674     0.6894 0.084 0.888 0.008 0.000 0.020
#> GSM494581     2  0.0912     0.6921 0.000 0.972 0.012 0.000 0.016
#> GSM494580     3  0.2280     0.7457 0.000 0.120 0.880 0.000 0.000
#> GSM494563     5  0.1704     0.6967 0.004 0.068 0.000 0.000 0.928
#> GSM494576     2  0.4102     0.4894 0.004 0.692 0.004 0.000 0.300
#> GSM494605     4  0.1043     0.8747 0.040 0.000 0.000 0.960 0.000
#> GSM494584     2  0.1281     0.6982 0.000 0.956 0.012 0.000 0.032
#> GSM494586     2  0.6157     0.2862 0.140 0.496 0.000 0.000 0.364
#> GSM494578     2  0.4538    -0.1222 0.000 0.540 0.452 0.000 0.008
#> GSM494585     2  0.1740     0.6929 0.056 0.932 0.012 0.000 0.000
#> GSM494611     1  0.3934     0.4127 0.740 0.244 0.000 0.000 0.016
#> GSM494560     5  0.4283     0.1792 0.000 0.456 0.000 0.000 0.544
#> GSM494595     2  0.2616     0.6796 0.020 0.880 0.000 0.000 0.100
#> GSM494570     5  0.1894     0.7148 0.008 0.072 0.000 0.000 0.920
#> GSM494597     3  0.4528     0.2482 0.000 0.008 0.548 0.000 0.444
#> GSM494607     1  0.1026     0.5720 0.968 0.004 0.000 0.004 0.024
#> GSM494561     5  0.4790     0.5347 0.008 0.064 0.004 0.184 0.740
#> GSM494569     4  0.3197     0.7931 0.012 0.004 0.152 0.832 0.000
#> GSM494592     1  0.2464     0.5378 0.888 0.096 0.000 0.016 0.000
#> GSM494577     2  0.4702     0.2558 0.016 0.552 0.000 0.000 0.432
#> GSM494588     5  0.3684     0.5725 0.000 0.280 0.000 0.000 0.720
#> GSM494590     3  0.0000     0.7868 0.000 0.000 1.000 0.000 0.000
#> GSM494609     2  0.2403     0.6873 0.072 0.904 0.012 0.012 0.000
#> GSM494608     2  0.6086     0.2226 0.116 0.556 0.008 0.320 0.000
#> GSM494606     2  0.4872     0.2071 0.436 0.540 0.000 0.024 0.000
#> GSM494574     1  0.5729     0.3523 0.516 0.088 0.000 0.000 0.396
#> GSM494573     5  0.2966     0.6798 0.000 0.184 0.000 0.000 0.816
#> GSM494566     1  0.5778     0.4417 0.576 0.096 0.004 0.000 0.324
#> GSM494601     1  0.4306    -0.1071 0.508 0.492 0.000 0.000 0.000
#> GSM494557     3  0.4894     0.2568 0.000 0.456 0.520 0.000 0.024
#> GSM494579     5  0.2233     0.6816 0.016 0.080 0.000 0.000 0.904
#> GSM494596     3  0.0162     0.7872 0.000 0.004 0.996 0.000 0.000
#> GSM494575     2  0.2852     0.6427 0.172 0.828 0.000 0.000 0.000
#> GSM494625     4  0.4235     0.5197 0.008 0.000 0.000 0.656 0.336
#> GSM494654     3  0.0000     0.7868 0.000 0.000 1.000 0.000 0.000
#> GSM494664     4  0.1041     0.8769 0.032 0.000 0.000 0.964 0.004
#> GSM494624     5  0.4533     0.0248 0.008 0.000 0.000 0.448 0.544
#> GSM494651     3  0.4422     0.4749 0.004 0.012 0.664 0.320 0.000
#> GSM494662     4  0.0693     0.8726 0.008 0.000 0.000 0.980 0.012
#> GSM494627     4  0.2710     0.8464 0.008 0.000 0.064 0.892 0.036
#> GSM494673     4  0.3876     0.5864 0.316 0.000 0.000 0.684 0.000
#> GSM494649     4  0.2929     0.8060 0.008 0.000 0.000 0.840 0.152
#> GSM494658     1  0.4558     0.4214 0.652 0.000 0.000 0.324 0.024
#> GSM494653     4  0.1410     0.8703 0.060 0.000 0.000 0.940 0.000
#> GSM494643     4  0.0798     0.8715 0.008 0.000 0.000 0.976 0.016
#> GSM494672     1  0.2970     0.5338 0.828 0.004 0.000 0.168 0.000
#> GSM494618     4  0.2631     0.8588 0.004 0.012 0.044 0.904 0.036
#> GSM494631     3  0.1830     0.7796 0.004 0.052 0.932 0.012 0.000
#> GSM494619     4  0.4425     0.3849 0.008 0.000 0.000 0.600 0.392
#> GSM494674     4  0.1478     0.8680 0.064 0.000 0.000 0.936 0.000
#> GSM494616     4  0.2462     0.8324 0.000 0.008 0.112 0.880 0.000
#> GSM494663     4  0.3768     0.6963 0.008 0.004 0.000 0.760 0.228
#> GSM494628     4  0.5075     0.6804 0.004 0.008 0.084 0.720 0.184
#> GSM494632     4  0.0162     0.8767 0.004 0.000 0.000 0.996 0.000
#> GSM494660     4  0.3583     0.7779 0.008 0.016 0.000 0.808 0.168
#> GSM494622     3  0.7550     0.1298 0.024 0.012 0.416 0.252 0.296
#> GSM494642     4  0.1270     0.8717 0.052 0.000 0.000 0.948 0.000
#> GSM494647     4  0.2471     0.8234 0.136 0.000 0.000 0.864 0.000
#> GSM494659     4  0.3143     0.7568 0.204 0.000 0.000 0.796 0.000
#> GSM494670     1  0.4183     0.4160 0.668 0.000 0.000 0.324 0.008
#> GSM494675     5  0.2859     0.6669 0.016 0.012 0.096 0.000 0.876
#> GSM494641     4  0.1197     0.8727 0.048 0.000 0.000 0.952 0.000
#> GSM494636     4  0.0693     0.8726 0.008 0.000 0.000 0.980 0.012
#> GSM494640     4  0.1087     0.8727 0.008 0.000 0.008 0.968 0.016
#> GSM494623     5  0.4533     0.0429 0.008 0.000 0.000 0.448 0.544
#> GSM494644     4  0.0794     0.8762 0.028 0.000 0.000 0.972 0.000
#> GSM494646     4  0.0162     0.8756 0.000 0.000 0.000 0.996 0.004
#> GSM494665     4  0.2230     0.8453 0.116 0.000 0.000 0.884 0.000
#> GSM494638     4  0.1278     0.8758 0.016 0.004 0.020 0.960 0.000
#> GSM494645     4  0.0794     0.8762 0.028 0.000 0.000 0.972 0.000
#> GSM494671     1  0.2230     0.5638 0.884 0.000 0.000 0.116 0.000
#> GSM494655     4  0.0963     0.8755 0.036 0.000 0.000 0.964 0.000
#> GSM494620     4  0.2612     0.8151 0.008 0.000 0.000 0.868 0.124
#> GSM494630     4  0.1644     0.8644 0.008 0.004 0.000 0.940 0.048
#> GSM494657     3  0.0162     0.7872 0.000 0.004 0.996 0.000 0.000
#> GSM494667     4  0.2891     0.7841 0.176 0.000 0.000 0.824 0.000
#> GSM494621     4  0.4557     0.1346 0.008 0.000 0.000 0.516 0.476
#> GSM494629     3  0.4298     0.4311 0.008 0.000 0.640 0.352 0.000
#> GSM494637     4  0.0960     0.8721 0.008 0.000 0.004 0.972 0.016
#> GSM494652     4  0.2424     0.8233 0.132 0.000 0.000 0.868 0.000
#> GSM494648     4  0.4354     0.4427 0.008 0.000 0.000 0.624 0.368
#> GSM494650     3  0.3348     0.6872 0.004 0.012 0.836 0.140 0.008
#> GSM494669     4  0.1792     0.8595 0.084 0.000 0.000 0.916 0.000
#> GSM494666     4  0.0963     0.8755 0.036 0.000 0.000 0.964 0.000
#> GSM494668     4  0.2612     0.8369 0.124 0.000 0.000 0.868 0.008
#> GSM494633     4  0.2647     0.8454 0.008 0.024 0.000 0.892 0.076
#> GSM494634     1  0.4307    -0.1123 0.504 0.000 0.000 0.496 0.000
#> GSM494639     4  0.0290     0.8767 0.008 0.000 0.000 0.992 0.000
#> GSM494661     4  0.1043     0.8747 0.040 0.000 0.000 0.960 0.000
#> GSM494617     4  0.0955     0.8768 0.028 0.004 0.000 0.968 0.000
#> GSM494626     4  0.1748     0.8771 0.028 0.008 0.004 0.944 0.016
#> GSM494656     3  0.0000     0.7868 0.000 0.000 1.000 0.000 0.000
#> GSM494635     4  0.0451     0.8741 0.008 0.000 0.000 0.988 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
#> GSM494565     5  0.2015     0.7476 0.000 0.056 0.000 0.012 0.916 0.016
#> GSM494594     3  0.0436     0.8662 0.000 0.000 0.988 0.004 0.004 0.004
#> GSM494604     5  0.5235     0.1576 0.068 0.004 0.000 0.428 0.496 0.004
#> GSM494564     6  0.3632     0.5970 0.000 0.012 0.000 0.012 0.220 0.756
#> GSM494591     3  0.0767     0.8638 0.000 0.000 0.976 0.012 0.008 0.004
#> GSM494567     3  0.1843     0.8419 0.004 0.040 0.932 0.008 0.012 0.004
#> GSM494602     4  0.2838     0.6204 0.000 0.188 0.000 0.808 0.004 0.000
#> GSM494613     2  0.2540     0.7706 0.000 0.892 0.044 0.000 0.020 0.044
#> GSM494589     6  0.3897     0.5955 0.000 0.036 0.000 0.012 0.192 0.760
#> GSM494598     5  0.2121     0.7481 0.000 0.012 0.000 0.096 0.892 0.000
#> GSM494593     2  0.1644     0.7782 0.000 0.920 0.000 0.076 0.004 0.000
#> GSM494583     5  0.3360     0.6060 0.000 0.264 0.000 0.004 0.732 0.000
#> GSM494612     2  0.3288     0.5823 0.000 0.724 0.000 0.276 0.000 0.000
#> GSM494558     3  0.4876     0.3290 0.000 0.020 0.580 0.004 0.024 0.372
#> GSM494556     2  0.6709     0.2849 0.000 0.448 0.168 0.016 0.032 0.336
#> GSM494559     2  0.2585     0.7628 0.000 0.880 0.000 0.012 0.024 0.084
#> GSM494571     3  0.0291     0.8659 0.000 0.000 0.992 0.004 0.004 0.000
#> GSM494614     2  0.3628     0.7504 0.000 0.832 0.016 0.016 0.060 0.076
#> GSM494603     5  0.3608     0.5803 0.004 0.012 0.000 0.000 0.736 0.248
#> GSM494568     6  0.5519     0.4901 0.004 0.020 0.116 0.004 0.216 0.640
#> GSM494572     3  0.0964     0.8604 0.000 0.000 0.968 0.012 0.004 0.016
#> GSM494600     6  0.4303     0.3990 0.000 0.016 0.000 0.012 0.332 0.640
#> GSM494562     5  0.2750     0.7306 0.000 0.020 0.000 0.136 0.844 0.000
#> GSM494615     6  0.3792     0.6853 0.004 0.036 0.096 0.012 0.028 0.824
#> GSM494582     4  0.2165     0.6607 0.000 0.108 0.000 0.884 0.008 0.000
#> GSM494599     4  0.1245     0.6634 0.016 0.032 0.000 0.952 0.000 0.000
#> GSM494610     5  0.1858     0.7525 0.000 0.012 0.000 0.076 0.912 0.000
#> GSM494587     2  0.2231     0.7855 0.000 0.908 0.028 0.048 0.016 0.000
#> GSM494581     2  0.1194     0.7862 0.000 0.956 0.004 0.008 0.032 0.000
#> GSM494580     3  0.1269     0.8557 0.000 0.020 0.956 0.012 0.012 0.000
#> GSM494563     5  0.1606     0.7456 0.000 0.008 0.000 0.004 0.932 0.056
#> GSM494576     5  0.3850     0.5891 0.000 0.260 0.000 0.020 0.716 0.004
#> GSM494605     1  0.0260     0.8808 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM494584     2  0.4427     0.5542 0.000 0.684 0.040 0.012 0.264 0.000
#> GSM494586     5  0.3227     0.7287 0.000 0.084 0.000 0.088 0.828 0.000
#> GSM494578     2  0.2946     0.7094 0.000 0.824 0.160 0.012 0.000 0.004
#> GSM494585     2  0.1218     0.7871 0.000 0.956 0.004 0.028 0.012 0.000
#> GSM494611     4  0.1983     0.6634 0.000 0.072 0.000 0.908 0.020 0.000
#> GSM494560     2  0.6388     0.0246 0.000 0.372 0.000 0.012 0.332 0.284
#> GSM494595     2  0.2487     0.7629 0.000 0.876 0.000 0.032 0.092 0.000
#> GSM494570     6  0.2566     0.7044 0.000 0.012 0.000 0.008 0.112 0.868
#> GSM494597     5  0.3168     0.6373 0.000 0.016 0.192 0.000 0.792 0.000
#> GSM494607     5  0.4514     0.3954 0.040 0.000 0.000 0.372 0.588 0.000
#> GSM494561     6  0.1149     0.7459 0.008 0.008 0.000 0.000 0.024 0.960
#> GSM494569     1  0.2569     0.8284 0.880 0.000 0.092 0.004 0.012 0.012
#> GSM494592     4  0.2948     0.6236 0.008 0.188 0.000 0.804 0.000 0.000
#> GSM494577     5  0.1349     0.7523 0.000 0.056 0.000 0.004 0.940 0.000
#> GSM494588     2  0.5774     0.4078 0.000 0.548 0.000 0.012 0.276 0.164
#> GSM494590     3  0.0291     0.8669 0.000 0.000 0.992 0.004 0.004 0.000
#> GSM494609     2  0.0972     0.7865 0.000 0.964 0.000 0.028 0.008 0.000
#> GSM494608     2  0.2333     0.7599 0.040 0.896 0.004 0.060 0.000 0.000
#> GSM494606     2  0.2400     0.7511 0.008 0.872 0.000 0.116 0.000 0.004
#> GSM494574     5  0.1967     0.7508 0.000 0.012 0.000 0.084 0.904 0.000
#> GSM494573     5  0.4763     0.2431 0.000 0.032 0.000 0.012 0.564 0.392
#> GSM494566     4  0.5976     0.0961 0.020 0.032 0.004 0.524 0.368 0.052
#> GSM494601     4  0.4018     0.2416 0.000 0.412 0.000 0.580 0.008 0.000
#> GSM494557     2  0.2367     0.7608 0.000 0.888 0.088 0.000 0.016 0.008
#> GSM494579     5  0.1452     0.7546 0.000 0.012 0.000 0.020 0.948 0.020
#> GSM494596     3  0.0405     0.8662 0.000 0.000 0.988 0.008 0.004 0.000
#> GSM494575     2  0.1863     0.7670 0.000 0.896 0.000 0.104 0.000 0.000
#> GSM494625     6  0.2278     0.7517 0.128 0.000 0.000 0.004 0.000 0.868
#> GSM494654     3  0.0436     0.8665 0.000 0.000 0.988 0.004 0.004 0.004
#> GSM494664     1  0.2177     0.8619 0.916 0.012 0.000 0.012 0.016 0.044
#> GSM494624     6  0.1759     0.7687 0.064 0.004 0.000 0.004 0.004 0.924
#> GSM494651     3  0.4864     0.4310 0.328 0.020 0.620 0.000 0.020 0.012
#> GSM494662     1  0.1026     0.8776 0.968 0.004 0.008 0.008 0.000 0.012
#> GSM494627     1  0.4787     0.6934 0.720 0.008 0.068 0.004 0.016 0.184
#> GSM494673     1  0.2597     0.7683 0.824 0.000 0.000 0.176 0.000 0.000
#> GSM494649     6  0.2827     0.7534 0.132 0.008 0.000 0.004 0.008 0.848
#> GSM494658     1  0.5551     0.4727 0.620 0.004 0.000 0.248 0.100 0.028
#> GSM494653     1  0.0790     0.8782 0.968 0.000 0.000 0.032 0.000 0.000
#> GSM494643     1  0.2194     0.8397 0.892 0.004 0.004 0.004 0.000 0.096
#> GSM494672     4  0.2838     0.6122 0.188 0.004 0.000 0.808 0.000 0.000
#> GSM494618     1  0.5498     0.4201 0.584 0.020 0.056 0.000 0.016 0.324
#> GSM494631     3  0.0696     0.8652 0.000 0.008 0.980 0.004 0.004 0.004
#> GSM494619     6  0.4158     0.2742 0.400 0.004 0.000 0.004 0.004 0.588
#> GSM494674     1  0.0777     0.8785 0.972 0.004 0.000 0.024 0.000 0.000
#> GSM494616     1  0.2170     0.8572 0.916 0.016 0.044 0.000 0.016 0.008
#> GSM494663     1  0.4968     0.2010 0.524 0.016 0.000 0.004 0.028 0.428
#> GSM494628     6  0.4364     0.7081 0.152 0.024 0.024 0.008 0.020 0.772
#> GSM494632     1  0.0146     0.8803 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM494660     6  0.1957     0.7660 0.072 0.008 0.000 0.000 0.008 0.912
#> GSM494622     6  0.4291     0.7305 0.068 0.024 0.076 0.004 0.028 0.800
#> GSM494642     1  0.0458     0.8791 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM494647     1  0.1007     0.8742 0.956 0.000 0.000 0.044 0.000 0.000
#> GSM494659     1  0.1267     0.8667 0.940 0.000 0.000 0.060 0.000 0.000
#> GSM494670     4  0.5823     0.4139 0.244 0.004 0.000 0.588 0.024 0.140
#> GSM494675     5  0.6024     0.0575 0.000 0.020 0.088 0.016 0.468 0.408
#> GSM494641     1  0.0291     0.8802 0.992 0.004 0.000 0.004 0.000 0.000
#> GSM494636     1  0.0862     0.8784 0.972 0.000 0.004 0.008 0.000 0.016
#> GSM494640     1  0.3045     0.8309 0.864 0.004 0.052 0.008 0.004 0.068
#> GSM494623     6  0.2635     0.7614 0.100 0.004 0.000 0.004 0.020 0.872
#> GSM494644     1  0.0291     0.8804 0.992 0.004 0.000 0.000 0.000 0.004
#> GSM494646     1  0.0508     0.8805 0.984 0.000 0.000 0.004 0.000 0.012
#> GSM494665     1  0.1814     0.8466 0.900 0.000 0.000 0.100 0.000 0.000
#> GSM494638     1  0.1293     0.8753 0.956 0.004 0.020 0.004 0.000 0.016
#> GSM494645     1  0.0146     0.8806 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM494671     4  0.3747     0.3210 0.396 0.000 0.000 0.604 0.000 0.000
#> GSM494655     1  0.0146     0.8803 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM494620     1  0.3878     0.4932 0.644 0.004 0.000 0.004 0.000 0.348
#> GSM494630     1  0.2062     0.8446 0.900 0.004 0.000 0.008 0.000 0.088
#> GSM494657     3  0.0146     0.8667 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494667     1  0.1141     0.8692 0.948 0.000 0.000 0.052 0.000 0.000
#> GSM494621     6  0.3189     0.6397 0.236 0.000 0.000 0.004 0.000 0.760
#> GSM494629     3  0.4612     0.4750 0.284 0.000 0.656 0.008 0.000 0.052
#> GSM494637     1  0.2086     0.8536 0.912 0.004 0.012 0.008 0.000 0.064
#> GSM494652     1  0.0935     0.8761 0.964 0.004 0.000 0.032 0.000 0.000
#> GSM494648     1  0.3993     0.1406 0.520 0.000 0.000 0.004 0.000 0.476
#> GSM494650     3  0.4545     0.6543 0.156 0.020 0.752 0.000 0.020 0.052
#> GSM494669     1  0.0790     0.8764 0.968 0.000 0.000 0.032 0.000 0.000
#> GSM494666     1  0.0260     0.8808 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494668     1  0.4937     0.6466 0.684 0.004 0.000 0.116 0.008 0.188
#> GSM494633     6  0.2946     0.7445 0.160 0.012 0.000 0.004 0.000 0.824
#> GSM494634     1  0.1908     0.8353 0.900 0.000 0.000 0.096 0.000 0.004
#> GSM494639     1  0.0291     0.8809 0.992 0.000 0.000 0.004 0.000 0.004
#> GSM494661     1  0.0000     0.8803 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494617     1  0.1173     0.8730 0.960 0.016 0.000 0.000 0.016 0.008
#> GSM494626     1  0.3910     0.7562 0.788 0.020 0.012 0.004 0.016 0.160
#> GSM494656     3  0.0436     0.8662 0.000 0.000 0.988 0.004 0.004 0.004
#> GSM494635     1  0.0405     0.8806 0.988 0.004 0.000 0.000 0.000 0.008

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-NMF-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-NMF-collect-classes

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

test_to_known_factors(res)
#>          n disease.state(p) age(p) other(p) individual(p) k
#> SD:NMF  96         2.48e-13  0.942 2.34e-09         0.948 2
#> SD:NMF 117         8.48e-20  0.964 3.24e-17         0.982 3
#> SD:NMF 114         4.48e-14  0.443 3.97e-11         0.225 4
#> SD:NMF  87         1.54e-11  0.682 7.13e-09         0.663 5
#> SD:NMF  98         4.81e-12  0.261 6.65e-08         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.


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 51941 rows and 120 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 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-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.256           0.802       0.876         0.4745 0.497   0.497
#> 3 3 0.436           0.701       0.836         0.2822 0.852   0.707
#> 4 4 0.545           0.604       0.711         0.1500 0.824   0.582
#> 5 5 0.700           0.747       0.836         0.0880 0.849   0.550
#> 6 6 0.718           0.615       0.779         0.0565 0.968   0.856

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
#> GSM494565     1  0.8081     0.6776 0.752 0.248
#> GSM494594     2  0.0672     0.8413 0.008 0.992
#> GSM494604     1  0.0000     0.8724 1.000 0.000
#> GSM494564     2  0.8327     0.6765 0.264 0.736
#> GSM494591     2  0.0672     0.8413 0.008 0.992
#> GSM494567     2  0.4939     0.8338 0.108 0.892
#> GSM494602     1  0.0376     0.8721 0.996 0.004
#> GSM494613     2  0.4939     0.8338 0.108 0.892
#> GSM494589     2  0.8327     0.6765 0.264 0.736
#> GSM494598     1  0.0376     0.8721 0.996 0.004
#> GSM494593     1  0.0376     0.8721 0.996 0.004
#> GSM494583     1  0.8081     0.6713 0.752 0.248
#> GSM494612     1  0.0376     0.8721 0.996 0.004
#> GSM494558     2  0.2423     0.8554 0.040 0.960
#> GSM494556     2  0.5059     0.8350 0.112 0.888
#> GSM494559     2  0.8207     0.6792 0.256 0.744
#> GSM494571     2  0.0672     0.8413 0.008 0.992
#> GSM494614     1  0.9970     0.0849 0.532 0.468
#> GSM494603     2  0.4022     0.8679 0.080 0.920
#> GSM494568     2  0.4022     0.8679 0.080 0.920
#> GSM494572     2  0.0672     0.8413 0.008 0.992
#> GSM494600     2  0.8327     0.6765 0.264 0.736
#> GSM494562     1  0.0672     0.8717 0.992 0.008
#> GSM494615     2  0.4939     0.8338 0.108 0.892
#> GSM494582     1  0.0376     0.8721 0.996 0.004
#> GSM494599     1  0.0376     0.8721 0.996 0.004
#> GSM494610     1  0.0376     0.8721 0.996 0.004
#> GSM494587     1  0.6801     0.7611 0.820 0.180
#> GSM494581     1  0.5629     0.8094 0.868 0.132
#> GSM494580     2  0.4939     0.8338 0.108 0.892
#> GSM494563     2  0.9866     0.2726 0.432 0.568
#> GSM494576     1  0.5946     0.7978 0.856 0.144
#> GSM494605     1  0.8813     0.5712 0.700 0.300
#> GSM494584     1  0.8267     0.6616 0.740 0.260
#> GSM494586     1  0.4562     0.8317 0.904 0.096
#> GSM494578     2  0.4939     0.8338 0.108 0.892
#> GSM494585     1  0.6801     0.7630 0.820 0.180
#> GSM494611     1  0.0376     0.8721 0.996 0.004
#> GSM494560     2  0.8327     0.6765 0.264 0.736
#> GSM494595     1  0.1414     0.8686 0.980 0.020
#> GSM494570     2  0.8207     0.6792 0.256 0.744
#> GSM494597     2  0.0672     0.8413 0.008 0.992
#> GSM494607     1  0.0000     0.8724 1.000 0.000
#> GSM494561     2  0.8207     0.6792 0.256 0.744
#> GSM494569     2  0.5629     0.8754 0.132 0.868
#> GSM494592     1  0.0376     0.8721 0.996 0.004
#> GSM494577     1  0.7883     0.6960 0.764 0.236
#> GSM494588     2  0.8267     0.6777 0.260 0.740
#> GSM494590     2  0.0672     0.8413 0.008 0.992
#> GSM494609     1  0.5737     0.8073 0.864 0.136
#> GSM494608     1  0.5737     0.8073 0.864 0.136
#> GSM494606     1  0.0376     0.8721 0.996 0.004
#> GSM494574     1  0.0376     0.8721 0.996 0.004
#> GSM494573     2  0.8327     0.6765 0.264 0.736
#> GSM494566     1  0.8267     0.6849 0.740 0.260
#> GSM494601     1  0.3584     0.8454 0.932 0.068
#> GSM494557     2  0.4939     0.8338 0.108 0.892
#> GSM494579     1  0.7674     0.7135 0.776 0.224
#> GSM494596     2  0.0672     0.8413 0.008 0.992
#> GSM494575     1  0.0376     0.8721 0.996 0.004
#> GSM494625     2  0.5629     0.8754 0.132 0.868
#> GSM494654     2  0.0672     0.8413 0.008 0.992
#> GSM494664     1  0.8813     0.5712 0.700 0.300
#> GSM494624     2  0.5629     0.8754 0.132 0.868
#> GSM494651     2  0.5629     0.8754 0.132 0.868
#> GSM494662     2  0.6887     0.8319 0.184 0.816
#> GSM494627     2  0.5408     0.8754 0.124 0.876
#> GSM494673     1  0.0672     0.8724 0.992 0.008
#> GSM494649     2  0.5629     0.8754 0.132 0.868
#> GSM494658     1  0.0672     0.8724 0.992 0.008
#> GSM494653     1  0.0672     0.8724 0.992 0.008
#> GSM494643     2  0.5629     0.8754 0.132 0.868
#> GSM494672     1  0.0672     0.8724 0.992 0.008
#> GSM494618     2  0.5629     0.8754 0.132 0.868
#> GSM494631     2  0.5178     0.8358 0.116 0.884
#> GSM494619     2  0.5629     0.8754 0.132 0.868
#> GSM494674     1  0.0672     0.8724 0.992 0.008
#> GSM494616     2  0.5629     0.8754 0.132 0.868
#> GSM494663     2  0.5408     0.8754 0.124 0.876
#> GSM494628     2  0.5408     0.8754 0.124 0.876
#> GSM494632     2  0.7376     0.8047 0.208 0.792
#> GSM494660     2  0.5629     0.8754 0.132 0.868
#> GSM494622     2  0.5408     0.8754 0.124 0.876
#> GSM494642     1  0.0672     0.8724 0.992 0.008
#> GSM494647     1  0.0672     0.8724 0.992 0.008
#> GSM494659     1  0.0672     0.8724 0.992 0.008
#> GSM494670     1  0.0672     0.8724 0.992 0.008
#> GSM494675     2  0.0672     0.8413 0.008 0.992
#> GSM494641     1  0.0672     0.8724 0.992 0.008
#> GSM494636     2  0.7299     0.8093 0.204 0.796
#> GSM494640     2  0.5629     0.8754 0.132 0.868
#> GSM494623     2  0.5629     0.8754 0.132 0.868
#> GSM494644     1  0.8813     0.5712 0.700 0.300
#> GSM494646     1  0.8861     0.5637 0.696 0.304
#> GSM494665     1  0.8813     0.5712 0.700 0.300
#> GSM494638     2  0.6887     0.8319 0.184 0.816
#> GSM494645     1  0.8813     0.5712 0.700 0.300
#> GSM494671     1  0.0672     0.8724 0.992 0.008
#> GSM494655     1  0.0672     0.8724 0.992 0.008
#> GSM494620     2  0.5629     0.8754 0.132 0.868
#> GSM494630     2  0.5629     0.8754 0.132 0.868
#> GSM494657     2  0.0672     0.8413 0.008 0.992
#> GSM494667     1  0.0672     0.8724 0.992 0.008
#> GSM494621     2  0.5629     0.8754 0.132 0.868
#> GSM494629     2  0.5629     0.8754 0.132 0.868
#> GSM494637     2  0.5629     0.8754 0.132 0.868
#> GSM494652     1  0.0672     0.8724 0.992 0.008
#> GSM494648     2  0.5629     0.8754 0.132 0.868
#> GSM494650     2  0.5629     0.8754 0.132 0.868
#> GSM494669     1  0.0672     0.8724 0.992 0.008
#> GSM494666     1  0.8813     0.5712 0.700 0.300
#> GSM494668     1  0.0672     0.8724 0.992 0.008
#> GSM494633     2  0.5629     0.8754 0.132 0.868
#> GSM494634     1  0.0672     0.8724 0.992 0.008
#> GSM494639     2  0.7883     0.7679 0.236 0.764
#> GSM494661     1  0.8813     0.5712 0.700 0.300
#> GSM494617     2  0.5629     0.8754 0.132 0.868
#> GSM494626     2  0.5629     0.8754 0.132 0.868
#> GSM494656     2  0.0672     0.8413 0.008 0.992
#> GSM494635     1  0.8813     0.5712 0.700 0.300

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM494565     2  0.6159     0.6026 0.048 0.756 0.196
#> GSM494594     3  0.0000     0.6615 0.000 0.000 1.000
#> GSM494604     2  0.0892     0.7828 0.020 0.980 0.000
#> GSM494564     3  0.9665     0.6087 0.276 0.260 0.464
#> GSM494591     3  0.0000     0.6615 0.000 0.000 1.000
#> GSM494567     3  0.8637     0.4216 0.448 0.100 0.452
#> GSM494602     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494613     3  0.8637     0.4216 0.448 0.100 0.452
#> GSM494589     3  0.9665     0.6087 0.276 0.260 0.464
#> GSM494598     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494593     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494583     2  0.6159     0.5971 0.048 0.756 0.196
#> GSM494612     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494558     1  0.3192     0.7756 0.888 0.000 0.112
#> GSM494556     1  0.8637    -0.4405 0.456 0.100 0.444
#> GSM494559     3  0.9654     0.6059 0.288 0.248 0.464
#> GSM494571     3  0.0000     0.6615 0.000 0.000 1.000
#> GSM494614     2  0.7699     0.0315 0.048 0.532 0.420
#> GSM494603     1  0.2261     0.8470 0.932 0.000 0.068
#> GSM494568     1  0.2261     0.8470 0.932 0.000 0.068
#> GSM494572     3  0.0000     0.6615 0.000 0.000 1.000
#> GSM494600     3  0.9665     0.6087 0.276 0.260 0.464
#> GSM494562     2  0.0237     0.7782 0.000 0.996 0.004
#> GSM494615     3  0.8637     0.4216 0.448 0.100 0.452
#> GSM494582     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494599     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494610     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494587     2  0.4802     0.6743 0.020 0.824 0.156
#> GSM494581     2  0.3995     0.7212 0.016 0.868 0.116
#> GSM494580     3  0.8637     0.4216 0.448 0.100 0.452
#> GSM494563     2  0.9532    -0.2549 0.192 0.432 0.376
#> GSM494576     2  0.4413     0.7185 0.036 0.860 0.104
#> GSM494605     2  0.6225     0.4368 0.432 0.568 0.000
#> GSM494584     2  0.6302     0.5862 0.048 0.744 0.208
#> GSM494586     2  0.3043     0.7424 0.008 0.908 0.084
#> GSM494578     3  0.8637     0.4216 0.448 0.100 0.452
#> GSM494585     2  0.4802     0.6757 0.020 0.824 0.156
#> GSM494611     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494560     3  0.9665     0.6087 0.276 0.260 0.464
#> GSM494595     2  0.0829     0.7763 0.004 0.984 0.012
#> GSM494570     3  0.9654     0.6059 0.288 0.248 0.464
#> GSM494597     3  0.0237     0.6614 0.004 0.000 0.996
#> GSM494607     2  0.0892     0.7828 0.020 0.980 0.000
#> GSM494561     3  0.9657     0.5954 0.300 0.240 0.460
#> GSM494569     1  0.0237     0.9273 0.996 0.000 0.004
#> GSM494592     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494577     2  0.6007     0.6208 0.048 0.768 0.184
#> GSM494588     3  0.9676     0.6050 0.288 0.252 0.460
#> GSM494590     3  0.0000     0.6615 0.000 0.000 1.000
#> GSM494609     2  0.4068     0.7193 0.016 0.864 0.120
#> GSM494608     2  0.4068     0.7193 0.016 0.864 0.120
#> GSM494606     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494574     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494573     3  0.9665     0.6087 0.276 0.260 0.464
#> GSM494566     2  0.6449     0.6135 0.056 0.740 0.204
#> GSM494601     2  0.2492     0.7578 0.016 0.936 0.048
#> GSM494557     3  0.8637     0.4216 0.448 0.100 0.452
#> GSM494579     2  0.5798     0.6367 0.044 0.780 0.176
#> GSM494596     3  0.0000     0.6615 0.000 0.000 1.000
#> GSM494575     2  0.0000     0.7791 0.000 1.000 0.000
#> GSM494625     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494654     3  0.0000     0.6615 0.000 0.000 1.000
#> GSM494664     2  0.6225     0.4368 0.432 0.568 0.000
#> GSM494624     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494651     1  0.0237     0.9273 0.996 0.000 0.004
#> GSM494662     1  0.1860     0.8690 0.948 0.052 0.000
#> GSM494627     1  0.0424     0.9234 0.992 0.000 0.008
#> GSM494673     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494649     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494658     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494653     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494643     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494672     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494618     1  0.0237     0.9273 0.996 0.000 0.004
#> GSM494631     1  0.8587    -0.3307 0.500 0.100 0.400
#> GSM494619     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494674     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494616     1  0.0237     0.9273 0.996 0.000 0.004
#> GSM494663     1  0.0424     0.9234 0.992 0.000 0.008
#> GSM494628     1  0.0424     0.9234 0.992 0.000 0.008
#> GSM494632     1  0.2448     0.8392 0.924 0.076 0.000
#> GSM494660     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494622     1  0.0424     0.9234 0.992 0.000 0.008
#> GSM494642     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494647     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494659     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494670     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494675     3  0.0237     0.6614 0.004 0.000 0.996
#> GSM494641     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494636     1  0.2356     0.8443 0.928 0.072 0.000
#> GSM494640     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494623     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494644     2  0.6225     0.4368 0.432 0.568 0.000
#> GSM494646     2  0.6235     0.4275 0.436 0.564 0.000
#> GSM494665     2  0.6225     0.4368 0.432 0.568 0.000
#> GSM494638     1  0.1860     0.8690 0.948 0.052 0.000
#> GSM494645     2  0.6225     0.4368 0.432 0.568 0.000
#> GSM494671     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494655     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494620     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494630     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494657     3  0.0000     0.6615 0.000 0.000 1.000
#> GSM494667     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494621     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494629     1  0.0237     0.9273 0.996 0.000 0.004
#> GSM494637     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494652     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494648     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494650     1  0.0237     0.9273 0.996 0.000 0.004
#> GSM494669     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494666     2  0.6225     0.4368 0.432 0.568 0.000
#> GSM494668     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494633     1  0.0000     0.9283 1.000 0.000 0.000
#> GSM494634     2  0.3686     0.7813 0.140 0.860 0.000
#> GSM494639     1  0.3038     0.7992 0.896 0.104 0.000
#> GSM494661     2  0.6225     0.4368 0.432 0.568 0.000
#> GSM494617     1  0.0237     0.9273 0.996 0.000 0.004
#> GSM494626     1  0.0237     0.9273 0.996 0.000 0.004
#> GSM494656     3  0.0000     0.6615 0.000 0.000 1.000
#> GSM494635     2  0.6225     0.4368 0.432 0.568 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     3  0.6104   -0.05802 0.036 0.472 0.488 0.004
#> GSM494594     1  0.4382    0.98857 0.704 0.000 0.296 0.000
#> GSM494604     2  0.2353    0.70623 0.056 0.924 0.008 0.012
#> GSM494564     3  0.2124    0.56055 0.000 0.008 0.924 0.068
#> GSM494591     1  0.4382    0.98857 0.704 0.000 0.296 0.000
#> GSM494567     3  0.6102    0.49716 0.048 0.000 0.532 0.420
#> GSM494602     2  0.0524    0.70405 0.004 0.988 0.008 0.000
#> GSM494613     3  0.6102    0.49716 0.048 0.000 0.532 0.420
#> GSM494589     3  0.2124    0.56055 0.000 0.008 0.924 0.068
#> GSM494598     2  0.1488    0.69840 0.032 0.956 0.012 0.000
#> GSM494593     2  0.0469    0.70474 0.000 0.988 0.012 0.000
#> GSM494583     3  0.5775   -0.07613 0.020 0.488 0.488 0.004
#> GSM494612     2  0.1151    0.69975 0.024 0.968 0.008 0.000
#> GSM494558     4  0.3392    0.62864 0.072 0.000 0.056 0.872
#> GSM494556     3  0.6114    0.49207 0.048 0.000 0.524 0.428
#> GSM494559     3  0.2197    0.55760 0.004 0.000 0.916 0.080
#> GSM494571     1  0.4382    0.98857 0.704 0.000 0.296 0.000
#> GSM494614     3  0.5035    0.36840 0.016 0.284 0.696 0.004
#> GSM494603     4  0.2174    0.69990 0.052 0.000 0.020 0.928
#> GSM494568     4  0.2174    0.69990 0.052 0.000 0.020 0.928
#> GSM494572     1  0.4382    0.98857 0.704 0.000 0.296 0.000
#> GSM494600     3  0.2124    0.56055 0.000 0.008 0.924 0.068
#> GSM494562     2  0.1610    0.69654 0.032 0.952 0.016 0.000
#> GSM494615     3  0.6102    0.49716 0.048 0.000 0.532 0.420
#> GSM494582     2  0.1356    0.69696 0.032 0.960 0.008 0.000
#> GSM494599     2  0.0336    0.70464 0.000 0.992 0.008 0.000
#> GSM494610     2  0.1488    0.69840 0.032 0.956 0.012 0.000
#> GSM494587     2  0.4679    0.36744 0.000 0.648 0.352 0.000
#> GSM494581     2  0.3831    0.58864 0.004 0.792 0.204 0.000
#> GSM494580     3  0.6102    0.49716 0.048 0.000 0.532 0.420
#> GSM494563     3  0.4790    0.45503 0.032 0.148 0.796 0.024
#> GSM494576     2  0.6032    0.24339 0.040 0.576 0.380 0.004
#> GSM494605     4  0.7770   -0.00740 0.240 0.364 0.000 0.396
#> GSM494584     2  0.5336    0.03529 0.004 0.496 0.496 0.004
#> GSM494586     2  0.5619    0.35769 0.040 0.640 0.320 0.000
#> GSM494578     3  0.6102    0.49716 0.048 0.000 0.532 0.420
#> GSM494585     2  0.4697    0.36229 0.000 0.644 0.356 0.000
#> GSM494611     2  0.1151    0.69975 0.024 0.968 0.008 0.000
#> GSM494560     3  0.2124    0.56055 0.000 0.008 0.924 0.068
#> GSM494595     2  0.3895    0.62544 0.036 0.832 0.132 0.000
#> GSM494570     3  0.2197    0.55760 0.004 0.000 0.916 0.080
#> GSM494597     1  0.4643    0.94650 0.656 0.000 0.344 0.000
#> GSM494607     2  0.2353    0.70623 0.056 0.924 0.008 0.012
#> GSM494561     3  0.2401    0.55399 0.004 0.000 0.904 0.092
#> GSM494569     4  0.0779    0.76276 0.004 0.000 0.016 0.980
#> GSM494592     2  0.0336    0.70464 0.000 0.992 0.008 0.000
#> GSM494577     2  0.6178    0.01462 0.040 0.480 0.476 0.004
#> GSM494588     3  0.2011    0.55854 0.000 0.000 0.920 0.080
#> GSM494590     1  0.4382    0.98857 0.704 0.000 0.296 0.000
#> GSM494609     2  0.3870    0.58614 0.004 0.788 0.208 0.000
#> GSM494608     2  0.3870    0.58614 0.004 0.788 0.208 0.000
#> GSM494606     2  0.0592    0.70410 0.000 0.984 0.016 0.000
#> GSM494574     2  0.1488    0.69840 0.032 0.956 0.012 0.000
#> GSM494573     3  0.2124    0.56055 0.000 0.008 0.924 0.068
#> GSM494566     2  0.6260    0.08122 0.032 0.500 0.456 0.012
#> GSM494601     2  0.2814    0.63093 0.000 0.868 0.132 0.000
#> GSM494557     3  0.6102    0.49716 0.048 0.000 0.532 0.420
#> GSM494579     2  0.5503    0.10553 0.016 0.516 0.468 0.000
#> GSM494596     1  0.4382    0.98857 0.704 0.000 0.296 0.000
#> GSM494575     2  0.1151    0.69975 0.024 0.968 0.008 0.000
#> GSM494625     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494654     1  0.4382    0.98857 0.704 0.000 0.296 0.000
#> GSM494664     4  0.7770   -0.00740 0.240 0.364 0.000 0.396
#> GSM494624     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494651     4  0.0779    0.76276 0.004 0.000 0.016 0.980
#> GSM494662     4  0.2831    0.74950 0.044 0.008 0.040 0.908
#> GSM494627     4  0.0469    0.76299 0.012 0.000 0.000 0.988
#> GSM494673     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494649     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494658     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494653     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494643     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494672     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494618     4  0.0779    0.76276 0.004 0.000 0.016 0.980
#> GSM494631     3  0.6010    0.42344 0.040 0.000 0.488 0.472
#> GSM494619     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494674     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494616     4  0.0779    0.76276 0.004 0.000 0.016 0.980
#> GSM494663     4  0.0469    0.76299 0.012 0.000 0.000 0.988
#> GSM494628     4  0.0469    0.76299 0.012 0.000 0.000 0.988
#> GSM494632     4  0.3515    0.73017 0.072 0.012 0.040 0.876
#> GSM494660     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494622     4  0.0469    0.76299 0.012 0.000 0.000 0.988
#> GSM494642     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494647     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494659     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494670     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494675     1  0.4643    0.94650 0.656 0.000 0.344 0.000
#> GSM494641     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494636     4  0.3442    0.73291 0.068 0.012 0.040 0.880
#> GSM494640     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494623     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494644     4  0.7770   -0.00740 0.240 0.364 0.000 0.396
#> GSM494646     4  0.7720    0.02572 0.228 0.360 0.000 0.412
#> GSM494665     4  0.7770   -0.00740 0.240 0.364 0.000 0.396
#> GSM494638     4  0.2831    0.74950 0.044 0.008 0.040 0.908
#> GSM494645     4  0.7770   -0.00740 0.240 0.364 0.000 0.396
#> GSM494671     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494655     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494620     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494630     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494657     1  0.4382    0.98857 0.704 0.000 0.296 0.000
#> GSM494667     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494621     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494629     4  0.0779    0.76276 0.004 0.000 0.016 0.980
#> GSM494637     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494652     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494648     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494650     4  0.0779    0.76276 0.004 0.000 0.016 0.980
#> GSM494669     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494666     4  0.7770   -0.00740 0.240 0.364 0.000 0.396
#> GSM494668     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494633     4  0.1211    0.77085 0.000 0.000 0.040 0.960
#> GSM494634     2  0.6220    0.66832 0.248 0.648 0.000 0.104
#> GSM494639     4  0.4085    0.70836 0.092 0.020 0.040 0.848
#> GSM494661     4  0.7770   -0.00740 0.240 0.364 0.000 0.396
#> GSM494617     4  0.0779    0.76276 0.004 0.000 0.016 0.980
#> GSM494626     4  0.0779    0.76276 0.004 0.000 0.016 0.980
#> GSM494656     1  0.4382    0.98857 0.704 0.000 0.296 0.000
#> GSM494635     4  0.7740    0.00861 0.232 0.364 0.000 0.404

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     2  0.4341      0.435 0.008 0.628 0.000 0.000 0.364
#> GSM494594     3  0.0162      0.985 0.000 0.000 0.996 0.004 0.000
#> GSM494604     2  0.4307      0.369 0.496 0.504 0.000 0.000 0.000
#> GSM494564     5  0.0807      0.668 0.000 0.000 0.012 0.012 0.976
#> GSM494591     3  0.0000      0.986 0.000 0.000 1.000 0.000 0.000
#> GSM494567     5  0.6490      0.488 0.008 0.016 0.092 0.416 0.468
#> GSM494602     2  0.3242      0.759 0.216 0.784 0.000 0.000 0.000
#> GSM494613     5  0.6490      0.488 0.008 0.016 0.092 0.416 0.468
#> GSM494589     5  0.0807      0.668 0.000 0.000 0.012 0.012 0.976
#> GSM494598     2  0.3264      0.766 0.164 0.820 0.000 0.000 0.016
#> GSM494593     2  0.3336      0.757 0.228 0.772 0.000 0.000 0.000
#> GSM494583     2  0.4588      0.444 0.016 0.604 0.000 0.000 0.380
#> GSM494612     2  0.2773      0.765 0.164 0.836 0.000 0.000 0.000
#> GSM494558     4  0.3192      0.791 0.004 0.016 0.076 0.872 0.032
#> GSM494556     5  0.6454      0.472 0.008 0.016 0.088 0.424 0.464
#> GSM494559     5  0.1710      0.672 0.012 0.000 0.020 0.024 0.944
#> GSM494571     3  0.0000      0.986 0.000 0.000 1.000 0.000 0.000
#> GSM494614     5  0.5376      0.107 0.004 0.404 0.048 0.000 0.544
#> GSM494603     4  0.1557      0.857 0.000 0.000 0.052 0.940 0.008
#> GSM494568     4  0.1557      0.857 0.000 0.000 0.052 0.940 0.008
#> GSM494572     3  0.0000      0.986 0.000 0.000 1.000 0.000 0.000
#> GSM494600     5  0.0807      0.668 0.000 0.000 0.012 0.012 0.976
#> GSM494562     2  0.3359      0.767 0.164 0.816 0.000 0.000 0.020
#> GSM494615     5  0.6490      0.488 0.008 0.016 0.092 0.416 0.468
#> GSM494582     2  0.2848      0.764 0.156 0.840 0.000 0.000 0.004
#> GSM494599     2  0.3305      0.757 0.224 0.776 0.000 0.000 0.000
#> GSM494610     2  0.3264      0.766 0.164 0.820 0.000 0.000 0.016
#> GSM494587     2  0.5602      0.623 0.092 0.612 0.004 0.000 0.292
#> GSM494581     2  0.5726      0.712 0.188 0.640 0.000 0.004 0.168
#> GSM494580     5  0.6490      0.488 0.008 0.016 0.092 0.416 0.468
#> GSM494563     5  0.4003      0.360 0.008 0.288 0.000 0.000 0.704
#> GSM494576     2  0.3783      0.574 0.008 0.740 0.000 0.000 0.252
#> GSM494605     1  0.3857      0.653 0.688 0.000 0.000 0.312 0.000
#> GSM494584     2  0.4804      0.447 0.008 0.612 0.016 0.000 0.364
#> GSM494586     2  0.3675      0.627 0.024 0.788 0.000 0.000 0.188
#> GSM494578     5  0.6490      0.488 0.008 0.016 0.092 0.416 0.468
#> GSM494585     2  0.5620      0.617 0.092 0.608 0.004 0.000 0.296
#> GSM494611     2  0.2773      0.765 0.164 0.836 0.000 0.000 0.000
#> GSM494560     5  0.0807      0.668 0.000 0.000 0.012 0.012 0.976
#> GSM494595     2  0.3281      0.741 0.092 0.848 0.000 0.000 0.060
#> GSM494570     5  0.1710      0.672 0.012 0.000 0.020 0.024 0.944
#> GSM494597     3  0.1571      0.940 0.000 0.004 0.936 0.000 0.060
#> GSM494607     2  0.4307      0.369 0.496 0.504 0.000 0.000 0.000
#> GSM494561     5  0.1869      0.670 0.012 0.000 0.016 0.036 0.936
#> GSM494569     4  0.1200      0.889 0.008 0.016 0.000 0.964 0.012
#> GSM494592     2  0.3305      0.757 0.224 0.776 0.000 0.000 0.000
#> GSM494577     2  0.4298      0.451 0.008 0.640 0.000 0.000 0.352
#> GSM494588     5  0.1617      0.672 0.012 0.000 0.020 0.020 0.948
#> GSM494590     3  0.0000      0.986 0.000 0.000 1.000 0.000 0.000
#> GSM494609     2  0.5759      0.709 0.188 0.636 0.000 0.004 0.172
#> GSM494608     2  0.5759      0.709 0.188 0.636 0.000 0.004 0.172
#> GSM494606     2  0.3461      0.758 0.224 0.772 0.000 0.000 0.004
#> GSM494574     2  0.3264      0.766 0.164 0.820 0.000 0.000 0.016
#> GSM494573     5  0.0807      0.668 0.000 0.000 0.012 0.012 0.976
#> GSM494566     2  0.6257      0.446 0.052 0.580 0.036 0.012 0.320
#> GSM494601     2  0.4852      0.747 0.184 0.716 0.000 0.000 0.100
#> GSM494557     5  0.6490      0.488 0.008 0.016 0.092 0.416 0.468
#> GSM494579     2  0.5142      0.478 0.052 0.600 0.000 0.000 0.348
#> GSM494596     3  0.0000      0.986 0.000 0.000 1.000 0.000 0.000
#> GSM494575     2  0.2773      0.765 0.164 0.836 0.000 0.000 0.000
#> GSM494625     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494654     3  0.0162      0.985 0.000 0.000 0.996 0.004 0.000
#> GSM494664     1  0.3857      0.653 0.688 0.000 0.000 0.312 0.000
#> GSM494624     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494651     4  0.1200      0.889 0.008 0.016 0.000 0.964 0.012
#> GSM494662     4  0.2782      0.870 0.072 0.000 0.000 0.880 0.048
#> GSM494627     4  0.0000      0.895 0.000 0.000 0.000 1.000 0.000
#> GSM494673     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494649     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494658     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494653     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494643     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494672     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494618     4  0.1200      0.889 0.008 0.016 0.000 0.964 0.012
#> GSM494631     4  0.6329     -0.413 0.008 0.016 0.076 0.468 0.432
#> GSM494619     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494674     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494616     4  0.1200      0.889 0.008 0.016 0.000 0.964 0.012
#> GSM494663     4  0.0000      0.895 0.000 0.000 0.000 1.000 0.000
#> GSM494628     4  0.0000      0.895 0.000 0.000 0.000 1.000 0.000
#> GSM494632     4  0.3389      0.826 0.116 0.000 0.000 0.836 0.048
#> GSM494660     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494622     4  0.0000      0.895 0.000 0.000 0.000 1.000 0.000
#> GSM494642     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494647     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494659     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494670     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494675     3  0.1571      0.940 0.000 0.004 0.936 0.000 0.060
#> GSM494641     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494636     4  0.3339      0.831 0.112 0.000 0.000 0.840 0.048
#> GSM494640     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494623     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494644     1  0.3857      0.653 0.688 0.000 0.000 0.312 0.000
#> GSM494646     1  0.3932      0.626 0.672 0.000 0.000 0.328 0.000
#> GSM494665     1  0.3857      0.653 0.688 0.000 0.000 0.312 0.000
#> GSM494638     4  0.2782      0.870 0.072 0.000 0.000 0.880 0.048
#> GSM494645     1  0.3857      0.653 0.688 0.000 0.000 0.312 0.000
#> GSM494671     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494655     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494620     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494630     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494657     3  0.0000      0.986 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494621     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494629     4  0.1200      0.889 0.008 0.016 0.000 0.964 0.012
#> GSM494637     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494652     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494648     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494650     4  0.1200      0.889 0.008 0.016 0.000 0.964 0.012
#> GSM494669     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494666     1  0.3857      0.653 0.688 0.000 0.000 0.312 0.000
#> GSM494668     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494633     4  0.2006      0.904 0.012 0.000 0.000 0.916 0.072
#> GSM494634     1  0.0510      0.830 0.984 0.000 0.000 0.016 0.000
#> GSM494639     4  0.3794      0.781 0.152 0.000 0.000 0.800 0.048
#> GSM494661     1  0.3857      0.653 0.688 0.000 0.000 0.312 0.000
#> GSM494617     4  0.1200      0.889 0.008 0.016 0.000 0.964 0.012
#> GSM494626     4  0.1200      0.889 0.008 0.016 0.000 0.964 0.012
#> GSM494656     3  0.0162      0.985 0.000 0.000 0.996 0.004 0.000
#> GSM494635     1  0.3895      0.639 0.680 0.000 0.000 0.320 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
#> GSM494565     5  0.4806     -0.202 0.000 0.460 0.000 0.000 0.488 0.052
#> GSM494594     3  0.0260      0.982 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM494604     2  0.4097      0.347 0.488 0.504 0.000 0.000 0.008 0.000
#> GSM494564     5  0.5392      0.422 0.004 0.004 0.000 0.084 0.492 0.416
#> GSM494591     3  0.0000      0.982 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     6  0.2070      0.597 0.000 0.000 0.044 0.048 0.000 0.908
#> GSM494602     2  0.2454      0.715 0.160 0.840 0.000 0.000 0.000 0.000
#> GSM494613     6  0.2070      0.597 0.000 0.000 0.044 0.048 0.000 0.908
#> GSM494589     5  0.5258      0.434 0.000 0.004 0.000 0.084 0.500 0.412
#> GSM494598     2  0.3252      0.712 0.108 0.824 0.000 0.000 0.068 0.000
#> GSM494593     2  0.2668      0.714 0.168 0.828 0.000 0.000 0.000 0.004
#> GSM494583     2  0.5711      0.125 0.000 0.492 0.000 0.000 0.328 0.180
#> GSM494612     2  0.2889      0.710 0.108 0.848 0.000 0.000 0.044 0.000
#> GSM494558     6  0.6390     -0.323 0.000 0.000 0.064 0.388 0.108 0.440
#> GSM494556     6  0.2129      0.592 0.000 0.000 0.040 0.056 0.000 0.904
#> GSM494559     6  0.5497     -0.361 0.004 0.004 0.000 0.096 0.408 0.488
#> GSM494571     3  0.0000      0.982 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494614     6  0.6024     -0.220 0.000 0.284 0.008 0.000 0.220 0.488
#> GSM494603     4  0.5335      0.659 0.000 0.000 0.044 0.668 0.108 0.180
#> GSM494568     4  0.5335      0.659 0.000 0.000 0.044 0.668 0.108 0.180
#> GSM494572     3  0.0000      0.982 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494600     5  0.5258      0.434 0.000 0.004 0.000 0.084 0.500 0.412
#> GSM494562     2  0.3252      0.713 0.108 0.824 0.000 0.000 0.068 0.000
#> GSM494615     6  0.2070      0.597 0.000 0.000 0.044 0.048 0.000 0.908
#> GSM494582     2  0.3138      0.708 0.108 0.832 0.000 0.000 0.060 0.000
#> GSM494599     2  0.2527      0.713 0.168 0.832 0.000 0.000 0.000 0.000
#> GSM494610     2  0.3252      0.712 0.108 0.824 0.000 0.000 0.068 0.000
#> GSM494587     2  0.6111      0.454 0.056 0.576 0.000 0.000 0.148 0.220
#> GSM494581     2  0.5167      0.637 0.140 0.668 0.000 0.000 0.020 0.172
#> GSM494580     6  0.2070      0.597 0.000 0.000 0.044 0.048 0.000 0.908
#> GSM494563     5  0.4204      0.326 0.000 0.132 0.000 0.000 0.740 0.128
#> GSM494576     2  0.4334      0.300 0.000 0.568 0.000 0.000 0.408 0.024
#> GSM494605     1  0.3409      0.695 0.700 0.000 0.000 0.300 0.000 0.000
#> GSM494584     2  0.5869      0.168 0.000 0.504 0.004 0.000 0.208 0.284
#> GSM494586     2  0.4034      0.392 0.004 0.624 0.000 0.000 0.364 0.008
#> GSM494578     6  0.2070      0.597 0.000 0.000 0.044 0.048 0.000 0.908
#> GSM494585     2  0.6001      0.466 0.060 0.584 0.000 0.000 0.116 0.240
#> GSM494611     2  0.2889      0.710 0.108 0.848 0.000 0.000 0.044 0.000
#> GSM494560     5  0.5258      0.434 0.000 0.004 0.000 0.084 0.500 0.412
#> GSM494595     2  0.4108      0.650 0.060 0.748 0.000 0.000 0.184 0.008
#> GSM494570     6  0.5505     -0.371 0.004 0.004 0.000 0.096 0.416 0.480
#> GSM494597     3  0.2074      0.931 0.000 0.004 0.912 0.000 0.036 0.048
#> GSM494607     2  0.4097      0.347 0.488 0.504 0.000 0.000 0.008 0.000
#> GSM494561     6  0.5602     -0.356 0.004 0.004 0.000 0.108 0.408 0.476
#> GSM494569     4  0.5313      0.469 0.000 0.000 0.000 0.508 0.108 0.384
#> GSM494592     2  0.2527      0.713 0.168 0.832 0.000 0.000 0.000 0.000
#> GSM494577     5  0.4651     -0.220 0.000 0.476 0.000 0.000 0.484 0.040
#> GSM494588     6  0.5501     -0.370 0.004 0.004 0.000 0.096 0.412 0.484
#> GSM494590     3  0.0146      0.982 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM494609     2  0.5197      0.634 0.140 0.664 0.000 0.000 0.020 0.176
#> GSM494608     2  0.5197      0.634 0.140 0.664 0.000 0.000 0.020 0.176
#> GSM494606     2  0.2778      0.714 0.168 0.824 0.000 0.000 0.000 0.008
#> GSM494574     2  0.3252      0.712 0.108 0.824 0.000 0.000 0.068 0.000
#> GSM494573     5  0.5258      0.434 0.000 0.004 0.000 0.084 0.500 0.412
#> GSM494566     2  0.7258      0.176 0.044 0.480 0.028 0.012 0.180 0.256
#> GSM494601     2  0.4410      0.678 0.144 0.744 0.000 0.000 0.016 0.096
#> GSM494557     6  0.2070      0.597 0.000 0.000 0.044 0.048 0.000 0.908
#> GSM494579     2  0.6403      0.204 0.036 0.496 0.000 0.000 0.232 0.236
#> GSM494596     3  0.0000      0.982 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.2889      0.710 0.108 0.848 0.000 0.000 0.044 0.000
#> GSM494625     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494654     3  0.0260      0.982 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM494664     1  0.3409      0.695 0.700 0.000 0.000 0.300 0.000 0.000
#> GSM494624     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494651     4  0.5330      0.452 0.000 0.000 0.000 0.496 0.108 0.396
#> GSM494662     4  0.1267      0.752 0.060 0.000 0.000 0.940 0.000 0.000
#> GSM494627     4  0.4286      0.694 0.000 0.000 0.000 0.728 0.108 0.164
#> GSM494673     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494649     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494658     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494653     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494643     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494672     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494618     4  0.5330      0.452 0.000 0.000 0.000 0.496 0.108 0.396
#> GSM494631     6  0.2881      0.559 0.000 0.000 0.040 0.084 0.012 0.864
#> GSM494619     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494674     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494616     4  0.5330      0.452 0.000 0.000 0.000 0.496 0.108 0.396
#> GSM494663     4  0.4286      0.694 0.000 0.000 0.000 0.728 0.108 0.164
#> GSM494628     4  0.4286      0.694 0.000 0.000 0.000 0.728 0.108 0.164
#> GSM494632     4  0.1910      0.718 0.108 0.000 0.000 0.892 0.000 0.000
#> GSM494660     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494622     4  0.4286      0.694 0.000 0.000 0.000 0.728 0.108 0.164
#> GSM494642     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494647     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494659     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494670     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494675     3  0.2074      0.931 0.000 0.004 0.912 0.000 0.036 0.048
#> GSM494641     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494636     4  0.1863      0.722 0.104 0.000 0.000 0.896 0.000 0.000
#> GSM494640     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494623     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494644     1  0.3409      0.695 0.700 0.000 0.000 0.300 0.000 0.000
#> GSM494646     1  0.3499      0.665 0.680 0.000 0.000 0.320 0.000 0.000
#> GSM494665     1  0.3409      0.695 0.700 0.000 0.000 0.300 0.000 0.000
#> GSM494638     4  0.1267      0.752 0.060 0.000 0.000 0.940 0.000 0.000
#> GSM494645     1  0.3409      0.695 0.700 0.000 0.000 0.300 0.000 0.000
#> GSM494671     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494655     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494620     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494630     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494657     3  0.0146      0.982 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM494667     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494621     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494629     4  0.5313      0.469 0.000 0.000 0.000 0.508 0.108 0.384
#> GSM494637     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494652     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494648     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494650     4  0.5330      0.452 0.000 0.000 0.000 0.496 0.108 0.396
#> GSM494669     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494666     1  0.3409      0.695 0.700 0.000 0.000 0.300 0.000 0.000
#> GSM494668     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494633     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494634     1  0.0146      0.850 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494639     4  0.2416      0.667 0.156 0.000 0.000 0.844 0.000 0.000
#> GSM494661     1  0.3409      0.695 0.700 0.000 0.000 0.300 0.000 0.000
#> GSM494617     4  0.5330      0.452 0.000 0.000 0.000 0.496 0.108 0.396
#> GSM494626     4  0.5330      0.452 0.000 0.000 0.000 0.496 0.108 0.396
#> GSM494656     3  0.0260      0.982 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM494635     1  0.3446      0.685 0.692 0.000 0.000 0.308 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 5)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-hclust-collect-classes

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

test_to_known_factors(res)
#>             n disease.state(p)   age(p) other(p) individual(p) k
#> CV:hclust 118         2.73e-01 0.000385 4.78e-02      0.000694 2
#> CV:hclust 101         2.19e-07 0.015644 4.83e-05      0.128619 3
#> CV:hclust  91         2.20e-06 0.029381 3.22e-05      0.061477 4
#> CV:hclust 102         4.92e-15 0.103337 1.16e-11      0.555458 5
#> CV:hclust  88         1.09e-12 0.133799 1.29e-11      0.493639 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 51941 rows and 120 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 0.487           0.636       0.783         0.5011 0.496   0.496
#> 3 3 0.503           0.660       0.771         0.3165 0.841   0.685
#> 4 4 0.781           0.854       0.885         0.1270 0.866   0.634
#> 5 5 0.837           0.818       0.875         0.0655 0.951   0.805
#> 6 6 0.835           0.717       0.801         0.0387 0.936   0.709

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
#> GSM494565     2  0.9963      0.724 0.464 0.536
#> GSM494594     2  0.9963      0.724 0.464 0.536
#> GSM494604     1  0.9970      0.653 0.532 0.468
#> GSM494564     2  0.9963      0.724 0.464 0.536
#> GSM494591     2  0.9963      0.724 0.464 0.536
#> GSM494567     2  0.9963      0.724 0.464 0.536
#> GSM494602     2  0.0000      0.520 0.000 1.000
#> GSM494613     2  0.9963      0.724 0.464 0.536
#> GSM494589     2  0.9963      0.724 0.464 0.536
#> GSM494598     2  0.0000      0.520 0.000 1.000
#> GSM494593     2  0.0000      0.520 0.000 1.000
#> GSM494583     2  0.9552      0.687 0.376 0.624
#> GSM494612     2  0.0000      0.520 0.000 1.000
#> GSM494558     2  0.9963      0.724 0.464 0.536
#> GSM494556     2  0.9963      0.724 0.464 0.536
#> GSM494559     2  0.9963      0.724 0.464 0.536
#> GSM494571     2  0.9963      0.724 0.464 0.536
#> GSM494614     2  0.9963      0.724 0.464 0.536
#> GSM494603     2  0.9963      0.724 0.464 0.536
#> GSM494568     2  0.9963      0.724 0.464 0.536
#> GSM494572     2  0.9963      0.724 0.464 0.536
#> GSM494600     2  0.9963      0.724 0.464 0.536
#> GSM494562     2  0.1184      0.529 0.016 0.984
#> GSM494615     2  0.9963      0.724 0.464 0.536
#> GSM494582     2  0.0000      0.520 0.000 1.000
#> GSM494599     2  0.0000      0.520 0.000 1.000
#> GSM494610     2  0.0000      0.520 0.000 1.000
#> GSM494587     2  0.4161      0.565 0.084 0.916
#> GSM494581     2  0.3114      0.551 0.056 0.944
#> GSM494580     2  0.9963      0.724 0.464 0.536
#> GSM494563     2  0.9963      0.724 0.464 0.536
#> GSM494576     2  0.6887      0.606 0.184 0.816
#> GSM494605     1  0.9963      0.657 0.536 0.464
#> GSM494584     2  0.9963      0.724 0.464 0.536
#> GSM494586     2  0.0938      0.527 0.012 0.988
#> GSM494578     2  0.9963      0.724 0.464 0.536
#> GSM494585     2  0.3431      0.556 0.064 0.936
#> GSM494611     2  0.0000      0.520 0.000 1.000
#> GSM494560     2  0.9963      0.724 0.464 0.536
#> GSM494595     2  0.0376      0.522 0.004 0.996
#> GSM494570     2  0.9963      0.724 0.464 0.536
#> GSM494597     2  0.9963      0.724 0.464 0.536
#> GSM494607     2  0.4939      0.327 0.108 0.892
#> GSM494561     2  0.9963      0.724 0.464 0.536
#> GSM494569     1  0.0000      0.595 1.000 0.000
#> GSM494592     2  0.0000      0.520 0.000 1.000
#> GSM494577     2  0.6887      0.606 0.184 0.816
#> GSM494588     2  0.9963      0.724 0.464 0.536
#> GSM494590     2  0.9963      0.724 0.464 0.536
#> GSM494609     2  0.0000      0.520 0.000 1.000
#> GSM494608     2  0.0000      0.520 0.000 1.000
#> GSM494606     2  0.0000      0.520 0.000 1.000
#> GSM494574     2  0.0000      0.520 0.000 1.000
#> GSM494573     2  0.9963      0.724 0.464 0.536
#> GSM494566     2  0.9963      0.724 0.464 0.536
#> GSM494601     2  0.0000      0.520 0.000 1.000
#> GSM494557     2  0.9963      0.724 0.464 0.536
#> GSM494579     2  0.3584      0.558 0.068 0.932
#> GSM494596     2  0.9963      0.724 0.464 0.536
#> GSM494575     2  0.0000      0.520 0.000 1.000
#> GSM494625     1  0.0000      0.595 1.000 0.000
#> GSM494654     2  0.9963      0.724 0.464 0.536
#> GSM494664     1  0.9963      0.657 0.536 0.464
#> GSM494624     1  0.0672      0.601 0.992 0.008
#> GSM494651     1  0.0000      0.595 1.000 0.000
#> GSM494662     1  0.1414      0.607 0.980 0.020
#> GSM494627     1  0.0000      0.595 1.000 0.000
#> GSM494673     1  0.9963      0.657 0.536 0.464
#> GSM494649     1  0.0000      0.595 1.000 0.000
#> GSM494658     1  0.9963      0.657 0.536 0.464
#> GSM494653     1  0.9963      0.657 0.536 0.464
#> GSM494643     1  0.1414      0.607 0.980 0.020
#> GSM494672     1  0.9963      0.657 0.536 0.464
#> GSM494618     1  0.0376      0.598 0.996 0.004
#> GSM494631     2  0.9963      0.724 0.464 0.536
#> GSM494619     1  0.1414      0.607 0.980 0.020
#> GSM494674     1  0.9963      0.657 0.536 0.464
#> GSM494616     1  0.0000      0.595 1.000 0.000
#> GSM494663     1  0.0000      0.595 1.000 0.000
#> GSM494628     1  0.0000      0.595 1.000 0.000
#> GSM494632     1  0.9963      0.657 0.536 0.464
#> GSM494660     1  0.0000      0.595 1.000 0.000
#> GSM494622     1  0.0000      0.595 1.000 0.000
#> GSM494642     1  0.9963      0.657 0.536 0.464
#> GSM494647     1  0.9963      0.657 0.536 0.464
#> GSM494659     1  0.9963      0.657 0.536 0.464
#> GSM494670     1  0.9963      0.657 0.536 0.464
#> GSM494675     2  0.9963      0.724 0.464 0.536
#> GSM494641     1  0.9963      0.657 0.536 0.464
#> GSM494636     1  0.1414      0.607 0.980 0.020
#> GSM494640     1  0.0000      0.595 1.000 0.000
#> GSM494623     1  0.1414      0.607 0.980 0.020
#> GSM494644     1  0.9963      0.657 0.536 0.464
#> GSM494646     1  0.9963      0.657 0.536 0.464
#> GSM494665     1  0.9963      0.657 0.536 0.464
#> GSM494638     1  0.1414      0.607 0.980 0.020
#> GSM494645     1  0.9963      0.657 0.536 0.464
#> GSM494671     1  0.9963      0.657 0.536 0.464
#> GSM494655     1  0.9963      0.657 0.536 0.464
#> GSM494620     1  0.1414      0.607 0.980 0.020
#> GSM494630     1  0.1414      0.607 0.980 0.020
#> GSM494657     2  0.9963      0.724 0.464 0.536
#> GSM494667     1  0.9963      0.657 0.536 0.464
#> GSM494621     1  0.1414      0.607 0.980 0.020
#> GSM494629     1  0.0000      0.595 1.000 0.000
#> GSM494637     1  0.0000      0.595 1.000 0.000
#> GSM494652     1  0.9963      0.657 0.536 0.464
#> GSM494648     1  0.1414      0.607 0.980 0.020
#> GSM494650     1  0.0000      0.595 1.000 0.000
#> GSM494669     1  0.9963      0.657 0.536 0.464
#> GSM494666     1  0.9963      0.657 0.536 0.464
#> GSM494668     1  0.9963      0.657 0.536 0.464
#> GSM494633     1  0.0000      0.595 1.000 0.000
#> GSM494634     1  0.9963      0.657 0.536 0.464
#> GSM494639     1  0.9963      0.657 0.536 0.464
#> GSM494661     1  0.9963      0.657 0.536 0.464
#> GSM494617     1  0.1184      0.605 0.984 0.016
#> GSM494626     1  0.0672      0.601 0.992 0.008
#> GSM494656     2  0.9963      0.724 0.464 0.536
#> GSM494635     1  0.9963      0.657 0.536 0.464

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM494565     2  0.6420      0.548 0.024 0.688 0.288
#> GSM494594     3  0.1878      0.804 0.004 0.044 0.952
#> GSM494604     2  0.5621      0.375 0.308 0.692 0.000
#> GSM494564     3  0.6287      0.644 0.024 0.272 0.704
#> GSM494591     3  0.4233      0.809 0.004 0.160 0.836
#> GSM494567     3  0.3896      0.828 0.008 0.128 0.864
#> GSM494602     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494613     3  0.4033      0.828 0.008 0.136 0.856
#> GSM494589     3  0.5053      0.799 0.024 0.164 0.812
#> GSM494598     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494593     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494583     2  0.5465      0.583 0.000 0.712 0.288
#> GSM494612     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494558     3  0.0424      0.783 0.008 0.000 0.992
#> GSM494556     3  0.4033      0.828 0.008 0.136 0.856
#> GSM494559     3  0.6952      0.414 0.024 0.376 0.600
#> GSM494571     3  0.0237      0.784 0.004 0.000 0.996
#> GSM494614     3  0.6209      0.454 0.004 0.368 0.628
#> GSM494603     3  0.0983      0.785 0.016 0.004 0.980
#> GSM494568     3  0.1031      0.769 0.024 0.000 0.976
#> GSM494572     3  0.3851      0.828 0.004 0.136 0.860
#> GSM494600     3  0.5585      0.752 0.024 0.204 0.772
#> GSM494562     2  0.3267      0.725 0.000 0.884 0.116
#> GSM494615     3  0.0848      0.788 0.008 0.008 0.984
#> GSM494582     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494599     2  0.3686      0.657 0.140 0.860 0.000
#> GSM494610     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494587     2  0.5465      0.583 0.000 0.712 0.288
#> GSM494581     2  0.5465      0.583 0.000 0.712 0.288
#> GSM494580     3  0.4033      0.828 0.008 0.136 0.856
#> GSM494563     2  0.6420      0.548 0.024 0.688 0.288
#> GSM494576     2  0.5465      0.583 0.000 0.712 0.288
#> GSM494605     1  0.1031      0.709 0.976 0.024 0.000
#> GSM494584     2  0.6264      0.372 0.004 0.616 0.380
#> GSM494586     2  0.3267      0.725 0.000 0.884 0.116
#> GSM494578     3  0.4033      0.828 0.008 0.136 0.856
#> GSM494585     2  0.5465      0.583 0.000 0.712 0.288
#> GSM494611     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494560     3  0.7043      0.353 0.024 0.400 0.576
#> GSM494595     2  0.0237      0.773 0.000 0.996 0.004
#> GSM494570     3  0.3637      0.816 0.024 0.084 0.892
#> GSM494597     3  0.4047      0.820 0.004 0.148 0.848
#> GSM494607     2  0.4121      0.623 0.168 0.832 0.000
#> GSM494561     3  0.1031      0.777 0.024 0.000 0.976
#> GSM494569     1  0.6026      0.570 0.624 0.000 0.376
#> GSM494592     2  0.3686      0.657 0.140 0.860 0.000
#> GSM494577     2  0.5465      0.583 0.000 0.712 0.288
#> GSM494588     2  0.6451      0.544 0.024 0.684 0.292
#> GSM494590     3  0.3851      0.828 0.004 0.136 0.860
#> GSM494609     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494608     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494606     2  0.3686      0.657 0.140 0.860 0.000
#> GSM494574     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494573     3  0.6879      0.453 0.024 0.360 0.616
#> GSM494566     2  0.6129      0.501 0.008 0.668 0.324
#> GSM494601     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494557     3  0.4353      0.814 0.008 0.156 0.836
#> GSM494579     2  0.5465      0.583 0.000 0.712 0.288
#> GSM494596     3  0.4047      0.820 0.004 0.148 0.848
#> GSM494575     2  0.0000      0.774 0.000 1.000 0.000
#> GSM494625     1  0.5948      0.575 0.640 0.000 0.360
#> GSM494654     3  0.0424      0.781 0.008 0.000 0.992
#> GSM494664     1  0.0892      0.710 0.980 0.020 0.000
#> GSM494624     1  0.4178      0.705 0.828 0.000 0.172
#> GSM494651     1  0.6062      0.560 0.616 0.000 0.384
#> GSM494662     1  0.4235      0.705 0.824 0.000 0.176
#> GSM494627     1  0.6062      0.560 0.616 0.000 0.384
#> GSM494673     1  0.5650      0.578 0.688 0.312 0.000
#> GSM494649     1  0.5948      0.575 0.640 0.000 0.360
#> GSM494658     1  0.5678      0.574 0.684 0.316 0.000
#> GSM494653     1  0.5650      0.578 0.688 0.312 0.000
#> GSM494643     1  0.4121      0.706 0.832 0.000 0.168
#> GSM494672     1  0.5678      0.574 0.684 0.316 0.000
#> GSM494618     1  0.6026      0.570 0.624 0.000 0.376
#> GSM494631     3  0.0747      0.777 0.016 0.000 0.984
#> GSM494619     1  0.4178      0.705 0.828 0.000 0.172
#> GSM494674     1  0.5621      0.581 0.692 0.308 0.000
#> GSM494616     1  0.6026      0.570 0.624 0.000 0.376
#> GSM494663     1  0.5968      0.574 0.636 0.000 0.364
#> GSM494628     1  0.6062      0.560 0.616 0.000 0.384
#> GSM494632     1  0.1315      0.711 0.972 0.020 0.008
#> GSM494660     1  0.5948      0.575 0.640 0.000 0.360
#> GSM494622     1  0.6062      0.560 0.616 0.000 0.384
#> GSM494642     1  0.5650      0.578 0.688 0.312 0.000
#> GSM494647     1  0.5650      0.578 0.688 0.312 0.000
#> GSM494659     1  0.5650      0.578 0.688 0.312 0.000
#> GSM494670     1  0.5650      0.578 0.688 0.312 0.000
#> GSM494675     3  0.4099      0.826 0.008 0.140 0.852
#> GSM494641     1  0.5650      0.578 0.688 0.312 0.000
#> GSM494636     1  0.4235      0.705 0.824 0.000 0.176
#> GSM494640     1  0.6045      0.562 0.620 0.000 0.380
#> GSM494623     1  0.4178      0.705 0.828 0.000 0.172
#> GSM494644     1  0.5621      0.581 0.692 0.308 0.000
#> GSM494646     1  0.0892      0.710 0.980 0.020 0.000
#> GSM494665     1  0.4974      0.621 0.764 0.236 0.000
#> GSM494638     1  0.4645      0.707 0.816 0.008 0.176
#> GSM494645     1  0.1031      0.709 0.976 0.024 0.000
#> GSM494671     1  0.5678      0.574 0.684 0.316 0.000
#> GSM494655     1  0.5621      0.581 0.692 0.308 0.000
#> GSM494620     1  0.4178      0.705 0.828 0.000 0.172
#> GSM494630     1  0.4178      0.705 0.828 0.000 0.172
#> GSM494657     3  0.3851      0.828 0.004 0.136 0.860
#> GSM494667     1  0.5650      0.578 0.688 0.312 0.000
#> GSM494621     1  0.4178      0.705 0.828 0.000 0.172
#> GSM494629     3  0.6244     -0.195 0.440 0.000 0.560
#> GSM494637     1  0.5968      0.574 0.636 0.000 0.364
#> GSM494652     1  0.5650      0.578 0.688 0.312 0.000
#> GSM494648     1  0.4178      0.705 0.828 0.000 0.172
#> GSM494650     1  0.6062      0.560 0.616 0.000 0.384
#> GSM494669     1  0.5650      0.578 0.688 0.312 0.000
#> GSM494666     1  0.1031      0.709 0.976 0.024 0.000
#> GSM494668     1  0.5621      0.581 0.692 0.308 0.000
#> GSM494633     1  0.4399      0.699 0.812 0.000 0.188
#> GSM494634     1  0.5678      0.574 0.684 0.316 0.000
#> GSM494639     1  0.0892      0.710 0.980 0.020 0.000
#> GSM494661     1  0.4002      0.659 0.840 0.160 0.000
#> GSM494617     1  0.4399      0.703 0.812 0.000 0.188
#> GSM494626     1  0.5859      0.600 0.656 0.000 0.344
#> GSM494656     3  0.0237      0.784 0.004 0.000 0.996
#> GSM494635     1  0.1031      0.709 0.976 0.024 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     2  0.4332      0.824 0.112 0.816 0.072 0.000
#> GSM494594     3  0.1284      0.862 0.024 0.000 0.964 0.012
#> GSM494604     1  0.3726      0.729 0.788 0.212 0.000 0.000
#> GSM494564     3  0.6190      0.675 0.112 0.168 0.704 0.016
#> GSM494591     3  0.1617      0.864 0.024 0.008 0.956 0.012
#> GSM494567     3  0.1174      0.864 0.000 0.020 0.968 0.012
#> GSM494602     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494613     3  0.1174      0.864 0.000 0.020 0.968 0.012
#> GSM494589     3  0.3736      0.807 0.108 0.020 0.856 0.016
#> GSM494598     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494593     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494583     2  0.3383      0.867 0.076 0.872 0.052 0.000
#> GSM494612     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494558     3  0.1520      0.859 0.024 0.000 0.956 0.020
#> GSM494556     3  0.1174      0.864 0.000 0.020 0.968 0.012
#> GSM494559     3  0.7458      0.160 0.112 0.412 0.460 0.016
#> GSM494571     3  0.1284      0.862 0.024 0.000 0.964 0.012
#> GSM494614     3  0.5988      0.615 0.100 0.224 0.676 0.000
#> GSM494603     3  0.7371      0.367 0.112 0.016 0.512 0.360
#> GSM494568     4  0.5862     -0.121 0.032 0.000 0.484 0.484
#> GSM494572     3  0.1617      0.864 0.024 0.008 0.956 0.012
#> GSM494600     3  0.3736      0.807 0.108 0.020 0.856 0.016
#> GSM494562     2  0.0524      0.923 0.004 0.988 0.008 0.000
#> GSM494615     3  0.1059      0.864 0.000 0.016 0.972 0.012
#> GSM494582     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494599     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494610     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494587     2  0.1118      0.911 0.000 0.964 0.036 0.000
#> GSM494581     2  0.1305      0.913 0.004 0.960 0.036 0.000
#> GSM494580     3  0.1174      0.864 0.000 0.020 0.968 0.012
#> GSM494563     2  0.4571      0.821 0.116 0.808 0.072 0.004
#> GSM494576     2  0.1798      0.904 0.016 0.944 0.040 0.000
#> GSM494605     1  0.3355      0.948 0.836 0.004 0.000 0.160
#> GSM494584     2  0.5759      0.609 0.080 0.688 0.232 0.000
#> GSM494586     2  0.0524      0.923 0.004 0.988 0.008 0.000
#> GSM494578     3  0.1174      0.864 0.000 0.020 0.968 0.012
#> GSM494585     2  0.1109      0.915 0.004 0.968 0.028 0.000
#> GSM494611     2  0.1022      0.927 0.032 0.968 0.000 0.000
#> GSM494560     3  0.7365      0.128 0.112 0.424 0.452 0.012
#> GSM494595     2  0.0336      0.926 0.008 0.992 0.000 0.000
#> GSM494570     3  0.7633      0.373 0.120 0.024 0.500 0.356
#> GSM494597     3  0.1617      0.864 0.024 0.008 0.956 0.012
#> GSM494607     2  0.3801      0.705 0.220 0.780 0.000 0.000
#> GSM494561     3  0.7505      0.315 0.120 0.016 0.480 0.384
#> GSM494569     4  0.1284      0.920 0.012 0.000 0.024 0.964
#> GSM494592     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494577     2  0.3286      0.873 0.080 0.876 0.044 0.000
#> GSM494588     2  0.4905      0.813 0.120 0.800 0.060 0.020
#> GSM494590     3  0.1617      0.864 0.024 0.008 0.956 0.012
#> GSM494609     2  0.0592      0.927 0.016 0.984 0.000 0.000
#> GSM494608     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494606     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494574     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494573     3  0.6136      0.677 0.108 0.168 0.708 0.016
#> GSM494566     2  0.5056      0.741 0.076 0.760 0.164 0.000
#> GSM494601     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494557     3  0.1174      0.864 0.000 0.020 0.968 0.012
#> GSM494579     2  0.2699      0.890 0.068 0.904 0.028 0.000
#> GSM494596     3  0.1617      0.864 0.024 0.008 0.956 0.012
#> GSM494575     2  0.0921      0.927 0.028 0.972 0.000 0.000
#> GSM494625     4  0.0657      0.920 0.012 0.004 0.000 0.984
#> GSM494654     3  0.1520      0.859 0.024 0.000 0.956 0.020
#> GSM494664     1  0.3356      0.931 0.824 0.000 0.000 0.176
#> GSM494624     4  0.1209      0.917 0.032 0.004 0.000 0.964
#> GSM494651     4  0.1388      0.918 0.012 0.000 0.028 0.960
#> GSM494662     4  0.1211      0.912 0.040 0.000 0.000 0.960
#> GSM494627     4  0.1256      0.919 0.008 0.000 0.028 0.964
#> GSM494673     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494649     4  0.0657      0.920 0.012 0.004 0.000 0.984
#> GSM494658     1  0.3934      0.957 0.836 0.048 0.000 0.116
#> GSM494653     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494643     4  0.0779      0.918 0.016 0.004 0.000 0.980
#> GSM494672     1  0.3934      0.957 0.836 0.048 0.000 0.116
#> GSM494618     4  0.1284      0.920 0.012 0.000 0.024 0.964
#> GSM494631     3  0.1209      0.860 0.000 0.004 0.964 0.032
#> GSM494619     4  0.1305      0.916 0.036 0.004 0.000 0.960
#> GSM494674     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494616     4  0.1284      0.920 0.012 0.000 0.024 0.964
#> GSM494663     4  0.1042      0.921 0.008 0.000 0.020 0.972
#> GSM494628     4  0.1388      0.918 0.012 0.000 0.028 0.960
#> GSM494632     4  0.4406      0.477 0.300 0.000 0.000 0.700
#> GSM494660     4  0.0657      0.920 0.012 0.004 0.000 0.984
#> GSM494622     4  0.1388      0.918 0.012 0.000 0.028 0.960
#> GSM494642     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494647     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494659     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494670     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494675     3  0.1404      0.865 0.012 0.012 0.964 0.012
#> GSM494641     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494636     4  0.1211      0.912 0.040 0.000 0.000 0.960
#> GSM494640     4  0.0779      0.922 0.004 0.000 0.016 0.980
#> GSM494623     4  0.1305      0.916 0.036 0.004 0.000 0.960
#> GSM494644     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494646     1  0.3444      0.927 0.816 0.000 0.000 0.184
#> GSM494665     1  0.3606      0.967 0.844 0.024 0.000 0.132
#> GSM494638     4  0.1211      0.912 0.040 0.000 0.000 0.960
#> GSM494645     1  0.3356      0.935 0.824 0.000 0.000 0.176
#> GSM494671     1  0.3907      0.961 0.836 0.044 0.000 0.120
#> GSM494655     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494620     4  0.1305      0.916 0.036 0.004 0.000 0.960
#> GSM494630     4  0.1305      0.916 0.036 0.004 0.000 0.960
#> GSM494657     3  0.1617      0.864 0.024 0.008 0.956 0.012
#> GSM494667     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494621     4  0.1305      0.916 0.036 0.004 0.000 0.960
#> GSM494629     4  0.2737      0.838 0.008 0.000 0.104 0.888
#> GSM494637     4  0.0779      0.922 0.004 0.000 0.016 0.980
#> GSM494652     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494648     4  0.1305      0.916 0.036 0.004 0.000 0.960
#> GSM494650     4  0.2101      0.892 0.012 0.000 0.060 0.928
#> GSM494669     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494666     1  0.3400      0.931 0.820 0.000 0.000 0.180
#> GSM494668     1  0.3803      0.971 0.836 0.032 0.000 0.132
#> GSM494633     4  0.1209      0.917 0.032 0.004 0.000 0.964
#> GSM494634     1  0.3842      0.968 0.836 0.036 0.000 0.128
#> GSM494639     4  0.4804      0.221 0.384 0.000 0.000 0.616
#> GSM494661     1  0.3257      0.954 0.844 0.004 0.000 0.152
#> GSM494617     4  0.1545      0.914 0.040 0.000 0.008 0.952
#> GSM494626     4  0.1284      0.920 0.012 0.000 0.024 0.964
#> GSM494656     3  0.1520      0.859 0.024 0.000 0.956 0.020
#> GSM494635     1  0.3356      0.935 0.824 0.000 0.000 0.176

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     5  0.4758      0.604 0.000 0.276 0.048 0.000 0.676
#> GSM494594     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM494604     1  0.3320      0.807 0.820 0.164 0.000 0.004 0.012
#> GSM494564     5  0.3835      0.661 0.000 0.008 0.260 0.000 0.732
#> GSM494591     3  0.0162      0.886 0.000 0.000 0.996 0.000 0.004
#> GSM494567     3  0.2864      0.862 0.000 0.000 0.864 0.024 0.112
#> GSM494602     2  0.0000      0.892 0.000 1.000 0.000 0.000 0.000
#> GSM494613     3  0.2813      0.863 0.000 0.000 0.868 0.024 0.108
#> GSM494589     5  0.4135      0.601 0.000 0.004 0.340 0.000 0.656
#> GSM494598     2  0.1041      0.888 0.000 0.964 0.000 0.004 0.032
#> GSM494593     2  0.0162      0.892 0.000 0.996 0.000 0.004 0.000
#> GSM494583     2  0.4658      0.289 0.000 0.576 0.000 0.016 0.408
#> GSM494612     2  0.0000      0.892 0.000 1.000 0.000 0.000 0.000
#> GSM494558     3  0.3731      0.816 0.000 0.000 0.816 0.112 0.072
#> GSM494556     3  0.3060      0.847 0.000 0.000 0.848 0.024 0.128
#> GSM494559     5  0.5035      0.727 0.000 0.144 0.124 0.008 0.724
#> GSM494571     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM494614     5  0.5363      0.621 0.000 0.056 0.320 0.008 0.616
#> GSM494603     5  0.5773      0.492 0.000 0.000 0.100 0.356 0.544
#> GSM494568     4  0.3506      0.655 0.000 0.000 0.064 0.832 0.104
#> GSM494572     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM494600     5  0.4135      0.601 0.000 0.004 0.340 0.000 0.656
#> GSM494562     2  0.1282      0.887 0.000 0.952 0.000 0.004 0.044
#> GSM494615     3  0.3134      0.852 0.000 0.000 0.848 0.032 0.120
#> GSM494582     2  0.1041      0.888 0.000 0.964 0.000 0.004 0.032
#> GSM494599     2  0.0000      0.892 0.000 1.000 0.000 0.000 0.000
#> GSM494610     2  0.1041      0.888 0.000 0.964 0.000 0.004 0.032
#> GSM494587     2  0.1485      0.887 0.000 0.948 0.000 0.020 0.032
#> GSM494581     2  0.1310      0.882 0.000 0.956 0.000 0.020 0.024
#> GSM494580     3  0.2864      0.862 0.000 0.000 0.864 0.024 0.112
#> GSM494563     5  0.4842      0.614 0.000 0.264 0.048 0.004 0.684
#> GSM494576     2  0.2909      0.800 0.000 0.848 0.000 0.012 0.140
#> GSM494605     1  0.0807      0.972 0.976 0.000 0.000 0.012 0.012
#> GSM494584     5  0.6491      0.381 0.000 0.396 0.112 0.020 0.472
#> GSM494586     2  0.1282      0.887 0.000 0.952 0.000 0.004 0.044
#> GSM494578     3  0.2864      0.862 0.000 0.000 0.864 0.024 0.112
#> GSM494585     2  0.1012      0.888 0.000 0.968 0.000 0.020 0.012
#> GSM494611     2  0.0000      0.892 0.000 1.000 0.000 0.000 0.000
#> GSM494560     5  0.5177      0.689 0.000 0.220 0.104 0.000 0.676
#> GSM494595     2  0.1205      0.888 0.000 0.956 0.000 0.004 0.040
#> GSM494570     5  0.2516      0.661 0.000 0.000 0.140 0.000 0.860
#> GSM494597     3  0.0162      0.886 0.000 0.000 0.996 0.000 0.004
#> GSM494607     2  0.0963      0.860 0.036 0.964 0.000 0.000 0.000
#> GSM494561     5  0.3401      0.596 0.000 0.000 0.096 0.064 0.840
#> GSM494569     4  0.0865      0.834 0.024 0.000 0.004 0.972 0.000
#> GSM494592     2  0.0000      0.892 0.000 1.000 0.000 0.000 0.000
#> GSM494577     2  0.4473      0.296 0.000 0.580 0.000 0.008 0.412
#> GSM494588     5  0.4170      0.682 0.000 0.192 0.048 0.000 0.760
#> GSM494590     3  0.0162      0.886 0.000 0.000 0.996 0.000 0.004
#> GSM494609     2  0.1117      0.886 0.000 0.964 0.000 0.020 0.016
#> GSM494608     2  0.1117      0.886 0.000 0.964 0.000 0.020 0.016
#> GSM494606     2  0.0162      0.892 0.000 0.996 0.000 0.004 0.000
#> GSM494574     2  0.1041      0.888 0.000 0.964 0.000 0.004 0.032
#> GSM494573     5  0.4235      0.607 0.000 0.008 0.336 0.000 0.656
#> GSM494566     2  0.5971     -0.235 0.000 0.468 0.044 0.032 0.456
#> GSM494601     2  0.0566      0.891 0.000 0.984 0.000 0.004 0.012
#> GSM494557     3  0.2864      0.862 0.000 0.000 0.864 0.024 0.112
#> GSM494579     2  0.4505      0.357 0.000 0.604 0.000 0.012 0.384
#> GSM494596     3  0.0162      0.886 0.000 0.000 0.996 0.000 0.004
#> GSM494575     2  0.0000      0.892 0.000 1.000 0.000 0.000 0.000
#> GSM494625     4  0.4484      0.793 0.024 0.000 0.000 0.668 0.308
#> GSM494654     3  0.1341      0.845 0.000 0.000 0.944 0.056 0.000
#> GSM494664     1  0.0807      0.972 0.976 0.000 0.000 0.012 0.012
#> GSM494624     4  0.4820      0.780 0.036 0.000 0.000 0.632 0.332
#> GSM494651     4  0.0865      0.834 0.024 0.000 0.004 0.972 0.000
#> GSM494662     4  0.2850      0.839 0.036 0.000 0.000 0.872 0.092
#> GSM494627     4  0.1267      0.834 0.024 0.000 0.004 0.960 0.012
#> GSM494673     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494649     4  0.4445      0.796 0.024 0.000 0.000 0.676 0.300
#> GSM494658     1  0.0807      0.981 0.976 0.012 0.000 0.000 0.012
#> GSM494653     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494643     4  0.4269      0.815 0.036 0.000 0.000 0.732 0.232
#> GSM494672     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494618     4  0.0865      0.834 0.024 0.000 0.004 0.972 0.000
#> GSM494631     3  0.5191      0.610 0.000 0.000 0.660 0.252 0.088
#> GSM494619     4  0.4820      0.780 0.036 0.000 0.000 0.632 0.332
#> GSM494674     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494616     4  0.0865      0.834 0.024 0.000 0.004 0.972 0.000
#> GSM494663     4  0.1211      0.836 0.024 0.000 0.000 0.960 0.016
#> GSM494628     4  0.0865      0.834 0.024 0.000 0.004 0.972 0.000
#> GSM494632     4  0.4223      0.678 0.248 0.000 0.000 0.724 0.028
#> GSM494660     4  0.4445      0.796 0.024 0.000 0.000 0.676 0.300
#> GSM494622     4  0.0865      0.834 0.024 0.000 0.004 0.972 0.000
#> GSM494642     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494647     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494659     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494670     1  0.0807      0.981 0.976 0.012 0.000 0.000 0.012
#> GSM494675     3  0.2674      0.860 0.000 0.000 0.868 0.012 0.120
#> GSM494641     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494636     4  0.2850      0.839 0.036 0.000 0.000 0.872 0.092
#> GSM494640     4  0.2761      0.839 0.024 0.000 0.000 0.872 0.104
#> GSM494623     4  0.4820      0.780 0.036 0.000 0.000 0.632 0.332
#> GSM494644     1  0.0404      0.978 0.988 0.000 0.000 0.000 0.012
#> GSM494646     1  0.1195      0.960 0.960 0.000 0.000 0.012 0.028
#> GSM494665     1  0.0807      0.972 0.976 0.000 0.000 0.012 0.012
#> GSM494638     4  0.2228      0.837 0.040 0.000 0.000 0.912 0.048
#> GSM494645     1  0.0404      0.978 0.988 0.000 0.000 0.000 0.012
#> GSM494671     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.979 1.000 0.000 0.000 0.000 0.000
#> GSM494620     4  0.4820      0.780 0.036 0.000 0.000 0.632 0.332
#> GSM494630     4  0.4820      0.780 0.036 0.000 0.000 0.632 0.332
#> GSM494657     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494621     4  0.4820      0.780 0.036 0.000 0.000 0.632 0.332
#> GSM494629     4  0.1314      0.830 0.016 0.000 0.012 0.960 0.012
#> GSM494637     4  0.2761      0.839 0.024 0.000 0.000 0.872 0.104
#> GSM494652     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494648     4  0.4820      0.780 0.036 0.000 0.000 0.632 0.332
#> GSM494650     4  0.0865      0.834 0.024 0.000 0.004 0.972 0.000
#> GSM494669     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494666     1  0.0807      0.972 0.976 0.000 0.000 0.012 0.012
#> GSM494668     1  0.0807      0.981 0.976 0.012 0.000 0.000 0.012
#> GSM494633     4  0.4820      0.780 0.036 0.000 0.000 0.632 0.332
#> GSM494634     1  0.0404      0.982 0.988 0.012 0.000 0.000 0.000
#> GSM494639     4  0.4976      0.242 0.468 0.000 0.000 0.504 0.028
#> GSM494661     1  0.0404      0.978 0.988 0.000 0.000 0.000 0.012
#> GSM494617     4  0.0865      0.834 0.024 0.000 0.004 0.972 0.000
#> GSM494626     4  0.0865      0.834 0.024 0.000 0.004 0.972 0.000
#> GSM494656     3  0.1270      0.848 0.000 0.000 0.948 0.052 0.000
#> GSM494635     1  0.0404      0.978 0.988 0.000 0.000 0.000 0.012

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM494565     5  0.2362     0.7719 0.000 0.080 0.016 0.012 0.892 0.000
#> GSM494594     3  0.0000     0.8193 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.3128     0.7722 0.812 0.168 0.000 0.012 0.008 0.000
#> GSM494564     5  0.2650     0.7739 0.000 0.004 0.072 0.004 0.880 0.040
#> GSM494591     3  0.0291     0.8204 0.000 0.000 0.992 0.004 0.004 0.000
#> GSM494567     3  0.4701     0.7322 0.000 0.000 0.684 0.168 0.148 0.000
#> GSM494602     2  0.0000     0.8562 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494613     3  0.4734     0.7320 0.000 0.000 0.680 0.168 0.152 0.000
#> GSM494589     5  0.2146     0.7568 0.000 0.000 0.116 0.004 0.880 0.000
#> GSM494598     2  0.2869     0.8277 0.000 0.832 0.000 0.148 0.020 0.000
#> GSM494593     2  0.0260     0.8564 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM494583     5  0.5806    -0.0478 0.000 0.408 0.004 0.156 0.432 0.000
#> GSM494612     2  0.0000     0.8562 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     4  0.4808    -0.3415 0.000 0.000 0.468 0.480 0.052 0.000
#> GSM494556     3  0.4830     0.7202 0.000 0.000 0.668 0.172 0.160 0.000
#> GSM494559     5  0.2699     0.7844 0.000 0.028 0.048 0.000 0.884 0.040
#> GSM494571     3  0.0146     0.8176 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494614     5  0.4565     0.6636 0.000 0.008 0.108 0.168 0.716 0.000
#> GSM494603     4  0.5463    -0.2715 0.000 0.000 0.016 0.464 0.444 0.076
#> GSM494568     4  0.4279     0.4984 0.000 0.000 0.008 0.732 0.068 0.192
#> GSM494572     3  0.0146     0.8202 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494600     5  0.2146     0.7568 0.000 0.000 0.116 0.004 0.880 0.000
#> GSM494562     2  0.2830     0.8288 0.000 0.836 0.000 0.144 0.020 0.000
#> GSM494615     3  0.5556     0.5344 0.000 0.000 0.512 0.336 0.152 0.000
#> GSM494582     2  0.2667     0.8339 0.000 0.852 0.000 0.128 0.020 0.000
#> GSM494599     2  0.0291     0.8547 0.004 0.992 0.000 0.000 0.004 0.000
#> GSM494610     2  0.2869     0.8277 0.000 0.832 0.000 0.148 0.020 0.000
#> GSM494587     2  0.2377     0.8305 0.000 0.868 0.004 0.124 0.004 0.000
#> GSM494581     2  0.2218     0.8221 0.000 0.884 0.000 0.104 0.012 0.000
#> GSM494580     3  0.4734     0.7320 0.000 0.000 0.680 0.168 0.152 0.000
#> GSM494563     5  0.2988     0.7560 0.000 0.080 0.016 0.044 0.860 0.000
#> GSM494576     2  0.5741     0.5137 0.000 0.540 0.004 0.236 0.220 0.000
#> GSM494605     1  0.1908     0.9194 0.916 0.000 0.000 0.028 0.056 0.000
#> GSM494584     5  0.6458     0.5073 0.000 0.236 0.048 0.208 0.508 0.000
#> GSM494586     2  0.2981     0.8280 0.000 0.820 0.000 0.160 0.020 0.000
#> GSM494578     3  0.4765     0.7293 0.000 0.000 0.676 0.172 0.152 0.000
#> GSM494585     2  0.1958     0.8295 0.000 0.896 0.000 0.100 0.004 0.000
#> GSM494611     2  0.1007     0.8557 0.000 0.956 0.000 0.044 0.000 0.000
#> GSM494560     5  0.2384     0.7833 0.000 0.064 0.048 0.000 0.888 0.000
#> GSM494595     2  0.2750     0.8362 0.000 0.844 0.000 0.136 0.020 0.000
#> GSM494570     5  0.2461     0.7696 0.000 0.000 0.044 0.004 0.888 0.064
#> GSM494597     3  0.0291     0.8204 0.000 0.000 0.992 0.004 0.004 0.000
#> GSM494607     2  0.2314     0.8180 0.056 0.900 0.000 0.036 0.008 0.000
#> GSM494561     5  0.4922     0.3896 0.000 0.000 0.020 0.032 0.556 0.392
#> GSM494569     4  0.3819     0.6932 0.000 0.000 0.000 0.624 0.004 0.372
#> GSM494592     2  0.0291     0.8547 0.004 0.992 0.000 0.000 0.004 0.000
#> GSM494577     2  0.6092     0.1277 0.000 0.400 0.004 0.224 0.372 0.000
#> GSM494588     5  0.2450     0.7828 0.000 0.048 0.016 0.000 0.896 0.040
#> GSM494590     3  0.0291     0.8204 0.000 0.000 0.992 0.004 0.004 0.000
#> GSM494609     2  0.2006     0.8273 0.000 0.892 0.000 0.104 0.004 0.000
#> GSM494608     2  0.2006     0.8273 0.000 0.892 0.000 0.104 0.004 0.000
#> GSM494606     2  0.0713     0.8551 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM494574     2  0.2869     0.8277 0.000 0.832 0.000 0.148 0.020 0.000
#> GSM494573     5  0.2100     0.7613 0.000 0.004 0.112 0.000 0.884 0.000
#> GSM494566     5  0.6360     0.4337 0.000 0.208 0.020 0.380 0.392 0.000
#> GSM494601     2  0.0865     0.8541 0.000 0.964 0.000 0.036 0.000 0.000
#> GSM494557     3  0.4734     0.7320 0.000 0.000 0.680 0.168 0.152 0.000
#> GSM494579     2  0.5954     0.1413 0.000 0.408 0.000 0.220 0.372 0.000
#> GSM494596     3  0.0291     0.8204 0.000 0.000 0.992 0.004 0.004 0.000
#> GSM494575     2  0.0000     0.8562 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     6  0.0405     0.7585 0.000 0.000 0.000 0.004 0.008 0.988
#> GSM494654     3  0.1010     0.7949 0.000 0.000 0.960 0.036 0.000 0.004
#> GSM494664     1  0.1908     0.9194 0.916 0.000 0.000 0.028 0.056 0.000
#> GSM494624     6  0.0260     0.7602 0.000 0.000 0.000 0.000 0.008 0.992
#> GSM494651     4  0.3684     0.6969 0.000 0.000 0.000 0.628 0.000 0.372
#> GSM494662     6  0.4798     0.2671 0.000 0.000 0.000 0.312 0.076 0.612
#> GSM494627     4  0.3986     0.6906 0.000 0.000 0.004 0.608 0.004 0.384
#> GSM494673     1  0.0260     0.9468 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494649     6  0.0603     0.7553 0.000 0.000 0.000 0.016 0.004 0.980
#> GSM494658     1  0.0622     0.9434 0.980 0.000 0.000 0.012 0.008 0.000
#> GSM494653     1  0.0260     0.9468 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494643     6  0.1682     0.7232 0.000 0.000 0.000 0.020 0.052 0.928
#> GSM494672     1  0.0260     0.9468 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494618     4  0.3684     0.6969 0.000 0.000 0.000 0.628 0.000 0.372
#> GSM494631     4  0.4776    -0.1007 0.000 0.000 0.340 0.604 0.048 0.008
#> GSM494619     6  0.0260     0.7602 0.000 0.000 0.000 0.000 0.008 0.992
#> GSM494674     1  0.0000     0.9475 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.3684     0.6969 0.000 0.000 0.000 0.628 0.000 0.372
#> GSM494663     4  0.4090     0.6854 0.000 0.000 0.004 0.604 0.008 0.384
#> GSM494628     4  0.3965     0.6969 0.000 0.000 0.004 0.616 0.004 0.376
#> GSM494632     6  0.6957     0.0623 0.340 0.000 0.000 0.192 0.076 0.392
#> GSM494660     6  0.0603     0.7553 0.000 0.000 0.000 0.016 0.004 0.980
#> GSM494622     4  0.3965     0.6969 0.000 0.000 0.004 0.616 0.004 0.376
#> GSM494642     1  0.0000     0.9475 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.9475 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0260     0.9468 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494670     1  0.0520     0.9451 0.984 0.000 0.000 0.008 0.008 0.000
#> GSM494675     3  0.4316     0.7487 0.000 0.000 0.728 0.128 0.144 0.000
#> GSM494641     1  0.0000     0.9475 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     6  0.4798     0.2671 0.000 0.000 0.000 0.312 0.076 0.612
#> GSM494640     6  0.4315     0.2388 0.000 0.000 0.000 0.328 0.036 0.636
#> GSM494623     6  0.0260     0.7602 0.000 0.000 0.000 0.000 0.008 0.992
#> GSM494644     1  0.0622     0.9429 0.980 0.000 0.000 0.008 0.012 0.000
#> GSM494646     1  0.3490     0.8439 0.832 0.000 0.000 0.028 0.072 0.068
#> GSM494665     1  0.1908     0.9194 0.916 0.000 0.000 0.028 0.056 0.000
#> GSM494638     6  0.5064    -0.2320 0.000 0.000 0.000 0.432 0.076 0.492
#> GSM494645     1  0.1398     0.9288 0.940 0.000 0.000 0.008 0.052 0.000
#> GSM494671     1  0.0260     0.9468 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494655     1  0.0000     0.9475 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.0260     0.7602 0.000 0.000 0.000 0.000 0.008 0.992
#> GSM494630     6  0.0520     0.7581 0.000 0.000 0.000 0.008 0.008 0.984
#> GSM494657     3  0.0146     0.8202 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494667     1  0.0000     0.9475 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0260     0.7602 0.000 0.000 0.000 0.000 0.008 0.992
#> GSM494629     4  0.4079     0.6892 0.000 0.000 0.004 0.608 0.008 0.380
#> GSM494637     6  0.4408     0.2527 0.000 0.000 0.000 0.320 0.044 0.636
#> GSM494652     1  0.0260     0.9468 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494648     6  0.0260     0.7602 0.000 0.000 0.000 0.000 0.008 0.992
#> GSM494650     4  0.3954     0.6977 0.000 0.000 0.004 0.620 0.004 0.372
#> GSM494669     1  0.0000     0.9475 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.1908     0.9194 0.916 0.000 0.000 0.028 0.056 0.000
#> GSM494668     1  0.0146     0.9472 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494633     6  0.0405     0.7594 0.000 0.000 0.000 0.004 0.008 0.988
#> GSM494634     1  0.0260     0.9468 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494639     1  0.5572     0.2052 0.544 0.000 0.000 0.032 0.072 0.352
#> GSM494661     1  0.1398     0.9288 0.940 0.000 0.000 0.008 0.052 0.000
#> GSM494617     4  0.4088     0.6708 0.000 0.000 0.000 0.616 0.016 0.368
#> GSM494626     4  0.3684     0.6969 0.000 0.000 0.000 0.628 0.000 0.372
#> GSM494656     3  0.0865     0.7974 0.000 0.000 0.964 0.036 0.000 0.000
#> GSM494635     1  0.1895     0.9155 0.912 0.000 0.000 0.016 0.072 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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-kmeans-collect-classes

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

test_to_known_factors(res)
#>             n disease.state(p) age(p) other(p) individual(p) k
#> CV:kmeans 119         1.96e-20  1.000 1.17e-15         1.000 2
#> CV:kmeans 113         4.86e-20  0.926 1.13e-17         0.987 3
#> CV:kmeans 112         3.02e-18  0.299 1.82e-12         0.781 4
#> CV:kmeans 113         3.93e-17  0.359 1.21e-12         0.656 5
#> CV:kmeans 104         6.65e-16  0.391 2.38e-09         0.414 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 51941 rows and 120 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 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-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.980       0.986         0.5042 0.496   0.496
#> 3 3 0.731           0.830       0.897         0.3262 0.720   0.494
#> 4 4 1.000           0.994       0.997         0.1308 0.815   0.512
#> 5 5 0.989           0.961       0.976         0.0509 0.955   0.817
#> 6 6 0.954           0.887       0.944         0.0394 0.967   0.842

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 5

There is also optional best \(k\) = 2 4 5 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
#> GSM494565     2   0.000      0.984 0.000 1.000
#> GSM494594     2   0.000      0.984 0.000 1.000
#> GSM494604     1   0.000      0.987 1.000 0.000
#> GSM494564     2   0.000      0.984 0.000 1.000
#> GSM494591     2   0.000      0.984 0.000 1.000
#> GSM494567     2   0.000      0.984 0.000 1.000
#> GSM494602     2   0.163      0.980 0.024 0.976
#> GSM494613     2   0.000      0.984 0.000 1.000
#> GSM494589     2   0.000      0.984 0.000 1.000
#> GSM494598     2   0.163      0.980 0.024 0.976
#> GSM494593     2   0.163      0.980 0.024 0.976
#> GSM494583     2   0.163      0.980 0.024 0.976
#> GSM494612     2   0.163      0.980 0.024 0.976
#> GSM494558     2   0.000      0.984 0.000 1.000
#> GSM494556     2   0.000      0.984 0.000 1.000
#> GSM494559     2   0.000      0.984 0.000 1.000
#> GSM494571     2   0.000      0.984 0.000 1.000
#> GSM494614     2   0.000      0.984 0.000 1.000
#> GSM494603     2   0.000      0.984 0.000 1.000
#> GSM494568     2   0.000      0.984 0.000 1.000
#> GSM494572     2   0.000      0.984 0.000 1.000
#> GSM494600     2   0.000      0.984 0.000 1.000
#> GSM494562     2   0.163      0.980 0.024 0.976
#> GSM494615     2   0.000      0.984 0.000 1.000
#> GSM494582     2   0.163      0.980 0.024 0.976
#> GSM494599     2   0.163      0.980 0.024 0.976
#> GSM494610     2   0.163      0.980 0.024 0.976
#> GSM494587     2   0.163      0.980 0.024 0.976
#> GSM494581     2   0.163      0.980 0.024 0.976
#> GSM494580     2   0.000      0.984 0.000 1.000
#> GSM494563     2   0.000      0.984 0.000 1.000
#> GSM494576     2   0.163      0.980 0.024 0.976
#> GSM494605     1   0.000      0.987 1.000 0.000
#> GSM494584     2   0.000      0.984 0.000 1.000
#> GSM494586     2   0.163      0.980 0.024 0.976
#> GSM494578     2   0.000      0.984 0.000 1.000
#> GSM494585     2   0.163      0.980 0.024 0.976
#> GSM494611     2   0.163      0.980 0.024 0.976
#> GSM494560     2   0.000      0.984 0.000 1.000
#> GSM494595     2   0.163      0.980 0.024 0.976
#> GSM494570     2   0.000      0.984 0.000 1.000
#> GSM494597     2   0.000      0.984 0.000 1.000
#> GSM494607     2   0.955      0.433 0.376 0.624
#> GSM494561     2   0.000      0.984 0.000 1.000
#> GSM494569     1   0.163      0.987 0.976 0.024
#> GSM494592     2   0.163      0.980 0.024 0.976
#> GSM494577     2   0.163      0.980 0.024 0.976
#> GSM494588     2   0.000      0.984 0.000 1.000
#> GSM494590     2   0.000      0.984 0.000 1.000
#> GSM494609     2   0.163      0.980 0.024 0.976
#> GSM494608     2   0.163      0.980 0.024 0.976
#> GSM494606     2   0.163      0.980 0.024 0.976
#> GSM494574     2   0.163      0.980 0.024 0.976
#> GSM494573     2   0.000      0.984 0.000 1.000
#> GSM494566     2   0.141      0.981 0.020 0.980
#> GSM494601     2   0.163      0.980 0.024 0.976
#> GSM494557     2   0.000      0.984 0.000 1.000
#> GSM494579     2   0.163      0.980 0.024 0.976
#> GSM494596     2   0.000      0.984 0.000 1.000
#> GSM494575     2   0.163      0.980 0.024 0.976
#> GSM494625     1   0.163      0.987 0.976 0.024
#> GSM494654     2   0.000      0.984 0.000 1.000
#> GSM494664     1   0.000      0.987 1.000 0.000
#> GSM494624     1   0.163      0.987 0.976 0.024
#> GSM494651     1   0.163      0.987 0.976 0.024
#> GSM494662     1   0.163      0.987 0.976 0.024
#> GSM494627     1   0.163      0.987 0.976 0.024
#> GSM494673     1   0.000      0.987 1.000 0.000
#> GSM494649     1   0.163      0.987 0.976 0.024
#> GSM494658     1   0.000      0.987 1.000 0.000
#> GSM494653     1   0.000      0.987 1.000 0.000
#> GSM494643     1   0.163      0.987 0.976 0.024
#> GSM494672     1   0.000      0.987 1.000 0.000
#> GSM494618     1   0.163      0.987 0.976 0.024
#> GSM494631     2   0.000      0.984 0.000 1.000
#> GSM494619     1   0.163      0.987 0.976 0.024
#> GSM494674     1   0.000      0.987 1.000 0.000
#> GSM494616     1   0.163      0.987 0.976 0.024
#> GSM494663     1   0.163      0.987 0.976 0.024
#> GSM494628     1   0.163      0.987 0.976 0.024
#> GSM494632     1   0.000      0.987 1.000 0.000
#> GSM494660     1   0.163      0.987 0.976 0.024
#> GSM494622     1   0.163      0.987 0.976 0.024
#> GSM494642     1   0.000      0.987 1.000 0.000
#> GSM494647     1   0.000      0.987 1.000 0.000
#> GSM494659     1   0.000      0.987 1.000 0.000
#> GSM494670     1   0.000      0.987 1.000 0.000
#> GSM494675     2   0.000      0.984 0.000 1.000
#> GSM494641     1   0.000      0.987 1.000 0.000
#> GSM494636     1   0.163      0.987 0.976 0.024
#> GSM494640     1   0.163      0.987 0.976 0.024
#> GSM494623     1   0.163      0.987 0.976 0.024
#> GSM494644     1   0.000      0.987 1.000 0.000
#> GSM494646     1   0.000      0.987 1.000 0.000
#> GSM494665     1   0.000      0.987 1.000 0.000
#> GSM494638     1   0.163      0.987 0.976 0.024
#> GSM494645     1   0.000      0.987 1.000 0.000
#> GSM494671     1   0.000      0.987 1.000 0.000
#> GSM494655     1   0.000      0.987 1.000 0.000
#> GSM494620     1   0.163      0.987 0.976 0.024
#> GSM494630     1   0.163      0.987 0.976 0.024
#> GSM494657     2   0.000      0.984 0.000 1.000
#> GSM494667     1   0.000      0.987 1.000 0.000
#> GSM494621     1   0.163      0.987 0.976 0.024
#> GSM494629     1   0.163      0.987 0.976 0.024
#> GSM494637     1   0.163      0.987 0.976 0.024
#> GSM494652     1   0.000      0.987 1.000 0.000
#> GSM494648     1   0.163      0.987 0.976 0.024
#> GSM494650     1   0.163      0.987 0.976 0.024
#> GSM494669     1   0.000      0.987 1.000 0.000
#> GSM494666     1   0.000      0.987 1.000 0.000
#> GSM494668     1   0.000      0.987 1.000 0.000
#> GSM494633     1   0.163      0.987 0.976 0.024
#> GSM494634     1   0.000      0.987 1.000 0.000
#> GSM494639     1   0.000      0.987 1.000 0.000
#> GSM494661     1   0.000      0.987 1.000 0.000
#> GSM494617     1   0.163      0.987 0.976 0.024
#> GSM494626     1   0.163      0.987 0.976 0.024
#> GSM494656     2   0.000      0.984 0.000 1.000
#> GSM494635     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
#> GSM494565     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494594     3  0.5058      0.779 0.000 0.244 0.756
#> GSM494604     1  0.6095      0.189 0.608 0.392 0.000
#> GSM494564     2  0.1411      0.894 0.000 0.964 0.036
#> GSM494591     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494567     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494602     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494613     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494589     3  0.5621      0.727 0.000 0.308 0.692
#> GSM494598     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494593     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494583     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494612     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494558     3  0.1860      0.843 0.000 0.052 0.948
#> GSM494556     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494559     2  0.1031      0.905 0.000 0.976 0.024
#> GSM494571     3  0.1964      0.843 0.000 0.056 0.944
#> GSM494614     2  0.1031      0.905 0.000 0.976 0.024
#> GSM494603     3  0.3879      0.820 0.000 0.152 0.848
#> GSM494568     3  0.1753      0.843 0.000 0.048 0.952
#> GSM494572     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494600     2  0.5968      0.196 0.000 0.636 0.364
#> GSM494562     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494615     3  0.3816      0.821 0.000 0.148 0.852
#> GSM494582     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494599     2  0.5465      0.655 0.288 0.712 0.000
#> GSM494610     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494587     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494581     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494580     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494563     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494576     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494605     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494584     2  0.0892      0.907 0.000 0.980 0.020
#> GSM494586     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494578     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494585     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494611     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494560     2  0.1031      0.905 0.000 0.976 0.024
#> GSM494595     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494570     3  0.5254      0.769 0.000 0.264 0.736
#> GSM494597     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494607     2  0.5465      0.655 0.288 0.712 0.000
#> GSM494561     3  0.1860      0.843 0.000 0.052 0.948
#> GSM494569     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494592     2  0.5465      0.655 0.288 0.712 0.000
#> GSM494577     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494588     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494590     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494609     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494608     2  0.3267      0.862 0.116 0.884 0.000
#> GSM494606     2  0.5465      0.655 0.288 0.712 0.000
#> GSM494574     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494573     2  0.1031      0.905 0.000 0.976 0.024
#> GSM494566     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494601     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494557     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494579     2  0.0000      0.918 0.000 1.000 0.000
#> GSM494596     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494575     2  0.1860      0.914 0.052 0.948 0.000
#> GSM494625     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494654     3  0.1860      0.843 0.000 0.052 0.948
#> GSM494664     1  0.1860      0.877 0.948 0.000 0.052
#> GSM494624     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494651     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494662     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494627     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494673     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494649     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494658     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494653     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494643     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494672     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494618     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494631     3  0.1860      0.843 0.000 0.052 0.948
#> GSM494619     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494674     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494616     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494663     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494628     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494632     1  0.1860      0.877 0.948 0.000 0.052
#> GSM494660     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494622     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494642     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494647     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494659     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494670     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494675     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494641     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494636     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494640     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494623     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494644     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494646     1  0.1860      0.877 0.948 0.000 0.052
#> GSM494665     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494638     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494645     1  0.1529      0.880 0.960 0.000 0.040
#> GSM494671     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494655     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494620     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494630     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494657     3  0.5465      0.754 0.000 0.288 0.712
#> GSM494667     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494621     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494629     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494637     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494652     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494648     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494650     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494669     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494666     1  0.1860      0.877 0.948 0.000 0.052
#> GSM494668     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494633     1  0.5706      0.716 0.680 0.000 0.320
#> GSM494634     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494639     1  0.1860      0.877 0.948 0.000 0.052
#> GSM494661     1  0.0000      0.886 1.000 0.000 0.000
#> GSM494617     1  0.5465      0.757 0.712 0.000 0.288
#> GSM494626     3  0.1031      0.828 0.024 0.000 0.976
#> GSM494656     3  0.1860      0.843 0.000 0.052 0.948
#> GSM494635     1  0.1643      0.879 0.956 0.000 0.044

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3 p4
#> GSM494565     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494594     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494604     1  0.1474      0.945 0.948 0.052 0.000  0
#> GSM494564     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494591     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494567     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494602     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494613     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494589     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494598     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494593     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494583     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494612     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494558     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494556     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494559     3  0.0592      0.984 0.000 0.016 0.984  0
#> GSM494571     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494614     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494603     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494568     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494572     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494600     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494562     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494615     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494582     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494599     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494610     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494587     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494581     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494580     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494563     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494576     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494605     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494584     2  0.3074      0.823 0.000 0.848 0.152  0
#> GSM494586     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494578     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494585     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494611     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494560     3  0.0592      0.984 0.000 0.016 0.984  0
#> GSM494595     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494570     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494597     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494607     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494561     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494569     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494592     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494577     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494588     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494590     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494609     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494608     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494606     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494574     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494573     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494566     2  0.2345      0.890 0.000 0.900 0.100  0
#> GSM494601     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494557     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494579     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494596     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494575     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM494625     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494654     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494664     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494624     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494651     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494662     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494627     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494673     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494649     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494658     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494653     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494643     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494672     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494618     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494631     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494619     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494674     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494616     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494663     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494628     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494632     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494660     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494622     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494642     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494647     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494659     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494670     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494675     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494641     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494636     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494640     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494623     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494644     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494646     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494665     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494638     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494645     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494671     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494655     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494620     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494630     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494657     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494667     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494621     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494629     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494637     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494652     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494648     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494650     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494669     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494666     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494668     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494633     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494634     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494639     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494661     1  0.0000      0.998 1.000 0.000 0.000  0
#> GSM494617     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494626     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM494656     3  0.0000      0.999 0.000 0.000 1.000  0
#> GSM494635     1  0.0000      0.998 1.000 0.000 0.000  0

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     5  0.1168      0.954 0.000 0.032 0.008 0.000 0.960
#> GSM494594     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494604     1  0.3730      0.605 0.712 0.288 0.000 0.000 0.000
#> GSM494564     5  0.0880      0.963 0.000 0.000 0.032 0.000 0.968
#> GSM494591     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494567     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494602     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494613     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494589     5  0.1043      0.962 0.000 0.000 0.040 0.000 0.960
#> GSM494598     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494593     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494583     2  0.3177      0.768 0.000 0.792 0.000 0.000 0.208
#> GSM494612     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494558     3  0.0566      0.976 0.000 0.000 0.984 0.004 0.012
#> GSM494556     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494559     5  0.0912      0.963 0.000 0.012 0.016 0.000 0.972
#> GSM494571     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494614     5  0.1732      0.933 0.000 0.000 0.080 0.000 0.920
#> GSM494603     5  0.2929      0.804 0.000 0.000 0.180 0.000 0.820
#> GSM494568     3  0.0912      0.964 0.000 0.000 0.972 0.016 0.012
#> GSM494572     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494600     5  0.1043      0.962 0.000 0.000 0.040 0.000 0.960
#> GSM494562     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494615     3  0.0000      0.989 0.000 0.000 1.000 0.000 0.000
#> GSM494582     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494599     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494610     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494587     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494581     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494580     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494563     5  0.1168      0.954 0.000 0.032 0.008 0.000 0.960
#> GSM494576     2  0.2230      0.862 0.000 0.884 0.000 0.000 0.116
#> GSM494605     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494584     2  0.3690      0.732 0.000 0.764 0.012 0.000 0.224
#> GSM494586     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494578     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494585     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494611     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494560     5  0.1216      0.962 0.000 0.020 0.020 0.000 0.960
#> GSM494595     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494570     5  0.0451      0.956 0.000 0.000 0.008 0.004 0.988
#> GSM494597     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494607     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494561     5  0.0566      0.956 0.000 0.000 0.012 0.004 0.984
#> GSM494569     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494592     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494577     2  0.3210      0.763 0.000 0.788 0.000 0.000 0.212
#> GSM494588     5  0.0771      0.958 0.000 0.020 0.004 0.000 0.976
#> GSM494590     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494609     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494608     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494606     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494574     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494573     5  0.1043      0.962 0.000 0.000 0.040 0.000 0.960
#> GSM494566     2  0.4891      0.670 0.000 0.716 0.172 0.000 0.112
#> GSM494601     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494557     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494579     2  0.3003      0.792 0.000 0.812 0.000 0.000 0.188
#> GSM494596     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494575     2  0.0000      0.952 0.000 1.000 0.000 0.000 0.000
#> GSM494625     4  0.0794      0.979 0.000 0.000 0.000 0.972 0.028
#> GSM494654     3  0.0324      0.983 0.000 0.000 0.992 0.004 0.004
#> GSM494664     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494624     4  0.0794      0.979 0.000 0.000 0.000 0.972 0.028
#> GSM494651     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494662     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000
#> GSM494627     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494673     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.0794      0.979 0.000 0.000 0.000 0.972 0.028
#> GSM494658     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.0703      0.979 0.000 0.000 0.000 0.976 0.024
#> GSM494672     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494631     3  0.0162      0.986 0.000 0.000 0.996 0.000 0.004
#> GSM494619     4  0.0794      0.979 0.000 0.000 0.000 0.972 0.028
#> GSM494674     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494663     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494628     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494632     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494660     4  0.0794      0.979 0.000 0.000 0.000 0.972 0.028
#> GSM494622     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494642     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494675     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494641     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000
#> GSM494640     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000
#> GSM494623     4  0.0794      0.979 0.000 0.000 0.000 0.972 0.028
#> GSM494644     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494665     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494638     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000
#> GSM494645     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494620     4  0.0794      0.979 0.000 0.000 0.000 0.972 0.028
#> GSM494630     4  0.0794      0.979 0.000 0.000 0.000 0.972 0.028
#> GSM494657     3  0.0290      0.993 0.000 0.000 0.992 0.000 0.008
#> GSM494667     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494621     4  0.0794      0.979 0.000 0.000 0.000 0.972 0.028
#> GSM494629     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494637     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000
#> GSM494652     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494648     4  0.0794      0.979 0.000 0.000 0.000 0.972 0.028
#> GSM494650     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494669     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494633     4  0.0794      0.979 0.000 0.000 0.000 0.972 0.028
#> GSM494634     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494661     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494626     4  0.0693      0.980 0.000 0.000 0.008 0.980 0.012
#> GSM494656     3  0.0324      0.983 0.000 0.000 0.992 0.004 0.004
#> GSM494635     1  0.0000      0.988 1.000 0.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM494565     5  0.0260      0.924 0.000 0.008 0.000 0.000 0.992 0.000
#> GSM494594     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.3714      0.492 0.656 0.340 0.000 0.004 0.000 0.000
#> GSM494564     5  0.0291      0.925 0.000 0.000 0.004 0.000 0.992 0.004
#> GSM494591     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494602     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494613     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494589     5  0.0260      0.925 0.000 0.000 0.008 0.000 0.992 0.000
#> GSM494598     2  0.0713      0.902 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM494593     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494583     2  0.4461      0.405 0.000 0.564 0.000 0.032 0.404 0.000
#> GSM494612     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     3  0.3789      0.276 0.000 0.000 0.584 0.416 0.000 0.000
#> GSM494556     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494559     5  0.0291      0.925 0.000 0.004 0.000 0.000 0.992 0.004
#> GSM494571     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494614     5  0.1480      0.891 0.000 0.000 0.040 0.020 0.940 0.000
#> GSM494603     5  0.4872      0.115 0.000 0.000 0.040 0.452 0.500 0.008
#> GSM494568     4  0.2431      0.813 0.000 0.000 0.132 0.860 0.000 0.008
#> GSM494572     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494600     5  0.0260      0.925 0.000 0.000 0.008 0.000 0.992 0.000
#> GSM494562     2  0.0713      0.902 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM494615     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494582     2  0.0632      0.902 0.000 0.976 0.000 0.024 0.000 0.000
#> GSM494599     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494610     2  0.0713      0.902 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM494587     2  0.0858      0.901 0.000 0.968 0.000 0.028 0.004 0.000
#> GSM494581     2  0.0146      0.904 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM494580     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494563     5  0.0260      0.924 0.000 0.008 0.000 0.000 0.992 0.000
#> GSM494576     2  0.3101      0.780 0.000 0.820 0.000 0.032 0.148 0.000
#> GSM494605     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494584     2  0.4620      0.361 0.000 0.544 0.004 0.032 0.420 0.000
#> GSM494586     2  0.0790      0.901 0.000 0.968 0.000 0.032 0.000 0.000
#> GSM494578     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494585     2  0.0713      0.902 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM494611     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494560     5  0.0260      0.924 0.000 0.008 0.000 0.000 0.992 0.000
#> GSM494595     2  0.0713      0.902 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM494570     5  0.0260      0.924 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM494597     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494607     2  0.0146      0.904 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM494561     5  0.3309      0.595 0.000 0.000 0.000 0.000 0.720 0.280
#> GSM494569     4  0.0790      0.977 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM494592     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494577     2  0.4475      0.387 0.000 0.556 0.000 0.032 0.412 0.000
#> GSM494588     5  0.0291      0.925 0.000 0.004 0.000 0.000 0.992 0.004
#> GSM494590     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     2  0.0146      0.904 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM494608     2  0.0146      0.904 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM494606     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494574     2  0.0713      0.902 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM494573     5  0.0260      0.925 0.000 0.000 0.008 0.000 0.992 0.000
#> GSM494566     2  0.6572      0.376 0.000 0.512 0.108 0.108 0.272 0.000
#> GSM494601     2  0.0146      0.904 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM494557     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494579     2  0.4319      0.513 0.000 0.620 0.000 0.032 0.348 0.000
#> GSM494596     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0000      0.904 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     6  0.0000      0.876 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494664     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494624     6  0.0000      0.876 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494651     4  0.0790      0.977 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM494662     6  0.3804      0.617 0.000 0.000 0.000 0.336 0.008 0.656
#> GSM494627     4  0.0937      0.975 0.000 0.000 0.000 0.960 0.000 0.040
#> GSM494673     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     6  0.0790      0.869 0.000 0.000 0.000 0.032 0.000 0.968
#> GSM494658     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     6  0.0520      0.874 0.000 0.000 0.000 0.008 0.008 0.984
#> GSM494672     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0790      0.977 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM494631     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494619     6  0.0000      0.876 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0790      0.977 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM494663     4  0.1501      0.942 0.000 0.000 0.000 0.924 0.000 0.076
#> GSM494628     4  0.0937      0.975 0.000 0.000 0.000 0.960 0.000 0.040
#> GSM494632     1  0.0520      0.972 0.984 0.000 0.000 0.008 0.008 0.000
#> GSM494660     6  0.0790      0.869 0.000 0.000 0.000 0.032 0.000 0.968
#> GSM494622     4  0.0937      0.975 0.000 0.000 0.000 0.960 0.000 0.040
#> GSM494642     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494675     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494641     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     6  0.3804      0.617 0.000 0.000 0.000 0.336 0.008 0.656
#> GSM494640     6  0.3804      0.617 0.000 0.000 0.000 0.336 0.008 0.656
#> GSM494623     6  0.0000      0.876 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494644     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.0260      0.979 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494665     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494638     6  0.4088      0.588 0.008 0.000 0.000 0.348 0.008 0.636
#> GSM494645     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.0000      0.876 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494630     6  0.0260      0.875 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM494657     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0000      0.876 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494629     4  0.0790      0.977 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM494637     6  0.3804      0.617 0.000 0.000 0.000 0.336 0.008 0.656
#> GSM494652     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.0000      0.876 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494650     4  0.0937      0.975 0.000 0.000 0.000 0.960 0.000 0.040
#> GSM494669     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     6  0.0260      0.875 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM494634     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.0260      0.979 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494661     1  0.0000      0.985 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.0790      0.977 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM494626     4  0.0790      0.977 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM494656     3  0.0000      0.977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494635     1  0.0000      0.985 1.000 0.000 0.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-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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 3)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-skmeans-collect-classes

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

test_to_known_factors(res)
#>              n disease.state(p) age(p) other(p) individual(p) k
#> CV:skmeans 119         1.96e-20  1.000 1.17e-15         1.000 2
#> CV:skmeans 118         1.33e-16  0.643 1.23e-14         0.736 3
#> CV:skmeans 120         8.49e-20  0.517 9.69e-14         0.915 4
#> CV:skmeans 120         2.43e-19  0.471 2.03e-14         0.750 5
#> CV:skmeans 113         2.21e-17  0.260 8.09e-11         0.394 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 51941 rows and 120 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 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.686           0.840       0.930         0.5025 0.496   0.496
#> 3 3 0.758           0.718       0.874         0.3207 0.824   0.656
#> 4 4 0.736           0.825       0.855         0.1087 0.857   0.617
#> 5 5 0.760           0.784       0.852         0.0648 0.881   0.591
#> 6 6 0.834           0.825       0.907         0.0478 0.936   0.719

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
#> GSM494565     2  0.0000      0.896 0.000 1.000
#> GSM494594     2  0.0000      0.896 0.000 1.000
#> GSM494604     1  0.0000      0.939 1.000 0.000
#> GSM494564     2  0.0000      0.896 0.000 1.000
#> GSM494591     2  0.0000      0.896 0.000 1.000
#> GSM494567     2  0.0000      0.896 0.000 1.000
#> GSM494602     2  0.8909      0.623 0.308 0.692
#> GSM494613     2  0.0000      0.896 0.000 1.000
#> GSM494589     2  0.0000      0.896 0.000 1.000
#> GSM494598     2  0.8909      0.623 0.308 0.692
#> GSM494593     2  0.8909      0.623 0.308 0.692
#> GSM494583     2  0.0000      0.896 0.000 1.000
#> GSM494612     2  0.8909      0.623 0.308 0.692
#> GSM494558     2  0.0000      0.896 0.000 1.000
#> GSM494556     2  0.0000      0.896 0.000 1.000
#> GSM494559     2  0.0000      0.896 0.000 1.000
#> GSM494571     2  0.0000      0.896 0.000 1.000
#> GSM494614     2  0.0000      0.896 0.000 1.000
#> GSM494603     2  0.0000      0.896 0.000 1.000
#> GSM494568     2  0.9833      0.187 0.424 0.576
#> GSM494572     2  0.0000      0.896 0.000 1.000
#> GSM494600     2  0.0000      0.896 0.000 1.000
#> GSM494562     2  0.0000      0.896 0.000 1.000
#> GSM494615     2  0.0000      0.896 0.000 1.000
#> GSM494582     2  0.8909      0.623 0.308 0.692
#> GSM494599     1  0.8955      0.447 0.688 0.312
#> GSM494610     2  0.8909      0.623 0.308 0.692
#> GSM494587     2  0.0000      0.896 0.000 1.000
#> GSM494581     2  0.0000      0.896 0.000 1.000
#> GSM494580     2  0.0000      0.896 0.000 1.000
#> GSM494563     2  0.0000      0.896 0.000 1.000
#> GSM494576     2  0.0000      0.896 0.000 1.000
#> GSM494605     1  0.0000      0.939 1.000 0.000
#> GSM494584     2  0.0000      0.896 0.000 1.000
#> GSM494586     2  0.0000      0.896 0.000 1.000
#> GSM494578     2  0.0000      0.896 0.000 1.000
#> GSM494585     2  0.0000      0.896 0.000 1.000
#> GSM494611     2  0.8909      0.623 0.308 0.692
#> GSM494560     2  0.0000      0.896 0.000 1.000
#> GSM494595     2  0.4815      0.826 0.104 0.896
#> GSM494570     2  0.0000      0.896 0.000 1.000
#> GSM494597     2  0.0000      0.896 0.000 1.000
#> GSM494607     2  0.9775      0.427 0.412 0.588
#> GSM494561     2  0.7528      0.671 0.216 0.784
#> GSM494569     1  0.0000      0.939 1.000 0.000
#> GSM494592     2  0.9833      0.398 0.424 0.576
#> GSM494577     2  0.0000      0.896 0.000 1.000
#> GSM494588     2  0.0000      0.896 0.000 1.000
#> GSM494590     2  0.0000      0.896 0.000 1.000
#> GSM494609     2  0.8909      0.623 0.308 0.692
#> GSM494608     1  0.5178      0.813 0.884 0.116
#> GSM494606     2  0.9732      0.444 0.404 0.596
#> GSM494574     2  0.8909      0.623 0.308 0.692
#> GSM494573     2  0.0000      0.896 0.000 1.000
#> GSM494566     2  0.0000      0.896 0.000 1.000
#> GSM494601     2  0.2423      0.872 0.040 0.960
#> GSM494557     2  0.0000      0.896 0.000 1.000
#> GSM494579     2  0.0000      0.896 0.000 1.000
#> GSM494596     2  0.0000      0.896 0.000 1.000
#> GSM494575     2  0.8909      0.623 0.308 0.692
#> GSM494625     1  0.0000      0.939 1.000 0.000
#> GSM494654     1  0.9896      0.267 0.560 0.440
#> GSM494664     1  0.0000      0.939 1.000 0.000
#> GSM494624     1  0.0000      0.939 1.000 0.000
#> GSM494651     1  0.2778      0.897 0.952 0.048
#> GSM494662     1  0.0000      0.939 1.000 0.000
#> GSM494627     1  0.8909      0.567 0.692 0.308
#> GSM494673     1  0.0000      0.939 1.000 0.000
#> GSM494649     1  0.0000      0.939 1.000 0.000
#> GSM494658     1  0.0000      0.939 1.000 0.000
#> GSM494653     1  0.0000      0.939 1.000 0.000
#> GSM494643     1  0.0000      0.939 1.000 0.000
#> GSM494672     1  0.0000      0.939 1.000 0.000
#> GSM494618     1  0.0000      0.939 1.000 0.000
#> GSM494631     2  0.7139      0.701 0.196 0.804
#> GSM494619     1  0.0000      0.939 1.000 0.000
#> GSM494674     1  0.0000      0.939 1.000 0.000
#> GSM494616     1  0.0672      0.933 0.992 0.008
#> GSM494663     1  0.0000      0.939 1.000 0.000
#> GSM494628     1  0.8909      0.567 0.692 0.308
#> GSM494632     1  0.0000      0.939 1.000 0.000
#> GSM494660     1  0.0000      0.939 1.000 0.000
#> GSM494622     1  0.8909      0.567 0.692 0.308
#> GSM494642     1  0.0000      0.939 1.000 0.000
#> GSM494647     1  0.0000      0.939 1.000 0.000
#> GSM494659     1  0.0000      0.939 1.000 0.000
#> GSM494670     1  0.0000      0.939 1.000 0.000
#> GSM494675     2  0.0000      0.896 0.000 1.000
#> GSM494641     1  0.0000      0.939 1.000 0.000
#> GSM494636     1  0.0000      0.939 1.000 0.000
#> GSM494640     1  0.8909      0.567 0.692 0.308
#> GSM494623     1  0.0000      0.939 1.000 0.000
#> GSM494644     1  0.0000      0.939 1.000 0.000
#> GSM494646     1  0.0000      0.939 1.000 0.000
#> GSM494665     1  0.0000      0.939 1.000 0.000
#> GSM494638     1  0.0000      0.939 1.000 0.000
#> GSM494645     1  0.0000      0.939 1.000 0.000
#> GSM494671     1  0.0000      0.939 1.000 0.000
#> GSM494655     1  0.0000      0.939 1.000 0.000
#> GSM494620     1  0.0000      0.939 1.000 0.000
#> GSM494630     1  0.0000      0.939 1.000 0.000
#> GSM494657     2  0.0000      0.896 0.000 1.000
#> GSM494667     1  0.0000      0.939 1.000 0.000
#> GSM494621     1  0.0000      0.939 1.000 0.000
#> GSM494629     1  0.8909      0.567 0.692 0.308
#> GSM494637     1  0.8909      0.567 0.692 0.308
#> GSM494652     1  0.0000      0.939 1.000 0.000
#> GSM494648     1  0.0000      0.939 1.000 0.000
#> GSM494650     1  0.8909      0.567 0.692 0.308
#> GSM494669     1  0.0000      0.939 1.000 0.000
#> GSM494666     1  0.0000      0.939 1.000 0.000
#> GSM494668     1  0.0000      0.939 1.000 0.000
#> GSM494633     1  0.0000      0.939 1.000 0.000
#> GSM494634     1  0.0000      0.939 1.000 0.000
#> GSM494639     1  0.0000      0.939 1.000 0.000
#> GSM494661     1  0.0000      0.939 1.000 0.000
#> GSM494617     1  0.0000      0.939 1.000 0.000
#> GSM494626     1  0.0000      0.939 1.000 0.000
#> GSM494656     2  0.0000      0.896 0.000 1.000
#> GSM494635     1  0.0000      0.939 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
#> GSM494565     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494594     2  0.3551      0.724 0.000 0.868 0.132
#> GSM494604     1  0.0892      0.980 0.980 0.000 0.020
#> GSM494564     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494591     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494567     2  0.0892      0.814 0.000 0.980 0.020
#> GSM494602     2  0.6308      0.202 0.492 0.508 0.000
#> GSM494613     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494589     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494598     2  0.6154      0.394 0.408 0.592 0.000
#> GSM494593     2  0.6008      0.459 0.372 0.628 0.000
#> GSM494583     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494612     2  0.6308      0.202 0.492 0.508 0.000
#> GSM494558     2  0.6309      0.119 0.000 0.504 0.496
#> GSM494556     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494559     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494571     2  0.6280      0.216 0.000 0.540 0.460
#> GSM494614     2  0.0424      0.821 0.008 0.992 0.000
#> GSM494603     2  0.6280      0.216 0.000 0.540 0.460
#> GSM494568     2  0.6307      0.142 0.000 0.512 0.488
#> GSM494572     2  0.0892      0.814 0.000 0.980 0.020
#> GSM494600     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494562     2  0.1031      0.817 0.024 0.976 0.000
#> GSM494615     2  0.6244      0.255 0.000 0.560 0.440
#> GSM494582     2  0.6308      0.202 0.492 0.508 0.000
#> GSM494599     1  0.0892      0.946 0.980 0.020 0.000
#> GSM494610     2  0.5733      0.535 0.324 0.676 0.000
#> GSM494587     2  0.1031      0.817 0.024 0.976 0.000
#> GSM494581     2  0.1031      0.817 0.024 0.976 0.000
#> GSM494580     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494563     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494576     2  0.1031      0.817 0.024 0.976 0.000
#> GSM494605     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494584     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494586     2  0.1031      0.817 0.024 0.976 0.000
#> GSM494578     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494585     2  0.1031      0.817 0.024 0.976 0.000
#> GSM494611     2  0.6308      0.202 0.492 0.508 0.000
#> GSM494560     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494595     2  0.1031      0.817 0.024 0.976 0.000
#> GSM494570     2  0.2165      0.784 0.000 0.936 0.064
#> GSM494597     2  0.0892      0.814 0.000 0.980 0.020
#> GSM494607     1  0.0000      0.962 1.000 0.000 0.000
#> GSM494561     2  0.6309      0.119 0.000 0.504 0.496
#> GSM494569     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494592     1  0.0892      0.946 0.980 0.020 0.000
#> GSM494577     2  0.1031      0.817 0.024 0.976 0.000
#> GSM494588     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494590     2  0.0892      0.814 0.000 0.980 0.020
#> GSM494609     2  0.6215      0.350 0.428 0.572 0.000
#> GSM494608     1  0.3009      0.905 0.920 0.052 0.028
#> GSM494606     1  0.0892      0.946 0.980 0.020 0.000
#> GSM494574     2  0.6260      0.310 0.448 0.552 0.000
#> GSM494573     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494566     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494601     2  0.5291      0.607 0.268 0.732 0.000
#> GSM494557     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494579     2  0.1031      0.817 0.024 0.976 0.000
#> GSM494596     2  0.0000      0.822 0.000 1.000 0.000
#> GSM494575     2  0.6308      0.202 0.492 0.508 0.000
#> GSM494625     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494654     3  0.6308     -0.124 0.000 0.492 0.508
#> GSM494664     1  0.1860      0.961 0.948 0.000 0.052
#> GSM494624     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494651     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494662     3  0.6280      0.292 0.460 0.000 0.540
#> GSM494627     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494673     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494649     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494658     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494653     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494643     3  0.1529      0.799 0.040 0.000 0.960
#> GSM494672     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494618     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494631     2  0.6309      0.103 0.000 0.500 0.500
#> GSM494619     3  0.0424      0.816 0.008 0.000 0.992
#> GSM494674     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494616     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494663     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494628     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494632     3  0.6280      0.292 0.460 0.000 0.540
#> GSM494660     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494622     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494642     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494647     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494659     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494670     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494675     2  0.0892      0.814 0.000 0.980 0.020
#> GSM494641     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494636     3  0.2796      0.763 0.092 0.000 0.908
#> GSM494640     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494623     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494644     1  0.1753      0.964 0.952 0.000 0.048
#> GSM494646     3  0.6280      0.292 0.460 0.000 0.540
#> GSM494665     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494638     3  0.6280      0.292 0.460 0.000 0.540
#> GSM494645     1  0.1860      0.961 0.948 0.000 0.052
#> GSM494671     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494655     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494620     3  0.6280      0.292 0.460 0.000 0.540
#> GSM494630     3  0.6280      0.292 0.460 0.000 0.540
#> GSM494657     2  0.0892      0.814 0.000 0.980 0.020
#> GSM494667     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494621     3  0.1753      0.794 0.048 0.000 0.952
#> GSM494629     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494637     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494652     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494648     3  0.6280      0.292 0.460 0.000 0.540
#> GSM494650     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494669     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494666     1  0.1860      0.961 0.948 0.000 0.052
#> GSM494668     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494633     3  0.0424      0.816 0.008 0.000 0.992
#> GSM494634     1  0.1031      0.983 0.976 0.000 0.024
#> GSM494639     3  0.6280      0.292 0.460 0.000 0.540
#> GSM494661     1  0.1860      0.961 0.948 0.000 0.052
#> GSM494617     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494626     3  0.0000      0.819 0.000 0.000 1.000
#> GSM494656     3  0.6308     -0.124 0.000 0.492 0.508
#> GSM494635     3  0.6280      0.292 0.460 0.000 0.540

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494594     3  0.3311      0.794 0.000 0.172 0.828 0.000
#> GSM494604     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494564     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494591     3  0.3688      0.807 0.000 0.208 0.792 0.000
#> GSM494567     3  0.5877      0.814 0.000 0.276 0.656 0.068
#> GSM494602     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494613     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494589     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494598     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494593     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494583     3  0.4790      0.782 0.000 0.380 0.620 0.000
#> GSM494612     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494558     3  0.2011      0.658 0.000 0.000 0.920 0.080
#> GSM494556     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494559     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494571     3  0.0188      0.680 0.000 0.004 0.996 0.000
#> GSM494614     3  0.4679      0.810 0.000 0.352 0.648 0.000
#> GSM494603     3  0.3611      0.685 0.000 0.060 0.860 0.080
#> GSM494568     3  0.3280      0.648 0.000 0.016 0.860 0.124
#> GSM494572     3  0.3688      0.807 0.000 0.208 0.792 0.000
#> GSM494600     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494562     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494615     3  0.3521      0.698 0.000 0.084 0.864 0.052
#> GSM494582     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494599     2  0.4406      0.524 0.300 0.700 0.000 0.000
#> GSM494610     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494587     2  0.1716      0.819 0.000 0.936 0.064 0.000
#> GSM494581     2  0.1716      0.819 0.000 0.936 0.064 0.000
#> GSM494580     3  0.4222      0.819 0.000 0.272 0.728 0.000
#> GSM494563     3  0.4843      0.770 0.000 0.396 0.604 0.000
#> GSM494576     2  0.3400      0.608 0.000 0.820 0.180 0.000
#> GSM494605     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494584     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494586     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494578     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494585     2  0.1474      0.832 0.000 0.948 0.052 0.000
#> GSM494611     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494560     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494595     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494570     3  0.5953      0.676 0.000 0.076 0.656 0.268
#> GSM494597     3  0.3688      0.807 0.000 0.208 0.792 0.000
#> GSM494607     1  0.3726      0.728 0.788 0.212 0.000 0.000
#> GSM494561     3  0.5110      0.629 0.000 0.016 0.656 0.328
#> GSM494569     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494592     2  0.4500      0.503 0.316 0.684 0.000 0.000
#> GSM494577     2  0.1557      0.823 0.000 0.944 0.056 0.000
#> GSM494588     3  0.5384      0.812 0.000 0.324 0.648 0.028
#> GSM494590     3  0.3688      0.807 0.000 0.208 0.792 0.000
#> GSM494609     2  0.1722      0.844 0.048 0.944 0.008 0.000
#> GSM494608     2  0.6168      0.147 0.452 0.504 0.004 0.040
#> GSM494606     2  0.4500      0.503 0.316 0.684 0.000 0.000
#> GSM494574     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494573     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494566     3  0.4898      0.731 0.000 0.416 0.584 0.000
#> GSM494601     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494557     3  0.4643      0.817 0.000 0.344 0.656 0.000
#> GSM494579     2  0.0469      0.868 0.000 0.988 0.012 0.000
#> GSM494596     3  0.3688      0.807 0.000 0.208 0.792 0.000
#> GSM494575     2  0.0000      0.876 0.000 1.000 0.000 0.000
#> GSM494625     4  0.0000      0.843 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0000      0.676 0.000 0.000 1.000 0.000
#> GSM494664     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494624     4  0.0000      0.843 0.000 0.000 0.000 1.000
#> GSM494651     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494662     4  0.4331      0.682 0.288 0.000 0.000 0.712
#> GSM494627     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494673     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494649     4  0.0000      0.843 0.000 0.000 0.000 1.000
#> GSM494658     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494643     4  0.1284      0.849 0.012 0.000 0.024 0.964
#> GSM494672     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494618     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494631     3  0.5630      0.746 0.000 0.140 0.724 0.136
#> GSM494619     4  0.0469      0.843 0.012 0.000 0.000 0.988
#> GSM494674     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494616     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494663     4  0.3649      0.852 0.000 0.000 0.204 0.796
#> GSM494628     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494632     4  0.4331      0.682 0.288 0.000 0.000 0.712
#> GSM494660     4  0.0188      0.844 0.000 0.000 0.004 0.996
#> GSM494622     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494642     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494675     3  0.5989      0.811 0.000 0.264 0.656 0.080
#> GSM494641     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494636     4  0.4595      0.788 0.176 0.000 0.044 0.780
#> GSM494640     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494623     4  0.0000      0.843 0.000 0.000 0.000 1.000
#> GSM494644     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494646     4  0.4967      0.369 0.452 0.000 0.000 0.548
#> GSM494665     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494638     4  0.4483      0.686 0.284 0.000 0.004 0.712
#> GSM494645     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494620     4  0.2011      0.816 0.080 0.000 0.000 0.920
#> GSM494630     4  0.2011      0.816 0.080 0.000 0.000 0.920
#> GSM494657     3  0.3688      0.807 0.000 0.208 0.792 0.000
#> GSM494667     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494621     4  0.0707      0.841 0.020 0.000 0.000 0.980
#> GSM494629     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494637     4  0.1867      0.852 0.000 0.000 0.072 0.928
#> GSM494652     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494648     4  0.2011      0.816 0.080 0.000 0.000 0.920
#> GSM494650     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494669     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494633     4  0.0469      0.843 0.012 0.000 0.000 0.988
#> GSM494634     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494639     4  0.4331      0.682 0.288 0.000 0.000 0.712
#> GSM494661     1  0.0000      0.991 1.000 0.000 0.000 0.000
#> GSM494617     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494626     4  0.3688      0.852 0.000 0.000 0.208 0.792
#> GSM494656     3  0.0000      0.676 0.000 0.000 1.000 0.000
#> GSM494635     4  0.4967      0.368 0.452 0.000 0.000 0.548

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     3  0.5625      0.767 0.000 0.204 0.636 0.160 0.000
#> GSM494594     3  0.0000      0.799 0.000 0.000 1.000 0.000 0.000
#> GSM494604     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494564     3  0.6484      0.763 0.000 0.120 0.636 0.160 0.084
#> GSM494591     3  0.0000      0.799 0.000 0.000 1.000 0.000 0.000
#> GSM494567     3  0.2773      0.827 0.000 0.164 0.836 0.000 0.000
#> GSM494602     2  0.0000      0.888 0.000 1.000 0.000 0.000 0.000
#> GSM494613     3  0.3177      0.816 0.000 0.208 0.792 0.000 0.000
#> GSM494589     3  0.6176      0.772 0.000 0.172 0.636 0.160 0.032
#> GSM494598     2  0.1478      0.889 0.000 0.936 0.000 0.064 0.000
#> GSM494593     2  0.0000      0.888 0.000 1.000 0.000 0.000 0.000
#> GSM494583     3  0.6071      0.689 0.000 0.284 0.556 0.160 0.000
#> GSM494612     2  0.0162      0.888 0.004 0.996 0.000 0.000 0.000
#> GSM494558     4  0.4235      0.317 0.000 0.000 0.424 0.576 0.000
#> GSM494556     3  0.3300      0.818 0.000 0.204 0.792 0.004 0.000
#> GSM494559     3  0.6000      0.709 0.000 0.268 0.572 0.160 0.000
#> GSM494571     3  0.0000      0.799 0.000 0.000 1.000 0.000 0.000
#> GSM494614     3  0.4073      0.809 0.000 0.216 0.752 0.032 0.000
#> GSM494603     4  0.5681      0.268 0.000 0.084 0.336 0.576 0.004
#> GSM494568     4  0.4659      0.420 0.000 0.020 0.332 0.644 0.004
#> GSM494572     3  0.0000      0.799 0.000 0.000 1.000 0.000 0.000
#> GSM494600     3  0.5625      0.767 0.000 0.204 0.636 0.160 0.000
#> GSM494562     2  0.1478      0.889 0.000 0.936 0.000 0.064 0.000
#> GSM494615     3  0.4139      0.784 0.000 0.084 0.784 0.132 0.000
#> GSM494582     2  0.1478      0.889 0.000 0.936 0.000 0.064 0.000
#> GSM494599     2  0.1965      0.824 0.096 0.904 0.000 0.000 0.000
#> GSM494610     2  0.1478      0.889 0.000 0.936 0.000 0.064 0.000
#> GSM494587     2  0.1197      0.862 0.000 0.952 0.048 0.000 0.000
#> GSM494581     2  0.0992      0.879 0.000 0.968 0.008 0.024 0.000
#> GSM494580     3  0.2179      0.829 0.000 0.112 0.888 0.000 0.000
#> GSM494563     3  0.6083      0.712 0.000 0.204 0.572 0.224 0.000
#> GSM494576     2  0.4155      0.692 0.000 0.780 0.144 0.076 0.000
#> GSM494605     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494584     3  0.3300      0.818 0.000 0.204 0.792 0.004 0.000
#> GSM494586     2  0.1608      0.887 0.000 0.928 0.000 0.072 0.000
#> GSM494578     3  0.3300      0.818 0.000 0.204 0.792 0.000 0.004
#> GSM494585     2  0.0162      0.887 0.000 0.996 0.004 0.000 0.000
#> GSM494611     2  0.1478      0.889 0.000 0.936 0.000 0.064 0.000
#> GSM494560     3  0.5625      0.767 0.000 0.204 0.636 0.160 0.000
#> GSM494595     2  0.1410      0.889 0.000 0.940 0.000 0.060 0.000
#> GSM494570     5  0.4781      0.619 0.000 0.000 0.112 0.160 0.728
#> GSM494597     3  0.0000      0.799 0.000 0.000 1.000 0.000 0.000
#> GSM494607     2  0.5509      0.163 0.464 0.472 0.000 0.064 0.000
#> GSM494561     5  0.4136      0.625 0.000 0.000 0.188 0.048 0.764
#> GSM494569     4  0.3336      0.854 0.000 0.000 0.000 0.772 0.228
#> GSM494592     2  0.1965      0.824 0.096 0.904 0.000 0.000 0.000
#> GSM494577     2  0.4284      0.727 0.000 0.736 0.040 0.224 0.000
#> GSM494588     5  0.7483      0.290 0.000 0.268 0.084 0.160 0.488
#> GSM494590     3  0.0000      0.799 0.000 0.000 1.000 0.000 0.000
#> GSM494609     2  0.0404      0.886 0.012 0.988 0.000 0.000 0.000
#> GSM494608     2  0.4757      0.341 0.380 0.596 0.000 0.000 0.024
#> GSM494606     2  0.1965      0.824 0.096 0.904 0.000 0.000 0.000
#> GSM494574     2  0.1478      0.889 0.000 0.936 0.000 0.064 0.000
#> GSM494573     3  0.5625      0.767 0.000 0.204 0.636 0.160 0.000
#> GSM494566     3  0.3999      0.703 0.000 0.344 0.656 0.000 0.000
#> GSM494601     2  0.0000      0.888 0.000 1.000 0.000 0.000 0.000
#> GSM494557     3  0.3300      0.818 0.000 0.204 0.792 0.004 0.000
#> GSM494579     2  0.2669      0.859 0.000 0.876 0.020 0.104 0.000
#> GSM494596     3  0.0000      0.799 0.000 0.000 1.000 0.000 0.000
#> GSM494575     2  0.0000      0.888 0.000 1.000 0.000 0.000 0.000
#> GSM494625     5  0.0162      0.870 0.000 0.000 0.000 0.004 0.996
#> GSM494654     3  0.0000      0.799 0.000 0.000 1.000 0.000 0.000
#> GSM494664     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494624     5  0.0162      0.870 0.000 0.000 0.000 0.004 0.996
#> GSM494651     4  0.3336      0.854 0.000 0.000 0.000 0.772 0.228
#> GSM494662     1  0.6053      0.408 0.576 0.000 0.000 0.196 0.228
#> GSM494627     4  0.3305      0.854 0.000 0.000 0.000 0.776 0.224
#> GSM494673     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494649     5  0.0000      0.869 0.000 0.000 0.000 0.000 1.000
#> GSM494658     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494643     5  0.3074      0.551 0.000 0.000 0.000 0.196 0.804
#> GSM494672     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.3305      0.854 0.000 0.000 0.000 0.776 0.224
#> GSM494631     3  0.3583      0.711 0.000 0.012 0.792 0.192 0.004
#> GSM494619     5  0.0162      0.870 0.000 0.000 0.000 0.004 0.996
#> GSM494674     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.3336      0.854 0.000 0.000 0.000 0.772 0.228
#> GSM494663     4  0.3305      0.854 0.000 0.000 0.000 0.776 0.224
#> GSM494628     4  0.3305      0.854 0.000 0.000 0.000 0.776 0.224
#> GSM494632     1  0.6030      0.415 0.580 0.000 0.000 0.196 0.224
#> GSM494660     5  0.0290      0.862 0.000 0.000 0.000 0.008 0.992
#> GSM494622     4  0.3305      0.854 0.000 0.000 0.000 0.776 0.224
#> GSM494642     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494675     3  0.4064      0.796 0.000 0.092 0.792 0.116 0.000
#> GSM494641     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494636     1  0.6120      0.388 0.564 0.000 0.000 0.196 0.240
#> GSM494640     4  0.3819      0.840 0.000 0.000 0.016 0.756 0.228
#> GSM494623     5  0.0162      0.870 0.000 0.000 0.000 0.004 0.996
#> GSM494644     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.5791      0.478 0.616 0.000 0.000 0.196 0.188
#> GSM494665     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494638     1  0.6053      0.408 0.576 0.000 0.000 0.196 0.228
#> GSM494645     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494620     5  0.0000      0.869 0.000 0.000 0.000 0.000 1.000
#> GSM494630     5  0.0000      0.869 0.000 0.000 0.000 0.000 1.000
#> GSM494657     3  0.0000      0.799 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494621     5  0.0162      0.870 0.000 0.000 0.000 0.004 0.996
#> GSM494629     4  0.3336      0.854 0.000 0.000 0.000 0.772 0.228
#> GSM494637     4  0.4273      0.498 0.000 0.000 0.000 0.552 0.448
#> GSM494652     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494648     5  0.0162      0.870 0.000 0.000 0.000 0.004 0.996
#> GSM494650     4  0.3305      0.854 0.000 0.000 0.000 0.776 0.224
#> GSM494669     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494633     5  0.0000      0.869 0.000 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.6030      0.415 0.580 0.000 0.000 0.196 0.224
#> GSM494661     1  0.0000      0.894 1.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.3336      0.854 0.000 0.000 0.000 0.772 0.228
#> GSM494626     4  0.3305      0.854 0.000 0.000 0.000 0.776 0.224
#> GSM494656     3  0.0000      0.799 0.000 0.000 1.000 0.000 0.000
#> GSM494635     1  0.5877      0.458 0.604 0.000 0.000 0.196 0.200

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM494565     5  0.2420      0.829 0.000 0.040 0.076 0.000 0.884 0.000
#> GSM494594     3  0.0000      0.936 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.0260      0.952 0.992 0.008 0.000 0.000 0.000 0.000
#> GSM494564     5  0.2092      0.829 0.000 0.000 0.124 0.000 0.876 0.000
#> GSM494591     3  0.0000      0.936 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     3  0.0146      0.933 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494602     2  0.0000      0.861 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494613     3  0.2902      0.675 0.000 0.196 0.800 0.000 0.004 0.000
#> GSM494589     5  0.2092      0.829 0.000 0.000 0.124 0.000 0.876 0.000
#> GSM494598     2  0.2346      0.844 0.000 0.868 0.000 0.000 0.124 0.008
#> GSM494593     2  0.0000      0.861 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494583     5  0.2100      0.797 0.000 0.112 0.004 0.000 0.884 0.000
#> GSM494612     2  0.0000      0.861 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     4  0.2562      0.746 0.000 0.000 0.172 0.828 0.000 0.000
#> GSM494556     5  0.4844      0.260 0.000 0.000 0.440 0.056 0.504 0.000
#> GSM494559     5  0.2312      0.800 0.000 0.112 0.012 0.000 0.876 0.000
#> GSM494571     3  0.0000      0.936 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494614     5  0.3756      0.439 0.000 0.000 0.400 0.000 0.600 0.000
#> GSM494603     4  0.2340      0.763 0.000 0.000 0.148 0.852 0.000 0.000
#> GSM494568     4  0.2752      0.781 0.000 0.000 0.108 0.856 0.000 0.036
#> GSM494572     3  0.0000      0.936 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494600     5  0.2092      0.829 0.000 0.000 0.124 0.000 0.876 0.000
#> GSM494562     2  0.2389      0.843 0.000 0.864 0.000 0.000 0.128 0.008
#> GSM494615     4  0.3817      0.337 0.000 0.000 0.432 0.568 0.000 0.000
#> GSM494582     2  0.2257      0.845 0.000 0.876 0.000 0.000 0.116 0.008
#> GSM494599     2  0.0000      0.861 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494610     2  0.2389      0.843 0.000 0.864 0.000 0.000 0.128 0.008
#> GSM494587     2  0.2513      0.758 0.000 0.852 0.140 0.000 0.008 0.000
#> GSM494581     2  0.2489      0.775 0.000 0.860 0.012 0.000 0.128 0.000
#> GSM494580     3  0.0146      0.933 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494563     5  0.0000      0.786 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494576     2  0.4513      0.607 0.000 0.692 0.096 0.000 0.212 0.000
#> GSM494605     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494584     5  0.5255      0.253 0.000 0.096 0.428 0.000 0.476 0.000
#> GSM494586     2  0.2513      0.840 0.000 0.852 0.000 0.000 0.140 0.008
#> GSM494578     3  0.0146      0.933 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494585     2  0.0291      0.858 0.000 0.992 0.004 0.000 0.004 0.000
#> GSM494611     2  0.2003      0.846 0.000 0.884 0.000 0.000 0.116 0.000
#> GSM494560     5  0.2048      0.830 0.000 0.000 0.120 0.000 0.880 0.000
#> GSM494595     2  0.1918      0.853 0.000 0.904 0.000 0.000 0.088 0.008
#> GSM494570     5  0.2618      0.809 0.000 0.000 0.052 0.000 0.872 0.076
#> GSM494597     3  0.0000      0.936 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494607     2  0.5294      0.402 0.356 0.532 0.000 0.000 0.112 0.000
#> GSM494561     6  0.1498      0.912 0.000 0.000 0.032 0.028 0.000 0.940
#> GSM494569     4  0.0865      0.846 0.000 0.000 0.000 0.964 0.000 0.036
#> GSM494592     2  0.0000      0.861 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494577     5  0.0260      0.783 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM494588     5  0.2455      0.799 0.000 0.112 0.012 0.000 0.872 0.004
#> GSM494590     3  0.0000      0.936 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     2  0.0000      0.861 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494608     2  0.4219      0.375 0.360 0.620 0.000 0.012 0.000 0.008
#> GSM494606     2  0.0000      0.861 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494574     2  0.2346      0.844 0.000 0.868 0.000 0.000 0.124 0.008
#> GSM494573     5  0.2048      0.830 0.000 0.000 0.120 0.000 0.880 0.000
#> GSM494566     2  0.5900      0.221 0.000 0.500 0.276 0.220 0.004 0.000
#> GSM494601     2  0.0000      0.861 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494557     3  0.4336     -0.227 0.000 0.020 0.504 0.000 0.476 0.000
#> GSM494579     2  0.3490      0.745 0.000 0.724 0.000 0.000 0.268 0.008
#> GSM494596     3  0.0000      0.936 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0000      0.861 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     6  0.1007      0.932 0.000 0.000 0.000 0.044 0.000 0.956
#> GSM494654     3  0.0000      0.936 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494664     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494624     6  0.0937      0.934 0.000 0.000 0.000 0.040 0.000 0.960
#> GSM494651     4  0.0713      0.848 0.000 0.000 0.000 0.972 0.000 0.028
#> GSM494662     1  0.3134      0.828 0.820 0.000 0.000 0.144 0.000 0.036
#> GSM494627     4  0.0000      0.849 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494673     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     6  0.0713      0.936 0.000 0.000 0.000 0.028 0.000 0.972
#> GSM494658     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     6  0.2300      0.855 0.000 0.000 0.000 0.144 0.000 0.856
#> GSM494672     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0000      0.849 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494631     4  0.3961      0.310 0.000 0.000 0.440 0.556 0.004 0.000
#> GSM494619     6  0.0865      0.935 0.000 0.000 0.000 0.036 0.000 0.964
#> GSM494674     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0790      0.847 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM494663     4  0.1663      0.798 0.000 0.000 0.000 0.912 0.000 0.088
#> GSM494628     4  0.0000      0.849 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494632     1  0.3062      0.832 0.824 0.000 0.000 0.144 0.000 0.032
#> GSM494660     6  0.2135      0.873 0.000 0.000 0.000 0.128 0.000 0.872
#> GSM494622     4  0.0146      0.848 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM494642     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494675     4  0.3961      0.312 0.000 0.000 0.440 0.556 0.004 0.000
#> GSM494641     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     1  0.3332      0.817 0.808 0.000 0.000 0.144 0.000 0.048
#> GSM494640     4  0.0865      0.846 0.000 0.000 0.000 0.964 0.000 0.036
#> GSM494623     6  0.1007      0.932 0.000 0.000 0.000 0.044 0.000 0.956
#> GSM494644     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.2942      0.842 0.836 0.000 0.000 0.132 0.000 0.032
#> GSM494665     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494638     1  0.3134      0.828 0.820 0.000 0.000 0.144 0.000 0.036
#> GSM494645     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.0260      0.938 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM494630     6  0.1957      0.887 0.000 0.000 0.000 0.112 0.000 0.888
#> GSM494657     3  0.0000      0.936 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0363      0.939 0.000 0.000 0.000 0.012 0.000 0.988
#> GSM494629     4  0.0865      0.846 0.000 0.000 0.000 0.964 0.000 0.036
#> GSM494637     4  0.3409      0.527 0.000 0.000 0.000 0.700 0.000 0.300
#> GSM494652     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.0363      0.939 0.000 0.000 0.000 0.012 0.000 0.988
#> GSM494650     4  0.0000      0.849 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494669     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     6  0.1501      0.913 0.000 0.000 0.000 0.076 0.000 0.924
#> GSM494634     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.3062      0.832 0.824 0.000 0.000 0.144 0.000 0.032
#> GSM494661     1  0.0000      0.957 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.0865      0.846 0.000 0.000 0.000 0.964 0.000 0.036
#> GSM494626     4  0.0632      0.849 0.000 0.000 0.000 0.976 0.000 0.024
#> GSM494656     3  0.0000      0.936 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494635     1  0.3062      0.832 0.824 0.000 0.000 0.144 0.000 0.032

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 5)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-pam-collect-classes

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

test_to_known_factors(res)
#>          n disease.state(p) age(p) other(p) individual(p) k
#> CV:pam 114         2.49e-19  1.000 7.73e-15         1.000 2
#> CV:pam  93         9.01e-14  0.246 1.16e-07         0.668 3
#> CV:pam 117         2.33e-18  0.533 9.89e-14         0.852 4
#> CV:pam 106         1.20e-14  0.218 3.98e-08         0.324 5
#> CV:pam 110         3.48e-15  0.127 2.71e-11         0.257 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 51941 rows and 120 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-mclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.965           0.941       0.972         0.3440 0.667   0.667
#> 3 3 0.687           0.807       0.894         0.8581 0.676   0.519
#> 4 4 0.883           0.906       0.955         0.1365 0.867   0.651
#> 5 5 0.723           0.772       0.857         0.0763 0.905   0.665
#> 6 6 0.871           0.860       0.933         0.0247 0.883   0.546

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
#> GSM494565     2  0.0938    0.96512 0.012 0.988
#> GSM494594     1  0.1633    0.96008 0.976 0.024
#> GSM494604     1  0.0376    0.97357 0.996 0.004
#> GSM494564     2  0.0938    0.96512 0.012 0.988
#> GSM494591     1  0.1633    0.96008 0.976 0.024
#> GSM494567     1  0.0000    0.97383 1.000 0.000
#> GSM494602     1  0.0000    0.97383 1.000 0.000
#> GSM494613     1  0.0000    0.97383 1.000 0.000
#> GSM494589     2  0.0938    0.96512 0.012 0.988
#> GSM494598     1  0.0000    0.97383 1.000 0.000
#> GSM494593     1  0.0000    0.97383 1.000 0.000
#> GSM494583     1  0.7674    0.70151 0.776 0.224
#> GSM494612     1  0.0000    0.97383 1.000 0.000
#> GSM494558     1  0.1633    0.96008 0.976 0.024
#> GSM494556     1  0.0000    0.97383 1.000 0.000
#> GSM494559     2  0.0938    0.96512 0.012 0.988
#> GSM494571     1  0.1633    0.96008 0.976 0.024
#> GSM494614     1  0.0000    0.97383 1.000 0.000
#> GSM494603     2  0.8016    0.69604 0.244 0.756
#> GSM494568     1  0.2603    0.93933 0.956 0.044
#> GSM494572     1  0.1633    0.96008 0.976 0.024
#> GSM494600     2  0.0938    0.96512 0.012 0.988
#> GSM494562     1  0.0000    0.97383 1.000 0.000
#> GSM494615     1  0.0000    0.97383 1.000 0.000
#> GSM494582     1  0.0000    0.97383 1.000 0.000
#> GSM494599     1  0.0000    0.97383 1.000 0.000
#> GSM494610     1  0.0000    0.97383 1.000 0.000
#> GSM494587     1  0.0000    0.97383 1.000 0.000
#> GSM494581     1  0.0376    0.97269 0.996 0.004
#> GSM494580     1  0.0000    0.97383 1.000 0.000
#> GSM494563     2  0.0938    0.96512 0.012 0.988
#> GSM494576     1  0.0000    0.97383 1.000 0.000
#> GSM494605     1  0.0376    0.97357 0.996 0.004
#> GSM494584     1  0.0000    0.97383 1.000 0.000
#> GSM494586     1  0.0000    0.97383 1.000 0.000
#> GSM494578     1  0.0000    0.97383 1.000 0.000
#> GSM494585     1  0.0000    0.97383 1.000 0.000
#> GSM494611     1  0.0000    0.97383 1.000 0.000
#> GSM494560     2  0.0938    0.96512 0.012 0.988
#> GSM494595     1  0.0000    0.97383 1.000 0.000
#> GSM494570     2  0.0938    0.96512 0.012 0.988
#> GSM494597     1  0.1633    0.96008 0.976 0.024
#> GSM494607     1  0.0000    0.97383 1.000 0.000
#> GSM494561     2  0.0938    0.96512 0.012 0.988
#> GSM494569     1  0.0376    0.97357 0.996 0.004
#> GSM494592     1  0.0000    0.97383 1.000 0.000
#> GSM494577     1  0.8443    0.61629 0.728 0.272
#> GSM494588     2  0.0938    0.96512 0.012 0.988
#> GSM494590     1  0.1633    0.96008 0.976 0.024
#> GSM494609     1  0.0000    0.97383 1.000 0.000
#> GSM494608     1  0.0000    0.97383 1.000 0.000
#> GSM494606     1  0.0000    0.97383 1.000 0.000
#> GSM494574     1  0.0000    0.97383 1.000 0.000
#> GSM494573     2  0.0938    0.96512 0.012 0.988
#> GSM494566     1  0.0000    0.97383 1.000 0.000
#> GSM494601     1  0.0000    0.97383 1.000 0.000
#> GSM494557     1  0.0000    0.97383 1.000 0.000
#> GSM494579     1  0.0376    0.97258 0.996 0.004
#> GSM494596     1  0.1633    0.96008 0.976 0.024
#> GSM494575     1  0.0000    0.97383 1.000 0.000
#> GSM494625     2  0.0672    0.96511 0.008 0.992
#> GSM494654     1  0.1633    0.96008 0.976 0.024
#> GSM494664     1  0.0376    0.97357 0.996 0.004
#> GSM494624     2  0.0672    0.96511 0.008 0.992
#> GSM494651     1  0.0376    0.97357 0.996 0.004
#> GSM494662     1  0.2948    0.93506 0.948 0.052
#> GSM494627     1  0.8955    0.55278 0.688 0.312
#> GSM494673     1  0.0938    0.97054 0.988 0.012
#> GSM494649     2  0.0672    0.96511 0.008 0.992
#> GSM494658     1  0.0376    0.97357 0.996 0.004
#> GSM494653     1  0.0938    0.97054 0.988 0.012
#> GSM494643     2  0.7453    0.73993 0.212 0.788
#> GSM494672     1  0.0938    0.97054 0.988 0.012
#> GSM494618     1  0.0376    0.97357 0.996 0.004
#> GSM494631     1  0.0000    0.97383 1.000 0.000
#> GSM494619     2  0.0672    0.96511 0.008 0.992
#> GSM494674     1  0.0938    0.97054 0.988 0.012
#> GSM494616     1  0.0376    0.97357 0.996 0.004
#> GSM494663     2  0.8955    0.55858 0.312 0.688
#> GSM494628     1  0.0938    0.97069 0.988 0.012
#> GSM494632     1  0.0376    0.97357 0.996 0.004
#> GSM494660     2  0.0672    0.96511 0.008 0.992
#> GSM494622     1  0.0376    0.97357 0.996 0.004
#> GSM494642     1  0.0938    0.97054 0.988 0.012
#> GSM494647     1  0.0938    0.97054 0.988 0.012
#> GSM494659     1  0.0938    0.97054 0.988 0.012
#> GSM494670     1  0.0938    0.97054 0.988 0.012
#> GSM494675     1  0.0376    0.97252 0.996 0.004
#> GSM494641     1  0.0938    0.97054 0.988 0.012
#> GSM494636     1  0.2043    0.95461 0.968 0.032
#> GSM494640     1  0.9358    0.45695 0.648 0.352
#> GSM494623     2  0.0672    0.96511 0.008 0.992
#> GSM494644     1  0.0376    0.97357 0.996 0.004
#> GSM494646     1  0.0376    0.97357 0.996 0.004
#> GSM494665     1  0.0376    0.97357 0.996 0.004
#> GSM494638     1  0.0376    0.97357 0.996 0.004
#> GSM494645     1  0.0376    0.97357 0.996 0.004
#> GSM494671     1  0.0938    0.97054 0.988 0.012
#> GSM494655     1  0.0938    0.97054 0.988 0.012
#> GSM494620     2  0.0672    0.96511 0.008 0.992
#> GSM494630     2  0.0672    0.96511 0.008 0.992
#> GSM494657     1  0.1633    0.96008 0.976 0.024
#> GSM494667     1  0.0938    0.97054 0.988 0.012
#> GSM494621     2  0.0672    0.96511 0.008 0.992
#> GSM494629     1  0.1843    0.95999 0.972 0.028
#> GSM494637     1  0.9998    0.00665 0.508 0.492
#> GSM494652     1  0.0938    0.97054 0.988 0.012
#> GSM494648     2  0.0672    0.96511 0.008 0.992
#> GSM494650     1  0.0376    0.97357 0.996 0.004
#> GSM494669     1  0.0938    0.97054 0.988 0.012
#> GSM494666     1  0.0376    0.97357 0.996 0.004
#> GSM494668     1  0.0938    0.97054 0.988 0.012
#> GSM494633     2  0.0672    0.96511 0.008 0.992
#> GSM494634     1  0.0938    0.97054 0.988 0.012
#> GSM494639     1  0.0376    0.97357 0.996 0.004
#> GSM494661     1  0.0672    0.97236 0.992 0.008
#> GSM494617     1  0.0376    0.97357 0.996 0.004
#> GSM494626     1  0.0376    0.97357 0.996 0.004
#> GSM494656     1  0.1633    0.96008 0.976 0.024
#> GSM494635     1  0.0376    0.97357 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
#> GSM494565     3  0.0237      0.925 0.000 0.004 0.996
#> GSM494594     2  0.5905      0.658 0.000 0.648 0.352
#> GSM494604     2  0.4504      0.700 0.196 0.804 0.000
#> GSM494564     3  0.0237      0.925 0.000 0.004 0.996
#> GSM494591     2  0.5905      0.658 0.000 0.648 0.352
#> GSM494567     2  0.5363      0.711 0.000 0.724 0.276
#> GSM494602     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494613     2  0.5363      0.711 0.000 0.724 0.276
#> GSM494589     3  0.0237      0.925 0.000 0.004 0.996
#> GSM494598     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494593     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494583     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494612     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494558     2  0.6081      0.661 0.004 0.652 0.344
#> GSM494556     2  0.5363      0.711 0.000 0.724 0.276
#> GSM494559     3  0.0237      0.925 0.000 0.004 0.996
#> GSM494571     2  0.5905      0.658 0.000 0.648 0.352
#> GSM494614     2  0.0237      0.834 0.000 0.996 0.004
#> GSM494603     3  0.4749      0.836 0.072 0.076 0.852
#> GSM494568     2  0.9613      0.280 0.228 0.464 0.308
#> GSM494572     2  0.5905      0.658 0.000 0.648 0.352
#> GSM494600     3  0.0237      0.925 0.000 0.004 0.996
#> GSM494562     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494615     2  0.5363      0.711 0.000 0.724 0.276
#> GSM494582     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494599     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494610     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494587     2  0.0237      0.834 0.000 0.996 0.004
#> GSM494581     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494580     2  0.5363      0.711 0.000 0.724 0.276
#> GSM494563     3  0.0237      0.925 0.000 0.004 0.996
#> GSM494576     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494605     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494584     2  0.0237      0.834 0.000 0.996 0.004
#> GSM494586     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494578     2  0.5363      0.711 0.000 0.724 0.276
#> GSM494585     2  0.0237      0.834 0.000 0.996 0.004
#> GSM494611     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494560     3  0.0237      0.925 0.000 0.004 0.996
#> GSM494595     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494570     3  0.0237      0.925 0.000 0.004 0.996
#> GSM494597     2  0.5905      0.658 0.000 0.648 0.352
#> GSM494607     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494561     3  0.0237      0.925 0.000 0.004 0.996
#> GSM494569     1  0.5254      0.689 0.736 0.000 0.264
#> GSM494592     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494577     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494588     3  0.0237      0.925 0.000 0.004 0.996
#> GSM494590     2  0.5905      0.658 0.000 0.648 0.352
#> GSM494609     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494608     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494606     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494574     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494573     3  0.0237      0.925 0.000 0.004 0.996
#> GSM494566     2  0.0237      0.834 0.000 0.996 0.004
#> GSM494601     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494557     2  0.5363      0.711 0.000 0.724 0.276
#> GSM494579     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494596     2  0.5905      0.658 0.000 0.648 0.352
#> GSM494575     2  0.0000      0.835 0.000 1.000 0.000
#> GSM494625     3  0.2537      0.925 0.080 0.000 0.920
#> GSM494654     2  0.6587      0.640 0.016 0.632 0.352
#> GSM494664     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494624     3  0.2537      0.925 0.080 0.000 0.920
#> GSM494651     1  0.5327      0.675 0.728 0.000 0.272
#> GSM494662     1  0.1529      0.858 0.960 0.000 0.040
#> GSM494627     1  0.5254      0.688 0.736 0.000 0.264
#> GSM494673     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494649     3  0.2711      0.918 0.088 0.000 0.912
#> GSM494658     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494653     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494643     3  0.5948      0.402 0.360 0.000 0.640
#> GSM494672     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494618     1  0.5216      0.692 0.740 0.000 0.260
#> GSM494631     2  0.5763      0.706 0.008 0.716 0.276
#> GSM494619     3  0.2537      0.925 0.080 0.000 0.920
#> GSM494674     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494616     1  0.5216      0.692 0.740 0.000 0.260
#> GSM494663     1  0.5465      0.655 0.712 0.000 0.288
#> GSM494628     1  0.5216      0.692 0.740 0.000 0.260
#> GSM494632     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494660     3  0.2625      0.921 0.084 0.000 0.916
#> GSM494622     1  0.7728      0.571 0.640 0.084 0.276
#> GSM494642     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494647     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494659     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494670     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494675     2  0.5363      0.711 0.000 0.724 0.276
#> GSM494641     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494636     1  0.2711      0.830 0.912 0.000 0.088
#> GSM494640     1  0.5327      0.679 0.728 0.000 0.272
#> GSM494623     3  0.2537      0.925 0.080 0.000 0.920
#> GSM494644     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494646     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494665     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494638     1  0.4346      0.763 0.816 0.000 0.184
#> GSM494645     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494671     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494655     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494620     3  0.2537      0.925 0.080 0.000 0.920
#> GSM494630     3  0.2537      0.925 0.080 0.000 0.920
#> GSM494657     2  0.5905      0.658 0.000 0.648 0.352
#> GSM494667     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494621     3  0.2537      0.925 0.080 0.000 0.920
#> GSM494629     1  0.5327      0.675 0.728 0.000 0.272
#> GSM494637     1  0.5327      0.679 0.728 0.000 0.272
#> GSM494652     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494648     3  0.2537      0.925 0.080 0.000 0.920
#> GSM494650     1  0.5363      0.671 0.724 0.000 0.276
#> GSM494669     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494666     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494668     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494633     3  0.2537      0.925 0.080 0.000 0.920
#> GSM494634     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494639     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494661     1  0.0000      0.877 1.000 0.000 0.000
#> GSM494617     1  0.5216      0.692 0.740 0.000 0.260
#> GSM494626     1  0.5216      0.692 0.740 0.000 0.260
#> GSM494656     2  0.5905      0.658 0.000 0.648 0.352
#> GSM494635     1  0.0000      0.877 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
#> GSM494565     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494594     3  0.0000     0.8668 0.000 0.000 1.000 0.000
#> GSM494604     2  0.2814     0.7874 0.132 0.868 0.000 0.000
#> GSM494564     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494591     3  0.0000     0.8668 0.000 0.000 1.000 0.000
#> GSM494567     3  0.2814     0.8655 0.000 0.132 0.868 0.000
#> GSM494602     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494613     3  0.2760     0.8667 0.000 0.128 0.872 0.000
#> GSM494589     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494598     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494593     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494583     2  0.1302     0.9409 0.000 0.956 0.044 0.000
#> GSM494612     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494558     3  0.2814     0.8655 0.000 0.132 0.868 0.000
#> GSM494556     3  0.2814     0.8655 0.000 0.132 0.868 0.000
#> GSM494559     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494571     3  0.0000     0.8668 0.000 0.000 1.000 0.000
#> GSM494614     3  0.4746     0.5292 0.000 0.368 0.632 0.000
#> GSM494603     3  0.8316     0.5665 0.120 0.176 0.568 0.136
#> GSM494568     3  0.3342     0.8230 0.100 0.032 0.868 0.000
#> GSM494572     3  0.0000     0.8668 0.000 0.000 1.000 0.000
#> GSM494600     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494562     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494615     3  0.2814     0.8655 0.000 0.132 0.868 0.000
#> GSM494582     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494599     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494610     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494587     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494581     2  0.1302     0.9409 0.000 0.956 0.044 0.000
#> GSM494580     3  0.2814     0.8655 0.000 0.132 0.868 0.000
#> GSM494563     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494576     2  0.1302     0.9409 0.000 0.956 0.044 0.000
#> GSM494605     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494584     2  0.4331     0.5378 0.000 0.712 0.288 0.000
#> GSM494586     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494578     3  0.2814     0.8655 0.000 0.132 0.868 0.000
#> GSM494585     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494611     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494560     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494595     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494570     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494597     3  0.0000     0.8668 0.000 0.000 1.000 0.000
#> GSM494607     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494561     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494569     1  0.0469     0.9521 0.988 0.000 0.012 0.000
#> GSM494592     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494577     2  0.1302     0.9409 0.000 0.956 0.044 0.000
#> GSM494588     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494590     3  0.0000     0.8668 0.000 0.000 1.000 0.000
#> GSM494609     2  0.1302     0.9409 0.000 0.956 0.044 0.000
#> GSM494608     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494606     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494574     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494573     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494566     3  0.4222     0.7067 0.000 0.272 0.728 0.000
#> GSM494601     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494557     3  0.2760     0.8667 0.000 0.128 0.872 0.000
#> GSM494579     2  0.1302     0.9409 0.000 0.956 0.044 0.000
#> GSM494596     3  0.0000     0.8668 0.000 0.000 1.000 0.000
#> GSM494575     2  0.0000     0.9689 0.000 1.000 0.000 0.000
#> GSM494625     4  0.1302     0.9420 0.044 0.000 0.000 0.956
#> GSM494654     3  0.0000     0.8668 0.000 0.000 1.000 0.000
#> GSM494664     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494624     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494651     1  0.2868     0.8352 0.864 0.000 0.136 0.000
#> GSM494662     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494627     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494673     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494649     1  0.4961     0.2074 0.552 0.000 0.000 0.448
#> GSM494658     1  0.4999     0.0311 0.508 0.492 0.000 0.000
#> GSM494653     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494643     1  0.0921     0.9369 0.972 0.000 0.000 0.028
#> GSM494672     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494618     1  0.0336     0.9552 0.992 0.000 0.008 0.000
#> GSM494631     3  0.2704     0.8673 0.000 0.124 0.876 0.000
#> GSM494619     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494616     1  0.0336     0.9552 0.992 0.000 0.008 0.000
#> GSM494663     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494628     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494632     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494660     1  0.4967     0.1949 0.548 0.000 0.000 0.452
#> GSM494622     3  0.4999     0.0747 0.492 0.000 0.508 0.000
#> GSM494642     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494659     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494670     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494675     3  0.2814     0.8655 0.000 0.132 0.868 0.000
#> GSM494641     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494636     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494640     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494623     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494644     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494646     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494665     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494638     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494645     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494671     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494655     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494620     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494630     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494657     3  0.0000     0.8668 0.000 0.000 1.000 0.000
#> GSM494667     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494621     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494629     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494637     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494652     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494648     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494650     1  0.2868     0.8352 0.864 0.000 0.136 0.000
#> GSM494669     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494666     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494668     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494633     4  0.0000     0.9970 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494639     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494661     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494617     1  0.0000     0.9606 1.000 0.000 0.000 0.000
#> GSM494626     1  0.0188     0.9579 0.996 0.000 0.004 0.000
#> GSM494656     3  0.0000     0.8668 0.000 0.000 1.000 0.000
#> GSM494635     1  0.0000     0.9606 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
#> GSM494565     5  0.0000     0.8446 0.000 0.000 0.000 0.000 1.000
#> GSM494594     3  0.0000     0.9015 0.000 0.000 1.000 0.000 0.000
#> GSM494604     2  0.0510     0.8467 0.016 0.984 0.000 0.000 0.000
#> GSM494564     5  0.0000     0.8446 0.000 0.000 0.000 0.000 1.000
#> GSM494591     3  0.0000     0.9015 0.000 0.000 1.000 0.000 0.000
#> GSM494567     3  0.0290     0.9036 0.000 0.008 0.992 0.000 0.000
#> GSM494602     2  0.0162     0.8548 0.004 0.996 0.000 0.000 0.000
#> GSM494613     3  0.0290     0.9036 0.000 0.008 0.992 0.000 0.000
#> GSM494589     5  0.0000     0.8446 0.000 0.000 0.000 0.000 1.000
#> GSM494598     2  0.0000     0.8551 0.000 1.000 0.000 0.000 0.000
#> GSM494593     2  0.0000     0.8551 0.000 1.000 0.000 0.000 0.000
#> GSM494583     2  0.4030     0.5529 0.000 0.648 0.352 0.000 0.000
#> GSM494612     2  0.0162     0.8548 0.004 0.996 0.000 0.000 0.000
#> GSM494558     3  0.0290     0.9036 0.000 0.008 0.992 0.000 0.000
#> GSM494556     3  0.0290     0.9036 0.000 0.008 0.992 0.000 0.000
#> GSM494559     5  0.0000     0.8446 0.000 0.000 0.000 0.000 1.000
#> GSM494571     3  0.0000     0.9015 0.000 0.000 1.000 0.000 0.000
#> GSM494614     3  0.3895     0.4346 0.000 0.320 0.680 0.000 0.000
#> GSM494603     3  0.5008     0.6575 0.000 0.180 0.732 0.028 0.060
#> GSM494568     3  0.2502     0.8394 0.000 0.060 0.904 0.024 0.012
#> GSM494572     3  0.0000     0.9015 0.000 0.000 1.000 0.000 0.000
#> GSM494600     5  0.0000     0.8446 0.000 0.000 0.000 0.000 1.000
#> GSM494562     2  0.0000     0.8551 0.000 1.000 0.000 0.000 0.000
#> GSM494615     3  0.0290     0.9036 0.000 0.008 0.992 0.000 0.000
#> GSM494582     2  0.0000     0.8551 0.000 1.000 0.000 0.000 0.000
#> GSM494599     2  0.0162     0.8548 0.004 0.996 0.000 0.000 0.000
#> GSM494610     2  0.0000     0.8551 0.000 1.000 0.000 0.000 0.000
#> GSM494587     2  0.2648     0.7713 0.000 0.848 0.152 0.000 0.000
#> GSM494581     2  0.4045     0.5467 0.000 0.644 0.356 0.000 0.000
#> GSM494580     3  0.0290     0.9036 0.000 0.008 0.992 0.000 0.000
#> GSM494563     5  0.0000     0.8446 0.000 0.000 0.000 0.000 1.000
#> GSM494576     2  0.4030     0.5529 0.000 0.648 0.352 0.000 0.000
#> GSM494605     1  0.4795     0.7088 0.704 0.000 0.072 0.224 0.000
#> GSM494584     3  0.4262     0.0251 0.000 0.440 0.560 0.000 0.000
#> GSM494586     2  0.1478     0.8276 0.000 0.936 0.064 0.000 0.000
#> GSM494578     3  0.0290     0.9036 0.000 0.008 0.992 0.000 0.000
#> GSM494585     2  0.2471     0.7832 0.000 0.864 0.136 0.000 0.000
#> GSM494611     2  0.0000     0.8551 0.000 1.000 0.000 0.000 0.000
#> GSM494560     5  0.0000     0.8446 0.000 0.000 0.000 0.000 1.000
#> GSM494595     2  0.0290     0.8533 0.000 0.992 0.008 0.000 0.000
#> GSM494570     5  0.0000     0.8446 0.000 0.000 0.000 0.000 1.000
#> GSM494597     3  0.0290     0.9036 0.000 0.008 0.992 0.000 0.000
#> GSM494607     2  0.0162     0.8548 0.004 0.996 0.000 0.000 0.000
#> GSM494561     5  0.0000     0.8446 0.000 0.000 0.000 0.000 1.000
#> GSM494569     4  0.4666     0.8274 0.088 0.000 0.180 0.732 0.000
#> GSM494592     2  0.0162     0.8548 0.004 0.996 0.000 0.000 0.000
#> GSM494577     2  0.4030     0.5529 0.000 0.648 0.352 0.000 0.000
#> GSM494588     5  0.0000     0.8446 0.000 0.000 0.000 0.000 1.000
#> GSM494590     3  0.0000     0.9015 0.000 0.000 1.000 0.000 0.000
#> GSM494609     2  0.4045     0.5467 0.000 0.644 0.356 0.000 0.000
#> GSM494608     2  0.3895     0.5986 0.000 0.680 0.320 0.000 0.000
#> GSM494606     2  0.0162     0.8548 0.004 0.996 0.000 0.000 0.000
#> GSM494574     2  0.0000     0.8551 0.000 1.000 0.000 0.000 0.000
#> GSM494573     5  0.0000     0.8446 0.000 0.000 0.000 0.000 1.000
#> GSM494566     3  0.3983     0.4056 0.000 0.340 0.660 0.000 0.000
#> GSM494601     2  0.0000     0.8551 0.000 1.000 0.000 0.000 0.000
#> GSM494557     3  0.0290     0.9036 0.000 0.008 0.992 0.000 0.000
#> GSM494579     2  0.4030     0.5529 0.000 0.648 0.352 0.000 0.000
#> GSM494596     3  0.0000     0.9015 0.000 0.000 1.000 0.000 0.000
#> GSM494575     2  0.0162     0.8548 0.004 0.996 0.000 0.000 0.000
#> GSM494625     4  0.5369     0.5311 0.000 0.000 0.124 0.660 0.216
#> GSM494654     3  0.0000     0.9015 0.000 0.000 1.000 0.000 0.000
#> GSM494664     1  0.5250     0.6596 0.668 0.000 0.108 0.224 0.000
#> GSM494624     5  0.4101     0.7463 0.000 0.000 0.000 0.372 0.628
#> GSM494651     4  0.4238     0.8445 0.068 0.000 0.164 0.768 0.000
#> GSM494662     4  0.4503     0.7894 0.120 0.000 0.124 0.756 0.000
#> GSM494627     4  0.2690     0.8579 0.000 0.000 0.156 0.844 0.000
#> GSM494673     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.5341     0.5401 0.000 0.000 0.124 0.664 0.212
#> GSM494658     2  0.6739     0.0149 0.348 0.392 0.260 0.000 0.000
#> GSM494653     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.2690     0.8579 0.000 0.000 0.156 0.844 0.000
#> GSM494672     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.4412     0.8390 0.080 0.000 0.164 0.756 0.000
#> GSM494631     3  0.0290     0.9036 0.000 0.008 0.992 0.000 0.000
#> GSM494619     5  0.4101     0.7463 0.000 0.000 0.000 0.372 0.628
#> GSM494674     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.4297     0.8430 0.072 0.000 0.164 0.764 0.000
#> GSM494663     4  0.2690     0.8579 0.000 0.000 0.156 0.844 0.000
#> GSM494628     4  0.2690     0.8579 0.000 0.000 0.156 0.844 0.000
#> GSM494632     1  0.5500     0.6132 0.640 0.000 0.124 0.236 0.000
#> GSM494660     4  0.5341     0.5401 0.000 0.000 0.124 0.664 0.212
#> GSM494622     3  0.4854     0.2200 0.044 0.000 0.648 0.308 0.000
#> GSM494642     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0510     0.8192 0.984 0.000 0.000 0.016 0.000
#> GSM494675     3  0.0290     0.9036 0.000 0.008 0.992 0.000 0.000
#> GSM494641     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.4964     0.7822 0.132 0.000 0.156 0.712 0.000
#> GSM494640     4  0.2690     0.8579 0.000 0.000 0.156 0.844 0.000
#> GSM494623     5  0.4101     0.7463 0.000 0.000 0.000 0.372 0.628
#> GSM494644     1  0.3305     0.7638 0.776 0.000 0.000 0.224 0.000
#> GSM494646     1  0.5329     0.6436 0.656 0.000 0.108 0.236 0.000
#> GSM494665     1  0.4617     0.7216 0.716 0.000 0.060 0.224 0.000
#> GSM494638     4  0.6326     0.5853 0.208 0.000 0.268 0.524 0.000
#> GSM494645     1  0.3461     0.7620 0.772 0.000 0.004 0.224 0.000
#> GSM494671     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.3210     0.7691 0.788 0.000 0.000 0.212 0.000
#> GSM494620     5  0.4101     0.7463 0.000 0.000 0.000 0.372 0.628
#> GSM494630     5  0.4101     0.7463 0.000 0.000 0.000 0.372 0.628
#> GSM494657     3  0.0000     0.9015 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494621     5  0.4101     0.7463 0.000 0.000 0.000 0.372 0.628
#> GSM494629     4  0.2732     0.8572 0.000 0.000 0.160 0.840 0.000
#> GSM494637     4  0.2690     0.8579 0.000 0.000 0.156 0.844 0.000
#> GSM494652     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494648     5  0.4101     0.7463 0.000 0.000 0.000 0.372 0.628
#> GSM494650     4  0.5010     0.7739 0.076 0.000 0.248 0.676 0.000
#> GSM494669     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.5060     0.6834 0.684 0.000 0.092 0.224 0.000
#> GSM494668     1  0.3305     0.7638 0.776 0.000 0.000 0.224 0.000
#> GSM494633     5  0.4161     0.7215 0.000 0.000 0.000 0.392 0.608
#> GSM494634     1  0.0000     0.8213 1.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.5500     0.6132 0.640 0.000 0.124 0.236 0.000
#> GSM494661     1  0.4424     0.7327 0.728 0.000 0.048 0.224 0.000
#> GSM494617     4  0.5510     0.7251 0.184 0.000 0.164 0.652 0.000
#> GSM494626     4  0.4521     0.8345 0.088 0.000 0.164 0.748 0.000
#> GSM494656     3  0.0000     0.9015 0.000 0.000 1.000 0.000 0.000
#> GSM494635     1  0.5500     0.6132 0.640 0.000 0.124 0.236 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
#> GSM494565     5  0.0000      0.986 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494594     3  0.0000      0.997 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     2  0.1075      0.801 0.000 0.952 0.000 0.048 0.000 0.000
#> GSM494564     5  0.0000      0.986 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494591     3  0.0000      0.997 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     3  0.0146      0.997 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494602     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494613     3  0.0146      0.997 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494589     5  0.0000      0.986 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494598     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494593     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494583     2  0.3309      0.721 0.000 0.720 0.280 0.000 0.000 0.000
#> GSM494612     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     3  0.0000      0.997 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494556     3  0.0146      0.997 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494559     5  0.0000      0.986 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494571     3  0.0000      0.997 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494614     2  0.3986      0.373 0.000 0.532 0.464 0.004 0.000 0.000
#> GSM494603     4  0.3848      0.562 0.000 0.004 0.292 0.692 0.012 0.000
#> GSM494568     4  0.3330      0.580 0.000 0.000 0.284 0.716 0.000 0.000
#> GSM494572     3  0.0000      0.997 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494600     5  0.0000      0.986 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494562     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494615     3  0.0458      0.982 0.000 0.000 0.984 0.016 0.000 0.000
#> GSM494582     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494599     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494610     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494587     2  0.2969      0.763 0.000 0.776 0.224 0.000 0.000 0.000
#> GSM494581     2  0.3309      0.721 0.000 0.720 0.280 0.000 0.000 0.000
#> GSM494580     3  0.0146      0.997 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494563     5  0.0000      0.986 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494576     2  0.3309      0.721 0.000 0.720 0.280 0.000 0.000 0.000
#> GSM494605     4  0.0458      0.904 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM494584     2  0.3309      0.721 0.000 0.720 0.280 0.000 0.000 0.000
#> GSM494586     2  0.2597      0.789 0.000 0.824 0.176 0.000 0.000 0.000
#> GSM494578     3  0.0146      0.997 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494585     2  0.2854      0.773 0.000 0.792 0.208 0.000 0.000 0.000
#> GSM494611     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494560     5  0.0000      0.986 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494595     2  0.0632      0.826 0.000 0.976 0.024 0.000 0.000 0.000
#> GSM494570     5  0.0000      0.986 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494597     3  0.0000      0.997 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494607     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494561     5  0.2277      0.849 0.000 0.000 0.000 0.076 0.892 0.032
#> GSM494569     4  0.0000      0.907 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494592     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494577     2  0.3309      0.721 0.000 0.720 0.280 0.000 0.000 0.000
#> GSM494588     5  0.0000      0.986 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494590     3  0.0000      0.997 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     2  0.3309      0.721 0.000 0.720 0.280 0.000 0.000 0.000
#> GSM494608     2  0.2969      0.763 0.000 0.776 0.224 0.000 0.000 0.000
#> GSM494606     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494574     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494573     5  0.0000      0.986 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494566     2  0.6032      0.312 0.000 0.424 0.284 0.292 0.000 0.000
#> GSM494601     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494557     3  0.0146      0.997 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494579     2  0.3309      0.721 0.000 0.720 0.280 0.000 0.000 0.000
#> GSM494596     3  0.0000      0.997 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0000      0.829 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     4  0.3531      0.531 0.000 0.000 0.000 0.672 0.000 0.328
#> GSM494654     3  0.0000      0.997 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494664     4  0.0458      0.904 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM494624     6  0.0000      0.963 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494651     4  0.0000      0.907 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494662     4  0.0146      0.907 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM494627     4  0.0146      0.907 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM494673     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.3531      0.531 0.000 0.000 0.000 0.672 0.000 0.328
#> GSM494658     2  0.3766      0.452 0.012 0.684 0.000 0.304 0.000 0.000
#> GSM494653     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.0363      0.905 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM494672     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0000      0.907 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494631     4  0.3647      0.449 0.000 0.000 0.360 0.640 0.000 0.000
#> GSM494619     6  0.0000      0.963 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0000      0.907 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494663     4  0.0146      0.907 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM494628     4  0.0146      0.907 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM494632     4  0.0260      0.906 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM494660     4  0.3531      0.531 0.000 0.000 0.000 0.672 0.000 0.328
#> GSM494622     4  0.0363      0.902 0.000 0.000 0.012 0.988 0.000 0.000
#> GSM494642     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.2854      0.716 0.792 0.000 0.000 0.208 0.000 0.000
#> GSM494675     3  0.0146      0.997 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494641     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.0146      0.907 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM494640     4  0.0146      0.907 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM494623     6  0.0000      0.963 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494644     4  0.3756      0.263 0.400 0.000 0.000 0.600 0.000 0.000
#> GSM494646     4  0.0458      0.904 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM494665     4  0.1075      0.883 0.048 0.000 0.000 0.952 0.000 0.000
#> GSM494638     4  0.0146      0.907 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM494645     4  0.0790      0.894 0.032 0.000 0.000 0.968 0.000 0.000
#> GSM494671     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.3330      0.627 0.716 0.000 0.000 0.284 0.000 0.000
#> GSM494620     6  0.0000      0.963 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494630     6  0.0146      0.960 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM494657     3  0.0000      0.997 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0000      0.963 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494629     4  0.0146      0.907 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM494637     4  0.0146      0.907 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM494652     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.0000      0.963 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494650     4  0.0000      0.907 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494669     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     4  0.0458      0.904 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM494668     1  0.3330      0.627 0.716 0.000 0.000 0.284 0.000 0.000
#> GSM494633     6  0.2527      0.743 0.000 0.000 0.000 0.168 0.000 0.832
#> GSM494634     1  0.0000      0.928 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     4  0.0458      0.904 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM494661     4  0.2300      0.786 0.144 0.000 0.000 0.856 0.000 0.000
#> GSM494617     4  0.0000      0.907 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494626     4  0.0000      0.907 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494656     3  0.0000      0.997 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494635     4  0.0458      0.904 0.016 0.000 0.000 0.984 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 3)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 4)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 5)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-mclust-collect-classes

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

test_to_known_factors(res)
#>             n disease.state(p)  age(p) other(p) individual(p) k
#> CV:mclust 118         9.24e-01 0.00742 9.41e-01      1.77e-05 2
#> CV:mclust 118         8.52e-16 0.33030 6.72e-09      1.36e-01 3
#> CV:mclust 116         1.14e-15 0.11295 1.24e-13      5.76e-02 4
#> CV:mclust 115         4.42e-15 0.11521 2.24e-11      7.20e-02 5
#> CV:mclust 115         1.52e-17 0.53558 9.96e-12      7.17e-01 6

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


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 51941 rows and 120 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 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-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.629           0.859       0.931         0.5008 0.499   0.499
#> 3 3 0.931           0.929       0.970         0.3264 0.681   0.447
#> 4 4 0.875           0.882       0.945         0.1264 0.754   0.406
#> 5 5 0.648           0.630       0.806         0.0541 0.808   0.405
#> 6 6 0.733           0.684       0.825         0.0368 0.883   0.538

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
#> GSM494565     2  0.0000      0.918 0.000 1.000
#> GSM494594     2  0.0000      0.918 0.000 1.000
#> GSM494604     1  0.0000      0.928 1.000 0.000
#> GSM494564     2  0.0000      0.918 0.000 1.000
#> GSM494591     2  0.0000      0.918 0.000 1.000
#> GSM494567     2  0.0000      0.918 0.000 1.000
#> GSM494602     1  0.2603      0.902 0.956 0.044
#> GSM494613     2  0.0000      0.918 0.000 1.000
#> GSM494589     2  0.0000      0.918 0.000 1.000
#> GSM494598     1  0.6973      0.779 0.812 0.188
#> GSM494593     1  0.7139      0.770 0.804 0.196
#> GSM494583     2  0.0000      0.918 0.000 1.000
#> GSM494612     1  0.1633      0.915 0.976 0.024
#> GSM494558     2  0.0000      0.918 0.000 1.000
#> GSM494556     2  0.0000      0.918 0.000 1.000
#> GSM494559     2  0.0000      0.918 0.000 1.000
#> GSM494571     2  0.0000      0.918 0.000 1.000
#> GSM494614     2  0.0000      0.918 0.000 1.000
#> GSM494603     2  0.0000      0.918 0.000 1.000
#> GSM494568     2  0.0000      0.918 0.000 1.000
#> GSM494572     2  0.0000      0.918 0.000 1.000
#> GSM494600     2  0.0000      0.918 0.000 1.000
#> GSM494562     1  0.9460      0.519 0.636 0.364
#> GSM494615     2  0.0000      0.918 0.000 1.000
#> GSM494582     1  0.4022      0.878 0.920 0.080
#> GSM494599     1  0.0376      0.926 0.996 0.004
#> GSM494610     1  0.7139      0.770 0.804 0.196
#> GSM494587     2  0.5408      0.809 0.124 0.876
#> GSM494581     1  0.8144      0.704 0.748 0.252
#> GSM494580     2  0.0000      0.918 0.000 1.000
#> GSM494563     2  0.0000      0.918 0.000 1.000
#> GSM494576     2  0.0000      0.918 0.000 1.000
#> GSM494605     1  0.0000      0.928 1.000 0.000
#> GSM494584     2  0.0000      0.918 0.000 1.000
#> GSM494586     1  0.8207      0.698 0.744 0.256
#> GSM494578     2  0.0000      0.918 0.000 1.000
#> GSM494585     1  0.9988      0.215 0.520 0.480
#> GSM494611     1  0.4690      0.862 0.900 0.100
#> GSM494560     2  0.0000      0.918 0.000 1.000
#> GSM494595     1  0.7299      0.761 0.796 0.204
#> GSM494570     2  0.0000      0.918 0.000 1.000
#> GSM494597     2  0.0000      0.918 0.000 1.000
#> GSM494607     1  0.0000      0.928 1.000 0.000
#> GSM494561     2  0.0000      0.918 0.000 1.000
#> GSM494569     2  0.8813      0.663 0.300 0.700
#> GSM494592     1  0.0000      0.928 1.000 0.000
#> GSM494577     2  0.0376      0.915 0.004 0.996
#> GSM494588     1  0.9608      0.477 0.616 0.384
#> GSM494590     2  0.0000      0.918 0.000 1.000
#> GSM494609     1  0.4431      0.870 0.908 0.092
#> GSM494608     1  0.0000      0.928 1.000 0.000
#> GSM494606     1  0.0000      0.928 1.000 0.000
#> GSM494574     1  0.6148      0.816 0.848 0.152
#> GSM494573     2  0.0000      0.918 0.000 1.000
#> GSM494566     2  0.4298      0.848 0.088 0.912
#> GSM494601     1  0.5842      0.827 0.860 0.140
#> GSM494557     2  0.0000      0.918 0.000 1.000
#> GSM494579     1  0.9661      0.459 0.608 0.392
#> GSM494596     2  0.0000      0.918 0.000 1.000
#> GSM494575     1  0.3733      0.884 0.928 0.072
#> GSM494625     2  0.7745      0.761 0.228 0.772
#> GSM494654     2  0.0376      0.916 0.004 0.996
#> GSM494664     1  0.0000      0.928 1.000 0.000
#> GSM494624     1  0.6247      0.765 0.844 0.156
#> GSM494651     2  0.7139      0.794 0.196 0.804
#> GSM494662     1  0.0000      0.928 1.000 0.000
#> GSM494627     2  0.6887      0.804 0.184 0.816
#> GSM494673     1  0.0000      0.928 1.000 0.000
#> GSM494649     2  0.7453      0.778 0.212 0.788
#> GSM494658     1  0.0000      0.928 1.000 0.000
#> GSM494653     1  0.0000      0.928 1.000 0.000
#> GSM494643     1  0.0000      0.928 1.000 0.000
#> GSM494672     1  0.0000      0.928 1.000 0.000
#> GSM494618     2  0.8386      0.709 0.268 0.732
#> GSM494631     2  0.0000      0.918 0.000 1.000
#> GSM494619     1  0.0000      0.928 1.000 0.000
#> GSM494674     1  0.0000      0.928 1.000 0.000
#> GSM494616     2  0.7602      0.770 0.220 0.780
#> GSM494663     2  0.8861      0.655 0.304 0.696
#> GSM494628     2  0.7139      0.794 0.196 0.804
#> GSM494632     1  0.0000      0.928 1.000 0.000
#> GSM494660     2  0.7376      0.783 0.208 0.792
#> GSM494622     2  0.7056      0.798 0.192 0.808
#> GSM494642     1  0.0000      0.928 1.000 0.000
#> GSM494647     1  0.0000      0.928 1.000 0.000
#> GSM494659     1  0.0000      0.928 1.000 0.000
#> GSM494670     1  0.0000      0.928 1.000 0.000
#> GSM494675     2  0.0000      0.918 0.000 1.000
#> GSM494641     1  0.0000      0.928 1.000 0.000
#> GSM494636     1  0.0000      0.928 1.000 0.000
#> GSM494640     2  0.7376      0.783 0.208 0.792
#> GSM494623     1  0.0000      0.928 1.000 0.000
#> GSM494644     1  0.0000      0.928 1.000 0.000
#> GSM494646     1  0.0000      0.928 1.000 0.000
#> GSM494665     1  0.0000      0.928 1.000 0.000
#> GSM494638     1  0.0000      0.928 1.000 0.000
#> GSM494645     1  0.0000      0.928 1.000 0.000
#> GSM494671     1  0.0000      0.928 1.000 0.000
#> GSM494655     1  0.0000      0.928 1.000 0.000
#> GSM494620     1  0.0000      0.928 1.000 0.000
#> GSM494630     1  0.0000      0.928 1.000 0.000
#> GSM494657     2  0.0000      0.918 0.000 1.000
#> GSM494667     1  0.0000      0.928 1.000 0.000
#> GSM494621     1  0.0000      0.928 1.000 0.000
#> GSM494629     2  0.5178      0.852 0.116 0.884
#> GSM494637     2  0.9044      0.627 0.320 0.680
#> GSM494652     1  0.0000      0.928 1.000 0.000
#> GSM494648     1  0.0000      0.928 1.000 0.000
#> GSM494650     2  0.7139      0.794 0.196 0.804
#> GSM494669     1  0.0000      0.928 1.000 0.000
#> GSM494666     1  0.0000      0.928 1.000 0.000
#> GSM494668     1  0.0000      0.928 1.000 0.000
#> GSM494633     2  0.9963      0.282 0.464 0.536
#> GSM494634     1  0.0000      0.928 1.000 0.000
#> GSM494639     1  0.0000      0.928 1.000 0.000
#> GSM494661     1  0.0000      0.928 1.000 0.000
#> GSM494617     1  0.1633      0.910 0.976 0.024
#> GSM494626     1  0.9635      0.247 0.612 0.388
#> GSM494656     2  0.0000      0.918 0.000 1.000
#> GSM494635     1  0.0000      0.928 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM494565     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494594     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494604     2  0.4291     0.7764 0.180 0.820 0.000
#> GSM494564     3  0.3941     0.8116 0.000 0.156 0.844
#> GSM494591     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494567     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494602     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494613     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494589     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494598     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494593     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494583     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494612     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494558     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494556     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494559     2  0.3551     0.8310 0.000 0.868 0.132
#> GSM494571     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494614     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494603     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494568     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494572     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494600     3  0.2537     0.8934 0.000 0.080 0.920
#> GSM494562     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494615     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494582     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494599     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494610     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494587     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494581     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494580     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494563     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494576     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494605     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494584     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494586     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494578     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494585     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494611     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494560     2  0.0237     0.9740 0.000 0.996 0.004
#> GSM494595     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494570     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494597     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494607     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494561     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494569     1  0.5926     0.4386 0.644 0.000 0.356
#> GSM494592     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494577     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494588     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494590     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494609     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494608     2  0.6045     0.3892 0.380 0.620 0.000
#> GSM494606     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494574     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494573     3  0.5560     0.5842 0.000 0.300 0.700
#> GSM494566     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494601     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494557     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494579     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494596     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494575     2  0.0000     0.9775 0.000 1.000 0.000
#> GSM494625     1  0.6302     0.0575 0.520 0.000 0.480
#> GSM494654     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494664     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494624     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494651     3  0.5178     0.6634 0.256 0.000 0.744
#> GSM494662     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494627     3  0.0237     0.9544 0.004 0.000 0.996
#> GSM494673     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494649     3  0.5760     0.5192 0.328 0.000 0.672
#> GSM494658     1  0.0237     0.9653 0.996 0.004 0.000
#> GSM494653     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494643     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494672     1  0.0237     0.9653 0.996 0.004 0.000
#> GSM494618     1  0.0592     0.9590 0.988 0.000 0.012
#> GSM494631     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494619     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494674     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494616     1  0.5254     0.6333 0.736 0.000 0.264
#> GSM494663     1  0.2448     0.8986 0.924 0.000 0.076
#> GSM494628     3  0.2711     0.8918 0.088 0.000 0.912
#> GSM494632     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494660     3  0.2959     0.8794 0.100 0.000 0.900
#> GSM494622     3  0.2537     0.8998 0.080 0.000 0.920
#> GSM494642     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494647     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494659     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494670     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494675     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494641     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494636     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494640     3  0.1860     0.9222 0.052 0.000 0.948
#> GSM494623     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494644     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494646     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494665     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494638     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494645     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494671     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494655     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494620     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494630     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494657     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494667     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494621     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494629     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494637     1  0.4178     0.7819 0.828 0.000 0.172
#> GSM494652     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494648     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494650     3  0.1163     0.9397 0.028 0.000 0.972
#> GSM494669     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494666     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494668     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494633     1  0.1289     0.9416 0.968 0.000 0.032
#> GSM494634     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494639     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494661     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494617     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494626     1  0.0000     0.9686 1.000 0.000 0.000
#> GSM494656     3  0.0000     0.9567 0.000 0.000 1.000
#> GSM494635     1  0.0000     0.9686 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
#> GSM494565     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494594     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494604     1  0.0000      0.883 1.000 0.000 0.000 0.000
#> GSM494564     2  0.0469      0.960 0.000 0.988 0.000 0.012
#> GSM494591     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494567     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494602     1  0.0469      0.879 0.988 0.012 0.000 0.000
#> GSM494613     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494589     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494598     2  0.0336      0.962 0.008 0.992 0.000 0.000
#> GSM494593     1  0.3837      0.676 0.776 0.224 0.000 0.000
#> GSM494583     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494612     1  0.0469      0.879 0.988 0.012 0.000 0.000
#> GSM494558     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494556     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494559     2  0.0469      0.960 0.000 0.988 0.000 0.012
#> GSM494571     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494614     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494603     2  0.0779      0.956 0.000 0.980 0.004 0.016
#> GSM494568     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494572     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494600     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494562     2  0.3942      0.695 0.236 0.764 0.000 0.000
#> GSM494615     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494582     1  0.2081      0.830 0.916 0.084 0.000 0.000
#> GSM494599     1  0.0188      0.882 0.996 0.004 0.000 0.000
#> GSM494610     2  0.0336      0.962 0.008 0.992 0.000 0.000
#> GSM494587     2  0.3266      0.797 0.168 0.832 0.000 0.000
#> GSM494581     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494580     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494563     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494576     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494605     4  0.2704      0.833 0.124 0.000 0.000 0.876
#> GSM494584     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494586     2  0.0188      0.964 0.004 0.996 0.000 0.000
#> GSM494578     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494585     2  0.0188      0.964 0.004 0.996 0.000 0.000
#> GSM494611     1  0.1474      0.855 0.948 0.052 0.000 0.000
#> GSM494560     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494595     2  0.0188      0.964 0.004 0.996 0.000 0.000
#> GSM494570     2  0.1557      0.922 0.000 0.944 0.000 0.056
#> GSM494597     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494607     1  0.0000      0.883 1.000 0.000 0.000 0.000
#> GSM494561     4  0.2868      0.803 0.000 0.136 0.000 0.864
#> GSM494569     3  0.1824      0.925 0.004 0.000 0.936 0.060
#> GSM494592     1  0.0000      0.883 1.000 0.000 0.000 0.000
#> GSM494577     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494588     2  0.0469      0.960 0.000 0.988 0.000 0.012
#> GSM494590     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494609     2  0.1637      0.920 0.060 0.940 0.000 0.000
#> GSM494608     1  0.0707      0.883 0.980 0.000 0.000 0.020
#> GSM494606     1  0.0000      0.883 1.000 0.000 0.000 0.000
#> GSM494574     2  0.3873      0.703 0.228 0.772 0.000 0.000
#> GSM494573     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494566     1  0.7251      0.431 0.536 0.192 0.272 0.000
#> GSM494601     1  0.0707      0.877 0.980 0.020 0.000 0.000
#> GSM494557     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494579     2  0.0000      0.966 0.000 1.000 0.000 0.000
#> GSM494596     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494575     1  0.1118      0.865 0.964 0.036 0.000 0.000
#> GSM494625     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494664     4  0.1637      0.892 0.060 0.000 0.000 0.940
#> GSM494624     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494651     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494662     4  0.0188      0.918 0.004 0.000 0.000 0.996
#> GSM494627     4  0.4222      0.640 0.000 0.000 0.272 0.728
#> GSM494673     1  0.0188      0.884 0.996 0.000 0.000 0.004
#> GSM494649     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494658     1  0.3123      0.790 0.844 0.000 0.000 0.156
#> GSM494653     1  0.4222      0.643 0.728 0.000 0.000 0.272
#> GSM494643     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494672     1  0.0000      0.883 1.000 0.000 0.000 0.000
#> GSM494618     4  0.4964      0.444 0.004 0.000 0.380 0.616
#> GSM494631     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494619     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494674     1  0.4356      0.609 0.708 0.000 0.000 0.292
#> GSM494616     3  0.2011      0.906 0.000 0.000 0.920 0.080
#> GSM494663     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494628     4  0.4866      0.367 0.000 0.000 0.404 0.596
#> GSM494632     4  0.0592      0.916 0.016 0.000 0.000 0.984
#> GSM494660     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494622     3  0.0188      0.989 0.000 0.000 0.996 0.004
#> GSM494642     1  0.4977      0.190 0.540 0.000 0.000 0.460
#> GSM494647     1  0.0817      0.882 0.976 0.000 0.000 0.024
#> GSM494659     1  0.0921      0.881 0.972 0.000 0.000 0.028
#> GSM494670     1  0.3356      0.770 0.824 0.000 0.000 0.176
#> GSM494675     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494641     4  0.4888      0.251 0.412 0.000 0.000 0.588
#> GSM494636     4  0.0469      0.917 0.012 0.000 0.000 0.988
#> GSM494640     4  0.0336      0.916 0.000 0.000 0.008 0.992
#> GSM494623     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494644     4  0.1389      0.900 0.048 0.000 0.000 0.952
#> GSM494646     4  0.0469      0.917 0.012 0.000 0.000 0.988
#> GSM494665     1  0.4898      0.328 0.584 0.000 0.000 0.416
#> GSM494638     4  0.0592      0.916 0.016 0.000 0.000 0.984
#> GSM494645     4  0.1022      0.909 0.032 0.000 0.000 0.968
#> GSM494671     1  0.0000      0.883 1.000 0.000 0.000 0.000
#> GSM494655     4  0.1716      0.889 0.064 0.000 0.000 0.936
#> GSM494620     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494630     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494657     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494667     1  0.0921      0.881 0.972 0.000 0.000 0.028
#> GSM494621     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494629     3  0.0469      0.981 0.000 0.000 0.988 0.012
#> GSM494637     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494652     1  0.1118      0.878 0.964 0.000 0.000 0.036
#> GSM494648     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494650     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494669     1  0.3528      0.752 0.808 0.000 0.000 0.192
#> GSM494666     4  0.1557      0.895 0.056 0.000 0.000 0.944
#> GSM494668     4  0.3873      0.691 0.228 0.000 0.000 0.772
#> GSM494633     4  0.0000      0.918 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.883 1.000 0.000 0.000 0.000
#> GSM494639     4  0.0469      0.917 0.012 0.000 0.000 0.988
#> GSM494661     4  0.3444      0.759 0.184 0.000 0.000 0.816
#> GSM494617     4  0.0817      0.913 0.024 0.000 0.000 0.976
#> GSM494626     4  0.3166      0.834 0.016 0.000 0.116 0.868
#> GSM494656     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM494635     4  0.0469      0.917 0.012 0.000 0.000 0.988

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     5  0.3336     0.6733 0.000 0.000 0.000 0.228 0.772
#> GSM494594     3  0.0000     0.8415 0.000 0.000 1.000 0.000 0.000
#> GSM494604     2  0.0798     0.7170 0.016 0.976 0.000 0.000 0.008
#> GSM494564     4  0.2127     0.5472 0.000 0.000 0.000 0.892 0.108
#> GSM494591     3  0.0000     0.8415 0.000 0.000 1.000 0.000 0.000
#> GSM494567     3  0.1877     0.8259 0.000 0.000 0.924 0.012 0.064
#> GSM494602     2  0.1197     0.7008 0.000 0.952 0.000 0.000 0.048
#> GSM494613     3  0.5110     0.6995 0.000 0.016 0.728 0.116 0.140
#> GSM494589     4  0.2732     0.4969 0.000 0.000 0.000 0.840 0.160
#> GSM494598     2  0.6133     0.2670 0.000 0.524 0.000 0.148 0.328
#> GSM494593     5  0.2773     0.7276 0.000 0.164 0.000 0.000 0.836
#> GSM494583     5  0.1831     0.7877 0.000 0.004 0.000 0.076 0.920
#> GSM494612     2  0.2230     0.6728 0.000 0.884 0.000 0.000 0.116
#> GSM494558     3  0.1908     0.8032 0.000 0.000 0.908 0.092 0.000
#> GSM494556     3  0.2563     0.7960 0.000 0.000 0.872 0.120 0.008
#> GSM494559     5  0.2648     0.7413 0.000 0.000 0.000 0.152 0.848
#> GSM494571     3  0.0000     0.8415 0.000 0.000 1.000 0.000 0.000
#> GSM494614     5  0.2970     0.7740 0.000 0.004 0.000 0.168 0.828
#> GSM494603     4  0.3039     0.5326 0.000 0.012 0.000 0.836 0.152
#> GSM494568     4  0.4337     0.4536 0.000 0.016 0.284 0.696 0.004
#> GSM494572     3  0.0671     0.8396 0.000 0.000 0.980 0.016 0.004
#> GSM494600     4  0.3039     0.4616 0.000 0.000 0.000 0.808 0.192
#> GSM494562     2  0.5617     0.4246 0.000 0.620 0.000 0.124 0.256
#> GSM494615     3  0.3123     0.7604 0.000 0.000 0.812 0.184 0.004
#> GSM494582     2  0.2189     0.6793 0.000 0.904 0.000 0.012 0.084
#> GSM494599     2  0.1571     0.7204 0.060 0.936 0.000 0.000 0.004
#> GSM494610     2  0.6287     0.2590 0.000 0.512 0.000 0.176 0.312
#> GSM494587     5  0.3336     0.7621 0.000 0.144 0.008 0.016 0.832
#> GSM494581     5  0.1981     0.7899 0.000 0.016 0.000 0.064 0.920
#> GSM494580     3  0.1764     0.8272 0.000 0.000 0.928 0.008 0.064
#> GSM494563     4  0.4138     0.4058 0.000 0.016 0.000 0.708 0.276
#> GSM494576     5  0.3527     0.7631 0.000 0.056 0.000 0.116 0.828
#> GSM494605     1  0.0609     0.8195 0.980 0.020 0.000 0.000 0.000
#> GSM494584     5  0.1074     0.7977 0.000 0.016 0.004 0.012 0.968
#> GSM494586     5  0.4386     0.7297 0.000 0.096 0.000 0.140 0.764
#> GSM494578     3  0.5292     0.5854 0.000 0.016 0.656 0.052 0.276
#> GSM494585     5  0.2378     0.7890 0.000 0.048 0.000 0.048 0.904
#> GSM494611     2  0.2077     0.6834 0.000 0.908 0.000 0.008 0.084
#> GSM494560     5  0.4291     0.3578 0.000 0.000 0.000 0.464 0.536
#> GSM494595     5  0.2983     0.7804 0.000 0.076 0.000 0.056 0.868
#> GSM494570     4  0.1502     0.5733 0.004 0.000 0.000 0.940 0.056
#> GSM494597     3  0.3152     0.7603 0.000 0.000 0.840 0.136 0.024
#> GSM494607     2  0.0510     0.7172 0.016 0.984 0.000 0.000 0.000
#> GSM494561     4  0.2293     0.6259 0.084 0.000 0.000 0.900 0.016
#> GSM494569     3  0.3949     0.5150 0.332 0.000 0.668 0.000 0.000
#> GSM494592     2  0.2104     0.7178 0.060 0.916 0.000 0.000 0.024
#> GSM494577     5  0.4333     0.7124 0.000 0.060 0.000 0.188 0.752
#> GSM494588     4  0.4291    -0.1962 0.000 0.000 0.000 0.536 0.464
#> GSM494590     3  0.0000     0.8415 0.000 0.000 1.000 0.000 0.000
#> GSM494609     5  0.2664     0.7836 0.004 0.064 0.000 0.040 0.892
#> GSM494608     1  0.6696     0.0243 0.432 0.148 0.000 0.016 0.404
#> GSM494606     2  0.4497     0.6040 0.060 0.732 0.000 0.000 0.208
#> GSM494574     2  0.5954     0.3719 0.000 0.576 0.000 0.152 0.272
#> GSM494573     4  0.3366     0.4032 0.000 0.000 0.000 0.768 0.232
#> GSM494566     2  0.6598     0.5323 0.012 0.644 0.128 0.064 0.152
#> GSM494601     5  0.4275     0.5807 0.020 0.284 0.000 0.000 0.696
#> GSM494557     3  0.5115     0.6490 0.000 0.012 0.696 0.068 0.224
#> GSM494579     4  0.5425    -0.0905 0.000 0.060 0.000 0.520 0.420
#> GSM494596     3  0.0000     0.8415 0.000 0.000 1.000 0.000 0.000
#> GSM494575     5  0.3913     0.5569 0.000 0.324 0.000 0.000 0.676
#> GSM494625     4  0.3913     0.5452 0.324 0.000 0.000 0.676 0.000
#> GSM494654     3  0.0000     0.8415 0.000 0.000 1.000 0.000 0.000
#> GSM494664     1  0.1701     0.8098 0.936 0.048 0.000 0.016 0.000
#> GSM494624     4  0.3508     0.6041 0.252 0.000 0.000 0.748 0.000
#> GSM494651     3  0.0451     0.8403 0.004 0.000 0.988 0.008 0.000
#> GSM494662     1  0.1608     0.7833 0.928 0.000 0.000 0.072 0.000
#> GSM494627     3  0.6301     0.2962 0.308 0.000 0.512 0.180 0.000
#> GSM494673     2  0.4101     0.3709 0.372 0.628 0.000 0.000 0.000
#> GSM494649     4  0.3796     0.5587 0.300 0.000 0.000 0.700 0.000
#> GSM494658     2  0.3305     0.6176 0.224 0.776 0.000 0.000 0.000
#> GSM494653     1  0.2732     0.7379 0.840 0.160 0.000 0.000 0.000
#> GSM494643     1  0.1671     0.7802 0.924 0.000 0.000 0.076 0.000
#> GSM494672     2  0.1792     0.7171 0.084 0.916 0.000 0.000 0.000
#> GSM494618     3  0.4455     0.6550 0.188 0.000 0.744 0.068 0.000
#> GSM494631     3  0.0510     0.8402 0.000 0.000 0.984 0.016 0.000
#> GSM494619     4  0.4015     0.5193 0.348 0.000 0.000 0.652 0.000
#> GSM494674     1  0.2074     0.7790 0.896 0.104 0.000 0.000 0.000
#> GSM494616     3  0.3171     0.7193 0.176 0.000 0.816 0.008 0.000
#> GSM494663     4  0.4268     0.3099 0.444 0.000 0.000 0.556 0.000
#> GSM494628     3  0.6381     0.1510 0.172 0.000 0.464 0.364 0.000
#> GSM494632     1  0.0162     0.8197 0.996 0.004 0.000 0.000 0.000
#> GSM494660     4  0.3816     0.5533 0.304 0.000 0.000 0.696 0.000
#> GSM494622     3  0.4402     0.4356 0.012 0.000 0.636 0.352 0.000
#> GSM494642     1  0.1544     0.8037 0.932 0.068 0.000 0.000 0.000
#> GSM494647     1  0.4088     0.4072 0.632 0.368 0.000 0.000 0.000
#> GSM494659     2  0.4201     0.2831 0.408 0.592 0.000 0.000 0.000
#> GSM494670     2  0.4141     0.6005 0.236 0.736 0.000 0.028 0.000
#> GSM494675     4  0.4919     0.3010 0.000 0.012 0.368 0.604 0.016
#> GSM494641     1  0.0794     0.8181 0.972 0.028 0.000 0.000 0.000
#> GSM494636     1  0.1671     0.7802 0.924 0.000 0.000 0.076 0.000
#> GSM494640     1  0.1956     0.7788 0.916 0.000 0.008 0.076 0.000
#> GSM494623     4  0.3752     0.5833 0.292 0.000 0.000 0.708 0.000
#> GSM494644     1  0.0404     0.8201 0.988 0.012 0.000 0.000 0.000
#> GSM494646     1  0.0880     0.8080 0.968 0.000 0.000 0.032 0.000
#> GSM494665     1  0.3999     0.4690 0.656 0.344 0.000 0.000 0.000
#> GSM494638     1  0.0671     0.8149 0.980 0.000 0.004 0.016 0.000
#> GSM494645     1  0.0290     0.8201 0.992 0.008 0.000 0.000 0.000
#> GSM494671     2  0.1671     0.7178 0.076 0.924 0.000 0.000 0.000
#> GSM494655     1  0.0510     0.8201 0.984 0.016 0.000 0.000 0.000
#> GSM494620     1  0.4161     0.2121 0.608 0.000 0.000 0.392 0.000
#> GSM494630     1  0.2377     0.7534 0.872 0.000 0.000 0.128 0.000
#> GSM494657     3  0.0000     0.8415 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.4126     0.3786 0.620 0.380 0.000 0.000 0.000
#> GSM494621     4  0.3796     0.5736 0.300 0.000 0.000 0.700 0.000
#> GSM494629     3  0.2580     0.7974 0.064 0.000 0.892 0.044 0.000
#> GSM494637     1  0.1671     0.7802 0.924 0.000 0.000 0.076 0.000
#> GSM494652     1  0.3424     0.6314 0.760 0.240 0.000 0.000 0.000
#> GSM494648     4  0.4101     0.4789 0.372 0.000 0.000 0.628 0.000
#> GSM494650     3  0.0510     0.8390 0.000 0.000 0.984 0.016 0.000
#> GSM494669     1  0.3274     0.6721 0.780 0.220 0.000 0.000 0.000
#> GSM494666     1  0.0510     0.8201 0.984 0.016 0.000 0.000 0.000
#> GSM494668     1  0.4874     0.3442 0.600 0.368 0.000 0.032 0.000
#> GSM494633     1  0.4278     0.1134 0.548 0.000 0.000 0.452 0.000
#> GSM494634     2  0.4192     0.3002 0.404 0.596 0.000 0.000 0.000
#> GSM494639     1  0.0162     0.8182 0.996 0.000 0.000 0.004 0.000
#> GSM494661     1  0.0510     0.8201 0.984 0.016 0.000 0.000 0.000
#> GSM494617     1  0.0854     0.8192 0.976 0.012 0.004 0.008 0.000
#> GSM494626     1  0.4841     0.5587 0.716 0.012 0.220 0.052 0.000
#> GSM494656     3  0.0000     0.8415 0.000 0.000 1.000 0.000 0.000
#> GSM494635     1  0.0404     0.8161 0.988 0.000 0.000 0.012 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
#> GSM494565     5  0.2520     0.8704 0.000 0.152 0.000 0.000 0.844 0.004
#> GSM494594     3  0.0260     0.8542 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM494604     4  0.3596     0.7213 0.040 0.004 0.000 0.796 0.156 0.004
#> GSM494564     6  0.3394     0.5890 0.000 0.024 0.000 0.000 0.200 0.776
#> GSM494591     3  0.0146     0.8543 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM494567     3  0.0692     0.8515 0.000 0.020 0.976 0.004 0.000 0.000
#> GSM494602     4  0.1219     0.7675 0.000 0.048 0.000 0.948 0.004 0.000
#> GSM494613     2  0.4267     0.6873 0.000 0.760 0.120 0.000 0.016 0.104
#> GSM494589     6  0.3938     0.5348 0.000 0.044 0.000 0.000 0.228 0.728
#> GSM494598     5  0.3307     0.8677 0.000 0.108 0.000 0.072 0.820 0.000
#> GSM494593     2  0.2402     0.7492 0.000 0.868 0.000 0.120 0.012 0.000
#> GSM494583     5  0.2969     0.8109 0.000 0.224 0.000 0.000 0.776 0.000
#> GSM494612     4  0.3996    -0.1612 0.000 0.484 0.000 0.512 0.004 0.000
#> GSM494558     3  0.2932     0.7900 0.000 0.020 0.868 0.004 0.028 0.080
#> GSM494556     3  0.6379     0.1638 0.000 0.164 0.460 0.004 0.028 0.344
#> GSM494559     2  0.2790     0.7253 0.000 0.844 0.000 0.000 0.024 0.132
#> GSM494571     3  0.0653     0.8527 0.000 0.004 0.980 0.000 0.012 0.004
#> GSM494614     2  0.4059     0.6339 0.000 0.768 0.024 0.004 0.172 0.032
#> GSM494603     5  0.4109     0.1845 0.000 0.024 0.000 0.000 0.648 0.328
#> GSM494568     6  0.6279     0.3315 0.000 0.024 0.316 0.008 0.152 0.500
#> GSM494572     3  0.0870     0.8507 0.000 0.004 0.972 0.000 0.012 0.012
#> GSM494600     6  0.4135     0.4635 0.000 0.032 0.000 0.000 0.300 0.668
#> GSM494562     5  0.3612     0.8488 0.000 0.104 0.000 0.100 0.796 0.000
#> GSM494615     6  0.3201     0.6778 0.000 0.040 0.072 0.004 0.028 0.856
#> GSM494582     4  0.1649     0.7673 0.000 0.032 0.000 0.932 0.036 0.000
#> GSM494599     4  0.0405     0.7781 0.004 0.008 0.000 0.988 0.000 0.000
#> GSM494610     5  0.2747     0.8743 0.000 0.096 0.000 0.044 0.860 0.000
#> GSM494587     2  0.2643     0.7618 0.000 0.888 0.036 0.040 0.036 0.000
#> GSM494581     2  0.1082     0.7590 0.000 0.956 0.000 0.000 0.040 0.004
#> GSM494580     3  0.0405     0.8540 0.000 0.008 0.988 0.004 0.000 0.000
#> GSM494563     5  0.2685     0.8348 0.000 0.060 0.000 0.000 0.868 0.072
#> GSM494576     5  0.2946     0.8593 0.000 0.176 0.000 0.012 0.812 0.000
#> GSM494605     1  0.1003     0.8642 0.964 0.004 0.000 0.028 0.004 0.000
#> GSM494584     2  0.3776     0.6302 0.000 0.756 0.048 0.000 0.196 0.000
#> GSM494586     5  0.3102     0.8696 0.000 0.156 0.000 0.028 0.816 0.000
#> GSM494578     2  0.2969     0.6626 0.000 0.776 0.224 0.000 0.000 0.000
#> GSM494585     2  0.1794     0.7629 0.000 0.924 0.000 0.040 0.036 0.000
#> GSM494611     4  0.0909     0.7770 0.000 0.020 0.000 0.968 0.012 0.000
#> GSM494560     6  0.5650     0.2075 0.000 0.168 0.000 0.000 0.332 0.500
#> GSM494595     2  0.4428     0.1721 0.000 0.580 0.000 0.032 0.388 0.000
#> GSM494570     6  0.1682     0.6924 0.000 0.020 0.000 0.000 0.052 0.928
#> GSM494597     3  0.3000     0.7367 0.000 0.016 0.824 0.000 0.156 0.004
#> GSM494607     4  0.2306     0.7599 0.016 0.004 0.000 0.888 0.092 0.000
#> GSM494561     6  0.0806     0.7010 0.000 0.020 0.000 0.000 0.008 0.972
#> GSM494569     3  0.4432     0.2549 0.444 0.008 0.536 0.004 0.008 0.000
#> GSM494592     4  0.2234     0.7069 0.004 0.124 0.000 0.872 0.000 0.000
#> GSM494577     5  0.2300     0.8747 0.000 0.144 0.000 0.000 0.856 0.000
#> GSM494588     2  0.5149     0.4506 0.000 0.624 0.000 0.000 0.192 0.184
#> GSM494590     3  0.0146     0.8545 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM494609     2  0.1498     0.7646 0.000 0.940 0.000 0.028 0.032 0.000
#> GSM494608     2  0.3405     0.6812 0.112 0.812 0.000 0.076 0.000 0.000
#> GSM494606     2  0.3240     0.6332 0.004 0.752 0.000 0.244 0.000 0.000
#> GSM494574     5  0.3103     0.8687 0.000 0.100 0.000 0.064 0.836 0.000
#> GSM494573     6  0.4666     0.2715 0.000 0.048 0.000 0.000 0.388 0.564
#> GSM494566     4  0.6122     0.5519 0.008 0.028 0.176 0.636 0.120 0.032
#> GSM494601     2  0.3905     0.5086 0.000 0.668 0.000 0.316 0.016 0.000
#> GSM494557     2  0.3473     0.6726 0.000 0.780 0.192 0.000 0.024 0.004
#> GSM494579     5  0.2266     0.8724 0.000 0.108 0.000 0.000 0.880 0.012
#> GSM494596     3  0.0291     0.8543 0.000 0.004 0.992 0.000 0.000 0.004
#> GSM494575     2  0.3240     0.6506 0.000 0.752 0.000 0.244 0.004 0.000
#> GSM494625     6  0.2711     0.6954 0.036 0.008 0.000 0.000 0.084 0.872
#> GSM494654     3  0.0146     0.8544 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494664     1  0.3931     0.7691 0.812 0.024 0.000 0.028 0.104 0.032
#> GSM494624     6  0.1649     0.7064 0.032 0.000 0.000 0.000 0.036 0.932
#> GSM494651     3  0.2954     0.8116 0.036 0.020 0.884 0.004 0.028 0.028
#> GSM494662     1  0.0291     0.8645 0.992 0.004 0.000 0.004 0.000 0.000
#> GSM494627     1  0.7680     0.0343 0.392 0.020 0.260 0.004 0.092 0.232
#> GSM494673     1  0.3789     0.3830 0.584 0.000 0.000 0.416 0.000 0.000
#> GSM494649     6  0.1364     0.7065 0.020 0.012 0.000 0.000 0.016 0.952
#> GSM494658     4  0.6461     0.0866 0.388 0.016 0.000 0.428 0.148 0.020
#> GSM494653     1  0.2092     0.8216 0.876 0.000 0.000 0.124 0.000 0.000
#> GSM494643     1  0.1296     0.8489 0.948 0.004 0.000 0.000 0.004 0.044
#> GSM494672     4  0.0790     0.7759 0.032 0.000 0.000 0.968 0.000 0.000
#> GSM494618     3  0.6675     0.4523 0.244 0.024 0.560 0.008 0.052 0.112
#> GSM494631     3  0.0767     0.8536 0.000 0.008 0.976 0.004 0.012 0.000
#> GSM494619     6  0.4559     0.6050 0.184 0.008 0.000 0.000 0.096 0.712
#> GSM494674     1  0.1141     0.8568 0.948 0.000 0.000 0.052 0.000 0.000
#> GSM494616     3  0.5626     0.2908 0.404 0.020 0.516 0.004 0.028 0.028
#> GSM494663     6  0.6003     0.0965 0.416 0.020 0.000 0.004 0.116 0.444
#> GSM494628     6  0.5741     0.6250 0.052 0.032 0.092 0.008 0.120 0.696
#> GSM494632     1  0.0146     0.8649 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM494660     6  0.1364     0.7043 0.012 0.020 0.000 0.000 0.016 0.952
#> GSM494622     6  0.5853     0.5047 0.004 0.032 0.224 0.004 0.124 0.612
#> GSM494642     1  0.0790     0.8622 0.968 0.000 0.000 0.032 0.000 0.000
#> GSM494647     1  0.1957     0.8304 0.888 0.000 0.000 0.112 0.000 0.000
#> GSM494659     1  0.2854     0.7489 0.792 0.000 0.000 0.208 0.000 0.000
#> GSM494670     4  0.4662     0.6641 0.048 0.012 0.000 0.760 0.112 0.068
#> GSM494675     6  0.5955     0.2545 0.000 0.020 0.368 0.004 0.116 0.492
#> GSM494641     1  0.0363     0.8651 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM494636     1  0.0405     0.8642 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM494640     1  0.2507     0.8239 0.888 0.004 0.072 0.004 0.000 0.032
#> GSM494623     6  0.3286     0.6858 0.044 0.012 0.000 0.000 0.112 0.832
#> GSM494644     1  0.0146     0.8651 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494646     1  0.0146     0.8649 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM494665     1  0.3244     0.6770 0.732 0.000 0.000 0.268 0.000 0.000
#> GSM494638     1  0.0951     0.8599 0.968 0.008 0.020 0.004 0.000 0.000
#> GSM494645     1  0.0291     0.8653 0.992 0.000 0.000 0.004 0.004 0.000
#> GSM494671     4  0.1204     0.7662 0.056 0.000 0.000 0.944 0.000 0.000
#> GSM494655     1  0.0146     0.8651 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494620     1  0.4086     0.1210 0.528 0.008 0.000 0.000 0.000 0.464
#> GSM494630     1  0.1745     0.8384 0.920 0.012 0.000 0.000 0.000 0.068
#> GSM494657     3  0.0146     0.8545 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM494667     1  0.2562     0.7844 0.828 0.000 0.000 0.172 0.000 0.000
#> GSM494621     6  0.2476     0.7019 0.072 0.008 0.000 0.000 0.032 0.888
#> GSM494629     3  0.2499     0.7809 0.096 0.004 0.880 0.004 0.000 0.016
#> GSM494637     1  0.1396     0.8545 0.952 0.008 0.012 0.004 0.000 0.024
#> GSM494652     1  0.1267     0.8535 0.940 0.000 0.000 0.060 0.000 0.000
#> GSM494648     6  0.5048     0.3717 0.344 0.008 0.000 0.000 0.068 0.580
#> GSM494650     3  0.2139     0.8243 0.000 0.020 0.920 0.008 0.024 0.028
#> GSM494669     1  0.1957     0.8296 0.888 0.000 0.000 0.112 0.000 0.000
#> GSM494666     1  0.0748     0.8641 0.976 0.004 0.000 0.004 0.016 0.000
#> GSM494668     1  0.7067     0.3218 0.500 0.012 0.000 0.192 0.100 0.196
#> GSM494633     6  0.3450     0.6187 0.188 0.032 0.000 0.000 0.000 0.780
#> GSM494634     1  0.3050     0.6833 0.764 0.000 0.000 0.236 0.000 0.000
#> GSM494639     1  0.0291     0.8653 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM494661     1  0.0146     0.8651 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494617     1  0.2170     0.8424 0.920 0.020 0.004 0.004 0.028 0.024
#> GSM494626     1  0.6163     0.5835 0.648 0.028 0.136 0.008 0.048 0.132
#> GSM494656     3  0.0146     0.8544 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494635     1  0.0146     0.8649 0.996 0.000 0.000 0.000 0.000 0.004

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 3)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-NMF-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-NMF-collect-classes

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

test_to_known_factors(res)
#>          n disease.state(p) age(p) other(p) individual(p) k
#> CV:NMF 115         3.85e-03 0.0792 3.26e-02        0.0219 2
#> CV:NMF 117         1.01e-17 0.8216 5.65e-15        0.8257 3
#> CV:NMF 114         6.18e-12 0.2676 2.12e-09        0.1872 4
#> CV:NMF  92         8.22e-09 0.1537 1.49e-05        0.0493 5
#> CV:NMF 100         3.81e-11 0.1354 2.25e-07        0.0887 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 51941 rows and 120 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 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-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.322           0.703       0.813         0.4835 0.498   0.498
#> 3 3 0.521           0.735       0.814         0.2733 0.798   0.616
#> 4 4 0.629           0.819       0.847         0.1833 0.870   0.641
#> 5 5 0.772           0.818       0.874         0.0725 0.955   0.823
#> 6 6 0.808           0.740       0.803         0.0344 0.956   0.806

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
#> GSM494565     2   0.871     0.3215 0.292 0.708
#> GSM494594     2   0.000     0.7469 0.000 1.000
#> GSM494604     1   0.625     0.7717 0.844 0.156
#> GSM494564     2   0.000     0.7469 0.000 1.000
#> GSM494591     2   0.000     0.7469 0.000 1.000
#> GSM494567     2   0.000     0.7469 0.000 1.000
#> GSM494602     1   0.795     0.7377 0.760 0.240
#> GSM494613     2   0.000     0.7469 0.000 1.000
#> GSM494589     2   0.000     0.7469 0.000 1.000
#> GSM494598     1   0.795     0.7377 0.760 0.240
#> GSM494593     1   0.738     0.7550 0.792 0.208
#> GSM494583     2   0.969    -0.0332 0.396 0.604
#> GSM494612     1   0.795     0.7377 0.760 0.240
#> GSM494558     2   0.913     0.7201 0.328 0.672
#> GSM494556     2   0.000     0.7469 0.000 1.000
#> GSM494559     2   0.260     0.7471 0.044 0.956
#> GSM494571     2   0.000     0.7469 0.000 1.000
#> GSM494614     2   0.000     0.7469 0.000 1.000
#> GSM494603     2   0.917     0.7196 0.332 0.668
#> GSM494568     2   0.917     0.7196 0.332 0.668
#> GSM494572     2   0.000     0.7469 0.000 1.000
#> GSM494600     2   0.000     0.7469 0.000 1.000
#> GSM494562     1   0.795     0.7377 0.760 0.240
#> GSM494615     2   0.000     0.7469 0.000 1.000
#> GSM494582     1   0.795     0.7377 0.760 0.240
#> GSM494599     1   0.738     0.7550 0.792 0.208
#> GSM494610     1   0.795     0.7377 0.760 0.240
#> GSM494587     1   0.952     0.6283 0.628 0.372
#> GSM494581     1   0.932     0.6462 0.652 0.348
#> GSM494580     2   0.000     0.7469 0.000 1.000
#> GSM494563     2   0.662     0.5842 0.172 0.828
#> GSM494576     1   0.921     0.6723 0.664 0.336
#> GSM494605     1   0.443     0.7384 0.908 0.092
#> GSM494584     2   0.706     0.5325 0.192 0.808
#> GSM494586     1   0.861     0.7167 0.716 0.284
#> GSM494578     2   0.000     0.7469 0.000 1.000
#> GSM494585     1   0.952     0.6283 0.628 0.372
#> GSM494611     1   0.795     0.7377 0.760 0.240
#> GSM494560     2   0.000     0.7469 0.000 1.000
#> GSM494595     1   0.808     0.7355 0.752 0.248
#> GSM494570     2   0.260     0.7471 0.044 0.956
#> GSM494597     2   0.000     0.7469 0.000 1.000
#> GSM494607     1   0.625     0.7717 0.844 0.156
#> GSM494561     2   0.260     0.7471 0.044 0.956
#> GSM494569     2   0.921     0.7180 0.336 0.664
#> GSM494592     1   0.738     0.7550 0.792 0.208
#> GSM494577     2   0.990    -0.1836 0.440 0.560
#> GSM494588     2   0.260     0.7471 0.044 0.956
#> GSM494590     2   0.000     0.7469 0.000 1.000
#> GSM494609     1   0.932     0.6462 0.652 0.348
#> GSM494608     1   0.932     0.6462 0.652 0.348
#> GSM494606     1   0.745     0.7531 0.788 0.212
#> GSM494574     1   0.795     0.7377 0.760 0.240
#> GSM494573     2   0.000     0.7469 0.000 1.000
#> GSM494566     1   0.929     0.6441 0.656 0.344
#> GSM494601     1   0.891     0.6916 0.692 0.308
#> GSM494557     2   0.000     0.7469 0.000 1.000
#> GSM494579     1   0.929     0.6441 0.656 0.344
#> GSM494596     2   0.000     0.7469 0.000 1.000
#> GSM494575     1   0.795     0.7377 0.760 0.240
#> GSM494625     2   0.925     0.7169 0.340 0.660
#> GSM494654     2   0.000     0.7469 0.000 1.000
#> GSM494664     1   0.443     0.7384 0.908 0.092
#> GSM494624     2   0.925     0.7169 0.340 0.660
#> GSM494651     2   0.925     0.7169 0.340 0.660
#> GSM494662     2   0.958     0.6606 0.380 0.620
#> GSM494627     2   0.917     0.7196 0.332 0.668
#> GSM494673     1   0.000     0.7830 1.000 0.000
#> GSM494649     2   0.925     0.7169 0.340 0.660
#> GSM494658     1   0.000     0.7830 1.000 0.000
#> GSM494653     1   0.000     0.7830 1.000 0.000
#> GSM494643     2   0.925     0.7169 0.340 0.660
#> GSM494672     1   0.000     0.7830 1.000 0.000
#> GSM494618     2   0.925     0.7169 0.340 0.660
#> GSM494631     2   0.184     0.7484 0.028 0.972
#> GSM494619     2   0.925     0.7169 0.340 0.660
#> GSM494674     1   0.000     0.7830 1.000 0.000
#> GSM494616     2   0.925     0.7169 0.340 0.660
#> GSM494663     2   0.917     0.7196 0.332 0.668
#> GSM494628     2   0.925     0.7169 0.340 0.660
#> GSM494632     1   0.552     0.6977 0.872 0.128
#> GSM494660     2   0.925     0.7169 0.340 0.660
#> GSM494622     2   0.921     0.7180 0.336 0.664
#> GSM494642     1   0.000     0.7830 1.000 0.000
#> GSM494647     1   0.000     0.7830 1.000 0.000
#> GSM494659     1   0.000     0.7830 1.000 0.000
#> GSM494670     1   0.000     0.7830 1.000 0.000
#> GSM494675     2   0.000     0.7469 0.000 1.000
#> GSM494641     1   0.000     0.7830 1.000 0.000
#> GSM494636     1   0.886     0.3183 0.696 0.304
#> GSM494640     2   0.925     0.7169 0.340 0.660
#> GSM494623     2   0.925     0.7169 0.340 0.660
#> GSM494644     1   0.456     0.7346 0.904 0.096
#> GSM494646     1   0.456     0.7346 0.904 0.096
#> GSM494665     1   0.443     0.7384 0.908 0.092
#> GSM494638     1   0.895     0.2934 0.688 0.312
#> GSM494645     1   0.456     0.7346 0.904 0.096
#> GSM494671     1   0.000     0.7830 1.000 0.000
#> GSM494655     1   0.000     0.7830 1.000 0.000
#> GSM494620     2   0.925     0.7169 0.340 0.660
#> GSM494630     2   0.925     0.7169 0.340 0.660
#> GSM494657     2   0.000     0.7469 0.000 1.000
#> GSM494667     1   0.000     0.7830 1.000 0.000
#> GSM494621     2   0.925     0.7169 0.340 0.660
#> GSM494629     2   0.921     0.7180 0.336 0.664
#> GSM494637     2   0.925     0.7169 0.340 0.660
#> GSM494652     1   0.000     0.7830 1.000 0.000
#> GSM494648     2   0.925     0.7169 0.340 0.660
#> GSM494650     2   0.925     0.7169 0.340 0.660
#> GSM494669     1   0.000     0.7830 1.000 0.000
#> GSM494666     1   0.443     0.7384 0.908 0.092
#> GSM494668     1   0.000     0.7830 1.000 0.000
#> GSM494633     2   0.925     0.7169 0.340 0.660
#> GSM494634     1   0.000     0.7830 1.000 0.000
#> GSM494639     1   0.886     0.3183 0.696 0.304
#> GSM494661     1   0.443     0.7384 0.908 0.092
#> GSM494617     2   0.925     0.7169 0.340 0.660
#> GSM494626     2   0.925     0.7169 0.340 0.660
#> GSM494656     2   0.000     0.7469 0.000 1.000
#> GSM494635     1   0.456     0.7346 0.904 0.096

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM494565     3  0.9462     0.3200 0.180 0.400 0.420
#> GSM494594     3  0.0000     0.7310 0.000 0.000 1.000
#> GSM494604     2  0.3192     0.7305 0.112 0.888 0.000
#> GSM494564     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494591     3  0.0000     0.7310 0.000 0.000 1.000
#> GSM494567     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494602     2  0.0000     0.7169 0.000 1.000 0.000
#> GSM494613     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494589     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494598     2  0.0000     0.7169 0.000 1.000 0.000
#> GSM494593     2  0.1753     0.7287 0.048 0.952 0.000
#> GSM494583     2  0.8571     0.0771 0.112 0.548 0.340
#> GSM494612     2  0.0000     0.7169 0.000 1.000 0.000
#> GSM494558     1  0.0747     0.9279 0.984 0.000 0.016
#> GSM494556     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494559     3  0.5785     0.7742 0.332 0.000 0.668
#> GSM494571     3  0.0000     0.7310 0.000 0.000 1.000
#> GSM494614     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494603     1  0.0592     0.9333 0.988 0.000 0.012
#> GSM494568     1  0.0592     0.9333 0.988 0.000 0.012
#> GSM494572     3  0.0000     0.7310 0.000 0.000 1.000
#> GSM494600     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494562     2  0.0000     0.7169 0.000 1.000 0.000
#> GSM494615     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494582     2  0.0000     0.7169 0.000 1.000 0.000
#> GSM494599     2  0.1753     0.7287 0.048 0.952 0.000
#> GSM494610     2  0.0000     0.7169 0.000 1.000 0.000
#> GSM494587     2  0.4413     0.6248 0.024 0.852 0.124
#> GSM494581     2  0.5998     0.6486 0.084 0.788 0.128
#> GSM494580     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494563     3  0.9506     0.6022 0.268 0.240 0.492
#> GSM494576     2  0.3481     0.6757 0.052 0.904 0.044
#> GSM494605     2  0.6225     0.5796 0.432 0.568 0.000
#> GSM494584     3  0.8042     0.6608 0.136 0.216 0.648
#> GSM494586     2  0.1765     0.6988 0.004 0.956 0.040
#> GSM494578     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494585     2  0.4413     0.6248 0.024 0.852 0.124
#> GSM494611     2  0.0000     0.7169 0.000 1.000 0.000
#> GSM494560     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494595     2  0.0424     0.7167 0.008 0.992 0.000
#> GSM494570     3  0.5785     0.7742 0.332 0.000 0.668
#> GSM494597     3  0.5254     0.8300 0.264 0.000 0.736
#> GSM494607     2  0.3192     0.7305 0.112 0.888 0.000
#> GSM494561     3  0.5785     0.7742 0.332 0.000 0.668
#> GSM494569     1  0.0237     0.9393 0.996 0.000 0.004
#> GSM494592     2  0.1753     0.7287 0.048 0.952 0.000
#> GSM494577     2  0.8322     0.2214 0.120 0.604 0.276
#> GSM494588     3  0.5785     0.7742 0.332 0.000 0.668
#> GSM494590     3  0.0000     0.7310 0.000 0.000 1.000
#> GSM494609     2  0.5998     0.6486 0.084 0.788 0.128
#> GSM494608     2  0.5998     0.6486 0.084 0.788 0.128
#> GSM494606     2  0.1529     0.7272 0.040 0.960 0.000
#> GSM494574     2  0.0000     0.7169 0.000 1.000 0.000
#> GSM494573     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494566     2  0.6605     0.6464 0.096 0.752 0.152
#> GSM494601     2  0.4920     0.6796 0.052 0.840 0.108
#> GSM494557     3  0.5291     0.8312 0.268 0.000 0.732
#> GSM494579     2  0.6605     0.6464 0.096 0.752 0.152
#> GSM494596     3  0.0000     0.7310 0.000 0.000 1.000
#> GSM494575     2  0.0000     0.7169 0.000 1.000 0.000
#> GSM494625     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494654     3  0.5591     0.4776 0.304 0.000 0.696
#> GSM494664     2  0.6225     0.5796 0.432 0.568 0.000
#> GSM494624     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494651     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494662     1  0.1529     0.8948 0.960 0.040 0.000
#> GSM494627     1  0.0592     0.9333 0.988 0.000 0.012
#> GSM494673     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494649     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494658     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494653     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494643     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494672     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494618     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494631     3  0.6267     0.5964 0.452 0.000 0.548
#> GSM494619     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494674     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494616     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494663     1  0.0592     0.9333 0.988 0.000 0.012
#> GSM494628     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494632     2  0.6291     0.5077 0.468 0.532 0.000
#> GSM494660     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494622     1  0.0424     0.9369 0.992 0.000 0.008
#> GSM494642     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494647     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494659     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494670     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494675     3  0.5254     0.8300 0.264 0.000 0.736
#> GSM494641     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494636     1  0.5926     0.1216 0.644 0.356 0.000
#> GSM494640     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494623     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494644     2  0.6235     0.5726 0.436 0.564 0.000
#> GSM494646     2  0.6235     0.5726 0.436 0.564 0.000
#> GSM494665     2  0.6225     0.5796 0.432 0.568 0.000
#> GSM494638     1  0.5882     0.1528 0.652 0.348 0.000
#> GSM494645     2  0.6235     0.5726 0.436 0.564 0.000
#> GSM494671     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494655     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494620     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494630     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494657     3  0.0000     0.7310 0.000 0.000 1.000
#> GSM494667     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494621     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494629     1  0.0237     0.9393 0.996 0.000 0.004
#> GSM494637     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494652     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494648     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494650     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494669     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494666     2  0.6225     0.5796 0.432 0.568 0.000
#> GSM494668     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494633     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494634     2  0.5835     0.6872 0.340 0.660 0.000
#> GSM494639     1  0.5926     0.1216 0.644 0.356 0.000
#> GSM494661     2  0.6225     0.5796 0.432 0.568 0.000
#> GSM494617     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494626     1  0.0000     0.9427 1.000 0.000 0.000
#> GSM494656     3  0.5591     0.4776 0.304 0.000 0.696
#> GSM494635     2  0.6235     0.5726 0.436 0.564 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     3  0.7869      0.147 0.056 0.360 0.496 0.088
#> GSM494594     3  0.3681      0.725 0.000 0.176 0.816 0.008
#> GSM494604     1  0.4992     -0.411 0.524 0.476 0.000 0.000
#> GSM494564     3  0.3224      0.842 0.000 0.016 0.864 0.120
#> GSM494591     3  0.3681      0.725 0.000 0.176 0.816 0.008
#> GSM494567     3  0.2589      0.846 0.000 0.000 0.884 0.116
#> GSM494602     2  0.3528      0.862 0.192 0.808 0.000 0.000
#> GSM494613     3  0.2589      0.846 0.000 0.000 0.884 0.116
#> GSM494589     3  0.3224      0.842 0.000 0.016 0.864 0.120
#> GSM494598     2  0.3528      0.862 0.192 0.808 0.000 0.000
#> GSM494593     2  0.4250      0.822 0.276 0.724 0.000 0.000
#> GSM494583     2  0.7841      0.328 0.092 0.472 0.388 0.048
#> GSM494612     2  0.3528      0.862 0.192 0.808 0.000 0.000
#> GSM494558     4  0.0844      0.979 0.004 0.004 0.012 0.980
#> GSM494556     3  0.2589      0.846 0.000 0.000 0.884 0.116
#> GSM494559     3  0.4012      0.814 0.000 0.016 0.800 0.184
#> GSM494571     3  0.3681      0.725 0.000 0.176 0.816 0.008
#> GSM494614     3  0.2589      0.846 0.000 0.000 0.884 0.116
#> GSM494603     4  0.0712      0.982 0.004 0.004 0.008 0.984
#> GSM494568     4  0.0712      0.982 0.004 0.004 0.008 0.984
#> GSM494572     3  0.3681      0.725 0.000 0.176 0.816 0.008
#> GSM494600     3  0.3224      0.842 0.000 0.016 0.864 0.120
#> GSM494562     2  0.3528      0.862 0.192 0.808 0.000 0.000
#> GSM494615     3  0.2589      0.846 0.000 0.000 0.884 0.116
#> GSM494582     2  0.3528      0.862 0.192 0.808 0.000 0.000
#> GSM494599     2  0.4250      0.822 0.276 0.724 0.000 0.000
#> GSM494610     2  0.3528      0.862 0.192 0.808 0.000 0.000
#> GSM494587     2  0.5848      0.825 0.152 0.716 0.128 0.004
#> GSM494581     2  0.6775      0.796 0.228 0.628 0.136 0.008
#> GSM494580     3  0.2589      0.846 0.000 0.000 0.884 0.116
#> GSM494563     3  0.6474      0.564 0.000 0.256 0.624 0.120
#> GSM494576     2  0.5080      0.840 0.136 0.784 0.064 0.016
#> GSM494605     1  0.2216      0.847 0.908 0.000 0.000 0.092
#> GSM494584     3  0.6390      0.629 0.080 0.136 0.720 0.064
#> GSM494586     2  0.4149      0.859 0.168 0.804 0.028 0.000
#> GSM494578     3  0.2589      0.846 0.000 0.000 0.884 0.116
#> GSM494585     2  0.5848      0.825 0.152 0.716 0.128 0.004
#> GSM494611     2  0.3528      0.862 0.192 0.808 0.000 0.000
#> GSM494560     3  0.3224      0.842 0.000 0.016 0.864 0.120
#> GSM494595     2  0.3768      0.862 0.184 0.808 0.008 0.000
#> GSM494570     3  0.4012      0.814 0.000 0.016 0.800 0.184
#> GSM494597     3  0.2773      0.845 0.000 0.004 0.880 0.116
#> GSM494607     1  0.4992     -0.411 0.524 0.476 0.000 0.000
#> GSM494561     3  0.4012      0.814 0.000 0.016 0.800 0.184
#> GSM494569     4  0.0336      0.991 0.008 0.000 0.000 0.992
#> GSM494592     2  0.4250      0.822 0.276 0.724 0.000 0.000
#> GSM494577     2  0.7711      0.437 0.088 0.532 0.328 0.052
#> GSM494588     3  0.4012      0.814 0.000 0.016 0.800 0.184
#> GSM494590     3  0.3681      0.725 0.000 0.176 0.816 0.008
#> GSM494609     2  0.6775      0.796 0.228 0.628 0.136 0.008
#> GSM494608     2  0.6775      0.796 0.228 0.628 0.136 0.008
#> GSM494606     2  0.4193      0.828 0.268 0.732 0.000 0.000
#> GSM494574     2  0.3528      0.862 0.192 0.808 0.000 0.000
#> GSM494573     3  0.3224      0.842 0.000 0.016 0.864 0.120
#> GSM494566     2  0.6906      0.744 0.264 0.580 0.156 0.000
#> GSM494601     2  0.6164      0.821 0.240 0.656 0.104 0.000
#> GSM494557     3  0.2589      0.846 0.000 0.000 0.884 0.116
#> GSM494579     2  0.6906      0.744 0.264 0.580 0.156 0.000
#> GSM494596     3  0.3681      0.725 0.000 0.176 0.816 0.008
#> GSM494575     2  0.3528      0.862 0.192 0.808 0.000 0.000
#> GSM494625     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494654     3  0.7299      0.388 0.000 0.176 0.512 0.312
#> GSM494664     1  0.2216      0.847 0.908 0.000 0.000 0.092
#> GSM494624     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494651     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494662     4  0.1792      0.926 0.068 0.000 0.000 0.932
#> GSM494627     4  0.0712      0.982 0.004 0.004 0.008 0.984
#> GSM494673     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494649     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494658     1  0.0469      0.857 0.988 0.012 0.000 0.000
#> GSM494653     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494643     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494672     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494618     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494631     3  0.4406      0.669 0.000 0.000 0.700 0.300
#> GSM494619     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494674     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494616     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494663     4  0.0712      0.982 0.004 0.004 0.008 0.984
#> GSM494628     4  0.0657      0.990 0.012 0.000 0.004 0.984
#> GSM494632     1  0.2760      0.815 0.872 0.000 0.000 0.128
#> GSM494660     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494622     4  0.0859      0.985 0.008 0.004 0.008 0.980
#> GSM494642     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494675     3  0.2773      0.845 0.000 0.004 0.880 0.116
#> GSM494641     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494636     1  0.4431      0.598 0.696 0.000 0.000 0.304
#> GSM494640     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494623     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494644     1  0.2281      0.845 0.904 0.000 0.000 0.096
#> GSM494646     1  0.2281      0.845 0.904 0.000 0.000 0.096
#> GSM494665     1  0.2216      0.847 0.908 0.000 0.000 0.092
#> GSM494638     1  0.4477      0.584 0.688 0.000 0.000 0.312
#> GSM494645     1  0.2281      0.845 0.904 0.000 0.000 0.096
#> GSM494671     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494620     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494630     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494657     3  0.3681      0.725 0.000 0.176 0.816 0.008
#> GSM494667     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494621     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494629     4  0.0336      0.991 0.008 0.000 0.000 0.992
#> GSM494637     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494652     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494648     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494650     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494669     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494666     1  0.2216      0.847 0.908 0.000 0.000 0.092
#> GSM494668     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494633     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494634     1  0.0000      0.867 1.000 0.000 0.000 0.000
#> GSM494639     1  0.4431      0.598 0.696 0.000 0.000 0.304
#> GSM494661     1  0.2216      0.847 0.908 0.000 0.000 0.092
#> GSM494617     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494626     4  0.0469      0.993 0.012 0.000 0.000 0.988
#> GSM494656     3  0.7299      0.388 0.000 0.176 0.512 0.312
#> GSM494635     1  0.2281      0.845 0.904 0.000 0.000 0.096

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     5  0.4182     0.0127 0.000 0.400 0.000 0.000 0.600
#> GSM494594     3  0.2798     0.8485 0.000 0.000 0.852 0.008 0.140
#> GSM494604     2  0.4268     0.4142 0.444 0.556 0.000 0.000 0.000
#> GSM494564     5  0.0000     0.7449 0.000 0.000 0.000 0.000 1.000
#> GSM494591     3  0.2561     0.8581 0.000 0.000 0.856 0.000 0.144
#> GSM494567     5  0.3395     0.7327 0.000 0.000 0.236 0.000 0.764
#> GSM494602     2  0.0404     0.8367 0.012 0.988 0.000 0.000 0.000
#> GSM494613     5  0.3395     0.7327 0.000 0.000 0.236 0.000 0.764
#> GSM494589     5  0.0000     0.7449 0.000 0.000 0.000 0.000 1.000
#> GSM494598     2  0.0000     0.8357 0.000 1.000 0.000 0.000 0.000
#> GSM494593     2  0.2074     0.8214 0.104 0.896 0.000 0.000 0.000
#> GSM494583     2  0.4278     0.4022 0.000 0.548 0.000 0.000 0.452
#> GSM494612     2  0.0000     0.8357 0.000 1.000 0.000 0.000 0.000
#> GSM494558     4  0.2536     0.9151 0.000 0.000 0.128 0.868 0.004
#> GSM494556     5  0.3424     0.7287 0.000 0.000 0.240 0.000 0.760
#> GSM494559     5  0.1701     0.7155 0.000 0.000 0.016 0.048 0.936
#> GSM494571     3  0.2561     0.8581 0.000 0.000 0.856 0.000 0.144
#> GSM494614     5  0.3395     0.7327 0.000 0.000 0.236 0.000 0.764
#> GSM494603     4  0.2488     0.9172 0.000 0.000 0.124 0.872 0.004
#> GSM494568     4  0.2488     0.9172 0.000 0.000 0.124 0.872 0.004
#> GSM494572     3  0.2561     0.8581 0.000 0.000 0.856 0.000 0.144
#> GSM494600     5  0.0000     0.7449 0.000 0.000 0.000 0.000 1.000
#> GSM494562     2  0.0000     0.8357 0.000 1.000 0.000 0.000 0.000
#> GSM494615     5  0.3395     0.7327 0.000 0.000 0.236 0.000 0.764
#> GSM494582     2  0.0000     0.8357 0.000 1.000 0.000 0.000 0.000
#> GSM494599     2  0.2074     0.8214 0.104 0.896 0.000 0.000 0.000
#> GSM494610     2  0.0000     0.8357 0.000 1.000 0.000 0.000 0.000
#> GSM494587     2  0.2605     0.8034 0.000 0.852 0.000 0.000 0.148
#> GSM494581     2  0.4686     0.7797 0.104 0.736 0.000 0.000 0.160
#> GSM494580     5  0.3395     0.7327 0.000 0.000 0.236 0.000 0.764
#> GSM494563     5  0.3424     0.4936 0.000 0.240 0.000 0.000 0.760
#> GSM494576     2  0.1965     0.8197 0.000 0.904 0.000 0.000 0.096
#> GSM494605     1  0.1908     0.9025 0.908 0.000 0.000 0.092 0.000
#> GSM494584     5  0.6156     0.4823 0.000 0.216 0.224 0.000 0.560
#> GSM494586     2  0.1121     0.8347 0.000 0.956 0.000 0.000 0.044
#> GSM494578     5  0.3395     0.7327 0.000 0.000 0.236 0.000 0.764
#> GSM494585     2  0.2605     0.8034 0.000 0.852 0.000 0.000 0.148
#> GSM494611     2  0.0000     0.8357 0.000 1.000 0.000 0.000 0.000
#> GSM494560     5  0.0000     0.7449 0.000 0.000 0.000 0.000 1.000
#> GSM494595     2  0.0290     0.8359 0.000 0.992 0.000 0.000 0.008
#> GSM494570     5  0.1701     0.7155 0.000 0.000 0.016 0.048 0.936
#> GSM494597     5  0.3508     0.7156 0.000 0.000 0.252 0.000 0.748
#> GSM494607     2  0.4268     0.4142 0.444 0.556 0.000 0.000 0.000
#> GSM494561     5  0.1701     0.7155 0.000 0.000 0.016 0.048 0.936
#> GSM494569     4  0.2179     0.9274 0.004 0.000 0.100 0.896 0.000
#> GSM494592     2  0.2074     0.8214 0.104 0.896 0.000 0.000 0.000
#> GSM494577     2  0.4171     0.4679 0.000 0.604 0.000 0.000 0.396
#> GSM494588     5  0.1701     0.7155 0.000 0.000 0.016 0.048 0.936
#> GSM494590     3  0.2561     0.8581 0.000 0.000 0.856 0.000 0.144
#> GSM494609     2  0.4686     0.7797 0.104 0.736 0.000 0.000 0.160
#> GSM494608     2  0.4686     0.7797 0.104 0.736 0.000 0.000 0.160
#> GSM494606     2  0.2020     0.8235 0.100 0.900 0.000 0.000 0.000
#> GSM494574     2  0.0000     0.8357 0.000 1.000 0.000 0.000 0.000
#> GSM494573     5  0.0000     0.7449 0.000 0.000 0.000 0.000 1.000
#> GSM494566     2  0.5546     0.7121 0.180 0.648 0.000 0.000 0.172
#> GSM494601     2  0.3906     0.8126 0.084 0.804 0.000 0.000 0.112
#> GSM494557     5  0.3395     0.7327 0.000 0.000 0.236 0.000 0.764
#> GSM494579     2  0.5546     0.7121 0.180 0.648 0.000 0.000 0.172
#> GSM494596     3  0.2561     0.8581 0.000 0.000 0.856 0.000 0.144
#> GSM494575     2  0.0000     0.8357 0.000 1.000 0.000 0.000 0.000
#> GSM494625     4  0.0798     0.9272 0.008 0.000 0.016 0.976 0.000
#> GSM494654     3  0.3496     0.5983 0.000 0.000 0.788 0.200 0.012
#> GSM494664     1  0.1908     0.9025 0.908 0.000 0.000 0.092 0.000
#> GSM494624     4  0.0798     0.9272 0.008 0.000 0.016 0.976 0.000
#> GSM494651     4  0.2563     0.9253 0.008 0.000 0.120 0.872 0.000
#> GSM494662     4  0.1478     0.8850 0.064 0.000 0.000 0.936 0.000
#> GSM494627     4  0.2439     0.9192 0.000 0.000 0.120 0.876 0.004
#> GSM494673     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.0798     0.9272 0.008 0.000 0.016 0.976 0.000
#> GSM494658     1  0.0404     0.9141 0.988 0.012 0.000 0.000 0.000
#> GSM494653     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.0290     0.9289 0.008 0.000 0.000 0.992 0.000
#> GSM494672     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.2563     0.9253 0.008 0.000 0.120 0.872 0.000
#> GSM494631     5  0.5232     0.5777 0.000 0.000 0.228 0.104 0.668
#> GSM494619     4  0.0798     0.9272 0.008 0.000 0.016 0.976 0.000
#> GSM494674     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.2563     0.9253 0.008 0.000 0.120 0.872 0.000
#> GSM494663     4  0.2488     0.9172 0.000 0.000 0.124 0.872 0.004
#> GSM494628     4  0.2722     0.9235 0.008 0.000 0.120 0.868 0.004
#> GSM494632     1  0.2377     0.8732 0.872 0.000 0.000 0.128 0.000
#> GSM494660     4  0.0798     0.9272 0.008 0.000 0.016 0.976 0.000
#> GSM494622     4  0.2646     0.9197 0.004 0.000 0.124 0.868 0.004
#> GSM494642     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494675     5  0.3508     0.7156 0.000 0.000 0.252 0.000 0.748
#> GSM494641     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494636     1  0.3816     0.6552 0.696 0.000 0.000 0.304 0.000
#> GSM494640     4  0.0290     0.9289 0.008 0.000 0.000 0.992 0.000
#> GSM494623     4  0.0798     0.9272 0.008 0.000 0.016 0.976 0.000
#> GSM494644     1  0.1965     0.9006 0.904 0.000 0.000 0.096 0.000
#> GSM494646     1  0.1965     0.9006 0.904 0.000 0.000 0.096 0.000
#> GSM494665     1  0.1908     0.9025 0.908 0.000 0.000 0.092 0.000
#> GSM494638     1  0.3990     0.6423 0.688 0.000 0.004 0.308 0.000
#> GSM494645     1  0.1965     0.9006 0.904 0.000 0.000 0.096 0.000
#> GSM494671     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494620     4  0.0798     0.9272 0.008 0.000 0.016 0.976 0.000
#> GSM494630     4  0.0798     0.9272 0.008 0.000 0.016 0.976 0.000
#> GSM494657     3  0.2561     0.8581 0.000 0.000 0.856 0.000 0.144
#> GSM494667     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494621     4  0.0798     0.9272 0.008 0.000 0.016 0.976 0.000
#> GSM494629     4  0.1831     0.9296 0.004 0.000 0.076 0.920 0.000
#> GSM494637     4  0.0290     0.9289 0.008 0.000 0.000 0.992 0.000
#> GSM494652     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494648     4  0.0798     0.9272 0.008 0.000 0.016 0.976 0.000
#> GSM494650     4  0.2563     0.9253 0.008 0.000 0.120 0.872 0.000
#> GSM494669     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.1908     0.9025 0.908 0.000 0.000 0.092 0.000
#> GSM494668     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494633     4  0.0798     0.9272 0.008 0.000 0.016 0.976 0.000
#> GSM494634     1  0.0000     0.9225 1.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.3816     0.6552 0.696 0.000 0.000 0.304 0.000
#> GSM494661     1  0.1908     0.9025 0.908 0.000 0.000 0.092 0.000
#> GSM494617     4  0.2563     0.9253 0.008 0.000 0.120 0.872 0.000
#> GSM494626     4  0.2563     0.9253 0.008 0.000 0.120 0.872 0.000
#> GSM494656     3  0.3496     0.5983 0.000 0.000 0.788 0.200 0.012
#> GSM494635     1  0.1965     0.9006 0.904 0.000 0.000 0.096 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
#> GSM494565     5  0.5303      0.274 0.000 0.232 0.172 0.000 0.596 0.000
#> GSM494594     6  0.3741      0.781 0.000 0.000 0.320 0.000 0.008 0.672
#> GSM494604     1  0.6145     -0.323 0.432 0.340 0.000 0.000 0.220 0.008
#> GSM494564     5  0.3717      0.665 0.000 0.000 0.384 0.000 0.616 0.000
#> GSM494591     6  0.3706      0.816 0.000 0.000 0.380 0.000 0.000 0.620
#> GSM494567     3  0.0146      0.911 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494602     2  0.3219      0.763 0.012 0.792 0.000 0.000 0.192 0.004
#> GSM494613     3  0.0146      0.911 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494589     5  0.3717      0.665 0.000 0.000 0.384 0.000 0.616 0.000
#> GSM494598     2  0.0806      0.739 0.000 0.972 0.000 0.000 0.020 0.008
#> GSM494593     2  0.4650      0.746 0.096 0.688 0.000 0.000 0.212 0.004
#> GSM494583     5  0.5367     -0.181 0.000 0.344 0.124 0.000 0.532 0.000
#> GSM494612     2  0.0520      0.730 0.000 0.984 0.000 0.000 0.008 0.008
#> GSM494558     4  0.1151      0.777 0.000 0.000 0.000 0.956 0.032 0.012
#> GSM494556     3  0.0291      0.908 0.000 0.000 0.992 0.000 0.004 0.004
#> GSM494559     5  0.3984      0.664 0.000 0.000 0.336 0.000 0.648 0.016
#> GSM494571     6  0.3706      0.816 0.000 0.000 0.380 0.000 0.000 0.620
#> GSM494614     3  0.0713      0.897 0.000 0.000 0.972 0.000 0.028 0.000
#> GSM494603     4  0.0508      0.794 0.000 0.000 0.000 0.984 0.012 0.004
#> GSM494568     4  0.0508      0.794 0.000 0.000 0.000 0.984 0.012 0.004
#> GSM494572     6  0.3706      0.816 0.000 0.000 0.380 0.000 0.000 0.620
#> GSM494600     5  0.3717      0.665 0.000 0.000 0.384 0.000 0.616 0.000
#> GSM494562     2  0.0806      0.739 0.000 0.972 0.000 0.000 0.020 0.008
#> GSM494615     3  0.0146      0.911 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494582     2  0.0520      0.730 0.000 0.984 0.000 0.000 0.008 0.008
#> GSM494599     2  0.4650      0.746 0.096 0.688 0.000 0.000 0.212 0.004
#> GSM494610     2  0.0806      0.739 0.000 0.972 0.000 0.000 0.020 0.008
#> GSM494587     2  0.4509      0.696 0.000 0.640 0.036 0.000 0.316 0.008
#> GSM494581     2  0.6126      0.641 0.096 0.500 0.036 0.000 0.360 0.008
#> GSM494580     3  0.0146      0.911 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494563     5  0.4532      0.541 0.000 0.108 0.196 0.000 0.696 0.000
#> GSM494576     2  0.3726      0.741 0.000 0.752 0.028 0.000 0.216 0.004
#> GSM494605     1  0.2129      0.865 0.904 0.000 0.000 0.040 0.000 0.056
#> GSM494584     3  0.4308      0.492 0.000 0.152 0.728 0.000 0.120 0.000
#> GSM494586     2  0.2979      0.757 0.000 0.804 0.004 0.000 0.188 0.004
#> GSM494578     3  0.0146      0.911 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494585     2  0.4509      0.696 0.000 0.640 0.036 0.000 0.316 0.008
#> GSM494611     2  0.0520      0.730 0.000 0.984 0.000 0.000 0.008 0.008
#> GSM494560     5  0.3717      0.665 0.000 0.000 0.384 0.000 0.616 0.000
#> GSM494595     2  0.1900      0.751 0.000 0.916 0.008 0.000 0.068 0.008
#> GSM494570     5  0.3984      0.664 0.000 0.000 0.336 0.000 0.648 0.016
#> GSM494597     3  0.1461      0.869 0.000 0.000 0.940 0.000 0.044 0.016
#> GSM494607     1  0.6145     -0.323 0.432 0.340 0.000 0.000 0.220 0.008
#> GSM494561     5  0.3984      0.664 0.000 0.000 0.336 0.000 0.648 0.016
#> GSM494569     4  0.1082      0.803 0.000 0.000 0.000 0.956 0.004 0.040
#> GSM494592     2  0.4650      0.746 0.096 0.688 0.000 0.000 0.212 0.004
#> GSM494577     5  0.5368     -0.295 0.000 0.400 0.112 0.000 0.488 0.000
#> GSM494588     5  0.3984      0.664 0.000 0.000 0.336 0.000 0.648 0.016
#> GSM494590     6  0.3706      0.816 0.000 0.000 0.380 0.000 0.000 0.620
#> GSM494609     2  0.6126      0.641 0.096 0.500 0.036 0.000 0.360 0.008
#> GSM494608     2  0.6126      0.641 0.096 0.500 0.036 0.000 0.360 0.008
#> GSM494606     2  0.4606      0.748 0.092 0.692 0.000 0.000 0.212 0.004
#> GSM494574     2  0.0806      0.739 0.000 0.972 0.000 0.000 0.020 0.008
#> GSM494573     5  0.3717      0.665 0.000 0.000 0.384 0.000 0.616 0.000
#> GSM494566     2  0.6665      0.540 0.172 0.412 0.036 0.000 0.372 0.008
#> GSM494601     2  0.5262      0.696 0.076 0.572 0.008 0.000 0.340 0.004
#> GSM494557     3  0.0146      0.911 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494579     2  0.6665      0.540 0.172 0.412 0.036 0.000 0.372 0.008
#> GSM494596     6  0.3706      0.816 0.000 0.000 0.380 0.000 0.000 0.620
#> GSM494575     2  0.0520      0.730 0.000 0.984 0.000 0.000 0.008 0.008
#> GSM494625     4  0.4671      0.791 0.000 0.000 0.000 0.628 0.068 0.304
#> GSM494654     6  0.4253      0.550 0.000 0.000 0.020 0.300 0.012 0.668
#> GSM494664     1  0.2129      0.865 0.904 0.000 0.000 0.040 0.000 0.056
#> GSM494624     4  0.4671      0.791 0.000 0.000 0.000 0.628 0.068 0.304
#> GSM494651     4  0.0692      0.791 0.000 0.000 0.000 0.976 0.020 0.004
#> GSM494662     4  0.4651      0.781 0.056 0.000 0.000 0.692 0.020 0.232
#> GSM494627     4  0.0622      0.795 0.000 0.000 0.000 0.980 0.012 0.008
#> GSM494673     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.4671      0.791 0.000 0.000 0.000 0.628 0.068 0.304
#> GSM494658     1  0.0717      0.872 0.976 0.008 0.000 0.000 0.016 0.000
#> GSM494653     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.3711      0.805 0.000 0.000 0.000 0.720 0.020 0.260
#> GSM494672     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0692      0.791 0.000 0.000 0.000 0.976 0.020 0.004
#> GSM494631     3  0.2664      0.637 0.000 0.000 0.816 0.184 0.000 0.000
#> GSM494619     4  0.4671      0.791 0.000 0.000 0.000 0.628 0.068 0.304
#> GSM494674     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0692      0.791 0.000 0.000 0.000 0.976 0.020 0.004
#> GSM494663     4  0.0508      0.794 0.000 0.000 0.000 0.984 0.012 0.004
#> GSM494628     4  0.0632      0.790 0.000 0.000 0.000 0.976 0.024 0.000
#> GSM494632     1  0.2688      0.838 0.868 0.000 0.000 0.068 0.000 0.064
#> GSM494660     4  0.4671      0.791 0.000 0.000 0.000 0.628 0.068 0.304
#> GSM494622     4  0.0508      0.794 0.000 0.000 0.000 0.984 0.012 0.004
#> GSM494642     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494675     3  0.1461      0.869 0.000 0.000 0.940 0.000 0.044 0.016
#> GSM494641     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     1  0.4325      0.618 0.692 0.000 0.000 0.244 0.000 0.064
#> GSM494640     4  0.3711      0.805 0.000 0.000 0.000 0.720 0.020 0.260
#> GSM494623     4  0.4671      0.791 0.000 0.000 0.000 0.628 0.068 0.304
#> GSM494644     1  0.2190      0.863 0.900 0.000 0.000 0.040 0.000 0.060
#> GSM494646     1  0.2190      0.863 0.900 0.000 0.000 0.040 0.000 0.060
#> GSM494665     1  0.2129      0.865 0.904 0.000 0.000 0.040 0.000 0.056
#> GSM494638     1  0.4370      0.607 0.684 0.000 0.000 0.252 0.000 0.064
#> GSM494645     1  0.2190      0.863 0.900 0.000 0.000 0.040 0.000 0.060
#> GSM494671     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     4  0.4671      0.791 0.000 0.000 0.000 0.628 0.068 0.304
#> GSM494630     4  0.4671      0.791 0.000 0.000 0.000 0.628 0.068 0.304
#> GSM494657     6  0.3706      0.816 0.000 0.000 0.380 0.000 0.000 0.620
#> GSM494667     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     4  0.4671      0.791 0.000 0.000 0.000 0.628 0.068 0.304
#> GSM494629     4  0.1753      0.807 0.000 0.000 0.000 0.912 0.004 0.084
#> GSM494637     4  0.3711      0.805 0.000 0.000 0.000 0.720 0.020 0.260
#> GSM494652     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     4  0.4671      0.791 0.000 0.000 0.000 0.628 0.068 0.304
#> GSM494650     4  0.0000      0.798 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494669     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.2129      0.865 0.904 0.000 0.000 0.040 0.000 0.056
#> GSM494668     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     4  0.4671      0.791 0.000 0.000 0.000 0.628 0.068 0.304
#> GSM494634     1  0.0000      0.885 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.4325      0.618 0.692 0.000 0.000 0.244 0.000 0.064
#> GSM494661     1  0.2129      0.865 0.904 0.000 0.000 0.040 0.000 0.056
#> GSM494617     4  0.0692      0.791 0.000 0.000 0.000 0.976 0.020 0.004
#> GSM494626     4  0.0692      0.791 0.000 0.000 0.000 0.976 0.020 0.004
#> GSM494656     6  0.4253      0.550 0.000 0.000 0.020 0.300 0.012 0.668
#> GSM494635     1  0.2190      0.863 0.900 0.000 0.000 0.040 0.000 0.060

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-hclust-collect-classes

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

test_to_known_factors(res)
#>              n disease.state(p)  age(p) other(p) individual(p) k
#> MAD:hclust 114         1.00e+00 0.00188 2.47e-01      0.000698 2
#> MAD:hclust 112         3.44e-08 0.02495 1.13e-04      0.061806 3
#> MAD:hclust 113         3.34e-18 0.52598 7.62e-12      0.859826 4
#> MAD:hclust 113         1.79e-16 0.06742 1.27e-11      0.556265 5
#> MAD:hclust 114         3.82e-16 0.11265 2.06e-12      0.503893 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 51941 rows and 120 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 0.495           0.768       0.854         0.5015 0.496   0.496
#> 3 3 0.596           0.512       0.731         0.3005 0.725   0.500
#> 4 4 0.758           0.892       0.890         0.1361 0.834   0.551
#> 5 5 0.841           0.695       0.833         0.0643 0.963   0.856
#> 6 6 0.796           0.723       0.810         0.0407 0.914   0.652

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
#> GSM494565     2   0.909     0.8281 0.324 0.676
#> GSM494594     2   0.909     0.8281 0.324 0.676
#> GSM494604     1   0.909     0.7727 0.676 0.324
#> GSM494564     2   0.909     0.8281 0.324 0.676
#> GSM494591     2   0.909     0.8281 0.324 0.676
#> GSM494567     2   0.909     0.8281 0.324 0.676
#> GSM494602     2   0.000     0.7062 0.000 1.000
#> GSM494613     2   0.909     0.8281 0.324 0.676
#> GSM494589     2   0.909     0.8281 0.324 0.676
#> GSM494598     2   0.000     0.7062 0.000 1.000
#> GSM494593     2   0.000     0.7062 0.000 1.000
#> GSM494583     2   0.909     0.8281 0.324 0.676
#> GSM494612     2   0.000     0.7062 0.000 1.000
#> GSM494558     2   0.909     0.8281 0.324 0.676
#> GSM494556     2   0.909     0.8281 0.324 0.676
#> GSM494559     2   0.909     0.8281 0.324 0.676
#> GSM494571     2   0.909     0.8281 0.324 0.676
#> GSM494614     2   0.909     0.8281 0.324 0.676
#> GSM494603     2   0.943     0.7906 0.360 0.640
#> GSM494568     1   0.886     0.0419 0.696 0.304
#> GSM494572     2   0.909     0.8281 0.324 0.676
#> GSM494600     2   0.909     0.8281 0.324 0.676
#> GSM494562     2   0.000     0.7062 0.000 1.000
#> GSM494615     2   0.909     0.8281 0.324 0.676
#> GSM494582     2   0.000     0.7062 0.000 1.000
#> GSM494599     2   0.000     0.7062 0.000 1.000
#> GSM494610     2   0.000     0.7062 0.000 1.000
#> GSM494587     2   0.343     0.7358 0.064 0.936
#> GSM494581     2   0.416     0.7439 0.084 0.916
#> GSM494580     2   0.909     0.8281 0.324 0.676
#> GSM494563     2   0.909     0.8281 0.324 0.676
#> GSM494576     2   0.871     0.8185 0.292 0.708
#> GSM494605     1   0.909     0.7727 0.676 0.324
#> GSM494584     2   0.909     0.8281 0.324 0.676
#> GSM494586     2   0.000     0.7062 0.000 1.000
#> GSM494578     2   0.909     0.8281 0.324 0.676
#> GSM494585     2   0.163     0.7181 0.024 0.976
#> GSM494611     2   0.000     0.7062 0.000 1.000
#> GSM494560     2   0.909     0.8281 0.324 0.676
#> GSM494595     2   0.000     0.7062 0.000 1.000
#> GSM494570     2   0.909     0.8281 0.324 0.676
#> GSM494597     2   0.909     0.8281 0.324 0.676
#> GSM494607     2   0.000     0.7062 0.000 1.000
#> GSM494561     2   0.909     0.8281 0.324 0.676
#> GSM494569     1   0.000     0.7592 1.000 0.000
#> GSM494592     2   0.000     0.7062 0.000 1.000
#> GSM494577     2   0.900     0.8260 0.316 0.684
#> GSM494588     2   0.909     0.8281 0.324 0.676
#> GSM494590     2   0.909     0.8281 0.324 0.676
#> GSM494609     2   0.000     0.7062 0.000 1.000
#> GSM494608     2   0.000     0.7062 0.000 1.000
#> GSM494606     2   0.000     0.7062 0.000 1.000
#> GSM494574     2   0.000     0.7062 0.000 1.000
#> GSM494573     2   0.909     0.8281 0.324 0.676
#> GSM494566     2   0.529     0.7572 0.120 0.880
#> GSM494601     2   0.000     0.7062 0.000 1.000
#> GSM494557     2   0.909     0.8281 0.324 0.676
#> GSM494579     2   0.224     0.7237 0.036 0.964
#> GSM494596     2   0.909     0.8281 0.324 0.676
#> GSM494575     2   0.000     0.7062 0.000 1.000
#> GSM494625     1   0.000     0.7592 1.000 0.000
#> GSM494654     2   0.909     0.8281 0.324 0.676
#> GSM494664     1   0.909     0.7727 0.676 0.324
#> GSM494624     1   0.000     0.7592 1.000 0.000
#> GSM494651     1   0.000     0.7592 1.000 0.000
#> GSM494662     1   0.000     0.7592 1.000 0.000
#> GSM494627     1   0.000     0.7592 1.000 0.000
#> GSM494673     1   0.909     0.7727 0.676 0.324
#> GSM494649     1   0.000     0.7592 1.000 0.000
#> GSM494658     1   0.909     0.7727 0.676 0.324
#> GSM494653     1   0.909     0.7727 0.676 0.324
#> GSM494643     1   0.000     0.7592 1.000 0.000
#> GSM494672     1   0.909     0.7727 0.676 0.324
#> GSM494618     1   0.000     0.7592 1.000 0.000
#> GSM494631     2   0.909     0.8281 0.324 0.676
#> GSM494619     1   0.000     0.7592 1.000 0.000
#> GSM494674     1   0.909     0.7727 0.676 0.324
#> GSM494616     1   0.000     0.7592 1.000 0.000
#> GSM494663     1   0.000     0.7592 1.000 0.000
#> GSM494628     1   0.000     0.7592 1.000 0.000
#> GSM494632     1   0.909     0.7727 0.676 0.324
#> GSM494660     1   0.000     0.7592 1.000 0.000
#> GSM494622     1   0.000     0.7592 1.000 0.000
#> GSM494642     1   0.909     0.7727 0.676 0.324
#> GSM494647     1   0.909     0.7727 0.676 0.324
#> GSM494659     1   0.909     0.7727 0.676 0.324
#> GSM494670     1   0.909     0.7727 0.676 0.324
#> GSM494675     2   0.909     0.8281 0.324 0.676
#> GSM494641     1   0.909     0.7727 0.676 0.324
#> GSM494636     1   0.000     0.7592 1.000 0.000
#> GSM494640     1   0.000     0.7592 1.000 0.000
#> GSM494623     1   0.000     0.7592 1.000 0.000
#> GSM494644     1   0.909     0.7727 0.676 0.324
#> GSM494646     1   0.909     0.7727 0.676 0.324
#> GSM494665     1   0.909     0.7727 0.676 0.324
#> GSM494638     1   0.000     0.7592 1.000 0.000
#> GSM494645     1   0.909     0.7727 0.676 0.324
#> GSM494671     1   0.909     0.7727 0.676 0.324
#> GSM494655     1   0.909     0.7727 0.676 0.324
#> GSM494620     1   0.000     0.7592 1.000 0.000
#> GSM494630     1   0.000     0.7592 1.000 0.000
#> GSM494657     2   0.909     0.8281 0.324 0.676
#> GSM494667     1   0.909     0.7727 0.676 0.324
#> GSM494621     1   0.000     0.7592 1.000 0.000
#> GSM494629     1   0.000     0.7592 1.000 0.000
#> GSM494637     1   0.000     0.7592 1.000 0.000
#> GSM494652     1   0.909     0.7727 0.676 0.324
#> GSM494648     1   0.000     0.7592 1.000 0.000
#> GSM494650     1   0.000     0.7592 1.000 0.000
#> GSM494669     1   0.909     0.7727 0.676 0.324
#> GSM494666     1   0.909     0.7727 0.676 0.324
#> GSM494668     1   0.909     0.7727 0.676 0.324
#> GSM494633     1   0.000     0.7592 1.000 0.000
#> GSM494634     1   0.909     0.7727 0.676 0.324
#> GSM494639     1   0.909     0.7727 0.676 0.324
#> GSM494661     1   0.909     0.7727 0.676 0.324
#> GSM494617     1   0.000     0.7592 1.000 0.000
#> GSM494626     1   0.000     0.7592 1.000 0.000
#> GSM494656     2   0.909     0.8281 0.324 0.676
#> GSM494635     1   0.909     0.7727 0.676 0.324

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM494565     3  0.1315     0.7937 0.008 0.020 0.972
#> GSM494594     3  0.0237     0.8020 0.004 0.000 0.996
#> GSM494604     2  0.0747     0.4221 0.016 0.984 0.000
#> GSM494564     3  0.0661     0.8009 0.008 0.004 0.988
#> GSM494591     3  0.0237     0.8018 0.000 0.004 0.996
#> GSM494567     3  0.0237     0.8020 0.004 0.000 0.996
#> GSM494602     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494613     3  0.0000     0.8026 0.000 0.000 1.000
#> GSM494589     3  0.0661     0.8009 0.008 0.004 0.988
#> GSM494598     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494593     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494583     3  0.6307     0.2189 0.000 0.488 0.512
#> GSM494612     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494558     3  0.5785     0.5071 0.332 0.000 0.668
#> GSM494556     3  0.0000     0.8026 0.000 0.000 1.000
#> GSM494559     3  0.0661     0.8009 0.008 0.004 0.988
#> GSM494571     3  0.4291     0.6668 0.180 0.000 0.820
#> GSM494614     3  0.0747     0.7967 0.000 0.016 0.984
#> GSM494603     3  0.6008     0.4352 0.372 0.000 0.628
#> GSM494568     1  0.6225     0.0555 0.568 0.000 0.432
#> GSM494572     3  0.0237     0.8020 0.004 0.000 0.996
#> GSM494600     3  0.0661     0.8009 0.008 0.004 0.988
#> GSM494562     2  0.6280    -0.1278 0.000 0.540 0.460
#> GSM494615     3  0.0237     0.8020 0.004 0.000 0.996
#> GSM494582     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494599     2  0.3482     0.3749 0.000 0.872 0.128
#> GSM494610     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494587     3  0.6309     0.2047 0.000 0.496 0.504
#> GSM494581     3  0.6309     0.2047 0.000 0.496 0.504
#> GSM494580     3  0.0237     0.8020 0.004 0.000 0.996
#> GSM494563     3  0.1315     0.7937 0.008 0.020 0.972
#> GSM494576     3  0.6308     0.2122 0.000 0.492 0.508
#> GSM494605     1  0.6008     0.4059 0.628 0.372 0.000
#> GSM494584     3  0.2448     0.7538 0.000 0.076 0.924
#> GSM494586     3  0.6309     0.2047 0.000 0.496 0.504
#> GSM494578     3  0.0000     0.8026 0.000 0.000 1.000
#> GSM494585     3  0.6309     0.2047 0.000 0.496 0.504
#> GSM494611     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494560     3  0.1170     0.7954 0.008 0.016 0.976
#> GSM494595     2  0.5733     0.2259 0.000 0.676 0.324
#> GSM494570     3  0.5529     0.5671 0.296 0.000 0.704
#> GSM494597     3  0.0000     0.8026 0.000 0.000 1.000
#> GSM494607     2  0.0000     0.4181 0.000 1.000 0.000
#> GSM494561     3  0.5810     0.5124 0.336 0.000 0.664
#> GSM494569     1  0.1031     0.8576 0.976 0.000 0.024
#> GSM494592     2  0.3482     0.3749 0.000 0.872 0.128
#> GSM494577     3  0.6308     0.2122 0.000 0.492 0.508
#> GSM494588     3  0.1315     0.7937 0.008 0.020 0.972
#> GSM494590     3  0.0237     0.8020 0.004 0.000 0.996
#> GSM494609     2  0.5591     0.2650 0.000 0.696 0.304
#> GSM494608     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494606     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494574     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494573     3  0.0661     0.8009 0.008 0.004 0.988
#> GSM494566     2  0.6286    -0.1373 0.000 0.536 0.464
#> GSM494601     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494557     3  0.0237     0.8018 0.000 0.004 0.996
#> GSM494579     2  0.6280    -0.1281 0.000 0.540 0.460
#> GSM494596     3  0.0000     0.8026 0.000 0.000 1.000
#> GSM494575     2  0.5497     0.2863 0.000 0.708 0.292
#> GSM494625     1  0.0747     0.8572 0.984 0.000 0.016
#> GSM494654     3  0.5678     0.5298 0.316 0.000 0.684
#> GSM494664     1  0.5560     0.5562 0.700 0.300 0.000
#> GSM494624     1  0.0237     0.8589 0.996 0.000 0.004
#> GSM494651     1  0.1031     0.8576 0.976 0.000 0.024
#> GSM494662     1  0.0424     0.8592 0.992 0.000 0.008
#> GSM494627     1  0.1031     0.8576 0.976 0.000 0.024
#> GSM494673     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494649     1  0.0747     0.8572 0.984 0.000 0.016
#> GSM494658     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494653     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494643     1  0.0237     0.8589 0.996 0.000 0.004
#> GSM494672     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494618     1  0.0592     0.8594 0.988 0.000 0.012
#> GSM494631     3  0.5529     0.5618 0.296 0.000 0.704
#> GSM494619     1  0.0000     0.8580 1.000 0.000 0.000
#> GSM494674     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494616     1  0.1031     0.8576 0.976 0.000 0.024
#> GSM494663     1  0.1031     0.8576 0.976 0.000 0.024
#> GSM494628     1  0.1031     0.8576 0.976 0.000 0.024
#> GSM494632     1  0.5058     0.6270 0.756 0.244 0.000
#> GSM494660     1  0.0747     0.8572 0.984 0.000 0.016
#> GSM494622     1  0.1031     0.8576 0.976 0.000 0.024
#> GSM494642     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494647     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494659     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494670     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494675     3  0.0000     0.8026 0.000 0.000 1.000
#> GSM494641     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494636     1  0.0424     0.8592 0.992 0.000 0.008
#> GSM494640     1  0.1031     0.8576 0.976 0.000 0.024
#> GSM494623     1  0.0000     0.8580 1.000 0.000 0.000
#> GSM494644     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494646     1  0.5497     0.5676 0.708 0.292 0.000
#> GSM494665     1  0.6299     0.0990 0.524 0.476 0.000
#> GSM494638     1  0.0424     0.8592 0.992 0.000 0.008
#> GSM494645     1  0.5560     0.5562 0.700 0.300 0.000
#> GSM494671     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494655     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494620     1  0.0000     0.8580 1.000 0.000 0.000
#> GSM494630     1  0.0000     0.8580 1.000 0.000 0.000
#> GSM494657     3  0.0237     0.8020 0.004 0.000 0.996
#> GSM494667     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494621     1  0.0000     0.8580 1.000 0.000 0.000
#> GSM494629     1  0.1031     0.8576 0.976 0.000 0.024
#> GSM494637     1  0.1031     0.8576 0.976 0.000 0.024
#> GSM494652     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494648     1  0.0000     0.8580 1.000 0.000 0.000
#> GSM494650     1  0.1031     0.8576 0.976 0.000 0.024
#> GSM494669     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494666     1  0.5560     0.5562 0.700 0.300 0.000
#> GSM494668     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494633     1  0.0747     0.8572 0.984 0.000 0.016
#> GSM494634     2  0.6307    -0.0130 0.488 0.512 0.000
#> GSM494639     1  0.5397     0.5835 0.720 0.280 0.000
#> GSM494661     1  0.5785     0.4950 0.668 0.332 0.000
#> GSM494617     1  0.0424     0.8592 0.992 0.000 0.008
#> GSM494626     1  0.0424     0.8592 0.992 0.000 0.008
#> GSM494656     3  0.5497     0.5618 0.292 0.000 0.708
#> GSM494635     1  0.5560     0.5562 0.700 0.300 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     3  0.5177      0.857 0.104 0.104 0.780 0.012
#> GSM494594     3  0.2196      0.894 0.032 0.016 0.936 0.016
#> GSM494604     1  0.3266      0.774 0.832 0.168 0.000 0.000
#> GSM494564     3  0.4152      0.893 0.100 0.048 0.840 0.012
#> GSM494591     3  0.2313      0.906 0.032 0.044 0.924 0.000
#> GSM494567     3  0.1389      0.910 0.000 0.048 0.952 0.000
#> GSM494602     2  0.1118      0.959 0.036 0.964 0.000 0.000
#> GSM494613     3  0.1576      0.910 0.004 0.048 0.948 0.000
#> GSM494589     3  0.4152      0.893 0.100 0.048 0.840 0.012
#> GSM494598     2  0.1118      0.959 0.036 0.964 0.000 0.000
#> GSM494593     2  0.1118      0.959 0.036 0.964 0.000 0.000
#> GSM494583     2  0.3754      0.870 0.064 0.852 0.084 0.000
#> GSM494612     2  0.1118      0.959 0.036 0.964 0.000 0.000
#> GSM494558     3  0.3906      0.819 0.020 0.020 0.848 0.112
#> GSM494556     3  0.2089      0.909 0.020 0.048 0.932 0.000
#> GSM494559     3  0.4212      0.892 0.104 0.048 0.836 0.012
#> GSM494571     3  0.1796      0.889 0.032 0.004 0.948 0.016
#> GSM494614     3  0.3471      0.900 0.072 0.060 0.868 0.000
#> GSM494603     4  0.7077      0.235 0.072 0.024 0.368 0.536
#> GSM494568     4  0.3740      0.842 0.028 0.020 0.088 0.864
#> GSM494572     3  0.2313      0.906 0.032 0.044 0.924 0.000
#> GSM494600     3  0.4152      0.893 0.100 0.048 0.840 0.012
#> GSM494562     2  0.1211      0.947 0.000 0.960 0.040 0.000
#> GSM494615     3  0.1624      0.907 0.020 0.028 0.952 0.000
#> GSM494582     2  0.1118      0.959 0.036 0.964 0.000 0.000
#> GSM494599     2  0.1637      0.938 0.060 0.940 0.000 0.000
#> GSM494610     2  0.1118      0.959 0.036 0.964 0.000 0.000
#> GSM494587     2  0.1743      0.936 0.004 0.940 0.056 0.000
#> GSM494581     2  0.2521      0.921 0.024 0.912 0.064 0.000
#> GSM494580     3  0.1389      0.910 0.000 0.048 0.952 0.000
#> GSM494563     3  0.5839      0.807 0.104 0.156 0.728 0.012
#> GSM494576     2  0.1824      0.934 0.004 0.936 0.060 0.000
#> GSM494605     1  0.3672      0.949 0.824 0.012 0.000 0.164
#> GSM494584     3  0.6037      0.596 0.068 0.304 0.628 0.000
#> GSM494586     2  0.1557      0.937 0.000 0.944 0.056 0.000
#> GSM494578     3  0.1389      0.910 0.000 0.048 0.952 0.000
#> GSM494585     2  0.1743      0.936 0.004 0.940 0.056 0.000
#> GSM494611     2  0.1118      0.959 0.036 0.964 0.000 0.000
#> GSM494560     3  0.4212      0.892 0.104 0.048 0.836 0.012
#> GSM494595     2  0.1256      0.952 0.008 0.964 0.028 0.000
#> GSM494570     3  0.5336      0.821 0.112 0.020 0.776 0.092
#> GSM494597     3  0.2313      0.906 0.032 0.044 0.924 0.000
#> GSM494607     2  0.2011      0.915 0.080 0.920 0.000 0.000
#> GSM494561     3  0.6180      0.752 0.112 0.024 0.716 0.148
#> GSM494569     4  0.1943      0.901 0.008 0.016 0.032 0.944
#> GSM494592     2  0.1637      0.938 0.060 0.940 0.000 0.000
#> GSM494577     2  0.3323      0.894 0.060 0.876 0.064 0.000
#> GSM494588     3  0.6002      0.802 0.116 0.156 0.716 0.012
#> GSM494590     3  0.2313      0.906 0.032 0.044 0.924 0.000
#> GSM494609     2  0.1388      0.957 0.028 0.960 0.012 0.000
#> GSM494608     2  0.1118      0.959 0.036 0.964 0.000 0.000
#> GSM494606     2  0.1118      0.959 0.036 0.964 0.000 0.000
#> GSM494574     2  0.1118      0.959 0.036 0.964 0.000 0.000
#> GSM494573     3  0.4152      0.893 0.100 0.048 0.840 0.012
#> GSM494566     2  0.2699      0.919 0.028 0.904 0.068 0.000
#> GSM494601     2  0.1022      0.959 0.032 0.968 0.000 0.000
#> GSM494557     3  0.1389      0.910 0.000 0.048 0.952 0.000
#> GSM494579     2  0.1677      0.944 0.012 0.948 0.040 0.000
#> GSM494596     3  0.2313      0.906 0.032 0.044 0.924 0.000
#> GSM494575     2  0.1118      0.959 0.036 0.964 0.000 0.000
#> GSM494625     4  0.1877      0.900 0.020 0.012 0.020 0.948
#> GSM494654     3  0.2920      0.867 0.032 0.020 0.908 0.040
#> GSM494664     1  0.3444      0.931 0.816 0.000 0.000 0.184
#> GSM494624     4  0.1877      0.900 0.020 0.012 0.020 0.948
#> GSM494651     4  0.1943      0.901 0.008 0.016 0.032 0.944
#> GSM494662     4  0.0817      0.902 0.024 0.000 0.000 0.976
#> GSM494627     4  0.1913      0.900 0.000 0.020 0.040 0.940
#> GSM494673     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494649     4  0.1877      0.900 0.020 0.012 0.020 0.948
#> GSM494658     1  0.3707      0.970 0.840 0.028 0.000 0.132
#> GSM494653     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494643     4  0.1377      0.902 0.008 0.008 0.020 0.964
#> GSM494672     1  0.3707      0.970 0.840 0.028 0.000 0.132
#> GSM494618     4  0.1943      0.901 0.008 0.016 0.032 0.944
#> GSM494631     3  0.3946      0.747 0.000 0.020 0.812 0.168
#> GSM494619     4  0.1877      0.900 0.020 0.012 0.020 0.948
#> GSM494674     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494616     4  0.1943      0.901 0.008 0.016 0.032 0.944
#> GSM494663     4  0.1913      0.900 0.000 0.020 0.040 0.940
#> GSM494628     4  0.2007      0.899 0.004 0.020 0.036 0.940
#> GSM494632     4  0.3801      0.663 0.220 0.000 0.000 0.780
#> GSM494660     4  0.1877      0.900 0.020 0.012 0.020 0.948
#> GSM494622     4  0.2007      0.899 0.004 0.020 0.036 0.940
#> GSM494642     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494647     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494659     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494670     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494675     3  0.2399      0.910 0.032 0.048 0.920 0.000
#> GSM494641     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494636     4  0.0817      0.902 0.024 0.000 0.000 0.976
#> GSM494640     4  0.0779      0.905 0.004 0.000 0.016 0.980
#> GSM494623     4  0.1877      0.900 0.020 0.012 0.020 0.948
#> GSM494644     1  0.3443      0.970 0.848 0.016 0.000 0.136
#> GSM494646     4  0.4998     -0.195 0.488 0.000 0.000 0.512
#> GSM494665     1  0.3606      0.970 0.840 0.020 0.000 0.140
#> GSM494638     4  0.1629      0.902 0.024 0.000 0.024 0.952
#> GSM494645     1  0.3400      0.933 0.820 0.000 0.000 0.180
#> GSM494671     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494655     1  0.3554      0.972 0.844 0.020 0.000 0.136
#> GSM494620     4  0.1877      0.900 0.020 0.012 0.020 0.948
#> GSM494630     4  0.1877      0.900 0.020 0.012 0.020 0.948
#> GSM494657     3  0.2313      0.906 0.032 0.044 0.924 0.000
#> GSM494667     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494621     4  0.1877      0.900 0.020 0.012 0.020 0.948
#> GSM494629     4  0.2706      0.871 0.000 0.020 0.080 0.900
#> GSM494637     4  0.0927      0.905 0.008 0.000 0.016 0.976
#> GSM494652     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494648     4  0.1877      0.900 0.020 0.012 0.020 0.948
#> GSM494650     4  0.2007      0.899 0.004 0.020 0.036 0.940
#> GSM494669     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494666     1  0.3444      0.931 0.816 0.000 0.000 0.184
#> GSM494668     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494633     4  0.1877      0.900 0.020 0.012 0.020 0.948
#> GSM494634     1  0.3659      0.974 0.840 0.024 0.000 0.136
#> GSM494639     4  0.4585      0.405 0.332 0.000 0.000 0.668
#> GSM494661     1  0.3356      0.937 0.824 0.000 0.000 0.176
#> GSM494617     4  0.1993      0.900 0.016 0.016 0.024 0.944
#> GSM494626     4  0.1993      0.900 0.016 0.016 0.024 0.944
#> GSM494656     3  0.2531      0.876 0.032 0.020 0.924 0.024
#> GSM494635     1  0.3444      0.929 0.816 0.000 0.000 0.184

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     3  0.4808     0.2161 0.000 0.024 0.576 0.000 0.400
#> GSM494594     3  0.3106     0.5841 0.000 0.000 0.844 0.024 0.132
#> GSM494604     1  0.3496     0.8118 0.844 0.056 0.000 0.008 0.092
#> GSM494564     3  0.4649     0.2188 0.000 0.000 0.580 0.016 0.404
#> GSM494591     3  0.3106     0.5841 0.000 0.000 0.844 0.024 0.132
#> GSM494567     3  0.0290     0.5881 0.000 0.000 0.992 0.008 0.000
#> GSM494602     2  0.0290     0.9257 0.000 0.992 0.000 0.008 0.000
#> GSM494613     3  0.0290     0.5881 0.000 0.000 0.992 0.008 0.000
#> GSM494589     3  0.4192     0.2553 0.000 0.000 0.596 0.000 0.404
#> GSM494598     2  0.0992     0.9221 0.000 0.968 0.000 0.008 0.024
#> GSM494593     2  0.1408     0.9192 0.000 0.948 0.000 0.008 0.044
#> GSM494583     2  0.5693     0.4849 0.000 0.620 0.144 0.000 0.236
#> GSM494612     2  0.0290     0.9257 0.000 0.992 0.000 0.008 0.000
#> GSM494558     3  0.6519    -0.1216 0.000 0.000 0.456 0.204 0.340
#> GSM494556     3  0.2886     0.5183 0.000 0.000 0.844 0.008 0.148
#> GSM494559     3  0.4640     0.2214 0.000 0.000 0.584 0.016 0.400
#> GSM494571     3  0.3152     0.5821 0.000 0.000 0.840 0.024 0.136
#> GSM494614     3  0.4183     0.3910 0.000 0.008 0.712 0.008 0.272
#> GSM494603     5  0.6466    -0.4024 0.004 0.000 0.164 0.360 0.472
#> GSM494568     4  0.5374     0.7049 0.004 0.000 0.052 0.568 0.376
#> GSM494572     3  0.3106     0.5841 0.000 0.000 0.844 0.024 0.132
#> GSM494600     3  0.4192     0.2553 0.000 0.000 0.596 0.000 0.404
#> GSM494562     2  0.0290     0.9257 0.000 0.992 0.000 0.000 0.008
#> GSM494615     3  0.3053     0.5145 0.000 0.000 0.828 0.008 0.164
#> GSM494582     2  0.0162     0.9258 0.000 0.996 0.000 0.004 0.000
#> GSM494599     2  0.1830     0.9133 0.000 0.924 0.000 0.008 0.068
#> GSM494610     2  0.0992     0.9221 0.000 0.968 0.000 0.008 0.024
#> GSM494587     2  0.0404     0.9235 0.000 0.988 0.012 0.000 0.000
#> GSM494581     2  0.3479     0.8420 0.000 0.836 0.080 0.000 0.084
#> GSM494580     3  0.0290     0.5881 0.000 0.000 0.992 0.008 0.000
#> GSM494563     3  0.6213    -0.0214 0.000 0.140 0.452 0.000 0.408
#> GSM494576     2  0.0510     0.9226 0.000 0.984 0.016 0.000 0.000
#> GSM494605     1  0.0963     0.9164 0.964 0.000 0.000 0.000 0.036
#> GSM494584     3  0.6694     0.0477 0.000 0.260 0.496 0.008 0.236
#> GSM494586     2  0.0000     0.9255 0.000 1.000 0.000 0.000 0.000
#> GSM494578     3  0.0290     0.5881 0.000 0.000 0.992 0.008 0.000
#> GSM494585     2  0.0404     0.9235 0.000 0.988 0.012 0.000 0.000
#> GSM494611     2  0.0290     0.9257 0.000 0.992 0.000 0.008 0.000
#> GSM494560     3  0.4331     0.2511 0.000 0.004 0.596 0.000 0.400
#> GSM494595     2  0.0000     0.9255 0.000 1.000 0.000 0.000 0.000
#> GSM494570     5  0.6551     0.1603 0.000 0.000 0.384 0.200 0.416
#> GSM494597     3  0.3106     0.5841 0.000 0.000 0.844 0.024 0.132
#> GSM494607     2  0.2193     0.9022 0.000 0.900 0.000 0.008 0.092
#> GSM494561     5  0.6596     0.1831 0.000 0.000 0.372 0.212 0.416
#> GSM494569     4  0.5014     0.7867 0.040 0.000 0.000 0.592 0.368
#> GSM494592     2  0.1484     0.9181 0.000 0.944 0.000 0.008 0.048
#> GSM494577     2  0.4815     0.6249 0.000 0.692 0.064 0.000 0.244
#> GSM494588     3  0.6438    -0.2915 0.000 0.004 0.436 0.152 0.408
#> GSM494590     3  0.3106     0.5841 0.000 0.000 0.844 0.024 0.132
#> GSM494609     2  0.1725     0.9152 0.000 0.936 0.020 0.000 0.044
#> GSM494608     2  0.1725     0.9152 0.000 0.936 0.020 0.000 0.044
#> GSM494606     2  0.1408     0.9192 0.000 0.948 0.000 0.008 0.044
#> GSM494574     2  0.0992     0.9221 0.000 0.968 0.000 0.008 0.024
#> GSM494573     3  0.4192     0.2553 0.000 0.000 0.596 0.000 0.404
#> GSM494566     2  0.5956     0.5594 0.000 0.616 0.152 0.008 0.224
#> GSM494601     2  0.1121     0.9195 0.000 0.956 0.000 0.000 0.044
#> GSM494557     3  0.0290     0.5881 0.000 0.000 0.992 0.008 0.000
#> GSM494579     2  0.3574     0.7861 0.000 0.804 0.028 0.000 0.168
#> GSM494596     3  0.3106     0.5841 0.000 0.000 0.844 0.024 0.132
#> GSM494575     2  0.0290     0.9257 0.000 0.992 0.000 0.008 0.000
#> GSM494625     4  0.1043     0.7391 0.040 0.000 0.000 0.960 0.000
#> GSM494654     3  0.4639     0.3524 0.000 0.000 0.632 0.024 0.344
#> GSM494664     1  0.1043     0.9139 0.960 0.000 0.000 0.000 0.040
#> GSM494624     4  0.1043     0.7391 0.040 0.000 0.000 0.960 0.000
#> GSM494651     4  0.4990     0.7917 0.040 0.000 0.000 0.600 0.360
#> GSM494662     4  0.4398     0.8017 0.040 0.000 0.000 0.720 0.240
#> GSM494627     4  0.4840     0.7985 0.040 0.000 0.000 0.640 0.320
#> GSM494673     1  0.0404     0.9318 0.988 0.000 0.000 0.000 0.012
#> GSM494649     4  0.1043     0.7391 0.040 0.000 0.000 0.960 0.000
#> GSM494658     1  0.1618     0.9061 0.944 0.008 0.000 0.008 0.040
#> GSM494653     1  0.0290     0.9328 0.992 0.000 0.000 0.000 0.008
#> GSM494643     4  0.3192     0.7742 0.040 0.000 0.000 0.848 0.112
#> GSM494672     1  0.0992     0.9223 0.968 0.008 0.000 0.000 0.024
#> GSM494618     4  0.4990     0.7917 0.040 0.000 0.000 0.600 0.360
#> GSM494631     3  0.5490     0.1258 0.000 0.000 0.644 0.128 0.228
#> GSM494619     4  0.1043     0.7391 0.040 0.000 0.000 0.960 0.000
#> GSM494674     1  0.0000     0.9339 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.4990     0.7917 0.040 0.000 0.000 0.600 0.360
#> GSM494663     4  0.4840     0.7985 0.040 0.000 0.000 0.640 0.320
#> GSM494628     4  0.4990     0.7917 0.040 0.000 0.000 0.600 0.360
#> GSM494632     1  0.5641    -0.1115 0.488 0.000 0.000 0.436 0.076
#> GSM494660     4  0.1043     0.7391 0.040 0.000 0.000 0.960 0.000
#> GSM494622     4  0.4886     0.7772 0.032 0.000 0.000 0.596 0.372
#> GSM494642     1  0.0000     0.9339 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.9339 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0290     0.9328 0.992 0.000 0.000 0.000 0.008
#> GSM494670     1  0.0703     0.9273 0.976 0.000 0.000 0.000 0.024
#> GSM494675     3  0.3053     0.5140 0.000 0.000 0.828 0.008 0.164
#> GSM494641     1  0.0000     0.9339 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.4552     0.8013 0.040 0.000 0.000 0.696 0.264
#> GSM494640     4  0.4284     0.8002 0.040 0.000 0.000 0.736 0.224
#> GSM494623     4  0.1043     0.7391 0.040 0.000 0.000 0.960 0.000
#> GSM494644     1  0.0000     0.9339 1.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.4284     0.6186 0.736 0.000 0.000 0.224 0.040
#> GSM494665     1  0.0963     0.9164 0.964 0.000 0.000 0.000 0.036
#> GSM494638     4  0.4990     0.7917 0.040 0.000 0.000 0.600 0.360
#> GSM494645     1  0.0000     0.9339 1.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0992     0.9223 0.968 0.008 0.000 0.000 0.024
#> GSM494655     1  0.0000     0.9339 1.000 0.000 0.000 0.000 0.000
#> GSM494620     4  0.1043     0.7391 0.040 0.000 0.000 0.960 0.000
#> GSM494630     4  0.1043     0.7391 0.040 0.000 0.000 0.960 0.000
#> GSM494657     3  0.3106     0.5841 0.000 0.000 0.844 0.024 0.132
#> GSM494667     1  0.0000     0.9339 1.000 0.000 0.000 0.000 0.000
#> GSM494621     4  0.1043     0.7391 0.040 0.000 0.000 0.960 0.000
#> GSM494629     4  0.4697     0.7951 0.032 0.000 0.000 0.648 0.320
#> GSM494637     4  0.4284     0.8002 0.040 0.000 0.000 0.736 0.224
#> GSM494652     1  0.0162     0.9334 0.996 0.000 0.000 0.000 0.004
#> GSM494648     4  0.1043     0.7391 0.040 0.000 0.000 0.960 0.000
#> GSM494650     4  0.5026     0.7839 0.040 0.000 0.000 0.588 0.372
#> GSM494669     1  0.0000     0.9339 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.1043     0.9139 0.960 0.000 0.000 0.000 0.040
#> GSM494668     1  0.0609     0.9287 0.980 0.000 0.000 0.000 0.020
#> GSM494633     4  0.1043     0.7391 0.040 0.000 0.000 0.960 0.000
#> GSM494634     1  0.0290     0.9328 0.992 0.000 0.000 0.000 0.008
#> GSM494639     1  0.5342     0.3422 0.612 0.000 0.000 0.312 0.076
#> GSM494661     1  0.0000     0.9339 1.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.4990     0.7917 0.040 0.000 0.000 0.600 0.360
#> GSM494626     4  0.4990     0.7917 0.040 0.000 0.000 0.600 0.360
#> GSM494656     3  0.3368     0.5691 0.000 0.000 0.820 0.024 0.156
#> GSM494635     1  0.0000     0.9339 1.000 0.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM494565     5  0.0767     0.6906 0.000 0.012 0.008 0.000 0.976 0.004
#> GSM494594     3  0.2664     0.7996 0.000 0.000 0.816 0.000 0.184 0.000
#> GSM494604     1  0.4052     0.8019 0.812 0.036 0.048 0.000 0.024 0.080
#> GSM494564     5  0.0891     0.6905 0.000 0.000 0.024 0.000 0.968 0.008
#> GSM494591     3  0.2730     0.8018 0.000 0.000 0.808 0.000 0.192 0.000
#> GSM494567     3  0.5771     0.5537 0.000 0.000 0.500 0.004 0.328 0.168
#> GSM494602     2  0.0000     0.8785 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494613     3  0.5809     0.5599 0.000 0.000 0.496 0.004 0.324 0.176
#> GSM494589     5  0.0790     0.6883 0.000 0.000 0.032 0.000 0.968 0.000
#> GSM494598     2  0.1585     0.8696 0.000 0.940 0.012 0.000 0.012 0.036
#> GSM494593     2  0.1616     0.8713 0.000 0.932 0.020 0.000 0.000 0.048
#> GSM494583     5  0.5635    -0.1507 0.000 0.420 0.000 0.000 0.432 0.148
#> GSM494612     2  0.0000     0.8785 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     4  0.5230     0.4697 0.000 0.000 0.208 0.648 0.016 0.128
#> GSM494556     5  0.5934    -0.2821 0.000 0.000 0.376 0.004 0.436 0.184
#> GSM494559     5  0.1003     0.6916 0.000 0.000 0.020 0.000 0.964 0.016
#> GSM494571     3  0.2631     0.7977 0.000 0.000 0.820 0.000 0.180 0.000
#> GSM494614     5  0.5439     0.3316 0.000 0.008 0.152 0.004 0.620 0.216
#> GSM494603     4  0.4739     0.5526 0.000 0.000 0.048 0.732 0.076 0.144
#> GSM494568     4  0.3382     0.6382 0.000 0.000 0.048 0.820 0.008 0.124
#> GSM494572     3  0.2730     0.8018 0.000 0.000 0.808 0.000 0.192 0.000
#> GSM494600     5  0.0790     0.6883 0.000 0.000 0.032 0.000 0.968 0.000
#> GSM494562     2  0.1049     0.8765 0.000 0.960 0.000 0.000 0.008 0.032
#> GSM494615     5  0.6027    -0.2760 0.000 0.000 0.372 0.008 0.436 0.184
#> GSM494582     2  0.0777     0.8773 0.000 0.972 0.000 0.000 0.004 0.024
#> GSM494599     2  0.2642     0.8582 0.000 0.884 0.032 0.000 0.020 0.064
#> GSM494610     2  0.1657     0.8687 0.000 0.936 0.012 0.000 0.012 0.040
#> GSM494587     2  0.2431     0.8505 0.000 0.860 0.000 0.000 0.008 0.132
#> GSM494581     2  0.5155     0.7067 0.000 0.668 0.020 0.000 0.132 0.180
#> GSM494580     3  0.5771     0.5537 0.000 0.000 0.500 0.004 0.328 0.168
#> GSM494563     5  0.1082     0.6758 0.000 0.040 0.000 0.000 0.956 0.004
#> GSM494576     2  0.3377     0.8166 0.000 0.808 0.000 0.000 0.056 0.136
#> GSM494605     1  0.2765     0.8722 0.872 0.000 0.064 0.056 0.000 0.008
#> GSM494584     5  0.5762     0.3904 0.000 0.172 0.012 0.000 0.556 0.260
#> GSM494586     2  0.1471     0.8763 0.000 0.932 0.000 0.000 0.004 0.064
#> GSM494578     3  0.5818     0.5440 0.000 0.000 0.492 0.004 0.328 0.176
#> GSM494585     2  0.2278     0.8526 0.000 0.868 0.000 0.000 0.004 0.128
#> GSM494611     2  0.0146     0.8781 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM494560     5  0.0951     0.6916 0.000 0.008 0.020 0.000 0.968 0.004
#> GSM494595     2  0.1010     0.8785 0.000 0.960 0.000 0.000 0.004 0.036
#> GSM494570     5  0.2147     0.6528 0.000 0.000 0.020 0.000 0.896 0.084
#> GSM494597     3  0.2871     0.8004 0.000 0.000 0.804 0.000 0.192 0.004
#> GSM494607     2  0.3401     0.8422 0.004 0.840 0.044 0.000 0.024 0.088
#> GSM494561     5  0.4002     0.4794 0.000 0.000 0.036 0.000 0.704 0.260
#> GSM494569     4  0.0291     0.7520 0.004 0.000 0.000 0.992 0.000 0.004
#> GSM494592     2  0.1974     0.8684 0.000 0.920 0.020 0.000 0.012 0.048
#> GSM494577     2  0.5461     0.3964 0.000 0.528 0.000 0.000 0.332 0.140
#> GSM494588     5  0.1531     0.6704 0.000 0.000 0.004 0.000 0.928 0.068
#> GSM494590     3  0.2730     0.8018 0.000 0.000 0.808 0.000 0.192 0.000
#> GSM494609     2  0.3229     0.8370 0.000 0.804 0.020 0.000 0.004 0.172
#> GSM494608     2  0.3296     0.8352 0.000 0.796 0.020 0.000 0.004 0.180
#> GSM494606     2  0.2039     0.8717 0.000 0.904 0.020 0.000 0.000 0.076
#> GSM494574     2  0.1657     0.8687 0.000 0.936 0.012 0.000 0.012 0.040
#> GSM494573     5  0.0790     0.6883 0.000 0.000 0.032 0.000 0.968 0.000
#> GSM494566     2  0.6936     0.2251 0.000 0.400 0.028 0.016 0.256 0.300
#> GSM494601     2  0.2094     0.8721 0.000 0.900 0.020 0.000 0.000 0.080
#> GSM494557     3  0.5818     0.5538 0.000 0.000 0.492 0.004 0.328 0.176
#> GSM494579     2  0.5341     0.6607 0.000 0.632 0.012 0.000 0.188 0.168
#> GSM494596     3  0.2730     0.8018 0.000 0.000 0.808 0.000 0.192 0.000
#> GSM494575     2  0.0000     0.8785 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     6  0.3756     0.9740 0.004 0.000 0.000 0.352 0.000 0.644
#> GSM494654     3  0.2605     0.6251 0.000 0.000 0.864 0.108 0.028 0.000
#> GSM494664     1  0.3055     0.8601 0.852 0.000 0.068 0.072 0.000 0.008
#> GSM494624     6  0.3878     0.9769 0.004 0.000 0.000 0.348 0.004 0.644
#> GSM494651     4  0.0146     0.7518 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM494662     4  0.4482     0.3715 0.004 0.000 0.096 0.712 0.000 0.188
#> GSM494627     4  0.2074     0.7261 0.004 0.000 0.048 0.912 0.000 0.036
#> GSM494673     1  0.0146     0.9131 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM494649     6  0.3756     0.9740 0.004 0.000 0.000 0.352 0.000 0.644
#> GSM494658     1  0.2255     0.8831 0.912 0.004 0.028 0.000 0.020 0.036
#> GSM494653     1  0.0146     0.9131 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM494643     6  0.4767     0.7310 0.004 0.000 0.040 0.444 0.000 0.512
#> GSM494672     1  0.1007     0.9046 0.968 0.004 0.004 0.000 0.016 0.008
#> GSM494618     4  0.0146     0.7518 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM494631     4  0.6778    -0.0703 0.000 0.000 0.332 0.424 0.064 0.180
#> GSM494619     6  0.3878     0.9769 0.004 0.000 0.000 0.348 0.004 0.644
#> GSM494674     1  0.0000     0.9137 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0146     0.7518 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM494663     4  0.1938     0.7262 0.004 0.000 0.036 0.920 0.000 0.040
#> GSM494628     4  0.0935     0.7489 0.004 0.000 0.032 0.964 0.000 0.000
#> GSM494632     1  0.5701     0.1835 0.480 0.000 0.088 0.408 0.000 0.024
#> GSM494660     6  0.3756     0.9740 0.004 0.000 0.000 0.352 0.000 0.644
#> GSM494622     4  0.1151     0.7459 0.000 0.000 0.032 0.956 0.000 0.012
#> GSM494642     1  0.0000     0.9137 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.9137 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000     0.9137 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.1369     0.9044 0.952 0.000 0.016 0.000 0.016 0.016
#> GSM494675     5  0.5877    -0.3052 0.000 0.000 0.380 0.004 0.444 0.172
#> GSM494641     1  0.0000     0.9137 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.4259     0.4268 0.004 0.000 0.096 0.740 0.000 0.160
#> GSM494640     4  0.4526     0.1324 0.004 0.000 0.052 0.656 0.000 0.288
#> GSM494623     6  0.3878     0.9769 0.004 0.000 0.000 0.348 0.004 0.644
#> GSM494644     1  0.0717     0.9104 0.976 0.000 0.016 0.000 0.000 0.008
#> GSM494646     1  0.5217     0.5831 0.640 0.000 0.088 0.248 0.000 0.024
#> GSM494665     1  0.2703     0.8744 0.876 0.000 0.064 0.052 0.000 0.008
#> GSM494638     4  0.2622     0.6679 0.004 0.000 0.104 0.868 0.000 0.024
#> GSM494645     1  0.1643     0.8952 0.924 0.000 0.068 0.000 0.000 0.008
#> GSM494671     1  0.1007     0.9046 0.968 0.004 0.004 0.000 0.016 0.008
#> GSM494655     1  0.0000     0.9137 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.3878     0.9769 0.004 0.000 0.000 0.348 0.004 0.644
#> GSM494630     6  0.4014     0.9739 0.004 0.000 0.004 0.348 0.004 0.640
#> GSM494657     3  0.2730     0.8018 0.000 0.000 0.808 0.000 0.192 0.000
#> GSM494667     1  0.0000     0.9137 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.3878     0.9769 0.004 0.000 0.000 0.348 0.004 0.644
#> GSM494629     4  0.1930     0.7264 0.000 0.000 0.048 0.916 0.000 0.036
#> GSM494637     4  0.4409     0.1311 0.004 0.000 0.044 0.664 0.000 0.288
#> GSM494652     1  0.0000     0.9137 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.3878     0.9769 0.004 0.000 0.000 0.348 0.004 0.644
#> GSM494650     4  0.1080     0.7489 0.004 0.000 0.032 0.960 0.000 0.004
#> GSM494669     1  0.0000     0.9137 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.2999     0.8628 0.856 0.000 0.068 0.068 0.000 0.008
#> GSM494668     1  0.1275     0.9057 0.956 0.000 0.012 0.000 0.016 0.016
#> GSM494633     6  0.3878     0.9769 0.004 0.000 0.000 0.348 0.004 0.644
#> GSM494634     1  0.0291     0.9115 0.992 0.004 0.004 0.000 0.000 0.000
#> GSM494639     1  0.5546     0.4133 0.560 0.000 0.088 0.328 0.000 0.024
#> GSM494661     1  0.1643     0.8952 0.924 0.000 0.068 0.000 0.000 0.008
#> GSM494617     4  0.1349     0.7167 0.004 0.000 0.056 0.940 0.000 0.000
#> GSM494626     4  0.0405     0.7488 0.004 0.000 0.008 0.988 0.000 0.000
#> GSM494656     3  0.2581     0.7440 0.000 0.000 0.860 0.020 0.120 0.000
#> GSM494635     1  0.2763     0.8716 0.868 0.000 0.088 0.036 0.000 0.008

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

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-kmeans-collect-classes

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

test_to_known_factors(res)
#>              n disease.state(p) age(p) other(p) individual(p) k
#> MAD:kmeans 119         1.96e-20  1.000 1.13e-15         1.000 2
#> MAD:kmeans  69         2.83e-11  0.828 2.71e-07         0.938 3
#> MAD:kmeans 117         2.40e-18  0.366 6.29e-12         0.851 4
#> MAD:kmeans 100         3.84e-16  0.297 7.29e-13         0.644 5
#> MAD:kmeans 103         4.77e-15  0.168 2.02e-09         0.340 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 51941 rows and 120 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 6.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.991       0.994         0.5045 0.496   0.496
#> 3 3 0.706           0.878       0.832         0.3014 0.752   0.542
#> 4 4 1.000           0.983       0.993         0.1502 0.828   0.545
#> 5 5 0.932           0.871       0.886         0.0500 0.949   0.799
#> 6 6 0.982           0.944       0.964         0.0373 0.954   0.788

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 5

There is also optional best \(k\) = 2 4 5 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
#> GSM494565     2  0.0000      0.995 0.000 1.000
#> GSM494594     2  0.0000      0.995 0.000 1.000
#> GSM494604     1  0.0000      0.993 1.000 0.000
#> GSM494564     2  0.0000      0.995 0.000 1.000
#> GSM494591     2  0.0000      0.995 0.000 1.000
#> GSM494567     2  0.0000      0.995 0.000 1.000
#> GSM494602     2  0.0672      0.994 0.008 0.992
#> GSM494613     2  0.0000      0.995 0.000 1.000
#> GSM494589     2  0.0000      0.995 0.000 1.000
#> GSM494598     2  0.0672      0.994 0.008 0.992
#> GSM494593     2  0.0672      0.994 0.008 0.992
#> GSM494583     2  0.0000      0.995 0.000 1.000
#> GSM494612     2  0.0672      0.994 0.008 0.992
#> GSM494558     2  0.0000      0.995 0.000 1.000
#> GSM494556     2  0.0000      0.995 0.000 1.000
#> GSM494559     2  0.0000      0.995 0.000 1.000
#> GSM494571     2  0.0000      0.995 0.000 1.000
#> GSM494614     2  0.0000      0.995 0.000 1.000
#> GSM494603     2  0.3879      0.917 0.076 0.924
#> GSM494568     1  0.7139      0.765 0.804 0.196
#> GSM494572     2  0.0000      0.995 0.000 1.000
#> GSM494600     2  0.0000      0.995 0.000 1.000
#> GSM494562     2  0.0672      0.994 0.008 0.992
#> GSM494615     2  0.0000      0.995 0.000 1.000
#> GSM494582     2  0.0672      0.994 0.008 0.992
#> GSM494599     2  0.0672      0.994 0.008 0.992
#> GSM494610     2  0.0672      0.994 0.008 0.992
#> GSM494587     2  0.0672      0.994 0.008 0.992
#> GSM494581     2  0.0672      0.994 0.008 0.992
#> GSM494580     2  0.0000      0.995 0.000 1.000
#> GSM494563     2  0.0000      0.995 0.000 1.000
#> GSM494576     2  0.0672      0.994 0.008 0.992
#> GSM494605     1  0.0000      0.993 1.000 0.000
#> GSM494584     2  0.0000      0.995 0.000 1.000
#> GSM494586     2  0.0672      0.994 0.008 0.992
#> GSM494578     2  0.0000      0.995 0.000 1.000
#> GSM494585     2  0.0672      0.994 0.008 0.992
#> GSM494611     2  0.0672      0.994 0.008 0.992
#> GSM494560     2  0.0000      0.995 0.000 1.000
#> GSM494595     2  0.0672      0.994 0.008 0.992
#> GSM494570     2  0.0000      0.995 0.000 1.000
#> GSM494597     2  0.0000      0.995 0.000 1.000
#> GSM494607     2  0.0672      0.994 0.008 0.992
#> GSM494561     2  0.0000      0.995 0.000 1.000
#> GSM494569     1  0.0672      0.993 0.992 0.008
#> GSM494592     2  0.0672      0.994 0.008 0.992
#> GSM494577     2  0.0672      0.994 0.008 0.992
#> GSM494588     2  0.0000      0.995 0.000 1.000
#> GSM494590     2  0.0000      0.995 0.000 1.000
#> GSM494609     2  0.0672      0.994 0.008 0.992
#> GSM494608     2  0.0672      0.994 0.008 0.992
#> GSM494606     2  0.0672      0.994 0.008 0.992
#> GSM494574     2  0.0672      0.994 0.008 0.992
#> GSM494573     2  0.0000      0.995 0.000 1.000
#> GSM494566     2  0.0672      0.994 0.008 0.992
#> GSM494601     2  0.0672      0.994 0.008 0.992
#> GSM494557     2  0.0000      0.995 0.000 1.000
#> GSM494579     2  0.0672      0.994 0.008 0.992
#> GSM494596     2  0.0000      0.995 0.000 1.000
#> GSM494575     2  0.0672      0.994 0.008 0.992
#> GSM494625     1  0.0672      0.993 0.992 0.008
#> GSM494654     2  0.0000      0.995 0.000 1.000
#> GSM494664     1  0.0000      0.993 1.000 0.000
#> GSM494624     1  0.0672      0.993 0.992 0.008
#> GSM494651     1  0.0672      0.993 0.992 0.008
#> GSM494662     1  0.0672      0.993 0.992 0.008
#> GSM494627     1  0.0672      0.993 0.992 0.008
#> GSM494673     1  0.0000      0.993 1.000 0.000
#> GSM494649     1  0.0672      0.993 0.992 0.008
#> GSM494658     1  0.0000      0.993 1.000 0.000
#> GSM494653     1  0.0000      0.993 1.000 0.000
#> GSM494643     1  0.0672      0.993 0.992 0.008
#> GSM494672     1  0.0000      0.993 1.000 0.000
#> GSM494618     1  0.0672      0.993 0.992 0.008
#> GSM494631     2  0.0376      0.993 0.004 0.996
#> GSM494619     1  0.0672      0.993 0.992 0.008
#> GSM494674     1  0.0000      0.993 1.000 0.000
#> GSM494616     1  0.0672      0.993 0.992 0.008
#> GSM494663     1  0.0672      0.993 0.992 0.008
#> GSM494628     1  0.0672      0.993 0.992 0.008
#> GSM494632     1  0.0000      0.993 1.000 0.000
#> GSM494660     1  0.0672      0.993 0.992 0.008
#> GSM494622     1  0.0672      0.993 0.992 0.008
#> GSM494642     1  0.0000      0.993 1.000 0.000
#> GSM494647     1  0.0000      0.993 1.000 0.000
#> GSM494659     1  0.0000      0.993 1.000 0.000
#> GSM494670     1  0.0000      0.993 1.000 0.000
#> GSM494675     2  0.0000      0.995 0.000 1.000
#> GSM494641     1  0.0000      0.993 1.000 0.000
#> GSM494636     1  0.0672      0.993 0.992 0.008
#> GSM494640     1  0.0672      0.993 0.992 0.008
#> GSM494623     1  0.0672      0.993 0.992 0.008
#> GSM494644     1  0.0000      0.993 1.000 0.000
#> GSM494646     1  0.0000      0.993 1.000 0.000
#> GSM494665     1  0.0000      0.993 1.000 0.000
#> GSM494638     1  0.0672      0.993 0.992 0.008
#> GSM494645     1  0.0000      0.993 1.000 0.000
#> GSM494671     1  0.0000      0.993 1.000 0.000
#> GSM494655     1  0.0000      0.993 1.000 0.000
#> GSM494620     1  0.0672      0.993 0.992 0.008
#> GSM494630     1  0.0672      0.993 0.992 0.008
#> GSM494657     2  0.0000      0.995 0.000 1.000
#> GSM494667     1  0.0000      0.993 1.000 0.000
#> GSM494621     1  0.0672      0.993 0.992 0.008
#> GSM494629     1  0.0672      0.993 0.992 0.008
#> GSM494637     1  0.0672      0.993 0.992 0.008
#> GSM494652     1  0.0000      0.993 1.000 0.000
#> GSM494648     1  0.0672      0.993 0.992 0.008
#> GSM494650     1  0.0672      0.993 0.992 0.008
#> GSM494669     1  0.0000      0.993 1.000 0.000
#> GSM494666     1  0.0000      0.993 1.000 0.000
#> GSM494668     1  0.0000      0.993 1.000 0.000
#> GSM494633     1  0.0672      0.993 0.992 0.008
#> GSM494634     1  0.0000      0.993 1.000 0.000
#> GSM494639     1  0.0000      0.993 1.000 0.000
#> GSM494661     1  0.0000      0.993 1.000 0.000
#> GSM494617     1  0.0672      0.993 0.992 0.008
#> GSM494626     1  0.0672      0.993 0.992 0.008
#> GSM494656     2  0.0000      0.995 0.000 1.000
#> GSM494635     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
#> GSM494565     2   0.000      0.886 0.000 1.000 0.000
#> GSM494594     2   0.000      0.886 0.000 1.000 0.000
#> GSM494604     1   0.000      0.721 1.000 0.000 0.000
#> GSM494564     2   0.000      0.886 0.000 1.000 0.000
#> GSM494591     2   0.000      0.886 0.000 1.000 0.000
#> GSM494567     2   0.000      0.886 0.000 1.000 0.000
#> GSM494602     2   0.497      0.873 0.236 0.764 0.000
#> GSM494613     2   0.000      0.886 0.000 1.000 0.000
#> GSM494589     2   0.000      0.886 0.000 1.000 0.000
#> GSM494598     2   0.497      0.873 0.236 0.764 0.000
#> GSM494593     2   0.497      0.873 0.236 0.764 0.000
#> GSM494583     2   0.493      0.875 0.232 0.768 0.000
#> GSM494612     2   0.497      0.873 0.236 0.764 0.000
#> GSM494558     3   0.497      0.738 0.000 0.236 0.764
#> GSM494556     2   0.000      0.886 0.000 1.000 0.000
#> GSM494559     2   0.000      0.886 0.000 1.000 0.000
#> GSM494571     3   0.611      0.508 0.000 0.396 0.604
#> GSM494614     2   0.000      0.886 0.000 1.000 0.000
#> GSM494603     3   0.497      0.738 0.000 0.236 0.764
#> GSM494568     3   0.493      0.741 0.000 0.232 0.768
#> GSM494572     2   0.000      0.886 0.000 1.000 0.000
#> GSM494600     2   0.000      0.886 0.000 1.000 0.000
#> GSM494562     2   0.493      0.875 0.232 0.768 0.000
#> GSM494615     2   0.000      0.886 0.000 1.000 0.000
#> GSM494582     2   0.497      0.873 0.236 0.764 0.000
#> GSM494599     1   0.226      0.646 0.932 0.068 0.000
#> GSM494610     2   0.497      0.873 0.236 0.764 0.000
#> GSM494587     2   0.493      0.875 0.232 0.768 0.000
#> GSM494581     2   0.493      0.875 0.232 0.768 0.000
#> GSM494580     2   0.000      0.886 0.000 1.000 0.000
#> GSM494563     2   0.000      0.886 0.000 1.000 0.000
#> GSM494576     2   0.493      0.875 0.232 0.768 0.000
#> GSM494605     1   0.493      0.944 0.768 0.000 0.232
#> GSM494584     2   0.103      0.886 0.024 0.976 0.000
#> GSM494586     2   0.493      0.875 0.232 0.768 0.000
#> GSM494578     2   0.000      0.886 0.000 1.000 0.000
#> GSM494585     2   0.493      0.875 0.232 0.768 0.000
#> GSM494611     2   0.497      0.873 0.236 0.764 0.000
#> GSM494560     2   0.000      0.886 0.000 1.000 0.000
#> GSM494595     2   0.497      0.873 0.236 0.764 0.000
#> GSM494570     3   0.497      0.738 0.000 0.236 0.764
#> GSM494597     2   0.000      0.886 0.000 1.000 0.000
#> GSM494607     1   0.000      0.721 1.000 0.000 0.000
#> GSM494561     3   0.497      0.738 0.000 0.236 0.764
#> GSM494569     3   0.000      0.906 0.000 0.000 1.000
#> GSM494592     1   0.226      0.646 0.932 0.068 0.000
#> GSM494577     2   0.493      0.875 0.232 0.768 0.000
#> GSM494588     2   0.000      0.886 0.000 1.000 0.000
#> GSM494590     2   0.000      0.886 0.000 1.000 0.000
#> GSM494609     2   0.497      0.873 0.236 0.764 0.000
#> GSM494608     2   0.497      0.873 0.236 0.764 0.000
#> GSM494606     2   0.595      0.748 0.360 0.640 0.000
#> GSM494574     2   0.497      0.873 0.236 0.764 0.000
#> GSM494573     2   0.000      0.886 0.000 1.000 0.000
#> GSM494566     2   0.493      0.875 0.232 0.768 0.000
#> GSM494601     2   0.497      0.873 0.236 0.764 0.000
#> GSM494557     2   0.000      0.886 0.000 1.000 0.000
#> GSM494579     2   0.493      0.875 0.232 0.768 0.000
#> GSM494596     2   0.000      0.886 0.000 1.000 0.000
#> GSM494575     2   0.497      0.873 0.236 0.764 0.000
#> GSM494625     3   0.000      0.906 0.000 0.000 1.000
#> GSM494654     3   0.497      0.738 0.000 0.236 0.764
#> GSM494664     1   0.497      0.941 0.764 0.000 0.236
#> GSM494624     3   0.000      0.906 0.000 0.000 1.000
#> GSM494651     3   0.000      0.906 0.000 0.000 1.000
#> GSM494662     3   0.000      0.906 0.000 0.000 1.000
#> GSM494627     3   0.000      0.906 0.000 0.000 1.000
#> GSM494673     1   0.493      0.944 0.768 0.000 0.232
#> GSM494649     3   0.000      0.906 0.000 0.000 1.000
#> GSM494658     1   0.207      0.779 0.940 0.000 0.060
#> GSM494653     1   0.493      0.944 0.768 0.000 0.232
#> GSM494643     3   0.000      0.906 0.000 0.000 1.000
#> GSM494672     1   0.493      0.944 0.768 0.000 0.232
#> GSM494618     3   0.000      0.906 0.000 0.000 1.000
#> GSM494631     3   0.562      0.663 0.000 0.308 0.692
#> GSM494619     3   0.000      0.906 0.000 0.000 1.000
#> GSM494674     1   0.493      0.944 0.768 0.000 0.232
#> GSM494616     3   0.000      0.906 0.000 0.000 1.000
#> GSM494663     3   0.000      0.906 0.000 0.000 1.000
#> GSM494628     3   0.000      0.906 0.000 0.000 1.000
#> GSM494632     1   0.497      0.941 0.764 0.000 0.236
#> GSM494660     3   0.000      0.906 0.000 0.000 1.000
#> GSM494622     3   0.000      0.906 0.000 0.000 1.000
#> GSM494642     1   0.493      0.944 0.768 0.000 0.232
#> GSM494647     1   0.493      0.944 0.768 0.000 0.232
#> GSM494659     1   0.493      0.944 0.768 0.000 0.232
#> GSM494670     1   0.493      0.944 0.768 0.000 0.232
#> GSM494675     2   0.000      0.886 0.000 1.000 0.000
#> GSM494641     1   0.493      0.944 0.768 0.000 0.232
#> GSM494636     3   0.000      0.906 0.000 0.000 1.000
#> GSM494640     3   0.000      0.906 0.000 0.000 1.000
#> GSM494623     3   0.000      0.906 0.000 0.000 1.000
#> GSM494644     1   0.493      0.944 0.768 0.000 0.232
#> GSM494646     1   0.497      0.941 0.764 0.000 0.236
#> GSM494665     1   0.493      0.944 0.768 0.000 0.232
#> GSM494638     3   0.216      0.830 0.064 0.000 0.936
#> GSM494645     1   0.497      0.941 0.764 0.000 0.236
#> GSM494671     1   0.493      0.944 0.768 0.000 0.232
#> GSM494655     1   0.493      0.944 0.768 0.000 0.232
#> GSM494620     3   0.000      0.906 0.000 0.000 1.000
#> GSM494630     3   0.000      0.906 0.000 0.000 1.000
#> GSM494657     2   0.000      0.886 0.000 1.000 0.000
#> GSM494667     1   0.493      0.944 0.768 0.000 0.232
#> GSM494621     3   0.000      0.906 0.000 0.000 1.000
#> GSM494629     3   0.103      0.889 0.000 0.024 0.976
#> GSM494637     3   0.000      0.906 0.000 0.000 1.000
#> GSM494652     1   0.493      0.944 0.768 0.000 0.232
#> GSM494648     3   0.000      0.906 0.000 0.000 1.000
#> GSM494650     3   0.000      0.906 0.000 0.000 1.000
#> GSM494669     1   0.493      0.944 0.768 0.000 0.232
#> GSM494666     1   0.497      0.941 0.764 0.000 0.236
#> GSM494668     1   0.493      0.944 0.768 0.000 0.232
#> GSM494633     3   0.000      0.906 0.000 0.000 1.000
#> GSM494634     1   0.493      0.944 0.768 0.000 0.232
#> GSM494639     1   0.497      0.941 0.764 0.000 0.236
#> GSM494661     1   0.493      0.944 0.768 0.000 0.232
#> GSM494617     3   0.000      0.906 0.000 0.000 1.000
#> GSM494626     3   0.000      0.906 0.000 0.000 1.000
#> GSM494656     3   0.497      0.738 0.000 0.236 0.764
#> GSM494635     1   0.497      0.941 0.764 0.000 0.236

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494594     3  0.0000      0.976 0.000 0.000 1.000 0.000
#> GSM494604     1  0.0921      0.971 0.972 0.028 0.000 0.000
#> GSM494564     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494591     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494567     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494602     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494613     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494589     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494598     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494593     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494583     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494612     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494558     3  0.0000      0.976 0.000 0.000 1.000 0.000
#> GSM494556     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494559     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494571     3  0.0000      0.976 0.000 0.000 1.000 0.000
#> GSM494614     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494603     3  0.3569      0.744 0.000 0.000 0.804 0.196
#> GSM494568     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494572     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494600     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494562     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494615     3  0.0000      0.976 0.000 0.000 1.000 0.000
#> GSM494582     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494599     2  0.0188      0.996 0.004 0.996 0.000 0.000
#> GSM494610     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494587     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494581     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494580     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494563     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494576     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494605     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494584     3  0.4994      0.083 0.000 0.480 0.520 0.000
#> GSM494586     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494578     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494585     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494611     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494560     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494595     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494570     3  0.0188      0.976 0.000 0.000 0.996 0.004
#> GSM494597     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494607     2  0.0188      0.996 0.004 0.996 0.000 0.000
#> GSM494561     3  0.0188      0.976 0.000 0.000 0.996 0.004
#> GSM494569     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494592     2  0.0188      0.996 0.004 0.996 0.000 0.000
#> GSM494577     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494588     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494590     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494609     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494608     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494606     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494574     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494573     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494566     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494601     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494557     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494579     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494596     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494575     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM494625     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0000      0.976 0.000 0.000 1.000 0.000
#> GSM494664     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494624     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494651     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494662     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494627     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494673     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494649     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494658     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494643     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494672     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494618     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494631     3  0.0000      0.976 0.000 0.000 1.000 0.000
#> GSM494619     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494616     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494663     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494628     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494632     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494660     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494622     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494642     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494675     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494641     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494636     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494640     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494623     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494644     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494646     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494665     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494638     4  0.0921      0.971 0.028 0.000 0.000 0.972
#> GSM494645     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494620     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494630     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494657     3  0.0188      0.978 0.000 0.004 0.996 0.000
#> GSM494667     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494621     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494629     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494637     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494652     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494648     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494650     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494669     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494633     4  0.0000      0.998 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494639     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494661     1  0.0000      0.999 1.000 0.000 0.000 0.000
#> GSM494617     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494626     4  0.0188      0.997 0.000 0.000 0.004 0.996
#> GSM494656     3  0.0000      0.976 0.000 0.000 1.000 0.000
#> GSM494635     1  0.0000      0.999 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
#> GSM494565     5  0.0000      0.922 0.000 0.000 0.000 0.000 1.000
#> GSM494594     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494604     1  0.0794      0.968 0.972 0.028 0.000 0.000 0.000
#> GSM494564     5  0.0000      0.922 0.000 0.000 0.000 0.000 1.000
#> GSM494591     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494567     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494602     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494613     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494589     5  0.0000      0.922 0.000 0.000 0.000 0.000 1.000
#> GSM494598     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494593     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494583     2  0.0404      0.970 0.000 0.988 0.000 0.000 0.012
#> GSM494612     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494558     3  0.0000      0.412 0.000 0.000 1.000 0.000 0.000
#> GSM494556     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494559     5  0.0000      0.922 0.000 0.000 0.000 0.000 1.000
#> GSM494571     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494614     5  0.3177      0.459 0.000 0.000 0.208 0.000 0.792
#> GSM494603     3  0.1907      0.352 0.000 0.000 0.928 0.028 0.044
#> GSM494568     3  0.1732      0.325 0.000 0.000 0.920 0.080 0.000
#> GSM494572     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494600     5  0.0000      0.922 0.000 0.000 0.000 0.000 1.000
#> GSM494562     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494615     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494582     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494599     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494610     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494587     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494581     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494580     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494563     5  0.0510      0.907 0.000 0.016 0.000 0.000 0.984
#> GSM494576     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494605     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494584     2  0.4825      0.105 0.000 0.568 0.024 0.000 0.408
#> GSM494586     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494578     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494585     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494611     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494560     5  0.0000      0.922 0.000 0.000 0.000 0.000 1.000
#> GSM494595     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494570     5  0.1792      0.854 0.000 0.000 0.000 0.084 0.916
#> GSM494597     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494607     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494561     5  0.1792      0.854 0.000 0.000 0.000 0.084 0.916
#> GSM494569     4  0.4242      0.761 0.000 0.000 0.428 0.572 0.000
#> GSM494592     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494577     2  0.0290      0.974 0.000 0.992 0.000 0.000 0.008
#> GSM494588     5  0.1792      0.854 0.000 0.000 0.000 0.084 0.916
#> GSM494590     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494609     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494608     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494606     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494574     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494573     5  0.0000      0.922 0.000 0.000 0.000 0.000 1.000
#> GSM494566     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494601     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494557     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494579     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494596     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494575     2  0.0000      0.981 0.000 1.000 0.000 0.000 0.000
#> GSM494625     4  0.0000      0.811 0.000 0.000 0.000 1.000 0.000
#> GSM494654     3  0.2020      0.491 0.000 0.000 0.900 0.000 0.100
#> GSM494664     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494624     4  0.0000      0.811 0.000 0.000 0.000 1.000 0.000
#> GSM494651     4  0.4242      0.761 0.000 0.000 0.428 0.572 0.000
#> GSM494662     4  0.1792      0.818 0.000 0.000 0.084 0.916 0.000
#> GSM494627     4  0.4242      0.761 0.000 0.000 0.428 0.572 0.000
#> GSM494673     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.0000      0.811 0.000 0.000 0.000 1.000 0.000
#> GSM494658     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.0609      0.814 0.000 0.000 0.020 0.980 0.000
#> GSM494672     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.4242      0.761 0.000 0.000 0.428 0.572 0.000
#> GSM494631     3  0.2127      0.497 0.000 0.000 0.892 0.000 0.108
#> GSM494619     4  0.0000      0.811 0.000 0.000 0.000 1.000 0.000
#> GSM494674     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.4242      0.761 0.000 0.000 0.428 0.572 0.000
#> GSM494663     4  0.4242      0.761 0.000 0.000 0.428 0.572 0.000
#> GSM494628     4  0.4242      0.761 0.000 0.000 0.428 0.572 0.000
#> GSM494632     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494660     4  0.0000      0.811 0.000 0.000 0.000 1.000 0.000
#> GSM494622     4  0.4242      0.761 0.000 0.000 0.428 0.572 0.000
#> GSM494642     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494675     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494641     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.1792      0.818 0.000 0.000 0.084 0.916 0.000
#> GSM494640     4  0.1792      0.818 0.000 0.000 0.084 0.916 0.000
#> GSM494623     4  0.0000      0.811 0.000 0.000 0.000 1.000 0.000
#> GSM494644     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494665     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494638     4  0.2654      0.810 0.032 0.000 0.084 0.884 0.000
#> GSM494645     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494620     4  0.0000      0.811 0.000 0.000 0.000 1.000 0.000
#> GSM494630     4  0.0000      0.811 0.000 0.000 0.000 1.000 0.000
#> GSM494657     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494667     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494621     4  0.0000      0.811 0.000 0.000 0.000 1.000 0.000
#> GSM494629     4  0.4150      0.770 0.000 0.000 0.388 0.612 0.000
#> GSM494637     4  0.1792      0.818 0.000 0.000 0.084 0.916 0.000
#> GSM494652     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494648     4  0.0000      0.811 0.000 0.000 0.000 1.000 0.000
#> GSM494650     4  0.4242      0.761 0.000 0.000 0.428 0.572 0.000
#> GSM494669     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494633     4  0.0000      0.811 0.000 0.000 0.000 1.000 0.000
#> GSM494634     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494661     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.4242      0.761 0.000 0.000 0.428 0.572 0.000
#> GSM494626     4  0.4242      0.761 0.000 0.000 0.428 0.572 0.000
#> GSM494656     3  0.4242      0.800 0.000 0.000 0.572 0.000 0.428
#> GSM494635     1  0.0000      0.999 1.000 0.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM494565     5  0.1327      0.978 0.000 0.000 0.064 0.000 0.936 0.000
#> GSM494594     3  0.0146      0.974 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494604     1  0.1267      0.930 0.940 0.060 0.000 0.000 0.000 0.000
#> GSM494564     5  0.1501      0.979 0.000 0.000 0.076 0.000 0.924 0.000
#> GSM494591     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494602     2  0.0000      0.973 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494613     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494589     5  0.1501      0.979 0.000 0.000 0.076 0.000 0.924 0.000
#> GSM494598     2  0.0146      0.973 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM494593     2  0.0000      0.973 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494583     2  0.2214      0.878 0.000 0.888 0.016 0.000 0.096 0.000
#> GSM494612     2  0.0000      0.973 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     4  0.1010      0.943 0.000 0.000 0.036 0.960 0.004 0.000
#> GSM494556     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494559     5  0.1444      0.979 0.000 0.000 0.072 0.000 0.928 0.000
#> GSM494571     3  0.0146      0.974 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM494614     3  0.3221      0.608 0.000 0.000 0.736 0.000 0.264 0.000
#> GSM494603     4  0.1088      0.949 0.000 0.000 0.024 0.960 0.016 0.000
#> GSM494568     4  0.0717      0.959 0.000 0.000 0.016 0.976 0.008 0.000
#> GSM494572     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494600     5  0.1501      0.979 0.000 0.000 0.076 0.000 0.924 0.000
#> GSM494562     2  0.0146      0.973 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM494615     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494582     2  0.0000      0.973 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494599     2  0.0000      0.973 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494610     2  0.0146      0.973 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM494587     2  0.0260      0.972 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM494581     2  0.0458      0.966 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM494580     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494563     5  0.1411      0.976 0.000 0.004 0.060 0.000 0.936 0.000
#> GSM494576     2  0.0458      0.968 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM494605     1  0.0260      0.986 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494584     2  0.4620      0.362 0.000 0.584 0.368 0.000 0.048 0.000
#> GSM494586     2  0.0260      0.972 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM494578     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494585     2  0.0260      0.972 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM494611     2  0.0000      0.973 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494560     5  0.1327      0.978 0.000 0.000 0.064 0.000 0.936 0.000
#> GSM494595     2  0.0260      0.972 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM494570     5  0.1789      0.962 0.000 0.000 0.044 0.000 0.924 0.032
#> GSM494597     3  0.0146      0.974 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM494607     2  0.0000      0.973 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494561     5  0.2088      0.924 0.000 0.000 0.028 0.000 0.904 0.068
#> GSM494569     4  0.0806      0.966 0.000 0.000 0.000 0.972 0.020 0.008
#> GSM494592     2  0.0000      0.973 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494577     2  0.1765      0.896 0.000 0.904 0.000 0.000 0.096 0.000
#> GSM494588     5  0.1549      0.967 0.000 0.000 0.044 0.000 0.936 0.020
#> GSM494590     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     2  0.0260      0.971 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM494608     2  0.0260      0.971 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM494606     2  0.0000      0.973 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494574     2  0.0146      0.973 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM494573     5  0.1501      0.979 0.000 0.000 0.076 0.000 0.924 0.000
#> GSM494566     2  0.0405      0.971 0.000 0.988 0.000 0.004 0.008 0.000
#> GSM494601     2  0.0000      0.973 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494557     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494579     2  0.0405      0.971 0.000 0.988 0.000 0.004 0.008 0.000
#> GSM494596     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0000      0.973 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     6  0.0000      0.902 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494654     3  0.1245      0.936 0.000 0.000 0.952 0.032 0.016 0.000
#> GSM494664     1  0.0806      0.974 0.972 0.000 0.000 0.008 0.020 0.000
#> GSM494624     6  0.0000      0.902 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494651     4  0.0622      0.968 0.000 0.000 0.000 0.980 0.012 0.008
#> GSM494662     6  0.4167      0.710 0.000 0.000 0.000 0.236 0.056 0.708
#> GSM494627     4  0.0777      0.961 0.000 0.000 0.000 0.972 0.004 0.024
#> GSM494673     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     6  0.0000      0.902 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494658     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     6  0.0865      0.888 0.000 0.000 0.000 0.000 0.036 0.964
#> GSM494672     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0622      0.968 0.000 0.000 0.000 0.980 0.012 0.008
#> GSM494631     3  0.1333      0.929 0.000 0.000 0.944 0.048 0.008 0.000
#> GSM494619     6  0.0000      0.902 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0806      0.966 0.000 0.000 0.000 0.972 0.020 0.008
#> GSM494663     4  0.1010      0.954 0.000 0.000 0.000 0.960 0.004 0.036
#> GSM494628     4  0.0146      0.968 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM494632     1  0.1700      0.941 0.928 0.000 0.000 0.024 0.048 0.000
#> GSM494660     6  0.0000      0.902 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494622     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494642     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494675     3  0.0291      0.972 0.000 0.000 0.992 0.004 0.004 0.000
#> GSM494641     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     6  0.4239      0.697 0.000 0.000 0.000 0.248 0.056 0.696
#> GSM494640     6  0.3860      0.725 0.000 0.000 0.000 0.236 0.036 0.728
#> GSM494623     6  0.0000      0.902 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494644     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.1075      0.961 0.952 0.000 0.000 0.000 0.048 0.000
#> GSM494665     1  0.0146      0.987 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM494638     6  0.5006      0.656 0.032 0.000 0.000 0.256 0.056 0.656
#> GSM494645     1  0.0146      0.987 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM494671     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.0000      0.902 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494630     6  0.0146      0.901 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM494657     3  0.0000      0.976 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0000      0.902 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494629     4  0.2531      0.832 0.000 0.000 0.000 0.856 0.012 0.132
#> GSM494637     6  0.3860      0.725 0.000 0.000 0.000 0.236 0.036 0.728
#> GSM494652     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.0000      0.902 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494650     4  0.0291      0.967 0.000 0.000 0.000 0.992 0.004 0.004
#> GSM494669     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0547      0.979 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM494668     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     6  0.0000      0.902 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.989 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.1434      0.952 0.940 0.000 0.000 0.012 0.048 0.000
#> GSM494661     1  0.0146      0.987 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM494617     4  0.0891      0.964 0.000 0.000 0.000 0.968 0.024 0.008
#> GSM494626     4  0.0622      0.968 0.000 0.000 0.000 0.980 0.012 0.008
#> GSM494656     3  0.0717      0.958 0.000 0.000 0.976 0.016 0.008 0.000
#> GSM494635     1  0.0865      0.969 0.964 0.000 0.000 0.000 0.036 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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 5)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-skmeans-collect-classes

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

test_to_known_factors(res)
#>               n disease.state(p) age(p) other(p) individual(p) k
#> MAD:skmeans 120         6.85e-20 0.9998 2.52e-15         1.000 2
#> MAD:skmeans 120         1.72e-16 0.2793 9.68e-11         0.785 3
#> MAD:skmeans 119         9.13e-19 0.3970 1.08e-12         0.880 4
#> MAD:skmeans 113         5.48e-19 0.4994 1.06e-13         0.800 5
#> MAD:skmeans 119         8.23e-17 0.0418 1.16e-10         0.266 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 51941 rows and 120 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 6.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-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.972       0.990         0.5044 0.496   0.496
#> 3 3 0.853           0.837       0.939         0.2866 0.774   0.575
#> 4 4 0.760           0.780       0.859         0.0998 0.922   0.782
#> 5 5 0.864           0.802       0.879         0.0815 0.854   0.557
#> 6 6 0.903           0.854       0.912         0.0566 0.908   0.628

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

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
#> GSM494565     2   0.000     0.9892 0.000 1.000
#> GSM494594     2   0.000     0.9892 0.000 1.000
#> GSM494604     1   0.416     0.9003 0.916 0.084
#> GSM494564     2   0.000     0.9892 0.000 1.000
#> GSM494591     2   0.000     0.9892 0.000 1.000
#> GSM494567     2   0.000     0.9892 0.000 1.000
#> GSM494602     2   0.000     0.9892 0.000 1.000
#> GSM494613     2   0.000     0.9892 0.000 1.000
#> GSM494589     2   0.000     0.9892 0.000 1.000
#> GSM494598     2   0.000     0.9892 0.000 1.000
#> GSM494593     2   0.000     0.9892 0.000 1.000
#> GSM494583     2   0.000     0.9892 0.000 1.000
#> GSM494612     2   0.000     0.9892 0.000 1.000
#> GSM494558     2   0.615     0.8140 0.152 0.848
#> GSM494556     2   0.000     0.9892 0.000 1.000
#> GSM494559     2   0.000     0.9892 0.000 1.000
#> GSM494571     2   0.000     0.9892 0.000 1.000
#> GSM494614     2   0.000     0.9892 0.000 1.000
#> GSM494603     2   0.000     0.9892 0.000 1.000
#> GSM494568     1   1.000     0.0300 0.512 0.488
#> GSM494572     2   0.000     0.9892 0.000 1.000
#> GSM494600     2   0.000     0.9892 0.000 1.000
#> GSM494562     2   0.000     0.9892 0.000 1.000
#> GSM494615     2   0.000     0.9892 0.000 1.000
#> GSM494582     2   0.000     0.9892 0.000 1.000
#> GSM494599     2   0.000     0.9892 0.000 1.000
#> GSM494610     2   0.000     0.9892 0.000 1.000
#> GSM494587     2   0.000     0.9892 0.000 1.000
#> GSM494581     2   0.000     0.9892 0.000 1.000
#> GSM494580     2   0.000     0.9892 0.000 1.000
#> GSM494563     2   0.000     0.9892 0.000 1.000
#> GSM494576     2   0.000     0.9892 0.000 1.000
#> GSM494605     1   0.000     0.9900 1.000 0.000
#> GSM494584     2   0.000     0.9892 0.000 1.000
#> GSM494586     2   0.000     0.9892 0.000 1.000
#> GSM494578     2   0.000     0.9892 0.000 1.000
#> GSM494585     2   0.000     0.9892 0.000 1.000
#> GSM494611     2   0.000     0.9892 0.000 1.000
#> GSM494560     2   0.000     0.9892 0.000 1.000
#> GSM494595     2   0.000     0.9892 0.000 1.000
#> GSM494570     2   0.000     0.9892 0.000 1.000
#> GSM494597     2   0.000     0.9892 0.000 1.000
#> GSM494607     2   0.000     0.9892 0.000 1.000
#> GSM494561     2   0.000     0.9892 0.000 1.000
#> GSM494569     1   0.000     0.9900 1.000 0.000
#> GSM494592     2   0.000     0.9892 0.000 1.000
#> GSM494577     2   0.000     0.9892 0.000 1.000
#> GSM494588     2   0.000     0.9892 0.000 1.000
#> GSM494590     2   0.000     0.9892 0.000 1.000
#> GSM494609     2   0.000     0.9892 0.000 1.000
#> GSM494608     2   0.000     0.9892 0.000 1.000
#> GSM494606     2   0.000     0.9892 0.000 1.000
#> GSM494574     2   0.000     0.9892 0.000 1.000
#> GSM494573     2   0.000     0.9892 0.000 1.000
#> GSM494566     2   0.000     0.9892 0.000 1.000
#> GSM494601     2   0.000     0.9892 0.000 1.000
#> GSM494557     2   0.000     0.9892 0.000 1.000
#> GSM494579     2   0.000     0.9892 0.000 1.000
#> GSM494596     2   0.000     0.9892 0.000 1.000
#> GSM494575     2   0.000     0.9892 0.000 1.000
#> GSM494625     1   0.000     0.9900 1.000 0.000
#> GSM494654     2   0.999     0.0503 0.484 0.516
#> GSM494664     1   0.000     0.9900 1.000 0.000
#> GSM494624     1   0.000     0.9900 1.000 0.000
#> GSM494651     1   0.000     0.9900 1.000 0.000
#> GSM494662     1   0.000     0.9900 1.000 0.000
#> GSM494627     1   0.000     0.9900 1.000 0.000
#> GSM494673     1   0.000     0.9900 1.000 0.000
#> GSM494649     1   0.000     0.9900 1.000 0.000
#> GSM494658     1   0.000     0.9900 1.000 0.000
#> GSM494653     1   0.000     0.9900 1.000 0.000
#> GSM494643     1   0.000     0.9900 1.000 0.000
#> GSM494672     1   0.000     0.9900 1.000 0.000
#> GSM494618     1   0.000     0.9900 1.000 0.000
#> GSM494631     2   0.000     0.9892 0.000 1.000
#> GSM494619     1   0.000     0.9900 1.000 0.000
#> GSM494674     1   0.000     0.9900 1.000 0.000
#> GSM494616     1   0.000     0.9900 1.000 0.000
#> GSM494663     1   0.000     0.9900 1.000 0.000
#> GSM494628     1   0.000     0.9900 1.000 0.000
#> GSM494632     1   0.000     0.9900 1.000 0.000
#> GSM494660     1   0.000     0.9900 1.000 0.000
#> GSM494622     1   0.000     0.9900 1.000 0.000
#> GSM494642     1   0.000     0.9900 1.000 0.000
#> GSM494647     1   0.000     0.9900 1.000 0.000
#> GSM494659     1   0.000     0.9900 1.000 0.000
#> GSM494670     1   0.000     0.9900 1.000 0.000
#> GSM494675     2   0.000     0.9892 0.000 1.000
#> GSM494641     1   0.000     0.9900 1.000 0.000
#> GSM494636     1   0.000     0.9900 1.000 0.000
#> GSM494640     1   0.000     0.9900 1.000 0.000
#> GSM494623     1   0.000     0.9900 1.000 0.000
#> GSM494644     1   0.000     0.9900 1.000 0.000
#> GSM494646     1   0.000     0.9900 1.000 0.000
#> GSM494665     1   0.000     0.9900 1.000 0.000
#> GSM494638     1   0.000     0.9900 1.000 0.000
#> GSM494645     1   0.000     0.9900 1.000 0.000
#> GSM494671     1   0.000     0.9900 1.000 0.000
#> GSM494655     1   0.000     0.9900 1.000 0.000
#> GSM494620     1   0.000     0.9900 1.000 0.000
#> GSM494630     1   0.000     0.9900 1.000 0.000
#> GSM494657     2   0.000     0.9892 0.000 1.000
#> GSM494667     1   0.000     0.9900 1.000 0.000
#> GSM494621     1   0.000     0.9900 1.000 0.000
#> GSM494629     1   0.000     0.9900 1.000 0.000
#> GSM494637     1   0.000     0.9900 1.000 0.000
#> GSM494652     1   0.000     0.9900 1.000 0.000
#> GSM494648     1   0.000     0.9900 1.000 0.000
#> GSM494650     1   0.000     0.9900 1.000 0.000
#> GSM494669     1   0.000     0.9900 1.000 0.000
#> GSM494666     1   0.000     0.9900 1.000 0.000
#> GSM494668     1   0.000     0.9900 1.000 0.000
#> GSM494633     1   0.000     0.9900 1.000 0.000
#> GSM494634     1   0.000     0.9900 1.000 0.000
#> GSM494639     1   0.000     0.9900 1.000 0.000
#> GSM494661     1   0.000     0.9900 1.000 0.000
#> GSM494617     1   0.000     0.9900 1.000 0.000
#> GSM494626     1   0.000     0.9900 1.000 0.000
#> GSM494656     2   0.000     0.9892 0.000 1.000
#> GSM494635     1   0.000     0.9900 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
#> GSM494565     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494594     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494604     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494564     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494591     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494567     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494602     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494613     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494589     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494598     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494593     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494583     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494612     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494558     3  0.5291     0.6071 0.000 0.268 0.732
#> GSM494556     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494559     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494571     2  0.5988     0.3505 0.000 0.632 0.368
#> GSM494614     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494603     3  0.6235     0.2633 0.000 0.436 0.564
#> GSM494568     3  0.5363     0.5913 0.000 0.276 0.724
#> GSM494572     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494600     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494562     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494615     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494582     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494599     1  0.4654     0.6789 0.792 0.208 0.000
#> GSM494610     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494587     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494581     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494580     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494563     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494576     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494605     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494584     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494586     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494578     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494585     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494611     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494560     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494595     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494570     3  0.6235     0.2609 0.000 0.436 0.564
#> GSM494597     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494607     1  0.4002     0.7374 0.840 0.160 0.000
#> GSM494561     3  0.6225     0.2714 0.000 0.432 0.568
#> GSM494569     3  0.0424     0.8454 0.008 0.000 0.992
#> GSM494592     1  0.2959     0.8032 0.900 0.100 0.000
#> GSM494577     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494588     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494590     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494609     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494608     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494606     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494574     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494573     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494566     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494601     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494557     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494579     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494596     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494575     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494625     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494654     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494664     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494624     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494651     3  0.0424     0.8454 0.008 0.000 0.992
#> GSM494662     3  0.2796     0.7655 0.092 0.000 0.908
#> GSM494627     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494673     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494649     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494658     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494653     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494643     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494672     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494618     3  0.0424     0.8454 0.008 0.000 0.992
#> GSM494631     2  0.3879     0.7969 0.000 0.848 0.152
#> GSM494619     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494674     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494616     3  0.0424     0.8454 0.008 0.000 0.992
#> GSM494663     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494628     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494632     1  0.6225     0.3408 0.568 0.000 0.432
#> GSM494660     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494622     3  0.0237     0.8468 0.004 0.000 0.996
#> GSM494642     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494647     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494659     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494670     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494675     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494641     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494636     3  0.0424     0.8454 0.008 0.000 0.992
#> GSM494640     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494623     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494644     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494646     1  0.6168     0.3818 0.588 0.000 0.412
#> GSM494665     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494638     1  0.6225     0.3408 0.568 0.000 0.432
#> GSM494645     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494671     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494655     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494620     3  0.6291    -0.0989 0.468 0.000 0.532
#> GSM494630     1  0.6252     0.3175 0.556 0.000 0.444
#> GSM494657     2  0.0000     0.9887 0.000 1.000 0.000
#> GSM494667     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494621     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494629     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494637     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494652     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494648     3  0.6295    -0.1120 0.472 0.000 0.528
#> GSM494650     3  0.0424     0.8454 0.008 0.000 0.992
#> GSM494669     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494666     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494668     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494633     3  0.0000     0.8480 0.000 0.000 1.000
#> GSM494634     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494639     1  0.6225     0.3408 0.568 0.000 0.432
#> GSM494661     1  0.0000     0.8962 1.000 0.000 0.000
#> GSM494617     3  0.6295    -0.0954 0.472 0.000 0.528
#> GSM494626     3  0.0424     0.8454 0.008 0.000 0.992
#> GSM494656     3  0.6244     0.2520 0.000 0.440 0.560
#> GSM494635     1  0.6062     0.4346 0.616 0.000 0.384

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494594     2  0.4277      0.844 0.000 0.720 0.280 0.000
#> GSM494604     1  0.3837      0.726 0.776 0.224 0.000 0.000
#> GSM494564     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494591     2  0.4277      0.844 0.000 0.720 0.280 0.000
#> GSM494567     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494602     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494613     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494589     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494598     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494593     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494583     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494612     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494558     3  0.0336      0.572 0.000 0.000 0.992 0.008
#> GSM494556     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494559     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494571     2  0.4985      0.597 0.000 0.532 0.468 0.000
#> GSM494614     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494603     3  0.0469      0.565 0.000 0.012 0.988 0.000
#> GSM494568     3  0.4019      0.720 0.000 0.012 0.792 0.196
#> GSM494572     2  0.4277      0.844 0.000 0.720 0.280 0.000
#> GSM494600     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494562     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494615     3  0.4776     -0.236 0.000 0.376 0.624 0.000
#> GSM494582     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494599     1  0.4585      0.599 0.668 0.332 0.000 0.000
#> GSM494610     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494587     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494581     2  0.0336      0.829 0.000 0.992 0.008 0.000
#> GSM494580     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494563     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494576     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494605     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494584     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494586     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494578     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494585     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494611     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494560     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494595     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494570     4  0.4485      0.539 0.000 0.012 0.248 0.740
#> GSM494597     2  0.4222      0.847 0.000 0.728 0.272 0.000
#> GSM494607     1  0.4222      0.679 0.728 0.272 0.000 0.000
#> GSM494561     4  0.4248      0.571 0.000 0.012 0.220 0.768
#> GSM494569     3  0.5203      0.756 0.048 0.000 0.720 0.232
#> GSM494592     1  0.4222      0.679 0.728 0.272 0.000 0.000
#> GSM494577     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494588     4  0.7824     -0.152 0.000 0.328 0.268 0.404
#> GSM494590     2  0.4277      0.844 0.000 0.720 0.280 0.000
#> GSM494609     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494608     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494606     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494574     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494573     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494566     2  0.0336      0.829 0.000 0.992 0.008 0.000
#> GSM494601     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494557     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494579     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494596     2  0.4277      0.844 0.000 0.720 0.280 0.000
#> GSM494575     2  0.0000      0.828 0.000 1.000 0.000 0.000
#> GSM494625     4  0.0000      0.839 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0000      0.568 0.000 0.000 1.000 0.000
#> GSM494664     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494624     4  0.0000      0.839 0.000 0.000 0.000 1.000
#> GSM494651     3  0.5203      0.756 0.048 0.000 0.720 0.232
#> GSM494662     1  0.6889      0.398 0.592 0.000 0.176 0.232
#> GSM494627     3  0.4277      0.745 0.000 0.000 0.720 0.280
#> GSM494673     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494649     4  0.0000      0.839 0.000 0.000 0.000 1.000
#> GSM494658     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494643     4  0.3528      0.521 0.000 0.000 0.192 0.808
#> GSM494672     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494618     3  0.5203      0.756 0.048 0.000 0.720 0.232
#> GSM494631     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494619     4  0.0000      0.839 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494616     3  0.5203      0.756 0.048 0.000 0.720 0.232
#> GSM494663     3  0.4277      0.745 0.000 0.000 0.720 0.280
#> GSM494628     3  0.4277      0.745 0.000 0.000 0.720 0.280
#> GSM494632     1  0.3907      0.699 0.768 0.000 0.000 0.232
#> GSM494660     4  0.0000      0.839 0.000 0.000 0.000 1.000
#> GSM494622     3  0.4539      0.748 0.008 0.000 0.720 0.272
#> GSM494642     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494675     2  0.4193      0.849 0.000 0.732 0.268 0.000
#> GSM494641     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494636     1  0.7394      0.207 0.520 0.000 0.244 0.236
#> GSM494640     3  0.4866      0.606 0.000 0.000 0.596 0.404
#> GSM494623     4  0.0000      0.839 0.000 0.000 0.000 1.000
#> GSM494644     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494646     1  0.3444      0.755 0.816 0.000 0.000 0.184
#> GSM494665     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494638     1  0.3907      0.699 0.768 0.000 0.000 0.232
#> GSM494645     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494620     4  0.0000      0.839 0.000 0.000 0.000 1.000
#> GSM494630     4  0.0000      0.839 0.000 0.000 0.000 1.000
#> GSM494657     2  0.4277      0.844 0.000 0.720 0.280 0.000
#> GSM494667     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494621     4  0.0000      0.839 0.000 0.000 0.000 1.000
#> GSM494629     3  0.4277      0.745 0.000 0.000 0.720 0.280
#> GSM494637     3  0.4925      0.565 0.000 0.000 0.572 0.428
#> GSM494652     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494648     4  0.0000      0.839 0.000 0.000 0.000 1.000
#> GSM494650     3  0.5203      0.756 0.048 0.000 0.720 0.232
#> GSM494669     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494633     4  0.0000      0.839 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494639     1  0.3907      0.699 0.768 0.000 0.000 0.232
#> GSM494661     1  0.0000      0.902 1.000 0.000 0.000 0.000
#> GSM494617     3  0.7325      0.513 0.236 0.000 0.532 0.232
#> GSM494626     3  0.5203      0.756 0.048 0.000 0.720 0.232
#> GSM494656     3  0.2216      0.472 0.000 0.092 0.908 0.000
#> GSM494635     1  0.2973      0.794 0.856 0.000 0.000 0.144

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494594     3  0.4249     0.5932 0.000 0.000 0.568 0.000 0.432
#> GSM494604     1  0.3932     0.5033 0.672 0.328 0.000 0.000 0.000
#> GSM494564     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494591     3  0.4249     0.5932 0.000 0.000 0.568 0.000 0.432
#> GSM494567     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494602     2  0.4192     0.8556 0.000 0.596 0.404 0.000 0.000
#> GSM494613     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494589     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494598     2  0.4192     0.8556 0.000 0.596 0.404 0.000 0.000
#> GSM494593     2  0.4201     0.8553 0.000 0.592 0.408 0.000 0.000
#> GSM494583     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494612     2  0.4192     0.8556 0.000 0.596 0.404 0.000 0.000
#> GSM494558     4  0.1965     0.8799 0.000 0.000 0.052 0.924 0.024
#> GSM494556     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494559     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494571     3  0.4249     0.5932 0.000 0.000 0.568 0.000 0.432
#> GSM494614     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494603     4  0.1732     0.8687 0.000 0.000 0.080 0.920 0.000
#> GSM494568     4  0.1740     0.8860 0.000 0.000 0.056 0.932 0.012
#> GSM494572     3  0.4249     0.5932 0.000 0.000 0.568 0.000 0.432
#> GSM494600     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494562     2  0.4242     0.8462 0.000 0.572 0.428 0.000 0.000
#> GSM494615     3  0.4030     0.3968 0.000 0.000 0.648 0.352 0.000
#> GSM494582     2  0.4192     0.8556 0.000 0.596 0.404 0.000 0.000
#> GSM494599     2  0.4192     0.2111 0.404 0.596 0.000 0.000 0.000
#> GSM494610     2  0.4192     0.8556 0.000 0.596 0.404 0.000 0.000
#> GSM494587     2  0.4249     0.8444 0.000 0.568 0.432 0.000 0.000
#> GSM494581     2  0.4262     0.8363 0.000 0.560 0.440 0.000 0.000
#> GSM494580     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494563     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494576     2  0.4249     0.8444 0.000 0.568 0.432 0.000 0.000
#> GSM494605     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494584     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494586     2  0.4249     0.8444 0.000 0.568 0.432 0.000 0.000
#> GSM494578     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494585     2  0.4249     0.8444 0.000 0.568 0.432 0.000 0.000
#> GSM494611     2  0.4192     0.8556 0.000 0.596 0.404 0.000 0.000
#> GSM494560     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494595     2  0.4192     0.8556 0.000 0.596 0.404 0.000 0.000
#> GSM494570     3  0.6539    -0.0470 0.000 0.404 0.464 0.024 0.108
#> GSM494597     3  0.2516     0.6906 0.000 0.000 0.860 0.000 0.140
#> GSM494607     2  0.4192     0.2111 0.404 0.596 0.000 0.000 0.000
#> GSM494561     2  0.7260    -0.6169 0.000 0.404 0.316 0.024 0.256
#> GSM494569     4  0.0703     0.9242 0.024 0.000 0.000 0.976 0.000
#> GSM494592     2  0.4192     0.2111 0.404 0.596 0.000 0.000 0.000
#> GSM494577     2  0.4249     0.8444 0.000 0.568 0.432 0.000 0.000
#> GSM494588     3  0.5815     0.0911 0.000 0.396 0.508 0.000 0.096
#> GSM494590     3  0.4249     0.5932 0.000 0.000 0.568 0.000 0.432
#> GSM494609     2  0.4201     0.8553 0.000 0.592 0.408 0.000 0.000
#> GSM494608     2  0.4201     0.8553 0.000 0.592 0.408 0.000 0.000
#> GSM494606     2  0.4201     0.8553 0.000 0.592 0.408 0.000 0.000
#> GSM494574     2  0.4192     0.8556 0.000 0.596 0.404 0.000 0.000
#> GSM494573     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494566     2  0.4297     0.7906 0.000 0.528 0.472 0.000 0.000
#> GSM494601     2  0.4192     0.8556 0.000 0.596 0.404 0.000 0.000
#> GSM494557     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494579     2  0.4262     0.8365 0.000 0.560 0.440 0.000 0.000
#> GSM494596     3  0.4249     0.5932 0.000 0.000 0.568 0.000 0.432
#> GSM494575     2  0.4192     0.8556 0.000 0.596 0.404 0.000 0.000
#> GSM494625     5  0.4893     0.9945 0.000 0.404 0.000 0.028 0.568
#> GSM494654     3  0.4249     0.5932 0.000 0.000 0.568 0.000 0.432
#> GSM494664     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494624     5  0.4893     0.9945 0.000 0.404 0.000 0.028 0.568
#> GSM494651     4  0.0703     0.9242 0.024 0.000 0.000 0.976 0.000
#> GSM494662     1  0.1628     0.9271 0.936 0.000 0.000 0.056 0.008
#> GSM494627     4  0.0000     0.9205 0.000 0.000 0.000 1.000 0.000
#> GSM494673     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494649     5  0.4893     0.9945 0.000 0.404 0.000 0.028 0.568
#> GSM494658     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494643     5  0.5652     0.9372 0.000 0.404 0.000 0.080 0.516
#> GSM494672     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0703     0.9242 0.024 0.000 0.000 0.976 0.000
#> GSM494631     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494619     5  0.4893     0.9945 0.000 0.404 0.000 0.028 0.568
#> GSM494674     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0703     0.9242 0.024 0.000 0.000 0.976 0.000
#> GSM494663     4  0.0703     0.9084 0.000 0.000 0.000 0.976 0.024
#> GSM494628     4  0.0000     0.9205 0.000 0.000 0.000 1.000 0.000
#> GSM494632     1  0.1341     0.9321 0.944 0.000 0.000 0.056 0.000
#> GSM494660     5  0.4893     0.9945 0.000 0.404 0.000 0.028 0.568
#> GSM494622     4  0.0162     0.9219 0.004 0.000 0.000 0.996 0.000
#> GSM494642     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494675     3  0.0000     0.7267 0.000 0.000 1.000 0.000 0.000
#> GSM494641     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494636     1  0.5411     0.5951 0.664 0.000 0.000 0.160 0.176
#> GSM494640     4  0.3913     0.5247 0.000 0.000 0.000 0.676 0.324
#> GSM494623     5  0.4893     0.9945 0.000 0.404 0.000 0.028 0.568
#> GSM494644     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.1341     0.9321 0.944 0.000 0.000 0.056 0.000
#> GSM494665     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494638     1  0.1341     0.9321 0.944 0.000 0.000 0.056 0.000
#> GSM494645     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494620     5  0.4893     0.9945 0.000 0.404 0.000 0.028 0.568
#> GSM494630     5  0.4893     0.9945 0.000 0.404 0.000 0.028 0.568
#> GSM494657     3  0.4249     0.5932 0.000 0.000 0.568 0.000 0.432
#> GSM494667     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494621     5  0.4893     0.9945 0.000 0.404 0.000 0.028 0.568
#> GSM494629     4  0.0000     0.9205 0.000 0.000 0.000 1.000 0.000
#> GSM494637     4  0.4015     0.4754 0.000 0.000 0.000 0.652 0.348
#> GSM494652     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494648     5  0.4893     0.9945 0.000 0.404 0.000 0.028 0.568
#> GSM494650     4  0.0703     0.9242 0.024 0.000 0.000 0.976 0.000
#> GSM494669     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494633     5  0.4893     0.9945 0.000 0.404 0.000 0.028 0.568
#> GSM494634     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.1341     0.9321 0.944 0.000 0.000 0.056 0.000
#> GSM494661     1  0.0000     0.9667 1.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.0703     0.9242 0.024 0.000 0.000 0.976 0.000
#> GSM494626     4  0.0703     0.9242 0.024 0.000 0.000 0.976 0.000
#> GSM494656     3  0.4249     0.5932 0.000 0.000 0.568 0.000 0.432
#> GSM494635     1  0.1341     0.9321 0.944 0.000 0.000 0.056 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
#> GSM494565     5  0.0632     0.7502 0.000 0.000 0.024 0.000 0.976 0.000
#> GSM494594     3  0.0790     0.9944 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM494604     1  0.3812     0.5783 0.712 0.264 0.000 0.000 0.024 0.000
#> GSM494564     5  0.0632     0.7502 0.000 0.000 0.024 0.000 0.976 0.000
#> GSM494591     3  0.0790     0.9944 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM494567     5  0.3330     0.7013 0.000 0.000 0.284 0.000 0.716 0.000
#> GSM494602     2  0.0000     0.9812 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494613     5  0.3448     0.7038 0.000 0.004 0.280 0.000 0.716 0.000
#> GSM494589     5  0.0632     0.7502 0.000 0.000 0.024 0.000 0.976 0.000
#> GSM494598     2  0.0000     0.9812 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494593     2  0.0937     0.9708 0.000 0.960 0.000 0.000 0.040 0.000
#> GSM494583     5  0.0713     0.7503 0.000 0.000 0.028 0.000 0.972 0.000
#> GSM494612     2  0.0000     0.9812 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     4  0.1141     0.8723 0.000 0.000 0.052 0.948 0.000 0.000
#> GSM494556     5  0.3126     0.7151 0.000 0.000 0.248 0.000 0.752 0.000
#> GSM494559     5  0.0000     0.7446 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494571     3  0.0790     0.9944 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM494614     5  0.3288     0.7060 0.000 0.000 0.276 0.000 0.724 0.000
#> GSM494603     4  0.1480     0.8615 0.000 0.000 0.020 0.940 0.040 0.000
#> GSM494568     4  0.1515     0.8704 0.000 0.000 0.020 0.944 0.028 0.008
#> GSM494572     3  0.0790     0.9944 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM494600     5  0.0632     0.7502 0.000 0.000 0.024 0.000 0.976 0.000
#> GSM494562     5  0.3563     0.6318 0.000 0.336 0.000 0.000 0.664 0.000
#> GSM494615     4  0.5855     0.0865 0.000 0.000 0.276 0.484 0.240 0.000
#> GSM494582     2  0.0000     0.9812 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494599     2  0.0632     0.9780 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM494610     2  0.0790     0.9576 0.000 0.968 0.000 0.000 0.032 0.000
#> GSM494587     5  0.3464     0.6537 0.000 0.312 0.000 0.000 0.688 0.000
#> GSM494581     5  0.3309     0.6674 0.000 0.280 0.000 0.000 0.720 0.000
#> GSM494580     5  0.3330     0.7013 0.000 0.000 0.284 0.000 0.716 0.000
#> GSM494563     5  0.0632     0.7502 0.000 0.000 0.024 0.000 0.976 0.000
#> GSM494576     5  0.3489     0.6643 0.000 0.288 0.004 0.000 0.708 0.000
#> GSM494605     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494584     5  0.3288     0.7060 0.000 0.000 0.276 0.000 0.724 0.000
#> GSM494586     5  0.3547     0.6363 0.000 0.332 0.000 0.000 0.668 0.000
#> GSM494578     5  0.3330     0.7013 0.000 0.000 0.284 0.000 0.716 0.000
#> GSM494585     5  0.3371     0.6572 0.000 0.292 0.000 0.000 0.708 0.000
#> GSM494611     2  0.0000     0.9812 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494560     5  0.0632     0.7502 0.000 0.000 0.024 0.000 0.976 0.000
#> GSM494595     2  0.0260     0.9782 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM494570     6  0.4065     0.6071 0.000 0.000 0.028 0.000 0.300 0.672
#> GSM494597     5  0.3847     0.4113 0.000 0.000 0.456 0.000 0.544 0.000
#> GSM494607     2  0.0260     0.9811 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM494561     6  0.3766     0.6211 0.000 0.000 0.212 0.000 0.040 0.748
#> GSM494569     4  0.0000     0.9060 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494592     2  0.0632     0.9780 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM494577     5  0.1657     0.7442 0.000 0.056 0.016 0.000 0.928 0.000
#> GSM494588     5  0.3756     0.0126 0.000 0.000 0.000 0.000 0.600 0.400
#> GSM494590     3  0.0790     0.9944 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM494609     2  0.1007     0.9680 0.000 0.956 0.000 0.000 0.044 0.000
#> GSM494608     2  0.1007     0.9680 0.000 0.956 0.000 0.000 0.044 0.000
#> GSM494606     2  0.1007     0.9680 0.000 0.956 0.000 0.000 0.044 0.000
#> GSM494574     2  0.0000     0.9812 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494573     5  0.0632     0.7502 0.000 0.000 0.024 0.000 0.976 0.000
#> GSM494566     5  0.3489     0.6616 0.000 0.288 0.004 0.000 0.708 0.000
#> GSM494601     2  0.0632     0.9780 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM494557     5  0.3309     0.7039 0.000 0.000 0.280 0.000 0.720 0.000
#> GSM494579     5  0.3371     0.6572 0.000 0.292 0.000 0.000 0.708 0.000
#> GSM494596     3  0.0790     0.9944 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM494575     2  0.0000     0.9812 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     6  0.0000     0.9401 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0000     0.9553 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494664     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494624     6  0.0000     0.9401 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494651     4  0.0000     0.9060 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494662     1  0.2302     0.9001 0.900 0.000 0.032 0.060 0.000 0.008
#> GSM494627     4  0.0000     0.9060 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494673     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     6  0.0000     0.9401 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494658     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     6  0.2046     0.8726 0.000 0.000 0.032 0.060 0.000 0.908
#> GSM494672     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0000     0.9060 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494631     5  0.3534     0.7032 0.000 0.000 0.276 0.008 0.716 0.000
#> GSM494619     6  0.0000     0.9401 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0000     0.9060 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494663     4  0.0713     0.8915 0.000 0.000 0.000 0.972 0.000 0.028
#> GSM494628     4  0.0000     0.9060 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494632     1  0.1267     0.9272 0.940 0.000 0.000 0.060 0.000 0.000
#> GSM494660     6  0.0000     0.9401 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494622     4  0.0000     0.9060 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494642     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494675     5  0.3198     0.7119 0.000 0.000 0.260 0.000 0.740 0.000
#> GSM494641     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     1  0.5358     0.6042 0.660 0.000 0.032 0.164 0.000 0.144
#> GSM494640     4  0.4186     0.5231 0.000 0.000 0.032 0.656 0.000 0.312
#> GSM494623     6  0.0000     0.9401 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494644     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.1267     0.9272 0.940 0.000 0.000 0.060 0.000 0.000
#> GSM494665     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494638     1  0.2046     0.9060 0.908 0.000 0.032 0.060 0.000 0.000
#> GSM494645     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.0000     0.9401 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494630     6  0.0790     0.9248 0.000 0.000 0.032 0.000 0.000 0.968
#> GSM494657     3  0.0790     0.9944 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM494667     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0000     0.9401 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494629     4  0.0790     0.8900 0.000 0.000 0.032 0.968 0.000 0.000
#> GSM494637     4  0.4278     0.4763 0.000 0.000 0.032 0.632 0.000 0.336
#> GSM494652     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.0000     0.9401 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494650     4  0.0000     0.9060 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494669     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     6  0.0632     0.9291 0.000 0.000 0.024 0.000 0.000 0.976
#> GSM494634     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.1267     0.9272 0.940 0.000 0.000 0.060 0.000 0.000
#> GSM494661     1  0.0000     0.9650 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494617     4  0.0000     0.9060 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494626     4  0.0000     0.9060 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494656     3  0.0790     0.9944 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM494635     1  0.1267     0.9272 0.940 0.000 0.000 0.060 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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 5)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-pam-collect-classes

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

test_to_known_factors(res)
#>           n disease.state(p)  age(p) other(p) individual(p) k
#> MAD:pam 118         5.93e-21 0.99997 3.67e-16         1.000 2
#> MAD:pam 106         2.21e-15 0.29615 3.48e-09         0.816 3
#> MAD:pam 115         1.50e-14 0.08709 2.89e-07         0.276 4
#> MAD:pam 112         1.32e-15 0.15188 9.87e-09         0.379 5
#> MAD:pam 116         1.37e-14 0.00521 3.52e-09         0.108 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 51941 rows and 120 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 6.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-mclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.499           0.846       0.891         0.3642 0.688   0.688
#> 3 3 0.909           0.896       0.944         0.7682 0.661   0.511
#> 4 4 0.736           0.870       0.896         0.1310 0.883   0.688
#> 5 5 0.851           0.754       0.893         0.0807 0.876   0.586
#> 6 6 0.906           0.884       0.945         0.0412 0.886   0.541

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] 3

There is also optional best \(k\) = 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
#> GSM494565     2   0.000      0.862 0.000 1.000
#> GSM494594     1   0.722      0.869 0.800 0.200
#> GSM494604     1   0.518      0.868 0.884 0.116
#> GSM494564     2   0.000      0.862 0.000 1.000
#> GSM494591     1   0.722      0.869 0.800 0.200
#> GSM494567     1   0.722      0.869 0.800 0.200
#> GSM494602     1   0.722      0.869 0.800 0.200
#> GSM494613     1   0.722      0.869 0.800 0.200
#> GSM494589     2   0.000      0.862 0.000 1.000
#> GSM494598     1   0.722      0.869 0.800 0.200
#> GSM494593     1   0.722      0.869 0.800 0.200
#> GSM494583     1   0.850      0.808 0.724 0.276
#> GSM494612     1   0.722      0.869 0.800 0.200
#> GSM494558     1   0.595      0.869 0.856 0.144
#> GSM494556     1   0.722      0.869 0.800 0.200
#> GSM494559     2   0.000      0.862 0.000 1.000
#> GSM494571     1   0.722      0.869 0.800 0.200
#> GSM494614     1   0.722      0.869 0.800 0.200
#> GSM494603     1   0.891      0.692 0.692 0.308
#> GSM494568     1   0.518      0.868 0.884 0.116
#> GSM494572     1   0.722      0.869 0.800 0.200
#> GSM494600     2   0.000      0.862 0.000 1.000
#> GSM494562     1   0.722      0.869 0.800 0.200
#> GSM494615     1   0.722      0.869 0.800 0.200
#> GSM494582     1   0.722      0.869 0.800 0.200
#> GSM494599     1   0.722      0.869 0.800 0.200
#> GSM494610     1   0.722      0.869 0.800 0.200
#> GSM494587     1   0.722      0.869 0.800 0.200
#> GSM494581     1   0.827      0.823 0.740 0.260
#> GSM494580     1   0.722      0.869 0.800 0.200
#> GSM494563     2   0.000      0.862 0.000 1.000
#> GSM494576     1   0.722      0.869 0.800 0.200
#> GSM494605     1   0.000      0.855 1.000 0.000
#> GSM494584     1   0.722      0.869 0.800 0.200
#> GSM494586     1   0.722      0.869 0.800 0.200
#> GSM494578     1   0.722      0.869 0.800 0.200
#> GSM494585     1   0.722      0.869 0.800 0.200
#> GSM494611     1   0.722      0.869 0.800 0.200
#> GSM494560     2   0.000      0.862 0.000 1.000
#> GSM494595     1   0.722      0.869 0.800 0.200
#> GSM494570     2   0.000      0.862 0.000 1.000
#> GSM494597     1   0.722      0.869 0.800 0.200
#> GSM494607     1   0.722      0.869 0.800 0.200
#> GSM494561     2   0.000      0.862 0.000 1.000
#> GSM494569     1   0.000      0.855 1.000 0.000
#> GSM494592     1   0.722      0.869 0.800 0.200
#> GSM494577     1   0.722      0.869 0.800 0.200
#> GSM494588     2   0.000      0.862 0.000 1.000
#> GSM494590     1   0.722      0.869 0.800 0.200
#> GSM494609     1   0.722      0.869 0.800 0.200
#> GSM494608     1   0.722      0.869 0.800 0.200
#> GSM494606     1   0.722      0.869 0.800 0.200
#> GSM494574     1   0.722      0.869 0.800 0.200
#> GSM494573     2   0.000      0.862 0.000 1.000
#> GSM494566     1   0.722      0.869 0.800 0.200
#> GSM494601     1   0.722      0.869 0.800 0.200
#> GSM494557     1   0.722      0.869 0.800 0.200
#> GSM494579     1   0.722      0.869 0.800 0.200
#> GSM494596     1   0.722      0.869 0.800 0.200
#> GSM494575     1   0.722      0.869 0.800 0.200
#> GSM494625     2   0.722      0.872 0.200 0.800
#> GSM494654     1   0.574      0.869 0.864 0.136
#> GSM494664     1   0.000      0.855 1.000 0.000
#> GSM494624     2   0.722      0.872 0.200 0.800
#> GSM494651     1   0.000      0.855 1.000 0.000
#> GSM494662     1   0.373      0.793 0.928 0.072
#> GSM494627     1   0.469      0.760 0.900 0.100
#> GSM494673     1   0.000      0.855 1.000 0.000
#> GSM494649     2   0.722      0.872 0.200 0.800
#> GSM494658     1   0.000      0.855 1.000 0.000
#> GSM494653     1   0.000      0.855 1.000 0.000
#> GSM494643     2   0.833      0.815 0.264 0.736
#> GSM494672     1   0.000      0.855 1.000 0.000
#> GSM494618     1   0.000      0.855 1.000 0.000
#> GSM494631     1   0.574      0.869 0.864 0.136
#> GSM494619     2   0.722      0.872 0.200 0.800
#> GSM494674     1   0.000      0.855 1.000 0.000
#> GSM494616     1   0.000      0.855 1.000 0.000
#> GSM494663     1   0.955      0.109 0.624 0.376
#> GSM494628     1   0.000      0.855 1.000 0.000
#> GSM494632     1   0.000      0.855 1.000 0.000
#> GSM494660     2   0.722      0.872 0.200 0.800
#> GSM494622     1   0.000      0.855 1.000 0.000
#> GSM494642     1   0.000      0.855 1.000 0.000
#> GSM494647     1   0.000      0.855 1.000 0.000
#> GSM494659     1   0.000      0.855 1.000 0.000
#> GSM494670     1   0.000      0.855 1.000 0.000
#> GSM494675     1   0.722      0.869 0.800 0.200
#> GSM494641     1   0.000      0.855 1.000 0.000
#> GSM494636     1   0.000      0.855 1.000 0.000
#> GSM494640     1   0.833      0.461 0.736 0.264
#> GSM494623     2   0.722      0.872 0.200 0.800
#> GSM494644     1   0.000      0.855 1.000 0.000
#> GSM494646     1   0.000      0.855 1.000 0.000
#> GSM494665     1   0.000      0.855 1.000 0.000
#> GSM494638     1   0.000      0.855 1.000 0.000
#> GSM494645     1   0.000      0.855 1.000 0.000
#> GSM494671     1   0.000      0.855 1.000 0.000
#> GSM494655     1   0.000      0.855 1.000 0.000
#> GSM494620     2   0.722      0.872 0.200 0.800
#> GSM494630     2   0.722      0.872 0.200 0.800
#> GSM494657     1   0.722      0.869 0.800 0.200
#> GSM494667     1   0.000      0.855 1.000 0.000
#> GSM494621     2   0.722      0.872 0.200 0.800
#> GSM494629     1   0.000      0.855 1.000 0.000
#> GSM494637     1   0.861      0.409 0.716 0.284
#> GSM494652     1   0.000      0.855 1.000 0.000
#> GSM494648     2   0.722      0.872 0.200 0.800
#> GSM494650     1   0.000      0.855 1.000 0.000
#> GSM494669     1   0.000      0.855 1.000 0.000
#> GSM494666     1   0.000      0.855 1.000 0.000
#> GSM494668     1   0.000      0.855 1.000 0.000
#> GSM494633     2   0.722      0.872 0.200 0.800
#> GSM494634     1   0.000      0.855 1.000 0.000
#> GSM494639     1   0.000      0.855 1.000 0.000
#> GSM494661     1   0.000      0.855 1.000 0.000
#> GSM494617     1   0.000      0.855 1.000 0.000
#> GSM494626     1   0.000      0.855 1.000 0.000
#> GSM494656     1   0.722      0.869 0.800 0.200
#> GSM494635     1   0.000      0.855 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
#> GSM494565     3  0.0000     0.9637 0.000 0.000 1.000
#> GSM494594     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494604     1  0.7919     0.0253 0.480 0.464 0.056
#> GSM494564     3  0.0000     0.9637 0.000 0.000 1.000
#> GSM494591     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494567     2  0.1643     0.9269 0.000 0.956 0.044
#> GSM494602     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494613     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494589     3  0.0000     0.9637 0.000 0.000 1.000
#> GSM494598     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494593     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494583     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494612     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494558     1  0.5986     0.6401 0.704 0.284 0.012
#> GSM494556     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494559     3  0.0000     0.9637 0.000 0.000 1.000
#> GSM494571     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494614     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494603     1  0.5737     0.6812 0.732 0.256 0.012
#> GSM494568     1  0.5737     0.6812 0.732 0.256 0.012
#> GSM494572     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494600     3  0.0000     0.9637 0.000 0.000 1.000
#> GSM494562     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494615     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494582     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494599     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494610     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494587     2  0.1860     0.9531 0.000 0.948 0.052
#> GSM494581     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494580     2  0.0747     0.9437 0.000 0.984 0.016
#> GSM494563     3  0.0000     0.9637 0.000 0.000 1.000
#> GSM494576     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494605     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494584     2  0.1643     0.9521 0.000 0.956 0.044
#> GSM494586     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494578     2  0.0747     0.9437 0.000 0.984 0.016
#> GSM494585     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494611     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494560     3  0.0000     0.9637 0.000 0.000 1.000
#> GSM494595     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494570     3  0.0000     0.9637 0.000 0.000 1.000
#> GSM494597     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494607     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494561     3  0.0000     0.9637 0.000 0.000 1.000
#> GSM494569     1  0.2550     0.8867 0.932 0.056 0.012
#> GSM494592     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494577     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494588     3  0.0000     0.9637 0.000 0.000 1.000
#> GSM494590     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494609     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494608     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494606     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494574     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494573     3  0.0000     0.9637 0.000 0.000 1.000
#> GSM494566     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494601     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494557     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494579     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494596     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494575     2  0.1964     0.9536 0.000 0.944 0.056
#> GSM494625     3  0.1964     0.9625 0.056 0.000 0.944
#> GSM494654     2  0.6735     0.1639 0.424 0.564 0.012
#> GSM494664     1  0.0237     0.9177 0.996 0.000 0.004
#> GSM494624     3  0.1964     0.9625 0.056 0.000 0.944
#> GSM494651     1  0.1620     0.9071 0.964 0.024 0.012
#> GSM494662     1  0.0592     0.9145 0.988 0.000 0.012
#> GSM494627     1  0.4002     0.7847 0.840 0.000 0.160
#> GSM494673     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494649     3  0.1964     0.9625 0.056 0.000 0.944
#> GSM494658     1  0.4811     0.7726 0.828 0.148 0.024
#> GSM494653     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494643     1  0.6302     0.0758 0.520 0.000 0.480
#> GSM494672     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494618     1  0.1751     0.9050 0.960 0.028 0.012
#> GSM494631     2  0.5884     0.5730 0.272 0.716 0.012
#> GSM494619     3  0.1964     0.9625 0.056 0.000 0.944
#> GSM494674     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494616     1  0.1620     0.9071 0.964 0.024 0.012
#> GSM494663     1  0.4121     0.7751 0.832 0.000 0.168
#> GSM494628     1  0.1877     0.9027 0.956 0.032 0.012
#> GSM494632     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494660     3  0.1964     0.9625 0.056 0.000 0.944
#> GSM494622     1  0.3539     0.8531 0.888 0.100 0.012
#> GSM494642     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494647     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494659     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494670     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494675     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494641     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494636     1  0.0592     0.9145 0.988 0.000 0.012
#> GSM494640     1  0.5706     0.5298 0.680 0.000 0.320
#> GSM494623     3  0.1964     0.9625 0.056 0.000 0.944
#> GSM494644     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494646     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494665     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494638     1  0.1015     0.9133 0.980 0.008 0.012
#> GSM494645     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494671     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494655     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494620     3  0.1964     0.9625 0.056 0.000 0.944
#> GSM494630     3  0.1964     0.9625 0.056 0.000 0.944
#> GSM494657     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494667     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494621     3  0.1964     0.9625 0.056 0.000 0.944
#> GSM494629     1  0.4859     0.8230 0.840 0.044 0.116
#> GSM494637     1  0.5706     0.5298 0.680 0.000 0.320
#> GSM494652     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494648     3  0.1964     0.9625 0.056 0.000 0.944
#> GSM494650     1  0.2550     0.8867 0.932 0.056 0.012
#> GSM494669     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494666     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494668     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494633     3  0.1964     0.9625 0.056 0.000 0.944
#> GSM494634     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494639     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494661     1  0.0000     0.9190 1.000 0.000 0.000
#> GSM494617     1  0.1620     0.9071 0.964 0.024 0.012
#> GSM494626     1  0.1620     0.9071 0.964 0.024 0.012
#> GSM494656     2  0.0592     0.9429 0.000 0.988 0.012
#> GSM494635     1  0.0000     0.9190 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
#> GSM494565     4  0.2647      0.899 0.000 0.000 0.120 0.880
#> GSM494594     3  0.1118      0.891 0.000 0.036 0.964 0.000
#> GSM494604     2  0.2380      0.854 0.064 0.920 0.008 0.008
#> GSM494564     4  0.2647      0.899 0.000 0.000 0.120 0.880
#> GSM494591     3  0.1118      0.891 0.000 0.036 0.964 0.000
#> GSM494567     3  0.3942      0.788 0.000 0.236 0.764 0.000
#> GSM494602     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494613     3  0.2760      0.872 0.000 0.128 0.872 0.000
#> GSM494589     4  0.2647      0.899 0.000 0.000 0.120 0.880
#> GSM494598     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494593     2  0.0336      0.928 0.000 0.992 0.008 0.000
#> GSM494583     2  0.2814      0.840 0.000 0.868 0.132 0.000
#> GSM494612     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494558     3  0.1661      0.892 0.004 0.052 0.944 0.000
#> GSM494556     3  0.3356      0.846 0.000 0.176 0.824 0.000
#> GSM494559     4  0.2647      0.899 0.000 0.000 0.120 0.880
#> GSM494571     3  0.1118      0.891 0.000 0.036 0.964 0.000
#> GSM494614     3  0.4679      0.580 0.000 0.352 0.648 0.000
#> GSM494603     3  0.6948      0.715 0.044 0.180 0.664 0.112
#> GSM494568     3  0.6413      0.743 0.048 0.124 0.716 0.112
#> GSM494572     3  0.1118      0.891 0.000 0.036 0.964 0.000
#> GSM494600     4  0.2647      0.899 0.000 0.000 0.120 0.880
#> GSM494562     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494615     3  0.3356      0.846 0.000 0.176 0.824 0.000
#> GSM494582     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494599     2  0.0336      0.928 0.000 0.992 0.008 0.000
#> GSM494610     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494587     2  0.2530      0.857 0.000 0.888 0.112 0.000
#> GSM494581     2  0.2760      0.844 0.000 0.872 0.128 0.000
#> GSM494580     3  0.3942      0.788 0.000 0.236 0.764 0.000
#> GSM494563     4  0.2647      0.899 0.000 0.000 0.120 0.880
#> GSM494576     2  0.2760      0.843 0.000 0.872 0.128 0.000
#> GSM494605     1  0.2714      0.909 0.884 0.000 0.004 0.112
#> GSM494584     2  0.4996     -0.120 0.000 0.516 0.484 0.000
#> GSM494586     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494578     3  0.3873      0.797 0.000 0.228 0.772 0.000
#> GSM494585     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494611     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494560     4  0.2647      0.899 0.000 0.000 0.120 0.880
#> GSM494595     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494570     4  0.2647      0.899 0.000 0.000 0.120 0.880
#> GSM494597     3  0.2081      0.888 0.000 0.084 0.916 0.000
#> GSM494607     2  0.0336      0.928 0.000 0.992 0.008 0.000
#> GSM494561     4  0.2647      0.899 0.000 0.000 0.120 0.880
#> GSM494569     1  0.4662      0.875 0.796 0.000 0.092 0.112
#> GSM494592     2  0.0336      0.928 0.000 0.992 0.008 0.000
#> GSM494577     2  0.2760      0.844 0.000 0.872 0.128 0.000
#> GSM494588     4  0.2647      0.899 0.000 0.000 0.120 0.880
#> GSM494590     3  0.1118      0.891 0.000 0.036 0.964 0.000
#> GSM494609     2  0.1474      0.906 0.000 0.948 0.052 0.000
#> GSM494608     2  0.2281      0.873 0.000 0.904 0.096 0.000
#> GSM494606     2  0.0336      0.928 0.000 0.992 0.008 0.000
#> GSM494574     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494573     4  0.2647      0.899 0.000 0.000 0.120 0.880
#> GSM494566     2  0.3486      0.773 0.000 0.812 0.188 0.000
#> GSM494601     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494557     3  0.1792      0.891 0.000 0.068 0.932 0.000
#> GSM494579     2  0.1211      0.914 0.000 0.960 0.040 0.000
#> GSM494596     3  0.1118      0.891 0.000 0.036 0.964 0.000
#> GSM494575     2  0.0000      0.929 0.000 1.000 0.000 0.000
#> GSM494625     4  0.0921      0.889 0.000 0.000 0.028 0.972
#> GSM494654     3  0.1118      0.890 0.000 0.036 0.964 0.000
#> GSM494664     1  0.2714      0.909 0.884 0.000 0.004 0.112
#> GSM494624     4  0.0000      0.902 0.000 0.000 0.000 1.000
#> GSM494651     1  0.5416      0.839 0.740 0.000 0.148 0.112
#> GSM494662     1  0.2530      0.910 0.888 0.000 0.000 0.112
#> GSM494627     1  0.3764      0.899 0.844 0.000 0.040 0.116
#> GSM494673     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494649     4  0.2224      0.858 0.032 0.000 0.040 0.928
#> GSM494658     1  0.5517      0.225 0.568 0.412 0.000 0.020
#> GSM494653     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494643     1  0.5681      0.511 0.568 0.000 0.028 0.404
#> GSM494672     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494618     1  0.4261      0.888 0.820 0.000 0.068 0.112
#> GSM494631     3  0.2739      0.838 0.000 0.036 0.904 0.060
#> GSM494619     4  0.0000      0.902 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494616     1  0.4724      0.877 0.792 0.000 0.096 0.112
#> GSM494663     1  0.3764      0.899 0.844 0.000 0.040 0.116
#> GSM494628     1  0.4662      0.880 0.796 0.000 0.092 0.112
#> GSM494632     1  0.2714      0.909 0.884 0.000 0.004 0.112
#> GSM494660     4  0.2124      0.862 0.028 0.000 0.040 0.932
#> GSM494622     1  0.5212      0.867 0.788 0.028 0.072 0.112
#> GSM494642     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494675     3  0.3528      0.833 0.000 0.192 0.808 0.000
#> GSM494641     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494636     1  0.2530      0.910 0.888 0.000 0.000 0.112
#> GSM494640     1  0.4378      0.870 0.796 0.000 0.040 0.164
#> GSM494623     4  0.0000      0.902 0.000 0.000 0.000 1.000
#> GSM494644     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494646     1  0.2530      0.910 0.888 0.000 0.000 0.112
#> GSM494665     1  0.2714      0.909 0.884 0.000 0.004 0.112
#> GSM494638     1  0.2714      0.909 0.884 0.000 0.004 0.112
#> GSM494645     1  0.1637      0.910 0.940 0.000 0.000 0.060
#> GSM494671     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494620     4  0.0000      0.902 0.000 0.000 0.000 1.000
#> GSM494630     4  0.0000      0.902 0.000 0.000 0.000 1.000
#> GSM494657     3  0.1118      0.891 0.000 0.036 0.964 0.000
#> GSM494667     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494621     4  0.0000      0.902 0.000 0.000 0.000 1.000
#> GSM494629     1  0.3231      0.906 0.868 0.004 0.012 0.116
#> GSM494637     1  0.4332      0.873 0.800 0.000 0.040 0.160
#> GSM494652     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494648     4  0.0000      0.902 0.000 0.000 0.000 1.000
#> GSM494650     1  0.5066      0.855 0.768 0.000 0.120 0.112
#> GSM494669     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494666     1  0.2714      0.909 0.884 0.000 0.004 0.112
#> GSM494668     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494633     4  0.0000      0.902 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.903 1.000 0.000 0.000 0.000
#> GSM494639     1  0.2530      0.910 0.888 0.000 0.000 0.112
#> GSM494661     1  0.1211      0.908 0.960 0.000 0.000 0.040
#> GSM494617     1  0.4261      0.888 0.820 0.000 0.068 0.112
#> GSM494626     1  0.4261      0.888 0.820 0.000 0.068 0.112
#> GSM494656     3  0.1118      0.891 0.000 0.036 0.964 0.000
#> GSM494635     1  0.2530      0.910 0.888 0.000 0.000 0.112

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     5  0.0000     0.7913 0.000 0.000 0.000 0.000 1.000
#> GSM494594     3  0.0000     0.8424 0.000 0.000 1.000 0.000 0.000
#> GSM494604     2  0.4457     0.3639 0.368 0.620 0.012 0.000 0.000
#> GSM494564     5  0.0000     0.7913 0.000 0.000 0.000 0.000 1.000
#> GSM494591     3  0.0880     0.8512 0.000 0.032 0.968 0.000 0.000
#> GSM494567     3  0.1557     0.8502 0.000 0.052 0.940 0.000 0.008
#> GSM494602     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494613     3  0.1121     0.8518 0.000 0.044 0.956 0.000 0.000
#> GSM494589     5  0.0000     0.7913 0.000 0.000 0.000 0.000 1.000
#> GSM494598     2  0.0703     0.8978 0.000 0.976 0.024 0.000 0.000
#> GSM494593     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494583     3  0.6215     0.3164 0.000 0.348 0.500 0.000 0.152
#> GSM494612     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494558     3  0.1579     0.8450 0.000 0.032 0.944 0.024 0.000
#> GSM494556     3  0.1270     0.8508 0.000 0.052 0.948 0.000 0.000
#> GSM494559     5  0.0000     0.7913 0.000 0.000 0.000 0.000 1.000
#> GSM494571     3  0.0000     0.8424 0.000 0.000 1.000 0.000 0.000
#> GSM494614     3  0.1410     0.8479 0.000 0.060 0.940 0.000 0.000
#> GSM494603     3  0.2221     0.8391 0.000 0.052 0.912 0.036 0.000
#> GSM494568     3  0.2221     0.8391 0.000 0.052 0.912 0.036 0.000
#> GSM494572     3  0.0000     0.8424 0.000 0.000 1.000 0.000 0.000
#> GSM494600     5  0.0000     0.7913 0.000 0.000 0.000 0.000 1.000
#> GSM494562     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494615     3  0.1270     0.8508 0.000 0.052 0.948 0.000 0.000
#> GSM494582     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494599     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494610     2  0.0794     0.8953 0.000 0.972 0.028 0.000 0.000
#> GSM494587     2  0.2074     0.8223 0.000 0.896 0.104 0.000 0.000
#> GSM494581     3  0.5447     0.2195 0.000 0.440 0.500 0.000 0.060
#> GSM494580     3  0.1430     0.8508 0.000 0.052 0.944 0.000 0.004
#> GSM494563     5  0.0000     0.7913 0.000 0.000 0.000 0.000 1.000
#> GSM494576     3  0.4307     0.1343 0.000 0.500 0.500 0.000 0.000
#> GSM494605     1  0.0162     0.9360 0.996 0.000 0.000 0.004 0.000
#> GSM494584     3  0.4287     0.2505 0.000 0.460 0.540 0.000 0.000
#> GSM494586     2  0.2329     0.7986 0.000 0.876 0.124 0.000 0.000
#> GSM494578     3  0.1430     0.8508 0.000 0.052 0.944 0.000 0.004
#> GSM494585     2  0.1671     0.8528 0.000 0.924 0.076 0.000 0.000
#> GSM494611     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494560     5  0.0000     0.7913 0.000 0.000 0.000 0.000 1.000
#> GSM494595     2  0.0703     0.8978 0.000 0.976 0.024 0.000 0.000
#> GSM494570     5  0.0000     0.7913 0.000 0.000 0.000 0.000 1.000
#> GSM494597     3  0.1270     0.8508 0.000 0.052 0.948 0.000 0.000
#> GSM494607     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494561     5  0.0000     0.7913 0.000 0.000 0.000 0.000 1.000
#> GSM494569     4  0.4294     0.2433 0.468 0.000 0.000 0.532 0.000
#> GSM494592     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494577     3  0.4307     0.1343 0.000 0.500 0.500 0.000 0.000
#> GSM494588     5  0.0000     0.7913 0.000 0.000 0.000 0.000 1.000
#> GSM494590     3  0.0000     0.8424 0.000 0.000 1.000 0.000 0.000
#> GSM494609     2  0.4305    -0.1596 0.000 0.512 0.488 0.000 0.000
#> GSM494608     2  0.3752     0.4933 0.000 0.708 0.292 0.000 0.000
#> GSM494606     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494574     2  0.0703     0.8978 0.000 0.976 0.024 0.000 0.000
#> GSM494573     5  0.0000     0.7913 0.000 0.000 0.000 0.000 1.000
#> GSM494566     3  0.4256     0.2761 0.000 0.436 0.564 0.000 0.000
#> GSM494601     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494557     3  0.0963     0.8517 0.000 0.036 0.964 0.000 0.000
#> GSM494579     3  0.4307     0.1343 0.000 0.500 0.500 0.000 0.000
#> GSM494596     3  0.0000     0.8424 0.000 0.000 1.000 0.000 0.000
#> GSM494575     2  0.0000     0.9056 0.000 1.000 0.000 0.000 0.000
#> GSM494625     4  0.1792     0.7237 0.000 0.000 0.000 0.916 0.084
#> GSM494654     3  0.0000     0.8424 0.000 0.000 1.000 0.000 0.000
#> GSM494664     1  0.0162     0.9360 0.996 0.000 0.000 0.004 0.000
#> GSM494624     5  0.4114     0.5901 0.000 0.000 0.000 0.376 0.624
#> GSM494651     4  0.0000     0.7947 0.000 0.000 0.000 1.000 0.000
#> GSM494662     4  0.3274     0.6720 0.220 0.000 0.000 0.780 0.000
#> GSM494627     4  0.0000     0.7947 0.000 0.000 0.000 1.000 0.000
#> GSM494673     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.1792     0.7237 0.000 0.000 0.000 0.916 0.084
#> GSM494658     1  0.3772     0.6779 0.792 0.036 0.172 0.000 0.000
#> GSM494653     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.0000     0.7947 0.000 0.000 0.000 1.000 0.000
#> GSM494672     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.2020     0.7552 0.100 0.000 0.000 0.900 0.000
#> GSM494631     3  0.0880     0.8512 0.000 0.032 0.968 0.000 0.000
#> GSM494619     5  0.4114     0.5901 0.000 0.000 0.000 0.376 0.624
#> GSM494674     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0000     0.7947 0.000 0.000 0.000 1.000 0.000
#> GSM494663     4  0.0000     0.7947 0.000 0.000 0.000 1.000 0.000
#> GSM494628     4  0.0000     0.7947 0.000 0.000 0.000 1.000 0.000
#> GSM494632     1  0.1410     0.8963 0.940 0.000 0.000 0.060 0.000
#> GSM494660     4  0.1792     0.7237 0.000 0.000 0.000 0.916 0.084
#> GSM494622     1  0.6992    -0.0826 0.388 0.008 0.336 0.268 0.000
#> GSM494642     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0162     0.9360 0.996 0.000 0.000 0.004 0.000
#> GSM494675     3  0.1410     0.8479 0.000 0.060 0.940 0.000 0.000
#> GSM494641     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.2891     0.7073 0.176 0.000 0.000 0.824 0.000
#> GSM494640     4  0.0000     0.7947 0.000 0.000 0.000 1.000 0.000
#> GSM494623     5  0.4114     0.5901 0.000 0.000 0.000 0.376 0.624
#> GSM494644     1  0.0162     0.9360 0.996 0.000 0.000 0.004 0.000
#> GSM494646     1  0.1410     0.8963 0.940 0.000 0.000 0.060 0.000
#> GSM494665     1  0.0162     0.9360 0.996 0.000 0.000 0.004 0.000
#> GSM494638     1  0.2046     0.8783 0.916 0.000 0.016 0.068 0.000
#> GSM494645     1  0.0162     0.9360 0.996 0.000 0.000 0.004 0.000
#> GSM494671     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0162     0.9360 0.996 0.000 0.000 0.004 0.000
#> GSM494620     5  0.4114     0.5901 0.000 0.000 0.000 0.376 0.624
#> GSM494630     5  0.4114     0.5901 0.000 0.000 0.000 0.376 0.624
#> GSM494657     3  0.0000     0.8424 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494621     5  0.4114     0.5901 0.000 0.000 0.000 0.376 0.624
#> GSM494629     4  0.4026     0.5525 0.020 0.000 0.244 0.736 0.000
#> GSM494637     4  0.0000     0.7947 0.000 0.000 0.000 1.000 0.000
#> GSM494652     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494648     5  0.4114     0.5901 0.000 0.000 0.000 0.376 0.624
#> GSM494650     4  0.4196     0.5026 0.356 0.000 0.004 0.640 0.000
#> GSM494669     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0162     0.9360 0.996 0.000 0.000 0.004 0.000
#> GSM494668     1  0.0162     0.9360 0.996 0.000 0.000 0.004 0.000
#> GSM494633     5  0.4210     0.5266 0.000 0.000 0.000 0.412 0.588
#> GSM494634     1  0.0000     0.9361 1.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.1341     0.8996 0.944 0.000 0.000 0.056 0.000
#> GSM494661     1  0.0162     0.9360 0.996 0.000 0.000 0.004 0.000
#> GSM494617     1  0.4300    -0.1411 0.524 0.000 0.000 0.476 0.000
#> GSM494626     4  0.4306     0.1754 0.492 0.000 0.000 0.508 0.000
#> GSM494656     3  0.0000     0.8424 0.000 0.000 1.000 0.000 0.000
#> GSM494635     1  0.1478     0.8937 0.936 0.000 0.000 0.064 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
#> GSM494565     5  0.0000     0.9984 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494594     3  0.0000     0.9238 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.4003     0.7577 0.756 0.152 0.000 0.092 0.000 0.000
#> GSM494564     5  0.0000     0.9984 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494591     3  0.0000     0.9238 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     3  0.1152     0.9160 0.000 0.000 0.952 0.044 0.004 0.000
#> GSM494602     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494613     3  0.0790     0.9211 0.000 0.000 0.968 0.032 0.000 0.000
#> GSM494589     5  0.0000     0.9984 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494598     2  0.0260     0.9603 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM494593     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494583     2  0.3313     0.8212 0.000 0.816 0.060 0.000 0.124 0.000
#> GSM494612     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     3  0.3076     0.6567 0.000 0.000 0.760 0.240 0.000 0.000
#> GSM494556     3  0.0790     0.9211 0.000 0.000 0.968 0.032 0.000 0.000
#> GSM494559     5  0.0000     0.9984 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494571     3  0.0000     0.9238 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494614     3  0.4378     0.3548 0.000 0.368 0.600 0.032 0.000 0.000
#> GSM494603     4  0.1556     0.8418 0.000 0.000 0.080 0.920 0.000 0.000
#> GSM494568     4  0.0458     0.9073 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM494572     3  0.0000     0.9238 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494600     5  0.0000     0.9984 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494562     2  0.0458     0.9553 0.000 0.984 0.016 0.000 0.000 0.000
#> GSM494615     3  0.0790     0.9211 0.000 0.000 0.968 0.032 0.000 0.000
#> GSM494582     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494599     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494610     2  0.0260     0.9603 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM494587     2  0.0458     0.9553 0.000 0.984 0.016 0.000 0.000 0.000
#> GSM494581     2  0.1890     0.9178 0.000 0.916 0.060 0.000 0.024 0.000
#> GSM494580     3  0.1152     0.9160 0.000 0.000 0.952 0.044 0.004 0.000
#> GSM494563     5  0.0000     0.9984 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494576     2  0.0937     0.9441 0.000 0.960 0.040 0.000 0.000 0.000
#> GSM494605     1  0.2135     0.8534 0.872 0.000 0.000 0.128 0.000 0.000
#> GSM494584     2  0.2003     0.8776 0.000 0.884 0.116 0.000 0.000 0.000
#> GSM494586     2  0.0260     0.9603 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM494578     3  0.1152     0.9160 0.000 0.000 0.952 0.044 0.004 0.000
#> GSM494585     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494611     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494560     5  0.0000     0.9984 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494595     2  0.0260     0.9603 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM494570     5  0.0000     0.9984 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494597     3  0.0000     0.9238 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494607     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494561     5  0.0458     0.9836 0.000 0.000 0.000 0.000 0.984 0.016
#> GSM494569     4  0.0000     0.9167 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494592     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494577     2  0.1267     0.9294 0.000 0.940 0.060 0.000 0.000 0.000
#> GSM494588     5  0.0000     0.9984 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494590     3  0.0000     0.9238 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     2  0.0713     0.9515 0.000 0.972 0.028 0.000 0.000 0.000
#> GSM494608     2  0.0603     0.9570 0.000 0.980 0.016 0.000 0.004 0.000
#> GSM494606     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494574     2  0.0260     0.9603 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM494573     5  0.0000     0.9984 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494566     2  0.4955     0.4570 0.000 0.608 0.296 0.096 0.000 0.000
#> GSM494601     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494557     3  0.0790     0.9211 0.000 0.000 0.968 0.032 0.000 0.000
#> GSM494579     2  0.1204     0.9326 0.000 0.944 0.056 0.000 0.000 0.000
#> GSM494596     3  0.0000     0.9238 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0000     0.9607 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     6  0.0458     0.9123 0.000 0.000 0.000 0.016 0.000 0.984
#> GSM494654     3  0.0632     0.9172 0.000 0.000 0.976 0.024 0.000 0.000
#> GSM494664     1  0.3101     0.7395 0.756 0.000 0.000 0.244 0.000 0.000
#> GSM494624     6  0.0000     0.9179 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494651     4  0.0000     0.9167 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494662     4  0.2092     0.8483 0.000 0.000 0.000 0.876 0.000 0.124
#> GSM494627     4  0.1075     0.9049 0.000 0.000 0.000 0.952 0.000 0.048
#> GSM494673     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     6  0.2092     0.8224 0.000 0.000 0.000 0.124 0.000 0.876
#> GSM494658     1  0.3606     0.8119 0.800 0.052 0.008 0.140 0.000 0.000
#> GSM494653     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     6  0.3823     0.1584 0.000 0.000 0.000 0.436 0.000 0.564
#> GSM494672     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0000     0.9167 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494631     3  0.3706     0.4389 0.000 0.000 0.620 0.380 0.000 0.000
#> GSM494619     6  0.0000     0.9179 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494674     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0000     0.9167 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494663     4  0.1267     0.8989 0.000 0.000 0.000 0.940 0.000 0.060
#> GSM494628     4  0.0790     0.9102 0.000 0.000 0.000 0.968 0.000 0.032
#> GSM494632     4  0.1556     0.8705 0.080 0.000 0.000 0.920 0.000 0.000
#> GSM494660     6  0.2092     0.8224 0.000 0.000 0.000 0.124 0.000 0.876
#> GSM494622     4  0.0146     0.9149 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM494642     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494675     3  0.1575     0.9003 0.000 0.032 0.936 0.032 0.000 0.000
#> GSM494641     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.1219     0.8968 0.048 0.000 0.000 0.948 0.000 0.004
#> GSM494640     4  0.2454     0.8095 0.000 0.000 0.000 0.840 0.000 0.160
#> GSM494623     6  0.0000     0.9179 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494644     1  0.1267     0.8928 0.940 0.000 0.000 0.060 0.000 0.000
#> GSM494646     1  0.3647     0.5213 0.640 0.000 0.000 0.360 0.000 0.000
#> GSM494665     1  0.2135     0.8534 0.872 0.000 0.000 0.128 0.000 0.000
#> GSM494638     4  0.1296     0.8994 0.044 0.000 0.004 0.948 0.000 0.004
#> GSM494645     1  0.1501     0.8861 0.924 0.000 0.000 0.076 0.000 0.000
#> GSM494671     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.0000     0.9179 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494630     6  0.0000     0.9179 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494657     3  0.0000     0.9238 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0000     0.9179 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494629     4  0.1075     0.9049 0.000 0.000 0.000 0.952 0.000 0.048
#> GSM494637     4  0.2454     0.8095 0.000 0.000 0.000 0.840 0.000 0.160
#> GSM494652     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.0000     0.9179 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494650     4  0.0000     0.9167 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494669     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.2597     0.8139 0.824 0.000 0.000 0.176 0.000 0.000
#> GSM494668     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     6  0.0363     0.9144 0.000 0.000 0.000 0.012 0.000 0.988
#> GSM494634     1  0.0000     0.9116 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     4  0.3847     0.0378 0.456 0.000 0.000 0.544 0.000 0.000
#> GSM494661     1  0.2597     0.8139 0.824 0.000 0.000 0.176 0.000 0.000
#> GSM494617     4  0.0146     0.9158 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM494626     4  0.0000     0.9167 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494656     3  0.0000     0.9238 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494635     1  0.3428     0.6382 0.696 0.000 0.000 0.304 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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 3)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 4)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-mclust-collect-classes

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

test_to_known_factors(res)
#>              n disease.state(p)  age(p) other(p) individual(p) k
#> MAD:mclust 117         8.91e-01 0.00493 9.09e-01      0.000024 2
#> MAD:mclust 117         2.76e-14 0.13997 1.74e-08      0.059486 3
#> MAD:mclust 118         1.13e-15 0.07716 1.22e-12      0.039834 4
#> MAD:mclust 106         6.80e-14 0.17796 8.41e-10      0.102737 5
#> MAD:mclust 115         8.46e-17 0.24931 1.53e-11      0.533989 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 51941 rows and 120 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 0.707           0.870       0.943         0.4923 0.503   0.503
#> 3 3 0.953           0.944       0.977         0.3236 0.636   0.401
#> 4 4 0.695           0.748       0.862         0.1165 0.867   0.651
#> 5 5 0.648           0.668       0.817         0.0698 0.838   0.514
#> 6 6 0.663           0.625       0.786         0.0302 0.913   0.658

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
#> GSM494565     2  0.0000     0.9118 0.000 1.000
#> GSM494594     2  0.0000     0.9118 0.000 1.000
#> GSM494604     1  0.0000     0.9544 1.000 0.000
#> GSM494564     2  0.0000     0.9118 0.000 1.000
#> GSM494591     2  0.0000     0.9118 0.000 1.000
#> GSM494567     2  0.0000     0.9118 0.000 1.000
#> GSM494602     1  0.0000     0.9544 1.000 0.000
#> GSM494613     2  0.0000     0.9118 0.000 1.000
#> GSM494589     2  0.0000     0.9118 0.000 1.000
#> GSM494598     1  0.0000     0.9544 1.000 0.000
#> GSM494593     1  0.0672     0.9481 0.992 0.008
#> GSM494583     2  0.0000     0.9118 0.000 1.000
#> GSM494612     1  0.0000     0.9544 1.000 0.000
#> GSM494558     2  0.0000     0.9118 0.000 1.000
#> GSM494556     2  0.0000     0.9118 0.000 1.000
#> GSM494559     2  0.0000     0.9118 0.000 1.000
#> GSM494571     2  0.0000     0.9118 0.000 1.000
#> GSM494614     2  0.0000     0.9118 0.000 1.000
#> GSM494603     2  0.0000     0.9118 0.000 1.000
#> GSM494568     2  0.0000     0.9118 0.000 1.000
#> GSM494572     2  0.0000     0.9118 0.000 1.000
#> GSM494600     2  0.0000     0.9118 0.000 1.000
#> GSM494562     1  0.7299     0.7281 0.796 0.204
#> GSM494615     2  0.0000     0.9118 0.000 1.000
#> GSM494582     1  0.0000     0.9544 1.000 0.000
#> GSM494599     1  0.0000     0.9544 1.000 0.000
#> GSM494610     1  0.0000     0.9544 1.000 0.000
#> GSM494587     2  0.9795     0.2590 0.416 0.584
#> GSM494581     1  0.3584     0.8922 0.932 0.068
#> GSM494580     2  0.0000     0.9118 0.000 1.000
#> GSM494563     2  0.0672     0.9075 0.008 0.992
#> GSM494576     2  0.5178     0.8225 0.116 0.884
#> GSM494605     1  0.0000     0.9544 1.000 0.000
#> GSM494584     2  0.0000     0.9118 0.000 1.000
#> GSM494586     1  0.5629     0.8216 0.868 0.132
#> GSM494578     2  0.0000     0.9118 0.000 1.000
#> GSM494585     1  0.8327     0.6390 0.736 0.264
#> GSM494611     1  0.0000     0.9544 1.000 0.000
#> GSM494560     2  0.0000     0.9118 0.000 1.000
#> GSM494595     1  0.0000     0.9544 1.000 0.000
#> GSM494570     2  0.0000     0.9118 0.000 1.000
#> GSM494597     2  0.0000     0.9118 0.000 1.000
#> GSM494607     1  0.0000     0.9544 1.000 0.000
#> GSM494561     2  0.0000     0.9118 0.000 1.000
#> GSM494569     1  0.9977    -0.0528 0.528 0.472
#> GSM494592     1  0.0000     0.9544 1.000 0.000
#> GSM494577     2  0.2043     0.8923 0.032 0.968
#> GSM494588     1  0.9866     0.2558 0.568 0.432
#> GSM494590     2  0.0000     0.9118 0.000 1.000
#> GSM494609     1  0.0000     0.9544 1.000 0.000
#> GSM494608     1  0.0000     0.9544 1.000 0.000
#> GSM494606     1  0.0000     0.9544 1.000 0.000
#> GSM494574     1  0.0000     0.9544 1.000 0.000
#> GSM494573     2  0.0000     0.9118 0.000 1.000
#> GSM494566     1  0.8499     0.6220 0.724 0.276
#> GSM494601     1  0.0000     0.9544 1.000 0.000
#> GSM494557     2  0.0000     0.9118 0.000 1.000
#> GSM494579     1  0.6973     0.7506 0.812 0.188
#> GSM494596     2  0.0000     0.9118 0.000 1.000
#> GSM494575     1  0.0000     0.9544 1.000 0.000
#> GSM494625     2  0.7453     0.7590 0.212 0.788
#> GSM494654     2  0.0000     0.9118 0.000 1.000
#> GSM494664     1  0.0000     0.9544 1.000 0.000
#> GSM494624     1  0.8861     0.5024 0.696 0.304
#> GSM494651     2  0.9248     0.5726 0.340 0.660
#> GSM494662     1  0.0000     0.9544 1.000 0.000
#> GSM494627     2  0.5408     0.8352 0.124 0.876
#> GSM494673     1  0.0000     0.9544 1.000 0.000
#> GSM494649     2  0.8144     0.7112 0.252 0.748
#> GSM494658     1  0.0000     0.9544 1.000 0.000
#> GSM494653     1  0.0000     0.9544 1.000 0.000
#> GSM494643     1  0.7376     0.6966 0.792 0.208
#> GSM494672     1  0.0000     0.9544 1.000 0.000
#> GSM494618     2  0.9833     0.3786 0.424 0.576
#> GSM494631     2  0.0000     0.9118 0.000 1.000
#> GSM494619     1  0.2423     0.9197 0.960 0.040
#> GSM494674     1  0.0000     0.9544 1.000 0.000
#> GSM494616     2  0.9044     0.6085 0.320 0.680
#> GSM494663     2  0.9248     0.5727 0.340 0.660
#> GSM494628     2  0.6973     0.7831 0.188 0.812
#> GSM494632     1  0.0000     0.9544 1.000 0.000
#> GSM494660     2  0.7299     0.7675 0.204 0.796
#> GSM494622     2  0.9635     0.4702 0.388 0.612
#> GSM494642     1  0.0000     0.9544 1.000 0.000
#> GSM494647     1  0.0000     0.9544 1.000 0.000
#> GSM494659     1  0.0000     0.9544 1.000 0.000
#> GSM494670     1  0.0000     0.9544 1.000 0.000
#> GSM494675     2  0.0000     0.9118 0.000 1.000
#> GSM494641     1  0.0000     0.9544 1.000 0.000
#> GSM494636     1  0.0000     0.9544 1.000 0.000
#> GSM494640     2  0.7219     0.7715 0.200 0.800
#> GSM494623     1  0.0000     0.9544 1.000 0.000
#> GSM494644     1  0.0000     0.9544 1.000 0.000
#> GSM494646     1  0.0000     0.9544 1.000 0.000
#> GSM494665     1  0.0000     0.9544 1.000 0.000
#> GSM494638     1  0.0000     0.9544 1.000 0.000
#> GSM494645     1  0.0000     0.9544 1.000 0.000
#> GSM494671     1  0.0000     0.9544 1.000 0.000
#> GSM494655     1  0.0000     0.9544 1.000 0.000
#> GSM494620     1  0.0000     0.9544 1.000 0.000
#> GSM494630     1  0.2236     0.9235 0.964 0.036
#> GSM494657     2  0.0000     0.9118 0.000 1.000
#> GSM494667     1  0.0000     0.9544 1.000 0.000
#> GSM494621     1  0.0672     0.9481 0.992 0.008
#> GSM494629     2  0.1633     0.8998 0.024 0.976
#> GSM494637     2  0.8207     0.7059 0.256 0.744
#> GSM494652     1  0.0000     0.9544 1.000 0.000
#> GSM494648     1  0.0000     0.9544 1.000 0.000
#> GSM494650     2  0.6712     0.7952 0.176 0.824
#> GSM494669     1  0.0000     0.9544 1.000 0.000
#> GSM494666     1  0.0000     0.9544 1.000 0.000
#> GSM494668     1  0.0000     0.9544 1.000 0.000
#> GSM494633     2  0.7528     0.7552 0.216 0.784
#> GSM494634     1  0.0000     0.9544 1.000 0.000
#> GSM494639     1  0.0000     0.9544 1.000 0.000
#> GSM494661     1  0.0000     0.9544 1.000 0.000
#> GSM494617     1  0.0000     0.9544 1.000 0.000
#> GSM494626     1  0.1633     0.9348 0.976 0.024
#> GSM494656     2  0.0000     0.9118 0.000 1.000
#> GSM494635     1  0.0000     0.9544 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
#> GSM494565     3  0.2959      0.870 0.000 0.100 0.900
#> GSM494594     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494604     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494564     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494591     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494567     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494602     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494613     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494589     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494598     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494593     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494583     2  0.0592      0.951 0.000 0.988 0.012
#> GSM494612     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494558     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494556     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494559     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494571     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494614     3  0.4750      0.713 0.000 0.216 0.784
#> GSM494603     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494568     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494572     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494600     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494562     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494615     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494582     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494599     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494610     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494587     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494581     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494580     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494563     2  0.5968      0.417 0.000 0.636 0.364
#> GSM494576     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494605     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494584     2  0.5859      0.465 0.000 0.656 0.344
#> GSM494586     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494578     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494585     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494611     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494560     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494595     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494570     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494597     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494607     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494561     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494569     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494592     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494577     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494588     3  0.8426      0.216 0.092 0.384 0.524
#> GSM494590     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494609     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494608     2  0.0592      0.950 0.012 0.988 0.000
#> GSM494606     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494574     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494573     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494566     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494601     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494557     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494579     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494596     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494575     2  0.0000      0.961 0.000 1.000 0.000
#> GSM494625     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494654     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494664     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494624     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494651     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494662     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494627     1  0.3340      0.859 0.880 0.000 0.120
#> GSM494673     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494649     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494658     2  0.2066      0.900 0.060 0.940 0.000
#> GSM494653     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494643     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494672     2  0.5650      0.538 0.312 0.688 0.000
#> GSM494618     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494631     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494619     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494674     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494616     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494663     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494628     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494632     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494660     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494622     1  0.0892      0.968 0.980 0.000 0.020
#> GSM494642     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494647     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494659     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494670     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494675     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494641     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494636     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494640     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494623     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494644     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494646     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494665     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494638     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494645     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494671     1  0.5810      0.492 0.664 0.336 0.000
#> GSM494655     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494620     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494630     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494657     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494667     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494621     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494629     3  0.4178      0.767 0.172 0.000 0.828
#> GSM494637     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494652     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494648     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494650     1  0.1643      0.945 0.956 0.000 0.044
#> GSM494669     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494666     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494668     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494633     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494634     1  0.4235      0.783 0.824 0.176 0.000
#> GSM494639     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494661     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494617     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494626     1  0.0000      0.987 1.000 0.000 0.000
#> GSM494656     3  0.0000      0.970 0.000 0.000 1.000
#> GSM494635     1  0.0000      0.987 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
#> GSM494565     2  0.2921     0.8172 0.140 0.860 0.000 0.000
#> GSM494594     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494604     1  0.3444     0.7464 0.816 0.000 0.000 0.184
#> GSM494564     2  0.0188     0.7494 0.004 0.996 0.000 0.000
#> GSM494591     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494567     3  0.0469     0.9591 0.000 0.012 0.988 0.000
#> GSM494602     1  0.0707     0.7530 0.980 0.020 0.000 0.000
#> GSM494613     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494589     2  0.3399     0.7741 0.040 0.868 0.092 0.000
#> GSM494598     2  0.4103     0.7778 0.256 0.744 0.000 0.000
#> GSM494593     1  0.2345     0.6956 0.900 0.100 0.000 0.000
#> GSM494583     2  0.3610     0.8159 0.200 0.800 0.000 0.000
#> GSM494612     1  0.0592     0.7541 0.984 0.016 0.000 0.000
#> GSM494558     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494556     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494559     2  0.0336     0.7407 0.000 0.992 0.000 0.008
#> GSM494571     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494614     2  0.6565     0.6516 0.148 0.628 0.224 0.000
#> GSM494603     2  0.6716    -0.0561 0.000 0.504 0.404 0.092
#> GSM494568     3  0.3463     0.8402 0.000 0.096 0.864 0.040
#> GSM494572     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494600     2  0.3279     0.8089 0.096 0.872 0.032 0.000
#> GSM494562     1  0.3907     0.5094 0.768 0.232 0.000 0.000
#> GSM494615     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494582     1  0.0592     0.7541 0.984 0.016 0.000 0.000
#> GSM494599     1  0.1716     0.7789 0.936 0.000 0.000 0.064
#> GSM494610     2  0.3837     0.8034 0.224 0.776 0.000 0.000
#> GSM494587     1  0.4697     0.2032 0.644 0.356 0.000 0.000
#> GSM494581     2  0.3610     0.8159 0.200 0.800 0.000 0.000
#> GSM494580     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494563     2  0.2704     0.8136 0.124 0.876 0.000 0.000
#> GSM494576     2  0.3649     0.8143 0.204 0.796 0.000 0.000
#> GSM494605     4  0.1118     0.8088 0.036 0.000 0.000 0.964
#> GSM494584     2  0.3610     0.8159 0.200 0.800 0.000 0.000
#> GSM494586     2  0.3764     0.8085 0.216 0.784 0.000 0.000
#> GSM494578     3  0.0188     0.9647 0.000 0.004 0.996 0.000
#> GSM494585     1  0.4356     0.3692 0.708 0.292 0.000 0.000
#> GSM494611     1  0.1474     0.7320 0.948 0.052 0.000 0.000
#> GSM494560     2  0.2973     0.8177 0.144 0.856 0.000 0.000
#> GSM494595     2  0.4164     0.7733 0.264 0.736 0.000 0.000
#> GSM494570     2  0.0921     0.7233 0.000 0.972 0.000 0.028
#> GSM494597     3  0.0921     0.9452 0.000 0.028 0.972 0.000
#> GSM494607     1  0.2216     0.7789 0.908 0.000 0.000 0.092
#> GSM494561     2  0.5523    -0.0190 0.000 0.596 0.024 0.380
#> GSM494569     4  0.4877     0.4852 0.008 0.000 0.328 0.664
#> GSM494592     1  0.2011     0.7798 0.920 0.000 0.000 0.080
#> GSM494577     2  0.3610     0.8159 0.200 0.800 0.000 0.000
#> GSM494588     2  0.0336     0.7407 0.000 0.992 0.000 0.008
#> GSM494590     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494609     2  0.4624     0.6620 0.340 0.660 0.000 0.000
#> GSM494608     1  0.3726     0.7381 0.788 0.000 0.000 0.212
#> GSM494606     1  0.2589     0.7732 0.884 0.000 0.000 0.116
#> GSM494574     2  0.4746     0.6144 0.368 0.632 0.000 0.000
#> GSM494573     2  0.3505     0.8040 0.088 0.864 0.048 0.000
#> GSM494566     1  0.3669     0.7514 0.876 0.040 0.052 0.032
#> GSM494601     1  0.0188     0.7596 0.996 0.004 0.000 0.000
#> GSM494557     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494579     2  0.3610     0.8159 0.200 0.800 0.000 0.000
#> GSM494596     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494575     1  0.0707     0.7516 0.980 0.020 0.000 0.000
#> GSM494625     4  0.3486     0.7848 0.000 0.188 0.000 0.812
#> GSM494654     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494664     4  0.0592     0.8162 0.016 0.000 0.000 0.984
#> GSM494624     4  0.3610     0.7788 0.000 0.200 0.000 0.800
#> GSM494651     4  0.5310     0.2835 0.012 0.000 0.412 0.576
#> GSM494662     4  0.2345     0.8085 0.000 0.100 0.000 0.900
#> GSM494627     4  0.4079     0.7835 0.000 0.180 0.020 0.800
#> GSM494673     1  0.4817     0.4496 0.612 0.000 0.000 0.388
#> GSM494649     4  0.3444     0.7865 0.000 0.184 0.000 0.816
#> GSM494658     1  0.4989     0.1977 0.528 0.000 0.000 0.472
#> GSM494653     4  0.1792     0.7911 0.068 0.000 0.000 0.932
#> GSM494643     4  0.3400     0.7881 0.000 0.180 0.000 0.820
#> GSM494672     1  0.3726     0.7354 0.788 0.000 0.000 0.212
#> GSM494618     4  0.0336     0.8191 0.000 0.008 0.000 0.992
#> GSM494631     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494619     4  0.3610     0.7788 0.000 0.200 0.000 0.800
#> GSM494674     4  0.1792     0.7914 0.068 0.000 0.000 0.932
#> GSM494616     4  0.1545     0.8080 0.008 0.000 0.040 0.952
#> GSM494663     4  0.3400     0.7881 0.000 0.180 0.000 0.820
#> GSM494628     4  0.3224     0.8027 0.000 0.120 0.016 0.864
#> GSM494632     4  0.0469     0.8171 0.012 0.000 0.000 0.988
#> GSM494660     4  0.3569     0.7810 0.000 0.196 0.000 0.804
#> GSM494622     4  0.5189     0.3736 0.012 0.000 0.372 0.616
#> GSM494642     4  0.1389     0.8030 0.048 0.000 0.000 0.952
#> GSM494647     4  0.4730     0.3318 0.364 0.000 0.000 0.636
#> GSM494659     4  0.4585     0.4147 0.332 0.000 0.000 0.668
#> GSM494670     4  0.3801     0.6263 0.220 0.000 0.000 0.780
#> GSM494675     3  0.0469     0.9590 0.000 0.012 0.988 0.000
#> GSM494641     4  0.1637     0.7961 0.060 0.000 0.000 0.940
#> GSM494636     4  0.2011     0.8119 0.000 0.080 0.000 0.920
#> GSM494640     4  0.3725     0.7866 0.000 0.180 0.008 0.812
#> GSM494623     4  0.3610     0.7788 0.000 0.200 0.000 0.800
#> GSM494644     4  0.0469     0.8171 0.012 0.000 0.000 0.988
#> GSM494646     4  0.0336     0.8191 0.000 0.008 0.000 0.992
#> GSM494665     4  0.4331     0.5102 0.288 0.000 0.000 0.712
#> GSM494638     4  0.0524     0.8183 0.008 0.004 0.000 0.988
#> GSM494645     4  0.0469     0.8171 0.012 0.000 0.000 0.988
#> GSM494671     1  0.3764     0.7318 0.784 0.000 0.000 0.216
#> GSM494655     4  0.0592     0.8162 0.016 0.000 0.000 0.984
#> GSM494620     4  0.3486     0.7848 0.000 0.188 0.000 0.812
#> GSM494630     4  0.3610     0.7788 0.000 0.200 0.000 0.800
#> GSM494657     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494667     4  0.4972     0.0143 0.456 0.000 0.000 0.544
#> GSM494621     4  0.3610     0.7788 0.000 0.200 0.000 0.800
#> GSM494629     3  0.5314     0.6873 0.000 0.108 0.748 0.144
#> GSM494637     4  0.3400     0.7881 0.000 0.180 0.000 0.820
#> GSM494652     4  0.4382     0.4951 0.296 0.000 0.000 0.704
#> GSM494648     4  0.3610     0.7788 0.000 0.200 0.000 0.800
#> GSM494650     3  0.3356     0.7582 0.000 0.000 0.824 0.176
#> GSM494669     4  0.4222     0.5397 0.272 0.000 0.000 0.728
#> GSM494666     4  0.0707     0.8149 0.020 0.000 0.000 0.980
#> GSM494668     4  0.2281     0.7694 0.096 0.000 0.000 0.904
#> GSM494633     4  0.3610     0.7788 0.000 0.200 0.000 0.800
#> GSM494634     1  0.4103     0.6883 0.744 0.000 0.000 0.256
#> GSM494639     4  0.0336     0.8178 0.008 0.000 0.000 0.992
#> GSM494661     4  0.0921     0.8120 0.028 0.000 0.000 0.972
#> GSM494617     4  0.0592     0.8162 0.016 0.000 0.000 0.984
#> GSM494626     4  0.0592     0.8162 0.016 0.000 0.000 0.984
#> GSM494656     3  0.0000     0.9672 0.000 0.000 1.000 0.000
#> GSM494635     4  0.0336     0.8191 0.000 0.008 0.000 0.992

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     4  0.4060    0.50582 0.000 0.000 0.000 0.640 0.360
#> GSM494594     3  0.0671    0.86699 0.000 0.000 0.980 0.004 0.016
#> GSM494604     2  0.2835    0.71859 0.036 0.880 0.000 0.004 0.080
#> GSM494564     4  0.2127    0.68047 0.000 0.000 0.000 0.892 0.108
#> GSM494591     3  0.0898    0.86897 0.000 0.000 0.972 0.020 0.008
#> GSM494567     3  0.2270    0.85047 0.004 0.000 0.908 0.016 0.072
#> GSM494602     2  0.3579    0.57796 0.000 0.756 0.000 0.004 0.240
#> GSM494613     3  0.4505    0.75560 0.000 0.004 0.760 0.152 0.084
#> GSM494589     4  0.1965    0.67984 0.000 0.000 0.000 0.904 0.096
#> GSM494598     2  0.4661    0.55744 0.000 0.656 0.000 0.032 0.312
#> GSM494593     5  0.4595    0.45788 0.004 0.400 0.000 0.008 0.588
#> GSM494583     5  0.0865    0.74908 0.000 0.004 0.000 0.024 0.972
#> GSM494612     2  0.2966    0.60552 0.000 0.816 0.000 0.000 0.184
#> GSM494558     3  0.3480    0.66653 0.000 0.000 0.752 0.248 0.000
#> GSM494556     3  0.3399    0.79840 0.000 0.000 0.812 0.168 0.020
#> GSM494559     4  0.4074    0.36212 0.000 0.000 0.000 0.636 0.364
#> GSM494571     3  0.0162    0.86788 0.000 0.000 0.996 0.004 0.000
#> GSM494614     5  0.6069    0.54782 0.000 0.012 0.176 0.196 0.616
#> GSM494603     4  0.3925    0.65929 0.028 0.004 0.004 0.792 0.172
#> GSM494568     4  0.4567    0.65388 0.036 0.004 0.152 0.776 0.032
#> GSM494572     3  0.1205    0.86572 0.000 0.000 0.956 0.040 0.004
#> GSM494600     4  0.2377    0.67293 0.000 0.000 0.000 0.872 0.128
#> GSM494562     2  0.4292    0.61982 0.000 0.704 0.000 0.024 0.272
#> GSM494615     3  0.3992    0.71019 0.000 0.000 0.720 0.268 0.012
#> GSM494582     2  0.2179    0.69058 0.000 0.888 0.000 0.000 0.112
#> GSM494599     2  0.1082    0.71557 0.008 0.964 0.000 0.000 0.028
#> GSM494610     2  0.5107    0.47429 0.000 0.596 0.000 0.048 0.356
#> GSM494587     5  0.3106    0.75521 0.000 0.116 0.008 0.020 0.856
#> GSM494581     5  0.2407    0.73351 0.000 0.012 0.004 0.088 0.896
#> GSM494580     3  0.1251    0.86529 0.000 0.000 0.956 0.008 0.036
#> GSM494563     4  0.3395    0.64044 0.000 0.000 0.000 0.764 0.236
#> GSM494576     5  0.2074    0.75718 0.000 0.044 0.000 0.036 0.920
#> GSM494605     1  0.1270    0.82902 0.948 0.052 0.000 0.000 0.000
#> GSM494584     5  0.1299    0.75558 0.000 0.008 0.012 0.020 0.960
#> GSM494586     5  0.4193    0.56333 0.000 0.256 0.000 0.024 0.720
#> GSM494578     3  0.4712    0.72724 0.004 0.000 0.736 0.080 0.180
#> GSM494585     5  0.3368    0.73421 0.000 0.156 0.000 0.024 0.820
#> GSM494611     2  0.2707    0.70052 0.000 0.860 0.000 0.008 0.132
#> GSM494560     4  0.3480    0.58179 0.000 0.000 0.000 0.752 0.248
#> GSM494595     5  0.2813    0.74883 0.000 0.108 0.000 0.024 0.868
#> GSM494570     4  0.1341    0.68907 0.000 0.000 0.000 0.944 0.056
#> GSM494597     3  0.3780    0.77997 0.000 0.000 0.812 0.116 0.072
#> GSM494607     2  0.1788    0.72340 0.008 0.932 0.000 0.004 0.056
#> GSM494561     4  0.1364    0.69490 0.036 0.000 0.000 0.952 0.012
#> GSM494569     1  0.4654    0.62888 0.720 0.008 0.240 0.012 0.020
#> GSM494592     2  0.1522    0.71287 0.012 0.944 0.000 0.000 0.044
#> GSM494577     5  0.2712    0.70812 0.000 0.032 0.000 0.088 0.880
#> GSM494588     4  0.2773    0.66130 0.000 0.000 0.000 0.836 0.164
#> GSM494590     3  0.0162    0.86788 0.000 0.000 0.996 0.004 0.000
#> GSM494609     5  0.3474    0.72663 0.032 0.112 0.004 0.008 0.844
#> GSM494608     5  0.6495    0.19837 0.148 0.380 0.008 0.000 0.464
#> GSM494606     2  0.5390    0.30442 0.048 0.620 0.004 0.008 0.320
#> GSM494574     2  0.4679    0.54995 0.000 0.652 0.000 0.032 0.316
#> GSM494573     4  0.2648    0.66350 0.000 0.000 0.000 0.848 0.152
#> GSM494566     2  0.3600    0.69966 0.016 0.840 0.008 0.020 0.116
#> GSM494601     2  0.3336    0.63513 0.000 0.772 0.000 0.000 0.228
#> GSM494557     3  0.3848    0.78632 0.000 0.004 0.816 0.076 0.104
#> GSM494579     4  0.5224    0.49256 0.000 0.080 0.000 0.644 0.276
#> GSM494596     3  0.0324    0.86897 0.000 0.000 0.992 0.004 0.004
#> GSM494575     5  0.4350    0.46437 0.000 0.408 0.000 0.004 0.588
#> GSM494625     4  0.4325    0.57814 0.300 0.012 0.000 0.684 0.004
#> GSM494654     3  0.0290    0.86872 0.000 0.000 0.992 0.008 0.000
#> GSM494664     1  0.1205    0.83082 0.956 0.040 0.000 0.004 0.000
#> GSM494624     4  0.3618    0.67116 0.196 0.012 0.000 0.788 0.004
#> GSM494651     3  0.4262    0.56491 0.288 0.004 0.696 0.012 0.000
#> GSM494662     1  0.1173    0.82168 0.964 0.012 0.000 0.020 0.004
#> GSM494627     1  0.3606    0.77405 0.848 0.012 0.072 0.064 0.004
#> GSM494673     1  0.4300    0.22803 0.524 0.476 0.000 0.000 0.000
#> GSM494649     4  0.4779    0.18036 0.448 0.012 0.000 0.536 0.004
#> GSM494658     2  0.4724    0.55939 0.248 0.704 0.000 0.008 0.040
#> GSM494653     1  0.1544    0.82403 0.932 0.068 0.000 0.000 0.000
#> GSM494643     1  0.1970    0.79959 0.924 0.012 0.000 0.060 0.004
#> GSM494672     2  0.2852    0.62545 0.172 0.828 0.000 0.000 0.000
#> GSM494618     1  0.2952    0.78670 0.872 0.004 0.036 0.088 0.000
#> GSM494631     3  0.1710    0.86528 0.000 0.004 0.940 0.040 0.016
#> GSM494619     4  0.4474    0.54114 0.332 0.012 0.000 0.652 0.004
#> GSM494674     1  0.1965    0.81368 0.904 0.096 0.000 0.000 0.000
#> GSM494616     1  0.2392    0.79308 0.888 0.004 0.104 0.004 0.000
#> GSM494663     1  0.4283    0.47178 0.692 0.012 0.000 0.292 0.004
#> GSM494628     1  0.5731    0.28542 0.568 0.000 0.104 0.328 0.000
#> GSM494632     1  0.0290    0.83117 0.992 0.008 0.000 0.000 0.000
#> GSM494660     4  0.4567    0.43589 0.356 0.012 0.000 0.628 0.004
#> GSM494622     4  0.6395    0.09972 0.108 0.016 0.424 0.452 0.000
#> GSM494642     1  0.1410    0.82597 0.940 0.060 0.000 0.000 0.000
#> GSM494647     1  0.2891    0.75997 0.824 0.176 0.000 0.000 0.000
#> GSM494659     1  0.3424    0.69268 0.760 0.240 0.000 0.000 0.000
#> GSM494670     2  0.4352    0.55095 0.244 0.720 0.000 0.036 0.000
#> GSM494675     4  0.4637    0.61765 0.000 0.004 0.160 0.748 0.088
#> GSM494641     1  0.0963    0.83050 0.964 0.036 0.000 0.000 0.000
#> GSM494636     1  0.1267    0.81832 0.960 0.012 0.000 0.024 0.004
#> GSM494640     1  0.2299    0.80180 0.916 0.012 0.012 0.056 0.004
#> GSM494623     4  0.3934    0.65461 0.236 0.012 0.000 0.748 0.004
#> GSM494644     1  0.0290    0.83071 0.992 0.008 0.000 0.000 0.000
#> GSM494646     1  0.0613    0.82625 0.984 0.008 0.000 0.004 0.004
#> GSM494665     1  0.4288    0.44739 0.612 0.384 0.000 0.004 0.000
#> GSM494638     1  0.1918    0.81716 0.940 0.012 0.012 0.016 0.020
#> GSM494645     1  0.0451    0.83098 0.988 0.008 0.000 0.004 0.000
#> GSM494671     2  0.2648    0.64451 0.152 0.848 0.000 0.000 0.000
#> GSM494655     1  0.0609    0.83112 0.980 0.020 0.000 0.000 0.000
#> GSM494620     1  0.4745    0.10598 0.560 0.012 0.000 0.424 0.004
#> GSM494630     1  0.2629    0.78158 0.880 0.012 0.000 0.104 0.004
#> GSM494657     3  0.0000    0.86808 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.3561    0.66958 0.740 0.260 0.000 0.000 0.000
#> GSM494621     4  0.4283    0.59643 0.292 0.012 0.000 0.692 0.004
#> GSM494629     3  0.5171    0.57264 0.248 0.012 0.688 0.044 0.008
#> GSM494637     1  0.2037    0.80071 0.920 0.012 0.000 0.064 0.004
#> GSM494652     1  0.2424    0.79277 0.868 0.132 0.000 0.000 0.000
#> GSM494648     4  0.4567    0.49789 0.356 0.012 0.000 0.628 0.004
#> GSM494650     3  0.2354    0.81885 0.076 0.008 0.904 0.012 0.000
#> GSM494669     1  0.2966    0.75087 0.816 0.184 0.000 0.000 0.000
#> GSM494666     1  0.0794    0.83100 0.972 0.028 0.000 0.000 0.000
#> GSM494668     1  0.5083    0.25970 0.532 0.432 0.000 0.036 0.000
#> GSM494633     1  0.4796   -0.00467 0.516 0.012 0.000 0.468 0.004
#> GSM494634     1  0.4630    0.36378 0.572 0.416 0.000 0.008 0.004
#> GSM494639     1  0.0324    0.82966 0.992 0.004 0.000 0.004 0.000
#> GSM494661     1  0.0880    0.83092 0.968 0.032 0.000 0.000 0.000
#> GSM494617     1  0.0671    0.83161 0.980 0.016 0.000 0.004 0.000
#> GSM494626     1  0.1845    0.81997 0.928 0.016 0.000 0.056 0.000
#> GSM494656     3  0.0451    0.86803 0.000 0.000 0.988 0.004 0.008
#> GSM494635     1  0.0727    0.82499 0.980 0.012 0.000 0.004 0.004

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM494565     4  0.5370     0.5656 0.000 0.000 0.000 0.588 0.192 0.220
#> GSM494594     3  0.0405     0.8498 0.000 0.004 0.988 0.000 0.008 0.000
#> GSM494604     4  0.4452     0.3367 0.040 0.312 0.000 0.644 0.004 0.000
#> GSM494564     6  0.2538     0.6486 0.000 0.000 0.000 0.124 0.016 0.860
#> GSM494591     3  0.1768     0.8329 0.000 0.012 0.932 0.004 0.008 0.044
#> GSM494567     3  0.1734     0.8299 0.000 0.004 0.932 0.008 0.048 0.008
#> GSM494602     2  0.2593     0.6170 0.000 0.844 0.000 0.008 0.148 0.000
#> GSM494613     5  0.5874     0.5428 0.000 0.012 0.212 0.036 0.620 0.120
#> GSM494589     6  0.2547     0.6586 0.000 0.000 0.004 0.080 0.036 0.880
#> GSM494598     4  0.4597     0.5551 0.000 0.148 0.000 0.716 0.128 0.008
#> GSM494593     5  0.3965     0.3816 0.000 0.376 0.000 0.004 0.616 0.004
#> GSM494583     5  0.3905     0.2272 0.000 0.000 0.004 0.356 0.636 0.004
#> GSM494612     2  0.3563     0.3563 0.000 0.664 0.000 0.000 0.336 0.000
#> GSM494558     3  0.4948     0.5534 0.000 0.012 0.648 0.080 0.000 0.260
#> GSM494556     6  0.6441     0.2340 0.000 0.000 0.276 0.056 0.160 0.508
#> GSM494559     5  0.4264     0.0188 0.000 0.000 0.000 0.016 0.496 0.488
#> GSM494571     3  0.1053     0.8453 0.000 0.012 0.964 0.020 0.000 0.004
#> GSM494614     5  0.5666     0.4353 0.000 0.016 0.056 0.032 0.584 0.312
#> GSM494603     4  0.3012     0.5663 0.008 0.000 0.000 0.796 0.000 0.196
#> GSM494568     4  0.5386     0.4457 0.016 0.004 0.108 0.628 0.000 0.244
#> GSM494572     3  0.2327     0.8214 0.000 0.012 0.908 0.028 0.008 0.044
#> GSM494600     6  0.2527     0.6491 0.000 0.000 0.000 0.108 0.024 0.868
#> GSM494562     2  0.5361     0.0334 0.000 0.452 0.000 0.440 0.108 0.000
#> GSM494615     6  0.4607     0.5782 0.000 0.028 0.104 0.056 0.040 0.772
#> GSM494582     2  0.2431     0.6212 0.000 0.860 0.000 0.008 0.132 0.000
#> GSM494599     2  0.1225     0.6442 0.012 0.952 0.000 0.000 0.036 0.000
#> GSM494610     4  0.4277     0.5893 0.000 0.084 0.000 0.764 0.128 0.024
#> GSM494587     5  0.3478     0.6422 0.000 0.064 0.060 0.040 0.836 0.000
#> GSM494581     5  0.0508     0.6505 0.012 0.000 0.004 0.000 0.984 0.000
#> GSM494580     3  0.1121     0.8453 0.000 0.004 0.964 0.008 0.016 0.008
#> GSM494563     4  0.4517     0.2196 0.000 0.000 0.000 0.524 0.032 0.444
#> GSM494576     5  0.4553     0.5447 0.000 0.040 0.020 0.216 0.716 0.008
#> GSM494605     1  0.0692     0.8744 0.976 0.020 0.000 0.004 0.000 0.000
#> GSM494584     5  0.4624     0.5133 0.000 0.004 0.096 0.208 0.692 0.000
#> GSM494586     2  0.6230     0.2442 0.000 0.452 0.000 0.248 0.288 0.012
#> GSM494578     5  0.4416     0.2251 0.012 0.004 0.440 0.000 0.540 0.004
#> GSM494585     5  0.1655     0.6512 0.000 0.044 0.012 0.004 0.936 0.004
#> GSM494611     2  0.2019     0.6406 0.000 0.900 0.000 0.012 0.088 0.000
#> GSM494560     6  0.4729     0.5209 0.000 0.000 0.000 0.128 0.196 0.676
#> GSM494595     5  0.2262     0.6392 0.000 0.080 0.000 0.016 0.896 0.008
#> GSM494570     6  0.2001     0.6691 0.004 0.000 0.000 0.092 0.004 0.900
#> GSM494597     4  0.4018     0.3078 0.000 0.000 0.412 0.580 0.000 0.008
#> GSM494607     2  0.4442     0.0570 0.020 0.536 0.000 0.440 0.004 0.000
#> GSM494561     6  0.1226     0.6796 0.004 0.000 0.004 0.040 0.000 0.952
#> GSM494569     1  0.2527     0.8513 0.896 0.004 0.056 0.032 0.008 0.004
#> GSM494592     2  0.1812     0.6416 0.008 0.912 0.000 0.000 0.080 0.000
#> GSM494577     4  0.3584     0.5581 0.000 0.004 0.000 0.740 0.244 0.012
#> GSM494588     6  0.5388     0.3933 0.004 0.000 0.000 0.196 0.196 0.604
#> GSM494590     3  0.0260     0.8500 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM494609     5  0.1282     0.6499 0.012 0.024 0.004 0.004 0.956 0.000
#> GSM494608     5  0.4308     0.5734 0.028 0.160 0.004 0.040 0.764 0.004
#> GSM494606     5  0.3871     0.4465 0.016 0.308 0.000 0.000 0.676 0.000
#> GSM494574     4  0.4292     0.5652 0.000 0.120 0.000 0.748 0.124 0.008
#> GSM494573     6  0.3637     0.5941 0.000 0.000 0.000 0.164 0.056 0.780
#> GSM494566     2  0.5587     0.1626 0.032 0.504 0.008 0.420 0.024 0.012
#> GSM494601     2  0.3284     0.5987 0.000 0.784 0.000 0.020 0.196 0.000
#> GSM494557     5  0.5051     0.3259 0.000 0.000 0.396 0.040 0.544 0.020
#> GSM494579     4  0.4805     0.6200 0.000 0.064 0.000 0.732 0.072 0.132
#> GSM494596     3  0.0260     0.8500 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM494575     5  0.3728     0.4319 0.000 0.344 0.000 0.004 0.652 0.000
#> GSM494625     6  0.4286     0.6439 0.132 0.020 0.000 0.088 0.000 0.760
#> GSM494654     3  0.0798     0.8485 0.000 0.004 0.976 0.012 0.004 0.004
#> GSM494664     1  0.2755     0.8191 0.844 0.004 0.000 0.140 0.000 0.012
#> GSM494624     6  0.3092     0.6863 0.088 0.016 0.000 0.044 0.000 0.852
#> GSM494651     3  0.5328     0.1623 0.420 0.000 0.496 0.072 0.000 0.012
#> GSM494662     1  0.1672     0.8645 0.944 0.020 0.012 0.008 0.004 0.012
#> GSM494627     1  0.5558     0.7098 0.692 0.020 0.080 0.136 0.000 0.072
#> GSM494673     1  0.3175     0.6896 0.744 0.256 0.000 0.000 0.000 0.000
#> GSM494649     6  0.3134     0.6709 0.148 0.016 0.000 0.012 0.000 0.824
#> GSM494658     4  0.5598     0.2046 0.208 0.220 0.000 0.568 0.000 0.004
#> GSM494653     1  0.1745     0.8658 0.924 0.056 0.000 0.020 0.000 0.000
#> GSM494643     1  0.2445     0.8440 0.896 0.020 0.000 0.028 0.000 0.056
#> GSM494672     2  0.2697     0.5585 0.188 0.812 0.000 0.000 0.000 0.000
#> GSM494618     1  0.5308     0.6920 0.696 0.008 0.048 0.144 0.000 0.104
#> GSM494631     3  0.1565     0.8372 0.000 0.000 0.940 0.028 0.028 0.004
#> GSM494619     6  0.5799     0.2399 0.372 0.020 0.000 0.112 0.000 0.496
#> GSM494674     1  0.0937     0.8714 0.960 0.040 0.000 0.000 0.000 0.000
#> GSM494616     1  0.2270     0.8522 0.900 0.000 0.020 0.072 0.004 0.004
#> GSM494663     1  0.5590     0.5645 0.612 0.020 0.000 0.180 0.000 0.188
#> GSM494628     1  0.6686     0.0507 0.420 0.012 0.024 0.204 0.000 0.340
#> GSM494632     1  0.0436     0.8724 0.988 0.000 0.000 0.004 0.004 0.004
#> GSM494660     6  0.2757     0.6916 0.104 0.016 0.000 0.016 0.000 0.864
#> GSM494622     6  0.7320     0.3117 0.148 0.000 0.224 0.212 0.000 0.416
#> GSM494642     1  0.0547     0.8731 0.980 0.020 0.000 0.000 0.000 0.000
#> GSM494647     1  0.1327     0.8649 0.936 0.064 0.000 0.000 0.000 0.000
#> GSM494659     1  0.1387     0.8629 0.932 0.068 0.000 0.000 0.000 0.000
#> GSM494670     2  0.6285     0.3006 0.180 0.532 0.000 0.244 0.000 0.044
#> GSM494675     4  0.5742     0.4986 0.000 0.012 0.196 0.568 0.000 0.224
#> GSM494641     1  0.0520     0.8735 0.984 0.008 0.000 0.008 0.000 0.000
#> GSM494636     1  0.1579     0.8625 0.944 0.020 0.000 0.008 0.004 0.024
#> GSM494640     1  0.3539     0.8177 0.840 0.020 0.072 0.016 0.000 0.052
#> GSM494623     6  0.4610     0.6204 0.100 0.020 0.000 0.152 0.000 0.728
#> GSM494644     1  0.0582     0.8721 0.984 0.004 0.000 0.004 0.004 0.004
#> GSM494646     1  0.0653     0.8717 0.980 0.004 0.000 0.004 0.000 0.012
#> GSM494665     1  0.3230     0.7426 0.776 0.212 0.000 0.012 0.000 0.000
#> GSM494638     1  0.2596     0.8502 0.900 0.024 0.044 0.016 0.008 0.008
#> GSM494645     1  0.0458     0.8742 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM494671     2  0.3163     0.5096 0.232 0.764 0.000 0.004 0.000 0.000
#> GSM494655     1  0.0146     0.8726 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM494620     1  0.4859     0.4982 0.628 0.020 0.000 0.044 0.000 0.308
#> GSM494630     1  0.2213     0.8442 0.904 0.020 0.000 0.004 0.004 0.068
#> GSM494657     3  0.0291     0.8502 0.000 0.004 0.992 0.000 0.004 0.000
#> GSM494667     1  0.1814     0.8469 0.900 0.100 0.000 0.000 0.000 0.000
#> GSM494621     6  0.4400     0.6103 0.180 0.020 0.000 0.064 0.000 0.736
#> GSM494629     3  0.5212     0.5011 0.252 0.020 0.660 0.016 0.004 0.048
#> GSM494637     1  0.2568     0.8492 0.900 0.020 0.012 0.016 0.004 0.048
#> GSM494652     1  0.0692     0.8721 0.976 0.020 0.000 0.000 0.004 0.000
#> GSM494648     1  0.5263     0.3244 0.552 0.020 0.000 0.060 0.000 0.368
#> GSM494650     3  0.4519     0.6597 0.096 0.004 0.752 0.124 0.000 0.024
#> GSM494669     1  0.1327     0.8654 0.936 0.064 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0725     0.8743 0.976 0.012 0.000 0.012 0.000 0.000
#> GSM494668     1  0.5858     0.5868 0.620 0.188 0.000 0.128 0.000 0.064
#> GSM494633     6  0.3144     0.6671 0.172 0.016 0.000 0.000 0.004 0.808
#> GSM494634     1  0.1858     0.8444 0.904 0.092 0.000 0.000 0.004 0.000
#> GSM494639     1  0.0291     0.8729 0.992 0.004 0.000 0.000 0.000 0.004
#> GSM494661     1  0.0993     0.8750 0.964 0.012 0.000 0.024 0.000 0.000
#> GSM494617     1  0.2032     0.8592 0.912 0.012 0.000 0.068 0.004 0.004
#> GSM494626     1  0.4017     0.7917 0.788 0.016 0.012 0.140 0.000 0.044
#> GSM494656     3  0.0551     0.8492 0.000 0.004 0.984 0.008 0.000 0.004
#> GSM494635     1  0.1007     0.8695 0.968 0.008 0.000 0.004 0.004 0.016

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 3)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-NMF-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-NMF-collect-classes

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

test_to_known_factors(res)
#>           n disease.state(p) age(p) other(p) individual(p) k
#> MAD:NMF 115         1.15e-02 0.0469 9.39e-02        0.0113 2
#> MAD:NMF 116         2.34e-18 0.8267 2.68e-14        0.9707 3
#> MAD:NMF 107         7.27e-16 0.6566 4.01e-12        0.4811 4
#> MAD:NMF 101         2.43e-09 0.2387 4.23e-06        0.0954 5
#> MAD:NMF  92         2.71e-09 0.4036 6.05e-06        0.1274 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 51941 rows and 120 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.915           0.947       0.976         0.2168 0.792   0.792
#> 3 3 0.439           0.760       0.857         1.0861 0.690   0.613
#> 4 4 0.574           0.759       0.881         0.2304 0.918   0.842
#> 5 5 0.602           0.730       0.863         0.0606 0.953   0.898
#> 6 6 0.527           0.501       0.710         0.2188 0.822   0.583

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

suggest_best_k(res)
#> [1] 2

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM494565     1  0.0000     0.9809 1.000 0.000
#> GSM494594     2  0.0000     0.9202 0.000 1.000
#> GSM494604     1  0.0000     0.9809 1.000 0.000
#> GSM494564     1  0.0000     0.9809 1.000 0.000
#> GSM494591     2  0.0000     0.9202 0.000 1.000
#> GSM494567     1  0.0000     0.9809 1.000 0.000
#> GSM494602     1  0.0000     0.9809 1.000 0.000
#> GSM494613     1  0.5737     0.8429 0.864 0.136
#> GSM494589     1  0.0000     0.9809 1.000 0.000
#> GSM494598     1  0.0000     0.9809 1.000 0.000
#> GSM494593     1  0.0000     0.9809 1.000 0.000
#> GSM494583     1  0.2043     0.9576 0.968 0.032
#> GSM494612     1  0.0672     0.9760 0.992 0.008
#> GSM494558     1  0.9983     0.0189 0.524 0.476
#> GSM494556     1  0.2043     0.9569 0.968 0.032
#> GSM494559     1  0.0000     0.9809 1.000 0.000
#> GSM494571     2  0.0000     0.9202 0.000 1.000
#> GSM494614     1  0.0000     0.9809 1.000 0.000
#> GSM494603     1  0.0000     0.9809 1.000 0.000
#> GSM494568     1  0.0000     0.9809 1.000 0.000
#> GSM494572     2  0.0000     0.9202 0.000 1.000
#> GSM494600     1  0.0000     0.9809 1.000 0.000
#> GSM494562     1  0.2043     0.9576 0.968 0.032
#> GSM494615     1  0.0000     0.9809 1.000 0.000
#> GSM494582     1  0.0672     0.9760 0.992 0.008
#> GSM494599     1  0.0000     0.9809 1.000 0.000
#> GSM494610     1  0.0672     0.9760 0.992 0.008
#> GSM494587     1  0.2043     0.9576 0.968 0.032
#> GSM494581     1  0.0376     0.9786 0.996 0.004
#> GSM494580     1  0.6438     0.8046 0.836 0.164
#> GSM494563     1  0.0000     0.9809 1.000 0.000
#> GSM494576     1  0.2043     0.9576 0.968 0.032
#> GSM494605     1  0.0000     0.9809 1.000 0.000
#> GSM494584     1  0.2043     0.9576 0.968 0.032
#> GSM494586     1  0.2043     0.9576 0.968 0.032
#> GSM494578     1  0.6438     0.8046 0.836 0.164
#> GSM494585     1  0.2043     0.9576 0.968 0.032
#> GSM494611     1  0.0000     0.9809 1.000 0.000
#> GSM494560     1  0.0000     0.9809 1.000 0.000
#> GSM494595     1  0.0376     0.9786 0.996 0.004
#> GSM494570     1  0.0000     0.9809 1.000 0.000
#> GSM494597     2  0.0000     0.9202 0.000 1.000
#> GSM494607     1  0.0000     0.9809 1.000 0.000
#> GSM494561     1  0.0000     0.9809 1.000 0.000
#> GSM494569     1  0.0000     0.9809 1.000 0.000
#> GSM494592     1  0.0000     0.9809 1.000 0.000
#> GSM494577     1  0.2043     0.9576 0.968 0.032
#> GSM494588     1  0.0000     0.9809 1.000 0.000
#> GSM494590     2  0.0000     0.9202 0.000 1.000
#> GSM494609     1  0.0000     0.9809 1.000 0.000
#> GSM494608     1  0.0376     0.9786 0.996 0.004
#> GSM494606     1  0.0000     0.9809 1.000 0.000
#> GSM494574     1  0.0672     0.9760 0.992 0.008
#> GSM494573     1  0.0000     0.9809 1.000 0.000
#> GSM494566     1  0.0000     0.9809 1.000 0.000
#> GSM494601     2  0.9209     0.5494 0.336 0.664
#> GSM494557     1  0.5737     0.8429 0.864 0.136
#> GSM494579     1  0.0000     0.9809 1.000 0.000
#> GSM494596     2  0.0000     0.9202 0.000 1.000
#> GSM494575     1  0.0672     0.9760 0.992 0.008
#> GSM494625     1  0.0000     0.9809 1.000 0.000
#> GSM494654     2  0.0000     0.9202 0.000 1.000
#> GSM494664     1  0.0000     0.9809 1.000 0.000
#> GSM494624     1  0.0000     0.9809 1.000 0.000
#> GSM494651     2  0.6343     0.8116 0.160 0.840
#> GSM494662     1  0.0000     0.9809 1.000 0.000
#> GSM494627     1  0.0000     0.9809 1.000 0.000
#> GSM494673     1  0.0000     0.9809 1.000 0.000
#> GSM494649     1  0.0000     0.9809 1.000 0.000
#> GSM494658     1  0.0000     0.9809 1.000 0.000
#> GSM494653     1  0.0000     0.9809 1.000 0.000
#> GSM494643     1  0.3431     0.9233 0.936 0.064
#> GSM494672     1  0.0000     0.9809 1.000 0.000
#> GSM494618     1  0.0000     0.9809 1.000 0.000
#> GSM494631     1  0.6438     0.8046 0.836 0.164
#> GSM494619     1  0.0000     0.9809 1.000 0.000
#> GSM494674     1  0.0000     0.9809 1.000 0.000
#> GSM494616     1  0.0000     0.9809 1.000 0.000
#> GSM494663     1  0.0000     0.9809 1.000 0.000
#> GSM494628     1  0.0000     0.9809 1.000 0.000
#> GSM494632     1  0.0000     0.9809 1.000 0.000
#> GSM494660     1  0.0000     0.9809 1.000 0.000
#> GSM494622     1  0.2603     0.9440 0.956 0.044
#> GSM494642     1  0.0000     0.9809 1.000 0.000
#> GSM494647     1  0.0000     0.9809 1.000 0.000
#> GSM494659     1  0.0000     0.9809 1.000 0.000
#> GSM494670     1  0.0000     0.9809 1.000 0.000
#> GSM494675     1  0.0938     0.9732 0.988 0.012
#> GSM494641     1  0.0000     0.9809 1.000 0.000
#> GSM494636     1  0.0000     0.9809 1.000 0.000
#> GSM494640     1  0.6247     0.8159 0.844 0.156
#> GSM494623     1  0.0000     0.9809 1.000 0.000
#> GSM494644     1  0.0000     0.9809 1.000 0.000
#> GSM494646     1  0.0000     0.9809 1.000 0.000
#> GSM494665     1  0.0000     0.9809 1.000 0.000
#> GSM494638     1  0.0000     0.9809 1.000 0.000
#> GSM494645     1  0.0000     0.9809 1.000 0.000
#> GSM494671     1  0.0000     0.9809 1.000 0.000
#> GSM494655     1  0.0000     0.9809 1.000 0.000
#> GSM494620     1  0.0000     0.9809 1.000 0.000
#> GSM494630     1  0.0000     0.9809 1.000 0.000
#> GSM494657     2  0.0000     0.9202 0.000 1.000
#> GSM494667     1  0.0000     0.9809 1.000 0.000
#> GSM494621     1  0.0000     0.9809 1.000 0.000
#> GSM494629     1  0.0000     0.9809 1.000 0.000
#> GSM494637     1  0.0938     0.9726 0.988 0.012
#> GSM494652     1  0.0000     0.9809 1.000 0.000
#> GSM494648     1  0.0000     0.9809 1.000 0.000
#> GSM494650     2  0.6343     0.8116 0.160 0.840
#> GSM494669     1  0.0000     0.9809 1.000 0.000
#> GSM494666     1  0.0000     0.9809 1.000 0.000
#> GSM494668     1  0.0000     0.9809 1.000 0.000
#> GSM494633     1  0.0000     0.9809 1.000 0.000
#> GSM494634     1  0.0000     0.9809 1.000 0.000
#> GSM494639     1  0.0000     0.9809 1.000 0.000
#> GSM494661     2  0.9209     0.5494 0.336 0.664
#> GSM494617     1  0.0000     0.9809 1.000 0.000
#> GSM494626     1  0.0000     0.9809 1.000 0.000
#> GSM494656     2  0.0000     0.9202 0.000 1.000
#> GSM494635     1  0.0000     0.9809 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
#> GSM494565     1  0.5465     0.4899 0.712 0.288 0.000
#> GSM494594     3  0.0000     0.9401 0.000 0.000 1.000
#> GSM494604     1  0.1411     0.8672 0.964 0.036 0.000
#> GSM494564     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494591     3  0.0000     0.9401 0.000 0.000 1.000
#> GSM494567     1  0.6274    -0.2613 0.544 0.456 0.000
#> GSM494602     1  0.4654     0.6655 0.792 0.208 0.000
#> GSM494613     2  0.4702     0.7645 0.212 0.788 0.000
#> GSM494589     1  0.1860     0.8674 0.948 0.052 0.000
#> GSM494598     2  0.6126     0.6914 0.400 0.600 0.000
#> GSM494593     1  0.4654     0.6655 0.792 0.208 0.000
#> GSM494583     2  0.5497     0.8152 0.292 0.708 0.000
#> GSM494612     2  0.5678     0.8035 0.316 0.684 0.000
#> GSM494558     2  0.8763     0.2913 0.136 0.552 0.312
#> GSM494556     2  0.6168     0.6597 0.412 0.588 0.000
#> GSM494559     1  0.1860     0.8674 0.948 0.052 0.000
#> GSM494571     3  0.0000     0.9401 0.000 0.000 1.000
#> GSM494614     1  0.5431     0.4950 0.716 0.284 0.000
#> GSM494603     1  0.3482     0.8002 0.872 0.128 0.000
#> GSM494568     1  0.3482     0.8002 0.872 0.128 0.000
#> GSM494572     3  0.0000     0.9401 0.000 0.000 1.000
#> GSM494600     1  0.1860     0.8674 0.948 0.052 0.000
#> GSM494562     2  0.5497     0.8152 0.292 0.708 0.000
#> GSM494615     1  0.5431     0.4950 0.716 0.284 0.000
#> GSM494582     2  0.5678     0.8035 0.316 0.684 0.000
#> GSM494599     1  0.3551     0.7840 0.868 0.132 0.000
#> GSM494610     2  0.5678     0.8035 0.316 0.684 0.000
#> GSM494587     2  0.5497     0.8152 0.292 0.708 0.000
#> GSM494581     2  0.6295     0.5109 0.472 0.528 0.000
#> GSM494580     2  0.4346     0.7284 0.184 0.816 0.000
#> GSM494563     1  0.1860     0.8674 0.948 0.052 0.000
#> GSM494576     2  0.5497     0.8152 0.292 0.708 0.000
#> GSM494605     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494584     2  0.5497     0.8152 0.292 0.708 0.000
#> GSM494586     2  0.5497     0.8152 0.292 0.708 0.000
#> GSM494578     2  0.4346     0.7284 0.184 0.816 0.000
#> GSM494585     2  0.5497     0.8152 0.292 0.708 0.000
#> GSM494611     2  0.6126     0.6914 0.400 0.600 0.000
#> GSM494560     1  0.1860     0.8674 0.948 0.052 0.000
#> GSM494595     2  0.5926     0.7598 0.356 0.644 0.000
#> GSM494570     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494597     3  0.0000     0.9401 0.000 0.000 1.000
#> GSM494607     1  0.1411     0.8672 0.964 0.036 0.000
#> GSM494561     1  0.1411     0.8751 0.964 0.036 0.000
#> GSM494569     1  0.3267     0.8128 0.884 0.116 0.000
#> GSM494592     1  0.3551     0.7840 0.868 0.132 0.000
#> GSM494577     2  0.5497     0.8152 0.292 0.708 0.000
#> GSM494588     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494590     3  0.0000     0.9401 0.000 0.000 1.000
#> GSM494609     1  0.4654     0.6655 0.792 0.208 0.000
#> GSM494608     2  0.6295     0.5109 0.472 0.528 0.000
#> GSM494606     1  0.4654     0.6655 0.792 0.208 0.000
#> GSM494574     2  0.5678     0.8035 0.316 0.684 0.000
#> GSM494573     1  0.1860     0.8674 0.948 0.052 0.000
#> GSM494566     1  0.3941     0.7672 0.844 0.156 0.000
#> GSM494601     2  0.5835    -0.3928 0.000 0.660 0.340
#> GSM494557     2  0.4702     0.7645 0.212 0.788 0.000
#> GSM494579     1  0.3941     0.7672 0.844 0.156 0.000
#> GSM494596     3  0.0000     0.9401 0.000 0.000 1.000
#> GSM494575     2  0.5678     0.8035 0.316 0.684 0.000
#> GSM494625     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494654     3  0.0000     0.9401 0.000 0.000 1.000
#> GSM494664     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494624     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494651     3  0.6286     0.6261 0.000 0.464 0.536
#> GSM494662     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494627     1  0.6111     0.0392 0.604 0.396 0.000
#> GSM494673     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494649     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494658     1  0.1411     0.8672 0.964 0.036 0.000
#> GSM494653     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494643     2  0.6192     0.5989 0.420 0.580 0.000
#> GSM494672     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494618     1  0.3267     0.8128 0.884 0.116 0.000
#> GSM494631     2  0.4346     0.7284 0.184 0.816 0.000
#> GSM494619     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494674     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494616     1  0.3267     0.8128 0.884 0.116 0.000
#> GSM494663     1  0.3482     0.8002 0.872 0.128 0.000
#> GSM494628     1  0.3267     0.8128 0.884 0.116 0.000
#> GSM494632     1  0.1289     0.8760 0.968 0.032 0.000
#> GSM494660     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494622     1  0.5016     0.6409 0.760 0.240 0.000
#> GSM494642     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494647     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494659     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494670     1  0.1411     0.8672 0.964 0.036 0.000
#> GSM494675     1  0.6008     0.1818 0.628 0.372 0.000
#> GSM494641     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494636     1  0.1289     0.8760 0.968 0.032 0.000
#> GSM494640     2  0.5621     0.7137 0.308 0.692 0.000
#> GSM494623     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494644     1  0.0747     0.8798 0.984 0.016 0.000
#> GSM494646     1  0.1163     0.8774 0.972 0.028 0.000
#> GSM494665     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494638     1  0.1289     0.8760 0.968 0.032 0.000
#> GSM494645     1  0.1163     0.8774 0.972 0.028 0.000
#> GSM494671     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494655     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494620     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494630     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494657     3  0.0000     0.9401 0.000 0.000 1.000
#> GSM494667     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494621     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494629     1  0.6111     0.0392 0.604 0.396 0.000
#> GSM494637     1  0.6192    -0.0785 0.580 0.420 0.000
#> GSM494652     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494648     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494650     3  0.6286     0.6261 0.000 0.464 0.536
#> GSM494669     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494666     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494668     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494633     1  0.0000     0.8810 1.000 0.000 0.000
#> GSM494634     1  0.0237     0.8817 0.996 0.004 0.000
#> GSM494639     1  0.1289     0.8760 0.968 0.032 0.000
#> GSM494661     2  0.5835    -0.3928 0.000 0.660 0.340
#> GSM494617     1  0.3267     0.8128 0.884 0.116 0.000
#> GSM494626     1  0.3267     0.8128 0.884 0.116 0.000
#> GSM494656     3  0.0000     0.9401 0.000 0.000 1.000
#> GSM494635     1  0.0747     0.8798 0.984 0.016 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     1  0.5746     0.3278 0.572 0.396 0.000 0.032
#> GSM494594     3  0.0000     0.9653 0.000 0.000 1.000 0.000
#> GSM494604     1  0.1792     0.8496 0.932 0.068 0.000 0.000
#> GSM494564     1  0.0188     0.8802 0.996 0.004 0.000 0.000
#> GSM494591     3  0.0000     0.9653 0.000 0.000 1.000 0.000
#> GSM494567     2  0.5558     0.5134 0.324 0.640 0.000 0.036
#> GSM494602     1  0.4776     0.4478 0.624 0.376 0.000 0.000
#> GSM494613     2  0.3610     0.6540 0.000 0.800 0.000 0.200
#> GSM494589     1  0.2222     0.8596 0.924 0.060 0.000 0.016
#> GSM494598     2  0.3400     0.6591 0.180 0.820 0.000 0.000
#> GSM494593     1  0.4776     0.4478 0.624 0.376 0.000 0.000
#> GSM494583     2  0.0817     0.7202 0.000 0.976 0.000 0.024
#> GSM494612     2  0.0000     0.7180 0.000 1.000 0.000 0.000
#> GSM494558     2  0.7596     0.0760 0.000 0.456 0.212 0.332
#> GSM494556     2  0.5434     0.6421 0.188 0.728 0.000 0.084
#> GSM494559     1  0.2222     0.8596 0.924 0.060 0.000 0.016
#> GSM494571     3  0.2345     0.9155 0.000 0.000 0.900 0.100
#> GSM494614     1  0.5735     0.3331 0.576 0.392 0.000 0.032
#> GSM494603     1  0.3972     0.7495 0.788 0.204 0.000 0.008
#> GSM494568     1  0.3972     0.7495 0.788 0.204 0.000 0.008
#> GSM494572     3  0.2345     0.9155 0.000 0.000 0.900 0.100
#> GSM494600     1  0.2222     0.8596 0.924 0.060 0.000 0.016
#> GSM494562     2  0.0817     0.7202 0.000 0.976 0.000 0.024
#> GSM494615     1  0.5735     0.3331 0.576 0.392 0.000 0.032
#> GSM494582     2  0.0000     0.7180 0.000 1.000 0.000 0.000
#> GSM494599     1  0.4250     0.6459 0.724 0.276 0.000 0.000
#> GSM494610     2  0.0000     0.7180 0.000 1.000 0.000 0.000
#> GSM494587     2  0.0817     0.7202 0.000 0.976 0.000 0.024
#> GSM494581     2  0.4540     0.6384 0.196 0.772 0.000 0.032
#> GSM494580     2  0.3975     0.6269 0.000 0.760 0.000 0.240
#> GSM494563     1  0.2222     0.8596 0.924 0.060 0.000 0.016
#> GSM494576     2  0.0817     0.7202 0.000 0.976 0.000 0.024
#> GSM494605     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494584     2  0.0817     0.7202 0.000 0.976 0.000 0.024
#> GSM494586     2  0.0817     0.7202 0.000 0.976 0.000 0.024
#> GSM494578     2  0.3975     0.6269 0.000 0.760 0.000 0.240
#> GSM494585     2  0.0817     0.7202 0.000 0.976 0.000 0.024
#> GSM494611     2  0.3266     0.6670 0.168 0.832 0.000 0.000
#> GSM494560     1  0.2222     0.8596 0.924 0.060 0.000 0.016
#> GSM494595     2  0.2149     0.7035 0.088 0.912 0.000 0.000
#> GSM494570     1  0.0188     0.8802 0.996 0.004 0.000 0.000
#> GSM494597     3  0.2345     0.9155 0.000 0.000 0.900 0.100
#> GSM494607     1  0.1792     0.8496 0.932 0.068 0.000 0.000
#> GSM494561     1  0.2149     0.8540 0.912 0.088 0.000 0.000
#> GSM494569     1  0.3668     0.7696 0.808 0.188 0.000 0.004
#> GSM494592     1  0.4250     0.6459 0.724 0.276 0.000 0.000
#> GSM494577     2  0.0817     0.7202 0.000 0.976 0.000 0.024
#> GSM494588     1  0.0188     0.8802 0.996 0.004 0.000 0.000
#> GSM494590     3  0.0000     0.9653 0.000 0.000 1.000 0.000
#> GSM494609     1  0.4776     0.4478 0.624 0.376 0.000 0.000
#> GSM494608     2  0.4540     0.6384 0.196 0.772 0.000 0.032
#> GSM494606     1  0.4776     0.4478 0.624 0.376 0.000 0.000
#> GSM494574     2  0.0000     0.7180 0.000 1.000 0.000 0.000
#> GSM494573     1  0.2222     0.8596 0.924 0.060 0.000 0.016
#> GSM494566     1  0.4630     0.6794 0.732 0.252 0.000 0.016
#> GSM494601     4  0.3108     0.8370 0.000 0.112 0.016 0.872
#> GSM494557     2  0.3610     0.6540 0.000 0.800 0.000 0.200
#> GSM494579     1  0.4630     0.6794 0.732 0.252 0.000 0.016
#> GSM494596     3  0.0000     0.9653 0.000 0.000 1.000 0.000
#> GSM494575     2  0.0000     0.7180 0.000 1.000 0.000 0.000
#> GSM494625     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494654     3  0.0000     0.9653 0.000 0.000 1.000 0.000
#> GSM494664     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494624     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494651     4  0.3208     0.8099 0.000 0.004 0.148 0.848
#> GSM494662     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494627     2  0.5716     0.2783 0.420 0.552 0.000 0.028
#> GSM494673     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494649     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494658     1  0.1792     0.8496 0.932 0.068 0.000 0.000
#> GSM494653     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494643     2  0.6449     0.5845 0.220 0.640 0.000 0.140
#> GSM494672     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494618     1  0.3668     0.7696 0.808 0.188 0.000 0.004
#> GSM494631     2  0.3975     0.6269 0.000 0.760 0.000 0.240
#> GSM494619     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494674     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494616     1  0.3668     0.7696 0.808 0.188 0.000 0.004
#> GSM494663     1  0.3972     0.7495 0.788 0.204 0.000 0.008
#> GSM494628     1  0.3668     0.7696 0.808 0.188 0.000 0.004
#> GSM494632     1  0.2281     0.8512 0.904 0.096 0.000 0.000
#> GSM494660     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494622     1  0.5786     0.5260 0.640 0.308 0.000 0.052
#> GSM494642     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494647     1  0.0336     0.8800 0.992 0.008 0.000 0.000
#> GSM494659     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494670     1  0.1792     0.8496 0.932 0.068 0.000 0.000
#> GSM494675     2  0.6077     0.0875 0.460 0.496 0.000 0.044
#> GSM494641     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494636     1  0.2281     0.8512 0.904 0.096 0.000 0.000
#> GSM494640     2  0.6394     0.5918 0.120 0.636 0.000 0.244
#> GSM494623     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494644     1  0.0921     0.8765 0.972 0.028 0.000 0.000
#> GSM494646     1  0.2081     0.8561 0.916 0.084 0.000 0.000
#> GSM494665     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494638     1  0.2281     0.8512 0.904 0.096 0.000 0.000
#> GSM494645     1  0.2081     0.8561 0.916 0.084 0.000 0.000
#> GSM494671     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494655     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494620     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494630     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494657     3  0.0000     0.9653 0.000 0.000 1.000 0.000
#> GSM494667     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494621     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494629     2  0.5716     0.2783 0.420 0.552 0.000 0.028
#> GSM494637     2  0.6052     0.3433 0.396 0.556 0.000 0.048
#> GSM494652     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494648     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494650     4  0.3208     0.8099 0.000 0.004 0.148 0.848
#> GSM494669     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494666     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494668     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494633     1  0.0000     0.8799 1.000 0.000 0.000 0.000
#> GSM494634     1  0.0188     0.8804 0.996 0.004 0.000 0.000
#> GSM494639     1  0.2149     0.8540 0.912 0.088 0.000 0.000
#> GSM494661     4  0.3108     0.8370 0.000 0.112 0.016 0.872
#> GSM494617     1  0.3668     0.7696 0.808 0.188 0.000 0.004
#> GSM494626     1  0.3668     0.7696 0.808 0.188 0.000 0.004
#> GSM494656     3  0.0000     0.9653 0.000 0.000 1.000 0.000
#> GSM494635     1  0.0817     0.8771 0.976 0.024 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
#> GSM494565     1  0.6102     0.2573 0.568 0.200 0.000 0.232 0.000
#> GSM494594     3  0.0000     0.8929 0.000 0.000 1.000 0.000 0.000
#> GSM494604     1  0.1704     0.8242 0.928 0.068 0.000 0.000 0.004
#> GSM494564     1  0.0162     0.8622 0.996 0.000 0.000 0.004 0.000
#> GSM494591     3  0.0000     0.8929 0.000 0.000 1.000 0.000 0.000
#> GSM494567     4  0.6432     0.5217 0.320 0.196 0.000 0.484 0.000
#> GSM494602     1  0.4114     0.3934 0.624 0.376 0.000 0.000 0.000
#> GSM494613     4  0.4321     0.3756 0.000 0.396 0.000 0.600 0.004
#> GSM494589     1  0.2067     0.8364 0.920 0.032 0.000 0.048 0.000
#> GSM494598     2  0.2929     0.5807 0.180 0.820 0.000 0.000 0.000
#> GSM494593     1  0.4114     0.3934 0.624 0.376 0.000 0.000 0.000
#> GSM494583     2  0.0963     0.8575 0.000 0.964 0.000 0.036 0.000
#> GSM494612     2  0.0000     0.8545 0.000 1.000 0.000 0.000 0.000
#> GSM494558     4  0.0880     0.0368 0.000 0.000 0.000 0.968 0.032
#> GSM494556     4  0.6478     0.3967 0.184 0.396 0.000 0.420 0.000
#> GSM494559     1  0.2067     0.8364 0.920 0.032 0.000 0.048 0.000
#> GSM494571     3  0.4442     0.7086 0.000 0.000 0.688 0.284 0.028
#> GSM494614     1  0.6066     0.2671 0.572 0.188 0.000 0.240 0.000
#> GSM494603     1  0.3530     0.7208 0.784 0.012 0.000 0.204 0.000
#> GSM494568     1  0.3530     0.7208 0.784 0.012 0.000 0.204 0.000
#> GSM494572     3  0.4442     0.7086 0.000 0.000 0.688 0.284 0.028
#> GSM494600     1  0.2067     0.8364 0.920 0.032 0.000 0.048 0.000
#> GSM494562     2  0.0963     0.8575 0.000 0.964 0.000 0.036 0.000
#> GSM494615     1  0.6066     0.2671 0.572 0.188 0.000 0.240 0.000
#> GSM494582     2  0.0000     0.8545 0.000 1.000 0.000 0.000 0.000
#> GSM494599     1  0.3814     0.5777 0.720 0.276 0.000 0.000 0.004
#> GSM494610     2  0.0000     0.8545 0.000 1.000 0.000 0.000 0.000
#> GSM494587     2  0.0963     0.8575 0.000 0.964 0.000 0.036 0.000
#> GSM494581     2  0.5148     0.3595 0.192 0.688 0.000 0.120 0.000
#> GSM494580     4  0.4196     0.4170 0.000 0.356 0.000 0.640 0.004
#> GSM494563     1  0.2067     0.8364 0.920 0.032 0.000 0.048 0.000
#> GSM494576     2  0.0963     0.8575 0.000 0.964 0.000 0.036 0.000
#> GSM494605     1  0.0162     0.8620 0.996 0.000 0.000 0.000 0.004
#> GSM494584     2  0.0963     0.8575 0.000 0.964 0.000 0.036 0.000
#> GSM494586     2  0.0963     0.8575 0.000 0.964 0.000 0.036 0.000
#> GSM494578     4  0.4196     0.4170 0.000 0.356 0.000 0.640 0.004
#> GSM494585     2  0.0963     0.8575 0.000 0.964 0.000 0.036 0.000
#> GSM494611     2  0.2813     0.6063 0.168 0.832 0.000 0.000 0.000
#> GSM494560     1  0.2067     0.8364 0.920 0.032 0.000 0.048 0.000
#> GSM494595     2  0.1851     0.7476 0.088 0.912 0.000 0.000 0.000
#> GSM494570     1  0.0162     0.8622 0.996 0.000 0.000 0.004 0.000
#> GSM494597     3  0.4442     0.7086 0.000 0.000 0.688 0.284 0.028
#> GSM494607     1  0.1704     0.8242 0.928 0.068 0.000 0.000 0.004
#> GSM494561     1  0.1908     0.8284 0.908 0.000 0.000 0.092 0.000
#> GSM494569     1  0.3074     0.7421 0.804 0.000 0.000 0.196 0.000
#> GSM494592     1  0.3814     0.5777 0.720 0.276 0.000 0.000 0.004
#> GSM494577     2  0.0963     0.8575 0.000 0.964 0.000 0.036 0.000
#> GSM494588     1  0.0162     0.8622 0.996 0.000 0.000 0.004 0.000
#> GSM494590     3  0.0000     0.8929 0.000 0.000 1.000 0.000 0.000
#> GSM494609     1  0.4114     0.3934 0.624 0.376 0.000 0.000 0.000
#> GSM494608     2  0.5148     0.3595 0.192 0.688 0.000 0.120 0.000
#> GSM494606     1  0.4114     0.3934 0.624 0.376 0.000 0.000 0.000
#> GSM494574     2  0.0000     0.8545 0.000 1.000 0.000 0.000 0.000
#> GSM494573     1  0.2067     0.8364 0.920 0.032 0.000 0.048 0.000
#> GSM494566     1  0.4718     0.6428 0.728 0.092 0.000 0.180 0.000
#> GSM494601     5  0.1106     0.8700 0.000 0.024 0.000 0.012 0.964
#> GSM494557     4  0.4321     0.3756 0.000 0.396 0.000 0.600 0.004
#> GSM494579     1  0.4718     0.6428 0.728 0.092 0.000 0.180 0.000
#> GSM494596     3  0.0000     0.8929 0.000 0.000 1.000 0.000 0.000
#> GSM494575     2  0.0000     0.8545 0.000 1.000 0.000 0.000 0.000
#> GSM494625     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494654     3  0.0000     0.8929 0.000 0.000 1.000 0.000 0.000
#> GSM494664     1  0.0162     0.8620 0.996 0.000 0.000 0.000 0.004
#> GSM494624     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494651     5  0.3177     0.8639 0.000 0.000 0.000 0.208 0.792
#> GSM494662     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494627     4  0.6062     0.3519 0.416 0.120 0.000 0.464 0.000
#> GSM494673     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494649     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494658     1  0.1704     0.8242 0.928 0.068 0.000 0.000 0.004
#> GSM494653     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494643     4  0.5954     0.5550 0.216 0.192 0.000 0.592 0.000
#> GSM494672     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494618     1  0.3074     0.7421 0.804 0.000 0.000 0.196 0.000
#> GSM494631     4  0.4196     0.4170 0.000 0.356 0.000 0.640 0.004
#> GSM494619     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494674     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494616     1  0.3074     0.7421 0.804 0.000 0.000 0.196 0.000
#> GSM494663     1  0.3530     0.7208 0.784 0.012 0.000 0.204 0.000
#> GSM494628     1  0.3074     0.7421 0.804 0.000 0.000 0.196 0.000
#> GSM494632     1  0.2407     0.8266 0.896 0.012 0.000 0.088 0.004
#> GSM494660     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494622     1  0.5470     0.4591 0.636 0.112 0.000 0.252 0.000
#> GSM494642     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494647     1  0.0579     0.8609 0.984 0.008 0.000 0.000 0.008
#> GSM494659     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494670     1  0.1704     0.8242 0.928 0.068 0.000 0.000 0.004
#> GSM494675     1  0.6616    -0.2047 0.456 0.252 0.000 0.292 0.000
#> GSM494641     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494636     1  0.2407     0.8266 0.896 0.012 0.000 0.088 0.004
#> GSM494640     4  0.5006     0.5446 0.116 0.180 0.000 0.704 0.000
#> GSM494623     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494644     1  0.1026     0.8580 0.968 0.004 0.000 0.024 0.004
#> GSM494646     1  0.2112     0.8321 0.908 0.004 0.000 0.084 0.004
#> GSM494665     1  0.0162     0.8620 0.996 0.000 0.000 0.000 0.004
#> GSM494638     1  0.2407     0.8266 0.896 0.012 0.000 0.088 0.004
#> GSM494645     1  0.2112     0.8321 0.908 0.004 0.000 0.084 0.004
#> GSM494671     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494655     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494620     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494630     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494657     3  0.0000     0.8929 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494621     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494629     4  0.6062     0.3519 0.416 0.120 0.000 0.464 0.000
#> GSM494637     4  0.6072     0.4148 0.392 0.124 0.000 0.484 0.000
#> GSM494652     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494648     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494650     5  0.3177     0.8639 0.000 0.000 0.000 0.208 0.792
#> GSM494669     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494666     1  0.0162     0.8620 0.996 0.000 0.000 0.000 0.004
#> GSM494668     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494633     1  0.0000     0.8625 1.000 0.000 0.000 0.000 0.000
#> GSM494634     1  0.0451     0.8612 0.988 0.004 0.000 0.000 0.008
#> GSM494639     1  0.2170     0.8294 0.904 0.004 0.000 0.088 0.004
#> GSM494661     5  0.1106     0.8700 0.000 0.024 0.000 0.012 0.964
#> GSM494617     1  0.3074     0.7421 0.804 0.000 0.000 0.196 0.000
#> GSM494626     1  0.3074     0.7421 0.804 0.000 0.000 0.196 0.000
#> GSM494656     3  0.0000     0.8929 0.000 0.000 1.000 0.000 0.000
#> GSM494635     1  0.0865     0.8585 0.972 0.000 0.000 0.024 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
#> GSM494565     5  0.6580   0.221765 0.160 0.136 0.000 0.152 0.552 0.000
#> GSM494594     3  0.0000   0.892766 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.1411   0.578762 0.936 0.060 0.000 0.000 0.004 0.000
#> GSM494564     5  0.3868   0.000869 0.496 0.000 0.000 0.000 0.504 0.000
#> GSM494591     3  0.0000   0.892766 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     4  0.6406   0.436597 0.088 0.084 0.000 0.456 0.372 0.000
#> GSM494602     1  0.4064   0.308718 0.624 0.360 0.000 0.000 0.016 0.000
#> GSM494613     4  0.4130   0.503599 0.000 0.260 0.000 0.696 0.044 0.000
#> GSM494589     5  0.3266   0.542014 0.272 0.000 0.000 0.000 0.728 0.000
#> GSM494598     2  0.2805   0.671509 0.184 0.812 0.000 0.000 0.004 0.000
#> GSM494593     1  0.4064   0.308718 0.624 0.360 0.000 0.000 0.016 0.000
#> GSM494583     2  0.2006   0.843261 0.000 0.904 0.000 0.080 0.016 0.000
#> GSM494612     2  0.0146   0.846525 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM494558     4  0.2092   0.144419 0.000 0.000 0.000 0.876 0.124 0.000
#> GSM494556     4  0.6641   0.477994 0.064 0.272 0.000 0.484 0.180 0.000
#> GSM494559     5  0.3288   0.533360 0.276 0.000 0.000 0.000 0.724 0.000
#> GSM494571     3  0.4634   0.708383 0.000 0.000 0.688 0.188 0.124 0.000
#> GSM494614     5  0.6598   0.242836 0.168 0.128 0.000 0.156 0.548 0.000
#> GSM494603     5  0.5362   0.579900 0.344 0.004 0.000 0.108 0.544 0.000
#> GSM494568     5  0.5362   0.579900 0.344 0.004 0.000 0.108 0.544 0.000
#> GSM494572     3  0.4634   0.708383 0.000 0.000 0.688 0.188 0.124 0.000
#> GSM494600     5  0.3266   0.542014 0.272 0.000 0.000 0.000 0.728 0.000
#> GSM494562     2  0.1471   0.846801 0.000 0.932 0.000 0.064 0.004 0.000
#> GSM494615     5  0.6598   0.242836 0.168 0.128 0.000 0.156 0.548 0.000
#> GSM494582     2  0.0146   0.846525 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM494599     1  0.3629   0.400565 0.724 0.260 0.000 0.000 0.016 0.000
#> GSM494610     2  0.0146   0.846525 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM494587     2  0.2006   0.843261 0.000 0.904 0.000 0.080 0.016 0.000
#> GSM494581     2  0.6217   0.380440 0.088 0.588 0.000 0.144 0.180 0.000
#> GSM494580     4  0.3900   0.525202 0.000 0.232 0.000 0.728 0.040 0.000
#> GSM494563     5  0.3288   0.533360 0.276 0.000 0.000 0.000 0.724 0.000
#> GSM494576     2  0.2006   0.843261 0.000 0.904 0.000 0.080 0.016 0.000
#> GSM494605     1  0.3309   0.389176 0.720 0.000 0.000 0.000 0.280 0.000
#> GSM494584     2  0.2006   0.843261 0.000 0.904 0.000 0.080 0.016 0.000
#> GSM494586     2  0.1471   0.846801 0.000 0.932 0.000 0.064 0.004 0.000
#> GSM494578     4  0.3900   0.525202 0.000 0.232 0.000 0.728 0.040 0.000
#> GSM494585     2  0.2006   0.843261 0.000 0.904 0.000 0.080 0.016 0.000
#> GSM494611     2  0.2703   0.688359 0.172 0.824 0.000 0.000 0.004 0.000
#> GSM494560     5  0.3288   0.533360 0.276 0.000 0.000 0.000 0.724 0.000
#> GSM494595     2  0.2019   0.776861 0.088 0.900 0.000 0.000 0.012 0.000
#> GSM494570     5  0.3868   0.000869 0.496 0.000 0.000 0.000 0.504 0.000
#> GSM494597     3  0.4634   0.708383 0.000 0.000 0.688 0.188 0.124 0.000
#> GSM494607     1  0.1411   0.578762 0.936 0.060 0.000 0.000 0.004 0.000
#> GSM494561     5  0.3899   0.441900 0.364 0.000 0.000 0.008 0.628 0.000
#> GSM494569     5  0.5241   0.566574 0.364 0.000 0.000 0.104 0.532 0.000
#> GSM494592     1  0.3629   0.400565 0.724 0.260 0.000 0.000 0.016 0.000
#> GSM494577     2  0.2006   0.843261 0.000 0.904 0.000 0.080 0.016 0.000
#> GSM494588     5  0.3867  -0.001180 0.488 0.000 0.000 0.000 0.512 0.000
#> GSM494590     3  0.0000   0.892766 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     1  0.4064   0.308718 0.624 0.360 0.000 0.000 0.016 0.000
#> GSM494608     2  0.6217   0.380440 0.088 0.588 0.000 0.144 0.180 0.000
#> GSM494606     1  0.4064   0.308718 0.624 0.360 0.000 0.000 0.016 0.000
#> GSM494574     2  0.0146   0.846525 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM494573     5  0.3288   0.533360 0.276 0.000 0.000 0.000 0.724 0.000
#> GSM494566     5  0.5628   0.513457 0.272 0.048 0.000 0.080 0.600 0.000
#> GSM494601     6  0.0000   0.870143 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494557     4  0.4193   0.486151 0.000 0.272 0.000 0.684 0.044 0.000
#> GSM494579     5  0.5679   0.516765 0.284 0.048 0.000 0.080 0.588 0.000
#> GSM494596     3  0.0000   0.892766 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0146   0.846525 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM494625     1  0.3866   0.037403 0.516 0.000 0.000 0.000 0.484 0.000
#> GSM494654     3  0.0000   0.892766 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494664     1  0.3309   0.389176 0.720 0.000 0.000 0.000 0.280 0.000
#> GSM494624     1  0.3862   0.063730 0.524 0.000 0.000 0.000 0.476 0.000
#> GSM494651     6  0.3883   0.864007 0.000 0.000 0.000 0.144 0.088 0.768
#> GSM494662     1  0.3774   0.174862 0.592 0.000 0.000 0.000 0.408 0.000
#> GSM494627     4  0.6143   0.218300 0.136 0.028 0.000 0.420 0.416 0.000
#> GSM494673     1  0.0000   0.611364 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     1  0.3866   0.037403 0.516 0.000 0.000 0.000 0.484 0.000
#> GSM494658     1  0.1411   0.578762 0.936 0.060 0.000 0.000 0.004 0.000
#> GSM494653     1  0.0000   0.611364 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.5285   0.554990 0.040 0.048 0.000 0.596 0.316 0.000
#> GSM494672     1  0.0000   0.611364 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     5  0.5241   0.566574 0.364 0.000 0.000 0.104 0.532 0.000
#> GSM494631     4  0.3900   0.525202 0.000 0.232 0.000 0.728 0.040 0.000
#> GSM494619     1  0.3862   0.063730 0.524 0.000 0.000 0.000 0.476 0.000
#> GSM494674     1  0.0000   0.611364 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     5  0.5241   0.566574 0.364 0.000 0.000 0.104 0.532 0.000
#> GSM494663     5  0.5362   0.579900 0.344 0.004 0.000 0.108 0.544 0.000
#> GSM494628     5  0.5241   0.566574 0.364 0.000 0.000 0.104 0.532 0.000
#> GSM494632     1  0.4232   0.092091 0.640 0.012 0.000 0.012 0.336 0.000
#> GSM494660     1  0.3866   0.037403 0.516 0.000 0.000 0.000 0.484 0.000
#> GSM494622     5  0.6533   0.389170 0.296 0.040 0.000 0.204 0.460 0.000
#> GSM494642     1  0.0000   0.611364 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0146   0.610176 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000   0.611364 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.1411   0.578762 0.936 0.060 0.000 0.000 0.004 0.000
#> GSM494675     5  0.7104  -0.122992 0.136 0.172 0.000 0.236 0.456 0.000
#> GSM494641     1  0.0000   0.611364 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     1  0.4232   0.092091 0.640 0.012 0.000 0.012 0.336 0.000
#> GSM494640     4  0.3979   0.559648 0.000 0.036 0.000 0.708 0.256 0.000
#> GSM494623     1  0.3862   0.063730 0.524 0.000 0.000 0.000 0.476 0.000
#> GSM494644     1  0.2149   0.538672 0.888 0.004 0.000 0.004 0.104 0.000
#> GSM494646     1  0.3243   0.396155 0.780 0.004 0.000 0.008 0.208 0.000
#> GSM494665     1  0.3309   0.389176 0.720 0.000 0.000 0.000 0.280 0.000
#> GSM494638     1  0.4232   0.092091 0.640 0.012 0.000 0.012 0.336 0.000
#> GSM494645     1  0.3243   0.396155 0.780 0.004 0.000 0.008 0.208 0.000
#> GSM494671     1  0.0000   0.611364 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0146   0.610479 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM494620     1  0.3862   0.063730 0.524 0.000 0.000 0.000 0.476 0.000
#> GSM494630     1  0.3862   0.063730 0.524 0.000 0.000 0.000 0.476 0.000
#> GSM494657     3  0.0000   0.892766 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0146   0.610479 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM494621     1  0.3862   0.063730 0.524 0.000 0.000 0.000 0.476 0.000
#> GSM494629     4  0.6143   0.218300 0.136 0.028 0.000 0.420 0.416 0.000
#> GSM494637     4  0.6110   0.272313 0.132 0.028 0.000 0.444 0.396 0.000
#> GSM494652     1  0.0000   0.611364 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     1  0.3862   0.063730 0.524 0.000 0.000 0.000 0.476 0.000
#> GSM494650     6  0.3883   0.864007 0.000 0.000 0.000 0.144 0.088 0.768
#> GSM494669     1  0.0146   0.610479 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM494666     1  0.3309   0.389176 0.720 0.000 0.000 0.000 0.280 0.000
#> GSM494668     1  0.0000   0.611364 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     1  0.3862   0.063730 0.524 0.000 0.000 0.000 0.476 0.000
#> GSM494634     1  0.0000   0.611364 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.3955   0.168369 0.668 0.004 0.000 0.012 0.316 0.000
#> GSM494661     6  0.0000   0.870143 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494617     5  0.5241   0.566574 0.364 0.000 0.000 0.104 0.532 0.000
#> GSM494626     5  0.5241   0.566574 0.364 0.000 0.000 0.104 0.532 0.000
#> GSM494656     3  0.0000   0.892766 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494635     1  0.2100   0.536957 0.884 0.000 0.000 0.004 0.112 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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 5)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error: The width or height of the raster image is zero, maybe you forget to turn off the
#> previous graphic device or it was corrupted. Run `dev.off()` to close it.

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

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-hclust-collect-classes

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

test_to_known_factors(res)
#>              n disease.state(p)   age(p) other(p) individual(p) k
#> ATC:hclust 119         7.50e-01 0.000109 0.225555      7.43e-05 2
#> ATC:hclust 109         9.34e-06 0.006558 0.000959      1.15e-02 3
#> ATC:hclust 108         1.59e-06 0.076707 0.001767      1.58e-02 4
#> ATC:hclust  99         9.45e-06 0.193496 0.000588      8.92e-03 5
#> ATC:hclust  74         2.90e-06 0.034149 0.000343      7.78e-02 6

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


ATC: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 51941 rows and 120 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 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-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.858           0.964       0.977         0.3423 0.630   0.630
#> 3 3 0.543           0.730       0.857         0.6864 0.725   0.594
#> 4 4 0.697           0.782       0.874         0.2327 0.770   0.520
#> 5 5 0.695           0.678       0.814         0.0897 0.912   0.700
#> 6 6 0.733           0.563       0.752         0.0539 0.909   0.629

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
#> GSM494565     1   0.000      1.000 1.000 0.000
#> GSM494594     2   0.000      0.899 0.000 1.000
#> GSM494604     1   0.000      1.000 1.000 0.000
#> GSM494564     1   0.000      1.000 1.000 0.000
#> GSM494591     2   0.000      0.899 0.000 1.000
#> GSM494567     1   0.000      1.000 1.000 0.000
#> GSM494602     1   0.000      1.000 1.000 0.000
#> GSM494613     2   0.767      0.806 0.224 0.776
#> GSM494589     1   0.000      1.000 1.000 0.000
#> GSM494598     1   0.000      1.000 1.000 0.000
#> GSM494593     1   0.000      1.000 1.000 0.000
#> GSM494583     2   0.767      0.806 0.224 0.776
#> GSM494612     1   0.000      1.000 1.000 0.000
#> GSM494558     2   0.000      0.899 0.000 1.000
#> GSM494556     1   0.000      1.000 1.000 0.000
#> GSM494559     1   0.000      1.000 1.000 0.000
#> GSM494571     2   0.000      0.899 0.000 1.000
#> GSM494614     1   0.000      1.000 1.000 0.000
#> GSM494603     1   0.000      1.000 1.000 0.000
#> GSM494568     1   0.000      1.000 1.000 0.000
#> GSM494572     2   0.000      0.899 0.000 1.000
#> GSM494600     1   0.000      1.000 1.000 0.000
#> GSM494562     2   0.767      0.806 0.224 0.776
#> GSM494615     1   0.000      1.000 1.000 0.000
#> GSM494582     1   0.000      1.000 1.000 0.000
#> GSM494599     1   0.000      1.000 1.000 0.000
#> GSM494610     1   0.000      1.000 1.000 0.000
#> GSM494587     2   0.767      0.806 0.224 0.776
#> GSM494581     1   0.000      1.000 1.000 0.000
#> GSM494580     2   0.000      0.899 0.000 1.000
#> GSM494563     1   0.000      1.000 1.000 0.000
#> GSM494576     2   0.925      0.628 0.340 0.660
#> GSM494605     1   0.000      1.000 1.000 0.000
#> GSM494584     2   0.767      0.806 0.224 0.776
#> GSM494586     2   0.767      0.806 0.224 0.776
#> GSM494578     2   0.767      0.806 0.224 0.776
#> GSM494585     2   0.767      0.806 0.224 0.776
#> GSM494611     1   0.000      1.000 1.000 0.000
#> GSM494560     1   0.000      1.000 1.000 0.000
#> GSM494595     1   0.000      1.000 1.000 0.000
#> GSM494570     1   0.000      1.000 1.000 0.000
#> GSM494597     2   0.000      0.899 0.000 1.000
#> GSM494607     1   0.000      1.000 1.000 0.000
#> GSM494561     1   0.000      1.000 1.000 0.000
#> GSM494569     1   0.000      1.000 1.000 0.000
#> GSM494592     1   0.000      1.000 1.000 0.000
#> GSM494577     2   0.925      0.628 0.340 0.660
#> GSM494588     1   0.000      1.000 1.000 0.000
#> GSM494590     2   0.000      0.899 0.000 1.000
#> GSM494609     1   0.000      1.000 1.000 0.000
#> GSM494608     1   0.000      1.000 1.000 0.000
#> GSM494606     1   0.000      1.000 1.000 0.000
#> GSM494574     1   0.000      1.000 1.000 0.000
#> GSM494573     1   0.000      1.000 1.000 0.000
#> GSM494566     1   0.000      1.000 1.000 0.000
#> GSM494601     2   0.000      0.899 0.000 1.000
#> GSM494557     2   0.000      0.899 0.000 1.000
#> GSM494579     1   0.000      1.000 1.000 0.000
#> GSM494596     2   0.000      0.899 0.000 1.000
#> GSM494575     1   0.000      1.000 1.000 0.000
#> GSM494625     1   0.000      1.000 1.000 0.000
#> GSM494654     2   0.000      0.899 0.000 1.000
#> GSM494664     1   0.000      1.000 1.000 0.000
#> GSM494624     1   0.000      1.000 1.000 0.000
#> GSM494651     2   0.000      0.899 0.000 1.000
#> GSM494662     1   0.000      1.000 1.000 0.000
#> GSM494627     1   0.000      1.000 1.000 0.000
#> GSM494673     1   0.000      1.000 1.000 0.000
#> GSM494649     1   0.000      1.000 1.000 0.000
#> GSM494658     1   0.000      1.000 1.000 0.000
#> GSM494653     1   0.000      1.000 1.000 0.000
#> GSM494643     1   0.000      1.000 1.000 0.000
#> GSM494672     1   0.000      1.000 1.000 0.000
#> GSM494618     1   0.000      1.000 1.000 0.000
#> GSM494631     2   0.767      0.806 0.224 0.776
#> GSM494619     1   0.000      1.000 1.000 0.000
#> GSM494674     1   0.000      1.000 1.000 0.000
#> GSM494616     1   0.000      1.000 1.000 0.000
#> GSM494663     1   0.000      1.000 1.000 0.000
#> GSM494628     1   0.000      1.000 1.000 0.000
#> GSM494632     1   0.000      1.000 1.000 0.000
#> GSM494660     1   0.000      1.000 1.000 0.000
#> GSM494622     1   0.000      1.000 1.000 0.000
#> GSM494642     1   0.000      1.000 1.000 0.000
#> GSM494647     1   0.000      1.000 1.000 0.000
#> GSM494659     1   0.000      1.000 1.000 0.000
#> GSM494670     1   0.000      1.000 1.000 0.000
#> GSM494675     1   0.000      1.000 1.000 0.000
#> GSM494641     1   0.000      1.000 1.000 0.000
#> GSM494636     1   0.000      1.000 1.000 0.000
#> GSM494640     2   0.343      0.880 0.064 0.936
#> GSM494623     1   0.000      1.000 1.000 0.000
#> GSM494644     1   0.000      1.000 1.000 0.000
#> GSM494646     1   0.000      1.000 1.000 0.000
#> GSM494665     1   0.000      1.000 1.000 0.000
#> GSM494638     1   0.000      1.000 1.000 0.000
#> GSM494645     1   0.000      1.000 1.000 0.000
#> GSM494671     1   0.000      1.000 1.000 0.000
#> GSM494655     1   0.000      1.000 1.000 0.000
#> GSM494620     1   0.000      1.000 1.000 0.000
#> GSM494630     1   0.000      1.000 1.000 0.000
#> GSM494657     2   0.000      0.899 0.000 1.000
#> GSM494667     1   0.000      1.000 1.000 0.000
#> GSM494621     1   0.000      1.000 1.000 0.000
#> GSM494629     1   0.000      1.000 1.000 0.000
#> GSM494637     1   0.000      1.000 1.000 0.000
#> GSM494652     1   0.000      1.000 1.000 0.000
#> GSM494648     1   0.000      1.000 1.000 0.000
#> GSM494650     2   0.000      0.899 0.000 1.000
#> GSM494669     1   0.000      1.000 1.000 0.000
#> GSM494666     1   0.000      1.000 1.000 0.000
#> GSM494668     1   0.000      1.000 1.000 0.000
#> GSM494633     1   0.000      1.000 1.000 0.000
#> GSM494634     1   0.000      1.000 1.000 0.000
#> GSM494639     1   0.000      1.000 1.000 0.000
#> GSM494661     2   0.000      0.899 0.000 1.000
#> GSM494617     1   0.000      1.000 1.000 0.000
#> GSM494626     1   0.000      1.000 1.000 0.000
#> GSM494656     2   0.000      0.899 0.000 1.000
#> GSM494635     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
#> GSM494565     2  0.5058     0.6669 0.244 0.756 0.000
#> GSM494594     3  0.3879     0.9624 0.000 0.152 0.848
#> GSM494604     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494564     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494591     3  0.3879     0.9624 0.000 0.152 0.848
#> GSM494567     2  0.4931     0.6660 0.232 0.768 0.000
#> GSM494602     1  0.8957     0.4839 0.536 0.312 0.152
#> GSM494613     2  0.2165     0.7171 0.064 0.936 0.000
#> GSM494589     1  0.5905     0.3156 0.648 0.352 0.000
#> GSM494598     2  0.6605     0.6474 0.096 0.752 0.152
#> GSM494593     2  0.9118     0.0713 0.352 0.496 0.152
#> GSM494583     2  0.0424     0.7305 0.008 0.992 0.000
#> GSM494612     2  0.4110     0.7161 0.004 0.844 0.152
#> GSM494558     2  0.5012     0.4937 0.008 0.788 0.204
#> GSM494556     2  0.4750     0.6811 0.216 0.784 0.000
#> GSM494559     1  0.4605     0.6433 0.796 0.204 0.000
#> GSM494571     3  0.3879     0.9624 0.000 0.152 0.848
#> GSM494614     2  0.4750     0.6811 0.216 0.784 0.000
#> GSM494603     1  0.2356     0.7980 0.928 0.072 0.000
#> GSM494568     1  0.2356     0.7980 0.928 0.072 0.000
#> GSM494572     3  0.3879     0.9624 0.000 0.152 0.848
#> GSM494600     1  0.5905     0.3156 0.648 0.352 0.000
#> GSM494562     2  0.0000     0.7275 0.000 1.000 0.000
#> GSM494615     2  0.6180     0.4505 0.416 0.584 0.000
#> GSM494582     2  0.4110     0.7161 0.004 0.844 0.152
#> GSM494599     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494610     2  0.4110     0.7161 0.004 0.844 0.152
#> GSM494587     2  0.0424     0.7305 0.008 0.992 0.000
#> GSM494581     2  0.4291     0.7224 0.008 0.840 0.152
#> GSM494580     2  0.2866     0.6681 0.008 0.916 0.076
#> GSM494563     1  0.3340     0.7562 0.880 0.120 0.000
#> GSM494576     2  0.0424     0.7305 0.008 0.992 0.000
#> GSM494605     1  0.4280     0.8170 0.856 0.020 0.124
#> GSM494584     2  0.0424     0.7305 0.008 0.992 0.000
#> GSM494586     2  0.0000     0.7275 0.000 1.000 0.000
#> GSM494578     2  0.2261     0.7153 0.068 0.932 0.000
#> GSM494585     2  0.0424     0.7305 0.008 0.992 0.000
#> GSM494611     2  0.4873     0.7062 0.024 0.824 0.152
#> GSM494560     1  0.6062     0.2189 0.616 0.384 0.000
#> GSM494595     2  0.3879     0.7180 0.000 0.848 0.152
#> GSM494570     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494597     3  0.3879     0.9624 0.000 0.152 0.848
#> GSM494607     1  0.6372     0.7886 0.764 0.084 0.152
#> GSM494561     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494569     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494592     1  0.6372     0.7886 0.764 0.084 0.152
#> GSM494577     2  0.0424     0.7305 0.008 0.992 0.000
#> GSM494588     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494590     3  0.3879     0.9624 0.000 0.152 0.848
#> GSM494609     2  0.9229    -0.2061 0.424 0.424 0.152
#> GSM494608     2  0.4291     0.7224 0.008 0.840 0.152
#> GSM494606     1  0.9130     0.3851 0.492 0.356 0.152
#> GSM494574     2  0.4110     0.7161 0.004 0.844 0.152
#> GSM494573     1  0.4605     0.6433 0.796 0.204 0.000
#> GSM494566     1  0.3116     0.7677 0.892 0.108 0.000
#> GSM494601     2  0.6260    -0.2518 0.000 0.552 0.448
#> GSM494557     2  0.2774     0.6719 0.008 0.920 0.072
#> GSM494579     1  0.8984     0.4569 0.524 0.328 0.148
#> GSM494596     3  0.3879     0.9624 0.000 0.152 0.848
#> GSM494575     2  0.4110     0.7161 0.004 0.844 0.152
#> GSM494625     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494654     3  0.3879     0.9624 0.000 0.152 0.848
#> GSM494664     1  0.0424     0.8376 0.992 0.008 0.000
#> GSM494624     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494651     3  0.6307     0.3679 0.000 0.488 0.512
#> GSM494662     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494627     1  0.2711     0.7856 0.912 0.088 0.000
#> GSM494673     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494649     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494658     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494653     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494643     2  0.5835     0.5749 0.340 0.660 0.000
#> GSM494672     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494618     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494631     2  0.2261     0.7153 0.068 0.932 0.000
#> GSM494619     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494674     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494616     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494663     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494628     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494632     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494660     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494622     2  0.5327     0.6382 0.272 0.728 0.000
#> GSM494642     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494647     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494659     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494670     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494675     2  0.4750     0.6811 0.216 0.784 0.000
#> GSM494641     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494636     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494640     2  0.3045     0.7021 0.064 0.916 0.020
#> GSM494623     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494644     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494646     1  0.0661     0.8376 0.988 0.008 0.004
#> GSM494665     1  0.5884     0.7973 0.788 0.064 0.148
#> GSM494638     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494645     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494671     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494655     1  0.5944     0.7958 0.784 0.064 0.152
#> GSM494620     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494630     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494657     3  0.3879     0.9624 0.000 0.152 0.848
#> GSM494667     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494621     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494629     1  0.2711     0.7856 0.912 0.088 0.000
#> GSM494637     1  0.2711     0.7856 0.912 0.088 0.000
#> GSM494652     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494648     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494650     3  0.3879     0.9624 0.000 0.152 0.848
#> GSM494669     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494666     1  0.3043     0.8277 0.908 0.008 0.084
#> GSM494668     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494633     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494634     1  0.6291     0.7910 0.768 0.080 0.152
#> GSM494639     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494661     2  0.6260    -0.2518 0.000 0.552 0.448
#> GSM494617     1  0.0000     0.8381 1.000 0.000 0.000
#> GSM494626     1  0.0237     0.8373 0.996 0.004 0.000
#> GSM494656     3  0.3879     0.9624 0.000 0.152 0.848
#> GSM494635     1  0.4291     0.8124 0.840 0.008 0.152

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     2  0.5290    0.42638 0.008 0.516 0.000 0.476
#> GSM494594     3  0.0000    0.99631 0.000 0.000 1.000 0.000
#> GSM494604     1  0.1059    0.87878 0.972 0.012 0.000 0.016
#> GSM494564     4  0.2530    0.81546 0.112 0.000 0.000 0.888
#> GSM494591     3  0.0000    0.99631 0.000 0.000 1.000 0.000
#> GSM494567     2  0.4866    0.56994 0.000 0.596 0.000 0.404
#> GSM494602     1  0.3749    0.77028 0.840 0.128 0.000 0.032
#> GSM494613     2  0.3486    0.79743 0.000 0.812 0.000 0.188
#> GSM494589     4  0.1356    0.77213 0.008 0.032 0.000 0.960
#> GSM494598     2  0.5685   -0.00812 0.460 0.516 0.000 0.024
#> GSM494593     1  0.5041    0.64805 0.728 0.232 0.000 0.040
#> GSM494583     2  0.0592    0.83893 0.000 0.984 0.000 0.016
#> GSM494612     2  0.1629    0.82744 0.024 0.952 0.000 0.024
#> GSM494558     2  0.5279    0.74007 0.000 0.704 0.044 0.252
#> GSM494556     2  0.3688    0.79145 0.000 0.792 0.000 0.208
#> GSM494559     4  0.1624    0.79715 0.028 0.020 0.000 0.952
#> GSM494571     3  0.0000    0.99631 0.000 0.000 1.000 0.000
#> GSM494614     2  0.4936    0.68535 0.008 0.652 0.000 0.340
#> GSM494603     4  0.1356    0.80081 0.032 0.008 0.000 0.960
#> GSM494568     4  0.1452    0.80064 0.036 0.008 0.000 0.956
#> GSM494572     3  0.0188    0.99482 0.000 0.000 0.996 0.004
#> GSM494600     4  0.1356    0.77213 0.008 0.032 0.000 0.960
#> GSM494562     2  0.0188    0.83487 0.004 0.996 0.000 0.000
#> GSM494615     4  0.1474    0.75447 0.000 0.052 0.000 0.948
#> GSM494582     2  0.1629    0.82744 0.024 0.952 0.000 0.024
#> GSM494599     1  0.1297    0.87452 0.964 0.016 0.000 0.020
#> GSM494610     2  0.1629    0.82744 0.024 0.952 0.000 0.024
#> GSM494587     2  0.0592    0.83893 0.000 0.984 0.000 0.016
#> GSM494581     2  0.1406    0.83076 0.016 0.960 0.000 0.024
#> GSM494580     2  0.3649    0.79598 0.000 0.796 0.000 0.204
#> GSM494563     4  0.3051    0.80020 0.088 0.028 0.000 0.884
#> GSM494576     2  0.0592    0.83893 0.000 0.984 0.000 0.016
#> GSM494605     1  0.1211    0.88433 0.960 0.000 0.000 0.040
#> GSM494584     2  0.0592    0.83893 0.000 0.984 0.000 0.016
#> GSM494586     2  0.0188    0.83487 0.004 0.996 0.000 0.000
#> GSM494578     2  0.3610    0.79190 0.000 0.800 0.000 0.200
#> GSM494585     2  0.0592    0.83893 0.000 0.984 0.000 0.016
#> GSM494611     1  0.5695    0.10024 0.500 0.476 0.000 0.024
#> GSM494560     4  0.2131    0.77908 0.036 0.032 0.000 0.932
#> GSM494595     2  0.1629    0.82744 0.024 0.952 0.000 0.024
#> GSM494570     4  0.2814    0.81206 0.132 0.000 0.000 0.868
#> GSM494597     3  0.0817    0.98481 0.000 0.000 0.976 0.024
#> GSM494607     1  0.1624    0.86799 0.952 0.028 0.000 0.020
#> GSM494561     4  0.2081    0.81439 0.084 0.000 0.000 0.916
#> GSM494569     4  0.2011    0.81389 0.080 0.000 0.000 0.920
#> GSM494592     1  0.1624    0.86799 0.952 0.028 0.000 0.020
#> GSM494577     2  0.0592    0.83893 0.000 0.984 0.000 0.016
#> GSM494588     4  0.4624    0.66596 0.340 0.000 0.000 0.660
#> GSM494590     3  0.0000    0.99631 0.000 0.000 1.000 0.000
#> GSM494609     1  0.5631    0.61767 0.700 0.224 0.000 0.076
#> GSM494608     2  0.1406    0.83076 0.016 0.960 0.000 0.024
#> GSM494606     1  0.3842    0.76736 0.836 0.128 0.000 0.036
#> GSM494574     2  0.1520    0.82765 0.024 0.956 0.000 0.020
#> GSM494573     4  0.1624    0.79715 0.028 0.020 0.000 0.952
#> GSM494566     4  0.1042    0.78353 0.008 0.020 0.000 0.972
#> GSM494601     2  0.2197    0.81073 0.000 0.928 0.048 0.024
#> GSM494557     2  0.1302    0.83515 0.000 0.956 0.000 0.044
#> GSM494579     1  0.7162    0.18399 0.472 0.136 0.000 0.392
#> GSM494596     3  0.0000    0.99631 0.000 0.000 1.000 0.000
#> GSM494575     2  0.1629    0.82744 0.024 0.952 0.000 0.024
#> GSM494625     4  0.4072    0.75984 0.252 0.000 0.000 0.748
#> GSM494654     3  0.0000    0.99631 0.000 0.000 1.000 0.000
#> GSM494664     1  0.2408    0.81201 0.896 0.000 0.000 0.104
#> GSM494624     4  0.4624    0.66596 0.340 0.000 0.000 0.660
#> GSM494651     2  0.5499    0.74721 0.000 0.712 0.072 0.216
#> GSM494662     4  0.4072    0.75984 0.252 0.000 0.000 0.748
#> GSM494627     4  0.1820    0.79562 0.036 0.020 0.000 0.944
#> GSM494673     1  0.0469    0.89486 0.988 0.000 0.000 0.012
#> GSM494649     4  0.4072    0.75984 0.252 0.000 0.000 0.748
#> GSM494658     1  0.1297    0.87452 0.964 0.016 0.000 0.020
#> GSM494653     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494643     4  0.4989   -0.22976 0.000 0.472 0.000 0.528
#> GSM494672     1  0.0469    0.88592 0.988 0.012 0.000 0.000
#> GSM494618     4  0.1716    0.81037 0.064 0.000 0.000 0.936
#> GSM494631     2  0.3688    0.79059 0.000 0.792 0.000 0.208
#> GSM494619     4  0.4948    0.49221 0.440 0.000 0.000 0.560
#> GSM494674     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494616     4  0.3219    0.80251 0.164 0.000 0.000 0.836
#> GSM494663     4  0.1389    0.80642 0.048 0.000 0.000 0.952
#> GSM494628     4  0.1716    0.81037 0.064 0.000 0.000 0.936
#> GSM494632     1  0.3172    0.75438 0.840 0.000 0.000 0.160
#> GSM494660     4  0.4072    0.75984 0.252 0.000 0.000 0.748
#> GSM494622     2  0.4522    0.68602 0.000 0.680 0.000 0.320
#> GSM494642     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494647     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494659     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494670     1  0.1520    0.87020 0.956 0.020 0.000 0.024
#> GSM494675     2  0.3688    0.79145 0.000 0.792 0.000 0.208
#> GSM494641     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494636     4  0.3764    0.77862 0.216 0.000 0.000 0.784
#> GSM494640     2  0.4382    0.73005 0.000 0.704 0.000 0.296
#> GSM494623     4  0.4948    0.49221 0.440 0.000 0.000 0.560
#> GSM494644     1  0.0592    0.89548 0.984 0.000 0.000 0.016
#> GSM494646     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494665     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494638     4  0.1474    0.80770 0.052 0.000 0.000 0.948
#> GSM494645     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494671     1  0.0469    0.89486 0.988 0.000 0.000 0.012
#> GSM494655     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494620     4  0.4948    0.49221 0.440 0.000 0.000 0.560
#> GSM494630     4  0.4605    0.67151 0.336 0.000 0.000 0.664
#> GSM494657     3  0.0000    0.99631 0.000 0.000 1.000 0.000
#> GSM494667     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494621     4  0.4877    0.55608 0.408 0.000 0.000 0.592
#> GSM494629     4  0.1929    0.79320 0.036 0.024 0.000 0.940
#> GSM494637     4  0.1929    0.79320 0.036 0.024 0.000 0.940
#> GSM494652     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494648     4  0.4948    0.49221 0.440 0.000 0.000 0.560
#> GSM494650     3  0.0817    0.98481 0.000 0.000 0.976 0.024
#> GSM494669     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494666     1  0.1211    0.88433 0.960 0.000 0.000 0.040
#> GSM494668     1  0.0817    0.89651 0.976 0.000 0.000 0.024
#> GSM494633     4  0.4072    0.75984 0.252 0.000 0.000 0.748
#> GSM494634     1  0.0469    0.89486 0.988 0.000 0.000 0.012
#> GSM494639     1  0.4643    0.25405 0.656 0.000 0.000 0.344
#> GSM494661     2  0.2197    0.81073 0.000 0.928 0.048 0.024
#> GSM494617     4  0.4072    0.75984 0.252 0.000 0.000 0.748
#> GSM494626     4  0.4008    0.76426 0.244 0.000 0.000 0.756
#> GSM494656     3  0.0000    0.99631 0.000 0.000 1.000 0.000
#> GSM494635     1  0.0817    0.89651 0.976 0.000 0.000 0.024

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     5  0.5819    0.51498 0.000 0.252 0.000 0.148 0.600
#> GSM494594     3  0.0000    0.98046 0.000 0.000 1.000 0.000 0.000
#> GSM494604     1  0.1502    0.85003 0.940 0.056 0.000 0.004 0.000
#> GSM494564     4  0.1942    0.70444 0.012 0.000 0.000 0.920 0.068
#> GSM494591     3  0.0000    0.98046 0.000 0.000 1.000 0.000 0.000
#> GSM494567     5  0.3932    0.61717 0.000 0.064 0.000 0.140 0.796
#> GSM494602     1  0.5321    0.45174 0.568 0.388 0.000 0.020 0.024
#> GSM494613     5  0.2852    0.56483 0.000 0.172 0.000 0.000 0.828
#> GSM494589     4  0.4341    0.34582 0.000 0.008 0.000 0.628 0.364
#> GSM494598     2  0.3308    0.63014 0.144 0.832 0.000 0.004 0.020
#> GSM494593     1  0.5355    0.41929 0.552 0.404 0.000 0.020 0.024
#> GSM494583     2  0.3661    0.74285 0.000 0.724 0.000 0.000 0.276
#> GSM494612     2  0.0162    0.77711 0.004 0.996 0.000 0.000 0.000
#> GSM494558     5  0.2358    0.59594 0.000 0.104 0.000 0.008 0.888
#> GSM494556     5  0.3630    0.56643 0.000 0.204 0.000 0.016 0.780
#> GSM494559     4  0.4142    0.53503 0.004 0.016 0.000 0.728 0.252
#> GSM494571     3  0.0162    0.97942 0.000 0.000 0.996 0.004 0.000
#> GSM494614     5  0.5770    0.51272 0.000 0.256 0.000 0.140 0.604
#> GSM494603     4  0.4610    0.22511 0.012 0.000 0.000 0.556 0.432
#> GSM494568     4  0.4546    0.11612 0.008 0.000 0.000 0.532 0.460
#> GSM494572     3  0.0162    0.97942 0.000 0.000 0.996 0.004 0.000
#> GSM494600     4  0.4444    0.33972 0.000 0.012 0.000 0.624 0.364
#> GSM494562     2  0.3143    0.77072 0.000 0.796 0.000 0.000 0.204
#> GSM494615     5  0.4555    0.35552 0.000 0.020 0.000 0.344 0.636
#> GSM494582     2  0.0162    0.77711 0.004 0.996 0.000 0.000 0.000
#> GSM494599     1  0.2206    0.83805 0.912 0.068 0.000 0.016 0.004
#> GSM494610     2  0.0162    0.77711 0.004 0.996 0.000 0.000 0.000
#> GSM494587     2  0.3561    0.75145 0.000 0.740 0.000 0.000 0.260
#> GSM494581     2  0.0955    0.76938 0.004 0.968 0.000 0.000 0.028
#> GSM494580     5  0.2377    0.57849 0.000 0.128 0.000 0.000 0.872
#> GSM494563     4  0.4124    0.55810 0.008 0.016 0.000 0.744 0.232
#> GSM494576     2  0.3684    0.74035 0.000 0.720 0.000 0.000 0.280
#> GSM494605     1  0.1792    0.81906 0.916 0.000 0.000 0.084 0.000
#> GSM494584     2  0.3752    0.73064 0.000 0.708 0.000 0.000 0.292
#> GSM494586     2  0.3143    0.77072 0.000 0.796 0.000 0.000 0.204
#> GSM494578     5  0.2852    0.56483 0.000 0.172 0.000 0.000 0.828
#> GSM494585     2  0.3452    0.75816 0.000 0.756 0.000 0.000 0.244
#> GSM494611     2  0.3055    0.63712 0.144 0.840 0.000 0.000 0.016
#> GSM494560     4  0.4763    0.34440 0.004 0.020 0.000 0.616 0.360
#> GSM494595     2  0.0566    0.76926 0.004 0.984 0.000 0.000 0.012
#> GSM494570     4  0.1741    0.71571 0.024 0.000 0.000 0.936 0.040
#> GSM494597     3  0.1894    0.93459 0.000 0.000 0.920 0.008 0.072
#> GSM494607     1  0.2935    0.80437 0.860 0.120 0.000 0.016 0.004
#> GSM494561     4  0.2069    0.70190 0.012 0.000 0.000 0.912 0.076
#> GSM494569     4  0.3165    0.69368 0.036 0.000 0.000 0.848 0.116
#> GSM494592     1  0.3124    0.79273 0.844 0.136 0.000 0.016 0.004
#> GSM494577     2  0.3661    0.74285 0.000 0.724 0.000 0.000 0.276
#> GSM494588     4  0.3535    0.69709 0.164 0.000 0.000 0.808 0.028
#> GSM494590     3  0.0000    0.98046 0.000 0.000 1.000 0.000 0.000
#> GSM494609     1  0.5638    0.39853 0.536 0.404 0.000 0.020 0.040
#> GSM494608     2  0.1285    0.76166 0.004 0.956 0.000 0.004 0.036
#> GSM494606     1  0.5330    0.44408 0.564 0.392 0.000 0.020 0.024
#> GSM494574     2  0.0162    0.77711 0.004 0.996 0.000 0.000 0.000
#> GSM494573     4  0.4116    0.53920 0.004 0.016 0.000 0.732 0.248
#> GSM494566     5  0.4747   -0.03707 0.000 0.016 0.000 0.488 0.496
#> GSM494601     2  0.4909    0.62783 0.000 0.588 0.000 0.032 0.380
#> GSM494557     2  0.4256    0.54999 0.000 0.564 0.000 0.000 0.436
#> GSM494579     1  0.8330   -0.00317 0.332 0.296 0.000 0.140 0.232
#> GSM494596     3  0.0000    0.98046 0.000 0.000 1.000 0.000 0.000
#> GSM494575     2  0.0162    0.77711 0.004 0.996 0.000 0.000 0.000
#> GSM494625     4  0.1965    0.73244 0.096 0.000 0.000 0.904 0.000
#> GSM494654     3  0.0000    0.98046 0.000 0.000 1.000 0.000 0.000
#> GSM494664     1  0.3707    0.53682 0.716 0.000 0.000 0.284 0.000
#> GSM494624     4  0.3123    0.69336 0.184 0.000 0.000 0.812 0.004
#> GSM494651     5  0.3090    0.56876 0.000 0.104 0.000 0.040 0.856
#> GSM494662     4  0.2124    0.73252 0.096 0.000 0.000 0.900 0.004
#> GSM494627     5  0.4420    0.16780 0.004 0.000 0.000 0.448 0.548
#> GSM494673     1  0.0000    0.87449 1.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.1965    0.73244 0.096 0.000 0.000 0.904 0.000
#> GSM494658     1  0.2488    0.81215 0.872 0.124 0.000 0.004 0.000
#> GSM494653     1  0.0162    0.87366 0.996 0.000 0.000 0.004 0.000
#> GSM494643     5  0.3421    0.64706 0.000 0.080 0.000 0.080 0.840
#> GSM494672     1  0.1043    0.85923 0.960 0.040 0.000 0.000 0.000
#> GSM494618     4  0.4467    0.36639 0.016 0.000 0.000 0.640 0.344
#> GSM494631     5  0.2773    0.56810 0.000 0.164 0.000 0.000 0.836
#> GSM494619     4  0.3452    0.65221 0.244 0.000 0.000 0.756 0.000
#> GSM494674     1  0.0000    0.87449 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.2927    0.71932 0.060 0.000 0.000 0.872 0.068
#> GSM494663     4  0.4528    0.13476 0.008 0.000 0.000 0.548 0.444
#> GSM494628     4  0.3278    0.66187 0.020 0.000 0.000 0.824 0.156
#> GSM494632     1  0.4300    0.67599 0.772 0.000 0.000 0.132 0.096
#> GSM494660     4  0.1965    0.73244 0.096 0.000 0.000 0.904 0.000
#> GSM494622     5  0.3239    0.64629 0.000 0.080 0.000 0.068 0.852
#> GSM494642     1  0.0000    0.87449 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000    0.87449 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0162    0.87366 0.996 0.000 0.000 0.004 0.000
#> GSM494670     1  0.2890    0.78440 0.836 0.160 0.000 0.004 0.000
#> GSM494675     5  0.3399    0.60243 0.000 0.168 0.000 0.020 0.812
#> GSM494641     1  0.0000    0.87449 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.4127    0.69285 0.080 0.000 0.000 0.784 0.136
#> GSM494640     5  0.2411    0.59614 0.000 0.108 0.000 0.008 0.884
#> GSM494623     4  0.3452    0.65221 0.244 0.000 0.000 0.756 0.000
#> GSM494644     1  0.0162    0.87354 0.996 0.004 0.000 0.000 0.000
#> GSM494646     1  0.0794    0.86175 0.972 0.000 0.000 0.028 0.000
#> GSM494665     1  0.0510    0.86847 0.984 0.000 0.000 0.016 0.000
#> GSM494638     5  0.4746    0.02651 0.016 0.000 0.000 0.480 0.504
#> GSM494645     1  0.0000    0.87449 1.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000    0.87449 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0162    0.87366 0.996 0.000 0.000 0.004 0.000
#> GSM494620     4  0.3452    0.65221 0.244 0.000 0.000 0.756 0.000
#> GSM494630     4  0.3123    0.69336 0.184 0.000 0.000 0.812 0.004
#> GSM494657     3  0.0000    0.98046 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0162    0.87366 0.996 0.000 0.000 0.004 0.000
#> GSM494621     4  0.3452    0.65221 0.244 0.000 0.000 0.756 0.000
#> GSM494629     5  0.4420    0.16780 0.004 0.000 0.000 0.448 0.548
#> GSM494637     5  0.4420    0.16780 0.004 0.000 0.000 0.448 0.548
#> GSM494652     1  0.0162    0.87366 0.996 0.000 0.000 0.004 0.000
#> GSM494648     4  0.3452    0.65221 0.244 0.000 0.000 0.756 0.000
#> GSM494650     3  0.3229    0.86867 0.000 0.000 0.840 0.032 0.128
#> GSM494669     1  0.0162    0.87366 0.996 0.000 0.000 0.004 0.000
#> GSM494666     1  0.1792    0.82045 0.916 0.000 0.000 0.084 0.000
#> GSM494668     1  0.0000    0.87449 1.000 0.000 0.000 0.000 0.000
#> GSM494633     4  0.2124    0.73209 0.096 0.000 0.000 0.900 0.004
#> GSM494634     1  0.0000    0.87449 1.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.3282    0.69005 0.804 0.000 0.000 0.188 0.008
#> GSM494661     2  0.4930    0.61684 0.000 0.580 0.000 0.032 0.388
#> GSM494617     4  0.3410    0.72355 0.092 0.000 0.000 0.840 0.068
#> GSM494626     4  0.3301    0.72191 0.080 0.000 0.000 0.848 0.072
#> GSM494656     3  0.0000    0.98046 0.000 0.000 1.000 0.000 0.000
#> GSM494635     1  0.0000    0.87449 1.000 0.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM494565     5  0.5248    0.32627 0.000 0.168 0.000 0.204 0.624 0.004
#> GSM494594     3  0.0000    0.96231 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.1297    0.87434 0.948 0.012 0.000 0.000 0.040 0.000
#> GSM494564     6  0.4477    0.21179 0.000 0.004 0.000 0.028 0.380 0.588
#> GSM494591     3  0.0000    0.96231 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     5  0.4096   -0.02802 0.000 0.008 0.000 0.484 0.508 0.000
#> GSM494602     1  0.5360   -0.00855 0.456 0.436 0.000 0.000 0.108 0.000
#> GSM494613     4  0.2846    0.71275 0.000 0.060 0.000 0.856 0.084 0.000
#> GSM494589     5  0.4882    0.15173 0.000 0.004 0.000 0.052 0.540 0.404
#> GSM494598     2  0.3068    0.60318 0.088 0.840 0.000 0.000 0.072 0.000
#> GSM494593     2  0.5586    0.35199 0.284 0.552 0.000 0.004 0.160 0.000
#> GSM494583     2  0.4076    0.40426 0.000 0.592 0.000 0.396 0.012 0.000
#> GSM494612     2  0.0291    0.66784 0.004 0.992 0.000 0.000 0.004 0.000
#> GSM494558     4  0.3017    0.70666 0.000 0.052 0.000 0.840 0.108 0.000
#> GSM494556     4  0.4663    0.55441 0.000 0.092 0.000 0.664 0.244 0.000
#> GSM494559     5  0.4887   -0.04137 0.000 0.004 0.000 0.048 0.476 0.472
#> GSM494571     3  0.0458    0.95884 0.000 0.000 0.984 0.000 0.016 0.000
#> GSM494614     5  0.5342    0.29781 0.000 0.156 0.000 0.236 0.604 0.004
#> GSM494603     5  0.3249    0.47857 0.000 0.004 0.000 0.044 0.824 0.128
#> GSM494568     5  0.3278    0.47709 0.000 0.000 0.000 0.040 0.808 0.152
#> GSM494572     3  0.0458    0.95884 0.000 0.000 0.984 0.000 0.016 0.000
#> GSM494600     5  0.4882    0.15173 0.000 0.004 0.000 0.052 0.540 0.404
#> GSM494562     2  0.3595    0.51306 0.000 0.704 0.000 0.288 0.008 0.000
#> GSM494615     5  0.4464    0.30786 0.000 0.008 0.000 0.340 0.624 0.028
#> GSM494582     2  0.0146    0.66824 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM494599     1  0.1934    0.85343 0.916 0.040 0.000 0.000 0.044 0.000
#> GSM494610     2  0.0146    0.66820 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM494587     2  0.3945    0.42526 0.000 0.612 0.000 0.380 0.008 0.000
#> GSM494581     2  0.2263    0.64269 0.000 0.896 0.000 0.056 0.048 0.000
#> GSM494580     4  0.1984    0.69912 0.000 0.056 0.000 0.912 0.032 0.000
#> GSM494563     6  0.4932   -0.02847 0.000 0.008 0.000 0.044 0.472 0.476
#> GSM494576     2  0.4093    0.39244 0.000 0.584 0.000 0.404 0.012 0.000
#> GSM494605     1  0.2250    0.83447 0.888 0.000 0.000 0.020 0.000 0.092
#> GSM494584     2  0.4172    0.27565 0.000 0.528 0.000 0.460 0.012 0.000
#> GSM494586     2  0.3595    0.51306 0.000 0.704 0.000 0.288 0.008 0.000
#> GSM494578     4  0.2897    0.71048 0.000 0.060 0.000 0.852 0.088 0.000
#> GSM494585     2  0.3887    0.45024 0.000 0.632 0.000 0.360 0.008 0.000
#> GSM494611     2  0.2697    0.61253 0.092 0.864 0.000 0.000 0.044 0.000
#> GSM494560     5  0.5258    0.10383 0.000 0.016 0.000 0.060 0.516 0.408
#> GSM494595     2  0.0363    0.66676 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM494570     6  0.3817    0.42479 0.000 0.000 0.000 0.028 0.252 0.720
#> GSM494597     3  0.2850    0.86655 0.000 0.000 0.856 0.112 0.016 0.016
#> GSM494607     1  0.2762    0.80846 0.860 0.092 0.000 0.000 0.048 0.000
#> GSM494561     6  0.4264    0.27067 0.000 0.000 0.000 0.028 0.352 0.620
#> GSM494569     6  0.4258    0.13845 0.000 0.000 0.000 0.016 0.468 0.516
#> GSM494592     1  0.2697    0.81010 0.864 0.092 0.000 0.000 0.044 0.000
#> GSM494577     2  0.4057    0.41429 0.000 0.600 0.000 0.388 0.012 0.000
#> GSM494588     6  0.4257    0.42609 0.028 0.000 0.000 0.020 0.240 0.712
#> GSM494590     3  0.0000    0.96231 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     2  0.6234    0.26177 0.204 0.476 0.000 0.020 0.300 0.000
#> GSM494608     2  0.2680    0.63371 0.000 0.868 0.000 0.056 0.076 0.000
#> GSM494606     2  0.5343    0.07546 0.408 0.484 0.000 0.000 0.108 0.000
#> GSM494574     2  0.0146    0.66820 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM494573     6  0.4886   -0.03173 0.000 0.004 0.000 0.048 0.468 0.480
#> GSM494566     5  0.3083    0.48842 0.000 0.000 0.000 0.040 0.828 0.132
#> GSM494601     4  0.5383   -0.13515 0.000 0.440 0.000 0.480 0.056 0.024
#> GSM494557     4  0.3071    0.54526 0.000 0.180 0.000 0.804 0.016 0.000
#> GSM494579     5  0.5549    0.28784 0.100 0.248 0.000 0.036 0.616 0.000
#> GSM494596     3  0.0000    0.96231 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0146    0.66820 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM494625     6  0.2784    0.57394 0.008 0.000 0.000 0.012 0.132 0.848
#> GSM494654     3  0.0000    0.96231 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494664     1  0.4167    0.41849 0.612 0.000 0.000 0.020 0.000 0.368
#> GSM494624     6  0.1204    0.62613 0.056 0.000 0.000 0.000 0.000 0.944
#> GSM494651     4  0.3651    0.67276 0.000 0.048 0.000 0.812 0.116 0.024
#> GSM494662     6  0.3535    0.50083 0.008 0.000 0.000 0.012 0.220 0.760
#> GSM494627     5  0.5279    0.44047 0.000 0.000 0.000 0.244 0.596 0.160
#> GSM494673     1  0.0260    0.89328 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM494649     6  0.1340    0.61922 0.008 0.000 0.000 0.004 0.040 0.948
#> GSM494658     1  0.2190    0.84069 0.900 0.060 0.000 0.000 0.040 0.000
#> GSM494653     1  0.0363    0.89423 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM494643     4  0.4406    0.13797 0.000 0.008 0.000 0.516 0.464 0.012
#> GSM494672     1  0.0405    0.89096 0.988 0.008 0.000 0.000 0.004 0.000
#> GSM494618     5  0.5242    0.06947 0.000 0.000 0.000 0.096 0.492 0.412
#> GSM494631     4  0.2740    0.71443 0.000 0.060 0.000 0.864 0.076 0.000
#> GSM494619     6  0.1556    0.62110 0.080 0.000 0.000 0.000 0.000 0.920
#> GSM494674     1  0.0405    0.89409 0.988 0.000 0.000 0.008 0.000 0.004
#> GSM494616     6  0.4264    0.32040 0.008 0.000 0.000 0.012 0.376 0.604
#> GSM494663     5  0.4646    0.30739 0.000 0.000 0.000 0.060 0.616 0.324
#> GSM494628     6  0.4405    0.10996 0.000 0.000 0.000 0.024 0.472 0.504
#> GSM494632     1  0.6229    0.08298 0.464 0.000 0.000 0.040 0.368 0.128
#> GSM494660     6  0.1340    0.61922 0.008 0.000 0.000 0.004 0.040 0.948
#> GSM494622     4  0.4122    0.12873 0.000 0.004 0.000 0.520 0.472 0.004
#> GSM494642     1  0.0146    0.89454 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM494647     1  0.0520    0.89361 0.984 0.000 0.000 0.008 0.008 0.000
#> GSM494659     1  0.0363    0.89423 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM494670     1  0.3054    0.77480 0.828 0.136 0.000 0.000 0.036 0.000
#> GSM494675     4  0.4452    0.45064 0.000 0.048 0.000 0.636 0.316 0.000
#> GSM494641     1  0.0000    0.89439 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     6  0.4878    0.08910 0.008 0.000 0.000 0.040 0.468 0.484
#> GSM494640     4  0.3032    0.70822 0.000 0.056 0.000 0.840 0.104 0.000
#> GSM494623     6  0.1556    0.62110 0.080 0.000 0.000 0.000 0.000 0.920
#> GSM494644     1  0.0725    0.89226 0.976 0.000 0.000 0.012 0.012 0.000
#> GSM494646     1  0.2164    0.85255 0.908 0.000 0.000 0.020 0.012 0.060
#> GSM494665     1  0.0777    0.88906 0.972 0.000 0.000 0.004 0.000 0.024
#> GSM494638     5  0.5208    0.39806 0.000 0.000 0.000 0.148 0.604 0.248
#> GSM494645     1  0.0870    0.89214 0.972 0.000 0.000 0.012 0.012 0.004
#> GSM494671     1  0.0000    0.89439 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0363    0.89423 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM494620     6  0.1556    0.62110 0.080 0.000 0.000 0.000 0.000 0.920
#> GSM494630     6  0.1285    0.62551 0.052 0.000 0.000 0.000 0.004 0.944
#> GSM494657     3  0.0000    0.96231 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0363    0.89423 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM494621     6  0.1556    0.62110 0.080 0.000 0.000 0.000 0.000 0.920
#> GSM494629     5  0.5259    0.44453 0.000 0.000 0.000 0.240 0.600 0.160
#> GSM494637     5  0.5279    0.44047 0.000 0.000 0.000 0.244 0.596 0.160
#> GSM494652     1  0.0363    0.89423 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM494648     6  0.1556    0.62110 0.080 0.000 0.000 0.000 0.000 0.920
#> GSM494650     3  0.4455    0.75035 0.000 0.000 0.732 0.184 0.060 0.024
#> GSM494669     1  0.0363    0.89423 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM494666     1  0.2301    0.83155 0.884 0.000 0.000 0.020 0.000 0.096
#> GSM494668     1  0.0000    0.89439 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     6  0.1049    0.61872 0.008 0.000 0.000 0.000 0.032 0.960
#> GSM494634     1  0.0000    0.89439 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.5850    0.34019 0.564 0.000 0.000 0.020 0.172 0.244
#> GSM494661     4  0.5360   -0.05690 0.000 0.412 0.000 0.508 0.056 0.024
#> GSM494617     6  0.4337    0.32268 0.008 0.000 0.000 0.016 0.372 0.604
#> GSM494626     6  0.4312    0.28535 0.008 0.000 0.000 0.012 0.396 0.584
#> GSM494656     3  0.0260    0.96082 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM494635     1  0.0767    0.89318 0.976 0.000 0.000 0.008 0.012 0.004

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-kmeans-collect-classes

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

test_to_known_factors(res)
#>              n disease.state(p)   age(p) other(p) individual(p) k
#> ATC:kmeans 120         1.05e-02 0.080773 4.26e-02       0.01630 2
#> ATC:kmeans 107         1.63e-07 0.022304 2.43e-05       0.04458 3
#> ATC:kmeans 110         1.38e-04 0.000444 2.47e-02       0.00217 4
#> ATC:kmeans 102         3.61e-07 0.007388 6.24e-06       0.00992 5
#> ATC:kmeans  72         2.39e-07 0.082830 4.48e-06       0.07407 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 51941 rows and 120 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk ATC-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.958       0.983         0.4786 0.519   0.519
#> 3 3 0.944           0.946       0.975         0.4034 0.769   0.571
#> 4 4 0.953           0.909       0.962         0.1073 0.896   0.697
#> 5 5 0.864           0.819       0.912         0.0642 0.925   0.717
#> 6 6 0.794           0.705       0.809         0.0381 0.949   0.766

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
#> GSM494565     2  0.5408      0.845 0.124 0.876
#> GSM494594     2  0.0000      0.973 0.000 1.000
#> GSM494604     1  0.0000      0.989 1.000 0.000
#> GSM494564     1  0.0000      0.989 1.000 0.000
#> GSM494591     2  0.0000      0.973 0.000 1.000
#> GSM494567     2  0.0000      0.973 0.000 1.000
#> GSM494602     1  0.0000      0.989 1.000 0.000
#> GSM494613     2  0.0000      0.973 0.000 1.000
#> GSM494589     1  0.9323      0.446 0.652 0.348
#> GSM494598     2  0.9833      0.281 0.424 0.576
#> GSM494593     1  0.0000      0.989 1.000 0.000
#> GSM494583     2  0.0000      0.973 0.000 1.000
#> GSM494612     2  0.0000      0.973 0.000 1.000
#> GSM494558     2  0.0000      0.973 0.000 1.000
#> GSM494556     2  0.0000      0.973 0.000 1.000
#> GSM494559     1  0.0000      0.989 1.000 0.000
#> GSM494571     2  0.0000      0.973 0.000 1.000
#> GSM494614     2  0.0672      0.966 0.008 0.992
#> GSM494603     1  0.0000      0.989 1.000 0.000
#> GSM494568     1  0.0000      0.989 1.000 0.000
#> GSM494572     2  0.0000      0.973 0.000 1.000
#> GSM494600     1  0.9427      0.416 0.640 0.360
#> GSM494562     2  0.0000      0.973 0.000 1.000
#> GSM494615     2  0.8327      0.643 0.264 0.736
#> GSM494582     2  0.0000      0.973 0.000 1.000
#> GSM494599     1  0.0000      0.989 1.000 0.000
#> GSM494610     2  0.0000      0.973 0.000 1.000
#> GSM494587     2  0.0000      0.973 0.000 1.000
#> GSM494581     2  0.0000      0.973 0.000 1.000
#> GSM494580     2  0.0000      0.973 0.000 1.000
#> GSM494563     1  0.0000      0.989 1.000 0.000
#> GSM494576     2  0.0000      0.973 0.000 1.000
#> GSM494605     1  0.0000      0.989 1.000 0.000
#> GSM494584     2  0.0000      0.973 0.000 1.000
#> GSM494586     2  0.0000      0.973 0.000 1.000
#> GSM494578     2  0.0000      0.973 0.000 1.000
#> GSM494585     2  0.0000      0.973 0.000 1.000
#> GSM494611     2  0.9775      0.315 0.412 0.588
#> GSM494560     1  0.3114      0.930 0.944 0.056
#> GSM494595     2  0.0000      0.973 0.000 1.000
#> GSM494570     1  0.0000      0.989 1.000 0.000
#> GSM494597     2  0.0000      0.973 0.000 1.000
#> GSM494607     1  0.0000      0.989 1.000 0.000
#> GSM494561     1  0.0000      0.989 1.000 0.000
#> GSM494569     1  0.0000      0.989 1.000 0.000
#> GSM494592     1  0.0000      0.989 1.000 0.000
#> GSM494577     2  0.0000      0.973 0.000 1.000
#> GSM494588     1  0.0000      0.989 1.000 0.000
#> GSM494590     2  0.0000      0.973 0.000 1.000
#> GSM494609     1  0.0000      0.989 1.000 0.000
#> GSM494608     2  0.0000      0.973 0.000 1.000
#> GSM494606     1  0.0000      0.989 1.000 0.000
#> GSM494574     2  0.0000      0.973 0.000 1.000
#> GSM494573     1  0.0000      0.989 1.000 0.000
#> GSM494566     1  0.0000      0.989 1.000 0.000
#> GSM494601     2  0.0000      0.973 0.000 1.000
#> GSM494557     2  0.0000      0.973 0.000 1.000
#> GSM494579     1  0.0000      0.989 1.000 0.000
#> GSM494596     2  0.0000      0.973 0.000 1.000
#> GSM494575     2  0.0000      0.973 0.000 1.000
#> GSM494625     1  0.0000      0.989 1.000 0.000
#> GSM494654     2  0.0000      0.973 0.000 1.000
#> GSM494664     1  0.0000      0.989 1.000 0.000
#> GSM494624     1  0.0000      0.989 1.000 0.000
#> GSM494651     2  0.0000      0.973 0.000 1.000
#> GSM494662     1  0.0000      0.989 1.000 0.000
#> GSM494627     1  0.0000      0.989 1.000 0.000
#> GSM494673     1  0.0000      0.989 1.000 0.000
#> GSM494649     1  0.0000      0.989 1.000 0.000
#> GSM494658     1  0.0000      0.989 1.000 0.000
#> GSM494653     1  0.0000      0.989 1.000 0.000
#> GSM494643     2  0.0000      0.973 0.000 1.000
#> GSM494672     1  0.0000      0.989 1.000 0.000
#> GSM494618     1  0.0000      0.989 1.000 0.000
#> GSM494631     2  0.0000      0.973 0.000 1.000
#> GSM494619     1  0.0000      0.989 1.000 0.000
#> GSM494674     1  0.0000      0.989 1.000 0.000
#> GSM494616     1  0.0000      0.989 1.000 0.000
#> GSM494663     1  0.0000      0.989 1.000 0.000
#> GSM494628     1  0.0000      0.989 1.000 0.000
#> GSM494632     1  0.0000      0.989 1.000 0.000
#> GSM494660     1  0.0000      0.989 1.000 0.000
#> GSM494622     2  0.0000      0.973 0.000 1.000
#> GSM494642     1  0.0000      0.989 1.000 0.000
#> GSM494647     1  0.0000      0.989 1.000 0.000
#> GSM494659     1  0.0000      0.989 1.000 0.000
#> GSM494670     1  0.0000      0.989 1.000 0.000
#> GSM494675     2  0.0000      0.973 0.000 1.000
#> GSM494641     1  0.0000      0.989 1.000 0.000
#> GSM494636     1  0.0000      0.989 1.000 0.000
#> GSM494640     2  0.0000      0.973 0.000 1.000
#> GSM494623     1  0.0000      0.989 1.000 0.000
#> GSM494644     1  0.0000      0.989 1.000 0.000
#> GSM494646     1  0.0000      0.989 1.000 0.000
#> GSM494665     1  0.0000      0.989 1.000 0.000
#> GSM494638     1  0.0000      0.989 1.000 0.000
#> GSM494645     1  0.0000      0.989 1.000 0.000
#> GSM494671     1  0.0000      0.989 1.000 0.000
#> GSM494655     1  0.0000      0.989 1.000 0.000
#> GSM494620     1  0.0000      0.989 1.000 0.000
#> GSM494630     1  0.0000      0.989 1.000 0.000
#> GSM494657     2  0.0000      0.973 0.000 1.000
#> GSM494667     1  0.0000      0.989 1.000 0.000
#> GSM494621     1  0.0000      0.989 1.000 0.000
#> GSM494629     1  0.0376      0.985 0.996 0.004
#> GSM494637     1  0.0000      0.989 1.000 0.000
#> GSM494652     1  0.0000      0.989 1.000 0.000
#> GSM494648     1  0.0000      0.989 1.000 0.000
#> GSM494650     2  0.0000      0.973 0.000 1.000
#> GSM494669     1  0.0000      0.989 1.000 0.000
#> GSM494666     1  0.0000      0.989 1.000 0.000
#> GSM494668     1  0.0000      0.989 1.000 0.000
#> GSM494633     1  0.0000      0.989 1.000 0.000
#> GSM494634     1  0.0000      0.989 1.000 0.000
#> GSM494639     1  0.0000      0.989 1.000 0.000
#> GSM494661     2  0.0000      0.973 0.000 1.000
#> GSM494617     1  0.0000      0.989 1.000 0.000
#> GSM494626     1  0.0000      0.989 1.000 0.000
#> GSM494656     2  0.0000      0.973 0.000 1.000
#> GSM494635     1  0.0000      0.989 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM494565     2  0.6154      0.326 0.000 0.592 0.408
#> GSM494594     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494604     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494564     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494591     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494567     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494602     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494613     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494589     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494598     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494593     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494583     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494612     1  0.4605      0.718 0.796 0.204 0.000
#> GSM494558     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494556     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494559     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494571     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494614     2  0.4178      0.783 0.000 0.828 0.172
#> GSM494603     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494568     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494572     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494600     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494562     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494615     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494582     2  0.5882      0.517 0.348 0.652 0.000
#> GSM494599     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494610     2  0.4399      0.780 0.188 0.812 0.000
#> GSM494587     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494581     2  0.0424      0.949 0.008 0.992 0.000
#> GSM494580     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494563     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494576     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494605     1  0.2711      0.896 0.912 0.000 0.088
#> GSM494584     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494586     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494578     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494585     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494611     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494560     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494595     2  0.4605      0.763 0.204 0.796 0.000
#> GSM494570     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494597     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494607     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494561     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494569     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494592     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494577     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494588     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494590     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494609     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494608     2  0.3267      0.862 0.116 0.884 0.000
#> GSM494606     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494574     2  0.4399      0.780 0.188 0.812 0.000
#> GSM494573     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494566     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494601     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494557     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494579     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494596     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494575     2  0.4605      0.761 0.204 0.796 0.000
#> GSM494625     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494654     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494664     1  0.5859      0.499 0.656 0.000 0.344
#> GSM494624     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494651     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494662     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494627     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494673     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494649     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494658     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494653     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494643     2  0.1411      0.927 0.000 0.964 0.036
#> GSM494672     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494618     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494631     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494619     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494674     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494616     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494663     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494628     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494632     1  0.2066      0.922 0.940 0.000 0.060
#> GSM494660     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494622     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494642     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494647     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494659     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494670     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494675     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494641     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494636     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494640     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494623     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494644     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494646     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494665     1  0.1753      0.932 0.952 0.000 0.048
#> GSM494638     3  0.0424      0.992 0.008 0.000 0.992
#> GSM494645     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494671     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494655     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494620     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494630     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494657     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494667     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494621     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494629     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494637     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494652     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494648     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494650     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494669     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494666     1  0.2711      0.896 0.912 0.000 0.088
#> GSM494668     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494633     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.969 1.000 0.000 0.000
#> GSM494639     1  0.5291      0.648 0.732 0.000 0.268
#> GSM494661     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494617     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494626     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494656     2  0.0000      0.955 0.000 1.000 0.000
#> GSM494635     1  0.0000      0.969 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
#> GSM494565     2  0.1940    0.83450 0.000 0.924 0.000 0.076
#> GSM494594     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494604     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494564     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494591     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494567     3  0.0188    0.94881 0.000 0.000 0.996 0.004
#> GSM494602     2  0.0188    0.88173 0.004 0.996 0.000 0.000
#> GSM494613     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494589     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494598     2  0.0000    0.88319 0.000 1.000 0.000 0.000
#> GSM494593     2  0.0000    0.88319 0.000 1.000 0.000 0.000
#> GSM494583     3  0.3528    0.72063 0.000 0.192 0.808 0.000
#> GSM494612     2  0.0000    0.88319 0.000 1.000 0.000 0.000
#> GSM494558     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494556     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494559     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494571     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494614     2  0.1557    0.84919 0.000 0.944 0.000 0.056
#> GSM494603     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494568     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494572     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494600     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494562     2  0.4761    0.43345 0.000 0.628 0.372 0.000
#> GSM494615     4  0.0707    0.95332 0.000 0.000 0.020 0.980
#> GSM494582     2  0.0000    0.88319 0.000 1.000 0.000 0.000
#> GSM494599     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494610     2  0.0000    0.88319 0.000 1.000 0.000 0.000
#> GSM494587     3  0.4888    0.21094 0.000 0.412 0.588 0.000
#> GSM494581     2  0.0000    0.88319 0.000 1.000 0.000 0.000
#> GSM494580     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494563     4  0.1118    0.94978 0.036 0.000 0.000 0.964
#> GSM494576     3  0.4985    0.00611 0.000 0.468 0.532 0.000
#> GSM494605     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494584     3  0.2408    0.84330 0.000 0.104 0.896 0.000
#> GSM494586     2  0.4761    0.43345 0.000 0.628 0.372 0.000
#> GSM494578     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494585     2  0.4925    0.29648 0.000 0.572 0.428 0.000
#> GSM494611     2  0.0000    0.88319 0.000 1.000 0.000 0.000
#> GSM494560     4  0.1022    0.94692 0.000 0.032 0.000 0.968
#> GSM494595     2  0.0000    0.88319 0.000 1.000 0.000 0.000
#> GSM494570     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494597     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494607     1  0.0188    0.99219 0.996 0.004 0.000 0.000
#> GSM494561     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494569     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494592     1  0.0817    0.97463 0.976 0.024 0.000 0.000
#> GSM494577     2  0.4948    0.26123 0.000 0.560 0.440 0.000
#> GSM494588     4  0.1557    0.93818 0.056 0.000 0.000 0.944
#> GSM494590     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494609     2  0.0188    0.88173 0.004 0.996 0.000 0.000
#> GSM494608     2  0.0000    0.88319 0.000 1.000 0.000 0.000
#> GSM494606     2  0.0188    0.88173 0.004 0.996 0.000 0.000
#> GSM494574     2  0.0000    0.88319 0.000 1.000 0.000 0.000
#> GSM494573     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494566     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494601     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494557     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494579     2  0.4761    0.39812 0.372 0.628 0.000 0.000
#> GSM494596     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494575     2  0.0000    0.88319 0.000 1.000 0.000 0.000
#> GSM494625     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494664     1  0.0817    0.96882 0.976 0.000 0.000 0.024
#> GSM494624     4  0.1557    0.93818 0.056 0.000 0.000 0.944
#> GSM494651     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494662     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494627     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494673     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494649     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494658     1  0.0336    0.98869 0.992 0.008 0.000 0.000
#> GSM494653     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494643     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494672     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494618     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494631     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494619     4  0.2589    0.88395 0.116 0.000 0.000 0.884
#> GSM494674     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494616     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494663     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494628     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494632     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494660     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494622     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494642     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494647     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494659     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494670     1  0.1716    0.92806 0.936 0.064 0.000 0.000
#> GSM494675     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494641     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494636     4  0.2081    0.91617 0.084 0.000 0.000 0.916
#> GSM494640     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494623     4  0.2011    0.91998 0.080 0.000 0.000 0.920
#> GSM494644     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494646     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494665     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494638     4  0.4585    0.54443 0.332 0.000 0.000 0.668
#> GSM494645     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494671     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494655     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494620     4  0.2011    0.91998 0.080 0.000 0.000 0.920
#> GSM494630     4  0.1557    0.93818 0.056 0.000 0.000 0.944
#> GSM494657     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494667     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494621     4  0.1792    0.92948 0.068 0.000 0.000 0.932
#> GSM494629     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494637     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494652     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494648     4  0.2011    0.91998 0.080 0.000 0.000 0.920
#> GSM494650     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494669     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494666     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494668     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494633     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494639     1  0.0000    0.99548 1.000 0.000 0.000 0.000
#> GSM494661     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494617     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494626     4  0.0000    0.96734 0.000 0.000 0.000 1.000
#> GSM494656     3  0.0000    0.95302 0.000 0.000 1.000 0.000
#> GSM494635     1  0.0000    0.99548 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
#> GSM494565     5  0.3561      0.611 0.000 0.260 0.000 0.000 0.740
#> GSM494594     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494604     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494564     5  0.0000      0.867 0.000 0.000 0.000 0.000 1.000
#> GSM494591     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494567     3  0.0162      0.971 0.000 0.000 0.996 0.004 0.000
#> GSM494602     2  0.3143      0.640 0.204 0.796 0.000 0.000 0.000
#> GSM494613     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494589     5  0.0000      0.867 0.000 0.000 0.000 0.000 1.000
#> GSM494598     2  0.0000      0.763 0.000 1.000 0.000 0.000 0.000
#> GSM494593     2  0.2377      0.694 0.128 0.872 0.000 0.000 0.000
#> GSM494583     3  0.3274      0.689 0.000 0.220 0.780 0.000 0.000
#> GSM494612     2  0.0000      0.763 0.000 1.000 0.000 0.000 0.000
#> GSM494558     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494556     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494559     5  0.0000      0.867 0.000 0.000 0.000 0.000 1.000
#> GSM494571     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494614     5  0.3837      0.537 0.000 0.308 0.000 0.000 0.692
#> GSM494603     5  0.3074      0.717 0.000 0.000 0.000 0.196 0.804
#> GSM494568     4  0.0162      0.798 0.000 0.000 0.000 0.996 0.004
#> GSM494572     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494600     5  0.0000      0.867 0.000 0.000 0.000 0.000 1.000
#> GSM494562     2  0.3730      0.589 0.000 0.712 0.288 0.000 0.000
#> GSM494615     5  0.3913      0.579 0.000 0.000 0.000 0.324 0.676
#> GSM494582     2  0.0000      0.763 0.000 1.000 0.000 0.000 0.000
#> GSM494599     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494610     2  0.0000      0.763 0.000 1.000 0.000 0.000 0.000
#> GSM494587     2  0.4304      0.187 0.000 0.516 0.484 0.000 0.000
#> GSM494581     2  0.0000      0.763 0.000 1.000 0.000 0.000 0.000
#> GSM494580     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494563     5  0.0000      0.867 0.000 0.000 0.000 0.000 1.000
#> GSM494576     2  0.4287      0.262 0.000 0.540 0.460 0.000 0.000
#> GSM494605     1  0.0510      0.965 0.984 0.000 0.000 0.016 0.000
#> GSM494584     3  0.2891      0.764 0.000 0.176 0.824 0.000 0.000
#> GSM494586     2  0.3774      0.579 0.000 0.704 0.296 0.000 0.000
#> GSM494578     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494585     2  0.4192      0.401 0.000 0.596 0.404 0.000 0.000
#> GSM494611     2  0.0000      0.763 0.000 1.000 0.000 0.000 0.000
#> GSM494560     5  0.0000      0.867 0.000 0.000 0.000 0.000 1.000
#> GSM494595     2  0.0000      0.763 0.000 1.000 0.000 0.000 0.000
#> GSM494570     5  0.0000      0.867 0.000 0.000 0.000 0.000 1.000
#> GSM494597     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494607     1  0.0162      0.975 0.996 0.004 0.000 0.000 0.000
#> GSM494561     5  0.0162      0.863 0.000 0.000 0.000 0.004 0.996
#> GSM494569     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494592     1  0.0703      0.958 0.976 0.024 0.000 0.000 0.000
#> GSM494577     2  0.4219      0.374 0.000 0.584 0.416 0.000 0.000
#> GSM494588     5  0.0000      0.867 0.000 0.000 0.000 0.000 1.000
#> GSM494590     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494609     2  0.2891      0.664 0.176 0.824 0.000 0.000 0.000
#> GSM494608     2  0.0000      0.763 0.000 1.000 0.000 0.000 0.000
#> GSM494606     2  0.3003      0.652 0.188 0.812 0.000 0.000 0.000
#> GSM494574     2  0.0000      0.763 0.000 1.000 0.000 0.000 0.000
#> GSM494573     5  0.0000      0.867 0.000 0.000 0.000 0.000 1.000
#> GSM494566     5  0.4235      0.431 0.000 0.000 0.000 0.424 0.576
#> GSM494601     3  0.2605      0.806 0.000 0.148 0.852 0.000 0.000
#> GSM494557     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494579     2  0.6684      0.180 0.372 0.392 0.000 0.000 0.236
#> GSM494596     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494575     2  0.0000      0.763 0.000 1.000 0.000 0.000 0.000
#> GSM494625     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494654     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494664     1  0.3274      0.687 0.780 0.000 0.000 0.220 0.000
#> GSM494624     4  0.5322      0.642 0.072 0.000 0.000 0.608 0.320
#> GSM494651     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494662     4  0.2377      0.758 0.000 0.000 0.000 0.872 0.128
#> GSM494627     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494673     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.3796      0.680 0.000 0.000 0.000 0.700 0.300
#> GSM494658     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494643     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494672     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494631     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494619     4  0.5425      0.635 0.080 0.000 0.000 0.600 0.320
#> GSM494674     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494663     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494628     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494632     1  0.2852      0.767 0.828 0.000 0.000 0.172 0.000
#> GSM494660     4  0.3774      0.683 0.000 0.000 0.000 0.704 0.296
#> GSM494622     3  0.0794      0.947 0.000 0.000 0.972 0.028 0.000
#> GSM494642     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.1792      0.890 0.916 0.084 0.000 0.000 0.000
#> GSM494675     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494641     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494640     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494623     4  0.5375      0.639 0.076 0.000 0.000 0.604 0.320
#> GSM494644     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494646     1  0.0162      0.975 0.996 0.000 0.000 0.004 0.000
#> GSM494665     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494638     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494645     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494671     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494620     4  0.5375      0.639 0.076 0.000 0.000 0.604 0.320
#> GSM494630     4  0.5160      0.634 0.056 0.000 0.000 0.608 0.336
#> GSM494657     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494621     4  0.5322      0.642 0.072 0.000 0.000 0.608 0.320
#> GSM494629     4  0.0162      0.798 0.000 0.000 0.000 0.996 0.004
#> GSM494637     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494652     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494648     4  0.5375      0.639 0.076 0.000 0.000 0.604 0.320
#> GSM494650     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494669     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0510      0.965 0.984 0.000 0.000 0.016 0.000
#> GSM494668     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494633     4  0.3932      0.658 0.000 0.000 0.000 0.672 0.328
#> GSM494634     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000
#> GSM494639     4  0.4300      0.172 0.476 0.000 0.000 0.524 0.000
#> GSM494661     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494617     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494626     4  0.0000      0.800 0.000 0.000 0.000 1.000 0.000
#> GSM494656     3  0.0000      0.975 0.000 0.000 1.000 0.000 0.000
#> GSM494635     1  0.0000      0.978 1.000 0.000 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM494565     5  0.3555      0.640 0.000 0.176 0.000 0.000 0.780 0.044
#> GSM494594     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.2135      0.712 0.872 0.000 0.000 0.000 0.000 0.128
#> GSM494564     5  0.1814      0.792 0.000 0.000 0.000 0.100 0.900 0.000
#> GSM494591     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     3  0.3063      0.804 0.000 0.000 0.840 0.000 0.092 0.068
#> GSM494602     6  0.5594      0.662 0.272 0.168 0.000 0.000 0.004 0.556
#> GSM494613     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494589     5  0.0260      0.818 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM494598     6  0.3828      0.310 0.000 0.440 0.000 0.000 0.000 0.560
#> GSM494593     6  0.5628      0.593 0.156 0.276 0.000 0.000 0.008 0.560
#> GSM494583     2  0.3428      0.680 0.000 0.696 0.304 0.000 0.000 0.000
#> GSM494612     2  0.2300      0.645 0.000 0.856 0.000 0.000 0.000 0.144
#> GSM494558     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494556     3  0.0713      0.958 0.000 0.028 0.972 0.000 0.000 0.000
#> GSM494559     5  0.0146      0.820 0.000 0.000 0.000 0.004 0.996 0.000
#> GSM494571     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494614     5  0.4352      0.487 0.000 0.280 0.000 0.000 0.668 0.052
#> GSM494603     5  0.5253      0.432 0.000 0.000 0.000 0.192 0.608 0.200
#> GSM494568     4  0.3789      0.589 0.000 0.000 0.000 0.584 0.000 0.416
#> GSM494572     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494600     5  0.0260      0.818 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM494562     2  0.2260      0.746 0.000 0.860 0.140 0.000 0.000 0.000
#> GSM494615     5  0.5922      0.204 0.000 0.000 0.000 0.252 0.464 0.284
#> GSM494582     2  0.1957      0.684 0.000 0.888 0.000 0.000 0.000 0.112
#> GSM494599     1  0.3869     -0.360 0.500 0.000 0.000 0.000 0.000 0.500
#> GSM494610     2  0.1814      0.695 0.000 0.900 0.000 0.000 0.000 0.100
#> GSM494587     2  0.3198      0.716 0.000 0.740 0.260 0.000 0.000 0.000
#> GSM494581     2  0.1267      0.706 0.000 0.940 0.000 0.000 0.000 0.060
#> GSM494580     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494563     5  0.1267      0.807 0.000 0.000 0.000 0.060 0.940 0.000
#> GSM494576     2  0.3175      0.718 0.000 0.744 0.256 0.000 0.000 0.000
#> GSM494605     1  0.2597      0.709 0.824 0.000 0.000 0.176 0.000 0.000
#> GSM494584     2  0.3563      0.634 0.000 0.664 0.336 0.000 0.000 0.000
#> GSM494586     2  0.2300      0.747 0.000 0.856 0.144 0.000 0.000 0.000
#> GSM494578     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494585     2  0.2996      0.731 0.000 0.772 0.228 0.000 0.000 0.000
#> GSM494611     6  0.3828      0.310 0.000 0.440 0.000 0.000 0.000 0.560
#> GSM494560     5  0.0146      0.819 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM494595     2  0.1814      0.695 0.000 0.900 0.000 0.000 0.000 0.100
#> GSM494570     5  0.2048      0.776 0.000 0.000 0.000 0.120 0.880 0.000
#> GSM494597     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494607     6  0.3864      0.333 0.480 0.000 0.000 0.000 0.000 0.520
#> GSM494561     5  0.1863      0.790 0.000 0.000 0.000 0.104 0.896 0.000
#> GSM494569     4  0.3717      0.600 0.000 0.000 0.000 0.616 0.000 0.384
#> GSM494592     6  0.3993      0.344 0.476 0.004 0.000 0.000 0.000 0.520
#> GSM494577     2  0.2793      0.740 0.000 0.800 0.200 0.000 0.000 0.000
#> GSM494588     5  0.2003      0.780 0.000 0.000 0.000 0.116 0.884 0.000
#> GSM494590     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     6  0.5739      0.655 0.232 0.204 0.000 0.000 0.008 0.556
#> GSM494608     2  0.1444      0.704 0.000 0.928 0.000 0.000 0.000 0.072
#> GSM494606     6  0.5643      0.663 0.248 0.192 0.000 0.000 0.004 0.556
#> GSM494574     2  0.1765      0.696 0.000 0.904 0.000 0.000 0.000 0.096
#> GSM494573     5  0.0146      0.820 0.000 0.000 0.000 0.004 0.996 0.000
#> GSM494566     6  0.5750     -0.369 0.000 0.000 0.000 0.336 0.184 0.480
#> GSM494601     2  0.3515      0.654 0.000 0.676 0.324 0.000 0.000 0.000
#> GSM494557     3  0.0260      0.975 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM494579     6  0.6246      0.578 0.308 0.064 0.000 0.000 0.108 0.520
#> GSM494596     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.1814      0.695 0.000 0.900 0.000 0.000 0.000 0.100
#> GSM494625     4  0.1501      0.615 0.000 0.000 0.000 0.924 0.000 0.076
#> GSM494654     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494664     1  0.3923      0.481 0.620 0.000 0.000 0.372 0.008 0.000
#> GSM494624     4  0.4638      0.464 0.096 0.000 0.000 0.672 0.232 0.000
#> GSM494651     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494662     4  0.1285      0.584 0.000 0.000 0.000 0.944 0.052 0.004
#> GSM494627     4  0.3782      0.591 0.000 0.000 0.000 0.588 0.000 0.412
#> GSM494673     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.2912      0.507 0.000 0.000 0.000 0.784 0.216 0.000
#> GSM494658     1  0.2527      0.653 0.832 0.000 0.000 0.000 0.000 0.168
#> GSM494653     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     3  0.1124      0.947 0.000 0.000 0.956 0.008 0.000 0.036
#> GSM494672     1  0.1327      0.785 0.936 0.000 0.000 0.000 0.000 0.064
#> GSM494618     4  0.3774      0.593 0.000 0.000 0.000 0.592 0.000 0.408
#> GSM494631     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494619     4  0.4638      0.464 0.096 0.000 0.000 0.672 0.232 0.000
#> GSM494674     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.3706      0.601 0.000 0.000 0.000 0.620 0.000 0.380
#> GSM494663     4  0.3782      0.591 0.000 0.000 0.000 0.588 0.000 0.412
#> GSM494628     4  0.3774      0.593 0.000 0.000 0.000 0.592 0.000 0.408
#> GSM494632     1  0.4460      0.519 0.644 0.000 0.000 0.304 0.000 0.052
#> GSM494660     4  0.2912      0.507 0.000 0.000 0.000 0.784 0.216 0.000
#> GSM494622     3  0.2170      0.865 0.000 0.000 0.888 0.012 0.000 0.100
#> GSM494642     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0260      0.842 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM494659     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.2431      0.702 0.860 0.008 0.000 0.000 0.000 0.132
#> GSM494675     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494641     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.2312      0.613 0.012 0.000 0.000 0.876 0.000 0.112
#> GSM494640     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494623     4  0.4638      0.464 0.096 0.000 0.000 0.672 0.232 0.000
#> GSM494644     1  0.0458      0.839 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM494646     1  0.3606      0.608 0.728 0.000 0.000 0.256 0.000 0.016
#> GSM494665     1  0.2048      0.759 0.880 0.000 0.000 0.120 0.000 0.000
#> GSM494638     4  0.2531      0.614 0.012 0.000 0.000 0.856 0.000 0.132
#> GSM494645     1  0.0458      0.839 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM494671     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     4  0.4638      0.464 0.096 0.000 0.000 0.672 0.232 0.000
#> GSM494630     4  0.4596      0.459 0.088 0.000 0.000 0.672 0.240 0.000
#> GSM494657     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     4  0.4638      0.464 0.096 0.000 0.000 0.672 0.232 0.000
#> GSM494629     4  0.3782      0.591 0.000 0.000 0.000 0.588 0.000 0.412
#> GSM494637     4  0.3782      0.591 0.000 0.000 0.000 0.588 0.000 0.412
#> GSM494652     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     4  0.4638      0.464 0.096 0.000 0.000 0.672 0.232 0.000
#> GSM494650     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494669     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.3266      0.610 0.728 0.000 0.000 0.272 0.000 0.000
#> GSM494668     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     4  0.3076      0.488 0.000 0.000 0.000 0.760 0.240 0.000
#> GSM494634     1  0.0000      0.845 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     1  0.4131      0.457 0.600 0.000 0.000 0.384 0.000 0.016
#> GSM494661     3  0.1267      0.926 0.000 0.060 0.940 0.000 0.000 0.000
#> GSM494617     4  0.3288      0.613 0.000 0.000 0.000 0.724 0.000 0.276
#> GSM494626     4  0.3672      0.604 0.000 0.000 0.000 0.632 0.000 0.368
#> GSM494656     3  0.0000      0.981 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494635     1  0.0405      0.841 0.988 0.000 0.000 0.008 0.000 0.004

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 3)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-skmeans-collect-classes

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

test_to_known_factors(res)
#>               n disease.state(p) age(p) other(p) individual(p) k
#> ATC:skmeans 116         7.11e-06 0.5512 1.57e-03       0.20779 2
#> ATC:skmeans 118         5.54e-04 0.0368 4.60e-02       0.00177 3
#> ATC:skmeans 113         3.40e-07 0.0333 3.62e-05       0.01305 4
#> ATC:skmeans 113         1.02e-12 0.3047 1.99e-08       0.27779 5
#> ATC:skmeans 101         4.89e-12 0.1879 5.82e-09       0.20886 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 51941 rows and 120 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 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 ATC-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.988       0.996         0.1759 0.832   0.832
#> 3 3 0.783           0.842       0.939         2.1103 0.649   0.578
#> 4 4 0.800           0.835       0.935         0.2775 0.815   0.615
#> 5 5 0.890           0.871       0.945         0.1081 0.910   0.706
#> 6 6 0.935           0.896       0.957         0.0456 0.957   0.811

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

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
#> GSM494565     1   0.000      0.995 1.000 0.000
#> GSM494594     2   0.000      1.000 0.000 1.000
#> GSM494604     1   0.000      0.995 1.000 0.000
#> GSM494564     1   0.000      0.995 1.000 0.000
#> GSM494591     2   0.000      1.000 0.000 1.000
#> GSM494567     1   0.000      0.995 1.000 0.000
#> GSM494602     1   0.000      0.995 1.000 0.000
#> GSM494613     1   0.000      0.995 1.000 0.000
#> GSM494589     1   0.000      0.995 1.000 0.000
#> GSM494598     1   0.000      0.995 1.000 0.000
#> GSM494593     1   0.000      0.995 1.000 0.000
#> GSM494583     1   0.000      0.995 1.000 0.000
#> GSM494612     1   0.000      0.995 1.000 0.000
#> GSM494558     1   0.000      0.995 1.000 0.000
#> GSM494556     1   0.000      0.995 1.000 0.000
#> GSM494559     1   0.000      0.995 1.000 0.000
#> GSM494571     2   0.000      1.000 0.000 1.000
#> GSM494614     1   0.000      0.995 1.000 0.000
#> GSM494603     1   0.000      0.995 1.000 0.000
#> GSM494568     1   0.000      0.995 1.000 0.000
#> GSM494572     2   0.000      1.000 0.000 1.000
#> GSM494600     1   0.000      0.995 1.000 0.000
#> GSM494562     1   0.000      0.995 1.000 0.000
#> GSM494615     1   0.000      0.995 1.000 0.000
#> GSM494582     1   0.000      0.995 1.000 0.000
#> GSM494599     1   0.000      0.995 1.000 0.000
#> GSM494610     1   0.000      0.995 1.000 0.000
#> GSM494587     1   0.000      0.995 1.000 0.000
#> GSM494581     1   0.000      0.995 1.000 0.000
#> GSM494580     1   0.000      0.995 1.000 0.000
#> GSM494563     1   0.000      0.995 1.000 0.000
#> GSM494576     1   0.000      0.995 1.000 0.000
#> GSM494605     1   0.000      0.995 1.000 0.000
#> GSM494584     1   0.000      0.995 1.000 0.000
#> GSM494586     1   0.000      0.995 1.000 0.000
#> GSM494578     1   0.000      0.995 1.000 0.000
#> GSM494585     1   0.000      0.995 1.000 0.000
#> GSM494611     1   0.000      0.995 1.000 0.000
#> GSM494560     1   0.000      0.995 1.000 0.000
#> GSM494595     1   0.000      0.995 1.000 0.000
#> GSM494570     1   0.000      0.995 1.000 0.000
#> GSM494597     2   0.000      1.000 0.000 1.000
#> GSM494607     1   0.000      0.995 1.000 0.000
#> GSM494561     1   0.000      0.995 1.000 0.000
#> GSM494569     1   0.000      0.995 1.000 0.000
#> GSM494592     1   0.000      0.995 1.000 0.000
#> GSM494577     1   0.000      0.995 1.000 0.000
#> GSM494588     1   0.000      0.995 1.000 0.000
#> GSM494590     2   0.000      1.000 0.000 1.000
#> GSM494609     1   0.000      0.995 1.000 0.000
#> GSM494608     1   0.000      0.995 1.000 0.000
#> GSM494606     1   0.000      0.995 1.000 0.000
#> GSM494574     1   0.000      0.995 1.000 0.000
#> GSM494573     1   0.000      0.995 1.000 0.000
#> GSM494566     1   0.000      0.995 1.000 0.000
#> GSM494601     1   0.992      0.192 0.552 0.448
#> GSM494557     1   0.000      0.995 1.000 0.000
#> GSM494579     1   0.000      0.995 1.000 0.000
#> GSM494596     2   0.000      1.000 0.000 1.000
#> GSM494575     1   0.000      0.995 1.000 0.000
#> GSM494625     1   0.000      0.995 1.000 0.000
#> GSM494654     2   0.000      1.000 0.000 1.000
#> GSM494664     1   0.000      0.995 1.000 0.000
#> GSM494624     1   0.000      0.995 1.000 0.000
#> GSM494651     1   0.000      0.995 1.000 0.000
#> GSM494662     1   0.000      0.995 1.000 0.000
#> GSM494627     1   0.000      0.995 1.000 0.000
#> GSM494673     1   0.000      0.995 1.000 0.000
#> GSM494649     1   0.000      0.995 1.000 0.000
#> GSM494658     1   0.000      0.995 1.000 0.000
#> GSM494653     1   0.000      0.995 1.000 0.000
#> GSM494643     1   0.000      0.995 1.000 0.000
#> GSM494672     1   0.000      0.995 1.000 0.000
#> GSM494618     1   0.000      0.995 1.000 0.000
#> GSM494631     1   0.000      0.995 1.000 0.000
#> GSM494619     1   0.000      0.995 1.000 0.000
#> GSM494674     1   0.000      0.995 1.000 0.000
#> GSM494616     1   0.000      0.995 1.000 0.000
#> GSM494663     1   0.000      0.995 1.000 0.000
#> GSM494628     1   0.000      0.995 1.000 0.000
#> GSM494632     1   0.000      0.995 1.000 0.000
#> GSM494660     1   0.000      0.995 1.000 0.000
#> GSM494622     1   0.000      0.995 1.000 0.000
#> GSM494642     1   0.000      0.995 1.000 0.000
#> GSM494647     1   0.000      0.995 1.000 0.000
#> GSM494659     1   0.000      0.995 1.000 0.000
#> GSM494670     1   0.000      0.995 1.000 0.000
#> GSM494675     1   0.000      0.995 1.000 0.000
#> GSM494641     1   0.000      0.995 1.000 0.000
#> GSM494636     1   0.000      0.995 1.000 0.000
#> GSM494640     1   0.000      0.995 1.000 0.000
#> GSM494623     1   0.000      0.995 1.000 0.000
#> GSM494644     1   0.000      0.995 1.000 0.000
#> GSM494646     1   0.000      0.995 1.000 0.000
#> GSM494665     1   0.000      0.995 1.000 0.000
#> GSM494638     1   0.000      0.995 1.000 0.000
#> GSM494645     1   0.000      0.995 1.000 0.000
#> GSM494671     1   0.000      0.995 1.000 0.000
#> GSM494655     1   0.000      0.995 1.000 0.000
#> GSM494620     1   0.000      0.995 1.000 0.000
#> GSM494630     1   0.000      0.995 1.000 0.000
#> GSM494657     2   0.000      1.000 0.000 1.000
#> GSM494667     1   0.000      0.995 1.000 0.000
#> GSM494621     1   0.000      0.995 1.000 0.000
#> GSM494629     1   0.000      0.995 1.000 0.000
#> GSM494637     1   0.000      0.995 1.000 0.000
#> GSM494652     1   0.000      0.995 1.000 0.000
#> GSM494648     1   0.000      0.995 1.000 0.000
#> GSM494650     2   0.000      1.000 0.000 1.000
#> GSM494669     1   0.000      0.995 1.000 0.000
#> GSM494666     1   0.000      0.995 1.000 0.000
#> GSM494668     1   0.000      0.995 1.000 0.000
#> GSM494633     1   0.000      0.995 1.000 0.000
#> GSM494634     1   0.000      0.995 1.000 0.000
#> GSM494639     1   0.000      0.995 1.000 0.000
#> GSM494661     1   0.402      0.910 0.920 0.080
#> GSM494617     1   0.000      0.995 1.000 0.000
#> GSM494626     1   0.000      0.995 1.000 0.000
#> GSM494656     2   0.000      1.000 0.000 1.000
#> GSM494635     1   0.000      0.995 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
#> GSM494565     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494594     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494604     1  0.0424      0.935 0.992 0.008 0.000
#> GSM494564     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494591     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494567     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494602     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494613     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494589     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494598     2  0.6252      0.277 0.444 0.556 0.000
#> GSM494593     2  0.6180      0.352 0.416 0.584 0.000
#> GSM494583     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494612     2  0.6180      0.352 0.416 0.584 0.000
#> GSM494558     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494556     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494559     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494571     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494614     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494603     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494568     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494572     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494600     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494562     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494615     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494582     2  0.6180      0.352 0.416 0.584 0.000
#> GSM494599     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494610     2  0.5905      0.489 0.352 0.648 0.000
#> GSM494587     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494581     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494580     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494563     2  0.5327      0.615 0.272 0.728 0.000
#> GSM494576     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494605     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494584     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494586     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494578     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494585     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494611     2  0.6299      0.179 0.476 0.524 0.000
#> GSM494560     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494595     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494570     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494597     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494607     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494561     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494569     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494592     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494577     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494588     1  0.5138      0.590 0.748 0.252 0.000
#> GSM494590     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494609     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494608     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494606     2  0.6180      0.352 0.416 0.584 0.000
#> GSM494574     2  0.5882      0.496 0.348 0.652 0.000
#> GSM494573     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494566     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494601     2  0.6260      0.191 0.000 0.552 0.448
#> GSM494557     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494579     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494596     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494575     2  0.5882      0.496 0.348 0.652 0.000
#> GSM494625     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494654     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494664     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494624     1  0.5216      0.582 0.740 0.260 0.000
#> GSM494651     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494662     2  0.5397      0.586 0.280 0.720 0.000
#> GSM494627     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494673     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494649     2  0.6140      0.314 0.404 0.596 0.000
#> GSM494658     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494653     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494643     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494672     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494618     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494631     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494619     1  0.4346      0.702 0.816 0.184 0.000
#> GSM494674     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494616     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494663     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494628     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494632     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494660     2  0.5138      0.632 0.252 0.748 0.000
#> GSM494622     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494642     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494647     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494659     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494670     1  0.6140      0.221 0.596 0.404 0.000
#> GSM494675     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494641     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494636     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494640     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494623     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494644     2  0.5254      0.634 0.264 0.736 0.000
#> GSM494646     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494665     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494638     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494645     2  0.3192      0.813 0.112 0.888 0.000
#> GSM494671     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494655     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494620     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494630     2  0.6267      0.173 0.452 0.548 0.000
#> GSM494657     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494667     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494621     1  0.1964      0.877 0.944 0.056 0.000
#> GSM494629     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494637     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494652     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494648     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494650     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494669     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494666     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494668     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494633     2  0.0747      0.893 0.016 0.984 0.000
#> GSM494634     1  0.0000      0.944 1.000 0.000 0.000
#> GSM494639     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494661     2  0.2537      0.840 0.000 0.920 0.080
#> GSM494617     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494626     2  0.0000      0.905 0.000 1.000 0.000
#> GSM494656     3  0.0000      1.000 0.000 0.000 1.000
#> GSM494635     2  0.0000      0.905 0.000 1.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
#> GSM494565     4  0.0336      0.911 0.000 0.008 0.000 0.992
#> GSM494594     3  0.0000      0.990 0.000 0.000 1.000 0.000
#> GSM494604     1  0.0336      0.931 0.992 0.000 0.000 0.008
#> GSM494564     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494591     3  0.0000      0.990 0.000 0.000 1.000 0.000
#> GSM494567     4  0.3873      0.644 0.000 0.228 0.000 0.772
#> GSM494602     1  0.3400      0.749 0.820 0.180 0.000 0.000
#> GSM494613     2  0.4072      0.673 0.000 0.748 0.000 0.252
#> GSM494589     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494598     2  0.4164      0.606 0.000 0.736 0.000 0.264
#> GSM494593     4  0.4252      0.576 0.004 0.252 0.000 0.744
#> GSM494583     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494612     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494558     2  0.4103      0.669 0.000 0.744 0.000 0.256
#> GSM494556     4  0.4008      0.625 0.000 0.244 0.000 0.756
#> GSM494559     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494571     3  0.0000      0.990 0.000 0.000 1.000 0.000
#> GSM494614     2  0.4996      0.241 0.000 0.516 0.000 0.484
#> GSM494603     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494568     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494572     3  0.0000      0.990 0.000 0.000 1.000 0.000
#> GSM494600     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494562     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494615     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494582     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494599     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494610     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494587     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494581     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494580     2  0.4072      0.673 0.000 0.748 0.000 0.252
#> GSM494563     4  0.3569      0.719 0.196 0.000 0.000 0.804
#> GSM494576     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494605     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494584     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494586     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494578     2  0.4072      0.673 0.000 0.748 0.000 0.252
#> GSM494585     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494611     2  0.4830      0.408 0.000 0.608 0.000 0.392
#> GSM494560     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494595     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494570     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494597     3  0.2216      0.892 0.000 0.092 0.908 0.000
#> GSM494607     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494561     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494569     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494592     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494577     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494588     1  0.3837      0.663 0.776 0.000 0.000 0.224
#> GSM494590     3  0.0000      0.990 0.000 0.000 1.000 0.000
#> GSM494609     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494608     2  0.4866      0.379 0.000 0.596 0.000 0.404
#> GSM494606     4  0.4072      0.581 0.000 0.252 0.000 0.748
#> GSM494574     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494573     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494566     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494601     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494557     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494579     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494596     3  0.0000      0.990 0.000 0.000 1.000 0.000
#> GSM494575     2  0.0000      0.825 0.000 1.000 0.000 0.000
#> GSM494625     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0000      0.990 0.000 0.000 1.000 0.000
#> GSM494664     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494624     1  0.4431      0.541 0.696 0.000 0.000 0.304
#> GSM494651     4  0.4855      0.258 0.000 0.400 0.000 0.600
#> GSM494662     4  0.4277      0.603 0.280 0.000 0.000 0.720
#> GSM494627     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494673     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494649     4  0.4877      0.319 0.408 0.000 0.000 0.592
#> GSM494658     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494643     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494672     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494618     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494631     2  0.4072      0.673 0.000 0.748 0.000 0.252
#> GSM494619     1  0.4406      0.550 0.700 0.000 0.000 0.300
#> GSM494674     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494616     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494663     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494628     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494632     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494660     4  0.4072      0.650 0.252 0.000 0.000 0.748
#> GSM494622     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494642     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494670     1  0.4888      0.285 0.588 0.000 0.000 0.412
#> GSM494675     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494641     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494636     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494640     4  0.3610      0.694 0.000 0.200 0.000 0.800
#> GSM494623     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494644     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494646     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494665     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494638     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494645     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494671     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494620     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494630     4  0.4981      0.148 0.464 0.000 0.000 0.536
#> GSM494657     3  0.0000      0.990 0.000 0.000 1.000 0.000
#> GSM494667     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494621     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494629     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494637     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494652     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494648     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494650     3  0.0000      0.990 0.000 0.000 1.000 0.000
#> GSM494669     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494633     4  0.0592      0.904 0.016 0.000 0.000 0.984
#> GSM494634     1  0.0000      0.939 1.000 0.000 0.000 0.000
#> GSM494639     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494661     2  0.4072      0.673 0.000 0.748 0.000 0.252
#> GSM494617     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494626     4  0.0000      0.917 0.000 0.000 0.000 1.000
#> GSM494656     3  0.0000      0.990 0.000 0.000 1.000 0.000
#> GSM494635     4  0.0000      0.917 0.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     4  0.0290      0.910 0.000 0.008 0.000 0.992 0.000
#> GSM494594     3  0.0000      0.989 0.000 0.000 1.000 0.000 0.000
#> GSM494604     1  0.0162      0.982 0.996 0.000 0.000 0.004 0.000
#> GSM494564     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000
#> GSM494591     3  0.0000      0.989 0.000 0.000 1.000 0.000 0.000
#> GSM494567     4  0.3336      0.648 0.000 0.228 0.000 0.772 0.000
#> GSM494602     1  0.2929      0.773 0.820 0.180 0.000 0.000 0.000
#> GSM494613     2  0.3508      0.675 0.000 0.748 0.000 0.252 0.000
#> GSM494589     4  0.0703      0.902 0.000 0.000 0.000 0.976 0.024
#> GSM494598     2  0.5008      0.449 0.300 0.644 0.000 0.056 0.000
#> GSM494593     4  0.6647      0.147 0.304 0.252 0.000 0.444 0.000
#> GSM494583     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494612     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494558     2  0.3534      0.669 0.000 0.744 0.000 0.256 0.000
#> GSM494556     4  0.3452      0.634 0.000 0.244 0.000 0.756 0.000
#> GSM494559     4  0.4074      0.454 0.000 0.000 0.000 0.636 0.364
#> GSM494571     3  0.0000      0.989 0.000 0.000 1.000 0.000 0.000
#> GSM494614     2  0.4304      0.211 0.000 0.516 0.000 0.484 0.000
#> GSM494603     4  0.0703      0.902 0.000 0.000 0.000 0.976 0.024
#> GSM494568     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494572     3  0.0000      0.989 0.000 0.000 1.000 0.000 0.000
#> GSM494600     4  0.0703      0.902 0.000 0.000 0.000 0.976 0.024
#> GSM494562     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494615     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494582     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494599     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494610     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494587     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494581     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494580     2  0.3508      0.675 0.000 0.748 0.000 0.252 0.000
#> GSM494563     5  0.0162      0.987 0.004 0.000 0.000 0.000 0.996
#> GSM494576     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494605     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494584     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494586     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494578     2  0.3508      0.675 0.000 0.748 0.000 0.252 0.000
#> GSM494585     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494611     2  0.5748      0.389 0.300 0.584 0.000 0.116 0.000
#> GSM494560     4  0.0963      0.894 0.000 0.000 0.000 0.964 0.036
#> GSM494595     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494570     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000
#> GSM494597     3  0.1908      0.891 0.000 0.092 0.908 0.000 0.000
#> GSM494607     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494561     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000
#> GSM494569     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494592     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494577     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494588     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000
#> GSM494590     3  0.0000      0.989 0.000 0.000 1.000 0.000 0.000
#> GSM494609     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494608     2  0.4192      0.339 0.000 0.596 0.000 0.404 0.000
#> GSM494606     4  0.6637      0.154 0.300 0.252 0.000 0.448 0.000
#> GSM494574     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494573     5  0.0162      0.986 0.000 0.000 0.000 0.004 0.996
#> GSM494566     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494601     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494557     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494579     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494596     3  0.0000      0.989 0.000 0.000 1.000 0.000 0.000
#> GSM494575     2  0.0000      0.838 0.000 1.000 0.000 0.000 0.000
#> GSM494625     5  0.0162      0.987 0.000 0.000 0.000 0.004 0.996
#> GSM494654     3  0.0000      0.989 0.000 0.000 1.000 0.000 0.000
#> GSM494664     1  0.0162      0.982 0.996 0.000 0.000 0.000 0.004
#> GSM494624     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000
#> GSM494651     4  0.4182      0.276 0.000 0.400 0.000 0.600 0.000
#> GSM494662     4  0.3876      0.723 0.032 0.000 0.000 0.776 0.192
#> GSM494627     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494673     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494649     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000
#> GSM494658     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494672     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494631     2  0.3508      0.675 0.000 0.748 0.000 0.252 0.000
#> GSM494619     5  0.0703      0.976 0.024 0.000 0.000 0.000 0.976
#> GSM494674     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494663     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494628     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494632     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494660     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000
#> GSM494622     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494642     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.2020      0.861 0.900 0.000 0.000 0.100 0.000
#> GSM494675     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494641     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494640     4  0.3109      0.702 0.000 0.200 0.000 0.800 0.000
#> GSM494623     5  0.0703      0.976 0.024 0.000 0.000 0.000 0.976
#> GSM494644     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494646     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494665     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494638     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494645     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494671     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494620     5  0.0703      0.976 0.024 0.000 0.000 0.000 0.976
#> GSM494630     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000
#> GSM494657     3  0.0000      0.989 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494621     5  0.0703      0.976 0.024 0.000 0.000 0.000 0.976
#> GSM494629     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494637     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494652     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494648     5  0.0703      0.976 0.024 0.000 0.000 0.000 0.976
#> GSM494650     3  0.0000      0.989 0.000 0.000 1.000 0.000 0.000
#> GSM494669     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494633     5  0.0000      0.989 0.000 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.986 1.000 0.000 0.000 0.000 0.000
#> GSM494639     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494661     2  0.3508      0.675 0.000 0.748 0.000 0.252 0.000
#> GSM494617     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494626     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000
#> GSM494656     3  0.0000      0.989 0.000 0.000 1.000 0.000 0.000
#> GSM494635     4  0.0000      0.916 0.000 0.000 0.000 1.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
#> GSM494565     4  0.0363      0.940 0.000 0.000 0.000 0.988 0.012 0.000
#> GSM494594     3  0.0000      0.935 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.0146      0.965 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM494564     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494591     3  0.0000      0.935 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     4  0.2562      0.769 0.000 0.000 0.000 0.828 0.172 0.000
#> GSM494602     2  0.1267      0.892 0.060 0.940 0.000 0.000 0.000 0.000
#> GSM494613     5  0.0000      0.888 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494589     4  0.0713      0.931 0.000 0.000 0.000 0.972 0.000 0.028
#> GSM494598     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494593     2  0.0891      0.920 0.008 0.968 0.000 0.024 0.000 0.000
#> GSM494583     5  0.0000      0.888 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494612     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     5  0.2823      0.655 0.000 0.000 0.000 0.204 0.796 0.000
#> GSM494556     4  0.1910      0.851 0.000 0.000 0.000 0.892 0.108 0.000
#> GSM494559     4  0.3672      0.452 0.000 0.000 0.000 0.632 0.000 0.368
#> GSM494571     3  0.0000      0.935 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494614     5  0.3464      0.550 0.000 0.000 0.000 0.312 0.688 0.000
#> GSM494603     4  0.0713      0.931 0.000 0.000 0.000 0.972 0.000 0.028
#> GSM494568     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494572     3  0.3050      0.733 0.000 0.000 0.764 0.000 0.236 0.000
#> GSM494600     4  0.0713      0.931 0.000 0.000 0.000 0.972 0.000 0.028
#> GSM494562     5  0.2048      0.819 0.000 0.120 0.000 0.000 0.880 0.000
#> GSM494615     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494582     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494599     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494610     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494587     5  0.0146      0.888 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM494581     5  0.3221      0.635 0.000 0.264 0.000 0.000 0.736 0.000
#> GSM494580     5  0.0000      0.888 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494563     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494576     5  0.0146      0.888 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM494605     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494584     5  0.0000      0.888 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494586     5  0.2003      0.822 0.000 0.116 0.000 0.000 0.884 0.000
#> GSM494578     5  0.0000      0.888 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494585     5  0.0363      0.884 0.000 0.012 0.000 0.000 0.988 0.000
#> GSM494611     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494560     4  0.1010      0.923 0.000 0.004 0.000 0.960 0.000 0.036
#> GSM494595     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494570     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494597     3  0.3309      0.669 0.000 0.000 0.720 0.000 0.280 0.000
#> GSM494607     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494561     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494569     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494592     2  0.3659      0.430 0.364 0.636 0.000 0.000 0.000 0.000
#> GSM494577     5  0.1141      0.865 0.000 0.052 0.000 0.000 0.948 0.000
#> GSM494588     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494590     3  0.0000      0.935 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494608     5  0.4531      0.329 0.000 0.036 0.000 0.408 0.556 0.000
#> GSM494606     2  0.1265      0.898 0.008 0.948 0.000 0.044 0.000 0.000
#> GSM494574     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494573     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494566     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494601     5  0.0000      0.888 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494557     5  0.0000      0.888 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494579     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494596     3  0.0000      0.935 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0000      0.941 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     6  0.0260      0.982 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM494654     3  0.0000      0.935 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494664     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494624     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494651     4  0.3833      0.226 0.000 0.000 0.000 0.556 0.444 0.000
#> GSM494662     4  0.4165      0.702 0.128 0.000 0.000 0.744 0.000 0.128
#> GSM494627     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494673     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494658     1  0.2527      0.775 0.832 0.168 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494672     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494631     5  0.0000      0.888 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494619     6  0.0713      0.972 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM494674     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494616     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494663     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494628     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494632     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494660     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494622     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494642     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494659     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.4331      0.070 0.516 0.464 0.000 0.020 0.000 0.000
#> GSM494675     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494641     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494640     4  0.3351      0.591 0.000 0.000 0.000 0.712 0.288 0.000
#> GSM494623     6  0.0713      0.972 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM494644     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494646     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494665     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494638     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494645     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494671     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.0713      0.972 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM494630     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494657     3  0.0000      0.935 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0713      0.972 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM494629     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494637     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494652     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.0713      0.972 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM494650     3  0.1444      0.892 0.000 0.000 0.928 0.000 0.072 0.000
#> GSM494669     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494668     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     6  0.0000      0.988 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.970 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494661     5  0.0000      0.888 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494617     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494626     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM494656     3  0.0000      0.935 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494635     4  0.0000      0.948 0.000 0.000 0.000 1.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

get_signatures(res, k = 6)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-pam-collect-classes

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

test_to_known_factors(res)
#>           n disease.state(p)   age(p) other(p) individual(p) k
#> ATC:pam 119         5.08e-01 0.000108 0.128878      0.000532 2
#> ATC:pam 107         3.13e-03 0.006513 0.083440      0.002141 3
#> ATC:pam 113         3.72e-06 0.027122 0.001228      0.011882 4
#> ATC:pam 112         1.51e-05 0.000879 0.003700      0.000176 5
#> ATC:pam 115         8.39e-07 0.003112 0.000129      0.000371 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 51941 rows and 120 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 0.473           0.875       0.904         0.4597 0.497   0.497
#> 3 3 0.813           0.725       0.883         0.3400 0.861   0.731
#> 4 4 0.627           0.801       0.871         0.0841 0.858   0.662
#> 5 5 0.798           0.812       0.907         0.1697 0.881   0.622
#> 6 6 0.844           0.817       0.899         0.0255 0.929   0.705

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
#> GSM494565     2   0.000      0.950 0.000 1.000
#> GSM494594     2   0.584      0.840 0.140 0.860
#> GSM494604     1   0.584      0.940 0.860 0.140
#> GSM494564     2   0.000      0.950 0.000 1.000
#> GSM494591     2   0.584      0.840 0.140 0.860
#> GSM494567     2   0.000      0.950 0.000 1.000
#> GSM494602     2   0.000      0.950 0.000 1.000
#> GSM494613     2   0.000      0.950 0.000 1.000
#> GSM494589     2   0.000      0.950 0.000 1.000
#> GSM494598     2   0.000      0.950 0.000 1.000
#> GSM494593     2   0.000      0.950 0.000 1.000
#> GSM494583     2   0.000      0.950 0.000 1.000
#> GSM494612     2   0.000      0.950 0.000 1.000
#> GSM494558     1   0.993      0.132 0.548 0.452
#> GSM494556     2   0.000      0.950 0.000 1.000
#> GSM494559     2   0.000      0.950 0.000 1.000
#> GSM494571     2   0.584      0.840 0.140 0.860
#> GSM494614     2   0.000      0.950 0.000 1.000
#> GSM494603     2   0.000      0.950 0.000 1.000
#> GSM494568     2   0.295      0.890 0.052 0.948
#> GSM494572     2   0.584      0.840 0.140 0.860
#> GSM494600     2   0.000      0.950 0.000 1.000
#> GSM494562     2   0.000      0.950 0.000 1.000
#> GSM494615     2   0.000      0.950 0.000 1.000
#> GSM494582     2   0.000      0.950 0.000 1.000
#> GSM494599     2   0.000      0.950 0.000 1.000
#> GSM494610     2   0.000      0.950 0.000 1.000
#> GSM494587     2   0.000      0.950 0.000 1.000
#> GSM494581     2   0.000      0.950 0.000 1.000
#> GSM494580     2   0.000      0.950 0.000 1.000
#> GSM494563     2   0.000      0.950 0.000 1.000
#> GSM494576     2   0.000      0.950 0.000 1.000
#> GSM494605     1   0.584      0.940 0.860 0.140
#> GSM494584     2   0.000      0.950 0.000 1.000
#> GSM494586     2   0.000      0.950 0.000 1.000
#> GSM494578     2   0.000      0.950 0.000 1.000
#> GSM494585     2   0.000      0.950 0.000 1.000
#> GSM494611     2   0.000      0.950 0.000 1.000
#> GSM494560     2   0.000      0.950 0.000 1.000
#> GSM494595     2   0.000      0.950 0.000 1.000
#> GSM494570     2   0.000      0.950 0.000 1.000
#> GSM494597     2   0.584      0.840 0.140 0.860
#> GSM494607     2   0.000      0.950 0.000 1.000
#> GSM494561     2   0.000      0.950 0.000 1.000
#> GSM494569     1   0.584      0.940 0.860 0.140
#> GSM494592     2   0.000      0.950 0.000 1.000
#> GSM494577     2   0.000      0.950 0.000 1.000
#> GSM494588     2   0.000      0.950 0.000 1.000
#> GSM494590     2   0.584      0.840 0.140 0.860
#> GSM494609     2   0.000      0.950 0.000 1.000
#> GSM494608     2   0.000      0.950 0.000 1.000
#> GSM494606     2   0.000      0.950 0.000 1.000
#> GSM494574     2   0.000      0.950 0.000 1.000
#> GSM494573     2   0.000      0.950 0.000 1.000
#> GSM494566     2   0.000      0.950 0.000 1.000
#> GSM494601     2   0.358      0.897 0.068 0.932
#> GSM494557     2   0.000      0.950 0.000 1.000
#> GSM494579     2   0.000      0.950 0.000 1.000
#> GSM494596     2   0.584      0.840 0.140 0.860
#> GSM494575     2   0.000      0.950 0.000 1.000
#> GSM494625     1   0.584      0.940 0.860 0.140
#> GSM494654     2   0.584      0.840 0.140 0.860
#> GSM494664     1   0.584      0.940 0.860 0.140
#> GSM494624     1   0.584      0.940 0.860 0.140
#> GSM494651     1   0.975      0.111 0.592 0.408
#> GSM494662     1   0.584      0.940 0.860 0.140
#> GSM494627     1   0.949      0.638 0.632 0.368
#> GSM494673     1   0.584      0.940 0.860 0.140
#> GSM494649     1   0.584      0.940 0.860 0.140
#> GSM494658     1   0.775      0.851 0.772 0.228
#> GSM494653     1   0.584      0.940 0.860 0.140
#> GSM494643     1   0.760      0.859 0.780 0.220
#> GSM494672     1   0.584      0.940 0.860 0.140
#> GSM494618     1   0.584      0.940 0.860 0.140
#> GSM494631     2   0.000      0.950 0.000 1.000
#> GSM494619     1   0.584      0.940 0.860 0.140
#> GSM494674     1   0.584      0.940 0.860 0.140
#> GSM494616     1   0.584      0.940 0.860 0.140
#> GSM494663     1   0.584      0.940 0.860 0.140
#> GSM494628     1   0.584      0.940 0.860 0.140
#> GSM494632     1   0.584      0.940 0.860 0.140
#> GSM494660     1   0.584      0.940 0.860 0.140
#> GSM494622     2   1.000     -0.300 0.488 0.512
#> GSM494642     1   0.584      0.940 0.860 0.140
#> GSM494647     1   0.584      0.940 0.860 0.140
#> GSM494659     1   0.584      0.940 0.860 0.140
#> GSM494670     1   0.625      0.926 0.844 0.156
#> GSM494675     2   0.000      0.950 0.000 1.000
#> GSM494641     1   0.584      0.940 0.860 0.140
#> GSM494636     1   0.584      0.940 0.860 0.140
#> GSM494640     1   0.993      0.132 0.548 0.452
#> GSM494623     1   0.584      0.940 0.860 0.140
#> GSM494644     1   0.584      0.940 0.860 0.140
#> GSM494646     1   0.584      0.940 0.860 0.140
#> GSM494665     1   0.584      0.940 0.860 0.140
#> GSM494638     1   0.584      0.940 0.860 0.140
#> GSM494645     1   0.584      0.940 0.860 0.140
#> GSM494671     1   0.584      0.940 0.860 0.140
#> GSM494655     1   0.584      0.940 0.860 0.140
#> GSM494620     1   0.584      0.940 0.860 0.140
#> GSM494630     1   0.584      0.940 0.860 0.140
#> GSM494657     2   0.584      0.840 0.140 0.860
#> GSM494667     1   0.584      0.940 0.860 0.140
#> GSM494621     1   0.584      0.940 0.860 0.140
#> GSM494629     2   0.993     -0.183 0.452 0.548
#> GSM494637     1   0.895      0.734 0.688 0.312
#> GSM494652     1   0.584      0.940 0.860 0.140
#> GSM494648     1   0.584      0.940 0.860 0.140
#> GSM494650     1   0.975      0.111 0.592 0.408
#> GSM494669     1   0.584      0.940 0.860 0.140
#> GSM494666     1   0.584      0.940 0.860 0.140
#> GSM494668     1   0.584      0.940 0.860 0.140
#> GSM494633     1   0.584      0.940 0.860 0.140
#> GSM494634     1   0.584      0.940 0.860 0.140
#> GSM494639     1   0.584      0.940 0.860 0.140
#> GSM494661     1   0.980      0.114 0.584 0.416
#> GSM494617     1   0.584      0.940 0.860 0.140
#> GSM494626     1   0.584      0.940 0.860 0.140
#> GSM494656     2   0.584      0.840 0.140 0.860
#> GSM494635     1   0.584      0.940 0.860 0.140

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM494565     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494594     3  0.0424     0.7816 0.000 0.008 0.992
#> GSM494604     1  0.1267     0.9390 0.972 0.024 0.004
#> GSM494564     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494591     3  0.0424     0.7816 0.000 0.008 0.992
#> GSM494567     2  0.0000     0.7208 0.000 1.000 0.000
#> GSM494602     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494613     2  0.0000     0.7208 0.000 1.000 0.000
#> GSM494589     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494598     3  0.7995    -0.2926 0.060 0.460 0.480
#> GSM494593     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494583     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494612     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494558     3  0.9816     0.1821 0.356 0.244 0.400
#> GSM494556     2  0.0000     0.7208 0.000 1.000 0.000
#> GSM494559     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494571     3  0.0424     0.7816 0.000 0.008 0.992
#> GSM494614     2  0.1031     0.7324 0.024 0.976 0.000
#> GSM494603     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494568     2  0.5292     0.6012 0.172 0.800 0.028
#> GSM494572     3  0.0424     0.7816 0.000 0.008 0.992
#> GSM494600     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494562     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494615     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494582     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494599     2  0.4346     0.6092 0.184 0.816 0.000
#> GSM494610     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494587     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494581     2  0.4452     0.5953 0.000 0.808 0.192
#> GSM494580     2  0.3116     0.6706 0.000 0.892 0.108
#> GSM494563     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494576     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494605     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494584     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494586     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494578     2  0.0000     0.7208 0.000 1.000 0.000
#> GSM494585     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494611     3  0.7586    -0.2943 0.040 0.480 0.480
#> GSM494560     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494595     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494570     2  0.2537     0.7318 0.080 0.920 0.000
#> GSM494597     3  0.0424     0.7816 0.000 0.008 0.992
#> GSM494607     2  0.4452     0.5981 0.192 0.808 0.000
#> GSM494561     2  0.2448     0.7354 0.076 0.924 0.000
#> GSM494569     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494592     2  0.2261     0.7420 0.068 0.932 0.000
#> GSM494577     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494588     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494590     3  0.0424     0.7816 0.000 0.008 0.992
#> GSM494609     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494608     2  0.0747     0.7289 0.016 0.984 0.000
#> GSM494606     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494574     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494573     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494566     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494601     3  0.3412     0.6777 0.000 0.124 0.876
#> GSM494557     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494579     2  0.2165     0.7450 0.064 0.936 0.000
#> GSM494596     3  0.0424     0.7816 0.000 0.008 0.992
#> GSM494575     2  0.6302     0.2400 0.000 0.520 0.480
#> GSM494625     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494654     3  0.0424     0.7816 0.000 0.008 0.992
#> GSM494664     1  0.0000     0.9592 1.000 0.000 0.000
#> GSM494624     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494651     1  0.8206     0.0412 0.480 0.072 0.448
#> GSM494662     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494627     1  0.1163     0.9423 0.972 0.000 0.028
#> GSM494673     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494649     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494658     1  0.1643     0.9194 0.956 0.044 0.000
#> GSM494653     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494643     1  0.2152     0.9212 0.948 0.016 0.036
#> GSM494672     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494618     1  0.1289     0.9389 0.968 0.000 0.032
#> GSM494631     2  0.1289     0.7088 0.000 0.968 0.032
#> GSM494619     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494674     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494616     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494663     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494628     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494632     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494660     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494622     1  0.2187     0.9206 0.948 0.024 0.028
#> GSM494642     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494647     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494659     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494670     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494675     2  0.0237     0.7201 0.000 0.996 0.004
#> GSM494641     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494636     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494640     1  0.7698     0.4296 0.624 0.072 0.304
#> GSM494623     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494644     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494646     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494665     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494638     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494645     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494671     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494655     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494620     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494630     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494657     3  0.0424     0.7816 0.000 0.008 0.992
#> GSM494667     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494621     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494629     1  0.6601     0.4951 0.676 0.296 0.028
#> GSM494637     1  0.1163     0.9423 0.972 0.000 0.028
#> GSM494652     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494648     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494650     3  0.6678    -0.1115 0.480 0.008 0.512
#> GSM494669     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494666     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494668     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494633     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494634     1  0.0237     0.9593 0.996 0.000 0.004
#> GSM494639     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494661     1  0.8206     0.0412 0.480 0.072 0.448
#> GSM494617     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494626     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM494656     3  0.0424     0.7816 0.000 0.008 0.992
#> GSM494635     1  0.0237     0.9593 0.996 0.000 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     2  0.3172     0.8820 0.000 0.840 0.000 0.160
#> GSM494594     3  0.4624     0.8819 0.340 0.000 0.660 0.000
#> GSM494604     1  0.6792     0.7098 0.476 0.096 0.000 0.428
#> GSM494564     2  0.3355     0.8809 0.004 0.836 0.000 0.160
#> GSM494591     3  0.4624     0.8819 0.340 0.000 0.660 0.000
#> GSM494567     2  0.3172     0.8820 0.000 0.840 0.000 0.160
#> GSM494602     2  0.0188     0.9000 0.004 0.996 0.000 0.000
#> GSM494613     2  0.2868     0.8914 0.000 0.864 0.000 0.136
#> GSM494589     2  0.3172     0.8820 0.000 0.840 0.000 0.160
#> GSM494598     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494593     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494583     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494612     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494558     3  0.2831     0.6900 0.004 0.000 0.876 0.120
#> GSM494556     2  0.2868     0.8914 0.000 0.864 0.000 0.136
#> GSM494559     2  0.3172     0.8820 0.000 0.840 0.000 0.160
#> GSM494571     3  0.4643     0.8814 0.344 0.000 0.656 0.000
#> GSM494614     2  0.2868     0.8914 0.000 0.864 0.000 0.136
#> GSM494603     2  0.3355     0.8809 0.004 0.836 0.000 0.160
#> GSM494568     4  0.2831     0.6545 0.004 0.120 0.000 0.876
#> GSM494572     3  0.4643     0.8814 0.344 0.000 0.656 0.000
#> GSM494600     2  0.3172     0.8820 0.000 0.840 0.000 0.160
#> GSM494562     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494615     2  0.3355     0.8809 0.004 0.836 0.000 0.160
#> GSM494582     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494599     2  0.0895     0.9010 0.004 0.976 0.000 0.020
#> GSM494610     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494587     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494581     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494580     2  0.6382     0.6730 0.004 0.664 0.196 0.136
#> GSM494563     2  0.3355     0.8809 0.004 0.836 0.000 0.160
#> GSM494576     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494605     4  0.4605    -0.0169 0.336 0.000 0.000 0.664
#> GSM494584     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494586     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494578     2  0.2868     0.8914 0.000 0.864 0.000 0.136
#> GSM494585     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494611     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494560     2  0.3172     0.8820 0.000 0.840 0.000 0.160
#> GSM494595     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494570     2  0.3355     0.8809 0.004 0.836 0.000 0.160
#> GSM494597     3  0.4643     0.8814 0.344 0.000 0.656 0.000
#> GSM494607     2  0.0376     0.9009 0.004 0.992 0.000 0.004
#> GSM494561     2  0.4283     0.7673 0.004 0.740 0.000 0.256
#> GSM494569     4  0.0188     0.8660 0.004 0.000 0.000 0.996
#> GSM494592     2  0.0188     0.9000 0.004 0.996 0.000 0.000
#> GSM494577     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494588     2  0.3355     0.8809 0.004 0.836 0.000 0.160
#> GSM494590     3  0.4624     0.8819 0.340 0.000 0.660 0.000
#> GSM494609     2  0.0376     0.9009 0.004 0.992 0.000 0.004
#> GSM494608     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494606     2  0.0188     0.9000 0.004 0.996 0.000 0.000
#> GSM494574     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494573     2  0.3355     0.8809 0.004 0.836 0.000 0.160
#> GSM494566     2  0.3052     0.8909 0.004 0.860 0.000 0.136
#> GSM494601     3  0.5271     0.5102 0.024 0.320 0.656 0.000
#> GSM494557     2  0.2281     0.8967 0.000 0.904 0.000 0.096
#> GSM494579     2  0.3052     0.8909 0.004 0.860 0.000 0.136
#> GSM494596     3  0.4624     0.8819 0.340 0.000 0.660 0.000
#> GSM494575     2  0.0000     0.9008 0.000 1.000 0.000 0.000
#> GSM494625     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494654     3  0.4624     0.8819 0.340 0.000 0.660 0.000
#> GSM494664     4  0.0817     0.8411 0.024 0.000 0.000 0.976
#> GSM494624     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494651     3  0.0376     0.7860 0.004 0.000 0.992 0.004
#> GSM494662     4  0.0188     0.8660 0.004 0.000 0.000 0.996
#> GSM494627     4  0.0188     0.8660 0.004 0.000 0.000 0.996
#> GSM494673     1  0.4713     0.9007 0.640 0.000 0.000 0.360
#> GSM494649     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494658     1  0.7423     0.6777 0.476 0.180 0.000 0.344
#> GSM494653     1  0.4661     0.9139 0.652 0.000 0.000 0.348
#> GSM494643     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494672     1  0.7261     0.7085 0.480 0.152 0.000 0.368
#> GSM494618     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494631     2  0.3052     0.8909 0.004 0.860 0.000 0.136
#> GSM494619     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494674     4  0.4989    -0.5709 0.472 0.000 0.000 0.528
#> GSM494616     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494663     4  0.0188     0.8660 0.004 0.000 0.000 0.996
#> GSM494628     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494632     4  0.0188     0.8647 0.004 0.000 0.000 0.996
#> GSM494660     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494622     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494642     1  0.4661     0.9139 0.652 0.000 0.000 0.348
#> GSM494647     4  0.4989    -0.5709 0.472 0.000 0.000 0.528
#> GSM494659     1  0.4661     0.9139 0.652 0.000 0.000 0.348
#> GSM494670     1  0.7093     0.7162 0.476 0.128 0.000 0.396
#> GSM494675     2  0.2921     0.8903 0.000 0.860 0.000 0.140
#> GSM494641     1  0.4643     0.9105 0.656 0.000 0.000 0.344
#> GSM494636     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494640     3  0.3105     0.6658 0.004 0.000 0.856 0.140
#> GSM494623     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494644     4  0.4989    -0.5709 0.472 0.000 0.000 0.528
#> GSM494646     4  0.1716     0.7784 0.064 0.000 0.000 0.936
#> GSM494665     4  0.4624    -0.0195 0.340 0.000 0.000 0.660
#> GSM494638     4  0.0188     0.8660 0.004 0.000 0.000 0.996
#> GSM494645     4  0.2973     0.5985 0.144 0.000 0.000 0.856
#> GSM494671     1  0.4661     0.9139 0.652 0.000 0.000 0.348
#> GSM494655     1  0.4661     0.9139 0.652 0.000 0.000 0.348
#> GSM494620     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494630     4  0.0188     0.8660 0.004 0.000 0.000 0.996
#> GSM494657     3  0.4624     0.8819 0.340 0.000 0.660 0.000
#> GSM494667     1  0.4661     0.9139 0.652 0.000 0.000 0.348
#> GSM494621     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494629     4  0.0188     0.8660 0.004 0.000 0.000 0.996
#> GSM494637     4  0.0188     0.8660 0.004 0.000 0.000 0.996
#> GSM494652     1  0.4661     0.9139 0.652 0.000 0.000 0.348
#> GSM494648     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494650     3  0.0188     0.7868 0.000 0.000 0.996 0.004
#> GSM494669     1  0.4661     0.9139 0.652 0.000 0.000 0.348
#> GSM494666     4  0.0921     0.8374 0.028 0.000 0.000 0.972
#> GSM494668     1  0.4643     0.9105 0.656 0.000 0.000 0.344
#> GSM494633     4  0.0188     0.8660 0.004 0.000 0.000 0.996
#> GSM494634     1  0.4661     0.9139 0.652 0.000 0.000 0.348
#> GSM494639     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494661     3  0.0188     0.7868 0.000 0.000 0.996 0.004
#> GSM494617     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494626     4  0.0000     0.8681 0.000 0.000 0.000 1.000
#> GSM494656     3  0.4624     0.8819 0.340 0.000 0.660 0.000
#> GSM494635     4  0.4907    -0.4064 0.420 0.000 0.000 0.580

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM494565     5  0.0162      0.832 0.000 0.004 0.000 0.000 0.996
#> GSM494594     3  0.0000      0.878 0.000 0.000 1.000 0.000 0.000
#> GSM494604     1  0.1732      0.879 0.920 0.000 0.000 0.000 0.080
#> GSM494564     5  0.0000      0.832 0.000 0.000 0.000 0.000 1.000
#> GSM494591     3  0.0000      0.878 0.000 0.000 1.000 0.000 0.000
#> GSM494567     5  0.0162      0.832 0.000 0.004 0.000 0.000 0.996
#> GSM494602     2  0.3177      0.782 0.000 0.792 0.000 0.000 0.208
#> GSM494613     5  0.2732      0.815 0.000 0.160 0.000 0.000 0.840
#> GSM494589     5  0.0000      0.832 0.000 0.000 0.000 0.000 1.000
#> GSM494598     2  0.0000      0.854 0.000 1.000 0.000 0.000 0.000
#> GSM494593     2  0.3177      0.782 0.000 0.792 0.000 0.000 0.208
#> GSM494583     5  0.3305      0.763 0.000 0.224 0.000 0.000 0.776
#> GSM494612     2  0.0000      0.854 0.000 1.000 0.000 0.000 0.000
#> GSM494558     3  0.3561      0.725 0.000 0.000 0.740 0.260 0.000
#> GSM494556     5  0.2732      0.815 0.000 0.160 0.000 0.000 0.840
#> GSM494559     5  0.0000      0.832 0.000 0.000 0.000 0.000 1.000
#> GSM494571     3  0.0000      0.878 0.000 0.000 1.000 0.000 0.000
#> GSM494614     5  0.0880      0.834 0.000 0.032 0.000 0.000 0.968
#> GSM494603     5  0.0000      0.832 0.000 0.000 0.000 0.000 1.000
#> GSM494568     4  0.2813      0.725 0.000 0.000 0.000 0.832 0.168
#> GSM494572     3  0.0000      0.878 0.000 0.000 1.000 0.000 0.000
#> GSM494600     5  0.0000      0.832 0.000 0.000 0.000 0.000 1.000
#> GSM494562     2  0.0703      0.855 0.000 0.976 0.000 0.000 0.024
#> GSM494615     5  0.3359      0.800 0.000 0.072 0.000 0.084 0.844
#> GSM494582     2  0.0000      0.854 0.000 1.000 0.000 0.000 0.000
#> GSM494599     2  0.3424      0.737 0.000 0.760 0.000 0.000 0.240
#> GSM494610     2  0.0000      0.854 0.000 1.000 0.000 0.000 0.000
#> GSM494587     5  0.4242      0.318 0.000 0.428 0.000 0.000 0.572
#> GSM494581     2  0.4182      0.273 0.000 0.600 0.000 0.000 0.400
#> GSM494580     5  0.5862      0.418 0.000 0.112 0.344 0.000 0.544
#> GSM494563     5  0.0000      0.832 0.000 0.000 0.000 0.000 1.000
#> GSM494576     5  0.2732      0.815 0.000 0.160 0.000 0.000 0.840
#> GSM494605     1  0.3816      0.589 0.696 0.000 0.000 0.304 0.000
#> GSM494584     5  0.2732      0.815 0.000 0.160 0.000 0.000 0.840
#> GSM494586     2  0.0963      0.853 0.000 0.964 0.000 0.000 0.036
#> GSM494578     5  0.2732      0.815 0.000 0.160 0.000 0.000 0.840
#> GSM494585     2  0.3177      0.761 0.000 0.792 0.000 0.000 0.208
#> GSM494611     2  0.0000      0.854 0.000 1.000 0.000 0.000 0.000
#> GSM494560     5  0.0000      0.832 0.000 0.000 0.000 0.000 1.000
#> GSM494595     2  0.0510      0.855 0.000 0.984 0.000 0.000 0.016
#> GSM494570     5  0.0880      0.823 0.000 0.000 0.000 0.032 0.968
#> GSM494597     3  0.0000      0.878 0.000 0.000 1.000 0.000 0.000
#> GSM494607     2  0.3210      0.778 0.000 0.788 0.000 0.000 0.212
#> GSM494561     5  0.2813      0.696 0.000 0.000 0.000 0.168 0.832
#> GSM494569     4  0.0162      0.922 0.000 0.000 0.000 0.996 0.004
#> GSM494592     2  0.3177      0.782 0.000 0.792 0.000 0.000 0.208
#> GSM494577     5  0.3949      0.606 0.000 0.332 0.000 0.000 0.668
#> GSM494588     5  0.0000      0.832 0.000 0.000 0.000 0.000 1.000
#> GSM494590     3  0.0000      0.878 0.000 0.000 1.000 0.000 0.000
#> GSM494609     5  0.4210      0.358 0.000 0.412 0.000 0.000 0.588
#> GSM494608     5  0.4227      0.350 0.000 0.420 0.000 0.000 0.580
#> GSM494606     2  0.3210      0.778 0.000 0.788 0.000 0.000 0.212
#> GSM494574     2  0.0000      0.854 0.000 1.000 0.000 0.000 0.000
#> GSM494573     5  0.0000      0.832 0.000 0.000 0.000 0.000 1.000
#> GSM494566     5  0.3359      0.800 0.000 0.072 0.000 0.084 0.844
#> GSM494601     3  0.3741      0.611 0.000 0.264 0.732 0.000 0.004
#> GSM494557     5  0.2732      0.815 0.000 0.160 0.000 0.000 0.840
#> GSM494579     5  0.2690      0.815 0.000 0.156 0.000 0.000 0.844
#> GSM494596     3  0.0000      0.878 0.000 0.000 1.000 0.000 0.000
#> GSM494575     2  0.0000      0.854 0.000 1.000 0.000 0.000 0.000
#> GSM494625     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494654     3  0.0000      0.878 0.000 0.000 1.000 0.000 0.000
#> GSM494664     4  0.3586      0.615 0.264 0.000 0.000 0.736 0.000
#> GSM494624     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494651     3  0.3586      0.724 0.000 0.000 0.736 0.264 0.000
#> GSM494662     4  0.0162      0.922 0.000 0.000 0.000 0.996 0.004
#> GSM494627     4  0.0162      0.922 0.000 0.000 0.000 0.996 0.004
#> GSM494673     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494649     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494658     1  0.2179      0.846 0.888 0.000 0.000 0.000 0.112
#> GSM494653     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494643     4  0.0000      0.922 0.000 0.000 0.000 1.000 0.000
#> GSM494672     1  0.1544      0.887 0.932 0.000 0.000 0.000 0.068
#> GSM494618     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494631     5  0.2732      0.815 0.000 0.160 0.000 0.000 0.840
#> GSM494619     4  0.0290      0.922 0.008 0.000 0.000 0.992 0.000
#> GSM494674     1  0.1792      0.882 0.916 0.000 0.000 0.084 0.000
#> GSM494616     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494663     4  0.0162      0.922 0.000 0.000 0.000 0.996 0.004
#> GSM494628     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494632     4  0.3949      0.503 0.332 0.000 0.000 0.668 0.000
#> GSM494660     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494622     4  0.0000      0.922 0.000 0.000 0.000 1.000 0.000
#> GSM494642     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.1544      0.893 0.932 0.000 0.000 0.068 0.000
#> GSM494659     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.1732      0.879 0.920 0.000 0.000 0.000 0.080
#> GSM494675     5  0.2732      0.815 0.000 0.160 0.000 0.000 0.840
#> GSM494641     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494636     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494640     3  0.3586      0.724 0.000 0.000 0.736 0.264 0.000
#> GSM494623     4  0.0290      0.922 0.008 0.000 0.000 0.992 0.000
#> GSM494644     1  0.1544      0.893 0.932 0.000 0.000 0.068 0.000
#> GSM494646     4  0.4227      0.294 0.420 0.000 0.000 0.580 0.000
#> GSM494665     1  0.3508      0.686 0.748 0.000 0.000 0.252 0.000
#> GSM494638     4  0.0162      0.922 0.000 0.000 0.000 0.996 0.004
#> GSM494645     4  0.4227      0.294 0.420 0.000 0.000 0.580 0.000
#> GSM494671     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494620     4  0.0290      0.922 0.008 0.000 0.000 0.992 0.000
#> GSM494630     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494657     3  0.0000      0.878 0.000 0.000 1.000 0.000 0.000
#> GSM494667     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494621     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494629     4  0.0162      0.922 0.000 0.000 0.000 0.996 0.004
#> GSM494637     4  0.0000      0.922 0.000 0.000 0.000 1.000 0.000
#> GSM494652     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494648     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494650     3  0.3586      0.724 0.000 0.000 0.736 0.264 0.000
#> GSM494669     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494666     4  0.3949      0.502 0.332 0.000 0.000 0.668 0.000
#> GSM494668     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494633     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494634     1  0.0000      0.924 1.000 0.000 0.000 0.000 0.000
#> GSM494639     4  0.0963      0.900 0.036 0.000 0.000 0.964 0.000
#> GSM494661     3  0.3715      0.599 0.260 0.000 0.736 0.004 0.000
#> GSM494617     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494626     4  0.0162      0.924 0.004 0.000 0.000 0.996 0.000
#> GSM494656     3  0.0000      0.878 0.000 0.000 1.000 0.000 0.000
#> GSM494635     1  0.3003      0.770 0.812 0.000 0.000 0.188 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
#> GSM494565     5  0.0000      0.750 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494594     3  0.0000      0.940 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494604     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494564     5  0.0000      0.750 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494591     3  0.0000      0.940 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494567     5  0.0146      0.751 0.000 0.000 0.000 0.004 0.996 0.000
#> GSM494602     2  0.0260      0.900 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM494613     5  0.5253      0.693 0.000 0.200 0.000 0.192 0.608 0.000
#> GSM494589     5  0.0000      0.750 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494598     2  0.0146      0.899 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM494593     2  0.0260      0.900 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM494583     5  0.5670      0.567 0.000 0.296 0.000 0.188 0.516 0.000
#> GSM494612     2  0.0000      0.898 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494558     4  0.5088      0.776 0.000 0.000 0.200 0.632 0.000 0.168
#> GSM494556     5  0.5253      0.693 0.000 0.200 0.000 0.192 0.608 0.000
#> GSM494559     5  0.0000      0.750 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494571     3  0.1714      0.904 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM494614     5  0.0547      0.751 0.000 0.000 0.000 0.020 0.980 0.000
#> GSM494603     5  0.0000      0.750 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494568     6  0.1765      0.849 0.000 0.000 0.000 0.000 0.096 0.904
#> GSM494572     3  0.1714      0.904 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM494600     5  0.0000      0.750 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494562     2  0.0363      0.899 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM494615     5  0.4959      0.494 0.000 0.032 0.000 0.032 0.608 0.328
#> GSM494582     2  0.0000      0.898 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494599     2  0.0363      0.899 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM494610     2  0.0000      0.898 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494587     2  0.4728      0.542 0.000 0.680 0.000 0.176 0.144 0.000
#> GSM494581     2  0.4064      0.219 0.000 0.624 0.000 0.016 0.360 0.000
#> GSM494580     5  0.5138      0.683 0.000 0.124 0.000 0.276 0.600 0.000
#> GSM494563     5  0.0000      0.750 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494576     5  0.5388      0.668 0.000 0.228 0.000 0.188 0.584 0.000
#> GSM494605     1  0.3489      0.586 0.708 0.000 0.000 0.004 0.000 0.288
#> GSM494584     5  0.5300      0.684 0.000 0.212 0.000 0.188 0.600 0.000
#> GSM494586     2  0.0363      0.899 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM494578     5  0.5254      0.695 0.000 0.196 0.000 0.196 0.608 0.000
#> GSM494585     2  0.0725      0.893 0.000 0.976 0.000 0.012 0.012 0.000
#> GSM494611     2  0.0000      0.898 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494560     5  0.0146      0.749 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM494595     2  0.0260      0.900 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM494570     5  0.0632      0.742 0.000 0.000 0.000 0.000 0.976 0.024
#> GSM494597     3  0.1714      0.904 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM494607     2  0.0508      0.898 0.004 0.984 0.000 0.000 0.012 0.000
#> GSM494561     5  0.2793      0.621 0.000 0.000 0.000 0.000 0.800 0.200
#> GSM494569     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494592     2  0.0363      0.899 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM494577     5  0.5502      0.476 0.000 0.364 0.000 0.136 0.500 0.000
#> GSM494588     5  0.0000      0.750 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494590     3  0.0000      0.940 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494609     2  0.1471      0.851 0.000 0.932 0.000 0.004 0.064 0.000
#> GSM494608     2  0.4209      0.122 0.000 0.596 0.000 0.020 0.384 0.000
#> GSM494606     2  0.0363      0.899 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM494574     2  0.0000      0.898 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494573     5  0.0000      0.750 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM494566     5  0.4703      0.566 0.000 0.032 0.000 0.032 0.668 0.268
#> GSM494601     2  0.5484      0.195 0.000 0.588 0.196 0.212 0.004 0.000
#> GSM494557     5  0.5300      0.685 0.000 0.212 0.000 0.188 0.600 0.000
#> GSM494579     5  0.4745      0.568 0.000 0.348 0.000 0.028 0.604 0.020
#> GSM494596     3  0.0000      0.940 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494575     2  0.0000      0.898 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM494625     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494654     3  0.0000      0.940 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494664     1  0.3807      0.462 0.628 0.000 0.000 0.004 0.000 0.368
#> GSM494624     6  0.0146      0.969 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM494651     4  0.2793      0.767 0.000 0.000 0.200 0.800 0.000 0.000
#> GSM494662     6  0.0146      0.968 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM494627     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494673     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494649     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494658     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494653     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494643     6  0.2887      0.798 0.120 0.000 0.000 0.036 0.000 0.844
#> GSM494672     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494618     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494631     5  0.5253      0.696 0.000 0.192 0.000 0.200 0.608 0.000
#> GSM494619     6  0.2191      0.825 0.120 0.000 0.000 0.004 0.000 0.876
#> GSM494674     1  0.0260      0.901 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM494616     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494663     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494628     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494632     1  0.3907      0.354 0.588 0.000 0.000 0.004 0.000 0.408
#> GSM494660     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494622     6  0.0520      0.960 0.008 0.000 0.000 0.008 0.000 0.984
#> GSM494642     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494647     1  0.0260      0.901 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM494659     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494670     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494675     5  0.5363      0.695 0.000 0.196 0.000 0.192 0.608 0.004
#> GSM494641     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494636     6  0.0713      0.944 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM494640     4  0.5088      0.776 0.000 0.000 0.200 0.632 0.000 0.168
#> GSM494623     6  0.0405      0.963 0.008 0.000 0.000 0.004 0.000 0.988
#> GSM494644     1  0.0260      0.901 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM494646     1  0.0622      0.893 0.980 0.000 0.000 0.008 0.000 0.012
#> GSM494665     1  0.3337      0.625 0.736 0.000 0.000 0.004 0.000 0.260
#> GSM494638     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494645     1  0.0622      0.893 0.980 0.000 0.000 0.008 0.000 0.012
#> GSM494671     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494655     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494620     6  0.0146      0.969 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM494630     6  0.0146      0.968 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM494657     3  0.0000      0.940 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM494667     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494621     6  0.0146      0.969 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM494629     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494637     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494652     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494648     6  0.0146      0.969 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM494650     4  0.2793      0.767 0.000 0.000 0.200 0.800 0.000 0.000
#> GSM494669     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494666     1  0.2964      0.695 0.792 0.000 0.000 0.004 0.000 0.204
#> GSM494668     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494633     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494634     1  0.0000      0.903 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM494639     6  0.2320      0.810 0.132 0.000 0.000 0.004 0.000 0.864
#> GSM494661     1  0.5624      0.178 0.536 0.000 0.200 0.264 0.000 0.000
#> GSM494617     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494626     6  0.0000      0.970 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM494656     3  0.1714      0.904 0.000 0.000 0.908 0.092 0.000 0.000
#> GSM494635     1  0.0146      0.902 0.996 0.000 0.000 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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-mclust-collect-classes

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

test_to_known_factors(res)
#>              n disease.state(p) age(p) other(p) individual(p) k
#> ATC:mclust 113         4.02e-19 0.9996 1.78e-14         1.000 2
#> ATC:mclust  97         1.08e-15 0.2897 1.69e-10         0.596 3
#> ATC:mclust 114         4.40e-17 0.2582 2.18e-09         0.558 4
#> ATC:mclust 113         1.94e-15 0.2384 4.91e-09         0.269 5
#> ATC:mclust 112         1.80e-15 0.0408 2.07e-08         0.546 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 51941 rows and 120 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk ATC-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.898           0.937       0.973         0.4773 0.516   0.516
#> 3 3 0.649           0.841       0.895         0.3674 0.687   0.461
#> 4 4 0.655           0.542       0.761         0.1016 0.754   0.424
#> 5 5 0.631           0.587       0.783         0.0706 0.834   0.512
#> 6 6 0.608           0.498       0.705         0.0579 0.871   0.522

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
#> GSM494565     2   0.552     0.8586 0.128 0.872
#> GSM494594     2   0.000     0.9483 0.000 1.000
#> GSM494604     1   0.000     0.9865 1.000 0.000
#> GSM494564     1   0.000     0.9865 1.000 0.000
#> GSM494591     2   0.000     0.9483 0.000 1.000
#> GSM494567     2   0.000     0.9483 0.000 1.000
#> GSM494602     1   0.000     0.9865 1.000 0.000
#> GSM494613     2   0.000     0.9483 0.000 1.000
#> GSM494589     2   0.311     0.9142 0.056 0.944
#> GSM494598     1   0.000     0.9865 1.000 0.000
#> GSM494593     1   0.000     0.9865 1.000 0.000
#> GSM494583     2   0.000     0.9483 0.000 1.000
#> GSM494612     1   0.995     0.0471 0.540 0.460
#> GSM494558     2   0.000     0.9483 0.000 1.000
#> GSM494556     2   0.000     0.9483 0.000 1.000
#> GSM494559     1   0.000     0.9865 1.000 0.000
#> GSM494571     2   0.000     0.9483 0.000 1.000
#> GSM494614     2   0.000     0.9483 0.000 1.000
#> GSM494603     1   0.000     0.9865 1.000 0.000
#> GSM494568     1   0.000     0.9865 1.000 0.000
#> GSM494572     2   0.000     0.9483 0.000 1.000
#> GSM494600     2   0.118     0.9395 0.016 0.984
#> GSM494562     2   0.000     0.9483 0.000 1.000
#> GSM494615     2   0.839     0.6787 0.268 0.732
#> GSM494582     2   0.909     0.5768 0.324 0.676
#> GSM494599     1   0.000     0.9865 1.000 0.000
#> GSM494610     2   0.518     0.8686 0.116 0.884
#> GSM494587     2   0.000     0.9483 0.000 1.000
#> GSM494581     2   0.000     0.9483 0.000 1.000
#> GSM494580     2   0.000     0.9483 0.000 1.000
#> GSM494563     1   0.000     0.9865 1.000 0.000
#> GSM494576     2   0.000     0.9483 0.000 1.000
#> GSM494605     1   0.000     0.9865 1.000 0.000
#> GSM494584     2   0.000     0.9483 0.000 1.000
#> GSM494586     2   0.000     0.9483 0.000 1.000
#> GSM494578     2   0.000     0.9483 0.000 1.000
#> GSM494585     2   0.000     0.9483 0.000 1.000
#> GSM494611     1   0.000     0.9865 1.000 0.000
#> GSM494560     1   0.184     0.9571 0.972 0.028
#> GSM494595     2   0.443     0.8883 0.092 0.908
#> GSM494570     1   0.000     0.9865 1.000 0.000
#> GSM494597     2   0.000     0.9483 0.000 1.000
#> GSM494607     1   0.000     0.9865 1.000 0.000
#> GSM494561     1   0.000     0.9865 1.000 0.000
#> GSM494569     1   0.000     0.9865 1.000 0.000
#> GSM494592     1   0.000     0.9865 1.000 0.000
#> GSM494577     2   0.000     0.9483 0.000 1.000
#> GSM494588     1   0.000     0.9865 1.000 0.000
#> GSM494590     2   0.000     0.9483 0.000 1.000
#> GSM494609     1   0.000     0.9865 1.000 0.000
#> GSM494608     2   0.671     0.8076 0.176 0.824
#> GSM494606     1   0.000     0.9865 1.000 0.000
#> GSM494574     2   0.644     0.8215 0.164 0.836
#> GSM494573     1   0.000     0.9865 1.000 0.000
#> GSM494566     1   0.000     0.9865 1.000 0.000
#> GSM494601     2   0.000     0.9483 0.000 1.000
#> GSM494557     2   0.000     0.9483 0.000 1.000
#> GSM494579     1   0.000     0.9865 1.000 0.000
#> GSM494596     2   0.000     0.9483 0.000 1.000
#> GSM494575     2   0.653     0.8171 0.168 0.832
#> GSM494625     1   0.000     0.9865 1.000 0.000
#> GSM494654     2   0.000     0.9483 0.000 1.000
#> GSM494664     1   0.000     0.9865 1.000 0.000
#> GSM494624     1   0.000     0.9865 1.000 0.000
#> GSM494651     2   0.000     0.9483 0.000 1.000
#> GSM494662     1   0.000     0.9865 1.000 0.000
#> GSM494627     1   0.971     0.2694 0.600 0.400
#> GSM494673     1   0.000     0.9865 1.000 0.000
#> GSM494649     1   0.000     0.9865 1.000 0.000
#> GSM494658     1   0.000     0.9865 1.000 0.000
#> GSM494653     1   0.000     0.9865 1.000 0.000
#> GSM494643     2   0.506     0.8726 0.112 0.888
#> GSM494672     1   0.000     0.9865 1.000 0.000
#> GSM494618     1   0.000     0.9865 1.000 0.000
#> GSM494631     2   0.000     0.9483 0.000 1.000
#> GSM494619     1   0.000     0.9865 1.000 0.000
#> GSM494674     1   0.000     0.9865 1.000 0.000
#> GSM494616     1   0.000     0.9865 1.000 0.000
#> GSM494663     1   0.000     0.9865 1.000 0.000
#> GSM494628     1   0.000     0.9865 1.000 0.000
#> GSM494632     1   0.000     0.9865 1.000 0.000
#> GSM494660     1   0.000     0.9865 1.000 0.000
#> GSM494622     2   0.844     0.6730 0.272 0.728
#> GSM494642     1   0.000     0.9865 1.000 0.000
#> GSM494647     1   0.000     0.9865 1.000 0.000
#> GSM494659     1   0.000     0.9865 1.000 0.000
#> GSM494670     1   0.000     0.9865 1.000 0.000
#> GSM494675     2   0.000     0.9483 0.000 1.000
#> GSM494641     1   0.000     0.9865 1.000 0.000
#> GSM494636     1   0.000     0.9865 1.000 0.000
#> GSM494640     2   0.000     0.9483 0.000 1.000
#> GSM494623     1   0.000     0.9865 1.000 0.000
#> GSM494644     1   0.000     0.9865 1.000 0.000
#> GSM494646     1   0.000     0.9865 1.000 0.000
#> GSM494665     1   0.000     0.9865 1.000 0.000
#> GSM494638     1   0.000     0.9865 1.000 0.000
#> GSM494645     1   0.000     0.9865 1.000 0.000
#> GSM494671     1   0.000     0.9865 1.000 0.000
#> GSM494655     1   0.000     0.9865 1.000 0.000
#> GSM494620     1   0.000     0.9865 1.000 0.000
#> GSM494630     1   0.000     0.9865 1.000 0.000
#> GSM494657     2   0.000     0.9483 0.000 1.000
#> GSM494667     1   0.000     0.9865 1.000 0.000
#> GSM494621     1   0.000     0.9865 1.000 0.000
#> GSM494629     2   0.141     0.9375 0.020 0.980
#> GSM494637     2   0.998     0.1621 0.476 0.524
#> GSM494652     1   0.000     0.9865 1.000 0.000
#> GSM494648     1   0.000     0.9865 1.000 0.000
#> GSM494650     2   0.000     0.9483 0.000 1.000
#> GSM494669     1   0.000     0.9865 1.000 0.000
#> GSM494666     1   0.000     0.9865 1.000 0.000
#> GSM494668     1   0.000     0.9865 1.000 0.000
#> GSM494633     1   0.000     0.9865 1.000 0.000
#> GSM494634     1   0.000     0.9865 1.000 0.000
#> GSM494639     1   0.000     0.9865 1.000 0.000
#> GSM494661     2   0.000     0.9483 0.000 1.000
#> GSM494617     1   0.000     0.9865 1.000 0.000
#> GSM494626     1   0.000     0.9865 1.000 0.000
#> GSM494656     2   0.000     0.9483 0.000 1.000
#> GSM494635     1   0.000     0.9865 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
#> GSM494565     3  0.6794    0.66204 0.028 0.324 0.648
#> GSM494594     3  0.4346    0.88760 0.000 0.184 0.816
#> GSM494604     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494564     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494591     3  0.4346    0.88760 0.000 0.184 0.816
#> GSM494567     3  0.0000    0.84512 0.000 0.000 1.000
#> GSM494602     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494613     3  0.4346    0.88760 0.000 0.184 0.816
#> GSM494589     3  0.5560    0.47966 0.300 0.000 0.700
#> GSM494598     2  0.0000    0.83669 0.000 1.000 0.000
#> GSM494593     2  0.3551    0.86502 0.132 0.868 0.000
#> GSM494583     2  0.5431    0.35048 0.000 0.716 0.284
#> GSM494612     2  0.0000    0.83669 0.000 1.000 0.000
#> GSM494558     3  0.0000    0.84512 0.000 0.000 1.000
#> GSM494556     3  0.4346    0.88760 0.000 0.184 0.816
#> GSM494559     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494571     3  0.0000    0.84512 0.000 0.000 1.000
#> GSM494614     3  0.5733    0.68987 0.000 0.324 0.676
#> GSM494603     1  0.0892    0.92970 0.980 0.000 0.020
#> GSM494568     1  0.4452    0.76961 0.808 0.000 0.192
#> GSM494572     3  0.0892    0.85387 0.000 0.020 0.980
#> GSM494600     3  0.2356    0.80540 0.072 0.000 0.928
#> GSM494562     2  0.0000    0.83669 0.000 1.000 0.000
#> GSM494615     3  0.0592    0.84375 0.012 0.000 0.988
#> GSM494582     2  0.0000    0.83669 0.000 1.000 0.000
#> GSM494599     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494610     2  0.0000    0.83669 0.000 1.000 0.000
#> GSM494587     2  0.1643    0.79702 0.000 0.956 0.044
#> GSM494581     2  0.0000    0.83669 0.000 1.000 0.000
#> GSM494580     3  0.4291    0.88836 0.000 0.180 0.820
#> GSM494563     1  0.5760    0.39490 0.672 0.328 0.000
#> GSM494576     2  0.1289    0.80955 0.000 0.968 0.032
#> GSM494605     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494584     3  0.4974    0.84764 0.000 0.236 0.764
#> GSM494586     2  0.0000    0.83669 0.000 1.000 0.000
#> GSM494578     3  0.2537    0.87611 0.000 0.080 0.920
#> GSM494585     2  0.0237    0.83409 0.000 0.996 0.004
#> GSM494611     2  0.0237    0.83799 0.004 0.996 0.000
#> GSM494560     1  0.6509    0.00275 0.524 0.004 0.472
#> GSM494595     2  0.0000    0.83669 0.000 1.000 0.000
#> GSM494570     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494597     3  0.4062    0.88998 0.000 0.164 0.836
#> GSM494607     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494561     1  0.4178    0.78794 0.828 0.000 0.172
#> GSM494569     1  0.2448    0.88861 0.924 0.000 0.076
#> GSM494592     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494577     2  0.0237    0.83409 0.000 0.996 0.004
#> GSM494588     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494590     3  0.4346    0.88760 0.000 0.184 0.816
#> GSM494609     2  0.3686    0.86569 0.140 0.860 0.000
#> GSM494608     2  0.0000    0.83669 0.000 1.000 0.000
#> GSM494606     2  0.4235    0.86285 0.176 0.824 0.000
#> GSM494574     2  0.0000    0.83669 0.000 1.000 0.000
#> GSM494573     1  0.1411    0.91981 0.964 0.000 0.036
#> GSM494566     1  0.2356    0.89648 0.928 0.000 0.072
#> GSM494601     2  0.0237    0.83409 0.000 0.996 0.004
#> GSM494557     3  0.4346    0.88760 0.000 0.184 0.816
#> GSM494579     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494596     3  0.4346    0.88760 0.000 0.184 0.816
#> GSM494575     2  0.0000    0.83669 0.000 1.000 0.000
#> GSM494625     1  0.0237    0.93671 0.996 0.000 0.004
#> GSM494654     3  0.4291    0.88836 0.000 0.180 0.820
#> GSM494664     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494624     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494651     3  0.2625    0.87711 0.000 0.084 0.916
#> GSM494662     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494627     3  0.5497    0.49574 0.292 0.000 0.708
#> GSM494673     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494649     1  0.0592    0.93347 0.988 0.000 0.012
#> GSM494658     2  0.4291    0.86206 0.180 0.820 0.000
#> GSM494653     2  0.4750    0.82991 0.216 0.784 0.000
#> GSM494643     3  0.4805    0.88717 0.012 0.176 0.812
#> GSM494672     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494618     1  0.3879    0.81869 0.848 0.000 0.152
#> GSM494631     3  0.3816    0.88914 0.000 0.148 0.852
#> GSM494619     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494674     2  0.4452    0.85441 0.192 0.808 0.000
#> GSM494616     1  0.1529    0.91707 0.960 0.000 0.040
#> GSM494663     1  0.0424    0.93530 0.992 0.000 0.008
#> GSM494628     1  0.3482    0.83816 0.872 0.000 0.128
#> GSM494632     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494660     1  0.0424    0.93529 0.992 0.000 0.008
#> GSM494622     3  0.4902    0.85880 0.064 0.092 0.844
#> GSM494642     2  0.4452    0.85453 0.192 0.808 0.000
#> GSM494647     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494659     2  0.6309    0.21903 0.500 0.500 0.000
#> GSM494670     2  0.2878    0.85888 0.096 0.904 0.000
#> GSM494675     3  0.4002    0.88991 0.000 0.160 0.840
#> GSM494641     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494636     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494640     3  0.3340    0.88553 0.000 0.120 0.880
#> GSM494623     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494644     2  0.4291    0.86206 0.180 0.820 0.000
#> GSM494646     1  0.0892    0.92493 0.980 0.020 0.000
#> GSM494665     1  0.0237    0.93580 0.996 0.004 0.000
#> GSM494638     1  0.1860    0.90483 0.948 0.000 0.052
#> GSM494645     2  0.4750    0.83000 0.216 0.784 0.000
#> GSM494671     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494655     1  0.0237    0.93580 0.996 0.004 0.000
#> GSM494620     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494630     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494657     3  0.4346    0.88760 0.000 0.184 0.816
#> GSM494667     1  0.0892    0.92436 0.980 0.020 0.000
#> GSM494621     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494629     3  0.2066    0.81507 0.060 0.000 0.940
#> GSM494637     3  0.5178    0.56487 0.256 0.000 0.744
#> GSM494652     1  0.4235    0.73046 0.824 0.176 0.000
#> GSM494648     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494650     3  0.4346    0.88760 0.000 0.184 0.816
#> GSM494669     1  0.2711    0.85457 0.912 0.088 0.000
#> GSM494666     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494668     2  0.4399    0.85780 0.188 0.812 0.000
#> GSM494633     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494634     2  0.4346    0.86082 0.184 0.816 0.000
#> GSM494639     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494661     2  0.0237    0.83409 0.000 0.996 0.004
#> GSM494617     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494626     1  0.0000    0.93793 1.000 0.000 0.000
#> GSM494656     3  0.3941    0.88979 0.000 0.156 0.844
#> GSM494635     1  0.5327    0.54672 0.728 0.272 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM494565     4  0.4955    -0.7388 0.000 0.444 0.000 0.556
#> GSM494594     3  0.4967     0.7889 0.000 0.452 0.548 0.000
#> GSM494604     4  0.7677    -0.4462 0.248 0.296 0.000 0.456
#> GSM494564     4  0.5511     0.0941 0.332 0.000 0.032 0.636
#> GSM494591     3  0.4967     0.7889 0.000 0.452 0.548 0.000
#> GSM494567     4  0.4985     0.2393 0.000 0.000 0.468 0.532
#> GSM494602     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494613     3  0.5010     0.4034 0.000 0.108 0.772 0.120
#> GSM494589     4  0.5137     0.2519 0.004 0.000 0.452 0.544
#> GSM494598     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494593     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494583     2  0.5592     0.7475 0.000 0.572 0.024 0.404
#> GSM494612     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494558     3  0.1022     0.5861 0.000 0.000 0.968 0.032
#> GSM494556     4  0.5894    -0.6865 0.000 0.428 0.036 0.536
#> GSM494559     4  0.2846     0.3301 0.028 0.012 0.052 0.908
#> GSM494571     3  0.0817     0.5930 0.000 0.000 0.976 0.024
#> GSM494614     4  0.4961    -0.7554 0.000 0.448 0.000 0.552
#> GSM494603     4  0.5444     0.3749 0.048 0.000 0.264 0.688
#> GSM494568     4  0.7197     0.2819 0.140 0.000 0.392 0.468
#> GSM494572     3  0.0672     0.6105 0.000 0.008 0.984 0.008
#> GSM494600     4  0.5126     0.2583 0.004 0.000 0.444 0.552
#> GSM494562     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494615     4  0.4998     0.2185 0.000 0.000 0.488 0.512
#> GSM494582     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494599     2  0.5850     0.8349 0.032 0.512 0.000 0.456
#> GSM494610     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494587     2  0.5132     0.8673 0.000 0.548 0.004 0.448
#> GSM494581     2  0.5155     0.8557 0.000 0.528 0.004 0.468
#> GSM494580     3  0.4948     0.7876 0.000 0.440 0.560 0.000
#> GSM494563     4  0.5217    -0.6305 0.012 0.380 0.000 0.608
#> GSM494576     2  0.4994     0.8439 0.000 0.520 0.000 0.480
#> GSM494605     1  0.0000     0.7902 1.000 0.000 0.000 0.000
#> GSM494584     2  0.7287     0.5603 0.000 0.464 0.152 0.384
#> GSM494586     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494578     3  0.0524     0.6079 0.000 0.004 0.988 0.008
#> GSM494585     2  0.5143     0.8745 0.000 0.540 0.004 0.456
#> GSM494611     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494560     4  0.3662    -0.0567 0.004 0.148 0.012 0.836
#> GSM494595     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494570     4  0.5000    -0.3475 0.496 0.000 0.000 0.504
#> GSM494597     3  0.2011     0.6577 0.000 0.080 0.920 0.000
#> GSM494607     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494561     4  0.7483     0.1283 0.288 0.000 0.216 0.496
#> GSM494569     1  0.5220     0.4275 0.568 0.000 0.008 0.424
#> GSM494592     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494577     2  0.5285     0.8438 0.000 0.524 0.008 0.468
#> GSM494588     4  0.4605     0.0985 0.336 0.000 0.000 0.664
#> GSM494590     3  0.4972     0.7874 0.000 0.456 0.544 0.000
#> GSM494609     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494608     2  0.4977     0.8745 0.000 0.540 0.000 0.460
#> GSM494606     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494574     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494573     4  0.3043     0.3687 0.008 0.004 0.112 0.876
#> GSM494566     4  0.4562     0.3653 0.036 0.028 0.116 0.820
#> GSM494601     2  0.3444    -0.3474 0.000 0.816 0.184 0.000
#> GSM494557     3  0.7244     0.5535 0.000 0.212 0.544 0.244
#> GSM494579     2  0.5137     0.8730 0.004 0.544 0.000 0.452
#> GSM494596     3  0.4967     0.7889 0.000 0.452 0.548 0.000
#> GSM494575     2  0.4972     0.8777 0.000 0.544 0.000 0.456
#> GSM494625     1  0.4888     0.4462 0.588 0.000 0.000 0.412
#> GSM494654     3  0.4967     0.7889 0.000 0.452 0.548 0.000
#> GSM494664     1  0.0000     0.7902 1.000 0.000 0.000 0.000
#> GSM494624     1  0.4643     0.5356 0.656 0.000 0.000 0.344
#> GSM494651     3  0.4967     0.7873 0.000 0.452 0.548 0.000
#> GSM494662     1  0.4431     0.5835 0.696 0.000 0.000 0.304
#> GSM494627     1  0.7888     0.0591 0.368 0.000 0.288 0.344
#> GSM494673     1  0.2984     0.7277 0.888 0.084 0.000 0.028
#> GSM494649     1  0.4977     0.3707 0.540 0.000 0.000 0.460
#> GSM494658     4  0.7692    -0.4129 0.268 0.276 0.000 0.456
#> GSM494653     1  0.1398     0.7788 0.956 0.040 0.000 0.004
#> GSM494643     3  0.5472     0.7802 0.016 0.440 0.544 0.000
#> GSM494672     1  0.6982     0.1982 0.576 0.172 0.000 0.252
#> GSM494618     1  0.4050     0.7076 0.808 0.000 0.024 0.168
#> GSM494631     3  0.3569     0.7105 0.000 0.196 0.804 0.000
#> GSM494619     1  0.0707     0.7883 0.980 0.000 0.000 0.020
#> GSM494674     1  0.1398     0.7791 0.956 0.040 0.000 0.004
#> GSM494616     1  0.4916     0.4338 0.576 0.000 0.000 0.424
#> GSM494663     1  0.4855     0.4697 0.600 0.000 0.000 0.400
#> GSM494628     1  0.5050     0.4561 0.588 0.000 0.004 0.408
#> GSM494632     1  0.0592     0.7882 0.984 0.000 0.016 0.000
#> GSM494660     1  0.4977     0.3721 0.540 0.000 0.000 0.460
#> GSM494622     3  0.7142     0.4030 0.324 0.152 0.524 0.000
#> GSM494642     1  0.1576     0.7747 0.948 0.048 0.000 0.004
#> GSM494647     1  0.1743     0.7694 0.940 0.056 0.000 0.004
#> GSM494659     1  0.0804     0.7879 0.980 0.012 0.000 0.008
#> GSM494670     1  0.7542     0.0235 0.488 0.232 0.000 0.280
#> GSM494675     4  0.7500    -0.4679 0.000 0.404 0.180 0.416
#> GSM494641     1  0.3082     0.7239 0.884 0.084 0.000 0.032
#> GSM494636     1  0.0188     0.7903 0.996 0.000 0.004 0.000
#> GSM494640     3  0.4967     0.7889 0.000 0.452 0.548 0.000
#> GSM494623     1  0.1716     0.7737 0.936 0.000 0.000 0.064
#> GSM494644     1  0.2125     0.7592 0.920 0.076 0.004 0.000
#> GSM494646     1  0.0000     0.7902 1.000 0.000 0.000 0.000
#> GSM494665     1  0.0469     0.7895 0.988 0.000 0.000 0.012
#> GSM494638     1  0.1557     0.7728 0.944 0.000 0.056 0.000
#> GSM494645     1  0.1151     0.7851 0.968 0.024 0.008 0.000
#> GSM494671     1  0.4727     0.6032 0.792 0.108 0.000 0.100
#> GSM494655     1  0.0000     0.7902 1.000 0.000 0.000 0.000
#> GSM494620     1  0.1118     0.7843 0.964 0.000 0.000 0.036
#> GSM494630     1  0.4804     0.4870 0.616 0.000 0.000 0.384
#> GSM494657     3  0.4967     0.7889 0.000 0.452 0.548 0.000
#> GSM494667     1  0.0188     0.7902 0.996 0.000 0.000 0.004
#> GSM494621     1  0.3528     0.6907 0.808 0.000 0.000 0.192
#> GSM494629     3  0.4996    -0.2519 0.000 0.000 0.516 0.484
#> GSM494637     4  0.7863    -0.0519 0.344 0.000 0.276 0.380
#> GSM494652     1  0.0336     0.7900 0.992 0.000 0.000 0.008
#> GSM494648     1  0.1792     0.7720 0.932 0.000 0.000 0.068
#> GSM494650     3  0.4972     0.7874 0.000 0.456 0.544 0.000
#> GSM494669     1  0.0188     0.7902 0.996 0.000 0.000 0.004
#> GSM494666     1  0.0000     0.7902 1.000 0.000 0.000 0.000
#> GSM494668     1  0.1854     0.7703 0.940 0.048 0.000 0.012
#> GSM494633     1  0.4977     0.3707 0.540 0.000 0.000 0.460
#> GSM494634     1  0.4411     0.6352 0.812 0.108 0.000 0.080
#> GSM494639     1  0.0000     0.7902 1.000 0.000 0.000 0.000
#> GSM494661     2  0.5000    -0.7892 0.000 0.504 0.496 0.000
#> GSM494617     1  0.1389     0.7830 0.952 0.000 0.000 0.048
#> GSM494626     1  0.3024     0.7304 0.852 0.000 0.000 0.148
#> GSM494656     3  0.4961     0.7887 0.000 0.448 0.552 0.000
#> GSM494635     1  0.0592     0.7889 0.984 0.016 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
#> GSM494565     5  0.4066     0.7177 0.000 0.324 0.000 0.004 0.672
#> GSM494594     3  0.0290     0.7992 0.000 0.000 0.992 0.000 0.008
#> GSM494604     2  0.3561     0.6154 0.260 0.740 0.000 0.000 0.000
#> GSM494564     5  0.2110     0.5708 0.072 0.000 0.000 0.016 0.912
#> GSM494591     3  0.0510     0.7981 0.000 0.000 0.984 0.000 0.016
#> GSM494567     4  0.5006     0.3237 0.000 0.000 0.048 0.624 0.328
#> GSM494602     2  0.3074     0.4616 0.000 0.804 0.000 0.000 0.196
#> GSM494613     5  0.7517     0.5569 0.000 0.244 0.084 0.180 0.492
#> GSM494589     5  0.1894     0.6112 0.000 0.008 0.000 0.072 0.920
#> GSM494598     2  0.1168     0.6719 0.000 0.960 0.000 0.008 0.032
#> GSM494593     2  0.1908     0.6235 0.000 0.908 0.000 0.000 0.092
#> GSM494583     3  0.6991    -0.0244 0.000 0.264 0.436 0.012 0.288
#> GSM494612     2  0.0865     0.6819 0.000 0.972 0.000 0.024 0.004
#> GSM494558     4  0.1478     0.6985 0.000 0.000 0.064 0.936 0.000
#> GSM494556     5  0.4565     0.7022 0.000 0.352 0.008 0.008 0.632
#> GSM494559     5  0.1478     0.6673 0.000 0.064 0.000 0.000 0.936
#> GSM494571     4  0.4617     0.4356 0.000 0.000 0.224 0.716 0.060
#> GSM494614     5  0.4565     0.6989 0.000 0.352 0.008 0.008 0.632
#> GSM494603     5  0.6865     0.5506 0.012 0.200 0.012 0.240 0.536
#> GSM494568     4  0.1444     0.7113 0.012 0.000 0.040 0.948 0.000
#> GSM494572     3  0.4907     0.5288 0.000 0.000 0.656 0.292 0.052
#> GSM494600     5  0.2130     0.6786 0.000 0.080 0.000 0.012 0.908
#> GSM494562     2  0.3232     0.6066 0.000 0.864 0.084 0.016 0.036
#> GSM494615     4  0.2358     0.7093 0.012 0.004 0.048 0.916 0.020
#> GSM494582     2  0.1117     0.6767 0.000 0.964 0.000 0.016 0.020
#> GSM494599     2  0.3003     0.6653 0.188 0.812 0.000 0.000 0.000
#> GSM494610     2  0.1082     0.6812 0.000 0.964 0.000 0.028 0.008
#> GSM494587     2  0.4230     0.5565 0.000 0.780 0.164 0.012 0.044
#> GSM494581     5  0.3999     0.7060 0.000 0.344 0.000 0.000 0.656
#> GSM494580     3  0.0162     0.7980 0.000 0.000 0.996 0.004 0.000
#> GSM494563     5  0.3809     0.7361 0.008 0.256 0.000 0.000 0.736
#> GSM494576     5  0.4060     0.6947 0.000 0.360 0.000 0.000 0.640
#> GSM494605     1  0.0703     0.7248 0.976 0.024 0.000 0.000 0.000
#> GSM494584     3  0.4181     0.5656 0.000 0.268 0.712 0.000 0.020
#> GSM494586     3  0.6778     0.1484 0.000 0.400 0.448 0.032 0.120
#> GSM494578     3  0.4491     0.4867 0.000 0.000 0.652 0.328 0.020
#> GSM494585     2  0.6799    -0.4437 0.000 0.384 0.228 0.004 0.384
#> GSM494611     2  0.1012     0.6799 0.000 0.968 0.000 0.020 0.012
#> GSM494560     5  0.3480     0.7335 0.000 0.248 0.000 0.000 0.752
#> GSM494595     5  0.4291     0.5299 0.000 0.464 0.000 0.000 0.536
#> GSM494570     5  0.2997     0.4986 0.148 0.000 0.000 0.012 0.840
#> GSM494597     3  0.4615     0.5916 0.000 0.000 0.700 0.252 0.048
#> GSM494607     2  0.2280     0.6880 0.120 0.880 0.000 0.000 0.000
#> GSM494561     5  0.3736     0.4118 0.140 0.000 0.000 0.052 0.808
#> GSM494569     4  0.4426     0.3030 0.380 0.000 0.004 0.612 0.004
#> GSM494592     2  0.1478     0.6940 0.064 0.936 0.000 0.000 0.000
#> GSM494577     5  0.4418     0.7081 0.000 0.332 0.016 0.000 0.652
#> GSM494588     5  0.2124     0.5750 0.096 0.004 0.000 0.000 0.900
#> GSM494590     3  0.0290     0.7992 0.000 0.000 0.992 0.000 0.008
#> GSM494609     2  0.4310    -0.2213 0.004 0.604 0.000 0.000 0.392
#> GSM494608     5  0.4138     0.6674 0.000 0.384 0.000 0.000 0.616
#> GSM494606     2  0.1270     0.6605 0.000 0.948 0.000 0.000 0.052
#> GSM494574     2  0.0955     0.6825 0.000 0.968 0.000 0.028 0.004
#> GSM494573     5  0.1671     0.6775 0.000 0.076 0.000 0.000 0.924
#> GSM494566     2  0.6657     0.4268 0.196 0.564 0.028 0.212 0.000
#> GSM494601     3  0.1331     0.7830 0.000 0.008 0.952 0.040 0.000
#> GSM494557     3  0.5223     0.5363 0.000 0.220 0.672 0.000 0.108
#> GSM494579     2  0.2079     0.6920 0.064 0.916 0.000 0.000 0.020
#> GSM494596     3  0.0290     0.7992 0.000 0.000 0.992 0.000 0.008
#> GSM494575     2  0.0955     0.6825 0.000 0.968 0.000 0.028 0.004
#> GSM494625     1  0.4985     0.6064 0.680 0.000 0.000 0.076 0.244
#> GSM494654     3  0.0000     0.7980 0.000 0.000 1.000 0.000 0.000
#> GSM494664     1  0.1117     0.7287 0.964 0.020 0.000 0.000 0.016
#> GSM494624     1  0.3957     0.6197 0.712 0.000 0.000 0.008 0.280
#> GSM494651     3  0.1341     0.7811 0.000 0.000 0.944 0.056 0.000
#> GSM494662     1  0.2438     0.7172 0.900 0.000 0.000 0.040 0.060
#> GSM494627     4  0.6347     0.1380 0.372 0.000 0.032 0.516 0.080
#> GSM494673     2  0.4297     0.2035 0.472 0.528 0.000 0.000 0.000
#> GSM494649     1  0.4615     0.6219 0.700 0.000 0.000 0.048 0.252
#> GSM494658     2  0.3689     0.6169 0.256 0.740 0.000 0.004 0.000
#> GSM494653     1  0.1197     0.7183 0.952 0.048 0.000 0.000 0.000
#> GSM494643     3  0.6221     0.3762 0.168 0.004 0.620 0.016 0.192
#> GSM494672     2  0.3752     0.5855 0.292 0.708 0.000 0.000 0.000
#> GSM494618     1  0.4178     0.4635 0.696 0.000 0.008 0.292 0.004
#> GSM494631     3  0.2470     0.7484 0.000 0.000 0.884 0.104 0.012
#> GSM494619     1  0.3783     0.6404 0.740 0.000 0.000 0.008 0.252
#> GSM494674     1  0.2424     0.6732 0.868 0.132 0.000 0.000 0.000
#> GSM494616     1  0.3671     0.5607 0.756 0.000 0.000 0.236 0.008
#> GSM494663     1  0.5538     0.5810 0.672 0.000 0.008 0.148 0.172
#> GSM494628     1  0.4302     0.3904 0.648 0.000 0.004 0.344 0.004
#> GSM494632     1  0.1731     0.7246 0.940 0.000 0.012 0.008 0.040
#> GSM494660     1  0.4865     0.6108 0.684 0.000 0.000 0.064 0.252
#> GSM494622     1  0.5576     0.1432 0.536 0.000 0.388 0.076 0.000
#> GSM494642     1  0.3684     0.4825 0.720 0.280 0.000 0.000 0.000
#> GSM494647     1  0.1484     0.7191 0.944 0.048 0.000 0.008 0.000
#> GSM494659     1  0.4182     0.1690 0.600 0.400 0.000 0.000 0.000
#> GSM494670     2  0.4268     0.6073 0.268 0.708 0.000 0.024 0.000
#> GSM494675     2  0.5868     0.0368 0.020 0.472 0.052 0.456 0.000
#> GSM494641     1  0.3949     0.3732 0.668 0.332 0.000 0.000 0.000
#> GSM494636     1  0.3487     0.6640 0.780 0.000 0.000 0.008 0.212
#> GSM494640     3  0.1444     0.7818 0.000 0.000 0.948 0.012 0.040
#> GSM494623     1  0.3783     0.6404 0.740 0.000 0.000 0.008 0.252
#> GSM494644     1  0.1455     0.7255 0.952 0.008 0.008 0.032 0.000
#> GSM494646     1  0.0833     0.7279 0.976 0.004 0.000 0.004 0.016
#> GSM494665     1  0.3774     0.4397 0.704 0.296 0.000 0.000 0.000
#> GSM494638     1  0.0579     0.7268 0.984 0.000 0.008 0.008 0.000
#> GSM494645     1  0.1616     0.7265 0.948 0.008 0.004 0.032 0.008
#> GSM494671     2  0.3999     0.5040 0.344 0.656 0.000 0.000 0.000
#> GSM494655     1  0.0703     0.7248 0.976 0.024 0.000 0.000 0.000
#> GSM494620     1  0.3728     0.6456 0.748 0.000 0.000 0.008 0.244
#> GSM494630     1  0.4165     0.5808 0.672 0.000 0.000 0.008 0.320
#> GSM494657     3  0.0290     0.7992 0.000 0.000 0.992 0.000 0.008
#> GSM494667     1  0.2280     0.6796 0.880 0.120 0.000 0.000 0.000
#> GSM494621     1  0.3809     0.6377 0.736 0.000 0.000 0.008 0.256
#> GSM494629     4  0.1393     0.7078 0.024 0.000 0.012 0.956 0.008
#> GSM494637     1  0.6904     0.4728 0.564 0.000 0.080 0.108 0.248
#> GSM494652     1  0.2966     0.6277 0.816 0.184 0.000 0.000 0.000
#> GSM494648     1  0.3756     0.6430 0.744 0.000 0.000 0.008 0.248
#> GSM494650     3  0.1168     0.7868 0.000 0.008 0.960 0.032 0.000
#> GSM494669     1  0.2605     0.6591 0.852 0.148 0.000 0.000 0.000
#> GSM494666     1  0.0703     0.7248 0.976 0.024 0.000 0.000 0.000
#> GSM494668     1  0.4242     0.0832 0.572 0.428 0.000 0.000 0.000
#> GSM494633     1  0.4173     0.6004 0.688 0.000 0.000 0.012 0.300
#> GSM494634     2  0.4074     0.4646 0.364 0.636 0.000 0.000 0.000
#> GSM494639     1  0.0451     0.7281 0.988 0.004 0.000 0.000 0.008
#> GSM494661     3  0.1331     0.7830 0.000 0.008 0.952 0.040 0.000
#> GSM494617     1  0.2930     0.6356 0.832 0.004 0.000 0.164 0.000
#> GSM494626     1  0.3366     0.5842 0.784 0.004 0.000 0.212 0.000
#> GSM494656     3  0.0162     0.7980 0.000 0.000 0.996 0.004 0.000
#> GSM494635     1  0.0703     0.7248 0.976 0.024 0.000 0.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM494565     5  0.4261    0.64575 0.000 0.156 0.000 0.000 0.732 0.112
#> GSM494594     3  0.0748    0.78498 0.000 0.000 0.976 0.016 0.004 0.004
#> GSM494604     2  0.2884    0.66344 0.164 0.824 0.000 0.000 0.004 0.008
#> GSM494564     6  0.3699    0.51280 0.004 0.000 0.000 0.000 0.336 0.660
#> GSM494591     3  0.1237    0.78187 0.000 0.000 0.956 0.020 0.020 0.004
#> GSM494567     4  0.5062    0.11299 0.000 0.024 0.020 0.532 0.416 0.008
#> GSM494602     2  0.4082   -0.16111 0.004 0.560 0.000 0.000 0.432 0.004
#> GSM494613     5  0.7015    0.44245 0.000 0.140 0.100 0.220 0.520 0.020
#> GSM494589     6  0.4343    0.33934 0.000 0.004 0.008 0.004 0.456 0.528
#> GSM494598     2  0.1007    0.62943 0.000 0.956 0.000 0.000 0.044 0.000
#> GSM494593     2  0.3910    0.19479 0.008 0.660 0.000 0.000 0.328 0.004
#> GSM494583     5  0.5275    0.45351 0.000 0.088 0.316 0.000 0.584 0.012
#> GSM494612     2  0.1219    0.62543 0.000 0.948 0.000 0.000 0.048 0.004
#> GSM494558     4  0.2045    0.59731 0.000 0.000 0.052 0.916 0.016 0.016
#> GSM494556     5  0.6533    0.58010 0.004 0.284 0.024 0.064 0.548 0.076
#> GSM494559     6  0.3993    0.34857 0.000 0.004 0.000 0.000 0.476 0.520
#> GSM494571     4  0.5064    0.38660 0.000 0.000 0.232 0.668 0.056 0.044
#> GSM494614     5  0.3981    0.66375 0.000 0.144 0.000 0.008 0.772 0.076
#> GSM494603     5  0.6983    0.05062 0.060 0.052 0.000 0.356 0.452 0.080
#> GSM494568     4  0.2040    0.61579 0.004 0.004 0.000 0.904 0.004 0.084
#> GSM494572     4  0.5385    0.04513 0.000 0.000 0.412 0.504 0.064 0.020
#> GSM494600     6  0.4225    0.33354 0.000 0.004 0.008 0.000 0.480 0.508
#> GSM494562     2  0.3260    0.56162 0.000 0.832 0.092 0.000 0.072 0.004
#> GSM494615     4  0.4336    0.59635 0.096 0.016 0.004 0.792 0.060 0.032
#> GSM494582     2  0.1970    0.59538 0.000 0.900 0.000 0.000 0.092 0.008
#> GSM494599     2  0.3499    0.56008 0.264 0.728 0.000 0.000 0.004 0.004
#> GSM494610     2  0.3372    0.55866 0.000 0.816 0.000 0.000 0.100 0.084
#> GSM494587     2  0.5221    0.13471 0.004 0.544 0.380 0.000 0.064 0.008
#> GSM494581     5  0.3037    0.69588 0.000 0.160 0.004 0.000 0.820 0.016
#> GSM494580     3  0.1760    0.78290 0.004 0.000 0.936 0.028 0.012 0.020
#> GSM494563     6  0.4460    0.33480 0.000 0.028 0.000 0.000 0.452 0.520
#> GSM494576     5  0.5055    0.67340 0.000 0.164 0.048 0.000 0.700 0.088
#> GSM494605     1  0.3041    0.68916 0.832 0.128 0.000 0.000 0.000 0.040
#> GSM494584     3  0.6794   -0.10626 0.004 0.192 0.444 0.012 0.320 0.028
#> GSM494586     3  0.6742    0.08823 0.004 0.312 0.460 0.000 0.164 0.060
#> GSM494578     4  0.6229    0.28179 0.004 0.000 0.196 0.464 0.324 0.012
#> GSM494585     5  0.6278    0.46930 0.004 0.256 0.280 0.000 0.452 0.008
#> GSM494611     2  0.0713    0.63435 0.000 0.972 0.000 0.000 0.028 0.000
#> GSM494560     5  0.4632   -0.24858 0.000 0.040 0.000 0.000 0.520 0.440
#> GSM494595     5  0.3984    0.58348 0.000 0.336 0.000 0.000 0.648 0.016
#> GSM494570     6  0.4091    0.60063 0.056 0.000 0.000 0.000 0.224 0.720
#> GSM494597     3  0.5257    0.43129 0.000 0.000 0.624 0.280 0.052 0.044
#> GSM494607     2  0.2389    0.66789 0.128 0.864 0.000 0.000 0.008 0.000
#> GSM494561     6  0.4548    0.62284 0.072 0.000 0.004 0.040 0.128 0.756
#> GSM494569     4  0.2257    0.62521 0.116 0.000 0.000 0.876 0.000 0.008
#> GSM494592     2  0.2250    0.66427 0.092 0.888 0.000 0.000 0.020 0.000
#> GSM494577     5  0.3418    0.69757 0.000 0.184 0.000 0.000 0.784 0.032
#> GSM494588     6  0.4333    0.49080 0.028 0.000 0.000 0.000 0.376 0.596
#> GSM494590     3  0.0551    0.78603 0.000 0.000 0.984 0.008 0.004 0.004
#> GSM494609     5  0.4798    0.40895 0.032 0.412 0.000 0.000 0.544 0.012
#> GSM494608     5  0.3133    0.69048 0.000 0.212 0.008 0.000 0.780 0.000
#> GSM494606     2  0.3830    0.00893 0.004 0.620 0.000 0.000 0.376 0.000
#> GSM494574     2  0.2433    0.60890 0.000 0.884 0.000 0.000 0.044 0.072
#> GSM494573     6  0.4083    0.36675 0.000 0.008 0.000 0.000 0.460 0.532
#> GSM494566     4  0.4857    0.00797 0.048 0.424 0.000 0.524 0.004 0.000
#> GSM494601     3  0.3562    0.71999 0.000 0.036 0.824 0.000 0.040 0.100
#> GSM494557     5  0.6496    0.45790 0.000 0.124 0.272 0.024 0.540 0.040
#> GSM494579     2  0.4656    0.59879 0.180 0.716 0.000 0.000 0.084 0.020
#> GSM494596     3  0.1148    0.78327 0.000 0.000 0.960 0.020 0.016 0.004
#> GSM494575     2  0.1863    0.62036 0.000 0.920 0.000 0.000 0.044 0.036
#> GSM494625     1  0.4945    0.28796 0.604 0.000 0.000 0.092 0.000 0.304
#> GSM494654     3  0.0520    0.78632 0.000 0.000 0.984 0.008 0.000 0.008
#> GSM494664     1  0.1152    0.70570 0.952 0.000 0.000 0.004 0.000 0.044
#> GSM494624     6  0.3351    0.63063 0.288 0.000 0.000 0.000 0.000 0.712
#> GSM494651     3  0.3568    0.73521 0.004 0.000 0.820 0.088 0.008 0.080
#> GSM494662     1  0.3172    0.64649 0.832 0.000 0.000 0.092 0.000 0.076
#> GSM494627     4  0.5949    0.39953 0.280 0.000 0.032 0.552 0.000 0.136
#> GSM494673     2  0.4086    0.16787 0.464 0.528 0.000 0.000 0.000 0.008
#> GSM494649     6  0.4215    0.62674 0.196 0.000 0.000 0.080 0.000 0.724
#> GSM494658     2  0.2957    0.66548 0.140 0.836 0.000 0.000 0.008 0.016
#> GSM494653     1  0.1528    0.71425 0.936 0.048 0.000 0.000 0.000 0.016
#> GSM494643     3  0.5698    0.36364 0.200 0.000 0.584 0.004 0.008 0.204
#> GSM494672     2  0.3489    0.52481 0.288 0.708 0.000 0.000 0.000 0.004
#> GSM494618     4  0.5115    0.31490 0.340 0.000 0.004 0.572 0.000 0.084
#> GSM494631     3  0.4329    0.24554 0.004 0.004 0.564 0.420 0.004 0.004
#> GSM494619     6  0.3717    0.50993 0.384 0.000 0.000 0.000 0.000 0.616
#> GSM494674     1  0.3368    0.57879 0.756 0.232 0.000 0.000 0.000 0.012
#> GSM494616     1  0.4748    0.06480 0.504 0.000 0.000 0.448 0.000 0.048
#> GSM494663     1  0.5617    0.30757 0.564 0.000 0.004 0.228 0.000 0.204
#> GSM494628     4  0.5113    0.46005 0.204 0.000 0.000 0.628 0.000 0.168
#> GSM494632     1  0.3561    0.67186 0.836 0.008 0.052 0.028 0.000 0.076
#> GSM494660     6  0.4314    0.61473 0.184 0.000 0.000 0.096 0.000 0.720
#> GSM494622     4  0.6156    0.13318 0.132 0.004 0.376 0.464 0.000 0.024
#> GSM494642     1  0.3189    0.58188 0.760 0.236 0.000 0.000 0.000 0.004
#> GSM494647     1  0.3053    0.65293 0.812 0.168 0.000 0.000 0.000 0.020
#> GSM494659     1  0.3852    0.26401 0.612 0.384 0.000 0.000 0.000 0.004
#> GSM494670     2  0.4186    0.65005 0.132 0.772 0.000 0.000 0.028 0.068
#> GSM494675     2  0.6631   -0.03340 0.000 0.428 0.008 0.264 0.020 0.280
#> GSM494641     1  0.2948    0.64075 0.804 0.188 0.000 0.000 0.000 0.008
#> GSM494636     1  0.3964    0.48687 0.724 0.000 0.000 0.044 0.000 0.232
#> GSM494640     3  0.2938    0.75347 0.012 0.000 0.876 0.044 0.016 0.052
#> GSM494623     6  0.3565    0.62225 0.304 0.000 0.000 0.000 0.004 0.692
#> GSM494644     1  0.3072    0.68310 0.868 0.024 0.048 0.000 0.008 0.052
#> GSM494646     1  0.1226    0.70943 0.952 0.004 0.000 0.004 0.000 0.040
#> GSM494665     1  0.4642    0.04840 0.508 0.452 0.000 0.000 0.000 0.040
#> GSM494638     1  0.3833    0.62806 0.812 0.008 0.008 0.108 0.008 0.056
#> GSM494645     1  0.2633    0.68796 0.888 0.012 0.044 0.000 0.004 0.052
#> GSM494671     2  0.3769    0.42615 0.356 0.640 0.000 0.000 0.000 0.004
#> GSM494655     1  0.0806    0.71297 0.972 0.008 0.000 0.000 0.000 0.020
#> GSM494620     6  0.3737    0.49668 0.392 0.000 0.000 0.000 0.000 0.608
#> GSM494630     6  0.3883    0.59689 0.332 0.000 0.000 0.000 0.012 0.656
#> GSM494657     3  0.1237    0.78187 0.000 0.000 0.956 0.020 0.020 0.004
#> GSM494667     1  0.3558    0.56506 0.736 0.248 0.000 0.000 0.000 0.016
#> GSM494621     6  0.3446    0.61594 0.308 0.000 0.000 0.000 0.000 0.692
#> GSM494629     4  0.1644    0.62152 0.012 0.000 0.004 0.932 0.000 0.052
#> GSM494637     1  0.6977    0.03859 0.444 0.000 0.084 0.240 0.000 0.232
#> GSM494652     1  0.3595    0.49582 0.704 0.288 0.000 0.000 0.000 0.008
#> GSM494648     6  0.3634    0.55671 0.356 0.000 0.000 0.000 0.000 0.644
#> GSM494650     3  0.2282    0.75326 0.000 0.000 0.888 0.000 0.024 0.088
#> GSM494669     1  0.3582    0.56009 0.732 0.252 0.000 0.000 0.000 0.016
#> GSM494666     1  0.0993    0.71360 0.964 0.012 0.000 0.000 0.000 0.024
#> GSM494668     2  0.4246    0.17193 0.452 0.532 0.000 0.000 0.000 0.016
#> GSM494633     6  0.3519    0.65456 0.232 0.000 0.000 0.008 0.008 0.752
#> GSM494634     2  0.4002    0.32832 0.404 0.588 0.000 0.000 0.000 0.008
#> GSM494639     1  0.1349    0.70326 0.940 0.000 0.000 0.004 0.000 0.056
#> GSM494661     3  0.3340    0.73088 0.004 0.024 0.840 0.000 0.032 0.100
#> GSM494617     1  0.3566    0.52946 0.744 0.000 0.000 0.236 0.000 0.020
#> GSM494626     1  0.4121    0.27104 0.604 0.000 0.000 0.380 0.000 0.016
#> GSM494656     3  0.0260    0.78610 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM494635     1  0.1296    0.71082 0.952 0.012 0.000 0.004 0.000 0.032

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

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)
#> Error in mat[ceiling(1:nr/h_ratio), ceiling(1:nc/w_ratio), drop = FALSE]: subscript out of bounds

plot of chunk tab-ATC-NMF-get-signatures-4

get_signatures(res, k = 6)
#> Error: The width or height of the raster image is zero, maybe you forget to turn off the
#> previous graphic device or it was corrupted. Run `dev.off()` to close it.

plot of chunk tab-ATC-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-NMF-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>           n disease.state(p) age(p) other(p) individual(p) k
#> ATC:NMF 117         4.64e-05 0.7546 2.76e-03       0.17200 2
#> ATC:NMF 114         9.01e-04 0.0451 7.06e-04       0.01087 3
#> ATC:NMF  81         1.98e-13 0.4838 1.39e-11       0.54995 4
#> ATC:NMF  94         1.56e-11 0.0738 3.60e-08       0.01286 5
#> ATC:NMF  74         1.36e-06 0.0070 1.94e-05       0.00218 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