cola Report for GDS1815

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

The call of run_all_consensus_partition_methods() was:

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

Dimension of the input matrix:

mat = get_matrix(res_list)
dim(mat)
#> [1] 21168   100

Density distribution

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

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

plot of chunk density-heatmap

Suggest the best k

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

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

suggest_best_k(res_list)
The best k 1-PAC Mean silhouette Concordance Optional k
SD:kmeans 2 1.000 0.951 0.980 **
SD:skmeans 2 1.000 0.986 0.994 **
CV:kmeans 2 1.000 0.980 0.991 **
CV:skmeans 2 1.000 0.983 0.992 **
CV:NMF 2 1.000 0.972 0.988 **
MAD:kmeans 2 1.000 0.963 0.985 **
MAD:mclust 2 1.000 0.974 0.980 **
MAD:NMF 2 1.000 0.966 0.986 **
ATC:NMF 2 1.000 0.979 0.991 **
ATC:kmeans 3 0.976 0.966 0.977 ** 2
MAD:skmeans 3 0.974 0.953 0.976 ** 2
ATC:skmeans 6 0.962 0.925 0.947 ** 2,3
ATC:mclust 6 0.941 0.887 0.951 * 2,4
SD:NMF 3 0.926 0.915 0.959 * 2
CV:mclust 4 0.910 0.904 0.960 *
ATC:pam 3 0.908 0.948 0.978 * 2
MAD:pam 2 0.898 0.946 0.971
SD:pam 2 0.894 0.935 0.970
SD:mclust 4 0.861 0.891 0.946
CV:pam 2 0.626 0.862 0.929
SD:hclust 3 0.580 0.862 0.908
ATC:hclust 3 0.538 0.735 0.872
MAD:hclust 3 0.488 0.809 0.885
CV:hclust 2 0.318 0.647 0.841

**: 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.999           0.971       0.987          0.495 0.505   0.505
#> CV:NMF      2 1.000           0.972       0.988          0.496 0.505   0.505
#> MAD:NMF     2 1.000           0.966       0.986          0.494 0.508   0.508
#> ATC:NMF     2 1.000           0.979       0.991          0.502 0.500   0.500
#> SD:skmeans  2 1.000           0.986       0.994          0.501 0.500   0.500
#> CV:skmeans  2 1.000           0.983       0.992          0.500 0.500   0.500
#> MAD:skmeans 2 1.000           0.986       0.993          0.500 0.500   0.500
#> ATC:skmeans 2 1.000           0.983       0.993          0.505 0.495   0.495
#> SD:mclust   2 0.600           0.915       0.948          0.365 0.642   0.642
#> CV:mclust   2 0.801           0.915       0.954          0.350 0.665   0.665
#> MAD:mclust  2 1.000           0.974       0.980          0.343 0.665   0.665
#> ATC:mclust  2 1.000           0.975       0.990          0.216 0.787   0.787
#> SD:kmeans   2 1.000           0.951       0.980          0.488 0.508   0.508
#> CV:kmeans   2 1.000           0.980       0.991          0.494 0.508   0.508
#> MAD:kmeans  2 1.000           0.963       0.985          0.487 0.519   0.519
#> ATC:kmeans  2 1.000           0.965       0.976          0.497 0.495   0.495
#> SD:pam      2 0.894           0.935       0.970          0.460 0.547   0.547
#> CV:pam      2 0.626           0.862       0.929          0.487 0.508   0.508
#> MAD:pam     2 0.898           0.946       0.971          0.463 0.540   0.540
#> ATC:pam     2 0.958           0.933       0.971          0.491 0.515   0.515
#> SD:hclust   2 0.466           0.884       0.925          0.387 0.653   0.653
#> CV:hclust   2 0.318           0.647       0.841          0.434 0.560   0.560
#> MAD:hclust  2 0.399           0.685       0.857          0.429 0.602   0.602
#> ATC:hclust  2 0.529           0.885       0.923          0.250 0.818   0.818
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.926           0.915       0.959          0.318 0.787   0.600
#> CV:NMF      3 0.529           0.701       0.840          0.325 0.807   0.634
#> MAD:NMF     3 0.889           0.900       0.952          0.322 0.791   0.609
#> ATC:NMF     3 0.846           0.862       0.933          0.284 0.699   0.478
#> SD:skmeans  3 0.837           0.942       0.966          0.307 0.788   0.600
#> CV:skmeans  3 0.671           0.414       0.731          0.322 0.754   0.543
#> MAD:skmeans 3 0.974           0.953       0.976          0.307 0.788   0.600
#> ATC:skmeans 3 0.950           0.912       0.964          0.288 0.822   0.652
#> SD:mclust   3 0.589           0.716       0.861          0.720 0.708   0.549
#> CV:mclust   3 0.469           0.437       0.711          0.726 0.792   0.692
#> MAD:mclust  3 0.862           0.879       0.946          0.811 0.659   0.507
#> ATC:mclust  3 0.587           0.791       0.903          1.614 0.600   0.498
#> SD:kmeans   3 0.630           0.793       0.885          0.332 0.751   0.551
#> CV:kmeans   3 0.487           0.385       0.682          0.305 0.772   0.606
#> MAD:kmeans  3 0.727           0.827       0.904          0.335 0.759   0.566
#> ATC:kmeans  3 0.976           0.966       0.977          0.196 0.899   0.800
#> SD:pam      3 0.435           0.435       0.738          0.365 0.872   0.775
#> CV:pam      3 0.518           0.701       0.854          0.365 0.732   0.515
#> MAD:pam     3 0.473           0.503       0.752          0.368 0.757   0.569
#> ATC:pam     3 0.908           0.948       0.978          0.194 0.899   0.804
#> SD:hclust   3 0.580           0.862       0.908          0.592 0.732   0.590
#> CV:hclust   3 0.391           0.699       0.817          0.423 0.776   0.617
#> MAD:hclust  3 0.488           0.809       0.885          0.443 0.743   0.588
#> ATC:hclust  3 0.538           0.735       0.872          1.250 0.596   0.506
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.614           0.570       0.755          0.137 0.805   0.505
#> CV:NMF      4 0.587           0.564       0.793          0.126 0.827   0.567
#> MAD:NMF     4 0.626           0.628       0.753          0.137 0.844   0.595
#> ATC:NMF     4 0.828           0.865       0.930          0.133 0.836   0.582
#> SD:skmeans  4 0.768           0.695       0.876          0.139 0.851   0.599
#> CV:skmeans  4 0.681           0.740       0.870          0.132 0.806   0.495
#> MAD:skmeans 4 0.761           0.672       0.848          0.140 0.844   0.585
#> ATC:skmeans 4 0.719           0.764       0.788          0.121 0.862   0.632
#> SD:mclust   4 0.861           0.891       0.946          0.155 0.889   0.705
#> CV:mclust   4 0.910           0.904       0.960          0.209 0.698   0.422
#> MAD:mclust  4 0.853           0.868       0.936          0.178 0.876   0.678
#> ATC:mclust  4 0.983           0.955       0.983          0.179 0.901   0.766
#> SD:kmeans   4 0.764           0.513       0.746          0.129 0.913   0.758
#> CV:kmeans   4 0.716           0.731       0.851          0.137 0.747   0.472
#> MAD:kmeans  4 0.801           0.744       0.864          0.139 0.827   0.549
#> ATC:kmeans  4 0.597           0.605       0.763          0.193 0.829   0.604
#> SD:pam      4 0.527           0.562       0.766          0.161 0.687   0.390
#> CV:pam      4 0.528           0.551       0.760          0.118 0.863   0.620
#> MAD:pam     4 0.580           0.654       0.809          0.155 0.812   0.529
#> ATC:pam     4 0.649           0.763       0.837          0.208 0.855   0.664
#> SD:hclust   4 0.678           0.839       0.872          0.140 0.920   0.793
#> CV:hclust   4 0.522           0.729       0.830          0.131 0.907   0.763
#> MAD:hclust  4 0.565           0.741       0.830          0.130 0.920   0.793
#> ATC:hclust  4 0.557           0.701       0.839          0.197 0.903   0.765
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.599           0.528       0.738         0.0717 0.842   0.474
#> CV:NMF      5 0.591           0.526       0.746         0.0726 0.817   0.439
#> MAD:NMF     5 0.600           0.549       0.737         0.0727 0.844   0.495
#> ATC:NMF     5 0.686           0.651       0.825         0.0634 0.911   0.699
#> SD:skmeans  5 0.735           0.748       0.841         0.0635 0.879   0.582
#> CV:skmeans  5 0.643           0.589       0.724         0.0591 0.904   0.647
#> MAD:skmeans 5 0.714           0.715       0.826         0.0631 0.879   0.584
#> ATC:skmeans 5 0.783           0.773       0.816         0.0712 0.937   0.769
#> SD:mclust   5 0.772           0.752       0.828         0.0727 0.937   0.785
#> CV:mclust   5 0.805           0.705       0.834         0.0585 0.956   0.846
#> MAD:mclust  5 0.791           0.860       0.877         0.0764 0.898   0.649
#> ATC:mclust  5 0.736           0.785       0.882         0.1119 0.881   0.673
#> SD:kmeans   5 0.694           0.655       0.802         0.0655 0.874   0.603
#> CV:kmeans   5 0.664           0.572       0.758         0.0676 0.865   0.584
#> MAD:kmeans  5 0.717           0.774       0.828         0.0624 0.909   0.667
#> ATC:kmeans  5 0.763           0.692       0.832         0.1012 0.805   0.429
#> SD:pam      5 0.692           0.657       0.820         0.0783 0.862   0.541
#> CV:pam      5 0.627           0.645       0.795         0.0650 0.848   0.502
#> MAD:pam     5 0.699           0.774       0.837         0.0753 0.874   0.583
#> ATC:pam     5 0.860           0.792       0.915         0.1006 0.872   0.608
#> SD:hclust   5 0.688           0.754       0.792         0.0890 0.900   0.677
#> CV:hclust   5 0.575           0.676       0.773         0.0671 1.000   1.000
#> MAD:hclust  5 0.625           0.687       0.767         0.0862 0.909   0.704
#> ATC:hclust  5 0.545           0.539       0.743         0.0892 0.939   0.808
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.631           0.528       0.722         0.0448 0.840   0.392
#> CV:NMF      6 0.626           0.485       0.696         0.0467 0.884   0.512
#> MAD:NMF     6 0.622           0.460       0.709         0.0441 0.852   0.417
#> ATC:NMF     6 0.652           0.538       0.752         0.0414 0.916   0.672
#> SD:skmeans  6 0.733           0.668       0.766         0.0389 0.970   0.858
#> CV:skmeans  6 0.640           0.493       0.704         0.0424 0.940   0.726
#> MAD:skmeans 6 0.705           0.548       0.720         0.0399 0.977   0.894
#> ATC:skmeans 6 0.962           0.925       0.947         0.0600 0.924   0.672
#> SD:mclust   6 0.874           0.891       0.918         0.0640 0.906   0.626
#> CV:mclust   6 0.772           0.771       0.787         0.0460 0.874   0.545
#> MAD:mclust  6 0.827           0.833       0.838         0.0429 0.948   0.756
#> ATC:mclust  6 0.941           0.887       0.951         0.1120 0.878   0.572
#> SD:kmeans   6 0.746           0.759       0.807         0.0457 0.916   0.660
#> CV:kmeans   6 0.709           0.664       0.743         0.0454 0.921   0.680
#> MAD:kmeans  6 0.747           0.731       0.787         0.0447 0.967   0.844
#> ATC:kmeans  6 0.837           0.866       0.882         0.0536 0.923   0.658
#> SD:pam      6 0.701           0.495       0.684         0.0500 0.909   0.613
#> CV:pam      6 0.627           0.495       0.686         0.0425 0.931   0.695
#> MAD:pam     6 0.723           0.598       0.750         0.0516 0.950   0.767
#> ATC:pam     6 0.854           0.754       0.887         0.0452 0.928   0.696
#> SD:hclust   6 0.742           0.806       0.868         0.0535 0.962   0.827
#> CV:hclust   6 0.607           0.579       0.741         0.0594 0.893   0.656
#> MAD:hclust  6 0.687           0.721       0.806         0.0549 0.962   0.827
#> ATC:hclust  6 0.589           0.608       0.725         0.0537 0.834   0.478

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) specimen(p) cell.type(p) other(p) k
#> SD:NMF       99         1.61e-05       0.166     3.04e-14  0.13812 2
#> CV:NMF      100         2.42e-05       0.251     1.12e-13  0.18012 2
#> MAD:NMF      99         1.61e-05       0.166     3.04e-14  0.13812 2
#> ATC:NMF      99         6.29e-06       0.617     1.57e-11  0.28570 2
#> SD:skmeans   99         1.18e-04       0.225     6.66e-13  0.10663 2
#> CV:skmeans  100         9.36e-05       0.173     5.21e-13  0.09028 2
#> MAD:skmeans 100         9.36e-05       0.173     5.21e-13  0.09028 2
#> ATC:skmeans 100         1.24e-07       0.714     5.25e-14  0.10191 2
#> SD:mclust    98         2.79e-05       0.404     8.16e-12  0.01147 2
#> CV:mclust    99         6.56e-07       0.570     2.99e-10  0.03080 2
#> MAD:mclust  100         6.54e-06       0.438     1.48e-10  0.00517 2
#> ATC:mclust   99         3.22e-02       0.424     8.13e-04  0.46276 2
#> SD:kmeans    98         4.41e-06       0.222     5.40e-15  0.06905 2
#> CV:kmeans   100         1.13e-05       0.298     4.23e-14  0.12314 2
#> MAD:kmeans   99         4.79e-06       0.212     5.56e-16  0.03262 2
#> ATC:kmeans  100         1.24e-07       0.714     5.25e-14  0.10191 2
#> SD:pam       98         7.18e-09       0.530     2.47e-19  0.00887 2
#> CV:pam       95         1.87e-09       0.519     9.94e-19  0.04830 2
#> MAD:pam     100         1.39e-06       0.440     9.32e-16  0.05269 2
#> ATC:pam      94         3.02e-09       0.472     7.85e-18  0.01100 2
#> SD:hclust    99         1.20e-04       0.166     2.00e-10  0.00263 2
#> CV:hclust    79         9.28e-04       0.304     3.11e-12  0.03868 2
#> MAD:hclust   78         4.12e-04       0.199     7.19e-12  0.00845 2
#> ATC:hclust  100         5.90e-02       0.526     4.19e-04  0.45353 2
test_to_known_factors(res_list, k = 3)
#>               n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:NMF       96         3.56e-05      0.1686     1.18e-17   0.0543 3
#> CV:NMF       90         8.38e-06      0.1059     9.92e-20   0.0238 3
#> MAD:NMF      97         7.29e-05      0.2888     5.42e-18   0.0784 3
#> ATC:NMF      94         9.01e-05      0.0862     1.22e-21   0.1605 3
#> SD:skmeans  100         1.14e-04      0.2896     6.36e-17   0.0685 3
#> CV:skmeans   37         3.62e-01      1.0000     2.96e-03   0.2540 3
#> MAD:skmeans 100         1.14e-04      0.2896     6.36e-17   0.0685 3
#> ATC:skmeans  93         4.35e-06      0.5150     2.47e-18   0.3916 3
#> SD:mclust    77         8.69e-03      0.4160     3.41e-15   0.1125 3
#> CV:mclust    59         3.59e-03      0.3146     6.24e-13   0.2008 3
#> MAD:mclust   92         8.69e-05      0.4307     9.63e-18   0.0340 3
#> ATC:mclust   96         4.68e-06      0.1355     2.76e-16   0.1236 3
#> SD:kmeans    94         1.92e-04      0.4126     1.41e-18   0.0374 3
#> CV:kmeans    44               NA          NA           NA       NA 3
#> MAD:kmeans   97         3.86e-05      0.2944     5.38e-19   0.0178 3
#> ATC:kmeans  100         1.01e-06      0.2295     3.56e-15   0.2241 3
#> SD:pam       46         3.33e-04      0.1775     1.03e-10   0.0697 3
#> CV:pam       84         3.06e-07      0.5632     3.99e-15   0.1185 3
#> MAD:pam      54         3.15e-03      0.8100     1.13e-13   0.1281 3
#> ATC:pam     100         1.61e-07      0.2208     1.13e-18   0.0321 3
#> SD:hclust    99         1.47e-03      0.1882     8.26e-14   0.0197 3
#> CV:hclust    85         6.37e-04      0.4828     2.04e-15   0.0545 3
#> MAD:hclust   95         2.70e-03      0.1882     1.66e-13   0.0301 3
#> ATC:hclust   89         6.61e-08      0.1775     4.27e-16   0.0620 3
test_to_known_factors(res_list, k = 4)
#>              n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:NMF      69         3.15e-04      0.0933     6.59e-12  0.03948 4
#> CV:NMF      70         3.14e-04      0.4693     2.72e-14  0.13855 4
#> MAD:NMF     84         1.19e-05      0.0649     5.06e-18  0.03217 4
#> ATC:NMF     96         7.69e-04      0.3426     1.63e-19  0.10578 4
#> SD:skmeans  78         2.01e-04      0.1674     3.84e-13  0.03117 4
#> CV:skmeans  87         1.23e-04      0.1849     1.40e-17  0.05833 4
#> MAD:skmeans 76         7.71e-05      0.4814     5.77e-13  0.02462 4
#> ATC:skmeans 91         6.42e-06      0.6007     1.86e-17  0.25032 4
#> SD:mclust   98         3.34e-05      0.0724     1.27e-18  0.02800 4
#> CV:mclust   96         8.49e-06      0.0410     2.31e-19  0.01710 4
#> MAD:mclust  96         1.04e-05      0.0566     5.29e-19  0.03038 4
#> ATC:mclust  98         2.37e-04      0.3213     3.62e-21  0.12438 4
#> SD:kmeans   46         4.76e-03      0.5495     1.31e-05  0.02305 4
#> CV:kmeans   85         2.83e-04      0.1406     1.07e-17  0.03455 4
#> MAD:kmeans  86         4.63e-05      0.2382     4.32e-13  0.02198 4
#> ATC:kmeans  70         6.91e-05      0.2979     8.78e-14  0.25065 4
#> SD:pam      68         1.04e-04      0.4784     5.69e-15  0.00165 4
#> CV:pam      60         7.60e-04      0.5942     2.81e-12  0.24305 4
#> MAD:pam     85         1.60e-05      0.8256     1.90e-17  0.00887 4
#> ATC:pam     95         2.77e-06      0.5445     2.06e-16  0.41837 4
#> SD:hclust   99         5.97e-04      0.0720     5.23e-16  0.02581 4
#> CV:hclust   90         3.28e-04      0.1786     6.02e-16  0.03872 4
#> MAD:hclust  95         1.09e-03      0.0924     8.74e-15  0.03654 4
#> ATC:hclust  88         6.64e-06      0.1174     1.27e-19  0.00812 4
test_to_known_factors(res_list, k = 5)
#>              n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:NMF      68         3.97e-03      0.2354     2.68e-14  0.04537 5
#> CV:NMF      72         1.45e-02      0.6117     1.16e-13  0.11178 5
#> MAD:NMF     69         2.76e-03      0.3427     4.61e-15  0.01764 5
#> ATC:NMF     78         1.26e-04      0.1133     1.89e-19  0.04313 5
#> SD:skmeans  88         6.48e-05      0.2277     3.50e-16  0.03502 5
#> CV:skmeans  74         1.74e-05      0.0624     8.83e-17  0.01379 5
#> MAD:skmeans 82         2.08e-05      0.4374     4.16e-16  0.06484 5
#> ATC:skmeans 86         3.28e-05      0.1786     7.68e-16  0.31132 5
#> SD:mclust   93         1.18e-05      0.0572     2.11e-19  0.01013 5
#> CV:mclust   93         3.60e-05      0.0441     9.45e-18  0.01237 5
#> MAD:mclust  97         1.30e-04      0.2812     4.26e-16  0.24324 5
#> ATC:mclust  83         5.25e-06      0.1483     1.34e-19  0.02197 5
#> SD:kmeans   83         5.43e-03      0.4675     2.72e-12  0.22397 5
#> CV:kmeans   79         5.99e-03      0.3902     3.70e-13  0.11470 5
#> MAD:kmeans  96         5.29e-05      0.2139     2.61e-15  0.13189 5
#> ATC:kmeans  73         5.03e-04      0.4267     5.55e-11  0.10647 5
#> SD:pam      80         1.45e-06      0.2105     6.75e-17  0.01235 5
#> CV:pam      79         3.36e-05      0.4310     7.14e-15  0.15301 5
#> MAD:pam     95         1.81e-07      0.2789     1.77e-20  0.01760 5
#> ATC:pam     88         1.57e-04      0.4898     5.32e-21  0.30149 5
#> SD:hclust   95         2.27e-04      0.1254     6.70e-15  0.08524 5
#> CV:hclust   89         1.87e-04      0.1611     2.22e-16  0.03245 5
#> MAD:hclust  90         1.91e-04      0.1509     8.12e-13  0.09718 5
#> ATC:hclust  61         4.28e-04      0.1236     1.61e-17  0.00533 5
test_to_known_factors(res_list, k = 6)
#>              n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:NMF      65         4.40e-03      0.4976     7.36e-13   0.0693 6
#> CV:NMF      50         3.71e-04      0.2514     9.45e-12   0.0525 6
#> MAD:NMF     60         1.92e-03      0.6206     9.68e-14   0.0968 6
#> ATC:NMF     61         7.20e-05      0.2446     1.92e-14   0.1045 6
#> SD:skmeans  83         4.09e-05      0.3370     3.40e-18   0.0216 6
#> CV:skmeans  60         3.04e-04      0.3256     1.60e-17   0.0982 6
#> MAD:skmeans 59         6.82e-05      0.4207     1.51e-15   0.1276 6
#> ATC:skmeans 99         1.82e-05      0.4471     5.89e-16   0.4205 6
#> SD:mclust   99         3.41e-06      0.0900     1.47e-19   0.0315 6
#> CV:mclust   94         3.88e-06      0.1120     4.63e-20   0.0189 6
#> MAD:mclust  96         8.80e-06      0.1944     1.18e-18   0.0496 6
#> ATC:mclust  94         8.30e-05      0.3993     1.53e-18   0.2559 6
#> SD:kmeans   94         1.45e-04      0.3720     2.03e-16   0.0504 6
#> CV:kmeans   82         4.78e-05      0.2056     1.42e-15   0.0045 6
#> MAD:kmeans  91         7.04e-05      0.3876     1.34e-15   0.0362 6
#> ATC:kmeans  98         8.19e-05      0.5824     5.47e-16   0.4758 6
#> SD:pam      51         4.23e-03      0.1398     2.03e-11   0.0623 6
#> CV:pam      58         3.68e-02      0.4973     2.34e-10   0.1339 6
#> MAD:pam     70         1.72e-06      0.3386     2.38e-14   0.0200 6
#> ATC:pam     84         4.04e-04      0.9368     7.19e-19   0.4925 6
#> SD:hclust   97         3.55e-04      0.1647     1.98e-17   0.0327 6
#> CV:hclust   70         4.39e-04      0.2097     3.25e-14   0.0128 6
#> MAD:hclust  95         2.67e-04      0.2186     3.97e-16   0.0232 6
#> ATC:hclust  62         5.10e-04      0.0427     9.55e-18   0.0149 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 21168 rows and 100 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 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.466           0.884       0.925         0.3875 0.653   0.653
#> 3 3 0.580           0.862       0.908         0.5923 0.732   0.590
#> 4 4 0.678           0.839       0.872         0.1405 0.920   0.793
#> 5 5 0.688           0.754       0.792         0.0890 0.900   0.677
#> 6 6 0.742           0.806       0.868         0.0535 0.962   0.827

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
#> GSM97038     2  0.6801     0.7484 0.180 0.820
#> GSM97045     2  0.0938     0.9479 0.012 0.988
#> GSM97047     1  0.7883     0.7740 0.764 0.236
#> GSM97025     2  0.0938     0.9479 0.012 0.988
#> GSM97030     1  0.6973     0.8426 0.812 0.188
#> GSM97027     2  0.0938     0.9479 0.012 0.988
#> GSM97033     2  0.0376     0.9524 0.004 0.996
#> GSM97034     1  0.6801     0.8371 0.820 0.180
#> GSM97020     2  0.0672     0.9504 0.008 0.992
#> GSM97026     1  0.6531     0.8395 0.832 0.168
#> GSM97012     2  0.0000     0.9541 0.000 1.000
#> GSM97015     1  0.6973     0.8426 0.812 0.188
#> GSM97016     2  0.0000     0.9541 0.000 1.000
#> GSM97017     1  0.5059     0.8812 0.888 0.112
#> GSM97019     2  0.0000     0.9541 0.000 1.000
#> GSM97022     2  0.0000     0.9541 0.000 1.000
#> GSM97035     2  0.0000     0.9541 0.000 1.000
#> GSM97036     1  0.2603     0.9078 0.956 0.044
#> GSM97039     2  0.0000     0.9541 0.000 1.000
#> GSM97046     2  0.0000     0.9541 0.000 1.000
#> GSM97023     1  0.0000     0.9120 1.000 0.000
#> GSM97029     1  0.6343     0.8511 0.840 0.160
#> GSM97043     1  0.8713     0.7020 0.708 0.292
#> GSM97013     1  0.0000     0.9120 1.000 0.000
#> GSM96956     1  0.8861     0.6931 0.696 0.304
#> GSM97024     2  0.2043     0.9286 0.032 0.968
#> GSM97032     1  0.6887     0.8463 0.816 0.184
#> GSM97044     1  0.6973     0.8426 0.812 0.188
#> GSM97049     2  0.0000     0.9541 0.000 1.000
#> GSM96968     1  0.6343     0.8687 0.840 0.160
#> GSM96971     1  0.4431     0.8942 0.908 0.092
#> GSM96986     1  0.5059     0.8856 0.888 0.112
#> GSM97003     1  0.0000     0.9120 1.000 0.000
#> GSM96957     1  0.3274     0.9073 0.940 0.060
#> GSM96960     1  0.0000     0.9120 1.000 0.000
#> GSM96975     1  0.0376     0.9124 0.996 0.004
#> GSM96998     1  0.0000     0.9120 1.000 0.000
#> GSM96999     1  0.3274     0.9073 0.940 0.060
#> GSM97001     1  0.3274     0.9073 0.940 0.060
#> GSM97005     1  0.1843     0.9124 0.972 0.028
#> GSM97006     1  0.0000     0.9120 1.000 0.000
#> GSM97021     1  0.5294     0.8769 0.880 0.120
#> GSM97028     1  0.5519     0.8830 0.872 0.128
#> GSM97031     1  0.2423     0.9096 0.960 0.040
#> GSM97037     1  0.8327     0.7570 0.736 0.264
#> GSM97018     1  0.6438     0.8680 0.836 0.164
#> GSM97014     1  0.7528     0.7896 0.784 0.216
#> GSM97042     2  0.0000     0.9541 0.000 1.000
#> GSM97040     1  0.5737     0.8689 0.864 0.136
#> GSM97041     1  0.5059     0.8812 0.888 0.112
#> GSM96955     2  0.5842     0.8025 0.140 0.860
#> GSM96990     1  0.6973     0.8426 0.812 0.188
#> GSM96991     2  0.0000     0.9541 0.000 1.000
#> GSM97048     2  0.0000     0.9541 0.000 1.000
#> GSM96963     2  0.0000     0.9541 0.000 1.000
#> GSM96953     2  0.0000     0.9541 0.000 1.000
#> GSM96966     1  0.0000     0.9120 1.000 0.000
#> GSM96979     1  0.5059     0.8856 0.888 0.112
#> GSM96983     1  0.5294     0.8815 0.880 0.120
#> GSM96984     1  0.5178     0.8833 0.884 0.116
#> GSM96994     1  0.5059     0.8856 0.888 0.112
#> GSM96996     1  0.0376     0.9118 0.996 0.004
#> GSM96997     1  0.5059     0.8856 0.888 0.112
#> GSM97007     1  0.5178     0.8833 0.884 0.116
#> GSM96954     1  0.4431     0.8942 0.908 0.092
#> GSM96962     1  0.5059     0.8856 0.888 0.112
#> GSM96969     1  0.0000     0.9120 1.000 0.000
#> GSM96970     1  0.0000     0.9120 1.000 0.000
#> GSM96973     1  0.0000     0.9120 1.000 0.000
#> GSM96976     1  0.4431     0.8954 0.908 0.092
#> GSM96977     1  0.1843     0.9118 0.972 0.028
#> GSM96995     1  0.6343     0.8687 0.840 0.160
#> GSM97002     1  0.0000     0.9120 1.000 0.000
#> GSM97009     1  0.7745     0.7743 0.772 0.228
#> GSM97010     1  0.3274     0.9080 0.940 0.060
#> GSM96974     1  0.2043     0.9112 0.968 0.032
#> GSM96985     1  0.5294     0.8815 0.880 0.120
#> GSM96959     2  0.9896     0.0969 0.440 0.560
#> GSM96972     1  0.0000     0.9120 1.000 0.000
#> GSM96978     1  0.5294     0.8815 0.880 0.120
#> GSM96967     1  0.0000     0.9120 1.000 0.000
#> GSM96987     1  0.0000     0.9120 1.000 0.000
#> GSM97011     1  0.7299     0.8011 0.796 0.204
#> GSM96964     1  0.1414     0.9118 0.980 0.020
#> GSM96965     1  0.4431     0.8954 0.908 0.092
#> GSM96981     1  0.0000     0.9120 1.000 0.000
#> GSM96982     1  0.0000     0.9120 1.000 0.000
#> GSM96988     1  0.5519     0.8830 0.872 0.128
#> GSM97000     1  0.5629     0.8700 0.868 0.132
#> GSM97004     1  0.0000     0.9120 1.000 0.000
#> GSM97008     1  0.4562     0.8910 0.904 0.096
#> GSM96950     1  0.1843     0.9119 0.972 0.028
#> GSM96980     1  0.0000     0.9120 1.000 0.000
#> GSM96989     1  0.0000     0.9120 1.000 0.000
#> GSM96992     1  0.0000     0.9120 1.000 0.000
#> GSM96993     1  0.2603     0.9078 0.956 0.044
#> GSM96958     1  0.1633     0.9117 0.976 0.024
#> GSM96951     1  0.0000     0.9120 1.000 0.000
#> GSM96952     1  0.0000     0.9120 1.000 0.000
#> GSM96961     1  0.0000     0.9120 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
#> GSM97038     2  0.5330      0.753 0.044 0.812 0.144
#> GSM97045     2  0.0592      0.945 0.012 0.988 0.000
#> GSM97047     1  0.8521      0.629 0.608 0.228 0.164
#> GSM97025     2  0.0592      0.945 0.012 0.988 0.000
#> GSM97030     3  0.2356      0.877 0.000 0.072 0.928
#> GSM97027     2  0.0592      0.945 0.012 0.988 0.000
#> GSM97033     2  0.0237      0.950 0.004 0.996 0.000
#> GSM97034     1  0.7493      0.744 0.696 0.168 0.136
#> GSM97020     2  0.0424      0.947 0.008 0.992 0.000
#> GSM97026     1  0.6775      0.794 0.740 0.164 0.096
#> GSM97012     2  0.0000      0.951 0.000 1.000 0.000
#> GSM97015     3  0.3234      0.878 0.020 0.072 0.908
#> GSM97016     2  0.0000      0.951 0.000 1.000 0.000
#> GSM97017     1  0.4818      0.864 0.844 0.108 0.048
#> GSM97019     2  0.0000      0.951 0.000 1.000 0.000
#> GSM97022     2  0.0000      0.951 0.000 1.000 0.000
#> GSM97035     2  0.0000      0.951 0.000 1.000 0.000
#> GSM97036     1  0.3155      0.895 0.916 0.044 0.040
#> GSM97039     2  0.0000      0.951 0.000 1.000 0.000
#> GSM97046     2  0.0000      0.951 0.000 1.000 0.000
#> GSM97023     1  0.0237      0.896 0.996 0.000 0.004
#> GSM97029     1  0.6529      0.802 0.756 0.152 0.092
#> GSM97043     3  0.8388      0.582 0.140 0.248 0.612
#> GSM97013     1  0.0000      0.895 1.000 0.000 0.000
#> GSM96956     3  0.4654      0.765 0.000 0.208 0.792
#> GSM97024     2  0.1289      0.927 0.000 0.968 0.032
#> GSM97032     3  0.2680      0.880 0.008 0.068 0.924
#> GSM97044     3  0.2356      0.877 0.000 0.072 0.928
#> GSM97049     2  0.0000      0.951 0.000 1.000 0.000
#> GSM96968     3  0.6171      0.795 0.144 0.080 0.776
#> GSM96971     3  0.4291      0.764 0.180 0.000 0.820
#> GSM96986     3  0.0237      0.889 0.004 0.000 0.996
#> GSM97003     1  0.0237      0.895 0.996 0.000 0.004
#> GSM96957     1  0.3572      0.891 0.900 0.060 0.040
#> GSM96960     1  0.0237      0.895 0.996 0.000 0.004
#> GSM96975     1  0.0829      0.899 0.984 0.004 0.012
#> GSM96998     1  0.0000      0.895 1.000 0.000 0.000
#> GSM96999     1  0.3572      0.891 0.900 0.060 0.040
#> GSM97001     1  0.3572      0.891 0.900 0.060 0.040
#> GSM97005     1  0.2187      0.900 0.948 0.028 0.024
#> GSM97006     1  0.0237      0.895 0.996 0.000 0.004
#> GSM97021     1  0.5263      0.854 0.824 0.116 0.060
#> GSM97028     3  0.4137      0.853 0.096 0.032 0.872
#> GSM97031     1  0.5529      0.580 0.704 0.000 0.296
#> GSM97037     3  0.4002      0.818 0.000 0.160 0.840
#> GSM97018     3  0.6719      0.759 0.160 0.096 0.744
#> GSM97014     1  0.6977      0.758 0.712 0.212 0.076
#> GSM97042     2  0.0000      0.951 0.000 1.000 0.000
#> GSM97040     1  0.6144      0.824 0.780 0.132 0.088
#> GSM97041     1  0.4712      0.866 0.848 0.108 0.044
#> GSM96955     2  0.4565      0.812 0.064 0.860 0.076
#> GSM96990     3  0.3091      0.879 0.016 0.072 0.912
#> GSM96991     2  0.0000      0.951 0.000 1.000 0.000
#> GSM97048     2  0.0000      0.951 0.000 1.000 0.000
#> GSM96963     2  0.0000      0.951 0.000 1.000 0.000
#> GSM96953     2  0.0000      0.951 0.000 1.000 0.000
#> GSM96966     1  0.3267      0.866 0.884 0.000 0.116
#> GSM96979     3  0.0237      0.889 0.004 0.000 0.996
#> GSM96983     3  0.0237      0.888 0.000 0.004 0.996
#> GSM96984     3  0.0000      0.887 0.000 0.000 1.000
#> GSM96994     3  0.0237      0.889 0.004 0.000 0.996
#> GSM96996     1  0.1129      0.899 0.976 0.004 0.020
#> GSM96997     3  0.0237      0.889 0.004 0.000 0.996
#> GSM97007     3  0.0000      0.887 0.000 0.000 1.000
#> GSM96954     3  0.4291      0.764 0.180 0.000 0.820
#> GSM96962     3  0.0237      0.889 0.004 0.000 0.996
#> GSM96969     1  0.3038      0.872 0.896 0.000 0.104
#> GSM96970     1  0.3192      0.868 0.888 0.000 0.112
#> GSM96973     1  0.3267      0.866 0.884 0.000 0.116
#> GSM96976     1  0.6644      0.791 0.748 0.092 0.160
#> GSM96977     1  0.2318      0.898 0.944 0.028 0.028
#> GSM96995     3  0.6171      0.795 0.144 0.080 0.776
#> GSM97002     1  0.0237      0.895 0.996 0.000 0.004
#> GSM97009     1  0.7821      0.701 0.660 0.224 0.116
#> GSM97010     1  0.3683      0.890 0.896 0.060 0.044
#> GSM96974     1  0.5627      0.807 0.780 0.032 0.188
#> GSM96985     3  0.0237      0.888 0.000 0.004 0.996
#> GSM96959     2  0.8646      0.269 0.320 0.556 0.124
#> GSM96972     1  0.1411      0.891 0.964 0.000 0.036
#> GSM96978     3  0.0237      0.888 0.000 0.004 0.996
#> GSM96967     1  0.3267      0.866 0.884 0.000 0.116
#> GSM96987     1  0.0000      0.895 1.000 0.000 0.000
#> GSM97011     1  0.7569      0.731 0.684 0.200 0.116
#> GSM96964     1  0.2050      0.898 0.952 0.020 0.028
#> GSM96965     1  0.6644      0.791 0.748 0.092 0.160
#> GSM96981     1  0.0592      0.898 0.988 0.000 0.012
#> GSM96982     1  0.0592      0.898 0.988 0.000 0.012
#> GSM96988     3  0.4137      0.853 0.096 0.032 0.872
#> GSM97000     1  0.5981      0.829 0.788 0.132 0.080
#> GSM97004     1  0.0237      0.895 0.996 0.000 0.004
#> GSM97008     1  0.5253      0.858 0.828 0.096 0.076
#> GSM96950     1  0.2318      0.899 0.944 0.028 0.028
#> GSM96980     1  0.0424      0.896 0.992 0.000 0.008
#> GSM96989     1  0.0000      0.895 1.000 0.000 0.000
#> GSM96992     1  0.0237      0.895 0.996 0.000 0.004
#> GSM96993     1  0.3155      0.895 0.916 0.044 0.040
#> GSM96958     1  0.2187      0.898 0.948 0.024 0.028
#> GSM96951     1  0.0237      0.896 0.996 0.000 0.004
#> GSM96952     1  0.0237      0.895 0.996 0.000 0.004
#> GSM96961     1  0.0237      0.895 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
#> GSM97038     2  0.5454      0.728 0.044 0.780 0.104 0.072
#> GSM97045     2  0.0524      0.940 0.008 0.988 0.000 0.004
#> GSM97047     1  0.7942      0.606 0.596 0.192 0.108 0.104
#> GSM97025     2  0.0524      0.940 0.008 0.988 0.000 0.004
#> GSM97030     3  0.2466      0.862 0.000 0.056 0.916 0.028
#> GSM97027     2  0.0524      0.940 0.008 0.988 0.000 0.004
#> GSM97033     2  0.0188      0.944 0.000 0.996 0.000 0.004
#> GSM97034     1  0.6895      0.710 0.688 0.132 0.076 0.104
#> GSM97020     2  0.0376      0.942 0.004 0.992 0.000 0.004
#> GSM97026     1  0.6224      0.751 0.728 0.124 0.044 0.104
#> GSM97012     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM97015     3  0.3161      0.860 0.020 0.056 0.896 0.028
#> GSM97016     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM97017     1  0.4292      0.824 0.832 0.072 0.008 0.088
#> GSM97019     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM97036     1  0.2599      0.857 0.912 0.020 0.004 0.064
#> GSM97039     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM97023     1  0.1118      0.863 0.964 0.000 0.000 0.036
#> GSM97029     1  0.5888      0.764 0.748 0.120 0.036 0.096
#> GSM97043     3  0.7570      0.552 0.136 0.232 0.592 0.040
#> GSM97013     1  0.1022      0.863 0.968 0.000 0.000 0.032
#> GSM96956     3  0.4348      0.758 0.000 0.196 0.780 0.024
#> GSM97024     2  0.1022      0.919 0.000 0.968 0.032 0.000
#> GSM97032     3  0.2846      0.864 0.012 0.052 0.908 0.028
#> GSM97044     3  0.2466      0.862 0.000 0.056 0.916 0.028
#> GSM97049     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM96968     3  0.5652      0.747 0.144 0.068 0.756 0.032
#> GSM96971     3  0.3791      0.711 0.004 0.000 0.796 0.200
#> GSM96986     3  0.0376      0.871 0.004 0.000 0.992 0.004
#> GSM97003     1  0.2216      0.842 0.908 0.000 0.000 0.092
#> GSM96957     1  0.2774      0.858 0.908 0.044 0.004 0.044
#> GSM96960     1  0.2281      0.841 0.904 0.000 0.000 0.096
#> GSM96975     1  0.1902      0.860 0.932 0.004 0.000 0.064
#> GSM96998     1  0.1474      0.858 0.948 0.000 0.000 0.052
#> GSM96999     1  0.2774      0.858 0.908 0.044 0.004 0.044
#> GSM97001     1  0.2774      0.858 0.908 0.044 0.004 0.044
#> GSM97005     1  0.2441      0.868 0.920 0.020 0.004 0.056
#> GSM97006     1  0.2281      0.841 0.904 0.000 0.000 0.096
#> GSM97021     1  0.4676      0.813 0.812 0.076 0.012 0.100
#> GSM97028     3  0.3639      0.819 0.096 0.028 0.864 0.012
#> GSM97031     1  0.5815      0.507 0.652 0.000 0.288 0.060
#> GSM97037     3  0.3863      0.808 0.000 0.144 0.828 0.028
#> GSM97018     3  0.6332      0.691 0.164 0.080 0.712 0.044
#> GSM97014     1  0.6368      0.715 0.700 0.172 0.028 0.100
#> GSM97042     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM97040     1  0.5637      0.781 0.768 0.096 0.040 0.096
#> GSM97041     1  0.4226      0.825 0.836 0.072 0.008 0.084
#> GSM96955     2  0.4621      0.778 0.060 0.828 0.036 0.076
#> GSM96990     3  0.3146      0.861 0.016 0.056 0.896 0.032
#> GSM96991     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM97048     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000      0.946 0.000 1.000 0.000 0.000
#> GSM96966     4  0.3143      0.913 0.100 0.000 0.024 0.876
#> GSM96979     3  0.0376      0.871 0.004 0.000 0.992 0.004
#> GSM96983     3  0.0000      0.870 0.000 0.000 1.000 0.000
#> GSM96984     3  0.0188      0.869 0.000 0.000 0.996 0.004
#> GSM96994     3  0.0376      0.871 0.004 0.000 0.992 0.004
#> GSM96996     1  0.2081      0.860 0.916 0.000 0.000 0.084
#> GSM96997     3  0.0376      0.871 0.004 0.000 0.992 0.004
#> GSM97007     3  0.0188      0.869 0.000 0.000 0.996 0.004
#> GSM96954     3  0.3791      0.711 0.004 0.000 0.796 0.200
#> GSM96962     3  0.0376      0.871 0.004 0.000 0.992 0.004
#> GSM96969     4  0.2654      0.906 0.108 0.000 0.004 0.888
#> GSM96970     4  0.2266      0.917 0.084 0.000 0.004 0.912
#> GSM96973     4  0.2266      0.919 0.084 0.000 0.004 0.912
#> GSM96976     4  0.3432      0.848 0.036 0.060 0.020 0.884
#> GSM96977     1  0.1796      0.862 0.948 0.016 0.004 0.032
#> GSM96995     3  0.5652      0.747 0.144 0.068 0.756 0.032
#> GSM97002     1  0.2216      0.842 0.908 0.000 0.000 0.092
#> GSM97009     1  0.7120      0.681 0.656 0.184 0.060 0.100
#> GSM97010     1  0.3249      0.860 0.888 0.044 0.008 0.060
#> GSM96974     4  0.2908      0.851 0.040 0.000 0.064 0.896
#> GSM96985     3  0.0000      0.870 0.000 0.000 1.000 0.000
#> GSM96959     2  0.8023      0.233 0.312 0.524 0.084 0.080
#> GSM96972     4  0.3172      0.851 0.160 0.000 0.000 0.840
#> GSM96978     3  0.0000      0.870 0.000 0.000 1.000 0.000
#> GSM96967     4  0.2266      0.919 0.084 0.000 0.004 0.912
#> GSM96987     1  0.1022      0.861 0.968 0.000 0.000 0.032
#> GSM97011     1  0.6993      0.698 0.672 0.160 0.060 0.108
#> GSM96964     1  0.1543      0.861 0.956 0.008 0.004 0.032
#> GSM96965     4  0.3353      0.849 0.036 0.056 0.020 0.888
#> GSM96981     1  0.1716      0.858 0.936 0.000 0.000 0.064
#> GSM96982     1  0.1716      0.858 0.936 0.000 0.000 0.064
#> GSM96988     3  0.3639      0.819 0.096 0.028 0.864 0.012
#> GSM97000     1  0.5427      0.788 0.780 0.096 0.036 0.088
#> GSM97004     1  0.2281      0.841 0.904 0.000 0.000 0.096
#> GSM97008     1  0.4772      0.816 0.816 0.064 0.028 0.092
#> GSM96950     1  0.1771      0.863 0.948 0.012 0.004 0.036
#> GSM96980     1  0.3444      0.774 0.816 0.000 0.000 0.184
#> GSM96989     1  0.1022      0.861 0.968 0.000 0.000 0.032
#> GSM96992     1  0.2149      0.844 0.912 0.000 0.000 0.088
#> GSM96993     1  0.2521      0.858 0.916 0.020 0.004 0.060
#> GSM96958     1  0.1674      0.862 0.952 0.012 0.004 0.032
#> GSM96951     1  0.1389      0.860 0.952 0.000 0.000 0.048
#> GSM96952     1  0.2149      0.844 0.912 0.000 0.000 0.088
#> GSM96961     1  0.2149      0.844 0.912 0.000 0.000 0.088

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97038     2  0.5343     0.7029 0.020 0.732 0.096 0.012 0.140
#> GSM97045     2  0.0880     0.9478 0.000 0.968 0.000 0.000 0.032
#> GSM97047     5  0.5505     0.5618 0.036 0.092 0.092 0.032 0.748
#> GSM97025     2  0.0880     0.9478 0.000 0.968 0.000 0.000 0.032
#> GSM97030     3  0.2659     0.7924 0.004 0.040 0.904 0.036 0.016
#> GSM97027     2  0.0880     0.9478 0.000 0.968 0.000 0.000 0.032
#> GSM97033     2  0.0771     0.9548 0.004 0.976 0.000 0.000 0.020
#> GSM97034     5  0.4979     0.6223 0.024 0.088 0.056 0.048 0.784
#> GSM97020     2  0.0794     0.9503 0.000 0.972 0.000 0.000 0.028
#> GSM97026     5  0.2902     0.6810 0.008 0.052 0.036 0.012 0.892
#> GSM97012     2  0.0000     0.9623 0.000 1.000 0.000 0.000 0.000
#> GSM97015     3  0.3102     0.7927 0.004 0.040 0.884 0.036 0.036
#> GSM97016     2  0.0290     0.9602 0.008 0.992 0.000 0.000 0.000
#> GSM97017     5  0.0833     0.7094 0.016 0.004 0.004 0.000 0.976
#> GSM97019     2  0.0000     0.9623 0.000 1.000 0.000 0.000 0.000
#> GSM97022     2  0.0000     0.9623 0.000 1.000 0.000 0.000 0.000
#> GSM97035     2  0.0000     0.9623 0.000 1.000 0.000 0.000 0.000
#> GSM97036     5  0.2770     0.6817 0.124 0.004 0.000 0.008 0.864
#> GSM97039     2  0.0162     0.9612 0.004 0.996 0.000 0.000 0.000
#> GSM97046     2  0.0162     0.9612 0.004 0.996 0.000 0.000 0.000
#> GSM97023     5  0.3480     0.5462 0.248 0.000 0.000 0.000 0.752
#> GSM97029     5  0.4361     0.6684 0.044 0.080 0.024 0.032 0.820
#> GSM97043     3  0.7013     0.5685 0.016 0.196 0.576 0.036 0.176
#> GSM97013     5  0.3336     0.5758 0.228 0.000 0.000 0.000 0.772
#> GSM96956     3  0.4266     0.7065 0.004 0.184 0.772 0.028 0.012
#> GSM97024     2  0.0880     0.9390 0.000 0.968 0.032 0.000 0.000
#> GSM97032     3  0.2942     0.7939 0.004 0.036 0.892 0.036 0.032
#> GSM97044     3  0.2659     0.7924 0.004 0.040 0.904 0.036 0.016
#> GSM97049     2  0.0162     0.9612 0.004 0.996 0.000 0.000 0.000
#> GSM96968     3  0.5110     0.7254 0.016 0.048 0.748 0.028 0.160
#> GSM96971     3  0.6272     0.5524 0.200 0.000 0.560 0.236 0.004
#> GSM96986     3  0.3897     0.7605 0.204 0.000 0.768 0.028 0.000
#> GSM97003     1  0.3661     0.8709 0.724 0.000 0.000 0.000 0.276
#> GSM96957     5  0.3488     0.6471 0.168 0.024 0.000 0.000 0.808
#> GSM96960     1  0.3741     0.8671 0.732 0.000 0.000 0.004 0.264
#> GSM96975     1  0.4047     0.8504 0.676 0.000 0.000 0.004 0.320
#> GSM96998     1  0.4403     0.6372 0.560 0.000 0.000 0.004 0.436
#> GSM96999     5  0.3488     0.6471 0.168 0.024 0.000 0.000 0.808
#> GSM97001     5  0.3488     0.6471 0.168 0.024 0.000 0.000 0.808
#> GSM97005     5  0.3003     0.6343 0.188 0.000 0.000 0.000 0.812
#> GSM97006     1  0.3741     0.8671 0.732 0.000 0.000 0.004 0.264
#> GSM97021     5  0.1016     0.7071 0.008 0.004 0.004 0.012 0.972
#> GSM97028     3  0.3260     0.7783 0.004 0.024 0.860 0.012 0.100
#> GSM97031     1  0.5941     0.1387 0.544 0.000 0.124 0.000 0.332
#> GSM97037     3  0.3958     0.7486 0.004 0.128 0.816 0.036 0.016
#> GSM97018     3  0.5669     0.6800 0.008 0.072 0.692 0.032 0.196
#> GSM97014     5  0.3439     0.6601 0.040 0.080 0.024 0.000 0.856
#> GSM97042     2  0.0000     0.9623 0.000 1.000 0.000 0.000 0.000
#> GSM97040     5  0.2637     0.6904 0.048 0.008 0.032 0.008 0.904
#> GSM97041     5  0.0932     0.7099 0.020 0.004 0.004 0.000 0.972
#> GSM96955     2  0.4933     0.7219 0.036 0.756 0.028 0.016 0.164
#> GSM96990     3  0.3145     0.7912 0.008 0.040 0.884 0.036 0.032
#> GSM96991     2  0.0000     0.9623 0.000 1.000 0.000 0.000 0.000
#> GSM97048     2  0.0162     0.9612 0.004 0.996 0.000 0.000 0.000
#> GSM96963     2  0.0000     0.9623 0.000 1.000 0.000 0.000 0.000
#> GSM96953     2  0.0000     0.9623 0.000 1.000 0.000 0.000 0.000
#> GSM96966     4  0.2865     0.9093 0.132 0.000 0.004 0.856 0.008
#> GSM96979     3  0.3897     0.7605 0.204 0.000 0.768 0.028 0.000
#> GSM96983     3  0.0794     0.7955 0.028 0.000 0.972 0.000 0.000
#> GSM96984     3  0.3897     0.7596 0.204 0.000 0.768 0.028 0.000
#> GSM96994     3  0.3897     0.7605 0.204 0.000 0.768 0.028 0.000
#> GSM96996     1  0.3999     0.8281 0.656 0.000 0.000 0.000 0.344
#> GSM96997     3  0.3993     0.7556 0.216 0.000 0.756 0.028 0.000
#> GSM97007     3  0.3897     0.7596 0.204 0.000 0.768 0.028 0.000
#> GSM96954     3  0.6272     0.5524 0.200 0.000 0.560 0.236 0.004
#> GSM96962     3  0.3897     0.7605 0.204 0.000 0.768 0.028 0.000
#> GSM96969     4  0.3224     0.8954 0.160 0.000 0.000 0.824 0.016
#> GSM96970     4  0.2648     0.9112 0.152 0.000 0.000 0.848 0.000
#> GSM96973     4  0.2561     0.9132 0.144 0.000 0.000 0.856 0.000
#> GSM96976     4  0.1809     0.8463 0.000 0.060 0.000 0.928 0.012
#> GSM96977     5  0.3210     0.6056 0.212 0.000 0.000 0.000 0.788
#> GSM96995     3  0.5110     0.7254 0.016 0.048 0.748 0.028 0.160
#> GSM97002     1  0.3661     0.8709 0.724 0.000 0.000 0.000 0.276
#> GSM97009     5  0.4592     0.6242 0.040 0.096 0.052 0.012 0.800
#> GSM97010     5  0.5143    -0.2500 0.420 0.032 0.004 0.000 0.544
#> GSM96974     4  0.1799     0.8575 0.020 0.000 0.028 0.940 0.012
#> GSM96985     3  0.0794     0.7955 0.028 0.000 0.972 0.000 0.000
#> GSM96959     5  0.6783    -0.0393 0.036 0.432 0.076 0.012 0.444
#> GSM96972     4  0.4024     0.8102 0.220 0.000 0.000 0.752 0.028
#> GSM96978     3  0.0794     0.7955 0.028 0.000 0.972 0.000 0.000
#> GSM96967     4  0.2561     0.9132 0.144 0.000 0.000 0.856 0.000
#> GSM96987     5  0.3636     0.4935 0.272 0.000 0.000 0.000 0.728
#> GSM97011     5  0.4036     0.6380 0.032 0.068 0.052 0.012 0.836
#> GSM96964     5  0.3242     0.6017 0.216 0.000 0.000 0.000 0.784
#> GSM96965     4  0.1845     0.8477 0.000 0.056 0.000 0.928 0.016
#> GSM96981     1  0.4009     0.8562 0.684 0.000 0.000 0.004 0.312
#> GSM96982     1  0.4009     0.8562 0.684 0.000 0.000 0.004 0.312
#> GSM96988     3  0.3260     0.7783 0.004 0.024 0.860 0.012 0.100
#> GSM97000     5  0.2694     0.6941 0.056 0.008 0.028 0.008 0.900
#> GSM97004     1  0.3741     0.8671 0.732 0.000 0.000 0.004 0.264
#> GSM97008     5  0.2514     0.7088 0.056 0.008 0.020 0.008 0.908
#> GSM96950     5  0.3398     0.6082 0.216 0.004 0.000 0.000 0.780
#> GSM96980     1  0.5141     0.7800 0.672 0.000 0.000 0.092 0.236
#> GSM96989     5  0.3636     0.4935 0.272 0.000 0.000 0.000 0.728
#> GSM96992     1  0.3774     0.8690 0.704 0.000 0.000 0.000 0.296
#> GSM96993     5  0.2818     0.6798 0.128 0.004 0.000 0.008 0.860
#> GSM96958     5  0.3242     0.6004 0.216 0.000 0.000 0.000 0.784
#> GSM96951     1  0.4227     0.6940 0.580 0.000 0.000 0.000 0.420
#> GSM96952     1  0.3774     0.8690 0.704 0.000 0.000 0.000 0.296
#> GSM96961     1  0.3774     0.8690 0.704 0.000 0.000 0.000 0.296

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.5056     0.6576 0.000 0.708 0.136 0.012 0.124 0.020
#> GSM97045     2  0.1010     0.9448 0.000 0.960 0.004 0.000 0.036 0.000
#> GSM97047     5  0.4455     0.6671 0.000 0.064 0.148 0.008 0.756 0.024
#> GSM97025     2  0.1010     0.9448 0.000 0.960 0.004 0.000 0.036 0.000
#> GSM97030     3  0.1370     0.8470 0.000 0.012 0.948 0.000 0.004 0.036
#> GSM97027     2  0.1010     0.9448 0.000 0.960 0.004 0.000 0.036 0.000
#> GSM97033     2  0.0547     0.9518 0.000 0.980 0.000 0.000 0.020 0.000
#> GSM97034     5  0.4890     0.7174 0.032 0.060 0.120 0.020 0.756 0.012
#> GSM97020     2  0.0790     0.9475 0.000 0.968 0.000 0.000 0.032 0.000
#> GSM97026     5  0.3796     0.7696 0.028 0.044 0.064 0.020 0.836 0.008
#> GSM97012     2  0.0291     0.9581 0.000 0.992 0.004 0.000 0.004 0.000
#> GSM97015     3  0.1700     0.8523 0.000 0.012 0.936 0.000 0.024 0.028
#> GSM97016     2  0.0405     0.9540 0.000 0.988 0.004 0.000 0.000 0.008
#> GSM97017     5  0.1667     0.7888 0.032 0.000 0.012 0.008 0.940 0.008
#> GSM97019     2  0.0291     0.9581 0.000 0.992 0.004 0.000 0.004 0.000
#> GSM97022     2  0.0291     0.9581 0.000 0.992 0.004 0.000 0.004 0.000
#> GSM97035     2  0.0291     0.9581 0.000 0.992 0.004 0.000 0.004 0.000
#> GSM97036     5  0.2723     0.7808 0.128 0.000 0.000 0.016 0.852 0.004
#> GSM97039     2  0.0260     0.9546 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM97046     2  0.0260     0.9546 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM97023     5  0.3314     0.6959 0.256 0.000 0.000 0.004 0.740 0.000
#> GSM97029     5  0.4253     0.7570 0.040 0.056 0.068 0.020 0.808 0.008
#> GSM97043     3  0.4997     0.6369 0.000 0.160 0.660 0.000 0.176 0.004
#> GSM97013     5  0.3314     0.7224 0.224 0.000 0.000 0.012 0.764 0.000
#> GSM96956     3  0.2859     0.7604 0.000 0.156 0.828 0.000 0.000 0.016
#> GSM97024     2  0.1080     0.9396 0.000 0.960 0.032 0.000 0.004 0.004
#> GSM97032     3  0.1838     0.8512 0.000 0.012 0.928 0.000 0.020 0.040
#> GSM97044     3  0.1370     0.8470 0.000 0.012 0.948 0.000 0.004 0.036
#> GSM97049     2  0.0260     0.9546 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM96968     3  0.3300     0.7929 0.000 0.016 0.812 0.000 0.156 0.016
#> GSM96971     6  0.3964     0.7389 0.000 0.000 0.044 0.232 0.000 0.724
#> GSM96986     6  0.1267     0.9299 0.000 0.000 0.060 0.000 0.000 0.940
#> GSM97003     1  0.0458     0.8231 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM96957     5  0.3784     0.7582 0.180 0.020 0.012 0.004 0.780 0.004
#> GSM96960     1  0.0146     0.8146 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM96975     1  0.2196     0.8286 0.884 0.000 0.004 0.004 0.108 0.000
#> GSM96998     1  0.3314     0.6851 0.764 0.000 0.000 0.012 0.224 0.000
#> GSM96999     5  0.3784     0.7582 0.180 0.020 0.012 0.004 0.780 0.004
#> GSM97001     5  0.3784     0.7582 0.180 0.020 0.012 0.004 0.780 0.004
#> GSM97005     5  0.2994     0.7474 0.208 0.000 0.000 0.004 0.788 0.000
#> GSM97006     1  0.0146     0.8146 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM97021     5  0.2215     0.7881 0.032 0.000 0.024 0.020 0.916 0.008
#> GSM97028     3  0.3874     0.8130 0.000 0.012 0.804 0.008 0.096 0.080
#> GSM97031     1  0.6416     0.1555 0.404 0.000 0.016 0.000 0.304 0.276
#> GSM97037     3  0.2526     0.8125 0.000 0.096 0.876 0.000 0.004 0.024
#> GSM97018     3  0.4706     0.7352 0.000 0.044 0.728 0.012 0.184 0.032
#> GSM97014     5  0.3136     0.7484 0.000 0.068 0.032 0.012 0.864 0.024
#> GSM97042     2  0.0291     0.9581 0.000 0.992 0.004 0.000 0.004 0.000
#> GSM97040     5  0.2179     0.7751 0.012 0.000 0.040 0.008 0.916 0.024
#> GSM97041     5  0.1628     0.7899 0.036 0.000 0.012 0.004 0.940 0.008
#> GSM96955     2  0.4870     0.7059 0.000 0.736 0.064 0.020 0.148 0.032
#> GSM96990     3  0.1616     0.8516 0.000 0.012 0.940 0.000 0.020 0.028
#> GSM96991     2  0.0291     0.9581 0.000 0.992 0.004 0.000 0.004 0.000
#> GSM97048     2  0.0260     0.9546 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM96963     2  0.0291     0.9581 0.000 0.992 0.004 0.000 0.004 0.000
#> GSM96953     2  0.0291     0.9581 0.000 0.992 0.004 0.000 0.004 0.000
#> GSM96966     4  0.2191     0.9033 0.120 0.000 0.000 0.876 0.000 0.004
#> GSM96979     6  0.1267     0.9299 0.000 0.000 0.060 0.000 0.000 0.940
#> GSM96983     3  0.2100     0.7995 0.000 0.000 0.884 0.004 0.000 0.112
#> GSM96984     6  0.1204     0.9252 0.000 0.000 0.056 0.000 0.000 0.944
#> GSM96994     6  0.1267     0.9299 0.000 0.000 0.060 0.000 0.000 0.940
#> GSM96996     1  0.1765     0.8226 0.904 0.000 0.000 0.000 0.096 0.000
#> GSM96997     6  0.1007     0.9257 0.000 0.000 0.044 0.000 0.000 0.956
#> GSM97007     6  0.1204     0.9252 0.000 0.000 0.056 0.000 0.000 0.944
#> GSM96954     6  0.3964     0.7389 0.000 0.000 0.044 0.232 0.000 0.724
#> GSM96962     6  0.1267     0.9299 0.000 0.000 0.060 0.000 0.000 0.940
#> GSM96969     4  0.2558     0.8957 0.156 0.000 0.000 0.840 0.000 0.004
#> GSM96970     4  0.2320     0.9069 0.132 0.000 0.000 0.864 0.000 0.004
#> GSM96973     4  0.2135     0.9083 0.128 0.000 0.000 0.872 0.000 0.000
#> GSM96976     4  0.1625     0.8311 0.000 0.060 0.012 0.928 0.000 0.000
#> GSM96977     5  0.3081     0.7303 0.220 0.000 0.000 0.004 0.776 0.000
#> GSM96995     3  0.3300     0.7929 0.000 0.016 0.812 0.000 0.156 0.016
#> GSM97002     1  0.0458     0.8231 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM97009     5  0.4267     0.7168 0.008 0.076 0.076 0.016 0.800 0.024
#> GSM97010     1  0.4889     0.4548 0.620 0.028 0.012 0.008 0.328 0.004
#> GSM96974     4  0.1003     0.8384 0.004 0.000 0.028 0.964 0.000 0.004
#> GSM96985     3  0.2100     0.7995 0.000 0.000 0.884 0.004 0.000 0.112
#> GSM96959     5  0.6446     0.0362 0.000 0.404 0.116 0.016 0.432 0.032
#> GSM96972     4  0.3240     0.8046 0.244 0.000 0.000 0.752 0.000 0.004
#> GSM96978     3  0.2100     0.7995 0.000 0.000 0.884 0.004 0.000 0.112
#> GSM96967     4  0.2135     0.9083 0.128 0.000 0.000 0.872 0.000 0.000
#> GSM96987     5  0.3690     0.6501 0.288 0.000 0.000 0.012 0.700 0.000
#> GSM97011     5  0.3620     0.7288 0.000 0.052 0.072 0.016 0.836 0.024
#> GSM96964     5  0.3109     0.7297 0.224 0.000 0.000 0.004 0.772 0.000
#> GSM96965     4  0.1657     0.8326 0.000 0.056 0.016 0.928 0.000 0.000
#> GSM96981     1  0.1788     0.8328 0.916 0.000 0.004 0.004 0.076 0.000
#> GSM96982     1  0.1788     0.8328 0.916 0.000 0.004 0.004 0.076 0.000
#> GSM96988     3  0.3874     0.8130 0.000 0.012 0.804 0.008 0.096 0.080
#> GSM97000     5  0.2289     0.7781 0.020 0.000 0.036 0.008 0.912 0.024
#> GSM97004     1  0.0146     0.8146 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM97008     5  0.2327     0.7909 0.044 0.000 0.028 0.008 0.908 0.012
#> GSM96950     5  0.3081     0.7323 0.220 0.000 0.000 0.004 0.776 0.000
#> GSM96980     1  0.2113     0.7425 0.896 0.000 0.000 0.092 0.008 0.004
#> GSM96989     5  0.3690     0.6501 0.288 0.000 0.000 0.012 0.700 0.000
#> GSM96992     1  0.2092     0.8091 0.876 0.000 0.000 0.000 0.124 0.000
#> GSM96993     5  0.2765     0.7797 0.132 0.000 0.000 0.016 0.848 0.004
#> GSM96958     5  0.3109     0.7266 0.224 0.000 0.000 0.004 0.772 0.000
#> GSM96951     1  0.3371     0.6138 0.708 0.000 0.000 0.000 0.292 0.000
#> GSM96952     1  0.2092     0.8091 0.876 0.000 0.000 0.000 0.124 0.000
#> GSM96961     1  0.2092     0.8091 0.876 0.000 0.000 0.000 0.124 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-hclust-collect-classes

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

test_to_known_factors(res)
#>            n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:hclust 99         0.000120       0.166     2.00e-10  0.00263 2
#> SD:hclust 99         0.001471       0.188     8.26e-14  0.01966 3
#> SD:hclust 99         0.000597       0.072     5.23e-16  0.02581 4
#> SD:hclust 95         0.000227       0.125     6.70e-15  0.08524 5
#> SD:hclust 97         0.000355       0.165     1.98e-17  0.03266 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 21168 rows and 100 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 1.000           0.951       0.980         0.4885 0.508   0.508
#> 3 3 0.630           0.793       0.885         0.3320 0.751   0.551
#> 4 4 0.764           0.513       0.746         0.1294 0.913   0.758
#> 5 5 0.694           0.655       0.802         0.0655 0.874   0.603
#> 6 6 0.746           0.759       0.807         0.0457 0.916   0.660

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
#> GSM97038     2  0.0376     0.9636 0.004 0.996
#> GSM97045     2  0.0376     0.9636 0.004 0.996
#> GSM97047     2  0.0376     0.9636 0.004 0.996
#> GSM97025     2  0.0376     0.9636 0.004 0.996
#> GSM97030     2  0.0000     0.9622 0.000 1.000
#> GSM97027     2  0.0376     0.9636 0.004 0.996
#> GSM97033     2  0.0376     0.9636 0.004 0.996
#> GSM97034     2  0.0000     0.9622 0.000 1.000
#> GSM97020     2  0.0376     0.9636 0.004 0.996
#> GSM97026     2  0.0376     0.9636 0.004 0.996
#> GSM97012     2  0.0376     0.9636 0.004 0.996
#> GSM97015     2  0.0000     0.9622 0.000 1.000
#> GSM97016     2  0.0376     0.9636 0.004 0.996
#> GSM97017     1  0.0000     0.9919 1.000 0.000
#> GSM97019     2  0.0376     0.9636 0.004 0.996
#> GSM97022     2  0.0376     0.9636 0.004 0.996
#> GSM97035     2  0.0376     0.9636 0.004 0.996
#> GSM97036     1  0.0000     0.9919 1.000 0.000
#> GSM97039     2  0.0376     0.9636 0.004 0.996
#> GSM97046     2  0.0376     0.9636 0.004 0.996
#> GSM97023     1  0.0000     0.9919 1.000 0.000
#> GSM97029     1  0.0000     0.9919 1.000 0.000
#> GSM97043     2  0.0376     0.9636 0.004 0.996
#> GSM97013     1  0.0000     0.9919 1.000 0.000
#> GSM96956     2  0.0000     0.9622 0.000 1.000
#> GSM97024     2  0.0000     0.9622 0.000 1.000
#> GSM97032     2  0.0000     0.9622 0.000 1.000
#> GSM97044     2  0.0000     0.9622 0.000 1.000
#> GSM97049     2  0.0376     0.9636 0.004 0.996
#> GSM96968     1  0.1633     0.9728 0.976 0.024
#> GSM96971     1  0.0376     0.9899 0.996 0.004
#> GSM96986     1  0.0376     0.9899 0.996 0.004
#> GSM97003     1  0.0376     0.9899 0.996 0.004
#> GSM96957     1  0.0000     0.9919 1.000 0.000
#> GSM96960     1  0.0376     0.9899 0.996 0.004
#> GSM96975     1  0.0000     0.9919 1.000 0.000
#> GSM96998     1  0.0000     0.9919 1.000 0.000
#> GSM96999     1  0.0000     0.9919 1.000 0.000
#> GSM97001     1  0.0000     0.9919 1.000 0.000
#> GSM97005     1  0.0000     0.9919 1.000 0.000
#> GSM97006     1  0.0000     0.9919 1.000 0.000
#> GSM97021     1  0.0000     0.9919 1.000 0.000
#> GSM97028     2  0.9998     0.0613 0.492 0.508
#> GSM97031     1  0.0376     0.9899 0.996 0.004
#> GSM97037     2  0.0000     0.9622 0.000 1.000
#> GSM97018     2  0.0000     0.9622 0.000 1.000
#> GSM97014     2  0.0376     0.9636 0.004 0.996
#> GSM97042     2  0.0376     0.9636 0.004 0.996
#> GSM97040     2  0.9248     0.5013 0.340 0.660
#> GSM97041     1  0.0000     0.9919 1.000 0.000
#> GSM96955     2  0.0376     0.9636 0.004 0.996
#> GSM96990     2  0.0000     0.9622 0.000 1.000
#> GSM96991     2  0.0376     0.9636 0.004 0.996
#> GSM97048     2  0.0376     0.9636 0.004 0.996
#> GSM96963     2  0.0376     0.9636 0.004 0.996
#> GSM96953     2  0.0376     0.9636 0.004 0.996
#> GSM96966     1  0.0000     0.9919 1.000 0.000
#> GSM96979     1  0.0376     0.9899 0.996 0.004
#> GSM96983     2  0.0000     0.9622 0.000 1.000
#> GSM96984     1  0.2603     0.9525 0.956 0.044
#> GSM96994     2  0.1843     0.9405 0.028 0.972
#> GSM96996     1  0.0000     0.9919 1.000 0.000
#> GSM96997     1  0.0376     0.9899 0.996 0.004
#> GSM97007     2  0.4022     0.8903 0.080 0.920
#> GSM96954     1  0.0376     0.9899 0.996 0.004
#> GSM96962     1  0.0376     0.9899 0.996 0.004
#> GSM96969     1  0.0000     0.9919 1.000 0.000
#> GSM96970     1  0.0000     0.9919 1.000 0.000
#> GSM96973     1  0.0000     0.9919 1.000 0.000
#> GSM96976     1  0.8499     0.6034 0.724 0.276
#> GSM96977     1  0.0000     0.9919 1.000 0.000
#> GSM96995     2  0.9993     0.0796 0.484 0.516
#> GSM97002     1  0.0000     0.9919 1.000 0.000
#> GSM97009     2  0.0376     0.9636 0.004 0.996
#> GSM97010     1  0.0000     0.9919 1.000 0.000
#> GSM96974     1  0.0376     0.9899 0.996 0.004
#> GSM96985     1  0.0376     0.9899 0.996 0.004
#> GSM96959     2  0.0000     0.9622 0.000 1.000
#> GSM96972     1  0.0000     0.9919 1.000 0.000
#> GSM96978     1  0.2948     0.9438 0.948 0.052
#> GSM96967     1  0.0000     0.9919 1.000 0.000
#> GSM96987     1  0.0000     0.9919 1.000 0.000
#> GSM97011     1  0.0000     0.9919 1.000 0.000
#> GSM96964     1  0.0000     0.9919 1.000 0.000
#> GSM96965     1  0.0000     0.9919 1.000 0.000
#> GSM96981     1  0.0000     0.9919 1.000 0.000
#> GSM96982     1  0.0000     0.9919 1.000 0.000
#> GSM96988     1  0.0376     0.9899 0.996 0.004
#> GSM97000     1  0.0376     0.9899 0.996 0.004
#> GSM97004     1  0.0000     0.9919 1.000 0.000
#> GSM97008     1  0.0000     0.9919 1.000 0.000
#> GSM96950     1  0.0000     0.9919 1.000 0.000
#> GSM96980     1  0.0000     0.9919 1.000 0.000
#> GSM96989     1  0.0000     0.9919 1.000 0.000
#> GSM96992     1  0.0000     0.9919 1.000 0.000
#> GSM96993     1  0.0000     0.9919 1.000 0.000
#> GSM96958     1  0.0000     0.9919 1.000 0.000
#> GSM96951     1  0.0000     0.9919 1.000 0.000
#> GSM96952     1  0.0000     0.9919 1.000 0.000
#> GSM96961     1  0.0000     0.9919 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
#> GSM97038     2  0.0000     0.9289 0.000 1.000 0.000
#> GSM97045     2  0.0424     0.9300 0.000 0.992 0.008
#> GSM97047     2  0.6180     0.0760 0.000 0.584 0.416
#> GSM97025     2  0.0424     0.9300 0.000 0.992 0.008
#> GSM97030     3  0.5529     0.6692 0.000 0.296 0.704
#> GSM97027     2  0.0424     0.9300 0.000 0.992 0.008
#> GSM97033     2  0.0237     0.9282 0.000 0.996 0.004
#> GSM97034     3  0.5465     0.6801 0.000 0.288 0.712
#> GSM97020     2  0.0237     0.9282 0.000 0.996 0.004
#> GSM97026     2  0.5420     0.5915 0.008 0.752 0.240
#> GSM97012     2  0.0747     0.9303 0.000 0.984 0.016
#> GSM97015     3  0.5656     0.6851 0.004 0.284 0.712
#> GSM97016     2  0.0237     0.9282 0.000 0.996 0.004
#> GSM97017     1  0.1315     0.8794 0.972 0.008 0.020
#> GSM97019     2  0.0747     0.9303 0.000 0.984 0.016
#> GSM97022     2  0.0747     0.9303 0.000 0.984 0.016
#> GSM97035     2  0.0747     0.9303 0.000 0.984 0.016
#> GSM97036     1  0.0848     0.8819 0.984 0.008 0.008
#> GSM97039     2  0.0237     0.9282 0.000 0.996 0.004
#> GSM97046     2  0.0237     0.9282 0.000 0.996 0.004
#> GSM97023     1  0.0000     0.8835 1.000 0.000 0.000
#> GSM97029     1  0.1315     0.8794 0.972 0.008 0.020
#> GSM97043     2  0.0747     0.9303 0.000 0.984 0.016
#> GSM97013     1  0.0661     0.8819 0.988 0.008 0.004
#> GSM96956     2  0.3267     0.8145 0.000 0.884 0.116
#> GSM97024     2  0.0747     0.9303 0.000 0.984 0.016
#> GSM97032     3  0.5465     0.6801 0.000 0.288 0.712
#> GSM97044     3  0.5465     0.6801 0.000 0.288 0.712
#> GSM97049     2  0.0237     0.9282 0.000 0.996 0.004
#> GSM96968     3  0.4974     0.7209 0.236 0.000 0.764
#> GSM96971     3  0.1031     0.7858 0.024 0.000 0.976
#> GSM96986     3  0.2878     0.8046 0.096 0.000 0.904
#> GSM97003     1  0.3412     0.8425 0.876 0.000 0.124
#> GSM96957     1  0.1315     0.8794 0.972 0.008 0.020
#> GSM96960     1  0.3340     0.8423 0.880 0.000 0.120
#> GSM96975     1  0.0592     0.8829 0.988 0.000 0.012
#> GSM96998     1  0.0424     0.8835 0.992 0.000 0.008
#> GSM96999     1  0.0592     0.8829 0.988 0.000 0.012
#> GSM97001     1  0.1315     0.8794 0.972 0.008 0.020
#> GSM97005     1  0.0747     0.8822 0.984 0.000 0.016
#> GSM97006     1  0.3340     0.8423 0.880 0.000 0.120
#> GSM97021     1  0.2384     0.8596 0.936 0.008 0.056
#> GSM97028     3  0.4469     0.8095 0.076 0.060 0.864
#> GSM97031     1  0.3267     0.8362 0.884 0.000 0.116
#> GSM97037     3  0.6225     0.4056 0.000 0.432 0.568
#> GSM97018     3  0.5431     0.6829 0.000 0.284 0.716
#> GSM97014     2  0.3325     0.8310 0.076 0.904 0.020
#> GSM97042     2  0.0747     0.9303 0.000 0.984 0.016
#> GSM97040     1  0.6936    -0.0340 0.524 0.016 0.460
#> GSM97041     1  0.1315     0.8794 0.972 0.008 0.020
#> GSM96955     2  0.0592     0.9288 0.000 0.988 0.012
#> GSM96990     3  0.5497     0.6798 0.000 0.292 0.708
#> GSM96991     2  0.0747     0.9303 0.000 0.984 0.016
#> GSM97048     2  0.0237     0.9282 0.000 0.996 0.004
#> GSM96963     2  0.0747     0.9303 0.000 0.984 0.016
#> GSM96953     2  0.0747     0.9303 0.000 0.984 0.016
#> GSM96966     1  0.5397     0.7273 0.720 0.000 0.280
#> GSM96979     3  0.2959     0.8041 0.100 0.000 0.900
#> GSM96983     3  0.3551     0.7800 0.000 0.132 0.868
#> GSM96984     3  0.3043     0.8101 0.084 0.008 0.908
#> GSM96994     3  0.3325     0.8025 0.020 0.076 0.904
#> GSM96996     1  0.2066     0.8708 0.940 0.000 0.060
#> GSM96997     3  0.2959     0.8041 0.100 0.000 0.900
#> GSM97007     3  0.3045     0.8043 0.020 0.064 0.916
#> GSM96954     3  0.4887     0.7284 0.228 0.000 0.772
#> GSM96962     3  0.2959     0.8041 0.100 0.000 0.900
#> GSM96969     1  0.5397     0.7273 0.720 0.000 0.280
#> GSM96970     1  0.5363     0.7310 0.724 0.000 0.276
#> GSM96973     1  0.5397     0.7273 0.720 0.000 0.280
#> GSM96976     3  0.2056     0.7901 0.024 0.024 0.952
#> GSM96977     1  0.6026     0.2927 0.624 0.000 0.376
#> GSM96995     3  0.6375     0.7069 0.244 0.036 0.720
#> GSM97002     1  0.3116     0.8488 0.892 0.000 0.108
#> GSM97009     2  0.8920     0.0892 0.144 0.532 0.324
#> GSM97010     1  0.2878     0.8453 0.904 0.000 0.096
#> GSM96974     3  0.3482     0.7101 0.128 0.000 0.872
#> GSM96985     3  0.4796     0.6359 0.220 0.000 0.780
#> GSM96959     3  0.6337     0.6984 0.028 0.264 0.708
#> GSM96972     1  0.5397     0.7273 0.720 0.000 0.280
#> GSM96978     3  0.2200     0.8083 0.056 0.004 0.940
#> GSM96967     1  0.5397     0.7273 0.720 0.000 0.280
#> GSM96987     1  0.0000     0.8835 1.000 0.000 0.000
#> GSM97011     1  0.3213     0.8318 0.900 0.008 0.092
#> GSM96964     1  0.0000     0.8835 1.000 0.000 0.000
#> GSM96965     1  0.5016     0.7629 0.760 0.000 0.240
#> GSM96981     1  0.0237     0.8831 0.996 0.000 0.004
#> GSM96982     1  0.1753     0.8749 0.952 0.000 0.048
#> GSM96988     3  0.2878     0.8063 0.096 0.000 0.904
#> GSM97000     1  0.6252     0.0655 0.556 0.000 0.444
#> GSM97004     1  0.3412     0.8407 0.876 0.000 0.124
#> GSM97008     1  0.3816     0.7743 0.852 0.000 0.148
#> GSM96950     1  0.0424     0.8832 0.992 0.000 0.008
#> GSM96980     1  0.4291     0.8099 0.820 0.000 0.180
#> GSM96989     1  0.0000     0.8835 1.000 0.000 0.000
#> GSM96992     1  0.0592     0.8830 0.988 0.000 0.012
#> GSM96993     1  0.0829     0.8825 0.984 0.004 0.012
#> GSM96958     1  0.0000     0.8835 1.000 0.000 0.000
#> GSM96951     1  0.0424     0.8835 0.992 0.000 0.008
#> GSM96952     1  0.0424     0.8835 0.992 0.000 0.008
#> GSM96961     1  0.0424     0.8835 0.992 0.000 0.008

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.1792     0.9371 0.000 0.932 0.000 0.068
#> GSM97045     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM97047     4  0.7793     0.3328 0.036 0.356 0.112 0.496
#> GSM97025     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM97030     3  0.1211     0.9036 0.000 0.040 0.960 0.000
#> GSM97027     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM97033     2  0.1716     0.9378 0.000 0.936 0.000 0.064
#> GSM97034     3  0.1471     0.9066 0.004 0.024 0.960 0.012
#> GSM97020     2  0.1792     0.9371 0.000 0.932 0.000 0.068
#> GSM97026     4  0.7663     0.3058 0.052 0.396 0.072 0.480
#> GSM97012     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM97015     3  0.1471     0.9066 0.004 0.024 0.960 0.012
#> GSM97016     2  0.1792     0.9371 0.000 0.932 0.000 0.068
#> GSM97017     1  0.5294    -0.1617 0.508 0.000 0.008 0.484
#> GSM97019     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM97036     1  0.5288    -0.1409 0.520 0.000 0.008 0.472
#> GSM97039     2  0.1716     0.9378 0.000 0.936 0.000 0.064
#> GSM97046     2  0.1792     0.9371 0.000 0.932 0.000 0.068
#> GSM97023     1  0.3400     0.3384 0.820 0.000 0.000 0.180
#> GSM97029     1  0.5294    -0.1617 0.508 0.000 0.008 0.484
#> GSM97043     2  0.1109     0.9296 0.000 0.968 0.028 0.004
#> GSM97013     1  0.5163    -0.1426 0.516 0.000 0.004 0.480
#> GSM96956     2  0.6249     0.3867 0.000 0.580 0.352 0.068
#> GSM97024     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM97032     3  0.1211     0.9036 0.000 0.040 0.960 0.000
#> GSM97044     3  0.1211     0.9036 0.000 0.040 0.960 0.000
#> GSM97049     2  0.1792     0.9371 0.000 0.932 0.000 0.068
#> GSM96968     3  0.1109     0.9060 0.004 0.000 0.968 0.028
#> GSM96971     3  0.1302     0.9024 0.000 0.000 0.956 0.044
#> GSM96986     3  0.1256     0.9082 0.008 0.000 0.964 0.028
#> GSM97003     1  0.1807     0.4482 0.940 0.000 0.008 0.052
#> GSM96957     1  0.5168    -0.1619 0.504 0.000 0.004 0.492
#> GSM96960     1  0.1635     0.4509 0.948 0.000 0.008 0.044
#> GSM96975     1  0.4999    -0.1544 0.508 0.000 0.000 0.492
#> GSM96998     1  0.0188     0.4571 0.996 0.000 0.004 0.000
#> GSM96999     1  0.4998    -0.1459 0.512 0.000 0.000 0.488
#> GSM97001     1  0.5168    -0.1619 0.504 0.000 0.004 0.492
#> GSM97005     1  0.5168    -0.1714 0.500 0.000 0.004 0.496
#> GSM97006     1  0.1452     0.4535 0.956 0.000 0.008 0.036
#> GSM97021     4  0.5781     0.1492 0.480 0.000 0.028 0.492
#> GSM97028     3  0.1059     0.9096 0.000 0.016 0.972 0.012
#> GSM97031     1  0.4831     0.2332 0.704 0.000 0.016 0.280
#> GSM97037     3  0.4499     0.7384 0.000 0.160 0.792 0.048
#> GSM97018     3  0.1471     0.9066 0.004 0.024 0.960 0.012
#> GSM97014     4  0.6513     0.2461 0.044 0.400 0.016 0.540
#> GSM97042     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM97040     4  0.6758     0.2583 0.424 0.004 0.080 0.492
#> GSM97041     1  0.5294    -0.1617 0.508 0.000 0.008 0.484
#> GSM96955     2  0.3972     0.7437 0.000 0.788 0.008 0.204
#> GSM96990     3  0.1471     0.9066 0.004 0.024 0.960 0.012
#> GSM96991     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM97048     2  0.1792     0.9371 0.000 0.932 0.000 0.068
#> GSM96963     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000     0.9487 0.000 1.000 0.000 0.000
#> GSM96966     1  0.5792     0.2509 0.552 0.000 0.032 0.416
#> GSM96979     3  0.1256     0.9082 0.008 0.000 0.964 0.028
#> GSM96983     3  0.0564     0.9117 0.004 0.004 0.988 0.004
#> GSM96984     3  0.1256     0.9082 0.008 0.000 0.964 0.028
#> GSM96994     3  0.1151     0.9087 0.008 0.000 0.968 0.024
#> GSM96996     1  0.0524     0.4576 0.988 0.000 0.008 0.004
#> GSM96997     3  0.1256     0.9082 0.008 0.000 0.964 0.028
#> GSM97007     3  0.1256     0.9082 0.008 0.000 0.964 0.028
#> GSM96954     3  0.1256     0.9075 0.008 0.000 0.964 0.028
#> GSM96962     3  0.1256     0.9082 0.008 0.000 0.964 0.028
#> GSM96969     1  0.5792     0.2509 0.552 0.000 0.032 0.416
#> GSM96970     1  0.5792     0.2509 0.552 0.000 0.032 0.416
#> GSM96973     1  0.5792     0.2509 0.552 0.000 0.032 0.416
#> GSM96976     3  0.6924     0.3439 0.108 0.000 0.464 0.428
#> GSM96977     4  0.6546     0.2483 0.432 0.000 0.076 0.492
#> GSM96995     3  0.1388     0.8995 0.012 0.000 0.960 0.028
#> GSM97002     1  0.1635     0.4509 0.948 0.000 0.008 0.044
#> GSM97009     4  0.8247     0.3201 0.304 0.120 0.068 0.508
#> GSM97010     1  0.5697    -0.2141 0.488 0.000 0.024 0.488
#> GSM96974     4  0.7521    -0.3152 0.184 0.000 0.396 0.420
#> GSM96985     3  0.6147     0.5903 0.200 0.000 0.672 0.128
#> GSM96959     3  0.5276     0.1918 0.004 0.004 0.560 0.432
#> GSM96972     1  0.5792     0.2509 0.552 0.000 0.032 0.416
#> GSM96978     3  0.0336     0.9107 0.008 0.000 0.992 0.000
#> GSM96967     1  0.5792     0.2509 0.552 0.000 0.032 0.416
#> GSM96987     1  0.0188     0.4555 0.996 0.000 0.000 0.004
#> GSM97011     4  0.5607     0.1366 0.484 0.000 0.020 0.496
#> GSM96964     1  0.4008     0.2762 0.756 0.000 0.000 0.244
#> GSM96965     4  0.5022    -0.0906 0.264 0.000 0.028 0.708
#> GSM96981     1  0.4790     0.0223 0.620 0.000 0.000 0.380
#> GSM96982     1  0.1356     0.4543 0.960 0.000 0.008 0.032
#> GSM96988     3  0.0336     0.9107 0.008 0.000 0.992 0.000
#> GSM97000     4  0.6491     0.2469 0.432 0.000 0.072 0.496
#> GSM97004     1  0.2048     0.4409 0.928 0.000 0.008 0.064
#> GSM97008     4  0.5607     0.1334 0.484 0.000 0.020 0.496
#> GSM96950     1  0.4994    -0.1361 0.520 0.000 0.000 0.480
#> GSM96980     1  0.5203     0.2584 0.576 0.000 0.008 0.416
#> GSM96989     1  0.0188     0.4555 0.996 0.000 0.000 0.004
#> GSM96992     1  0.0336     0.4575 0.992 0.000 0.008 0.000
#> GSM96993     1  0.5604    -0.1816 0.504 0.000 0.020 0.476
#> GSM96958     1  0.4948    -0.0642 0.560 0.000 0.000 0.440
#> GSM96951     1  0.4567     0.2416 0.716 0.000 0.008 0.276
#> GSM96952     1  0.0336     0.4575 0.992 0.000 0.008 0.000
#> GSM96961     1  0.2053     0.4224 0.924 0.000 0.004 0.072

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97038     2  0.0932     0.8122 0.004 0.972 0.004 0.000 0.020
#> GSM97045     2  0.3430     0.8677 0.000 0.776 0.004 0.220 0.000
#> GSM97047     5  0.4451     0.6233 0.000 0.036 0.128 0.048 0.788
#> GSM97025     2  0.3461     0.8682 0.000 0.772 0.004 0.224 0.000
#> GSM97030     3  0.1597     0.8037 0.000 0.000 0.940 0.012 0.048
#> GSM97027     2  0.3430     0.8677 0.000 0.776 0.004 0.220 0.000
#> GSM97033     2  0.0324     0.8231 0.004 0.992 0.000 0.000 0.004
#> GSM97034     3  0.1701     0.8013 0.000 0.000 0.936 0.016 0.048
#> GSM97020     2  0.0324     0.8231 0.004 0.992 0.000 0.000 0.004
#> GSM97026     5  0.4894     0.6113 0.000 0.020 0.116 0.112 0.752
#> GSM97012     2  0.3612     0.8682 0.000 0.764 0.008 0.228 0.000
#> GSM97015     3  0.1740     0.8009 0.000 0.000 0.932 0.012 0.056
#> GSM97016     2  0.0324     0.8231 0.004 0.992 0.000 0.000 0.004
#> GSM97017     5  0.2104     0.8131 0.060 0.000 0.000 0.024 0.916
#> GSM97019     2  0.3612     0.8682 0.000 0.764 0.008 0.228 0.000
#> GSM97022     2  0.3612     0.8682 0.000 0.764 0.008 0.228 0.000
#> GSM97035     2  0.3612     0.8682 0.000 0.764 0.008 0.228 0.000
#> GSM97036     5  0.3914     0.7339 0.164 0.000 0.000 0.048 0.788
#> GSM97039     2  0.0324     0.8231 0.004 0.992 0.000 0.000 0.004
#> GSM97046     2  0.0324     0.8231 0.004 0.992 0.000 0.000 0.004
#> GSM97023     1  0.4602     0.4989 0.656 0.000 0.000 0.028 0.316
#> GSM97029     5  0.2754     0.8027 0.080 0.000 0.000 0.040 0.880
#> GSM97043     2  0.6112     0.7646 0.000 0.636 0.112 0.216 0.036
#> GSM97013     5  0.3736     0.7560 0.140 0.000 0.000 0.052 0.808
#> GSM96956     2  0.4655     0.4217 0.000 0.660 0.312 0.004 0.024
#> GSM97024     2  0.3612     0.8682 0.000 0.764 0.008 0.228 0.000
#> GSM97032     3  0.1845     0.7993 0.000 0.000 0.928 0.016 0.056
#> GSM97044     3  0.0912     0.8102 0.000 0.000 0.972 0.012 0.016
#> GSM97049     2  0.0324     0.8231 0.004 0.992 0.000 0.000 0.004
#> GSM96968     3  0.1704     0.7986 0.000 0.000 0.928 0.004 0.068
#> GSM96971     3  0.4270     0.6831 0.012 0.000 0.668 0.320 0.000
#> GSM96986     3  0.3989     0.7534 0.008 0.000 0.728 0.260 0.004
#> GSM97003     1  0.4686     0.6275 0.736 0.000 0.000 0.104 0.160
#> GSM96957     5  0.2236     0.8109 0.068 0.000 0.000 0.024 0.908
#> GSM96960     1  0.3278     0.6771 0.824 0.000 0.000 0.020 0.156
#> GSM96975     5  0.1830     0.8124 0.068 0.000 0.000 0.008 0.924
#> GSM96998     1  0.4190     0.6721 0.768 0.000 0.000 0.060 0.172
#> GSM96999     5  0.2813     0.7908 0.108 0.000 0.000 0.024 0.868
#> GSM97001     5  0.1697     0.8134 0.060 0.000 0.000 0.008 0.932
#> GSM97005     5  0.1557     0.8147 0.052 0.000 0.000 0.008 0.940
#> GSM97006     1  0.3278     0.6771 0.824 0.000 0.000 0.020 0.156
#> GSM97021     5  0.1106     0.8144 0.024 0.000 0.000 0.012 0.964
#> GSM97028     3  0.1211     0.8125 0.000 0.000 0.960 0.024 0.016
#> GSM97031     5  0.5114    -0.0803 0.472 0.000 0.000 0.036 0.492
#> GSM97037     3  0.4792     0.5529 0.000 0.232 0.712 0.012 0.044
#> GSM97018     3  0.1774     0.7991 0.000 0.000 0.932 0.016 0.052
#> GSM97014     5  0.3276     0.6700 0.000 0.132 0.000 0.032 0.836
#> GSM97042     2  0.3612     0.8682 0.000 0.764 0.008 0.228 0.000
#> GSM97040     5  0.1502     0.7784 0.000 0.000 0.056 0.004 0.940
#> GSM97041     5  0.2104     0.8131 0.060 0.000 0.000 0.024 0.916
#> GSM96955     2  0.6283     0.5402 0.000 0.576 0.020 0.124 0.280
#> GSM96990     3  0.1740     0.8009 0.000 0.000 0.932 0.012 0.056
#> GSM96991     2  0.3612     0.8682 0.000 0.764 0.008 0.228 0.000
#> GSM97048     2  0.0324     0.8231 0.004 0.992 0.000 0.000 0.004
#> GSM96963     2  0.3582     0.8684 0.000 0.768 0.008 0.224 0.000
#> GSM96953     2  0.3582     0.8684 0.000 0.768 0.008 0.224 0.000
#> GSM96966     1  0.4533    -0.3596 0.544 0.000 0.000 0.448 0.008
#> GSM96979     3  0.3989     0.7534 0.008 0.000 0.728 0.260 0.004
#> GSM96983     3  0.1121     0.8114 0.000 0.000 0.956 0.044 0.000
#> GSM96984     3  0.3989     0.7534 0.008 0.000 0.728 0.260 0.004
#> GSM96994     3  0.3963     0.7550 0.008 0.000 0.732 0.256 0.004
#> GSM96996     1  0.3359     0.6810 0.816 0.000 0.000 0.020 0.164
#> GSM96997     3  0.4146     0.7455 0.012 0.000 0.716 0.268 0.004
#> GSM97007     3  0.3963     0.7550 0.008 0.000 0.732 0.256 0.004
#> GSM96954     3  0.3146     0.7984 0.000 0.000 0.844 0.128 0.028
#> GSM96962     3  0.3989     0.7534 0.008 0.000 0.728 0.260 0.004
#> GSM96969     1  0.4533    -0.3596 0.544 0.000 0.000 0.448 0.008
#> GSM96970     1  0.4533    -0.3596 0.544 0.000 0.000 0.448 0.008
#> GSM96973     1  0.4533    -0.3596 0.544 0.000 0.000 0.448 0.008
#> GSM96976     4  0.6219     0.7313 0.260 0.000 0.196 0.544 0.000
#> GSM96977     5  0.1569     0.7910 0.004 0.000 0.044 0.008 0.944
#> GSM96995     3  0.2233     0.7697 0.000 0.000 0.892 0.004 0.104
#> GSM97002     1  0.3183     0.6785 0.828 0.000 0.000 0.016 0.156
#> GSM97009     5  0.2207     0.7715 0.004 0.020 0.040 0.012 0.924
#> GSM97010     5  0.2390     0.8040 0.084 0.000 0.000 0.020 0.896
#> GSM96974     4  0.6348     0.7331 0.292 0.000 0.196 0.512 0.000
#> GSM96985     3  0.5580     0.2541 0.336 0.000 0.576 0.088 0.000
#> GSM96959     5  0.4610     0.4341 0.000 0.020 0.296 0.008 0.676
#> GSM96972     1  0.4546    -0.3675 0.532 0.000 0.000 0.460 0.008
#> GSM96978     3  0.1608     0.8072 0.000 0.000 0.928 0.072 0.000
#> GSM96967     1  0.4533    -0.3596 0.544 0.000 0.000 0.448 0.008
#> GSM96987     1  0.4066     0.6669 0.768 0.000 0.000 0.044 0.188
#> GSM97011     5  0.0451     0.8090 0.008 0.000 0.000 0.004 0.988
#> GSM96964     1  0.5107     0.3882 0.596 0.000 0.000 0.048 0.356
#> GSM96965     4  0.6589     0.4591 0.312 0.000 0.000 0.456 0.232
#> GSM96981     5  0.4510     0.1876 0.432 0.000 0.000 0.008 0.560
#> GSM96982     1  0.2891     0.6818 0.824 0.000 0.000 0.000 0.176
#> GSM96988     3  0.2102     0.8092 0.004 0.000 0.916 0.068 0.012
#> GSM97000     5  0.0854     0.8046 0.008 0.000 0.012 0.004 0.976
#> GSM97004     1  0.3106     0.6677 0.840 0.000 0.000 0.020 0.140
#> GSM97008     5  0.0451     0.8090 0.008 0.000 0.000 0.004 0.988
#> GSM96950     5  0.3821     0.7482 0.148 0.000 0.000 0.052 0.800
#> GSM96980     1  0.1697     0.4303 0.932 0.000 0.000 0.060 0.008
#> GSM96989     1  0.4170     0.6630 0.760 0.000 0.000 0.048 0.192
#> GSM96992     1  0.2891     0.6818 0.824 0.000 0.000 0.000 0.176
#> GSM96993     5  0.4058     0.7560 0.144 0.000 0.008 0.052 0.796
#> GSM96958     5  0.4734     0.3543 0.372 0.000 0.000 0.024 0.604
#> GSM96951     1  0.4367     0.3975 0.620 0.000 0.000 0.008 0.372
#> GSM96952     1  0.2891     0.6818 0.824 0.000 0.000 0.000 0.176
#> GSM96961     1  0.3809     0.6165 0.736 0.000 0.000 0.008 0.256

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.5154      0.777 0.008 0.680 0.216 0.048 0.048 0.000
#> GSM97045     2  0.0291      0.863 0.000 0.992 0.000 0.004 0.004 0.000
#> GSM97047     5  0.3173      0.727 0.000 0.008 0.156 0.008 0.820 0.008
#> GSM97025     2  0.0436      0.863 0.000 0.988 0.004 0.004 0.004 0.000
#> GSM97030     3  0.4245      0.771 0.000 0.004 0.604 0.000 0.016 0.376
#> GSM97027     2  0.0291      0.863 0.000 0.992 0.000 0.004 0.004 0.000
#> GSM97033     2  0.4777      0.804 0.008 0.724 0.180 0.044 0.044 0.000
#> GSM97034     3  0.4891      0.773 0.000 0.004 0.592 0.032 0.016 0.356
#> GSM97020     2  0.4777      0.804 0.008 0.724 0.180 0.044 0.044 0.000
#> GSM97026     5  0.3875      0.701 0.000 0.016 0.260 0.008 0.716 0.000
#> GSM97012     2  0.0146      0.863 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97015     3  0.4290      0.773 0.000 0.004 0.612 0.000 0.020 0.364
#> GSM97016     2  0.4745      0.803 0.008 0.724 0.184 0.040 0.044 0.000
#> GSM97017     5  0.2994      0.807 0.076 0.000 0.060 0.008 0.856 0.000
#> GSM97019     2  0.0146      0.863 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97022     2  0.0146      0.863 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97035     2  0.0146      0.863 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97036     5  0.6130      0.523 0.272 0.000 0.148 0.040 0.540 0.000
#> GSM97039     2  0.4745      0.803 0.008 0.724 0.184 0.040 0.044 0.000
#> GSM97046     2  0.4775      0.802 0.008 0.720 0.188 0.040 0.044 0.000
#> GSM97023     1  0.3151      0.791 0.848 0.000 0.076 0.012 0.064 0.000
#> GSM97029     5  0.5288      0.713 0.148 0.000 0.136 0.040 0.676 0.000
#> GSM97043     2  0.3309      0.705 0.000 0.788 0.192 0.004 0.016 0.000
#> GSM97013     5  0.6026      0.542 0.268 0.000 0.144 0.036 0.552 0.000
#> GSM96956     3  0.5907      0.272 0.004 0.212 0.640 0.028 0.036 0.080
#> GSM97024     2  0.0146      0.863 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97032     3  0.4254      0.776 0.000 0.004 0.624 0.000 0.020 0.352
#> GSM97044     3  0.3899      0.757 0.000 0.000 0.592 0.000 0.004 0.404
#> GSM97049     2  0.4745      0.803 0.008 0.724 0.184 0.040 0.044 0.000
#> GSM96968     3  0.4606      0.757 0.000 0.000 0.604 0.000 0.052 0.344
#> GSM96971     6  0.2039      0.836 0.000 0.000 0.020 0.076 0.000 0.904
#> GSM96986     6  0.0000      0.929 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97003     1  0.4013      0.689 0.768 0.000 0.016 0.052 0.000 0.164
#> GSM96957     5  0.3526      0.789 0.124 0.000 0.040 0.020 0.816 0.000
#> GSM96960     1  0.1982      0.790 0.912 0.000 0.016 0.068 0.000 0.004
#> GSM96975     5  0.3260      0.797 0.136 0.000 0.028 0.012 0.824 0.000
#> GSM96998     1  0.3300      0.790 0.840 0.000 0.096 0.036 0.028 0.000
#> GSM96999     5  0.4274      0.724 0.200 0.000 0.040 0.024 0.736 0.000
#> GSM97001     5  0.2222      0.812 0.084 0.000 0.012 0.008 0.896 0.000
#> GSM97005     5  0.1866      0.811 0.084 0.000 0.000 0.000 0.908 0.008
#> GSM97006     1  0.1888      0.791 0.916 0.000 0.012 0.068 0.000 0.004
#> GSM97021     5  0.2344      0.816 0.068 0.000 0.028 0.008 0.896 0.000
#> GSM97028     3  0.5072      0.716 0.000 0.000 0.532 0.052 0.012 0.404
#> GSM97031     1  0.6522      0.297 0.464 0.000 0.008 0.020 0.268 0.240
#> GSM97037     3  0.4274      0.614 0.000 0.040 0.736 0.000 0.024 0.200
#> GSM97018     3  0.4776      0.774 0.000 0.004 0.612 0.028 0.016 0.340
#> GSM97014     5  0.1801      0.788 0.012 0.012 0.040 0.004 0.932 0.000
#> GSM97042     2  0.0146      0.863 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97040     5  0.2231      0.801 0.028 0.000 0.068 0.000 0.900 0.004
#> GSM97041     5  0.3185      0.806 0.076 0.000 0.060 0.016 0.848 0.000
#> GSM96955     2  0.5704      0.260 0.008 0.492 0.080 0.016 0.404 0.000
#> GSM96990     3  0.4290      0.773 0.000 0.004 0.612 0.000 0.020 0.364
#> GSM96991     2  0.0405      0.862 0.000 0.988 0.008 0.000 0.004 0.000
#> GSM97048     2  0.4745      0.803 0.008 0.724 0.184 0.040 0.044 0.000
#> GSM96963     2  0.0405      0.862 0.000 0.988 0.008 0.000 0.004 0.000
#> GSM96953     2  0.0146      0.863 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM96966     4  0.2378      0.898 0.152 0.000 0.000 0.848 0.000 0.000
#> GSM96979     6  0.0146      0.932 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM96983     3  0.4879      0.665 0.000 0.000 0.500 0.048 0.004 0.448
#> GSM96984     6  0.0260      0.933 0.000 0.000 0.008 0.000 0.000 0.992
#> GSM96994     6  0.0260      0.933 0.000 0.000 0.008 0.000 0.000 0.992
#> GSM96996     1  0.2001      0.802 0.920 0.000 0.020 0.044 0.016 0.000
#> GSM96997     6  0.0551      0.912 0.004 0.000 0.008 0.004 0.000 0.984
#> GSM97007     6  0.0260      0.933 0.000 0.000 0.008 0.000 0.000 0.992
#> GSM96954     6  0.3296      0.546 0.000 0.000 0.188 0.008 0.012 0.792
#> GSM96962     6  0.0260      0.933 0.000 0.000 0.008 0.000 0.000 0.992
#> GSM96969     4  0.2378      0.898 0.152 0.000 0.000 0.848 0.000 0.000
#> GSM96970     4  0.2378      0.898 0.152 0.000 0.000 0.848 0.000 0.000
#> GSM96973     4  0.2378      0.898 0.152 0.000 0.000 0.848 0.000 0.000
#> GSM96976     4  0.3492      0.751 0.008 0.000 0.064 0.816 0.000 0.112
#> GSM96977     5  0.2939      0.806 0.044 0.000 0.080 0.008 0.864 0.004
#> GSM96995     3  0.4986      0.691 0.000 0.000 0.612 0.000 0.104 0.284
#> GSM97002     1  0.1982      0.793 0.912 0.000 0.016 0.068 0.004 0.000
#> GSM97009     5  0.2599      0.792 0.028 0.000 0.068 0.008 0.888 0.008
#> GSM97010     5  0.5015      0.736 0.168 0.000 0.092 0.032 0.704 0.004
#> GSM96974     4  0.3413      0.753 0.016 0.000 0.052 0.828 0.000 0.104
#> GSM96985     3  0.6968      0.382 0.156 0.000 0.424 0.072 0.008 0.340
#> GSM96959     5  0.3887      0.598 0.000 0.000 0.248 0.008 0.724 0.020
#> GSM96972     4  0.2416      0.878 0.156 0.000 0.000 0.844 0.000 0.000
#> GSM96978     3  0.4887      0.625 0.000 0.000 0.476 0.048 0.004 0.472
#> GSM96967     4  0.2378      0.898 0.152 0.000 0.000 0.848 0.000 0.000
#> GSM96987     1  0.3985      0.766 0.792 0.000 0.120 0.044 0.044 0.000
#> GSM97011     5  0.2207      0.811 0.060 0.000 0.020 0.008 0.908 0.004
#> GSM96964     1  0.4775      0.721 0.732 0.000 0.120 0.044 0.104 0.000
#> GSM96965     4  0.3433      0.762 0.040 0.000 0.012 0.816 0.132 0.000
#> GSM96981     1  0.4667      0.361 0.608 0.000 0.016 0.028 0.348 0.000
#> GSM96982     1  0.1838      0.806 0.928 0.000 0.012 0.040 0.020 0.000
#> GSM96988     3  0.4886      0.633 0.000 0.000 0.480 0.048 0.004 0.468
#> GSM97000     5  0.2172      0.810 0.044 0.000 0.024 0.000 0.912 0.020
#> GSM97004     1  0.1802      0.791 0.916 0.000 0.012 0.072 0.000 0.000
#> GSM97008     5  0.1921      0.813 0.056 0.000 0.012 0.000 0.920 0.012
#> GSM96950     5  0.6034      0.552 0.256 0.000 0.152 0.036 0.556 0.000
#> GSM96980     1  0.2912      0.679 0.816 0.000 0.012 0.172 0.000 0.000
#> GSM96989     1  0.4110      0.763 0.784 0.000 0.120 0.044 0.052 0.000
#> GSM96992     1  0.1492      0.808 0.940 0.000 0.000 0.036 0.024 0.000
#> GSM96993     5  0.6039      0.539 0.264 0.000 0.148 0.036 0.552 0.000
#> GSM96958     1  0.5229      0.406 0.596 0.000 0.052 0.032 0.320 0.000
#> GSM96951     1  0.3636      0.782 0.820 0.000 0.028 0.028 0.116 0.008
#> GSM96952     1  0.1636      0.808 0.936 0.000 0.004 0.036 0.024 0.000
#> GSM96961     1  0.2122      0.808 0.916 0.000 0.024 0.028 0.032 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-kmeans-collect-classes

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

test_to_known_factors(res)
#>            n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:kmeans 98         4.41e-06       0.222     5.40e-15   0.0691 2
#> SD:kmeans 94         1.92e-04       0.413     1.41e-18   0.0374 3
#> SD:kmeans 46         4.76e-03       0.550     1.31e-05   0.0231 4
#> SD:kmeans 83         5.43e-03       0.468     2.72e-12   0.2240 5
#> SD:kmeans 94         1.45e-04       0.372     2.03e-16   0.0504 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 21168 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.986       0.994         0.5009 0.500   0.500
#> 3 3 0.837           0.942       0.966         0.3070 0.788   0.600
#> 4 4 0.768           0.695       0.876         0.1394 0.851   0.599
#> 5 5 0.735           0.748       0.841         0.0635 0.879   0.582
#> 6 6 0.733           0.668       0.766         0.0389 0.970   0.858

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
#> GSM97038     2   0.000      0.997 0.000 1.000
#> GSM97045     2   0.000      0.997 0.000 1.000
#> GSM97047     2   0.000      0.997 0.000 1.000
#> GSM97025     2   0.000      0.997 0.000 1.000
#> GSM97030     2   0.000      0.997 0.000 1.000
#> GSM97027     2   0.000      0.997 0.000 1.000
#> GSM97033     2   0.000      0.997 0.000 1.000
#> GSM97034     2   0.000      0.997 0.000 1.000
#> GSM97020     2   0.000      0.997 0.000 1.000
#> GSM97026     2   0.000      0.997 0.000 1.000
#> GSM97012     2   0.000      0.997 0.000 1.000
#> GSM97015     2   0.000      0.997 0.000 1.000
#> GSM97016     2   0.000      0.997 0.000 1.000
#> GSM97017     1   0.000      0.992 1.000 0.000
#> GSM97019     2   0.000      0.997 0.000 1.000
#> GSM97022     2   0.000      0.997 0.000 1.000
#> GSM97035     2   0.000      0.997 0.000 1.000
#> GSM97036     1   0.000      0.992 1.000 0.000
#> GSM97039     2   0.000      0.997 0.000 1.000
#> GSM97046     2   0.000      0.997 0.000 1.000
#> GSM97023     1   0.000      0.992 1.000 0.000
#> GSM97029     1   0.000      0.992 1.000 0.000
#> GSM97043     2   0.000      0.997 0.000 1.000
#> GSM97013     1   0.000      0.992 1.000 0.000
#> GSM96956     2   0.000      0.997 0.000 1.000
#> GSM97024     2   0.000      0.997 0.000 1.000
#> GSM97032     2   0.000      0.997 0.000 1.000
#> GSM97044     2   0.000      0.997 0.000 1.000
#> GSM97049     2   0.000      0.997 0.000 1.000
#> GSM96968     1   0.961      0.371 0.616 0.384
#> GSM96971     1   0.000      0.992 1.000 0.000
#> GSM96986     1   0.000      0.992 1.000 0.000
#> GSM97003     1   0.000      0.992 1.000 0.000
#> GSM96957     1   0.000      0.992 1.000 0.000
#> GSM96960     1   0.000      0.992 1.000 0.000
#> GSM96975     1   0.000      0.992 1.000 0.000
#> GSM96998     1   0.000      0.992 1.000 0.000
#> GSM96999     1   0.000      0.992 1.000 0.000
#> GSM97001     1   0.000      0.992 1.000 0.000
#> GSM97005     1   0.000      0.992 1.000 0.000
#> GSM97006     1   0.000      0.992 1.000 0.000
#> GSM97021     1   0.000      0.992 1.000 0.000
#> GSM97028     2   0.000      0.997 0.000 1.000
#> GSM97031     1   0.000      0.992 1.000 0.000
#> GSM97037     2   0.000      0.997 0.000 1.000
#> GSM97018     2   0.000      0.997 0.000 1.000
#> GSM97014     2   0.000      0.997 0.000 1.000
#> GSM97042     2   0.000      0.997 0.000 1.000
#> GSM97040     2   0.000      0.997 0.000 1.000
#> GSM97041     1   0.000      0.992 1.000 0.000
#> GSM96955     2   0.000      0.997 0.000 1.000
#> GSM96990     2   0.000      0.997 0.000 1.000
#> GSM96991     2   0.000      0.997 0.000 1.000
#> GSM97048     2   0.000      0.997 0.000 1.000
#> GSM96963     2   0.000      0.997 0.000 1.000
#> GSM96953     2   0.000      0.997 0.000 1.000
#> GSM96966     1   0.000      0.992 1.000 0.000
#> GSM96979     1   0.000      0.992 1.000 0.000
#> GSM96983     2   0.000      0.997 0.000 1.000
#> GSM96984     2   0.482      0.885 0.104 0.896
#> GSM96994     2   0.000      0.997 0.000 1.000
#> GSM96996     1   0.000      0.992 1.000 0.000
#> GSM96997     1   0.000      0.992 1.000 0.000
#> GSM97007     2   0.000      0.997 0.000 1.000
#> GSM96954     1   0.000      0.992 1.000 0.000
#> GSM96962     1   0.000      0.992 1.000 0.000
#> GSM96969     1   0.000      0.992 1.000 0.000
#> GSM96970     1   0.000      0.992 1.000 0.000
#> GSM96973     1   0.000      0.992 1.000 0.000
#> GSM96976     2   0.000      0.997 0.000 1.000
#> GSM96977     1   0.000      0.992 1.000 0.000
#> GSM96995     2   0.000      0.997 0.000 1.000
#> GSM97002     1   0.000      0.992 1.000 0.000
#> GSM97009     2   0.000      0.997 0.000 1.000
#> GSM97010     1   0.000      0.992 1.000 0.000
#> GSM96974     1   0.000      0.992 1.000 0.000
#> GSM96985     1   0.000      0.992 1.000 0.000
#> GSM96959     2   0.000      0.997 0.000 1.000
#> GSM96972     1   0.000      0.992 1.000 0.000
#> GSM96978     2   0.278      0.949 0.048 0.952
#> GSM96967     1   0.000      0.992 1.000 0.000
#> GSM96987     1   0.000      0.992 1.000 0.000
#> GSM97011     1   0.141      0.973 0.980 0.020
#> GSM96964     1   0.000      0.992 1.000 0.000
#> GSM96965     1   0.000      0.992 1.000 0.000
#> GSM96981     1   0.000      0.992 1.000 0.000
#> GSM96982     1   0.000      0.992 1.000 0.000
#> GSM96988     1   0.000      0.992 1.000 0.000
#> GSM97000     1   0.000      0.992 1.000 0.000
#> GSM97004     1   0.000      0.992 1.000 0.000
#> GSM97008     1   0.000      0.992 1.000 0.000
#> GSM96950     1   0.000      0.992 1.000 0.000
#> GSM96980     1   0.000      0.992 1.000 0.000
#> GSM96989     1   0.000      0.992 1.000 0.000
#> GSM96992     1   0.000      0.992 1.000 0.000
#> GSM96993     1   0.000      0.992 1.000 0.000
#> GSM96958     1   0.000      0.992 1.000 0.000
#> GSM96951     1   0.000      0.992 1.000 0.000
#> GSM96952     1   0.000      0.992 1.000 0.000
#> GSM96961     1   0.000      0.992 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
#> GSM97038     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97045     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97047     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97025     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97030     3  0.3551      0.873 0.000 0.132 0.868
#> GSM97027     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97033     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97034     3  0.3412      0.879 0.000 0.124 0.876
#> GSM97020     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97026     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97012     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97015     3  0.3412      0.879 0.000 0.124 0.876
#> GSM97016     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97017     1  0.0237      0.961 0.996 0.004 0.000
#> GSM97019     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97022     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97035     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97036     1  0.0237      0.961 0.996 0.004 0.000
#> GSM97039     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97046     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97023     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97029     1  0.0237      0.961 0.996 0.004 0.000
#> GSM97043     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97013     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96956     2  0.1529      0.953 0.000 0.960 0.040
#> GSM97024     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97032     3  0.4750      0.781 0.000 0.216 0.784
#> GSM97044     3  0.3412      0.879 0.000 0.124 0.876
#> GSM97049     2  0.0000      0.990 0.000 1.000 0.000
#> GSM96968     3  0.0237      0.932 0.004 0.000 0.996
#> GSM96971     3  0.0000      0.933 0.000 0.000 1.000
#> GSM96986     3  0.0000      0.933 0.000 0.000 1.000
#> GSM97003     1  0.0892      0.958 0.980 0.000 0.020
#> GSM96957     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96960     1  0.0892      0.958 0.980 0.000 0.020
#> GSM96975     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96998     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96999     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97001     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97005     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97006     1  0.0892      0.958 0.980 0.000 0.020
#> GSM97021     1  0.0424      0.960 0.992 0.000 0.008
#> GSM97028     3  0.0592      0.931 0.000 0.012 0.988
#> GSM97031     1  0.1163      0.951 0.972 0.000 0.028
#> GSM97037     2  0.2878      0.888 0.000 0.904 0.096
#> GSM97018     3  0.4121      0.840 0.000 0.168 0.832
#> GSM97014     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97042     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97040     2  0.2269      0.938 0.040 0.944 0.016
#> GSM97041     1  0.0237      0.961 0.996 0.004 0.000
#> GSM96955     2  0.0000      0.990 0.000 1.000 0.000
#> GSM96990     3  0.3752      0.863 0.000 0.144 0.856
#> GSM96991     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97048     2  0.0000      0.990 0.000 1.000 0.000
#> GSM96963     2  0.0000      0.990 0.000 1.000 0.000
#> GSM96953     2  0.0000      0.990 0.000 1.000 0.000
#> GSM96966     1  0.3412      0.891 0.876 0.000 0.124
#> GSM96979     3  0.0000      0.933 0.000 0.000 1.000
#> GSM96983     3  0.0237      0.933 0.000 0.004 0.996
#> GSM96984     3  0.0000      0.933 0.000 0.000 1.000
#> GSM96994     3  0.0000      0.933 0.000 0.000 1.000
#> GSM96996     1  0.0892      0.958 0.980 0.000 0.020
#> GSM96997     3  0.0000      0.933 0.000 0.000 1.000
#> GSM97007     3  0.0000      0.933 0.000 0.000 1.000
#> GSM96954     3  0.0000      0.933 0.000 0.000 1.000
#> GSM96962     3  0.0000      0.933 0.000 0.000 1.000
#> GSM96969     1  0.3412      0.891 0.876 0.000 0.124
#> GSM96970     1  0.3412      0.891 0.876 0.000 0.124
#> GSM96973     1  0.3412      0.891 0.876 0.000 0.124
#> GSM96976     3  0.5058      0.691 0.000 0.244 0.756
#> GSM96977     1  0.4555      0.752 0.800 0.000 0.200
#> GSM96995     3  0.2959      0.893 0.000 0.100 0.900
#> GSM97002     1  0.0892      0.958 0.980 0.000 0.020
#> GSM97009     2  0.0000      0.990 0.000 1.000 0.000
#> GSM97010     1  0.2959      0.909 0.900 0.000 0.100
#> GSM96974     3  0.1289      0.913 0.032 0.000 0.968
#> GSM96985     3  0.1860      0.897 0.052 0.000 0.948
#> GSM96959     2  0.2165      0.929 0.000 0.936 0.064
#> GSM96972     1  0.3412      0.891 0.876 0.000 0.124
#> GSM96978     3  0.0000      0.933 0.000 0.000 1.000
#> GSM96967     1  0.3412      0.891 0.876 0.000 0.124
#> GSM96987     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97011     1  0.3816      0.824 0.852 0.148 0.000
#> GSM96964     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96965     1  0.3340      0.894 0.880 0.000 0.120
#> GSM96981     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96982     1  0.0592      0.960 0.988 0.000 0.012
#> GSM96988     3  0.0000      0.933 0.000 0.000 1.000
#> GSM97000     1  0.3412      0.862 0.876 0.000 0.124
#> GSM97004     1  0.0892      0.958 0.980 0.000 0.020
#> GSM97008     1  0.1031      0.951 0.976 0.000 0.024
#> GSM96950     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96980     1  0.0892      0.958 0.980 0.000 0.020
#> GSM96989     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96992     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96993     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96958     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96951     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96952     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96961     1  0.0000      0.962 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
#> GSM97038     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97045     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97047     2  0.4817    0.50390 0.388 0.612 0.000 0.000
#> GSM97025     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97030     3  0.0188    0.97176 0.004 0.000 0.996 0.000
#> GSM97027     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97033     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97034     3  0.0376    0.97033 0.004 0.004 0.992 0.000
#> GSM97020     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97026     2  0.0921    0.92254 0.028 0.972 0.000 0.000
#> GSM97012     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97015     3  0.0188    0.97176 0.004 0.000 0.996 0.000
#> GSM97016     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97017     1  0.0188    0.68936 0.996 0.000 0.000 0.004
#> GSM97019     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97036     1  0.5000    0.02944 0.504 0.000 0.000 0.496
#> GSM97039     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97023     1  0.4907    0.28883 0.580 0.000 0.000 0.420
#> GSM97029     1  0.3726    0.57928 0.788 0.000 0.000 0.212
#> GSM97043     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97013     1  0.4746    0.37781 0.632 0.000 0.000 0.368
#> GSM96956     2  0.2921    0.81276 0.000 0.860 0.140 0.000
#> GSM97024     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97032     3  0.3257    0.82510 0.004 0.152 0.844 0.000
#> GSM97044     3  0.0188    0.97176 0.004 0.000 0.996 0.000
#> GSM97049     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM96968     3  0.0188    0.97176 0.004 0.000 0.996 0.000
#> GSM96971     3  0.2081    0.91142 0.000 0.000 0.916 0.084
#> GSM96986     3  0.0000    0.97226 0.000 0.000 1.000 0.000
#> GSM97003     4  0.2412    0.69319 0.084 0.000 0.008 0.908
#> GSM96957     1  0.0592    0.68959 0.984 0.000 0.000 0.016
#> GSM96960     4  0.2149    0.69218 0.088 0.000 0.000 0.912
#> GSM96975     1  0.4277    0.50530 0.720 0.000 0.000 0.280
#> GSM96998     4  0.4431    0.44127 0.304 0.000 0.000 0.696
#> GSM96999     1  0.4981    0.13744 0.536 0.000 0.000 0.464
#> GSM97001     1  0.0188    0.68936 0.996 0.000 0.000 0.004
#> GSM97005     1  0.0592    0.68956 0.984 0.000 0.000 0.016
#> GSM97006     4  0.2469    0.67914 0.108 0.000 0.000 0.892
#> GSM97021     1  0.0469    0.68989 0.988 0.000 0.000 0.012
#> GSM97028     3  0.0000    0.97226 0.000 0.000 1.000 0.000
#> GSM97031     1  0.4936    0.44050 0.652 0.000 0.008 0.340
#> GSM97037     2  0.4220    0.65561 0.004 0.748 0.248 0.000
#> GSM97018     3  0.2714    0.87437 0.004 0.112 0.884 0.000
#> GSM97014     2  0.5000    0.28772 0.496 0.504 0.000 0.000
#> GSM97042     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97040     1  0.0921    0.66997 0.972 0.028 0.000 0.000
#> GSM97041     1  0.0188    0.68936 0.996 0.000 0.000 0.004
#> GSM96955     2  0.1389    0.90752 0.048 0.952 0.000 0.000
#> GSM96990     3  0.1004    0.95641 0.004 0.024 0.972 0.000
#> GSM96991     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM97048     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000    0.94081 0.000 1.000 0.000 0.000
#> GSM96966     4  0.0000    0.70249 0.000 0.000 0.000 1.000
#> GSM96979     3  0.2216    0.89869 0.000 0.000 0.908 0.092
#> GSM96983     3  0.0000    0.97226 0.000 0.000 1.000 0.000
#> GSM96984     3  0.0000    0.97226 0.000 0.000 1.000 0.000
#> GSM96994     3  0.0000    0.97226 0.000 0.000 1.000 0.000
#> GSM96996     4  0.1867    0.69881 0.072 0.000 0.000 0.928
#> GSM96997     3  0.0188    0.97065 0.000 0.000 0.996 0.004
#> GSM97007     3  0.0000    0.97226 0.000 0.000 1.000 0.000
#> GSM96954     3  0.0188    0.97176 0.004 0.000 0.996 0.000
#> GSM96962     3  0.0000    0.97226 0.000 0.000 1.000 0.000
#> GSM96969     4  0.0000    0.70249 0.000 0.000 0.000 1.000
#> GSM96970     4  0.0000    0.70249 0.000 0.000 0.000 1.000
#> GSM96973     4  0.0000    0.70249 0.000 0.000 0.000 1.000
#> GSM96976     4  0.7211    0.24593 0.000 0.248 0.204 0.548
#> GSM96977     1  0.3037    0.64411 0.880 0.000 0.020 0.100
#> GSM96995     3  0.1474    0.93743 0.052 0.000 0.948 0.000
#> GSM97002     4  0.1940    0.69753 0.076 0.000 0.000 0.924
#> GSM97009     2  0.4072    0.70086 0.252 0.748 0.000 0.000
#> GSM97010     4  0.0469    0.69912 0.012 0.000 0.000 0.988
#> GSM96974     4  0.4679    0.26588 0.000 0.000 0.352 0.648
#> GSM96985     4  0.4072    0.45574 0.000 0.000 0.252 0.748
#> GSM96959     1  0.7771   -0.04566 0.424 0.256 0.320 0.000
#> GSM96972     4  0.0000    0.70249 0.000 0.000 0.000 1.000
#> GSM96978     3  0.0000    0.97226 0.000 0.000 1.000 0.000
#> GSM96967     4  0.0000    0.70249 0.000 0.000 0.000 1.000
#> GSM96987     4  0.4941    0.14751 0.436 0.000 0.000 0.564
#> GSM97011     1  0.0657    0.68803 0.984 0.004 0.000 0.012
#> GSM96964     4  0.5000   -0.07726 0.500 0.000 0.000 0.500
#> GSM96965     4  0.1211    0.68494 0.040 0.000 0.000 0.960
#> GSM96981     4  0.4331    0.47664 0.288 0.000 0.000 0.712
#> GSM96982     4  0.1867    0.69939 0.072 0.000 0.000 0.928
#> GSM96988     3  0.0188    0.97098 0.000 0.000 0.996 0.004
#> GSM97000     1  0.1388    0.67324 0.960 0.000 0.028 0.012
#> GSM97004     4  0.1557    0.70182 0.056 0.000 0.000 0.944
#> GSM97008     1  0.0657    0.68782 0.984 0.000 0.004 0.012
#> GSM96950     1  0.4907    0.26720 0.580 0.000 0.000 0.420
#> GSM96980     4  0.0000    0.70249 0.000 0.000 0.000 1.000
#> GSM96989     4  0.4941    0.14751 0.436 0.000 0.000 0.564
#> GSM96992     4  0.4916    0.16465 0.424 0.000 0.000 0.576
#> GSM96993     1  0.4877    0.29485 0.592 0.000 0.000 0.408
#> GSM96958     4  0.4999   -0.06756 0.492 0.000 0.000 0.508
#> GSM96951     1  0.4994    0.10456 0.520 0.000 0.000 0.480
#> GSM96952     4  0.4925    0.15303 0.428 0.000 0.000 0.572
#> GSM96961     4  0.4989    0.00392 0.472 0.000 0.000 0.528

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97038     2  0.0566     0.9477 0.000 0.984 0.000 0.012 0.004
#> GSM97045     2  0.0000     0.9507 0.000 1.000 0.000 0.000 0.000
#> GSM97047     5  0.4329     0.6743 0.000 0.224 0.028 0.008 0.740
#> GSM97025     2  0.0000     0.9507 0.000 1.000 0.000 0.000 0.000
#> GSM97030     3  0.1461     0.8625 0.000 0.028 0.952 0.004 0.016
#> GSM97027     2  0.0000     0.9507 0.000 1.000 0.000 0.000 0.000
#> GSM97033     2  0.0451     0.9494 0.000 0.988 0.000 0.008 0.004
#> GSM97034     3  0.1988     0.8529 0.000 0.048 0.928 0.008 0.016
#> GSM97020     2  0.0451     0.9494 0.000 0.988 0.000 0.008 0.004
#> GSM97026     2  0.4192     0.7986 0.040 0.828 0.052 0.012 0.068
#> GSM97012     2  0.0000     0.9507 0.000 1.000 0.000 0.000 0.000
#> GSM97015     3  0.1306     0.8648 0.000 0.016 0.960 0.008 0.016
#> GSM97016     2  0.0451     0.9494 0.000 0.988 0.000 0.008 0.004
#> GSM97017     5  0.3123     0.7530 0.184 0.000 0.000 0.004 0.812
#> GSM97019     2  0.0000     0.9507 0.000 1.000 0.000 0.000 0.000
#> GSM97022     2  0.0000     0.9507 0.000 1.000 0.000 0.000 0.000
#> GSM97035     2  0.0000     0.9507 0.000 1.000 0.000 0.000 0.000
#> GSM97036     1  0.2570     0.6984 0.888 0.000 0.000 0.028 0.084
#> GSM97039     2  0.0451     0.9494 0.000 0.988 0.000 0.008 0.004
#> GSM97046     2  0.0451     0.9494 0.000 0.988 0.000 0.008 0.004
#> GSM97023     1  0.3056     0.7258 0.864 0.000 0.000 0.068 0.068
#> GSM97029     1  0.3999     0.5665 0.740 0.000 0.000 0.020 0.240
#> GSM97043     2  0.0854     0.9360 0.000 0.976 0.012 0.004 0.008
#> GSM97013     1  0.2798     0.6659 0.852 0.000 0.000 0.008 0.140
#> GSM96956     2  0.4048     0.7079 0.000 0.764 0.208 0.012 0.016
#> GSM97024     2  0.0162     0.9492 0.000 0.996 0.000 0.000 0.004
#> GSM97032     3  0.3734     0.7198 0.000 0.184 0.792 0.008 0.016
#> GSM97044     3  0.0833     0.8695 0.000 0.004 0.976 0.004 0.016
#> GSM97049     2  0.0451     0.9494 0.000 0.988 0.000 0.008 0.004
#> GSM96968     3  0.1393     0.8664 0.008 0.000 0.956 0.012 0.024
#> GSM96971     3  0.4818     0.3849 0.000 0.000 0.520 0.460 0.020
#> GSM96986     3  0.3445     0.8530 0.000 0.000 0.824 0.140 0.036
#> GSM97003     1  0.5704     0.5039 0.592 0.000 0.016 0.328 0.064
#> GSM96957     1  0.4450    -0.0617 0.508 0.000 0.000 0.004 0.488
#> GSM96960     1  0.4594     0.5527 0.680 0.000 0.000 0.284 0.036
#> GSM96975     1  0.6500     0.2050 0.412 0.000 0.000 0.188 0.400
#> GSM96998     1  0.1410     0.7123 0.940 0.000 0.000 0.060 0.000
#> GSM96999     1  0.3495     0.6922 0.812 0.000 0.000 0.028 0.160
#> GSM97001     5  0.2732     0.7542 0.160 0.000 0.000 0.000 0.840
#> GSM97005     5  0.2144     0.7977 0.068 0.000 0.000 0.020 0.912
#> GSM97006     1  0.4644     0.5565 0.680 0.000 0.000 0.280 0.040
#> GSM97021     5  0.2361     0.7957 0.096 0.000 0.000 0.012 0.892
#> GSM97028     3  0.0798     0.8735 0.000 0.000 0.976 0.016 0.008
#> GSM97031     1  0.6947     0.4540 0.488 0.000 0.032 0.160 0.320
#> GSM97037     2  0.5061     0.3484 0.000 0.580 0.388 0.012 0.020
#> GSM97018     3  0.3731     0.7323 0.000 0.172 0.800 0.012 0.016
#> GSM97014     5  0.3421     0.7045 0.000 0.204 0.000 0.008 0.788
#> GSM97042     2  0.0000     0.9507 0.000 1.000 0.000 0.000 0.000
#> GSM97040     5  0.1605     0.8035 0.040 0.004 0.012 0.000 0.944
#> GSM97041     5  0.3333     0.7305 0.208 0.000 0.000 0.004 0.788
#> GSM96955     2  0.2771     0.8234 0.000 0.860 0.000 0.012 0.128
#> GSM96990     3  0.1949     0.8565 0.000 0.040 0.932 0.012 0.016
#> GSM96991     2  0.0000     0.9507 0.000 1.000 0.000 0.000 0.000
#> GSM97048     2  0.0451     0.9494 0.000 0.988 0.000 0.008 0.004
#> GSM96963     2  0.0162     0.9504 0.000 0.996 0.000 0.000 0.004
#> GSM96953     2  0.0162     0.9504 0.000 0.996 0.000 0.000 0.004
#> GSM96966     4  0.2648     0.8311 0.152 0.000 0.000 0.848 0.000
#> GSM96979     3  0.4350     0.7456 0.000 0.000 0.704 0.268 0.028
#> GSM96983     3  0.0955     0.8756 0.000 0.000 0.968 0.028 0.004
#> GSM96984     3  0.3099     0.8615 0.000 0.000 0.848 0.124 0.028
#> GSM96994     3  0.3051     0.8626 0.000 0.000 0.852 0.120 0.028
#> GSM96996     1  0.4152     0.5385 0.692 0.000 0.000 0.296 0.012
#> GSM96997     3  0.3799     0.8452 0.012 0.000 0.812 0.144 0.032
#> GSM97007     3  0.3051     0.8626 0.000 0.000 0.852 0.120 0.028
#> GSM96954     3  0.2209     0.8751 0.000 0.000 0.912 0.056 0.032
#> GSM96962     3  0.3146     0.8601 0.000 0.000 0.844 0.128 0.028
#> GSM96969     4  0.2690     0.8282 0.156 0.000 0.000 0.844 0.000
#> GSM96970     4  0.2648     0.8311 0.152 0.000 0.000 0.848 0.000
#> GSM96973     4  0.2648     0.8311 0.152 0.000 0.000 0.848 0.000
#> GSM96976     4  0.3315     0.6684 0.000 0.084 0.052 0.856 0.008
#> GSM96977     5  0.6569     0.4804 0.264 0.000 0.072 0.080 0.584
#> GSM96995     3  0.2522     0.8187 0.000 0.000 0.880 0.012 0.108
#> GSM97002     1  0.4135     0.4804 0.656 0.000 0.000 0.340 0.004
#> GSM97009     5  0.4528     0.2328 0.000 0.444 0.000 0.008 0.548
#> GSM97010     4  0.5052     0.5442 0.340 0.000 0.000 0.612 0.048
#> GSM96974     4  0.3161     0.6991 0.032 0.000 0.100 0.860 0.008
#> GSM96985     4  0.4471     0.7136 0.088 0.000 0.132 0.772 0.008
#> GSM96959     5  0.4403     0.6671 0.000 0.036 0.188 0.016 0.760
#> GSM96972     4  0.2648     0.8311 0.152 0.000 0.000 0.848 0.000
#> GSM96978     3  0.2818     0.8634 0.000 0.000 0.856 0.132 0.012
#> GSM96967     4  0.2648     0.8311 0.152 0.000 0.000 0.848 0.000
#> GSM96987     1  0.0771     0.7139 0.976 0.000 0.000 0.004 0.020
#> GSM97011     5  0.1408     0.8034 0.044 0.000 0.000 0.008 0.948
#> GSM96964     1  0.1043     0.7137 0.960 0.000 0.000 0.000 0.040
#> GSM96965     4  0.3760     0.7841 0.188 0.000 0.000 0.784 0.028
#> GSM96981     1  0.5552     0.4261 0.584 0.000 0.000 0.328 0.088
#> GSM96982     1  0.5019     0.2253 0.532 0.000 0.000 0.436 0.032
#> GSM96988     3  0.2193     0.8721 0.000 0.000 0.900 0.092 0.008
#> GSM97000     5  0.1701     0.7971 0.028 0.000 0.012 0.016 0.944
#> GSM97004     1  0.3999     0.4748 0.656 0.000 0.000 0.344 0.000
#> GSM97008     5  0.1740     0.8011 0.056 0.000 0.000 0.012 0.932
#> GSM96950     1  0.2358     0.6892 0.888 0.000 0.000 0.008 0.104
#> GSM96980     4  0.4074     0.4344 0.364 0.000 0.000 0.636 0.000
#> GSM96989     1  0.0771     0.7139 0.976 0.000 0.000 0.004 0.020
#> GSM96992     1  0.3875     0.6789 0.792 0.000 0.000 0.160 0.048
#> GSM96993     1  0.2645     0.6863 0.884 0.000 0.008 0.012 0.096
#> GSM96958     1  0.3192     0.7191 0.848 0.000 0.000 0.040 0.112
#> GSM96951     1  0.3806     0.7177 0.812 0.000 0.000 0.084 0.104
#> GSM96952     1  0.3365     0.7000 0.836 0.000 0.000 0.120 0.044
#> GSM96961     1  0.2782     0.7190 0.880 0.000 0.000 0.072 0.048

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.2076     0.9123 0.000 0.912 0.012 0.000 0.016 0.060
#> GSM97045     2  0.0363     0.9280 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM97047     5  0.3550     0.7375 0.000 0.132 0.032 0.000 0.812 0.024
#> GSM97025     2  0.0405     0.9286 0.000 0.988 0.004 0.000 0.000 0.008
#> GSM97030     3  0.1092     0.6396 0.000 0.020 0.960 0.000 0.000 0.020
#> GSM97027     2  0.0458     0.9281 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM97033     2  0.1672     0.9197 0.000 0.932 0.016 0.000 0.004 0.048
#> GSM97034     3  0.2588     0.6276 0.000 0.060 0.888 0.008 0.004 0.040
#> GSM97020     2  0.1923     0.9148 0.000 0.916 0.016 0.000 0.004 0.064
#> GSM97026     2  0.6184     0.5834 0.032 0.660 0.128 0.008 0.084 0.088
#> GSM97012     2  0.0260     0.9281 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM97015     3  0.0993     0.6330 0.000 0.012 0.964 0.000 0.000 0.024
#> GSM97016     2  0.1863     0.9156 0.000 0.920 0.016 0.000 0.004 0.060
#> GSM97017     5  0.4033     0.7210 0.156 0.000 0.000 0.004 0.760 0.080
#> GSM97019     2  0.0405     0.9271 0.000 0.988 0.008 0.000 0.000 0.004
#> GSM97022     2  0.0405     0.9271 0.000 0.988 0.008 0.000 0.000 0.004
#> GSM97035     2  0.0520     0.9283 0.000 0.984 0.008 0.000 0.000 0.008
#> GSM97036     1  0.4616     0.6068 0.736 0.008 0.000 0.036 0.044 0.176
#> GSM97039     2  0.1863     0.9156 0.000 0.920 0.016 0.000 0.004 0.060
#> GSM97046     2  0.1863     0.9156 0.000 0.920 0.016 0.000 0.004 0.060
#> GSM97023     1  0.3796     0.6825 0.812 0.000 0.000 0.092 0.048 0.048
#> GSM97029     1  0.5416     0.4730 0.636 0.004 0.000 0.012 0.160 0.188
#> GSM97043     2  0.1124     0.9133 0.000 0.956 0.036 0.000 0.000 0.008
#> GSM97013     1  0.4498     0.5698 0.720 0.000 0.000 0.012 0.080 0.188
#> GSM96956     2  0.4756     0.5304 0.000 0.628 0.304 0.000 0.004 0.064
#> GSM97024     2  0.0858     0.9207 0.000 0.968 0.028 0.000 0.000 0.004
#> GSM97032     3  0.3168     0.5425 0.000 0.172 0.804 0.000 0.000 0.024
#> GSM97044     3  0.1411     0.6042 0.000 0.004 0.936 0.000 0.000 0.060
#> GSM97049     2  0.1923     0.9148 0.000 0.916 0.016 0.000 0.004 0.064
#> GSM96968     3  0.3158     0.5319 0.000 0.000 0.812 0.004 0.020 0.164
#> GSM96971     6  0.5894     0.4475 0.000 0.000 0.244 0.284 0.000 0.472
#> GSM96986     6  0.4045     0.8457 0.000 0.000 0.428 0.000 0.008 0.564
#> GSM97003     1  0.6096     0.4103 0.488 0.000 0.004 0.196 0.008 0.304
#> GSM96957     1  0.5962     0.2102 0.524 0.000 0.004 0.012 0.300 0.160
#> GSM96960     1  0.4758     0.5879 0.660 0.000 0.000 0.260 0.008 0.072
#> GSM96975     1  0.7478     0.2872 0.352 0.000 0.000 0.220 0.280 0.148
#> GSM96998     1  0.3526     0.6777 0.820 0.000 0.000 0.088 0.012 0.080
#> GSM96999     1  0.4640     0.6398 0.744 0.000 0.000 0.044 0.092 0.120
#> GSM97001     5  0.4002     0.7331 0.136 0.000 0.000 0.012 0.776 0.076
#> GSM97005     5  0.1777     0.8038 0.044 0.000 0.000 0.004 0.928 0.024
#> GSM97006     1  0.4815     0.6045 0.668 0.000 0.000 0.236 0.008 0.088
#> GSM97021     5  0.2706     0.7926 0.060 0.000 0.000 0.008 0.876 0.056
#> GSM97028     3  0.2631     0.5415 0.000 0.000 0.856 0.012 0.004 0.128
#> GSM97031     1  0.7731     0.3124 0.352 0.000 0.016 0.124 0.224 0.284
#> GSM97037     3  0.4766     0.3307 0.000 0.320 0.616 0.000 0.004 0.060
#> GSM97018     3  0.3412     0.5802 0.000 0.136 0.820 0.008 0.008 0.028
#> GSM97014     5  0.2818     0.7832 0.008 0.084 0.008 0.000 0.872 0.028
#> GSM97042     2  0.0405     0.9271 0.000 0.988 0.008 0.000 0.000 0.004
#> GSM97040     5  0.1180     0.8096 0.012 0.000 0.016 0.000 0.960 0.012
#> GSM97041     5  0.4664     0.6663 0.184 0.000 0.000 0.004 0.696 0.116
#> GSM96955     2  0.4205     0.7535 0.000 0.760 0.016 0.000 0.148 0.076
#> GSM96990     3  0.1864     0.6379 0.000 0.040 0.924 0.000 0.004 0.032
#> GSM96991     2  0.0405     0.9280 0.000 0.988 0.008 0.000 0.000 0.004
#> GSM97048     2  0.1923     0.9148 0.000 0.916 0.016 0.000 0.004 0.064
#> GSM96963     2  0.0146     0.9284 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM96953     2  0.0622     0.9289 0.000 0.980 0.008 0.000 0.000 0.012
#> GSM96966     4  0.0790     0.8168 0.032 0.000 0.000 0.968 0.000 0.000
#> GSM96979     6  0.4829     0.7720 0.000 0.000 0.356 0.056 0.004 0.584
#> GSM96983     3  0.3213     0.3964 0.000 0.000 0.784 0.008 0.004 0.204
#> GSM96984     6  0.3828     0.8487 0.000 0.000 0.440 0.000 0.000 0.560
#> GSM96994     6  0.3843     0.8301 0.000 0.000 0.452 0.000 0.000 0.548
#> GSM96996     1  0.5076     0.5676 0.616 0.000 0.000 0.288 0.008 0.088
#> GSM96997     6  0.3890     0.8260 0.004 0.000 0.400 0.000 0.000 0.596
#> GSM97007     6  0.3838     0.8416 0.000 0.000 0.448 0.000 0.000 0.552
#> GSM96954     3  0.4206    -0.2906 0.000 0.000 0.620 0.000 0.024 0.356
#> GSM96962     6  0.3828     0.8487 0.000 0.000 0.440 0.000 0.000 0.560
#> GSM96969     4  0.0937     0.8128 0.040 0.000 0.000 0.960 0.000 0.000
#> GSM96970     4  0.0790     0.8168 0.032 0.000 0.000 0.968 0.000 0.000
#> GSM96973     4  0.0790     0.8168 0.032 0.000 0.000 0.968 0.000 0.000
#> GSM96976     4  0.3416     0.7028 0.000 0.032 0.008 0.816 0.004 0.140
#> GSM96977     5  0.7794     0.3613 0.208 0.000 0.116 0.056 0.452 0.168
#> GSM96995     3  0.3563     0.5364 0.000 0.000 0.796 0.000 0.132 0.072
#> GSM97002     1  0.4997     0.5686 0.628 0.000 0.000 0.280 0.008 0.084
#> GSM97009     5  0.5375     0.4186 0.000 0.316 0.004 0.004 0.572 0.104
#> GSM97010     4  0.6650     0.2449 0.300 0.000 0.008 0.472 0.040 0.180
#> GSM96974     4  0.2983     0.7062 0.000 0.000 0.032 0.832 0.000 0.136
#> GSM96985     4  0.5323     0.5827 0.040 0.000 0.092 0.656 0.000 0.212
#> GSM96959     5  0.4436     0.6584 0.000 0.012 0.180 0.000 0.728 0.080
#> GSM96972     4  0.0937     0.8128 0.040 0.000 0.000 0.960 0.000 0.000
#> GSM96978     3  0.4278    -0.1777 0.000 0.000 0.632 0.032 0.000 0.336
#> GSM96967     4  0.0790     0.8168 0.032 0.000 0.000 0.968 0.000 0.000
#> GSM96987     1  0.3028     0.6646 0.848 0.000 0.000 0.040 0.008 0.104
#> GSM97011     5  0.1515     0.8071 0.020 0.000 0.000 0.008 0.944 0.028
#> GSM96964     1  0.2890     0.6610 0.856 0.000 0.000 0.020 0.016 0.108
#> GSM96965     4  0.2095     0.7698 0.076 0.000 0.000 0.904 0.016 0.004
#> GSM96981     1  0.6136     0.4731 0.524 0.000 0.000 0.316 0.056 0.104
#> GSM96982     1  0.4940     0.3963 0.532 0.000 0.000 0.400 0.000 0.068
#> GSM96988     3  0.4237     0.0364 0.000 0.000 0.660 0.028 0.004 0.308
#> GSM97000     5  0.1526     0.8053 0.008 0.000 0.004 0.008 0.944 0.036
#> GSM97004     1  0.4653     0.5680 0.644 0.000 0.000 0.292 0.004 0.060
#> GSM97008     5  0.1518     0.8071 0.024 0.000 0.000 0.008 0.944 0.024
#> GSM96950     1  0.4267     0.5900 0.740 0.000 0.000 0.016 0.056 0.188
#> GSM96980     4  0.4285     0.2470 0.320 0.000 0.000 0.644 0.000 0.036
#> GSM96989     1  0.2986     0.6623 0.852 0.000 0.000 0.032 0.012 0.104
#> GSM96992     1  0.4176     0.6413 0.740 0.000 0.000 0.200 0.016 0.044
#> GSM96993     1  0.4114     0.6029 0.756 0.000 0.008 0.012 0.036 0.188
#> GSM96958     1  0.4946     0.6634 0.724 0.000 0.000 0.120 0.076 0.080
#> GSM96951     1  0.4922     0.6682 0.724 0.000 0.000 0.128 0.080 0.068
#> GSM96952     1  0.3667     0.6610 0.788 0.000 0.000 0.164 0.012 0.036
#> GSM96961     1  0.3101     0.6746 0.832 0.000 0.000 0.136 0.012 0.020

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-skmeans-collect-classes

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

test_to_known_factors(res)
#>              n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:skmeans  99         1.18e-04       0.225     6.66e-13   0.1066 2
#> SD:skmeans 100         1.14e-04       0.290     6.36e-17   0.0685 3
#> SD:skmeans  78         2.01e-04       0.167     3.84e-13   0.0312 4
#> SD:skmeans  88         6.48e-05       0.228     3.50e-16   0.0350 5
#> SD:skmeans  83         4.09e-05       0.337     3.40e-18   0.0216 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 21168 rows and 100 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.894           0.935       0.970         0.4604 0.547   0.547
#> 3 3 0.435           0.435       0.738         0.3650 0.872   0.775
#> 4 4 0.527           0.562       0.766         0.1608 0.687   0.390
#> 5 5 0.692           0.657       0.820         0.0783 0.862   0.541
#> 6 6 0.701           0.495       0.684         0.0500 0.909   0.613

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
#> GSM97038     2  0.0000      0.973 0.000 1.000
#> GSM97045     2  0.0000      0.973 0.000 1.000
#> GSM97047     2  0.0938      0.964 0.012 0.988
#> GSM97025     2  0.0000      0.973 0.000 1.000
#> GSM97030     2  0.0000      0.973 0.000 1.000
#> GSM97027     2  0.0000      0.973 0.000 1.000
#> GSM97033     2  0.0000      0.973 0.000 1.000
#> GSM97034     2  0.3274      0.923 0.060 0.940
#> GSM97020     2  0.0000      0.973 0.000 1.000
#> GSM97026     2  0.0000      0.973 0.000 1.000
#> GSM97012     2  0.0000      0.973 0.000 1.000
#> GSM97015     2  0.6438      0.803 0.164 0.836
#> GSM97016     2  0.0000      0.973 0.000 1.000
#> GSM97017     1  0.0376      0.965 0.996 0.004
#> GSM97019     2  0.0000      0.973 0.000 1.000
#> GSM97022     2  0.0000      0.973 0.000 1.000
#> GSM97035     2  0.0000      0.973 0.000 1.000
#> GSM97036     2  0.7139      0.764 0.196 0.804
#> GSM97039     2  0.0000      0.973 0.000 1.000
#> GSM97046     2  0.0000      0.973 0.000 1.000
#> GSM97023     1  0.0000      0.967 1.000 0.000
#> GSM97029     1  0.6712      0.794 0.824 0.176
#> GSM97043     2  0.0000      0.973 0.000 1.000
#> GSM97013     1  0.7056      0.770 0.808 0.192
#> GSM96956     2  0.0000      0.973 0.000 1.000
#> GSM97024     2  0.0000      0.973 0.000 1.000
#> GSM97032     2  0.0000      0.973 0.000 1.000
#> GSM97044     2  0.1184      0.961 0.016 0.984
#> GSM97049     2  0.0000      0.973 0.000 1.000
#> GSM96968     1  0.0000      0.967 1.000 0.000
#> GSM96971     1  0.0000      0.967 1.000 0.000
#> GSM96986     1  0.0376      0.965 0.996 0.004
#> GSM97003     1  0.0000      0.967 1.000 0.000
#> GSM96957     1  0.0000      0.967 1.000 0.000
#> GSM96960     1  0.0000      0.967 1.000 0.000
#> GSM96975     1  0.0000      0.967 1.000 0.000
#> GSM96998     1  0.0000      0.967 1.000 0.000
#> GSM96999     1  0.0000      0.967 1.000 0.000
#> GSM97001     1  0.0000      0.967 1.000 0.000
#> GSM97005     1  0.0000      0.967 1.000 0.000
#> GSM97006     1  0.0000      0.967 1.000 0.000
#> GSM97021     1  0.0376      0.965 0.996 0.004
#> GSM97028     1  0.1843      0.948 0.972 0.028
#> GSM97031     1  0.0000      0.967 1.000 0.000
#> GSM97037     2  0.0000      0.973 0.000 1.000
#> GSM97018     2  0.3274      0.923 0.060 0.940
#> GSM97014     1  0.9815      0.332 0.580 0.420
#> GSM97042     2  0.0000      0.973 0.000 1.000
#> GSM97040     1  0.0938      0.960 0.988 0.012
#> GSM97041     1  0.4298      0.895 0.912 0.088
#> GSM96955     1  0.9000      0.572 0.684 0.316
#> GSM96990     2  0.0000      0.973 0.000 1.000
#> GSM96991     2  0.0000      0.973 0.000 1.000
#> GSM97048     2  0.0000      0.973 0.000 1.000
#> GSM96963     2  0.0000      0.973 0.000 1.000
#> GSM96953     2  0.0000      0.973 0.000 1.000
#> GSM96966     1  0.0000      0.967 1.000 0.000
#> GSM96979     1  0.0000      0.967 1.000 0.000
#> GSM96983     1  0.5519      0.855 0.872 0.128
#> GSM96984     1  0.1633      0.952 0.976 0.024
#> GSM96994     1  0.6712      0.796 0.824 0.176
#> GSM96996     1  0.0000      0.967 1.000 0.000
#> GSM96997     1  0.0000      0.967 1.000 0.000
#> GSM97007     2  0.9460      0.445 0.364 0.636
#> GSM96954     1  0.0000      0.967 1.000 0.000
#> GSM96962     1  0.0000      0.967 1.000 0.000
#> GSM96969     1  0.0000      0.967 1.000 0.000
#> GSM96970     1  0.0000      0.967 1.000 0.000
#> GSM96973     1  0.0000      0.967 1.000 0.000
#> GSM96976     1  0.4562      0.890 0.904 0.096
#> GSM96977     1  0.0000      0.967 1.000 0.000
#> GSM96995     1  0.3584      0.913 0.932 0.068
#> GSM97002     1  0.0000      0.967 1.000 0.000
#> GSM97009     1  0.8861      0.600 0.696 0.304
#> GSM97010     1  0.0672      0.962 0.992 0.008
#> GSM96974     1  0.0000      0.967 1.000 0.000
#> GSM96985     1  0.0000      0.967 1.000 0.000
#> GSM96959     1  0.1843      0.948 0.972 0.028
#> GSM96972     1  0.0000      0.967 1.000 0.000
#> GSM96978     1  0.0000      0.967 1.000 0.000
#> GSM96967     1  0.0000      0.967 1.000 0.000
#> GSM96987     1  0.0000      0.967 1.000 0.000
#> GSM97011     1  0.0376      0.965 0.996 0.004
#> GSM96964     1  0.0000      0.967 1.000 0.000
#> GSM96965     1  0.0938      0.960 0.988 0.012
#> GSM96981     1  0.0000      0.967 1.000 0.000
#> GSM96982     1  0.0000      0.967 1.000 0.000
#> GSM96988     1  0.0000      0.967 1.000 0.000
#> GSM97000     1  0.0000      0.967 1.000 0.000
#> GSM97004     1  0.0000      0.967 1.000 0.000
#> GSM97008     1  0.0000      0.967 1.000 0.000
#> GSM96950     1  0.0000      0.967 1.000 0.000
#> GSM96980     1  0.0000      0.967 1.000 0.000
#> GSM96989     1  0.0000      0.967 1.000 0.000
#> GSM96992     1  0.0000      0.967 1.000 0.000
#> GSM96993     1  0.0938      0.960 0.988 0.012
#> GSM96958     1  0.0000      0.967 1.000 0.000
#> GSM96951     1  0.0000      0.967 1.000 0.000
#> GSM96952     1  0.0000      0.967 1.000 0.000
#> GSM96961     1  0.0000      0.967 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97038     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97045     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97047     2  0.1482      0.622 0.020 0.968 0.012
#> GSM97025     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97030     2  0.0661      0.633 0.004 0.988 0.008
#> GSM97027     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97033     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97034     2  0.0661      0.633 0.004 0.988 0.008
#> GSM97020     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97026     2  0.4178      0.717 0.000 0.828 0.172
#> GSM97012     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97015     2  0.6548     -0.154 0.372 0.616 0.012
#> GSM97016     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97017     1  0.4645      0.433 0.816 0.008 0.176
#> GSM97019     2  0.5785      0.760 0.000 0.668 0.332
#> GSM97022     2  0.5760      0.760 0.000 0.672 0.328
#> GSM97035     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97036     2  0.5229      0.602 0.104 0.828 0.068
#> GSM97039     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97046     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97023     1  0.4887      0.459 0.772 0.000 0.228
#> GSM97029     1  0.9119     -0.121 0.484 0.368 0.148
#> GSM97043     2  0.2537      0.683 0.000 0.920 0.080
#> GSM97013     3  0.6505     -0.260 0.468 0.004 0.528
#> GSM96956     2  0.1643      0.666 0.000 0.956 0.044
#> GSM97024     2  0.2537      0.683 0.000 0.920 0.080
#> GSM97032     2  0.0000      0.641 0.000 1.000 0.000
#> GSM97044     2  0.1267      0.620 0.004 0.972 0.024
#> GSM97049     2  0.5810      0.761 0.000 0.664 0.336
#> GSM96968     1  0.5098      0.465 0.752 0.248 0.000
#> GSM96971     1  0.9559     -0.106 0.472 0.220 0.308
#> GSM96986     1  0.5486      0.487 0.780 0.196 0.024
#> GSM97003     1  0.1620      0.533 0.964 0.012 0.024
#> GSM96957     1  0.3276      0.535 0.908 0.068 0.024
#> GSM96960     1  0.4887      0.459 0.772 0.000 0.228
#> GSM96975     1  0.2261      0.537 0.932 0.068 0.000
#> GSM96998     1  0.4887      0.459 0.772 0.000 0.228
#> GSM96999     1  0.0848      0.529 0.984 0.008 0.008
#> GSM97001     1  0.4628      0.508 0.856 0.056 0.088
#> GSM97005     1  0.4808      0.490 0.804 0.008 0.188
#> GSM97006     1  0.5058      0.451 0.756 0.000 0.244
#> GSM97021     1  0.1950      0.536 0.952 0.040 0.008
#> GSM97028     1  0.6252      0.223 0.556 0.444 0.000
#> GSM97031     1  0.5098      0.454 0.752 0.000 0.248
#> GSM97037     2  0.0424      0.646 0.000 0.992 0.008
#> GSM97018     2  0.0661      0.633 0.004 0.988 0.008
#> GSM97014     2  0.9734      0.458 0.236 0.432 0.332
#> GSM97042     2  0.5810      0.761 0.000 0.664 0.336
#> GSM97040     1  0.5988      0.418 0.688 0.304 0.008
#> GSM97041     1  0.6427      0.296 0.640 0.012 0.348
#> GSM96955     2  0.9633      0.275 0.300 0.464 0.236
#> GSM96990     2  0.0983      0.627 0.004 0.980 0.016
#> GSM96991     2  0.5785      0.760 0.000 0.668 0.332
#> GSM97048     2  0.5810      0.761 0.000 0.664 0.336
#> GSM96963     2  0.5810      0.761 0.000 0.664 0.336
#> GSM96953     2  0.5810      0.761 0.000 0.664 0.336
#> GSM96966     1  0.6192     -0.268 0.580 0.000 0.420
#> GSM96979     1  0.7091      0.446 0.676 0.268 0.056
#> GSM96983     2  0.7130     -0.241 0.432 0.544 0.024
#> GSM96984     1  0.6702      0.380 0.648 0.328 0.024
#> GSM96994     1  0.6750      0.375 0.640 0.336 0.024
#> GSM96996     1  0.0237      0.526 0.996 0.000 0.004
#> GSM96997     1  0.6059      0.490 0.764 0.048 0.188
#> GSM97007     2  0.8579     -0.446 0.440 0.464 0.096
#> GSM96954     1  0.9438      0.381 0.504 0.252 0.244
#> GSM96962     1  0.9125      0.357 0.516 0.320 0.164
#> GSM96969     1  0.6235     -0.273 0.564 0.000 0.436
#> GSM96970     1  0.6168     -0.267 0.588 0.000 0.412
#> GSM96973     1  0.6192     -0.268 0.580 0.000 0.420
#> GSM96976     3  0.9806      0.308 0.276 0.292 0.432
#> GSM96977     1  0.4974      0.472 0.764 0.236 0.000
#> GSM96995     1  0.6047      0.410 0.680 0.312 0.008
#> GSM97002     1  0.2537      0.513 0.920 0.000 0.080
#> GSM97009     1  0.6726      0.198 0.644 0.024 0.332
#> GSM97010     1  0.6295      0.431 0.764 0.072 0.164
#> GSM96974     3  0.9744      0.301 0.236 0.336 0.428
#> GSM96985     1  0.9265     -0.357 0.428 0.156 0.416
#> GSM96959     1  0.5659      0.461 0.740 0.248 0.012
#> GSM96972     3  0.5948      0.287 0.360 0.000 0.640
#> GSM96978     1  0.6625      0.396 0.660 0.316 0.024
#> GSM96967     1  0.6225     -0.275 0.568 0.000 0.432
#> GSM96987     1  0.4887      0.459 0.772 0.000 0.228
#> GSM97011     1  0.5492      0.490 0.816 0.080 0.104
#> GSM96964     1  0.4887      0.459 0.772 0.000 0.228
#> GSM96965     3  0.6282      0.317 0.324 0.012 0.664
#> GSM96981     1  0.0592      0.527 0.988 0.000 0.012
#> GSM96982     1  0.2261      0.517 0.932 0.000 0.068
#> GSM96988     1  0.6726      0.384 0.644 0.332 0.024
#> GSM97000     1  0.3207      0.535 0.904 0.084 0.012
#> GSM97004     3  0.5948      0.287 0.360 0.000 0.640
#> GSM97008     1  0.2866      0.536 0.916 0.076 0.008
#> GSM96950     1  0.5816      0.502 0.788 0.056 0.156
#> GSM96980     1  0.6305     -0.310 0.516 0.000 0.484
#> GSM96989     1  0.4887      0.459 0.772 0.000 0.228
#> GSM96992     1  0.4887      0.459 0.772 0.000 0.228
#> GSM96993     1  0.8674      0.401 0.568 0.296 0.136
#> GSM96958     1  0.0424      0.526 0.992 0.000 0.008
#> GSM96951     1  0.4887      0.464 0.772 0.000 0.228
#> GSM96952     1  0.4887      0.459 0.772 0.000 0.228
#> GSM96961     1  0.4887      0.459 0.772 0.000 0.228

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.0188     0.8003 0.000 0.996 0.004 0.000
#> GSM97045     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM97047     2  0.7417     0.0166 0.016 0.464 0.412 0.108
#> GSM97025     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM97030     3  0.6060     0.0206 0.000 0.440 0.516 0.044
#> GSM97027     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM97033     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM97034     2  0.6265     0.1277 0.000 0.500 0.444 0.056
#> GSM97020     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM97026     2  0.3958     0.6695 0.000 0.816 0.160 0.024
#> GSM97012     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM97015     3  0.7612     0.4005 0.096 0.268 0.580 0.056
#> GSM97016     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM97017     4  0.7233     0.5782 0.232 0.128 0.028 0.612
#> GSM97019     2  0.0188     0.8006 0.000 0.996 0.004 0.000
#> GSM97022     2  0.0817     0.7902 0.000 0.976 0.024 0.000
#> GSM97035     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM97036     2  0.7471     0.4290 0.040 0.604 0.224 0.132
#> GSM97039     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM97023     1  0.0000     0.7676 1.000 0.000 0.000 0.000
#> GSM97029     4  0.7317     0.5071 0.156 0.244 0.016 0.584
#> GSM97043     2  0.4406     0.5263 0.000 0.700 0.300 0.000
#> GSM97013     1  0.4989     0.1810 0.528 0.472 0.000 0.000
#> GSM96956     2  0.4992     0.1350 0.000 0.524 0.476 0.000
#> GSM97024     2  0.5062     0.5063 0.000 0.680 0.300 0.020
#> GSM97032     2  0.6276     0.0572 0.000 0.480 0.464 0.056
#> GSM97044     3  0.3308     0.6906 0.000 0.092 0.872 0.036
#> GSM97049     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM96968     4  0.6856     0.6076 0.140 0.000 0.284 0.576
#> GSM96971     3  0.4250     0.4905 0.000 0.000 0.724 0.276
#> GSM96986     3  0.4988     0.3496 0.020 0.000 0.692 0.288
#> GSM97003     4  0.7254     0.6107 0.300 0.000 0.176 0.524
#> GSM96957     4  0.6038     0.4952 0.424 0.000 0.044 0.532
#> GSM96960     1  0.0469     0.7615 0.988 0.000 0.000 0.012
#> GSM96975     4  0.6678     0.6551 0.172 0.000 0.208 0.620
#> GSM96998     1  0.0000     0.7676 1.000 0.000 0.000 0.000
#> GSM96999     4  0.5277     0.4382 0.460 0.000 0.008 0.532
#> GSM97001     4  0.6501     0.6306 0.256 0.004 0.108 0.632
#> GSM97005     1  0.5169     0.4154 0.696 0.000 0.032 0.272
#> GSM97006     1  0.0707     0.7561 0.980 0.000 0.020 0.000
#> GSM97021     4  0.6566     0.6447 0.236 0.000 0.140 0.624
#> GSM97028     3  0.5255     0.4596 0.028 0.004 0.696 0.272
#> GSM97031     1  0.2644     0.7180 0.908 0.000 0.060 0.032
#> GSM97037     2  0.4998     0.1059 0.000 0.512 0.488 0.000
#> GSM97018     3  0.6252     0.0345 0.000 0.432 0.512 0.056
#> GSM97014     2  0.6047     0.2437 0.020 0.624 0.028 0.328
#> GSM97042     2  0.0336     0.7989 0.000 0.992 0.008 0.000
#> GSM97040     4  0.6523     0.6361 0.136 0.000 0.236 0.628
#> GSM97041     1  0.7854     0.0890 0.452 0.284 0.004 0.260
#> GSM96955     4  0.7805     0.5163 0.048 0.172 0.196 0.584
#> GSM96990     3  0.3266     0.7064 0.000 0.084 0.876 0.040
#> GSM96991     2  0.0469     0.7967 0.000 0.988 0.012 0.000
#> GSM97048     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000     0.8017 0.000 1.000 0.000 0.000
#> GSM96966     4  0.2647     0.5313 0.120 0.000 0.000 0.880
#> GSM96979     3  0.2011     0.7124 0.000 0.000 0.920 0.080
#> GSM96983     3  0.1042     0.7299 0.000 0.020 0.972 0.008
#> GSM96984     3  0.0657     0.7307 0.012 0.000 0.984 0.004
#> GSM96994     3  0.0000     0.7299 0.000 0.000 1.000 0.000
#> GSM96996     4  0.5906     0.4540 0.436 0.000 0.036 0.528
#> GSM96997     3  0.5309     0.4694 0.256 0.000 0.700 0.044
#> GSM97007     3  0.0188     0.7303 0.000 0.000 0.996 0.004
#> GSM96954     3  0.3176     0.7058 0.036 0.000 0.880 0.084
#> GSM96962     3  0.0937     0.7300 0.012 0.000 0.976 0.012
#> GSM96969     4  0.3610     0.4269 0.200 0.000 0.000 0.800
#> GSM96970     4  0.2197     0.5543 0.080 0.000 0.004 0.916
#> GSM96973     4  0.2319     0.5582 0.036 0.000 0.040 0.924
#> GSM96976     4  0.1545     0.5638 0.000 0.008 0.040 0.952
#> GSM96977     4  0.6635     0.6461 0.152 0.000 0.228 0.620
#> GSM96995     4  0.6442     0.6309 0.124 0.000 0.244 0.632
#> GSM97002     1  0.4605     0.1144 0.664 0.000 0.000 0.336
#> GSM97009     2  0.8749    -0.2129 0.136 0.468 0.096 0.300
#> GSM97010     4  0.8804     0.6104 0.156 0.108 0.240 0.496
#> GSM96974     3  0.5409     0.2927 0.012 0.000 0.496 0.492
#> GSM96985     4  0.3505     0.5665 0.048 0.000 0.088 0.864
#> GSM96959     4  0.6494     0.6388 0.136 0.000 0.232 0.632
#> GSM96972     1  0.5659     0.3889 0.600 0.000 0.032 0.368
#> GSM96978     3  0.4737     0.4790 0.020 0.000 0.728 0.252
#> GSM96967     4  0.4149     0.4597 0.168 0.000 0.028 0.804
#> GSM96987     1  0.0000     0.7676 1.000 0.000 0.000 0.000
#> GSM97011     4  0.6522     0.6447 0.144 0.000 0.224 0.632
#> GSM96964     1  0.0000     0.7676 1.000 0.000 0.000 0.000
#> GSM96965     4  0.2469     0.5316 0.000 0.108 0.000 0.892
#> GSM96981     4  0.4989     0.4165 0.472 0.000 0.000 0.528
#> GSM96982     1  0.4624     0.1014 0.660 0.000 0.000 0.340
#> GSM96988     3  0.3176     0.6943 0.084 0.000 0.880 0.036
#> GSM97000     4  0.6534     0.6316 0.132 0.000 0.244 0.624
#> GSM97004     1  0.2868     0.6497 0.864 0.000 0.000 0.136
#> GSM97008     4  0.6534     0.6475 0.148 0.000 0.220 0.632
#> GSM96950     1  0.3219     0.6036 0.836 0.000 0.000 0.164
#> GSM96980     4  0.4624     0.1990 0.340 0.000 0.000 0.660
#> GSM96989     1  0.0000     0.7676 1.000 0.000 0.000 0.000
#> GSM96992     1  0.0000     0.7676 1.000 0.000 0.000 0.000
#> GSM96993     1  0.6858     0.1048 0.532 0.004 0.368 0.096
#> GSM96958     4  0.4992     0.4086 0.476 0.000 0.000 0.524
#> GSM96951     1  0.1022     0.7548 0.968 0.000 0.000 0.032
#> GSM96952     1  0.0188     0.7660 0.996 0.000 0.000 0.004
#> GSM96961     1  0.0000     0.7676 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
#> GSM97038     2  0.0000      0.796 0.000 1.000 0.000 0.000 0.000
#> GSM97045     2  0.0000      0.796 0.000 1.000 0.000 0.000 0.000
#> GSM97047     5  0.4763      0.376 0.000 0.212 0.076 0.000 0.712
#> GSM97025     2  0.0000      0.796 0.000 1.000 0.000 0.000 0.000
#> GSM97030     2  0.5750      0.378 0.000 0.492 0.436 0.008 0.064
#> GSM97027     2  0.0000      0.796 0.000 1.000 0.000 0.000 0.000
#> GSM97033     2  0.0000      0.796 0.000 1.000 0.000 0.000 0.000
#> GSM97034     2  0.6221      0.397 0.000 0.492 0.400 0.016 0.092
#> GSM97020     2  0.0000      0.796 0.000 1.000 0.000 0.000 0.000
#> GSM97026     2  0.3412      0.734 0.000 0.820 0.152 0.000 0.028
#> GSM97012     2  0.2723      0.785 0.000 0.864 0.012 0.124 0.000
#> GSM97015     3  0.5959     -0.276 0.000 0.420 0.472 0.000 0.108
#> GSM97016     2  0.0000      0.796 0.000 1.000 0.000 0.000 0.000
#> GSM97017     5  0.2464      0.691 0.016 0.096 0.000 0.000 0.888
#> GSM97019     2  0.2723      0.785 0.000 0.864 0.012 0.124 0.000
#> GSM97022     2  0.3413      0.777 0.000 0.832 0.044 0.124 0.000
#> GSM97035     2  0.2723      0.785 0.000 0.864 0.012 0.124 0.000
#> GSM97036     2  0.6162      0.551 0.020 0.604 0.248 0.000 0.128
#> GSM97039     2  0.0000      0.796 0.000 1.000 0.000 0.000 0.000
#> GSM97046     2  0.0000      0.796 0.000 1.000 0.000 0.000 0.000
#> GSM97023     1  0.0000      0.827 1.000 0.000 0.000 0.000 0.000
#> GSM97029     5  0.7454      0.130 0.164 0.376 0.060 0.000 0.400
#> GSM97043     2  0.4403      0.531 0.000 0.608 0.384 0.008 0.000
#> GSM97013     1  0.4297      0.220 0.528 0.472 0.000 0.000 0.000
#> GSM96956     2  0.4482      0.524 0.000 0.612 0.376 0.000 0.012
#> GSM97024     2  0.6287      0.537 0.000 0.536 0.328 0.124 0.012
#> GSM97032     2  0.5944      0.377 0.000 0.488 0.404 0.000 0.108
#> GSM97044     3  0.1357      0.687 0.000 0.004 0.948 0.048 0.000
#> GSM97049     2  0.0000      0.796 0.000 1.000 0.000 0.000 0.000
#> GSM96968     3  0.4238      0.401 0.004 0.000 0.628 0.000 0.368
#> GSM96971     3  0.4278      0.415 0.000 0.000 0.548 0.000 0.452
#> GSM96986     3  0.4161      0.468 0.000 0.000 0.608 0.000 0.392
#> GSM97003     5  0.4197      0.532 0.244 0.000 0.028 0.000 0.728
#> GSM96957     1  0.3730      0.580 0.712 0.000 0.000 0.000 0.288
#> GSM96960     1  0.0162      0.827 0.996 0.000 0.000 0.004 0.000
#> GSM96975     5  0.0955      0.710 0.028 0.000 0.004 0.000 0.968
#> GSM96998     1  0.0000      0.827 1.000 0.000 0.000 0.000 0.000
#> GSM96999     1  0.3895      0.532 0.680 0.000 0.000 0.000 0.320
#> GSM97001     5  0.0162      0.711 0.004 0.000 0.000 0.000 0.996
#> GSM97005     5  0.3534      0.505 0.256 0.000 0.000 0.000 0.744
#> GSM97006     1  0.0162      0.827 0.996 0.000 0.000 0.004 0.000
#> GSM97021     5  0.0609      0.709 0.020 0.000 0.000 0.000 0.980
#> GSM97028     3  0.3816      0.516 0.000 0.000 0.696 0.000 0.304
#> GSM97031     1  0.3814      0.507 0.720 0.000 0.000 0.004 0.276
#> GSM97037     2  0.4547      0.491 0.000 0.588 0.400 0.000 0.012
#> GSM97018     2  0.5944      0.377 0.000 0.488 0.404 0.000 0.108
#> GSM97014     5  0.4219      0.459 0.000 0.416 0.000 0.000 0.584
#> GSM97042     2  0.2921      0.784 0.000 0.856 0.020 0.124 0.000
#> GSM97040     5  0.0000      0.710 0.000 0.000 0.000 0.000 1.000
#> GSM97041     5  0.6313      0.467 0.188 0.296 0.000 0.000 0.516
#> GSM96955     5  0.3969      0.558 0.000 0.304 0.004 0.000 0.692
#> GSM96990     3  0.3420      0.649 0.000 0.076 0.840 0.000 0.084
#> GSM96991     2  0.2921      0.784 0.000 0.856 0.020 0.124 0.000
#> GSM97048     2  0.0000      0.796 0.000 1.000 0.000 0.000 0.000
#> GSM96963     2  0.2723      0.785 0.000 0.864 0.012 0.124 0.000
#> GSM96953     2  0.2723      0.785 0.000 0.864 0.012 0.124 0.000
#> GSM96966     4  0.2859      0.909 0.068 0.000 0.000 0.876 0.056
#> GSM96979     3  0.4540      0.545 0.000 0.000 0.656 0.024 0.320
#> GSM96983     3  0.0794      0.706 0.000 0.000 0.972 0.000 0.028
#> GSM96984     3  0.1270      0.709 0.000 0.000 0.948 0.000 0.052
#> GSM96994     3  0.0404      0.701 0.000 0.000 0.988 0.000 0.012
#> GSM96996     5  0.5360      0.217 0.396 0.000 0.048 0.004 0.552
#> GSM96997     3  0.5569      0.474 0.092 0.000 0.588 0.000 0.320
#> GSM97007     3  0.0510      0.703 0.000 0.000 0.984 0.000 0.016
#> GSM96954     3  0.4789      0.494 0.024 0.000 0.584 0.000 0.392
#> GSM96962     3  0.3452      0.626 0.000 0.000 0.756 0.000 0.244
#> GSM96969     4  0.2329      0.888 0.124 0.000 0.000 0.876 0.000
#> GSM96970     4  0.2949      0.911 0.052 0.000 0.004 0.876 0.068
#> GSM96973     4  0.3009      0.902 0.008 0.000 0.052 0.876 0.064
#> GSM96976     4  0.2843      0.896 0.000 0.000 0.048 0.876 0.076
#> GSM96977     5  0.0510      0.711 0.016 0.000 0.000 0.000 0.984
#> GSM96995     5  0.1121      0.689 0.000 0.000 0.044 0.000 0.956
#> GSM97002     1  0.3452      0.636 0.756 0.000 0.000 0.000 0.244
#> GSM97009     5  0.4219      0.477 0.000 0.416 0.000 0.000 0.584
#> GSM97010     5  0.4480      0.629 0.016 0.152 0.060 0.000 0.772
#> GSM96974     4  0.2377      0.846 0.000 0.000 0.128 0.872 0.000
#> GSM96985     4  0.4356      0.830 0.016 0.000 0.060 0.784 0.140
#> GSM96959     5  0.0162      0.709 0.000 0.000 0.004 0.000 0.996
#> GSM96972     4  0.2793      0.902 0.088 0.000 0.036 0.876 0.000
#> GSM96978     3  0.2471      0.668 0.000 0.000 0.864 0.000 0.136
#> GSM96967     4  0.2990      0.910 0.080 0.000 0.032 0.876 0.012
#> GSM96987     1  0.0000      0.827 1.000 0.000 0.000 0.000 0.000
#> GSM97011     5  0.0000      0.710 0.000 0.000 0.000 0.000 1.000
#> GSM96964     1  0.0000      0.827 1.000 0.000 0.000 0.000 0.000
#> GSM96965     4  0.2989      0.878 0.000 0.072 0.000 0.868 0.060
#> GSM96981     5  0.4397      0.160 0.432 0.000 0.000 0.004 0.564
#> GSM96982     1  0.3607      0.639 0.752 0.000 0.000 0.004 0.244
#> GSM96988     3  0.1270      0.706 0.000 0.000 0.948 0.000 0.052
#> GSM97000     5  0.0162      0.708 0.000 0.000 0.004 0.000 0.996
#> GSM97004     1  0.0510      0.819 0.984 0.000 0.000 0.016 0.000
#> GSM97008     5  0.0000      0.710 0.000 0.000 0.000 0.000 1.000
#> GSM96950     1  0.1908      0.781 0.908 0.000 0.000 0.000 0.092
#> GSM96980     4  0.2921      0.889 0.124 0.000 0.000 0.856 0.020
#> GSM96989     1  0.0000      0.827 1.000 0.000 0.000 0.000 0.000
#> GSM96992     1  0.0162      0.827 0.996 0.000 0.000 0.004 0.000
#> GSM96993     1  0.6182      0.178 0.520 0.000 0.324 0.000 0.156
#> GSM96958     1  0.3730      0.583 0.712 0.000 0.000 0.000 0.288
#> GSM96951     1  0.0510      0.820 0.984 0.000 0.000 0.000 0.016
#> GSM96952     1  0.0162      0.827 0.996 0.000 0.000 0.004 0.000
#> GSM96961     1  0.0000      0.827 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
#> GSM97038     2  0.4184    0.34778 0.000 0.500 0.012 0.000 0.000 0.488
#> GSM97045     6  0.5714   -0.26886 0.000 0.176 0.340 0.000 0.000 0.484
#> GSM97047     5  0.4051    0.49534 0.000 0.004 0.224 0.000 0.728 0.044
#> GSM97025     6  0.5714   -0.26886 0.000 0.176 0.340 0.000 0.000 0.484
#> GSM97030     3  0.3610    0.48128 0.000 0.200 0.768 0.000 0.028 0.004
#> GSM97027     6  0.5714   -0.26886 0.000 0.176 0.340 0.000 0.000 0.484
#> GSM97033     6  0.5691   -0.26890 0.000 0.172 0.340 0.000 0.000 0.488
#> GSM97034     3  0.2629    0.41119 0.000 0.068 0.872 0.000 0.060 0.000
#> GSM97020     6  0.5844   -0.31503 0.000 0.268 0.244 0.000 0.000 0.488
#> GSM97026     3  0.5978   -0.23922 0.000 0.152 0.532 0.000 0.024 0.292
#> GSM97012     2  0.3578    0.54843 0.000 0.660 0.340 0.000 0.000 0.000
#> GSM97015     3  0.4945    0.45647 0.000 0.344 0.584 0.000 0.068 0.004
#> GSM97016     2  0.3997    0.35429 0.000 0.508 0.004 0.000 0.000 0.488
#> GSM97017     5  0.3620    0.67219 0.036 0.000 0.056 0.000 0.824 0.084
#> GSM97019     2  0.3578    0.54843 0.000 0.660 0.340 0.000 0.000 0.000
#> GSM97022     2  0.3727    0.51045 0.000 0.612 0.388 0.000 0.000 0.000
#> GSM97035     2  0.3607    0.54628 0.000 0.652 0.348 0.000 0.000 0.000
#> GSM97036     3  0.6136    0.09076 0.040 0.088 0.656 0.000 0.100 0.116
#> GSM97039     2  0.3997    0.35429 0.000 0.508 0.004 0.000 0.000 0.488
#> GSM97046     2  0.3997    0.35429 0.000 0.508 0.004 0.000 0.000 0.488
#> GSM97023     1  0.0000    0.81994 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97029     5  0.7860    0.12661 0.160 0.036 0.296 0.000 0.376 0.132
#> GSM97043     3  0.3916    0.30116 0.000 0.184 0.752 0.000 0.000 0.064
#> GSM97013     1  0.4513    0.19324 0.528 0.032 0.000 0.000 0.000 0.440
#> GSM96956     3  0.5384    0.35267 0.000 0.428 0.472 0.000 0.004 0.096
#> GSM97024     2  0.3737    0.50544 0.000 0.608 0.392 0.000 0.000 0.000
#> GSM97032     3  0.3752    0.48991 0.000 0.164 0.772 0.000 0.064 0.000
#> GSM97044     3  0.4246    0.46473 0.000 0.020 0.580 0.000 0.000 0.400
#> GSM97049     2  0.3997    0.35429 0.000 0.508 0.004 0.000 0.000 0.488
#> GSM96968     3  0.6511    0.37532 0.016 0.012 0.456 0.000 0.308 0.208
#> GSM96971     6  0.5147    0.19628 0.000 0.000 0.064 0.008 0.416 0.512
#> GSM96986     6  0.5361    0.21497 0.000 0.000 0.116 0.000 0.372 0.512
#> GSM97003     5  0.3732    0.53204 0.228 0.000 0.024 0.000 0.744 0.004
#> GSM96957     1  0.3221    0.62750 0.736 0.000 0.000 0.000 0.264 0.000
#> GSM96960     1  0.0363    0.81811 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM96975     5  0.1141    0.68365 0.052 0.000 0.000 0.000 0.948 0.000
#> GSM96998     1  0.0000    0.81994 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96999     1  0.3428    0.57712 0.696 0.000 0.000 0.000 0.304 0.000
#> GSM97001     5  0.0146    0.68405 0.004 0.000 0.000 0.000 0.996 0.000
#> GSM97005     5  0.4551    0.54104 0.168 0.000 0.056 0.000 0.736 0.040
#> GSM97006     1  0.0458    0.81678 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM97021     5  0.2577    0.67285 0.016 0.000 0.056 0.000 0.888 0.040
#> GSM97028     3  0.5646    0.41359 0.000 0.000 0.536 0.000 0.244 0.220
#> GSM97031     1  0.4680    0.33622 0.628 0.000 0.000 0.012 0.320 0.040
#> GSM97037     3  0.5105    0.38752 0.000 0.428 0.500 0.000 0.004 0.068
#> GSM97018     3  0.2965    0.45757 0.000 0.080 0.848 0.000 0.072 0.000
#> GSM97014     5  0.5364    0.38993 0.000 0.024 0.056 0.000 0.504 0.416
#> GSM97042     2  0.3578    0.54843 0.000 0.660 0.340 0.000 0.000 0.000
#> GSM97040     5  0.2129    0.67295 0.000 0.000 0.056 0.000 0.904 0.040
#> GSM97041     5  0.6944    0.42338 0.156 0.020 0.056 0.000 0.472 0.296
#> GSM96955     5  0.4789    0.49657 0.000 0.092 0.000 0.000 0.640 0.268
#> GSM96990     3  0.4671    0.49775 0.000 0.000 0.628 0.000 0.068 0.304
#> GSM96991     2  0.3634    0.54022 0.000 0.644 0.356 0.000 0.000 0.000
#> GSM97048     2  0.3997    0.35429 0.000 0.508 0.004 0.000 0.000 0.488
#> GSM96963     2  0.3578    0.54843 0.000 0.660 0.340 0.000 0.000 0.000
#> GSM96953     2  0.0260    0.38814 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM96966     4  0.0000    0.98267 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96979     6  0.5894    0.22541 0.000 0.000 0.084 0.044 0.360 0.512
#> GSM96983     3  0.3937    0.44610 0.000 0.000 0.572 0.000 0.004 0.424
#> GSM96984     6  0.4807   -0.40948 0.000 0.000 0.464 0.000 0.052 0.484
#> GSM96994     3  0.3860    0.40679 0.000 0.000 0.528 0.000 0.000 0.472
#> GSM96996     5  0.4177   -0.00686 0.468 0.000 0.000 0.012 0.520 0.000
#> GSM96997     6  0.6009    0.22181 0.056 0.000 0.080 0.000 0.360 0.504
#> GSM97007     3  0.4260    0.39078 0.000 0.000 0.512 0.000 0.016 0.472
#> GSM96954     6  0.5368    0.16795 0.024 0.000 0.056 0.000 0.420 0.500
#> GSM96962     6  0.5787    0.00387 0.000 0.000 0.252 0.000 0.244 0.504
#> GSM96969     4  0.0000    0.98267 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96970     4  0.0000    0.98267 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96973     4  0.0000    0.98267 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96976     4  0.0405    0.97589 0.000 0.008 0.000 0.988 0.004 0.000
#> GSM96977     5  0.1007    0.68392 0.044 0.000 0.000 0.000 0.956 0.000
#> GSM96995     5  0.1625    0.67432 0.000 0.000 0.060 0.000 0.928 0.012
#> GSM97002     1  0.3198    0.63209 0.740 0.000 0.000 0.000 0.260 0.000
#> GSM97009     5  0.4440    0.40789 0.000 0.008 0.016 0.000 0.556 0.420
#> GSM97010     5  0.3746    0.60048 0.048 0.000 0.000 0.000 0.760 0.192
#> GSM96974     4  0.0146    0.98037 0.000 0.000 0.004 0.996 0.000 0.000
#> GSM96985     4  0.2147    0.88602 0.000 0.000 0.020 0.896 0.084 0.000
#> GSM96959     5  0.2129    0.67295 0.000 0.000 0.056 0.000 0.904 0.040
#> GSM96972     4  0.0000    0.98267 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96978     3  0.5486    0.40143 0.000 0.000 0.496 0.000 0.132 0.372
#> GSM96967     4  0.0000    0.98267 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96987     1  0.0000    0.81994 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97011     5  0.0000    0.68318 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM96964     1  0.0000    0.81994 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96965     4  0.0520    0.97527 0.000 0.000 0.000 0.984 0.008 0.008
#> GSM96981     5  0.4169    0.02661 0.456 0.000 0.000 0.012 0.532 0.000
#> GSM96982     1  0.3608    0.62140 0.716 0.000 0.000 0.012 0.272 0.000
#> GSM96988     3  0.4400    0.46699 0.000 0.000 0.592 0.000 0.032 0.376
#> GSM97000     5  0.2129    0.67295 0.000 0.000 0.056 0.000 0.904 0.040
#> GSM97004     1  0.1075    0.79754 0.952 0.000 0.000 0.048 0.000 0.000
#> GSM97008     5  0.2066    0.67385 0.000 0.000 0.052 0.000 0.908 0.040
#> GSM96950     1  0.1765    0.77572 0.904 0.000 0.000 0.000 0.096 0.000
#> GSM96980     4  0.0692    0.96611 0.004 0.000 0.000 0.976 0.020 0.000
#> GSM96989     1  0.0000    0.81994 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96992     1  0.0363    0.81811 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM96993     1  0.5371    0.12864 0.520 0.000 0.360 0.000 0.120 0.000
#> GSM96958     1  0.3288    0.61839 0.724 0.000 0.000 0.000 0.276 0.000
#> GSM96951     1  0.0865    0.80175 0.964 0.000 0.000 0.000 0.036 0.000
#> GSM96952     1  0.0260    0.81900 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM96961     1  0.0000    0.81994 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-SD-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-pam-collect-classes

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

test_to_known_factors(res)
#>         n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:pam 98         7.18e-09       0.530     2.47e-19  0.00887 2
#> SD:pam 46         3.33e-04       0.178     1.03e-10  0.06974 3
#> SD:pam 68         1.04e-04       0.478     5.69e-15  0.00165 4
#> SD:pam 80         1.45e-06       0.211     6.75e-17  0.01235 5
#> SD:pam 51         4.23e-03       0.140     2.03e-11  0.06232 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 21168 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-mclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.600           0.915       0.948         0.3655 0.642   0.642
#> 3 3 0.589           0.716       0.861         0.7197 0.708   0.549
#> 4 4 0.861           0.891       0.946         0.1553 0.889   0.705
#> 5 5 0.772           0.752       0.828         0.0727 0.937   0.785
#> 6 6 0.874           0.891       0.918         0.0640 0.906   0.626

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
#> GSM97038     2  0.6531      0.802 0.168 0.832
#> GSM97045     2  0.0376      0.945 0.004 0.996
#> GSM97047     1  0.5059      0.915 0.888 0.112
#> GSM97025     2  0.0376      0.945 0.004 0.996
#> GSM97030     1  0.5059      0.915 0.888 0.112
#> GSM97027     2  0.0376      0.945 0.004 0.996
#> GSM97033     2  0.0376      0.945 0.004 0.996
#> GSM97034     1  0.5059      0.915 0.888 0.112
#> GSM97020     2  0.0376      0.945 0.004 0.996
#> GSM97026     1  0.5059      0.915 0.888 0.112
#> GSM97012     2  0.0376      0.945 0.004 0.996
#> GSM97015     1  0.5059      0.915 0.888 0.112
#> GSM97016     2  0.0376      0.945 0.004 0.996
#> GSM97017     1  0.0000      0.942 1.000 0.000
#> GSM97019     2  0.0376      0.945 0.004 0.996
#> GSM97022     2  0.0376      0.945 0.004 0.996
#> GSM97035     2  0.0376      0.945 0.004 0.996
#> GSM97036     1  0.0000      0.942 1.000 0.000
#> GSM97039     2  0.0376      0.945 0.004 0.996
#> GSM97046     2  0.0376      0.945 0.004 0.996
#> GSM97023     1  0.0000      0.942 1.000 0.000
#> GSM97029     1  0.0000      0.942 1.000 0.000
#> GSM97043     2  0.6801      0.788 0.180 0.820
#> GSM97013     1  0.0000      0.942 1.000 0.000
#> GSM96956     2  0.9393      0.435 0.356 0.644
#> GSM97024     2  0.7056      0.773 0.192 0.808
#> GSM97032     1  0.5059      0.915 0.888 0.112
#> GSM97044     1  0.5178      0.915 0.884 0.116
#> GSM97049     2  0.0376      0.945 0.004 0.996
#> GSM96968     1  0.5059      0.915 0.888 0.112
#> GSM96971     1  0.5178      0.915 0.884 0.116
#> GSM96986     1  0.5178      0.915 0.884 0.116
#> GSM97003     1  0.0938      0.941 0.988 0.012
#> GSM96957     1  0.0000      0.942 1.000 0.000
#> GSM96960     1  0.0376      0.941 0.996 0.004
#> GSM96975     1  0.0000      0.942 1.000 0.000
#> GSM96998     1  0.0000      0.942 1.000 0.000
#> GSM96999     1  0.0000      0.942 1.000 0.000
#> GSM97001     1  0.0000      0.942 1.000 0.000
#> GSM97005     1  0.0000      0.942 1.000 0.000
#> GSM97006     1  0.0000      0.942 1.000 0.000
#> GSM97021     1  0.0000      0.942 1.000 0.000
#> GSM97028     1  0.5059      0.915 0.888 0.112
#> GSM97031     1  0.4298      0.923 0.912 0.088
#> GSM97037     1  0.9970      0.177 0.532 0.468
#> GSM97018     1  0.5059      0.915 0.888 0.112
#> GSM97014     1  0.4298      0.923 0.912 0.088
#> GSM97042     2  0.0376      0.945 0.004 0.996
#> GSM97040     1  0.4690      0.919 0.900 0.100
#> GSM97041     1  0.0000      0.942 1.000 0.000
#> GSM96955     2  0.7139      0.767 0.196 0.804
#> GSM96990     1  0.5059      0.915 0.888 0.112
#> GSM96991     2  0.0672      0.943 0.008 0.992
#> GSM97048     2  0.0376      0.945 0.004 0.996
#> GSM96963     2  0.0376      0.945 0.004 0.996
#> GSM96953     2  0.0376      0.945 0.004 0.996
#> GSM96966     1  0.0376      0.941 0.996 0.004
#> GSM96979     1  0.5178      0.915 0.884 0.116
#> GSM96983     1  0.5178      0.915 0.884 0.116
#> GSM96984     1  0.5178      0.915 0.884 0.116
#> GSM96994     1  0.5178      0.915 0.884 0.116
#> GSM96996     1  0.0000      0.942 1.000 0.000
#> GSM96997     1  0.5178      0.915 0.884 0.116
#> GSM97007     1  0.5178      0.915 0.884 0.116
#> GSM96954     1  0.4815      0.918 0.896 0.104
#> GSM96962     1  0.5178      0.915 0.884 0.116
#> GSM96969     1  0.0376      0.941 0.996 0.004
#> GSM96970     1  0.0376      0.941 0.996 0.004
#> GSM96973     1  0.0376      0.941 0.996 0.004
#> GSM96976     1  0.1843      0.938 0.972 0.028
#> GSM96977     1  0.0938      0.941 0.988 0.012
#> GSM96995     1  0.5059      0.915 0.888 0.112
#> GSM97002     1  0.0000      0.942 1.000 0.000
#> GSM97009     1  0.5059      0.915 0.888 0.112
#> GSM97010     1  0.0000      0.942 1.000 0.000
#> GSM96974     1  0.1843      0.938 0.972 0.028
#> GSM96985     1  0.1633      0.939 0.976 0.024
#> GSM96959     1  0.4815      0.918 0.896 0.104
#> GSM96972     1  0.0376      0.941 0.996 0.004
#> GSM96978     1  0.5178      0.915 0.884 0.116
#> GSM96967     1  0.0376      0.941 0.996 0.004
#> GSM96987     1  0.0000      0.942 1.000 0.000
#> GSM97011     1  0.0000      0.942 1.000 0.000
#> GSM96964     1  0.0000      0.942 1.000 0.000
#> GSM96965     1  0.0376      0.941 0.996 0.004
#> GSM96981     1  0.0000      0.942 1.000 0.000
#> GSM96982     1  0.0376      0.941 0.996 0.004
#> GSM96988     1  0.5178      0.915 0.884 0.116
#> GSM97000     1  0.4690      0.919 0.900 0.100
#> GSM97004     1  0.0376      0.941 0.996 0.004
#> GSM97008     1  0.4298      0.923 0.912 0.088
#> GSM96950     1  0.0000      0.942 1.000 0.000
#> GSM96980     1  0.0376      0.941 0.996 0.004
#> GSM96989     1  0.0000      0.942 1.000 0.000
#> GSM96992     1  0.0000      0.942 1.000 0.000
#> GSM96993     1  0.0000      0.942 1.000 0.000
#> GSM96958     1  0.0000      0.942 1.000 0.000
#> GSM96951     1  0.0000      0.942 1.000 0.000
#> GSM96952     1  0.0000      0.942 1.000 0.000
#> GSM96961     1  0.0000      0.942 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
#> GSM97038     2  0.0747     0.9255 0.000 0.984 0.016
#> GSM97045     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97047     3  0.7458     0.6114 0.088 0.236 0.676
#> GSM97025     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97030     3  0.1711     0.8681 0.008 0.032 0.960
#> GSM97027     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97033     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97034     3  0.1585     0.8689 0.008 0.028 0.964
#> GSM97020     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97026     3  0.9547     0.2819 0.228 0.292 0.480
#> GSM97012     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97015     3  0.1711     0.8681 0.008 0.032 0.960
#> GSM97016     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97017     1  0.2796     0.7659 0.908 0.000 0.092
#> GSM97019     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97022     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97035     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97036     1  0.2448     0.7677 0.924 0.000 0.076
#> GSM97039     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97046     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97023     1  0.0747     0.7551 0.984 0.000 0.016
#> GSM97029     1  0.2796     0.7659 0.908 0.000 0.092
#> GSM97043     2  0.3192     0.8412 0.000 0.888 0.112
#> GSM97013     1  0.2711     0.7668 0.912 0.000 0.088
#> GSM96956     2  0.6398     0.2400 0.004 0.580 0.416
#> GSM97024     2  0.4110     0.8044 0.004 0.844 0.152
#> GSM97032     3  0.2866     0.8414 0.008 0.076 0.916
#> GSM97044     3  0.1585     0.8689 0.008 0.028 0.964
#> GSM97049     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM96968     3  0.2187     0.8644 0.024 0.028 0.948
#> GSM96971     3  0.0424     0.8667 0.008 0.000 0.992
#> GSM96986     3  0.0424     0.8667 0.008 0.000 0.992
#> GSM97003     1  0.6267     0.3926 0.548 0.000 0.452
#> GSM96957     1  0.2796     0.7659 0.908 0.000 0.092
#> GSM96960     1  0.6062     0.4678 0.616 0.000 0.384
#> GSM96975     1  0.2711     0.7669 0.912 0.000 0.088
#> GSM96998     1  0.0000     0.7482 1.000 0.000 0.000
#> GSM96999     1  0.2796     0.7659 0.908 0.000 0.092
#> GSM97001     1  0.2796     0.7659 0.908 0.000 0.092
#> GSM97005     1  0.2625     0.7674 0.916 0.000 0.084
#> GSM97006     1  0.5988     0.4722 0.632 0.000 0.368
#> GSM97021     1  0.3610     0.7575 0.888 0.016 0.096
#> GSM97028     3  0.1453     0.8692 0.008 0.024 0.968
#> GSM97031     1  0.6925     0.3767 0.532 0.016 0.452
#> GSM97037     2  0.6633     0.2356 0.008 0.548 0.444
#> GSM97018     3  0.2845     0.8470 0.012 0.068 0.920
#> GSM97014     1  0.9555     0.3079 0.480 0.232 0.288
#> GSM97042     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM97040     1  0.4995     0.7060 0.824 0.032 0.144
#> GSM97041     1  0.2796     0.7659 0.908 0.000 0.092
#> GSM96955     2  0.3941     0.7938 0.000 0.844 0.156
#> GSM96990     3  0.1711     0.8681 0.008 0.032 0.960
#> GSM96991     2  0.0424     0.9317 0.000 0.992 0.008
#> GSM97048     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM96963     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM96953     2  0.0000     0.9374 0.000 1.000 0.000
#> GSM96966     1  0.6026     0.4710 0.624 0.000 0.376
#> GSM96979     3  0.4399     0.6606 0.188 0.000 0.812
#> GSM96983     3  0.0424     0.8667 0.008 0.000 0.992
#> GSM96984     3  0.0424     0.8667 0.008 0.000 0.992
#> GSM96994     3  0.0424     0.8667 0.008 0.000 0.992
#> GSM96996     1  0.0000     0.7482 1.000 0.000 0.000
#> GSM96997     3  0.0424     0.8667 0.008 0.000 0.992
#> GSM97007     3  0.0424     0.8667 0.008 0.000 0.992
#> GSM96954     3  0.2031     0.8679 0.016 0.032 0.952
#> GSM96962     3  0.0424     0.8667 0.008 0.000 0.992
#> GSM96969     1  0.6026     0.4710 0.624 0.000 0.376
#> GSM96970     1  0.6026     0.4710 0.624 0.000 0.376
#> GSM96973     1  0.6026     0.4710 0.624 0.000 0.376
#> GSM96976     3  0.6852     0.3807 0.300 0.036 0.664
#> GSM96977     1  0.4999     0.7037 0.820 0.028 0.152
#> GSM96995     3  0.2176     0.8661 0.020 0.032 0.948
#> GSM97002     1  0.3752     0.7020 0.856 0.000 0.144
#> GSM97009     1  0.9027     0.1561 0.440 0.132 0.428
#> GSM97010     1  0.5591     0.6186 0.696 0.000 0.304
#> GSM96974     3  0.6235    -0.0878 0.436 0.000 0.564
#> GSM96985     3  0.6309    -0.3083 0.496 0.000 0.504
#> GSM96959     3  0.1832     0.8667 0.008 0.036 0.956
#> GSM96972     1  0.6026     0.4710 0.624 0.000 0.376
#> GSM96978     3  0.0424     0.8667 0.008 0.000 0.992
#> GSM96967     1  0.6026     0.4710 0.624 0.000 0.376
#> GSM96987     1  0.0592     0.7544 0.988 0.000 0.012
#> GSM97011     1  0.3670     0.7560 0.888 0.020 0.092
#> GSM96964     1  0.1411     0.7616 0.964 0.000 0.036
#> GSM96965     1  0.6244     0.4139 0.560 0.000 0.440
#> GSM96981     1  0.0892     0.7579 0.980 0.000 0.020
#> GSM96982     1  0.6026     0.4778 0.624 0.000 0.376
#> GSM96988     3  0.3340     0.7615 0.120 0.000 0.880
#> GSM97000     1  0.7286     0.3301 0.508 0.028 0.464
#> GSM97004     1  0.6008     0.4715 0.628 0.000 0.372
#> GSM97008     1  0.3966     0.7499 0.876 0.024 0.100
#> GSM96950     1  0.2625     0.7673 0.916 0.000 0.084
#> GSM96980     1  0.6026     0.4710 0.624 0.000 0.376
#> GSM96989     1  0.0747     0.7564 0.984 0.000 0.016
#> GSM96992     1  0.0747     0.7551 0.984 0.000 0.016
#> GSM96993     1  0.2796     0.7659 0.908 0.000 0.092
#> GSM96958     1  0.2165     0.7670 0.936 0.000 0.064
#> GSM96951     1  0.2066     0.7665 0.940 0.000 0.060
#> GSM96952     1  0.0747     0.7551 0.984 0.000 0.016
#> GSM96961     1  0.0747     0.7551 0.984 0.000 0.016

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97045     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97047     2  0.5204     0.4346 0.376 0.612 0.012 0.000
#> GSM97025     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97030     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM97027     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97033     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97034     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM97020     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97026     2  0.4250     0.6261 0.276 0.724 0.000 0.000
#> GSM97012     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97015     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM97016     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97017     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM97019     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97036     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM97039     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97023     1  0.2345     0.8862 0.900 0.000 0.000 0.100
#> GSM97029     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM97043     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97013     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM96956     2  0.0921     0.9308 0.000 0.972 0.028 0.000
#> GSM97024     2  0.0592     0.9423 0.000 0.984 0.016 0.000
#> GSM97032     3  0.3726     0.7087 0.000 0.212 0.788 0.000
#> GSM97044     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM97049     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM96968     3  0.1474     0.9134 0.052 0.000 0.948 0.000
#> GSM96971     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM96986     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM97003     1  0.3356     0.8449 0.824 0.000 0.000 0.176
#> GSM96957     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM96960     1  0.3610     0.8270 0.800 0.000 0.000 0.200
#> GSM96975     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM96998     1  0.3610     0.8270 0.800 0.000 0.000 0.200
#> GSM96999     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM97001     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM97005     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM97006     1  0.3649     0.8233 0.796 0.000 0.000 0.204
#> GSM97021     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM97028     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM97031     1  0.1557     0.9043 0.944 0.000 0.000 0.056
#> GSM97037     2  0.3649     0.7280 0.000 0.796 0.204 0.000
#> GSM97018     3  0.3610     0.7257 0.000 0.200 0.800 0.000
#> GSM97014     1  0.4967     0.0513 0.548 0.452 0.000 0.000
#> GSM97042     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97040     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM97041     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM96955     2  0.1302     0.9150 0.044 0.956 0.000 0.000
#> GSM96990     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM96991     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM97048     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000     0.9542 0.000 1.000 0.000 0.000
#> GSM96966     4  0.0000     0.9213 0.000 0.000 0.000 1.000
#> GSM96979     3  0.0469     0.9460 0.000 0.000 0.988 0.012
#> GSM96983     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM96984     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM96994     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM96996     1  0.3610     0.8270 0.800 0.000 0.000 0.200
#> GSM96997     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM97007     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM96954     3  0.1637     0.9053 0.060 0.000 0.940 0.000
#> GSM96962     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM96969     4  0.0000     0.9213 0.000 0.000 0.000 1.000
#> GSM96970     4  0.0000     0.9213 0.000 0.000 0.000 1.000
#> GSM96973     4  0.0000     0.9213 0.000 0.000 0.000 1.000
#> GSM96976     4  0.3668     0.7759 0.000 0.004 0.188 0.808
#> GSM96977     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM96995     3  0.1302     0.9212 0.044 0.000 0.956 0.000
#> GSM97002     1  0.3764     0.8114 0.784 0.000 0.000 0.216
#> GSM97009     1  0.0921     0.9037 0.972 0.028 0.000 0.000
#> GSM97010     1  0.0469     0.9123 0.988 0.000 0.000 0.012
#> GSM96974     4  0.3486     0.7779 0.000 0.000 0.188 0.812
#> GSM96985     4  0.3219     0.8046 0.000 0.000 0.164 0.836
#> GSM96959     3  0.3444     0.7421 0.184 0.000 0.816 0.000
#> GSM96972     4  0.0000     0.9213 0.000 0.000 0.000 1.000
#> GSM96978     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM96967     4  0.0000     0.9213 0.000 0.000 0.000 1.000
#> GSM96987     1  0.3219     0.8521 0.836 0.000 0.000 0.164
#> GSM97011     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM96964     1  0.1118     0.9098 0.964 0.000 0.000 0.036
#> GSM96965     4  0.3528     0.7590 0.192 0.000 0.000 0.808
#> GSM96981     1  0.0707     0.9135 0.980 0.000 0.000 0.020
#> GSM96982     1  0.3356     0.8448 0.824 0.000 0.000 0.176
#> GSM96988     3  0.0000     0.9550 0.000 0.000 1.000 0.000
#> GSM97000     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM97004     4  0.0000     0.9213 0.000 0.000 0.000 1.000
#> GSM97008     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM96950     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM96980     4  0.0000     0.9213 0.000 0.000 0.000 1.000
#> GSM96989     1  0.1867     0.8989 0.928 0.000 0.000 0.072
#> GSM96992     1  0.3486     0.8363 0.812 0.000 0.000 0.188
#> GSM96993     1  0.0000     0.9162 1.000 0.000 0.000 0.000
#> GSM96958     1  0.0188     0.9159 0.996 0.000 0.000 0.004
#> GSM96951     1  0.1940     0.8969 0.924 0.000 0.000 0.076
#> GSM96952     1  0.3486     0.8363 0.812 0.000 0.000 0.188
#> GSM96961     1  0.3444     0.8391 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
#> GSM97038     2  0.0162     0.9468 0.000 0.996 0.000 0.000 0.004
#> GSM97045     2  0.0000     0.9491 0.000 1.000 0.000 0.000 0.000
#> GSM97047     5  0.4118     0.5128 0.336 0.000 0.004 0.000 0.660
#> GSM97025     2  0.0000     0.9491 0.000 1.000 0.000 0.000 0.000
#> GSM97030     5  0.4015     0.6468 0.000 0.000 0.348 0.000 0.652
#> GSM97027     2  0.0000     0.9491 0.000 1.000 0.000 0.000 0.000
#> GSM97033     2  0.0000     0.9491 0.000 1.000 0.000 0.000 0.000
#> GSM97034     5  0.4045     0.6386 0.000 0.000 0.356 0.000 0.644
#> GSM97020     2  0.0000     0.9491 0.000 1.000 0.000 0.000 0.000
#> GSM97026     2  0.6711     0.0785 0.336 0.444 0.004 0.000 0.216
#> GSM97012     2  0.0290     0.9479 0.000 0.992 0.000 0.000 0.008
#> GSM97015     5  0.3983     0.6514 0.000 0.000 0.340 0.000 0.660
#> GSM97016     2  0.0000     0.9491 0.000 1.000 0.000 0.000 0.000
#> GSM97017     1  0.0000     0.7587 1.000 0.000 0.000 0.000 0.000
#> GSM97019     2  0.0290     0.9479 0.000 0.992 0.000 0.000 0.008
#> GSM97022     2  0.0290     0.9479 0.000 0.992 0.000 0.000 0.008
#> GSM97035     2  0.0290     0.9479 0.000 0.992 0.000 0.000 0.008
#> GSM97036     1  0.0609     0.7594 0.980 0.000 0.000 0.000 0.020
#> GSM97039     2  0.0000     0.9491 0.000 1.000 0.000 0.000 0.000
#> GSM97046     2  0.0000     0.9491 0.000 1.000 0.000 0.000 0.000
#> GSM97023     1  0.4925     0.6987 0.632 0.000 0.000 0.044 0.324
#> GSM97029     1  0.0162     0.7593 0.996 0.000 0.000 0.000 0.004
#> GSM97043     2  0.2690     0.7746 0.000 0.844 0.000 0.000 0.156
#> GSM97013     1  0.0162     0.7593 0.996 0.000 0.000 0.000 0.004
#> GSM96956     5  0.4403     0.3855 0.000 0.384 0.008 0.000 0.608
#> GSM97024     5  0.4151     0.4610 0.000 0.344 0.004 0.000 0.652
#> GSM97032     5  0.4836     0.6630 0.000 0.044 0.304 0.000 0.652
#> GSM97044     5  0.4287     0.4640 0.000 0.000 0.460 0.000 0.540
#> GSM97049     2  0.0000     0.9491 0.000 1.000 0.000 0.000 0.000
#> GSM96968     5  0.5708     0.5657 0.096 0.000 0.348 0.000 0.556
#> GSM96971     3  0.0000     0.9374 0.000 0.000 1.000 0.000 0.000
#> GSM96986     3  0.0000     0.9374 0.000 0.000 1.000 0.000 0.000
#> GSM97003     1  0.6461     0.6105 0.492 0.000 0.004 0.172 0.332
#> GSM96957     1  0.0162     0.7577 0.996 0.000 0.000 0.000 0.004
#> GSM96960     1  0.6482     0.5861 0.468 0.000 0.000 0.200 0.332
#> GSM96975     1  0.1197     0.7582 0.952 0.000 0.000 0.000 0.048
#> GSM96998     1  0.6461     0.5911 0.472 0.000 0.000 0.196 0.332
#> GSM96999     1  0.0000     0.7587 1.000 0.000 0.000 0.000 0.000
#> GSM97001     1  0.0162     0.7577 0.996 0.000 0.000 0.000 0.004
#> GSM97005     1  0.0162     0.7577 0.996 0.000 0.000 0.000 0.004
#> GSM97006     1  0.6461     0.5911 0.472 0.000 0.000 0.196 0.332
#> GSM97021     1  0.0162     0.7577 0.996 0.000 0.000 0.000 0.004
#> GSM97028     3  0.3932     0.2593 0.000 0.000 0.672 0.000 0.328
#> GSM97031     1  0.4602     0.7086 0.656 0.000 0.000 0.028 0.316
#> GSM97037     5  0.4339     0.4745 0.000 0.336 0.012 0.000 0.652
#> GSM97018     5  0.4716     0.6641 0.000 0.036 0.308 0.000 0.656
#> GSM97014     1  0.3530     0.5117 0.784 0.204 0.000 0.000 0.012
#> GSM97042     2  0.0290     0.9479 0.000 0.992 0.000 0.000 0.008
#> GSM97040     1  0.0609     0.7493 0.980 0.000 0.000 0.000 0.020
#> GSM97041     1  0.0000     0.7587 1.000 0.000 0.000 0.000 0.000
#> GSM96955     2  0.3317     0.7186 0.004 0.804 0.004 0.000 0.188
#> GSM96990     5  0.4015     0.6468 0.000 0.000 0.348 0.000 0.652
#> GSM96991     2  0.0290     0.9479 0.000 0.992 0.000 0.000 0.008
#> GSM97048     2  0.0000     0.9491 0.000 1.000 0.000 0.000 0.000
#> GSM96963     2  0.0162     0.9485 0.000 0.996 0.000 0.000 0.004
#> GSM96953     2  0.0290     0.9479 0.000 0.992 0.000 0.000 0.008
#> GSM96966     4  0.0162     0.8608 0.000 0.000 0.000 0.996 0.004
#> GSM96979     3  0.0000     0.9374 0.000 0.000 1.000 0.000 0.000
#> GSM96983     3  0.0000     0.9374 0.000 0.000 1.000 0.000 0.000
#> GSM96984     3  0.0000     0.9374 0.000 0.000 1.000 0.000 0.000
#> GSM96994     3  0.0000     0.9374 0.000 0.000 1.000 0.000 0.000
#> GSM96996     1  0.6461     0.5911 0.472 0.000 0.000 0.196 0.332
#> GSM96997     3  0.0000     0.9374 0.000 0.000 1.000 0.000 0.000
#> GSM97007     3  0.0000     0.9374 0.000 0.000 1.000 0.000 0.000
#> GSM96954     3  0.4057     0.6387 0.120 0.000 0.792 0.000 0.088
#> GSM96962     3  0.0000     0.9374 0.000 0.000 1.000 0.000 0.000
#> GSM96969     4  0.0000     0.8614 0.000 0.000 0.000 1.000 0.000
#> GSM96970     4  0.0162     0.8608 0.000 0.000 0.000 0.996 0.004
#> GSM96973     4  0.0000     0.8614 0.000 0.000 0.000 1.000 0.000
#> GSM96976     4  0.3391     0.7323 0.000 0.000 0.188 0.800 0.012
#> GSM96977     1  0.0162     0.7577 0.996 0.000 0.000 0.000 0.004
#> GSM96995     5  0.4642     0.6612 0.032 0.000 0.308 0.000 0.660
#> GSM97002     1  0.6482     0.5861 0.468 0.000 0.000 0.200 0.332
#> GSM97009     5  0.4545     0.4011 0.432 0.004 0.004 0.000 0.560
#> GSM97010     1  0.0609     0.7594 0.980 0.000 0.000 0.000 0.020
#> GSM96974     4  0.3109     0.7281 0.000 0.000 0.200 0.800 0.000
#> GSM96985     4  0.3109     0.7281 0.000 0.000 0.200 0.800 0.000
#> GSM96959     5  0.5414     0.5993 0.200 0.000 0.140 0.000 0.660
#> GSM96972     4  0.0000     0.8614 0.000 0.000 0.000 1.000 0.000
#> GSM96978     3  0.0000     0.9374 0.000 0.000 1.000 0.000 0.000
#> GSM96967     4  0.0000     0.8614 0.000 0.000 0.000 1.000 0.000
#> GSM96987     1  0.5701     0.6658 0.568 0.000 0.000 0.100 0.332
#> GSM97011     1  0.0162     0.7577 0.996 0.000 0.000 0.000 0.004
#> GSM96964     1  0.4201     0.7102 0.664 0.000 0.000 0.008 0.328
#> GSM96965     4  0.3109     0.6871 0.200 0.000 0.000 0.800 0.000
#> GSM96981     1  0.3949     0.7113 0.668 0.000 0.000 0.000 0.332
#> GSM96982     1  0.5865     0.6557 0.552 0.000 0.000 0.116 0.332
#> GSM96988     3  0.0000     0.9374 0.000 0.000 1.000 0.000 0.000
#> GSM97000     1  0.0162     0.7577 0.996 0.000 0.000 0.000 0.004
#> GSM97004     4  0.3816     0.6045 0.000 0.000 0.000 0.696 0.304
#> GSM97008     1  0.0162     0.7577 0.996 0.000 0.000 0.000 0.004
#> GSM96950     1  0.0609     0.7602 0.980 0.000 0.000 0.000 0.020
#> GSM96980     4  0.2605     0.7640 0.000 0.000 0.000 0.852 0.148
#> GSM96989     1  0.4747     0.7011 0.636 0.000 0.000 0.032 0.332
#> GSM96992     1  0.6461     0.5911 0.472 0.000 0.000 0.196 0.332
#> GSM96993     1  0.0000     0.7587 1.000 0.000 0.000 0.000 0.000
#> GSM96958     1  0.3932     0.7121 0.672 0.000 0.000 0.000 0.328
#> GSM96951     1  0.4522     0.7088 0.660 0.000 0.000 0.024 0.316
#> GSM96952     1  0.6461     0.5911 0.472 0.000 0.000 0.196 0.332
#> GSM96961     1  0.6205     0.6262 0.512 0.000 0.000 0.156 0.332

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.1332      0.947 0.012 0.952 0.028 0.008 0.000 0.000
#> GSM97045     2  0.0363      0.960 0.012 0.988 0.000 0.000 0.000 0.000
#> GSM97047     3  0.2070      0.859 0.000 0.000 0.892 0.008 0.100 0.000
#> GSM97025     2  0.0363      0.960 0.012 0.988 0.000 0.000 0.000 0.000
#> GSM97030     3  0.0937      0.938 0.000 0.000 0.960 0.000 0.000 0.040
#> GSM97027     2  0.0508      0.960 0.012 0.984 0.000 0.004 0.000 0.000
#> GSM97033     2  0.0622      0.958 0.012 0.980 0.000 0.008 0.000 0.000
#> GSM97034     3  0.1007      0.937 0.000 0.000 0.956 0.000 0.000 0.044
#> GSM97020     2  0.0622      0.958 0.012 0.980 0.000 0.008 0.000 0.000
#> GSM97026     5  0.3679      0.781 0.012 0.012 0.160 0.020 0.796 0.000
#> GSM97012     2  0.1138      0.957 0.004 0.960 0.012 0.024 0.000 0.000
#> GSM97015     3  0.0937      0.938 0.000 0.000 0.960 0.000 0.000 0.040
#> GSM97016     2  0.0260      0.960 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM97017     5  0.0000      0.941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97019     2  0.1036      0.958 0.004 0.964 0.008 0.024 0.000 0.000
#> GSM97022     2  0.1036      0.958 0.004 0.964 0.008 0.024 0.000 0.000
#> GSM97035     2  0.1036      0.958 0.004 0.964 0.008 0.024 0.000 0.000
#> GSM97036     5  0.0551      0.939 0.004 0.000 0.004 0.008 0.984 0.000
#> GSM97039     2  0.0260      0.960 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM97046     2  0.0665      0.960 0.004 0.980 0.008 0.008 0.000 0.000
#> GSM97023     1  0.2178      0.882 0.868 0.000 0.000 0.000 0.132 0.000
#> GSM97029     5  0.0551      0.939 0.004 0.000 0.004 0.008 0.984 0.000
#> GSM97043     2  0.3046      0.785 0.012 0.800 0.188 0.000 0.000 0.000
#> GSM97013     5  0.0405      0.940 0.000 0.000 0.004 0.008 0.988 0.000
#> GSM96956     3  0.1007      0.913 0.000 0.044 0.956 0.000 0.000 0.000
#> GSM97024     3  0.1010      0.917 0.000 0.036 0.960 0.004 0.000 0.000
#> GSM97032     3  0.0937      0.938 0.000 0.000 0.960 0.000 0.000 0.040
#> GSM97044     3  0.1007      0.937 0.000 0.000 0.956 0.000 0.000 0.044
#> GSM97049     2  0.0622      0.958 0.012 0.980 0.000 0.008 0.000 0.000
#> GSM96968     3  0.5239      0.616 0.000 0.000 0.640 0.116 0.016 0.228
#> GSM96971     6  0.0000      0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96986     6  0.0000      0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97003     1  0.1036      0.894 0.964 0.000 0.000 0.004 0.024 0.008
#> GSM96957     5  0.0000      0.941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM96960     1  0.0717      0.889 0.976 0.000 0.000 0.008 0.016 0.000
#> GSM96975     5  0.1895      0.875 0.072 0.000 0.016 0.000 0.912 0.000
#> GSM96998     1  0.1321      0.892 0.952 0.000 0.024 0.004 0.020 0.000
#> GSM96999     5  0.0146      0.941 0.004 0.000 0.000 0.000 0.996 0.000
#> GSM97001     5  0.0000      0.941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97005     5  0.0972      0.929 0.028 0.000 0.000 0.008 0.964 0.000
#> GSM97006     1  0.1245      0.878 0.952 0.000 0.000 0.032 0.016 0.000
#> GSM97021     5  0.1349      0.922 0.004 0.000 0.000 0.056 0.940 0.000
#> GSM97028     6  0.4025      0.211 0.000 0.000 0.416 0.008 0.000 0.576
#> GSM97031     1  0.2821      0.879 0.860 0.000 0.004 0.040 0.096 0.000
#> GSM97037     3  0.0891      0.926 0.000 0.024 0.968 0.000 0.000 0.008
#> GSM97018     3  0.1049      0.937 0.000 0.008 0.960 0.000 0.000 0.032
#> GSM97014     5  0.0622      0.933 0.012 0.008 0.000 0.000 0.980 0.000
#> GSM97042     2  0.1138      0.957 0.004 0.960 0.012 0.024 0.000 0.000
#> GSM97040     5  0.2146      0.887 0.000 0.000 0.004 0.116 0.880 0.000
#> GSM97041     5  0.0000      0.941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM96955     2  0.3292      0.770 0.008 0.784 0.200 0.008 0.000 0.000
#> GSM96990     3  0.0937      0.938 0.000 0.000 0.960 0.000 0.000 0.040
#> GSM96991     2  0.1138      0.957 0.004 0.960 0.012 0.024 0.000 0.000
#> GSM97048     2  0.0622      0.958 0.012 0.980 0.000 0.008 0.000 0.000
#> GSM96963     2  0.1138      0.957 0.004 0.960 0.012 0.024 0.000 0.000
#> GSM96953     2  0.1036      0.958 0.004 0.964 0.008 0.024 0.000 0.000
#> GSM96966     4  0.2491      0.873 0.164 0.000 0.000 0.836 0.000 0.000
#> GSM96979     6  0.0000      0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96983     6  0.0000      0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96984     6  0.0000      0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96994     6  0.0000      0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96996     1  0.1630      0.886 0.940 0.000 0.024 0.016 0.020 0.000
#> GSM96997     6  0.0000      0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97007     6  0.0000      0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96954     6  0.3441      0.785 0.004 0.000 0.020 0.116 0.032 0.828
#> GSM96962     6  0.0000      0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96969     4  0.2416      0.876 0.156 0.000 0.000 0.844 0.000 0.000
#> GSM96970     4  0.2454      0.875 0.160 0.000 0.000 0.840 0.000 0.000
#> GSM96973     4  0.2416      0.876 0.156 0.000 0.000 0.844 0.000 0.000
#> GSM96976     4  0.3037      0.762 0.000 0.000 0.016 0.808 0.000 0.176
#> GSM96977     5  0.2146      0.888 0.004 0.000 0.000 0.116 0.880 0.000
#> GSM96995     3  0.2579      0.894 0.000 0.000 0.872 0.088 0.000 0.040
#> GSM97002     1  0.1542      0.885 0.944 0.000 0.024 0.016 0.016 0.000
#> GSM97009     5  0.3445      0.688 0.000 0.000 0.244 0.012 0.744 0.000
#> GSM97010     5  0.0436      0.940 0.004 0.000 0.004 0.004 0.988 0.000
#> GSM96974     4  0.2793      0.751 0.000 0.000 0.000 0.800 0.000 0.200
#> GSM96985     4  0.2793      0.751 0.000 0.000 0.000 0.800 0.000 0.200
#> GSM96959     3  0.2624      0.894 0.000 0.000 0.880 0.080 0.024 0.016
#> GSM96972     4  0.2416      0.876 0.156 0.000 0.000 0.844 0.000 0.000
#> GSM96978     6  0.0000      0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96967     4  0.2416      0.876 0.156 0.000 0.000 0.844 0.000 0.000
#> GSM96987     1  0.2804      0.885 0.852 0.000 0.024 0.004 0.120 0.000
#> GSM97011     5  0.0000      0.941 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM96964     1  0.2877      0.856 0.820 0.000 0.012 0.000 0.168 0.000
#> GSM96965     4  0.2730      0.727 0.000 0.000 0.000 0.808 0.192 0.000
#> GSM96981     1  0.3394      0.823 0.776 0.000 0.024 0.000 0.200 0.000
#> GSM96982     1  0.2206      0.899 0.904 0.000 0.024 0.008 0.064 0.000
#> GSM96988     6  0.0000      0.944 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97000     5  0.2243      0.889 0.004 0.000 0.004 0.112 0.880 0.000
#> GSM97004     1  0.3221      0.678 0.792 0.000 0.020 0.188 0.000 0.000
#> GSM97008     5  0.2006      0.896 0.004 0.000 0.000 0.104 0.892 0.000
#> GSM96950     5  0.0291      0.940 0.004 0.000 0.004 0.000 0.992 0.000
#> GSM96980     4  0.3634      0.612 0.356 0.000 0.000 0.644 0.000 0.000
#> GSM96989     1  0.2988      0.866 0.824 0.000 0.024 0.000 0.152 0.000
#> GSM96992     1  0.0603      0.891 0.980 0.000 0.000 0.004 0.016 0.000
#> GSM96993     5  0.0291      0.940 0.004 0.000 0.004 0.000 0.992 0.000
#> GSM96958     1  0.2703      0.849 0.824 0.000 0.000 0.004 0.172 0.000
#> GSM96951     1  0.2346      0.883 0.868 0.000 0.000 0.008 0.124 0.000
#> GSM96952     1  0.0692      0.893 0.976 0.000 0.000 0.004 0.020 0.000
#> GSM96961     1  0.1141      0.899 0.948 0.000 0.000 0.000 0.052 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-mclust-collect-classes

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

test_to_known_factors(res)
#>            n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:mclust 98         2.79e-05      0.4038     8.16e-12   0.0115 2
#> SD:mclust 77         8.69e-03      0.4160     3.41e-15   0.1125 3
#> SD:mclust 98         3.34e-05      0.0724     1.27e-18   0.0280 4
#> SD:mclust 93         1.18e-05      0.0572     2.11e-19   0.0101 5
#> SD:mclust 99         3.41e-06      0.0900     1.47e-19   0.0315 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 21168 rows and 100 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.999           0.971       0.987         0.4949 0.505   0.505
#> 3 3 0.926           0.915       0.959         0.3180 0.787   0.600
#> 4 4 0.614           0.570       0.755         0.1373 0.805   0.505
#> 5 5 0.599           0.528       0.738         0.0717 0.842   0.474
#> 6 6 0.631           0.528       0.722         0.0448 0.840   0.392

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97038     2  0.0000      0.983 0.000 1.000
#> GSM97045     2  0.0000      0.983 0.000 1.000
#> GSM97047     2  0.0000      0.983 0.000 1.000
#> GSM97025     2  0.0000      0.983 0.000 1.000
#> GSM97030     2  0.0000      0.983 0.000 1.000
#> GSM97027     2  0.0000      0.983 0.000 1.000
#> GSM97033     2  0.0000      0.983 0.000 1.000
#> GSM97034     2  0.0000      0.983 0.000 1.000
#> GSM97020     2  0.0000      0.983 0.000 1.000
#> GSM97026     2  0.0000      0.983 0.000 1.000
#> GSM97012     2  0.0000      0.983 0.000 1.000
#> GSM97015     2  0.0000      0.983 0.000 1.000
#> GSM97016     2  0.0000      0.983 0.000 1.000
#> GSM97017     1  0.0376      0.986 0.996 0.004
#> GSM97019     2  0.0000      0.983 0.000 1.000
#> GSM97022     2  0.0000      0.983 0.000 1.000
#> GSM97035     2  0.0000      0.983 0.000 1.000
#> GSM97036     1  0.1414      0.974 0.980 0.020
#> GSM97039     2  0.0000      0.983 0.000 1.000
#> GSM97046     2  0.0000      0.983 0.000 1.000
#> GSM97023     1  0.0000      0.989 1.000 0.000
#> GSM97029     1  0.2043      0.963 0.968 0.032
#> GSM97043     2  0.0000      0.983 0.000 1.000
#> GSM97013     1  0.0000      0.989 1.000 0.000
#> GSM96956     2  0.0000      0.983 0.000 1.000
#> GSM97024     2  0.0000      0.983 0.000 1.000
#> GSM97032     2  0.0000      0.983 0.000 1.000
#> GSM97044     2  0.0000      0.983 0.000 1.000
#> GSM97049     2  0.0000      0.983 0.000 1.000
#> GSM96968     1  0.7883      0.695 0.764 0.236
#> GSM96971     1  0.0000      0.989 1.000 0.000
#> GSM96986     1  0.0000      0.989 1.000 0.000
#> GSM97003     1  0.0000      0.989 1.000 0.000
#> GSM96957     1  0.0938      0.981 0.988 0.012
#> GSM96960     1  0.0000      0.989 1.000 0.000
#> GSM96975     1  0.0000      0.989 1.000 0.000
#> GSM96998     1  0.0000      0.989 1.000 0.000
#> GSM96999     1  0.0000      0.989 1.000 0.000
#> GSM97001     1  0.0000      0.989 1.000 0.000
#> GSM97005     1  0.0000      0.989 1.000 0.000
#> GSM97006     1  0.0000      0.989 1.000 0.000
#> GSM97021     1  0.0376      0.986 0.996 0.004
#> GSM97028     2  0.9686      0.346 0.396 0.604
#> GSM97031     1  0.0000      0.989 1.000 0.000
#> GSM97037     2  0.0000      0.983 0.000 1.000
#> GSM97018     2  0.0000      0.983 0.000 1.000
#> GSM97014     2  0.0000      0.983 0.000 1.000
#> GSM97042     2  0.0000      0.983 0.000 1.000
#> GSM97040     2  0.1843      0.960 0.028 0.972
#> GSM97041     1  0.2236      0.960 0.964 0.036
#> GSM96955     2  0.0000      0.983 0.000 1.000
#> GSM96990     2  0.0000      0.983 0.000 1.000
#> GSM96991     2  0.0000      0.983 0.000 1.000
#> GSM97048     2  0.0000      0.983 0.000 1.000
#> GSM96963     2  0.0000      0.983 0.000 1.000
#> GSM96953     2  0.0000      0.983 0.000 1.000
#> GSM96966     1  0.0000      0.989 1.000 0.000
#> GSM96979     1  0.0000      0.989 1.000 0.000
#> GSM96983     2  0.0000      0.983 0.000 1.000
#> GSM96984     1  0.1414      0.974 0.980 0.020
#> GSM96994     2  0.0000      0.983 0.000 1.000
#> GSM96996     1  0.0000      0.989 1.000 0.000
#> GSM96997     1  0.0000      0.989 1.000 0.000
#> GSM97007     2  0.4815      0.881 0.104 0.896
#> GSM96954     1  0.0000      0.989 1.000 0.000
#> GSM96962     1  0.0000      0.989 1.000 0.000
#> GSM96969     1  0.0000      0.989 1.000 0.000
#> GSM96970     1  0.0000      0.989 1.000 0.000
#> GSM96973     1  0.0000      0.989 1.000 0.000
#> GSM96976     2  0.4022      0.909 0.080 0.920
#> GSM96977     1  0.0000      0.989 1.000 0.000
#> GSM96995     2  0.3879      0.914 0.076 0.924
#> GSM97002     1  0.0000      0.989 1.000 0.000
#> GSM97009     2  0.0000      0.983 0.000 1.000
#> GSM97010     1  0.0376      0.986 0.996 0.004
#> GSM96974     1  0.0000      0.989 1.000 0.000
#> GSM96985     1  0.0000      0.989 1.000 0.000
#> GSM96959     2  0.0000      0.983 0.000 1.000
#> GSM96972     1  0.0000      0.989 1.000 0.000
#> GSM96978     1  0.6712      0.790 0.824 0.176
#> GSM96967     1  0.0000      0.989 1.000 0.000
#> GSM96987     1  0.0000      0.989 1.000 0.000
#> GSM97011     1  0.3274      0.935 0.940 0.060
#> GSM96964     1  0.0000      0.989 1.000 0.000
#> GSM96965     1  0.0376      0.986 0.996 0.004
#> GSM96981     1  0.0000      0.989 1.000 0.000
#> GSM96982     1  0.0000      0.989 1.000 0.000
#> GSM96988     1  0.0000      0.989 1.000 0.000
#> GSM97000     1  0.0000      0.989 1.000 0.000
#> GSM97004     1  0.0000      0.989 1.000 0.000
#> GSM97008     1  0.0000      0.989 1.000 0.000
#> GSM96950     1  0.0000      0.989 1.000 0.000
#> GSM96980     1  0.0000      0.989 1.000 0.000
#> GSM96989     1  0.0000      0.989 1.000 0.000
#> GSM96992     1  0.0000      0.989 1.000 0.000
#> GSM96993     1  0.0672      0.984 0.992 0.008
#> GSM96958     1  0.0000      0.989 1.000 0.000
#> GSM96951     1  0.0000      0.989 1.000 0.000
#> GSM96952     1  0.0000      0.989 1.000 0.000
#> GSM96961     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
#> GSM97038     2  0.0424     0.9497 0.000 0.992 0.008
#> GSM97045     2  0.0237     0.9479 0.004 0.996 0.000
#> GSM97047     2  0.0237     0.9479 0.004 0.996 0.000
#> GSM97025     2  0.0237     0.9479 0.004 0.996 0.000
#> GSM97030     3  0.3340     0.8564 0.000 0.120 0.880
#> GSM97027     2  0.0237     0.9479 0.004 0.996 0.000
#> GSM97033     2  0.0237     0.9479 0.004 0.996 0.000
#> GSM97034     3  0.3412     0.8518 0.000 0.124 0.876
#> GSM97020     2  0.0237     0.9479 0.004 0.996 0.000
#> GSM97026     2  0.0424     0.9452 0.008 0.992 0.000
#> GSM97012     2  0.0424     0.9497 0.000 0.992 0.008
#> GSM97015     3  0.3941     0.8168 0.000 0.156 0.844
#> GSM97016     2  0.0424     0.9497 0.000 0.992 0.008
#> GSM97017     1  0.2356     0.9338 0.928 0.072 0.000
#> GSM97019     2  0.0424     0.9497 0.000 0.992 0.008
#> GSM97022     2  0.0592     0.9476 0.000 0.988 0.012
#> GSM97035     2  0.0592     0.9476 0.000 0.988 0.012
#> GSM97036     1  0.2796     0.9154 0.908 0.092 0.000
#> GSM97039     2  0.0424     0.9497 0.000 0.992 0.008
#> GSM97046     2  0.0424     0.9497 0.000 0.992 0.008
#> GSM97023     1  0.0000     0.9721 1.000 0.000 0.000
#> GSM97029     1  0.2878     0.9116 0.904 0.096 0.000
#> GSM97043     2  0.0424     0.9497 0.000 0.992 0.008
#> GSM97013     1  0.1529     0.9568 0.960 0.040 0.000
#> GSM96956     2  0.6280     0.0848 0.000 0.540 0.460
#> GSM97024     2  0.1031     0.9388 0.000 0.976 0.024
#> GSM97032     2  0.6309    -0.0635 0.000 0.504 0.496
#> GSM97044     3  0.1411     0.9212 0.000 0.036 0.964
#> GSM97049     2  0.0237     0.9479 0.004 0.996 0.000
#> GSM96968     3  0.0592     0.9322 0.012 0.000 0.988
#> GSM96971     3  0.0237     0.9345 0.004 0.000 0.996
#> GSM96986     3  0.0424     0.9335 0.008 0.000 0.992
#> GSM97003     1  0.3941     0.8401 0.844 0.000 0.156
#> GSM96957     1  0.1860     0.9498 0.948 0.052 0.000
#> GSM96960     1  0.1753     0.9525 0.952 0.000 0.048
#> GSM96975     1  0.0237     0.9716 0.996 0.004 0.000
#> GSM96998     1  0.0000     0.9721 1.000 0.000 0.000
#> GSM96999     1  0.0424     0.9708 0.992 0.008 0.000
#> GSM97001     1  0.1753     0.9519 0.952 0.048 0.000
#> GSM97005     1  0.0424     0.9708 0.992 0.008 0.000
#> GSM97006     1  0.0747     0.9697 0.984 0.000 0.016
#> GSM97021     1  0.0747     0.9684 0.984 0.016 0.000
#> GSM97028     3  0.0237     0.9354 0.000 0.004 0.996
#> GSM97031     1  0.2261     0.9362 0.932 0.000 0.068
#> GSM97037     2  0.3879     0.7940 0.000 0.848 0.152
#> GSM97018     3  0.5948     0.4685 0.000 0.360 0.640
#> GSM97014     2  0.1031     0.9312 0.024 0.976 0.000
#> GSM97042     2  0.0424     0.9497 0.000 0.992 0.008
#> GSM97040     2  0.1753     0.9055 0.048 0.952 0.000
#> GSM97041     1  0.3340     0.8866 0.880 0.120 0.000
#> GSM96955     2  0.0237     0.9494 0.000 0.996 0.004
#> GSM96990     3  0.5968     0.4572 0.000 0.364 0.636
#> GSM96991     2  0.0424     0.9497 0.000 0.992 0.008
#> GSM97048     2  0.0237     0.9479 0.004 0.996 0.000
#> GSM96963     2  0.0424     0.9497 0.000 0.992 0.008
#> GSM96953     2  0.0424     0.9497 0.000 0.992 0.008
#> GSM96966     1  0.0747     0.9697 0.984 0.000 0.016
#> GSM96979     3  0.0592     0.9321 0.012 0.000 0.988
#> GSM96983     3  0.0237     0.9354 0.000 0.004 0.996
#> GSM96984     3  0.0237     0.9354 0.000 0.004 0.996
#> GSM96994     3  0.0237     0.9354 0.000 0.004 0.996
#> GSM96996     1  0.0237     0.9721 0.996 0.000 0.004
#> GSM96997     3  0.0424     0.9335 0.008 0.000 0.992
#> GSM97007     3  0.0237     0.9354 0.000 0.004 0.996
#> GSM96954     3  0.1289     0.9177 0.032 0.000 0.968
#> GSM96962     3  0.0237     0.9354 0.000 0.004 0.996
#> GSM96969     1  0.1529     0.9575 0.960 0.000 0.040
#> GSM96970     1  0.0747     0.9697 0.984 0.000 0.016
#> GSM96973     1  0.1753     0.9525 0.952 0.000 0.048
#> GSM96976     3  0.1163     0.9272 0.000 0.028 0.972
#> GSM96977     1  0.0237     0.9724 0.996 0.000 0.004
#> GSM96995     3  0.2066     0.9064 0.000 0.060 0.940
#> GSM97002     1  0.0424     0.9717 0.992 0.000 0.008
#> GSM97009     2  0.0237     0.9479 0.004 0.996 0.000
#> GSM97010     1  0.0848     0.9710 0.984 0.008 0.008
#> GSM96974     3  0.0592     0.9323 0.012 0.000 0.988
#> GSM96985     3  0.0892     0.9272 0.020 0.000 0.980
#> GSM96959     2  0.1411     0.9293 0.000 0.964 0.036
#> GSM96972     1  0.1031     0.9663 0.976 0.000 0.024
#> GSM96978     3  0.0237     0.9354 0.000 0.004 0.996
#> GSM96967     1  0.1411     0.9599 0.964 0.000 0.036
#> GSM96987     1  0.0424     0.9708 0.992 0.008 0.000
#> GSM97011     1  0.2066     0.9437 0.940 0.060 0.000
#> GSM96964     1  0.0000     0.9721 1.000 0.000 0.000
#> GSM96965     1  0.1989     0.9523 0.948 0.048 0.004
#> GSM96981     1  0.0000     0.9721 1.000 0.000 0.000
#> GSM96982     1  0.0592     0.9709 0.988 0.000 0.012
#> GSM96988     3  0.0424     0.9335 0.008 0.000 0.992
#> GSM97000     1  0.0592     0.9712 0.988 0.000 0.012
#> GSM97004     1  0.0592     0.9709 0.988 0.000 0.012
#> GSM97008     1  0.0424     0.9708 0.992 0.008 0.000
#> GSM96950     1  0.0424     0.9708 0.992 0.008 0.000
#> GSM96980     1  0.0424     0.9717 0.992 0.000 0.008
#> GSM96989     1  0.0000     0.9721 1.000 0.000 0.000
#> GSM96992     1  0.0237     0.9721 0.996 0.000 0.004
#> GSM96993     1  0.1411     0.9598 0.964 0.036 0.000
#> GSM96958     1  0.0237     0.9721 0.996 0.000 0.004
#> GSM96951     1  0.0237     0.9721 0.996 0.000 0.004
#> GSM96952     1  0.0237     0.9721 0.996 0.000 0.004
#> GSM96961     1  0.0237     0.9721 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
#> GSM97038     2  0.4535     0.8197 0.292 0.704 0.004 0.000
#> GSM97045     2  0.4643     0.8022 0.344 0.656 0.000 0.000
#> GSM97047     1  0.5088    -0.5031 0.572 0.424 0.004 0.000
#> GSM97025     2  0.4454     0.8154 0.308 0.692 0.000 0.000
#> GSM97030     3  0.1118     0.8736 0.000 0.036 0.964 0.000
#> GSM97027     2  0.4800     0.8032 0.340 0.656 0.004 0.000
#> GSM97033     2  0.4761     0.8074 0.332 0.664 0.004 0.000
#> GSM97034     3  0.2867     0.8419 0.012 0.104 0.884 0.000
#> GSM97020     2  0.4643     0.8022 0.344 0.656 0.000 0.000
#> GSM97026     2  0.4804     0.7551 0.384 0.616 0.000 0.000
#> GSM97012     2  0.1520     0.7475 0.020 0.956 0.000 0.024
#> GSM97015     3  0.2227     0.8692 0.036 0.036 0.928 0.000
#> GSM97016     2  0.4594     0.8209 0.280 0.712 0.008 0.000
#> GSM97017     1  0.3647     0.5424 0.832 0.016 0.000 0.152
#> GSM97019     2  0.3208     0.8075 0.148 0.848 0.004 0.000
#> GSM97022     2  0.2124     0.7852 0.068 0.924 0.008 0.000
#> GSM97035     2  0.1824     0.7830 0.060 0.936 0.004 0.000
#> GSM97036     4  0.6665     0.1908 0.360 0.096 0.000 0.544
#> GSM97039     2  0.4655     0.8144 0.312 0.684 0.004 0.000
#> GSM97046     2  0.4008     0.8210 0.244 0.756 0.000 0.000
#> GSM97023     1  0.4866     0.3213 0.596 0.000 0.000 0.404
#> GSM97029     1  0.4610     0.5062 0.744 0.020 0.000 0.236
#> GSM97043     2  0.4382     0.8194 0.296 0.704 0.000 0.000
#> GSM97013     1  0.4516     0.4983 0.736 0.012 0.000 0.252
#> GSM96956     2  0.5413     0.5107 0.048 0.712 0.236 0.004
#> GSM97024     2  0.4501     0.8181 0.212 0.764 0.024 0.000
#> GSM97032     3  0.6421     0.2875 0.076 0.368 0.556 0.000
#> GSM97044     3  0.0927     0.8779 0.008 0.016 0.976 0.000
#> GSM97049     2  0.4624     0.8043 0.340 0.660 0.000 0.000
#> GSM96968     3  0.1109     0.8739 0.028 0.000 0.968 0.004
#> GSM96971     3  0.4341     0.7994 0.024 0.020 0.820 0.136
#> GSM96986     3  0.0895     0.8752 0.020 0.000 0.976 0.004
#> GSM97003     3  0.7544     0.0189 0.200 0.000 0.460 0.340
#> GSM96957     1  0.1767     0.5296 0.944 0.044 0.000 0.012
#> GSM96960     4  0.4054     0.5709 0.188 0.000 0.016 0.796
#> GSM96975     4  0.4998    -0.0549 0.488 0.000 0.000 0.512
#> GSM96998     4  0.4761     0.3088 0.372 0.000 0.000 0.628
#> GSM96999     1  0.4888     0.3082 0.588 0.000 0.000 0.412
#> GSM97001     1  0.2300     0.5346 0.924 0.048 0.000 0.028
#> GSM97005     1  0.5300     0.4377 0.664 0.000 0.028 0.308
#> GSM97006     4  0.5040     0.3209 0.364 0.000 0.008 0.628
#> GSM97021     1  0.2814     0.5499 0.908 0.008 0.032 0.052
#> GSM97028     3  0.1593     0.8783 0.016 0.024 0.956 0.004
#> GSM97031     1  0.6557     0.1308 0.476 0.000 0.448 0.076
#> GSM97037     2  0.6400     0.7062 0.168 0.652 0.180 0.000
#> GSM97018     2  0.5626     0.1861 0.024 0.612 0.360 0.004
#> GSM97014     1  0.4907    -0.4816 0.580 0.420 0.000 0.000
#> GSM97042     2  0.1042     0.7429 0.008 0.972 0.000 0.020
#> GSM97040     1  0.2334     0.4674 0.908 0.088 0.000 0.004
#> GSM97041     1  0.2363     0.5296 0.920 0.056 0.000 0.024
#> GSM96955     2  0.4008     0.7700 0.148 0.820 0.000 0.032
#> GSM96990     3  0.3803     0.7972 0.032 0.132 0.836 0.000
#> GSM96991     2  0.2660     0.6970 0.024 0.916 0.012 0.048
#> GSM97048     2  0.4781     0.8060 0.336 0.660 0.004 0.000
#> GSM96963     2  0.1545     0.7247 0.008 0.952 0.000 0.040
#> GSM96953     2  0.1398     0.7729 0.040 0.956 0.004 0.000
#> GSM96966     4  0.0927     0.6392 0.016 0.008 0.000 0.976
#> GSM96979     3  0.3606     0.8159 0.008 0.020 0.856 0.116
#> GSM96983     3  0.2099     0.8661 0.012 0.044 0.936 0.008
#> GSM96984     3  0.0188     0.8771 0.000 0.000 0.996 0.004
#> GSM96994     3  0.0524     0.8769 0.008 0.000 0.988 0.004
#> GSM96996     4  0.3444     0.5768 0.184 0.000 0.000 0.816
#> GSM96997     3  0.0779     0.8758 0.016 0.000 0.980 0.004
#> GSM97007     3  0.0188     0.8771 0.000 0.000 0.996 0.004
#> GSM96954     3  0.2799     0.8209 0.108 0.000 0.884 0.008
#> GSM96962     3  0.0657     0.8765 0.012 0.000 0.984 0.004
#> GSM96969     4  0.1305     0.6460 0.036 0.000 0.004 0.960
#> GSM96970     4  0.0469     0.6315 0.000 0.012 0.000 0.988
#> GSM96973     4  0.1824     0.6004 0.004 0.060 0.000 0.936
#> GSM96976     4  0.6473     0.0561 0.024 0.472 0.028 0.476
#> GSM96977     1  0.5953     0.4404 0.656 0.000 0.076 0.268
#> GSM96995     3  0.1635     0.8689 0.044 0.008 0.948 0.000
#> GSM97002     4  0.2149     0.6401 0.088 0.000 0.000 0.912
#> GSM97009     2  0.5097     0.7196 0.428 0.568 0.004 0.000
#> GSM97010     4  0.2412     0.6435 0.084 0.008 0.000 0.908
#> GSM96974     4  0.6510     0.3461 0.024 0.320 0.048 0.608
#> GSM96985     4  0.6358     0.3551 0.024 0.320 0.040 0.616
#> GSM96959     3  0.6005     0.5333 0.324 0.060 0.616 0.000
#> GSM96972     4  0.1452     0.6458 0.036 0.000 0.008 0.956
#> GSM96978     3  0.5881     0.7068 0.020 0.200 0.716 0.064
#> GSM96967     4  0.0592     0.6293 0.000 0.016 0.000 0.984
#> GSM96987     4  0.4948     0.1258 0.440 0.000 0.000 0.560
#> GSM97011     1  0.2908     0.5466 0.896 0.040 0.000 0.064
#> GSM96964     1  0.4933     0.2642 0.568 0.000 0.000 0.432
#> GSM96965     4  0.3157     0.5404 0.004 0.144 0.000 0.852
#> GSM96981     4  0.4477     0.4177 0.312 0.000 0.000 0.688
#> GSM96982     4  0.2011     0.6443 0.080 0.000 0.000 0.920
#> GSM96988     3  0.3529     0.8467 0.012 0.068 0.876 0.044
#> GSM97000     1  0.5404     0.2780 0.600 0.004 0.384 0.012
#> GSM97004     4  0.1716     0.6467 0.064 0.000 0.000 0.936
#> GSM97008     1  0.5011     0.5048 0.764 0.000 0.160 0.076
#> GSM96950     1  0.4967     0.2024 0.548 0.000 0.000 0.452
#> GSM96980     4  0.1474     0.6474 0.052 0.000 0.000 0.948
#> GSM96989     4  0.4925     0.1742 0.428 0.000 0.000 0.572
#> GSM96992     4  0.4961     0.1068 0.448 0.000 0.000 0.552
#> GSM96993     1  0.5252     0.4129 0.644 0.020 0.000 0.336
#> GSM96958     1  0.4925     0.2722 0.572 0.000 0.000 0.428
#> GSM96951     1  0.5728     0.3530 0.600 0.000 0.036 0.364
#> GSM96952     4  0.4977     0.0603 0.460 0.000 0.000 0.540
#> GSM96961     1  0.4972     0.1953 0.544 0.000 0.000 0.456

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97038     2  0.0566     0.6871 0.012 0.984 0.000 0.000 0.004
#> GSM97045     2  0.4150     0.5054 0.036 0.748 0.000 0.000 0.216
#> GSM97047     2  0.5514     0.4481 0.292 0.628 0.012 0.000 0.068
#> GSM97025     2  0.4812     0.1233 0.028 0.600 0.000 0.000 0.372
#> GSM97030     3  0.2295     0.7558 0.000 0.008 0.900 0.004 0.088
#> GSM97027     2  0.4240     0.4910 0.036 0.736 0.000 0.000 0.228
#> GSM97033     2  0.0671     0.6896 0.004 0.980 0.000 0.000 0.016
#> GSM97034     5  0.5470     0.4194 0.040 0.020 0.340 0.000 0.600
#> GSM97020     2  0.0703     0.6878 0.000 0.976 0.000 0.000 0.024
#> GSM97026     5  0.6066     0.4637 0.188 0.240 0.000 0.000 0.572
#> GSM97012     5  0.4444     0.4947 0.000 0.364 0.000 0.012 0.624
#> GSM97015     3  0.3996     0.6965 0.044 0.016 0.808 0.000 0.132
#> GSM97016     2  0.1043     0.6811 0.000 0.960 0.000 0.000 0.040
#> GSM97017     1  0.3379     0.6823 0.860 0.040 0.000 0.024 0.076
#> GSM97019     5  0.4309     0.5927 0.016 0.308 0.000 0.000 0.676
#> GSM97022     5  0.4402     0.5193 0.004 0.372 0.000 0.004 0.620
#> GSM97035     2  0.4448    -0.2012 0.000 0.516 0.000 0.004 0.480
#> GSM97036     1  0.5877     0.4792 0.596 0.008 0.000 0.108 0.288
#> GSM97039     2  0.0703     0.6873 0.000 0.976 0.000 0.000 0.024
#> GSM97046     2  0.1121     0.6804 0.000 0.956 0.000 0.000 0.044
#> GSM97023     1  0.3112     0.6794 0.856 0.000 0.000 0.100 0.044
#> GSM97029     1  0.3964     0.6389 0.796 0.032 0.000 0.012 0.160
#> GSM97043     5  0.5006     0.5962 0.048 0.272 0.008 0.000 0.672
#> GSM97013     1  0.6147     0.6313 0.668 0.132 0.000 0.128 0.072
#> GSM96956     2  0.4796     0.4772 0.000 0.740 0.164 0.008 0.088
#> GSM97024     5  0.5220     0.5029 0.020 0.380 0.020 0.000 0.580
#> GSM97032     5  0.6052     0.5808 0.028 0.100 0.252 0.000 0.620
#> GSM97044     3  0.2389     0.7428 0.004 0.000 0.880 0.000 0.116
#> GSM97049     2  0.0000     0.6889 0.000 1.000 0.000 0.000 0.000
#> GSM96968     3  0.0932     0.7805 0.000 0.004 0.972 0.004 0.020
#> GSM96971     4  0.4449    -0.1104 0.004 0.000 0.484 0.512 0.000
#> GSM96986     3  0.2170     0.7578 0.036 0.000 0.924 0.020 0.020
#> GSM97003     3  0.6717     0.1930 0.136 0.000 0.508 0.328 0.028
#> GSM96957     1  0.5619     0.4393 0.592 0.336 0.016 0.000 0.056
#> GSM96960     4  0.5686     0.4589 0.284 0.000 0.024 0.628 0.064
#> GSM96975     1  0.6089     0.1778 0.500 0.012 0.000 0.400 0.088
#> GSM96998     1  0.5474     0.3730 0.576 0.000 0.000 0.348 0.076
#> GSM96999     1  0.4739     0.5748 0.704 0.008 0.008 0.256 0.024
#> GSM97001     1  0.6355     0.3256 0.536 0.360 0.012 0.020 0.072
#> GSM97005     1  0.5377     0.6397 0.760 0.032 0.048 0.096 0.064
#> GSM97006     4  0.5732    -0.0601 0.464 0.000 0.016 0.472 0.048
#> GSM97021     1  0.3359     0.6663 0.868 0.028 0.036 0.004 0.064
#> GSM97028     5  0.4953     0.1049 0.028 0.000 0.440 0.000 0.532
#> GSM97031     3  0.6179     0.3795 0.312 0.000 0.580 0.052 0.056
#> GSM97037     2  0.6977    -0.2747 0.012 0.420 0.232 0.000 0.336
#> GSM97018     5  0.5213     0.6036 0.020 0.072 0.204 0.000 0.704
#> GSM97014     2  0.4068     0.5811 0.144 0.792 0.000 0.004 0.060
#> GSM97042     5  0.4232     0.5759 0.000 0.312 0.000 0.012 0.676
#> GSM97040     1  0.5065     0.5840 0.732 0.172 0.016 0.004 0.076
#> GSM97041     1  0.3559     0.6674 0.836 0.096 0.000 0.004 0.064
#> GSM96955     2  0.5591     0.4969 0.040 0.656 0.000 0.048 0.256
#> GSM96990     3  0.5733     0.2620 0.016 0.064 0.584 0.000 0.336
#> GSM96991     5  0.3690     0.6157 0.000 0.200 0.000 0.020 0.780
#> GSM97048     2  0.0000     0.6889 0.000 1.000 0.000 0.000 0.000
#> GSM96963     5  0.4506     0.5463 0.000 0.296 0.000 0.028 0.676
#> GSM96953     2  0.4118     0.3159 0.000 0.660 0.000 0.004 0.336
#> GSM96966     4  0.0671     0.7050 0.016 0.000 0.000 0.980 0.004
#> GSM96979     3  0.4326     0.5931 0.000 0.000 0.708 0.264 0.028
#> GSM96983     3  0.2929     0.7198 0.000 0.000 0.840 0.008 0.152
#> GSM96984     3  0.0798     0.7798 0.000 0.000 0.976 0.008 0.016
#> GSM96994     3  0.1168     0.7772 0.000 0.000 0.960 0.008 0.032
#> GSM96996     4  0.5524     0.1342 0.416 0.000 0.000 0.516 0.068
#> GSM96997     3  0.0968     0.7752 0.012 0.000 0.972 0.004 0.012
#> GSM97007     3  0.0955     0.7781 0.000 0.000 0.968 0.004 0.028
#> GSM96954     3  0.1956     0.7622 0.076 0.000 0.916 0.000 0.008
#> GSM96962     3  0.0566     0.7793 0.000 0.000 0.984 0.004 0.012
#> GSM96969     4  0.0771     0.7047 0.020 0.000 0.000 0.976 0.004
#> GSM96970     4  0.0798     0.7044 0.016 0.000 0.000 0.976 0.008
#> GSM96973     4  0.0566     0.7000 0.000 0.000 0.004 0.984 0.012
#> GSM96976     4  0.4640     0.5701 0.000 0.076 0.016 0.764 0.144
#> GSM96977     1  0.3700     0.6777 0.840 0.000 0.020 0.060 0.080
#> GSM96995     3  0.2209     0.7665 0.056 0.000 0.912 0.000 0.032
#> GSM97002     4  0.5192     0.4644 0.280 0.000 0.000 0.644 0.076
#> GSM97009     2  0.3682     0.6146 0.096 0.832 0.000 0.008 0.064
#> GSM97010     4  0.5177     0.6125 0.044 0.172 0.008 0.736 0.040
#> GSM96974     4  0.3720     0.5665 0.000 0.000 0.012 0.760 0.228
#> GSM96985     4  0.4954     0.2933 0.004 0.000 0.020 0.528 0.448
#> GSM96959     2  0.7537     0.2652 0.172 0.484 0.272 0.004 0.068
#> GSM96972     4  0.1728     0.6990 0.036 0.000 0.004 0.940 0.020
#> GSM96978     3  0.5606     0.3571 0.000 0.000 0.568 0.088 0.344
#> GSM96967     4  0.0807     0.7052 0.012 0.000 0.000 0.976 0.012
#> GSM96987     1  0.4934     0.5946 0.708 0.000 0.000 0.188 0.104
#> GSM97011     1  0.6601     0.0248 0.448 0.436 0.008 0.028 0.080
#> GSM96964     1  0.4016     0.6568 0.796 0.000 0.000 0.112 0.092
#> GSM96965     4  0.1990     0.6902 0.004 0.040 0.000 0.928 0.028
#> GSM96981     4  0.5744     0.2085 0.380 0.000 0.000 0.528 0.092
#> GSM96982     4  0.5112     0.5102 0.256 0.000 0.000 0.664 0.080
#> GSM96988     5  0.4920     0.1784 0.012 0.000 0.404 0.012 0.572
#> GSM97000     3  0.6783     0.2846 0.344 0.036 0.528 0.020 0.072
#> GSM97004     4  0.4865     0.5147 0.252 0.000 0.000 0.684 0.064
#> GSM97008     1  0.6411     0.5530 0.672 0.104 0.132 0.016 0.076
#> GSM96950     1  0.4307     0.6467 0.772 0.000 0.000 0.128 0.100
#> GSM96980     4  0.2580     0.6861 0.064 0.000 0.000 0.892 0.044
#> GSM96989     1  0.4914     0.5926 0.712 0.000 0.000 0.180 0.108
#> GSM96992     1  0.4960     0.5251 0.680 0.000 0.008 0.264 0.048
#> GSM96993     1  0.4087     0.6403 0.784 0.008 0.000 0.040 0.168
#> GSM96958     1  0.4681     0.6354 0.748 0.000 0.016 0.180 0.056
#> GSM96951     1  0.3872     0.6720 0.836 0.000 0.064 0.060 0.040
#> GSM96952     1  0.4602     0.5609 0.708 0.000 0.000 0.240 0.052
#> GSM96961     1  0.3975     0.6534 0.792 0.000 0.000 0.144 0.064

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     3  0.1760     0.7756 0.000 0.020 0.928 0.004 0.048 0.000
#> GSM97045     2  0.6946     0.3382 0.052 0.384 0.364 0.008 0.192 0.000
#> GSM97047     5  0.4683     0.5145 0.036 0.032 0.212 0.000 0.712 0.008
#> GSM97025     2  0.6191     0.5116 0.052 0.524 0.320 0.004 0.100 0.000
#> GSM97030     6  0.2101     0.7589 0.008 0.072 0.000 0.008 0.004 0.908
#> GSM97027     2  0.6736     0.3554 0.056 0.408 0.376 0.004 0.156 0.000
#> GSM97033     3  0.2680     0.7076 0.000 0.076 0.868 0.000 0.056 0.000
#> GSM97034     2  0.5902     0.3531 0.072 0.576 0.004 0.004 0.048 0.296
#> GSM97020     3  0.1750     0.7727 0.012 0.040 0.932 0.000 0.016 0.000
#> GSM97026     2  0.6280     0.4516 0.340 0.520 0.072 0.004 0.052 0.012
#> GSM97012     2  0.3736     0.6434 0.000 0.788 0.160 0.020 0.032 0.000
#> GSM97015     6  0.3672     0.7197 0.028 0.140 0.004 0.004 0.016 0.808
#> GSM97016     3  0.0713     0.7945 0.000 0.028 0.972 0.000 0.000 0.000
#> GSM97017     5  0.4609     0.4909 0.352 0.016 0.024 0.000 0.608 0.000
#> GSM97019     2  0.4374     0.6604 0.024 0.768 0.136 0.004 0.064 0.004
#> GSM97022     2  0.4887     0.6485 0.020 0.716 0.188 0.012 0.060 0.004
#> GSM97035     2  0.4508     0.5845 0.000 0.668 0.280 0.012 0.040 0.000
#> GSM97036     1  0.3100     0.5720 0.836 0.128 0.000 0.024 0.012 0.000
#> GSM97039     3  0.0777     0.7951 0.000 0.024 0.972 0.000 0.004 0.000
#> GSM97046     3  0.0508     0.7974 0.000 0.012 0.984 0.004 0.000 0.000
#> GSM97023     1  0.3275     0.5983 0.828 0.008 0.000 0.044 0.120 0.000
#> GSM97029     1  0.5141     0.3362 0.660 0.200 0.016 0.000 0.124 0.000
#> GSM97043     2  0.5374     0.6337 0.104 0.712 0.120 0.004 0.036 0.024
#> GSM97013     1  0.4526     0.5567 0.744 0.004 0.156 0.072 0.024 0.000
#> GSM96956     3  0.2201     0.7422 0.000 0.028 0.896 0.000 0.000 0.076
#> GSM97024     2  0.5874     0.6355 0.032 0.648 0.176 0.000 0.112 0.032
#> GSM97032     2  0.5587     0.3259 0.056 0.584 0.028 0.004 0.008 0.320
#> GSM97044     6  0.2642     0.7425 0.012 0.116 0.000 0.004 0.004 0.864
#> GSM97049     3  0.0000     0.7977 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM96968     6  0.1843     0.7668 0.008 0.040 0.004 0.004 0.012 0.932
#> GSM96971     4  0.4823     0.2780 0.000 0.012 0.000 0.600 0.044 0.344
#> GSM96986     6  0.3291     0.7431 0.008 0.012 0.000 0.060 0.072 0.848
#> GSM97003     6  0.7082     0.1821 0.044 0.028 0.000 0.280 0.192 0.456
#> GSM96957     3  0.5118     0.3242 0.148 0.004 0.640 0.000 0.208 0.000
#> GSM96960     1  0.7072     0.1789 0.388 0.028 0.000 0.384 0.152 0.048
#> GSM96975     5  0.5032     0.5011 0.120 0.008 0.004 0.196 0.672 0.000
#> GSM96998     1  0.3507     0.5901 0.764 0.012 0.000 0.216 0.008 0.000
#> GSM96999     1  0.6792     0.3150 0.484 0.016 0.020 0.144 0.316 0.020
#> GSM97001     5  0.4621     0.6164 0.128 0.000 0.140 0.012 0.720 0.000
#> GSM97005     5  0.4353     0.6054 0.164 0.004 0.000 0.060 0.752 0.020
#> GSM97006     1  0.6329     0.1826 0.452 0.024 0.000 0.412 0.068 0.044
#> GSM97021     5  0.4450     0.5508 0.264 0.028 0.016 0.000 0.688 0.004
#> GSM97028     2  0.5069    -0.2194 0.020 0.476 0.000 0.004 0.028 0.472
#> GSM97031     5  0.5554     0.1846 0.032 0.008 0.000 0.044 0.512 0.404
#> GSM97037     3  0.5216     0.2758 0.004 0.080 0.568 0.004 0.000 0.344
#> GSM97018     2  0.4502     0.4713 0.032 0.720 0.016 0.004 0.008 0.220
#> GSM97014     5  0.4578     0.2473 0.004 0.008 0.424 0.016 0.548 0.000
#> GSM97042     2  0.3390     0.6505 0.000 0.816 0.140 0.016 0.028 0.000
#> GSM97040     5  0.4495     0.6070 0.180 0.024 0.048 0.000 0.740 0.008
#> GSM97041     5  0.5452     0.4078 0.380 0.036 0.052 0.000 0.532 0.000
#> GSM96955     5  0.6970     0.2425 0.004 0.240 0.172 0.100 0.484 0.000
#> GSM96990     6  0.4452     0.6571 0.020 0.176 0.060 0.004 0.000 0.740
#> GSM96991     2  0.2867     0.6298 0.004 0.872 0.076 0.032 0.016 0.000
#> GSM97048     3  0.0146     0.7973 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM96963     2  0.4384     0.6143 0.004 0.764 0.140 0.040 0.052 0.000
#> GSM96953     2  0.5212     0.4776 0.000 0.572 0.348 0.020 0.060 0.000
#> GSM96966     4  0.1644     0.8042 0.052 0.004 0.000 0.932 0.012 0.000
#> GSM96979     6  0.4582     0.5010 0.012 0.020 0.000 0.280 0.016 0.672
#> GSM96983     6  0.4339     0.6374 0.004 0.216 0.000 0.012 0.044 0.724
#> GSM96984     6  0.1874     0.7695 0.008 0.012 0.000 0.020 0.028 0.932
#> GSM96994     6  0.2007     0.7736 0.008 0.016 0.000 0.012 0.040 0.924
#> GSM96996     1  0.6122     0.3007 0.492 0.028 0.000 0.376 0.088 0.016
#> GSM96997     6  0.3136     0.7449 0.008 0.024 0.000 0.052 0.052 0.864
#> GSM97007     6  0.1332     0.7738 0.008 0.000 0.000 0.012 0.028 0.952
#> GSM96954     6  0.2807     0.7581 0.016 0.028 0.000 0.000 0.088 0.868
#> GSM96962     6  0.1490     0.7730 0.008 0.004 0.000 0.016 0.024 0.948
#> GSM96969     4  0.1666     0.8059 0.036 0.008 0.000 0.936 0.020 0.000
#> GSM96970     4  0.1334     0.8052 0.032 0.000 0.000 0.948 0.020 0.000
#> GSM96973     4  0.0993     0.8058 0.024 0.000 0.000 0.964 0.012 0.000
#> GSM96976     4  0.3064     0.7305 0.004 0.092 0.004 0.860 0.024 0.016
#> GSM96977     5  0.5389     0.5236 0.268 0.016 0.004 0.040 0.640 0.032
#> GSM96995     6  0.3571     0.6426 0.000 0.020 0.004 0.000 0.216 0.760
#> GSM97002     1  0.6011     0.1091 0.452 0.036 0.000 0.432 0.068 0.012
#> GSM97009     5  0.5340     0.0405 0.012 0.020 0.448 0.020 0.492 0.008
#> GSM97010     3  0.5952     0.1989 0.028 0.024 0.540 0.360 0.016 0.032
#> GSM96974     4  0.3013     0.7377 0.008 0.116 0.000 0.848 0.004 0.024
#> GSM96985     2  0.6522    -0.1339 0.044 0.456 0.000 0.392 0.076 0.032
#> GSM96959     5  0.5182     0.5492 0.000 0.000 0.220 0.012 0.644 0.124
#> GSM96972     4  0.2587     0.7459 0.120 0.004 0.000 0.864 0.004 0.008
#> GSM96978     6  0.6585     0.3314 0.012 0.348 0.000 0.100 0.064 0.476
#> GSM96967     4  0.1668     0.7990 0.060 0.008 0.000 0.928 0.004 0.000
#> GSM96987     1  0.2002     0.6539 0.908 0.004 0.000 0.076 0.012 0.000
#> GSM97011     5  0.3230     0.6276 0.032 0.004 0.064 0.044 0.856 0.000
#> GSM96964     1  0.2152     0.6399 0.912 0.012 0.000 0.040 0.036 0.000
#> GSM96965     4  0.1823     0.7932 0.016 0.004 0.012 0.932 0.036 0.000
#> GSM96981     5  0.4988     0.4792 0.096 0.016 0.000 0.220 0.668 0.000
#> GSM96982     5  0.6339     0.0959 0.152 0.036 0.000 0.376 0.436 0.000
#> GSM96988     6  0.5679     0.1880 0.016 0.452 0.000 0.024 0.048 0.460
#> GSM97000     5  0.4409     0.5742 0.032 0.004 0.000 0.028 0.728 0.208
#> GSM97004     4  0.5072    -0.1738 0.472 0.024 0.000 0.476 0.024 0.004
#> GSM97008     5  0.2955     0.6229 0.084 0.000 0.016 0.016 0.868 0.016
#> GSM96950     1  0.2419     0.6398 0.896 0.016 0.000 0.060 0.028 0.000
#> GSM96980     4  0.4274     0.6126 0.200 0.024 0.000 0.736 0.040 0.000
#> GSM96989     1  0.1946     0.6534 0.912 0.004 0.000 0.072 0.012 0.000
#> GSM96992     1  0.6141     0.2224 0.444 0.016 0.000 0.176 0.364 0.000
#> GSM96993     1  0.2152     0.5755 0.904 0.068 0.000 0.004 0.024 0.000
#> GSM96958     5  0.5011     0.2440 0.392 0.000 0.000 0.064 0.540 0.004
#> GSM96951     5  0.4710     0.3790 0.360 0.000 0.000 0.024 0.596 0.020
#> GSM96952     1  0.5724     0.3969 0.560 0.020 0.000 0.128 0.292 0.000
#> GSM96961     1  0.3931     0.5595 0.756 0.008 0.000 0.044 0.192 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-NMF-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-NMF-collect-classes

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

test_to_known_factors(res)
#>         n disease.state(p) specimen(p) cell.type(p) other(p) k
#> SD:NMF 99         1.61e-05      0.1658     3.04e-14   0.1381 2
#> SD:NMF 96         3.56e-05      0.1686     1.18e-17   0.0543 3
#> SD:NMF 69         3.15e-04      0.0933     6.59e-12   0.0395 4
#> SD:NMF 68         3.97e-03      0.2354     2.68e-14   0.0454 5
#> SD:NMF 65         4.40e-03      0.4976     7.36e-13   0.0693 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 21168 rows and 100 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.318           0.647       0.841         0.4340 0.560   0.560
#> 3 3 0.391           0.699       0.817         0.4231 0.776   0.617
#> 4 4 0.522           0.729       0.830         0.1307 0.907   0.763
#> 5 5 0.575           0.676       0.773         0.0671 1.000   1.000
#> 6 6 0.607           0.579       0.741         0.0594 0.893   0.656

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
#> GSM97038     2  0.2236     0.7873 0.036 0.964
#> GSM97045     2  0.2603     0.7843 0.044 0.956
#> GSM97047     1  0.9209     0.5626 0.664 0.336
#> GSM97025     2  0.2603     0.7843 0.044 0.956
#> GSM97030     2  0.9833     0.1949 0.424 0.576
#> GSM97027     2  0.2423     0.7851 0.040 0.960
#> GSM97033     2  0.1184     0.7916 0.016 0.984
#> GSM97034     1  0.8499     0.6521 0.724 0.276
#> GSM97020     2  0.2236     0.7871 0.036 0.964
#> GSM97026     1  0.9286     0.5502 0.656 0.344
#> GSM97012     2  0.0376     0.7928 0.004 0.996
#> GSM97015     2  0.9866     0.1670 0.432 0.568
#> GSM97016     2  0.0376     0.7928 0.004 0.996
#> GSM97017     1  0.3733     0.8025 0.928 0.072
#> GSM97019     2  0.0672     0.7933 0.008 0.992
#> GSM97022     2  0.0376     0.7928 0.004 0.996
#> GSM97035     2  0.0376     0.7928 0.004 0.996
#> GSM97036     1  0.3274     0.8012 0.940 0.060
#> GSM97039     2  0.0376     0.7928 0.004 0.996
#> GSM97046     2  0.0376     0.7928 0.004 0.996
#> GSM97023     1  0.1414     0.8012 0.980 0.020
#> GSM97029     1  0.7139     0.7403 0.804 0.196
#> GSM97043     1  0.9922     0.2896 0.552 0.448
#> GSM97013     1  0.1843     0.8015 0.972 0.028
#> GSM96956     2  0.4939     0.7391 0.108 0.892
#> GSM97024     2  0.3733     0.7664 0.072 0.928
#> GSM97032     2  0.9850     0.1811 0.428 0.572
#> GSM97044     2  0.9850     0.1811 0.428 0.572
#> GSM97049     2  0.0376     0.7928 0.004 0.996
#> GSM96968     1  0.9248     0.5424 0.660 0.340
#> GSM96971     1  0.8327     0.6328 0.736 0.264
#> GSM96986     1  0.9833     0.3221 0.576 0.424
#> GSM97003     1  0.0376     0.7957 0.996 0.004
#> GSM96957     1  0.5842     0.7778 0.860 0.140
#> GSM96960     1  0.0376     0.7957 0.996 0.004
#> GSM96975     1  0.3733     0.8037 0.928 0.072
#> GSM96998     1  0.0938     0.7969 0.988 0.012
#> GSM96999     1  0.5842     0.7778 0.860 0.140
#> GSM97001     1  0.5842     0.7778 0.860 0.140
#> GSM97005     1  0.4690     0.7954 0.900 0.100
#> GSM97006     1  0.0376     0.7957 0.996 0.004
#> GSM97021     1  0.5178     0.7887 0.884 0.116
#> GSM97028     1  0.9833     0.3340 0.576 0.424
#> GSM97031     1  0.7745     0.6794 0.772 0.228
#> GSM97037     2  0.6712     0.6723 0.176 0.824
#> GSM97018     1  0.9944     0.2400 0.544 0.456
#> GSM97014     1  0.9248     0.5506 0.660 0.340
#> GSM97042     2  0.0376     0.7928 0.004 0.996
#> GSM97040     1  0.7950     0.6987 0.760 0.240
#> GSM97041     1  0.3733     0.8025 0.928 0.072
#> GSM96955     2  0.7602     0.6247 0.220 0.780
#> GSM96990     2  0.9833     0.1947 0.424 0.576
#> GSM96991     2  0.0938     0.7928 0.012 0.988
#> GSM97048     2  0.0376     0.7928 0.004 0.996
#> GSM96963     2  0.0938     0.7928 0.012 0.988
#> GSM96953     2  0.0376     0.7928 0.004 0.996
#> GSM96966     1  0.1633     0.8030 0.976 0.024
#> GSM96979     1  0.9815     0.3337 0.580 0.420
#> GSM96983     2  1.0000    -0.0668 0.496 0.504
#> GSM96984     1  0.9933     0.2319 0.548 0.452
#> GSM96994     1  0.9896     0.2736 0.560 0.440
#> GSM96996     1  0.0938     0.7969 0.988 0.012
#> GSM96997     1  0.9922     0.2461 0.552 0.448
#> GSM97007     1  0.9933     0.2319 0.548 0.452
#> GSM96954     1  0.9286     0.5084 0.656 0.344
#> GSM96962     1  0.9815     0.3337 0.580 0.420
#> GSM96969     1  0.1633     0.8026 0.976 0.024
#> GSM96970     1  0.1843     0.8028 0.972 0.028
#> GSM96973     1  0.2603     0.8020 0.956 0.044
#> GSM96976     1  0.3733     0.7997 0.928 0.072
#> GSM96977     1  0.6623     0.7609 0.828 0.172
#> GSM96995     2  0.9815     0.2078 0.420 0.580
#> GSM97002     1  0.0376     0.7957 0.996 0.004
#> GSM97009     1  0.8499     0.6543 0.724 0.276
#> GSM97010     1  0.2603     0.8038 0.956 0.044
#> GSM96974     1  0.3584     0.8002 0.932 0.068
#> GSM96985     1  1.0000     0.0542 0.504 0.496
#> GSM96959     2  0.9754     0.2167 0.408 0.592
#> GSM96972     1  0.0376     0.7957 0.996 0.004
#> GSM96978     2  1.0000    -0.0668 0.496 0.504
#> GSM96967     1  0.1414     0.8025 0.980 0.020
#> GSM96987     1  0.1633     0.8011 0.976 0.024
#> GSM97011     1  0.8499     0.6543 0.724 0.276
#> GSM96964     1  0.1843     0.8015 0.972 0.028
#> GSM96965     1  0.3733     0.8016 0.928 0.072
#> GSM96981     1  0.1414     0.8035 0.980 0.020
#> GSM96982     1  0.0938     0.8016 0.988 0.012
#> GSM96988     1  0.9881     0.2883 0.564 0.436
#> GSM97000     1  0.6438     0.7645 0.836 0.164
#> GSM97004     1  0.0376     0.7957 0.996 0.004
#> GSM97008     1  0.4690     0.7954 0.900 0.100
#> GSM96950     1  0.5294     0.7897 0.880 0.120
#> GSM96980     1  0.0376     0.7957 0.996 0.004
#> GSM96989     1  0.1633     0.8011 0.976 0.024
#> GSM96992     1  0.0000     0.7972 1.000 0.000
#> GSM96993     1  0.3274     0.8012 0.940 0.060
#> GSM96958     1  0.5178     0.7901 0.884 0.116
#> GSM96951     1  0.1843     0.8039 0.972 0.028
#> GSM96952     1  0.0000     0.7972 1.000 0.000
#> GSM96961     1  0.0000     0.7972 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
#> GSM97038     2  0.2982      0.844 0.024 0.920 0.056
#> GSM97045     2  0.1765      0.873 0.040 0.956 0.004
#> GSM97047     1  0.9203      0.434 0.536 0.248 0.216
#> GSM97025     2  0.1765      0.873 0.040 0.956 0.004
#> GSM97030     3  0.6059      0.748 0.048 0.188 0.764
#> GSM97027     2  0.1647      0.875 0.036 0.960 0.004
#> GSM97033     2  0.0829      0.886 0.012 0.984 0.004
#> GSM97034     1  0.8961      0.299 0.504 0.136 0.360
#> GSM97020     2  0.1525      0.878 0.032 0.964 0.004
#> GSM97026     1  0.9424      0.234 0.472 0.188 0.340
#> GSM97012     2  0.0237      0.889 0.000 0.996 0.004
#> GSM97015     3  0.6098      0.760 0.056 0.176 0.768
#> GSM97016     2  0.0237      0.889 0.000 0.996 0.004
#> GSM97017     1  0.4563      0.774 0.852 0.036 0.112
#> GSM97019     2  0.0475      0.889 0.004 0.992 0.004
#> GSM97022     2  0.0237      0.889 0.000 0.996 0.004
#> GSM97035     2  0.0237      0.889 0.000 0.996 0.004
#> GSM97036     1  0.4058      0.777 0.880 0.044 0.076
#> GSM97039     2  0.0000      0.889 0.000 1.000 0.000
#> GSM97046     2  0.0000      0.889 0.000 1.000 0.000
#> GSM97023     1  0.2860      0.778 0.912 0.004 0.084
#> GSM97029     1  0.7596      0.650 0.672 0.100 0.228
#> GSM97043     3  0.9962      0.141 0.344 0.292 0.364
#> GSM97013     1  0.3207      0.778 0.904 0.012 0.084
#> GSM96956     2  0.5591      0.527 0.000 0.696 0.304
#> GSM97024     2  0.4413      0.778 0.024 0.852 0.124
#> GSM97032     3  0.6054      0.756 0.052 0.180 0.768
#> GSM97044     3  0.6001      0.760 0.052 0.176 0.772
#> GSM97049     2  0.0000      0.889 0.000 1.000 0.000
#> GSM96968     3  0.8058      0.257 0.376 0.072 0.552
#> GSM96971     3  0.5285      0.585 0.244 0.004 0.752
#> GSM96986     3  0.3500      0.790 0.116 0.004 0.880
#> GSM97003     1  0.1163      0.759 0.972 0.000 0.028
#> GSM96957     1  0.6354      0.721 0.744 0.052 0.204
#> GSM96960     1  0.1411      0.757 0.964 0.000 0.036
#> GSM96975     1  0.4921      0.770 0.816 0.020 0.164
#> GSM96998     1  0.1267      0.759 0.972 0.004 0.024
#> GSM96999     1  0.6354      0.721 0.744 0.052 0.204
#> GSM97001     1  0.6354      0.721 0.744 0.052 0.204
#> GSM97005     1  0.5058      0.763 0.820 0.032 0.148
#> GSM97006     1  0.1289      0.757 0.968 0.000 0.032
#> GSM97021     1  0.5719      0.753 0.792 0.052 0.156
#> GSM97028     3  0.5618      0.760 0.156 0.048 0.796
#> GSM97031     1  0.6260      0.271 0.552 0.000 0.448
#> GSM97037     2  0.6483      0.114 0.004 0.544 0.452
#> GSM97018     3  0.6902      0.747 0.148 0.116 0.736
#> GSM97014     1  0.8600      0.508 0.580 0.284 0.136
#> GSM97042     2  0.0237      0.889 0.000 0.996 0.004
#> GSM97040     1  0.8171      0.612 0.644 0.172 0.184
#> GSM97041     1  0.4563      0.774 0.852 0.036 0.112
#> GSM96955     2  0.8016      0.445 0.108 0.632 0.260
#> GSM96990     3  0.6447      0.741 0.060 0.196 0.744
#> GSM96991     2  0.1529      0.875 0.000 0.960 0.040
#> GSM97048     2  0.0000      0.889 0.000 1.000 0.000
#> GSM96963     2  0.1529      0.875 0.000 0.960 0.040
#> GSM96953     2  0.0237      0.889 0.000 0.996 0.004
#> GSM96966     1  0.5859      0.544 0.656 0.000 0.344
#> GSM96979     3  0.3425      0.788 0.112 0.004 0.884
#> GSM96983     3  0.2031      0.793 0.016 0.032 0.952
#> GSM96984     3  0.1878      0.800 0.044 0.004 0.952
#> GSM96994     3  0.2845      0.804 0.068 0.012 0.920
#> GSM96996     1  0.1399      0.761 0.968 0.004 0.028
#> GSM96997     3  0.2096      0.801 0.052 0.004 0.944
#> GSM97007     3  0.1878      0.800 0.044 0.004 0.952
#> GSM96954     3  0.5202      0.686 0.220 0.008 0.772
#> GSM96962     3  0.3425      0.788 0.112 0.004 0.884
#> GSM96969     1  0.6008      0.498 0.628 0.000 0.372
#> GSM96970     1  0.6008      0.492 0.628 0.000 0.372
#> GSM96973     1  0.6140      0.453 0.596 0.000 0.404
#> GSM96976     1  0.6659      0.363 0.532 0.008 0.460
#> GSM96977     1  0.7157      0.641 0.668 0.056 0.276
#> GSM96995     3  0.6922      0.729 0.080 0.200 0.720
#> GSM97002     1  0.1163      0.759 0.972 0.000 0.028
#> GSM97009     1  0.8525      0.571 0.612 0.200 0.188
#> GSM97010     1  0.4677      0.779 0.840 0.028 0.132
#> GSM96974     1  0.6291      0.357 0.532 0.000 0.468
#> GSM96985     3  0.3237      0.801 0.056 0.032 0.912
#> GSM96959     2  0.9820     -0.237 0.244 0.396 0.360
#> GSM96972     1  0.4399      0.670 0.812 0.000 0.188
#> GSM96978     3  0.2031      0.793 0.016 0.032 0.952
#> GSM96967     1  0.5905      0.535 0.648 0.000 0.352
#> GSM96987     1  0.2955      0.779 0.912 0.008 0.080
#> GSM97011     1  0.8525      0.571 0.612 0.200 0.188
#> GSM96964     1  0.3120      0.781 0.908 0.012 0.080
#> GSM96965     1  0.6735      0.450 0.564 0.012 0.424
#> GSM96981     1  0.3272      0.779 0.892 0.004 0.104
#> GSM96982     1  0.2590      0.775 0.924 0.004 0.072
#> GSM96988     3  0.4489      0.803 0.108 0.036 0.856
#> GSM97000     1  0.6746      0.712 0.732 0.076 0.192
#> GSM97004     1  0.1289      0.757 0.968 0.000 0.032
#> GSM97008     1  0.5058      0.763 0.820 0.032 0.148
#> GSM96950     1  0.5643      0.732 0.760 0.020 0.220
#> GSM96980     1  0.2356      0.751 0.928 0.000 0.072
#> GSM96989     1  0.2955      0.779 0.912 0.008 0.080
#> GSM96992     1  0.1964      0.772 0.944 0.000 0.056
#> GSM96993     1  0.4232      0.778 0.872 0.044 0.084
#> GSM96958     1  0.5521      0.748 0.788 0.032 0.180
#> GSM96951     1  0.3192      0.773 0.888 0.000 0.112
#> GSM96952     1  0.1964      0.772 0.944 0.000 0.056
#> GSM96961     1  0.1964      0.772 0.944 0.000 0.056

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.2652     0.8448 0.028 0.912 0.056 0.004
#> GSM97045     2  0.1398     0.8722 0.040 0.956 0.004 0.000
#> GSM97047     1  0.7091     0.5007 0.592 0.244 0.156 0.008
#> GSM97025     2  0.1398     0.8722 0.040 0.956 0.004 0.000
#> GSM97030     3  0.5200     0.7454 0.052 0.188 0.752 0.008
#> GSM97027     2  0.1305     0.8744 0.036 0.960 0.004 0.000
#> GSM97033     2  0.0657     0.8837 0.012 0.984 0.004 0.000
#> GSM97034     1  0.7362     0.3156 0.540 0.136 0.312 0.012
#> GSM97020     2  0.1209     0.8767 0.032 0.964 0.004 0.000
#> GSM97026     1  0.7430     0.3530 0.548 0.184 0.260 0.008
#> GSM97012     2  0.0188     0.8858 0.000 0.996 0.004 0.000
#> GSM97015     3  0.5159     0.7527 0.064 0.176 0.756 0.004
#> GSM97016     2  0.0376     0.8854 0.000 0.992 0.004 0.004
#> GSM97017     1  0.2297     0.7900 0.932 0.032 0.024 0.012
#> GSM97019     2  0.0376     0.8859 0.004 0.992 0.004 0.000
#> GSM97022     2  0.0188     0.8858 0.000 0.996 0.004 0.000
#> GSM97035     2  0.0188     0.8858 0.000 0.996 0.004 0.000
#> GSM97036     1  0.1913     0.7893 0.940 0.040 0.000 0.020
#> GSM97039     2  0.0188     0.8855 0.000 0.996 0.000 0.004
#> GSM97046     2  0.0188     0.8855 0.000 0.996 0.000 0.004
#> GSM97023     1  0.0592     0.7874 0.984 0.000 0.000 0.016
#> GSM97029     1  0.5585     0.6816 0.748 0.096 0.144 0.012
#> GSM97043     1  0.8170    -0.1074 0.360 0.292 0.340 0.008
#> GSM97013     1  0.0927     0.7884 0.976 0.008 0.000 0.016
#> GSM96956     2  0.4608     0.5046 0.000 0.692 0.304 0.004
#> GSM97024     2  0.3447     0.7760 0.020 0.852 0.128 0.000
#> GSM97032     3  0.5055     0.7512 0.056 0.180 0.760 0.004
#> GSM97044     3  0.5013     0.7539 0.056 0.176 0.764 0.004
#> GSM97049     2  0.0188     0.8855 0.000 0.996 0.000 0.004
#> GSM96968     3  0.6863     0.2206 0.404 0.072 0.512 0.012
#> GSM96971     3  0.5130     0.3245 0.016 0.000 0.652 0.332
#> GSM96986     3  0.3354     0.7844 0.084 0.000 0.872 0.044
#> GSM97003     1  0.4245     0.7309 0.784 0.000 0.020 0.196
#> GSM96957     1  0.4316     0.7556 0.824 0.048 0.120 0.008
#> GSM96960     1  0.4387     0.7266 0.776 0.000 0.024 0.200
#> GSM96975     1  0.4107     0.7924 0.848 0.020 0.088 0.044
#> GSM96998     1  0.3946     0.7496 0.812 0.004 0.012 0.172
#> GSM96999     1  0.4316     0.7556 0.824 0.048 0.120 0.008
#> GSM97001     1  0.4316     0.7556 0.824 0.048 0.120 0.008
#> GSM97005     1  0.2884     0.7855 0.900 0.028 0.068 0.004
#> GSM97006     1  0.4323     0.7251 0.776 0.000 0.020 0.204
#> GSM97021     1  0.3629     0.7743 0.868 0.048 0.076 0.008
#> GSM97028     3  0.4466     0.7498 0.156 0.040 0.800 0.004
#> GSM97031     1  0.6360     0.2689 0.516 0.000 0.420 0.064
#> GSM97037     2  0.5263     0.0630 0.008 0.544 0.448 0.000
#> GSM97018     3  0.5680     0.7376 0.148 0.108 0.736 0.008
#> GSM97014     1  0.5862     0.5849 0.664 0.280 0.048 0.008
#> GSM97042     2  0.0188     0.8858 0.000 0.996 0.004 0.000
#> GSM97040     1  0.5968     0.6593 0.716 0.168 0.104 0.012
#> GSM97041     1  0.2297     0.7900 0.932 0.032 0.024 0.012
#> GSM96955     2  0.6919     0.4873 0.176 0.608 0.212 0.004
#> GSM96990     3  0.5828     0.7284 0.084 0.196 0.712 0.008
#> GSM96991     2  0.1637     0.8578 0.000 0.940 0.060 0.000
#> GSM97048     2  0.0188     0.8855 0.000 0.996 0.000 0.004
#> GSM96963     2  0.1637     0.8578 0.000 0.940 0.060 0.000
#> GSM96953     2  0.0188     0.8858 0.000 0.996 0.004 0.000
#> GSM96966     4  0.3617     0.8870 0.076 0.000 0.064 0.860
#> GSM96979     3  0.3176     0.7831 0.084 0.000 0.880 0.036
#> GSM96983     3  0.0804     0.7689 0.000 0.008 0.980 0.012
#> GSM96984     3  0.1722     0.7722 0.008 0.000 0.944 0.048
#> GSM96994     3  0.2831     0.7885 0.044 0.008 0.908 0.040
#> GSM96996     1  0.4063     0.7511 0.808 0.004 0.016 0.172
#> GSM96997     3  0.1975     0.7751 0.016 0.000 0.936 0.048
#> GSM97007     3  0.1722     0.7722 0.008 0.000 0.944 0.048
#> GSM96954     3  0.5302     0.7015 0.164 0.004 0.752 0.080
#> GSM96962     3  0.3176     0.7831 0.084 0.000 0.880 0.036
#> GSM96969     4  0.3900     0.9034 0.072 0.000 0.084 0.844
#> GSM96970     4  0.3900     0.9035 0.072 0.000 0.084 0.844
#> GSM96973     4  0.3919     0.8947 0.056 0.000 0.104 0.840
#> GSM96976     4  0.4381     0.8425 0.032 0.008 0.152 0.808
#> GSM96977     1  0.5441     0.6779 0.736 0.052 0.200 0.012
#> GSM96995     3  0.6154     0.7115 0.104 0.200 0.688 0.008
#> GSM97002     1  0.4245     0.7309 0.784 0.000 0.020 0.196
#> GSM97009     1  0.6118     0.6305 0.692 0.196 0.104 0.008
#> GSM97010     1  0.3725     0.7952 0.872 0.024 0.052 0.052
#> GSM96974     4  0.4152     0.8397 0.032 0.000 0.160 0.808
#> GSM96985     3  0.2010     0.7789 0.040 0.008 0.940 0.012
#> GSM96959     2  0.8023    -0.0963 0.296 0.392 0.308 0.004
#> GSM96972     4  0.2973     0.7443 0.144 0.000 0.000 0.856
#> GSM96978     3  0.0804     0.7689 0.000 0.008 0.980 0.012
#> GSM96967     4  0.3691     0.8950 0.076 0.000 0.068 0.856
#> GSM96987     1  0.1909     0.7888 0.940 0.004 0.008 0.048
#> GSM97011     1  0.6118     0.6305 0.692 0.196 0.104 0.008
#> GSM96964     1  0.2186     0.7922 0.932 0.008 0.012 0.048
#> GSM96965     4  0.5102     0.8491 0.116 0.008 0.096 0.780
#> GSM96981     1  0.3128     0.7846 0.888 0.004 0.032 0.076
#> GSM96982     1  0.3932     0.7689 0.836 0.004 0.032 0.128
#> GSM96988     3  0.3806     0.7949 0.092 0.028 0.860 0.020
#> GSM97000     1  0.4768     0.7372 0.800 0.072 0.120 0.008
#> GSM97004     1  0.4323     0.7251 0.776 0.000 0.020 0.204
#> GSM97008     1  0.2884     0.7855 0.900 0.028 0.068 0.004
#> GSM96950     1  0.3898     0.7631 0.836 0.016 0.136 0.012
#> GSM96980     1  0.5105     0.4049 0.564 0.000 0.004 0.432
#> GSM96989     1  0.1909     0.7888 0.940 0.004 0.008 0.048
#> GSM96992     1  0.3278     0.7702 0.864 0.000 0.020 0.116
#> GSM96993     1  0.1863     0.7913 0.944 0.040 0.004 0.012
#> GSM96958     1  0.4413     0.7755 0.828 0.028 0.112 0.032
#> GSM96951     1  0.3903     0.7792 0.844 0.000 0.076 0.080
#> GSM96952     1  0.3278     0.7702 0.864 0.000 0.020 0.116
#> GSM96961     1  0.3278     0.7702 0.864 0.000 0.020 0.116

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4 p5
#> GSM97038     2  0.2534     0.8413 0.020 0.908 0.052 0.004 NA
#> GSM97045     2  0.1569     0.8645 0.044 0.944 0.004 0.000 NA
#> GSM97047     1  0.6659     0.4568 0.588 0.216 0.148 0.000 NA
#> GSM97025     2  0.1569     0.8645 0.044 0.944 0.004 0.000 NA
#> GSM97030     3  0.5045     0.6733 0.052 0.164 0.744 0.004 NA
#> GSM97027     2  0.1365     0.8688 0.040 0.952 0.004 0.000 NA
#> GSM97033     2  0.0566     0.8812 0.012 0.984 0.004 0.000 NA
#> GSM97034     1  0.6900     0.2853 0.524 0.108 0.308 0.000 NA
#> GSM97020     2  0.1124     0.8724 0.036 0.960 0.004 0.000 NA
#> GSM97026     1  0.6972     0.3343 0.536 0.160 0.256 0.000 NA
#> GSM97012     2  0.0324     0.8830 0.000 0.992 0.000 0.004 NA
#> GSM97015     3  0.5043     0.6820 0.064 0.152 0.748 0.004 NA
#> GSM97016     2  0.0324     0.8825 0.000 0.992 0.004 0.000 NA
#> GSM97017     1  0.2234     0.7204 0.920 0.012 0.032 0.000 NA
#> GSM97019     2  0.0727     0.8825 0.004 0.980 0.000 0.004 NA
#> GSM97022     2  0.0324     0.8830 0.000 0.992 0.000 0.004 NA
#> GSM97035     2  0.0324     0.8830 0.000 0.992 0.000 0.004 NA
#> GSM97036     1  0.2264     0.7293 0.912 0.024 0.004 0.000 NA
#> GSM97039     2  0.0162     0.8828 0.000 0.996 0.000 0.000 NA
#> GSM97046     2  0.0162     0.8828 0.000 0.996 0.000 0.000 NA
#> GSM97023     1  0.1357     0.7329 0.948 0.000 0.004 0.000 NA
#> GSM97029     1  0.5258     0.6183 0.732 0.072 0.148 0.000 NA
#> GSM97043     1  0.7735    -0.0724 0.356 0.264 0.332 0.004 NA
#> GSM97013     1  0.1357     0.7320 0.948 0.000 0.004 0.000 NA
#> GSM96956     2  0.4067     0.5251 0.000 0.692 0.300 0.000 NA
#> GSM97024     2  0.3142     0.7756 0.016 0.852 0.124 0.004 NA
#> GSM97032     3  0.4957     0.6799 0.056 0.156 0.752 0.004 NA
#> GSM97044     3  0.4995     0.6867 0.056 0.152 0.752 0.004 NA
#> GSM97049     2  0.0162     0.8828 0.000 0.996 0.000 0.000 NA
#> GSM96968     3  0.7060     0.1797 0.368 0.048 0.468 0.004 NA
#> GSM96971     3  0.6301     0.2944 0.004 0.000 0.512 0.336 NA
#> GSM96986     3  0.4633     0.6741 0.036 0.000 0.696 0.004 NA
#> GSM97003     1  0.4917     0.6014 0.588 0.000 0.004 0.024 NA
#> GSM96957     1  0.4855     0.6778 0.764 0.032 0.100 0.000 NA
#> GSM96960     1  0.5146     0.5829 0.564 0.000 0.008 0.028 NA
#> GSM96975     1  0.4546     0.7231 0.756 0.012 0.056 0.000 NA
#> GSM96998     1  0.4526     0.6599 0.672 0.000 0.000 0.028 NA
#> GSM96999     1  0.4855     0.6778 0.764 0.032 0.100 0.000 NA
#> GSM97001     1  0.4855     0.6778 0.764 0.032 0.100 0.000 NA
#> GSM97005     1  0.2679     0.7147 0.892 0.004 0.048 0.000 NA
#> GSM97006     1  0.5041     0.5820 0.564 0.000 0.004 0.028 NA
#> GSM97021     1  0.3575     0.7021 0.848 0.020 0.056 0.000 NA
#> GSM97028     3  0.5220     0.6821 0.144 0.036 0.744 0.008 NA
#> GSM97031     1  0.6952     0.1754 0.412 0.000 0.320 0.008 NA
#> GSM97037     2  0.4882     0.1260 0.008 0.540 0.440 0.000 NA
#> GSM97018     3  0.5444     0.6716 0.136 0.096 0.728 0.008 NA
#> GSM97014     1  0.5570     0.5384 0.660 0.252 0.044 0.000 NA
#> GSM97042     2  0.0324     0.8830 0.000 0.992 0.000 0.004 NA
#> GSM97040     1  0.5630     0.5956 0.708 0.140 0.096 0.000 NA
#> GSM97041     1  0.2234     0.7204 0.920 0.012 0.032 0.000 NA
#> GSM96955     2  0.7079     0.4839 0.156 0.588 0.076 0.008 NA
#> GSM96990     3  0.5515     0.6581 0.084 0.172 0.708 0.004 NA
#> GSM96991     2  0.1571     0.8547 0.000 0.936 0.000 0.004 NA
#> GSM97048     2  0.0162     0.8828 0.000 0.996 0.000 0.000 NA
#> GSM96963     2  0.1571     0.8547 0.000 0.936 0.000 0.004 NA
#> GSM96953     2  0.0324     0.8830 0.000 0.992 0.000 0.004 NA
#> GSM96966     4  0.3117     0.8915 0.036 0.000 0.004 0.860 NA
#> GSM96979     3  0.4552     0.6790 0.040 0.000 0.716 0.004 NA
#> GSM96983     3  0.4492     0.6034 0.000 0.004 0.680 0.020 NA
#> GSM96984     3  0.3550     0.6677 0.000 0.000 0.760 0.004 NA
#> GSM96994     3  0.4063     0.6963 0.016 0.008 0.768 0.004 NA
#> GSM96996     1  0.4678     0.6614 0.668 0.000 0.004 0.028 NA
#> GSM96997     3  0.3607     0.6654 0.000 0.000 0.752 0.004 NA
#> GSM97007     3  0.3491     0.6705 0.000 0.000 0.768 0.004 NA
#> GSM96954     3  0.6087     0.6461 0.140 0.000 0.672 0.068 NA
#> GSM96962     3  0.4552     0.6790 0.040 0.000 0.716 0.004 NA
#> GSM96969     4  0.2236     0.9065 0.024 0.000 0.000 0.908 NA
#> GSM96970     4  0.2236     0.9066 0.024 0.000 0.000 0.908 NA
#> GSM96973     4  0.1386     0.8996 0.016 0.000 0.000 0.952 NA
#> GSM96976     4  0.1095     0.8635 0.000 0.008 0.012 0.968 NA
#> GSM96977     1  0.5662     0.6081 0.692 0.036 0.164 0.000 NA
#> GSM96995     3  0.5798     0.6406 0.104 0.176 0.684 0.004 NA
#> GSM97002     1  0.4917     0.6014 0.588 0.000 0.004 0.024 NA
#> GSM97009     1  0.5764     0.5737 0.688 0.168 0.096 0.000 NA
#> GSM97010     1  0.4522     0.7276 0.768 0.012 0.028 0.016 NA
#> GSM96974     4  0.0912     0.8639 0.000 0.000 0.016 0.972 NA
#> GSM96985     3  0.5221     0.6005 0.024 0.004 0.652 0.024 NA
#> GSM96959     2  0.7589    -0.1257 0.288 0.368 0.308 0.004 NA
#> GSM96972     4  0.4906     0.7511 0.076 0.000 0.000 0.692 NA
#> GSM96978     3  0.4405     0.6138 0.000 0.004 0.696 0.020 NA
#> GSM96967     4  0.2769     0.8971 0.032 0.000 0.000 0.876 NA
#> GSM96987     1  0.2338     0.7323 0.884 0.000 0.000 0.004 NA
#> GSM97011     1  0.5764     0.5737 0.688 0.168 0.096 0.000 NA
#> GSM96964     1  0.2536     0.7353 0.868 0.000 0.000 0.004 NA
#> GSM96965     4  0.2408     0.8292 0.096 0.008 0.000 0.892 NA
#> GSM96981     1  0.4146     0.6962 0.716 0.000 0.004 0.012 NA
#> GSM96982     1  0.4607     0.6629 0.656 0.000 0.004 0.020 NA
#> GSM96988     3  0.4417     0.7214 0.076 0.024 0.800 0.004 NA
#> GSM97000     1  0.4581     0.6750 0.788 0.040 0.096 0.000 NA
#> GSM97004     1  0.5041     0.5820 0.564 0.000 0.004 0.028 NA
#> GSM97008     1  0.2679     0.7147 0.892 0.004 0.048 0.000 NA
#> GSM96950     1  0.4298     0.6911 0.788 0.008 0.096 0.000 NA
#> GSM96980     1  0.6728     0.2588 0.404 0.000 0.000 0.260 NA
#> GSM96989     1  0.2338     0.7323 0.884 0.000 0.000 0.004 NA
#> GSM96992     1  0.3934     0.6998 0.748 0.000 0.004 0.012 NA
#> GSM96993     1  0.2104     0.7335 0.916 0.024 0.000 0.000 NA
#> GSM96958     1  0.4766     0.6998 0.760 0.012 0.084 0.004 NA
#> GSM96951     1  0.4579     0.7096 0.744 0.000 0.056 0.008 NA
#> GSM96952     1  0.3934     0.6998 0.748 0.000 0.004 0.012 NA
#> GSM96961     1  0.3934     0.6998 0.748 0.000 0.004 0.012 NA

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.2774     0.8108 0.012 0.872 0.076 0.000 0.040 0.000
#> GSM97045     2  0.1398     0.8513 0.000 0.940 0.008 0.000 0.052 0.000
#> GSM97047     5  0.5298     0.4431 0.004 0.164 0.180 0.000 0.644 0.008
#> GSM97025     2  0.1398     0.8513 0.000 0.940 0.008 0.000 0.052 0.000
#> GSM97030     3  0.3449     0.6152 0.000 0.116 0.808 0.000 0.076 0.000
#> GSM97027     2  0.1265     0.8556 0.000 0.948 0.008 0.000 0.044 0.000
#> GSM97033     2  0.0508     0.8684 0.000 0.984 0.004 0.000 0.012 0.000
#> GSM97034     5  0.6030     0.2567 0.048 0.068 0.332 0.000 0.540 0.012
#> GSM97020     2  0.1124     0.8594 0.000 0.956 0.008 0.000 0.036 0.000
#> GSM97026     5  0.5937     0.3233 0.024 0.128 0.268 0.000 0.572 0.008
#> GSM97012     2  0.0260     0.8700 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM97015     3  0.3810     0.6206 0.004 0.104 0.800 0.000 0.084 0.008
#> GSM97016     2  0.0922     0.8661 0.024 0.968 0.004 0.000 0.000 0.004
#> GSM97017     5  0.1606     0.5854 0.056 0.008 0.004 0.000 0.932 0.000
#> GSM97019     2  0.0622     0.8698 0.000 0.980 0.000 0.000 0.012 0.008
#> GSM97022     2  0.0260     0.8700 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM97035     2  0.0260     0.8700 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM97036     5  0.2551     0.5517 0.108 0.012 0.004 0.000 0.872 0.004
#> GSM97039     2  0.0777     0.8660 0.024 0.972 0.000 0.000 0.000 0.004
#> GSM97046     2  0.0858     0.8652 0.028 0.968 0.000 0.000 0.000 0.004
#> GSM97023     5  0.2260     0.5303 0.140 0.000 0.000 0.000 0.860 0.000
#> GSM97029     5  0.4808     0.5684 0.060 0.048 0.148 0.000 0.736 0.008
#> GSM97043     5  0.6599    -0.1379 0.024 0.224 0.372 0.000 0.376 0.004
#> GSM97013     5  0.2278     0.5393 0.128 0.000 0.004 0.000 0.868 0.000
#> GSM96956     2  0.3986     0.4932 0.020 0.664 0.316 0.000 0.000 0.000
#> GSM97024     2  0.2868     0.7627 0.000 0.852 0.112 0.000 0.032 0.004
#> GSM97032     3  0.3664     0.6174 0.000 0.108 0.804 0.000 0.080 0.008
#> GSM97044     3  0.3972     0.6110 0.000 0.104 0.792 0.000 0.080 0.024
#> GSM97049     2  0.0858     0.8652 0.028 0.968 0.000 0.000 0.000 0.004
#> GSM96968     3  0.6533     0.1663 0.092 0.008 0.488 0.000 0.336 0.076
#> GSM96971     6  0.6586     0.2838 0.024 0.000 0.224 0.344 0.004 0.404
#> GSM96986     6  0.4982     0.7403 0.024 0.000 0.292 0.000 0.052 0.632
#> GSM97003     1  0.2562     0.7481 0.828 0.000 0.000 0.000 0.172 0.000
#> GSM96957     5  0.5431     0.4888 0.184 0.000 0.128 0.000 0.652 0.036
#> GSM96960     1  0.3013     0.7387 0.828 0.000 0.004 0.004 0.152 0.012
#> GSM96975     5  0.5667     0.0131 0.412 0.000 0.060 0.004 0.492 0.032
#> GSM96998     1  0.3930     0.6271 0.628 0.000 0.004 0.004 0.364 0.000
#> GSM96999     5  0.5431     0.4888 0.184 0.000 0.128 0.000 0.652 0.036
#> GSM97001     5  0.5431     0.4888 0.184 0.000 0.128 0.000 0.652 0.036
#> GSM97005     5  0.2386     0.5863 0.064 0.000 0.028 0.000 0.896 0.012
#> GSM97006     1  0.2914     0.7398 0.832 0.000 0.004 0.004 0.152 0.008
#> GSM97021     5  0.2420     0.5964 0.028 0.008 0.044 0.000 0.904 0.016
#> GSM97028     3  0.6035     0.5388 0.040 0.028 0.656 0.008 0.148 0.120
#> GSM97031     5  0.7539     0.1027 0.204 0.000 0.180 0.000 0.356 0.260
#> GSM97037     2  0.4486     0.0429 0.008 0.512 0.464 0.000 0.016 0.000
#> GSM97018     3  0.5506     0.5863 0.020 0.068 0.696 0.004 0.156 0.056
#> GSM97014     5  0.4259     0.4948 0.004 0.228 0.040 0.000 0.720 0.008
#> GSM97042     2  0.0260     0.8700 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM97040     5  0.4201     0.5642 0.008 0.108 0.104 0.000 0.772 0.008
#> GSM97041     5  0.1606     0.5854 0.056 0.008 0.004 0.000 0.932 0.000
#> GSM96955     2  0.7097     0.3987 0.048 0.552 0.184 0.008 0.152 0.056
#> GSM96990     3  0.4166     0.6085 0.000 0.124 0.760 0.000 0.108 0.008
#> GSM96991     2  0.1462     0.8473 0.000 0.936 0.056 0.000 0.000 0.008
#> GSM97048     2  0.0858     0.8652 0.028 0.968 0.000 0.000 0.000 0.004
#> GSM96963     2  0.1462     0.8473 0.000 0.936 0.056 0.000 0.000 0.008
#> GSM96953     2  0.0260     0.8700 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM96966     4  0.2704     0.8806 0.140 0.000 0.000 0.844 0.016 0.000
#> GSM96979     6  0.4872     0.7571 0.020 0.000 0.284 0.000 0.052 0.644
#> GSM96983     3  0.4962     0.3246 0.064 0.004 0.628 0.008 0.000 0.296
#> GSM96984     6  0.3101     0.7645 0.000 0.000 0.244 0.000 0.000 0.756
#> GSM96994     6  0.5079     0.7152 0.012 0.008 0.332 0.000 0.048 0.600
#> GSM96996     1  0.4145     0.6294 0.628 0.000 0.008 0.004 0.356 0.004
#> GSM96997     6  0.3215     0.7646 0.004 0.000 0.240 0.000 0.000 0.756
#> GSM97007     6  0.3151     0.7623 0.000 0.000 0.252 0.000 0.000 0.748
#> GSM96954     3  0.7648    -0.1686 0.056 0.000 0.372 0.080 0.136 0.356
#> GSM96962     6  0.4872     0.7571 0.020 0.000 0.284 0.000 0.052 0.644
#> GSM96969     4  0.2263     0.8964 0.100 0.000 0.000 0.884 0.016 0.000
#> GSM96970     4  0.2263     0.8967 0.100 0.000 0.000 0.884 0.016 0.000
#> GSM96973     4  0.1584     0.8891 0.064 0.000 0.000 0.928 0.008 0.000
#> GSM96976     4  0.0665     0.8488 0.000 0.008 0.008 0.980 0.000 0.004
#> GSM96977     5  0.6272     0.4641 0.188 0.000 0.200 0.000 0.556 0.056
#> GSM96995     3  0.4450     0.5933 0.000 0.132 0.732 0.000 0.128 0.008
#> GSM97002     1  0.2562     0.7481 0.828 0.000 0.000 0.000 0.172 0.000
#> GSM97009     5  0.4684     0.5509 0.008 0.132 0.104 0.004 0.740 0.012
#> GSM97010     5  0.5748    -0.2863 0.448 0.008 0.036 0.020 0.468 0.020
#> GSM96974     4  0.0405     0.8492 0.000 0.000 0.008 0.988 0.000 0.004
#> GSM96985     3  0.5480     0.3225 0.084 0.004 0.608 0.012 0.008 0.284
#> GSM96959     2  0.6731    -0.2637 0.004 0.332 0.316 0.004 0.328 0.016
#> GSM96972     4  0.4459     0.7071 0.288 0.000 0.004 0.668 0.032 0.008
#> GSM96978     3  0.4822     0.3316 0.056 0.004 0.644 0.008 0.000 0.288
#> GSM96967     4  0.2623     0.8857 0.132 0.000 0.000 0.852 0.016 0.000
#> GSM96987     5  0.3330     0.3046 0.284 0.000 0.000 0.000 0.716 0.000
#> GSM97011     5  0.4684     0.5509 0.008 0.132 0.104 0.004 0.740 0.012
#> GSM96964     5  0.3808     0.3102 0.284 0.000 0.012 0.000 0.700 0.004
#> GSM96965     4  0.2256     0.8086 0.000 0.008 0.004 0.892 0.092 0.004
#> GSM96981     1  0.4590     0.6203 0.632 0.000 0.008 0.008 0.328 0.024
#> GSM96982     1  0.4138     0.6967 0.700 0.000 0.008 0.004 0.268 0.020
#> GSM96988     3  0.5809     0.3796 0.024 0.016 0.632 0.008 0.092 0.228
#> GSM97000     5  0.3911     0.5921 0.048 0.024 0.100 0.000 0.812 0.016
#> GSM97004     1  0.2914     0.7398 0.832 0.000 0.004 0.004 0.152 0.008
#> GSM97008     5  0.2386     0.5863 0.064 0.000 0.028 0.000 0.896 0.012
#> GSM96950     5  0.5465     0.4733 0.208 0.000 0.108 0.000 0.644 0.040
#> GSM96980     1  0.5082     0.4371 0.652 0.000 0.004 0.236 0.100 0.008
#> GSM96989     5  0.3330     0.3046 0.284 0.000 0.000 0.000 0.716 0.000
#> GSM96992     1  0.4242     0.5231 0.572 0.000 0.004 0.000 0.412 0.012
#> GSM96993     5  0.3018     0.5022 0.168 0.012 0.004 0.000 0.816 0.000
#> GSM96958     5  0.5695     0.3511 0.280 0.000 0.100 0.000 0.584 0.036
#> GSM96951     5  0.5247    -0.3127 0.460 0.000 0.016 0.000 0.468 0.056
#> GSM96952     1  0.4242     0.5231 0.572 0.000 0.004 0.000 0.412 0.012
#> GSM96961     1  0.4242     0.5231 0.572 0.000 0.004 0.000 0.412 0.012

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-hclust-collect-classes

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

test_to_known_factors(res)
#>            n disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:hclust 79         0.000928       0.304     3.11e-12   0.0387 2
#> CV:hclust 85         0.000637       0.483     2.04e-15   0.0545 3
#> CV:hclust 90         0.000328       0.179     6.02e-16   0.0387 4
#> CV:hclust 89         0.000187       0.161     2.22e-16   0.0325 5
#> CV:hclust 70         0.000439       0.210     3.25e-14   0.0128 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 21168 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.980       0.991         0.4938 0.508   0.508
#> 3 3 0.487           0.385       0.682         0.3047 0.772   0.606
#> 4 4 0.716           0.731       0.851         0.1370 0.747   0.472
#> 5 5 0.664           0.572       0.758         0.0676 0.865   0.584
#> 6 6 0.709           0.664       0.743         0.0454 0.921   0.680

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
#> GSM97038     2   0.000      0.995 0.000 1.000
#> GSM97045     2   0.000      0.995 0.000 1.000
#> GSM97047     2   0.000      0.995 0.000 1.000
#> GSM97025     2   0.000      0.995 0.000 1.000
#> GSM97030     2   0.000      0.995 0.000 1.000
#> GSM97027     2   0.000      0.995 0.000 1.000
#> GSM97033     2   0.000      0.995 0.000 1.000
#> GSM97034     2   0.000      0.995 0.000 1.000
#> GSM97020     2   0.000      0.995 0.000 1.000
#> GSM97026     2   0.000      0.995 0.000 1.000
#> GSM97012     2   0.000      0.995 0.000 1.000
#> GSM97015     2   0.000      0.995 0.000 1.000
#> GSM97016     2   0.000      0.995 0.000 1.000
#> GSM97017     1   0.000      0.988 1.000 0.000
#> GSM97019     2   0.000      0.995 0.000 1.000
#> GSM97022     2   0.000      0.995 0.000 1.000
#> GSM97035     2   0.000      0.995 0.000 1.000
#> GSM97036     1   0.000      0.988 1.000 0.000
#> GSM97039     2   0.000      0.995 0.000 1.000
#> GSM97046     2   0.000      0.995 0.000 1.000
#> GSM97023     1   0.000      0.988 1.000 0.000
#> GSM97029     1   0.000      0.988 1.000 0.000
#> GSM97043     2   0.000      0.995 0.000 1.000
#> GSM97013     1   0.000      0.988 1.000 0.000
#> GSM96956     2   0.000      0.995 0.000 1.000
#> GSM97024     2   0.000      0.995 0.000 1.000
#> GSM97032     2   0.000      0.995 0.000 1.000
#> GSM97044     2   0.000      0.995 0.000 1.000
#> GSM97049     2   0.000      0.995 0.000 1.000
#> GSM96968     1   0.584      0.837 0.860 0.140
#> GSM96971     1   0.000      0.988 1.000 0.000
#> GSM96986     1   0.000      0.988 1.000 0.000
#> GSM97003     1   0.000      0.988 1.000 0.000
#> GSM96957     1   0.000      0.988 1.000 0.000
#> GSM96960     1   0.000      0.988 1.000 0.000
#> GSM96975     1   0.000      0.988 1.000 0.000
#> GSM96998     1   0.000      0.988 1.000 0.000
#> GSM96999     1   0.000      0.988 1.000 0.000
#> GSM97001     1   0.000      0.988 1.000 0.000
#> GSM97005     1   0.000      0.988 1.000 0.000
#> GSM97006     1   0.000      0.988 1.000 0.000
#> GSM97021     1   0.000      0.988 1.000 0.000
#> GSM97028     2   0.141      0.978 0.020 0.980
#> GSM97031     1   0.000      0.988 1.000 0.000
#> GSM97037     2   0.000      0.995 0.000 1.000
#> GSM97018     2   0.000      0.995 0.000 1.000
#> GSM97014     2   0.000      0.995 0.000 1.000
#> GSM97042     2   0.000      0.995 0.000 1.000
#> GSM97040     2   0.000      0.995 0.000 1.000
#> GSM97041     1   0.000      0.988 1.000 0.000
#> GSM96955     2   0.000      0.995 0.000 1.000
#> GSM96990     2   0.000      0.995 0.000 1.000
#> GSM96991     2   0.000      0.995 0.000 1.000
#> GSM97048     2   0.000      0.995 0.000 1.000
#> GSM96963     2   0.000      0.995 0.000 1.000
#> GSM96953     2   0.000      0.995 0.000 1.000
#> GSM96966     1   0.000      0.988 1.000 0.000
#> GSM96979     1   0.000      0.988 1.000 0.000
#> GSM96983     2   0.000      0.995 0.000 1.000
#> GSM96984     1   0.184      0.961 0.972 0.028
#> GSM96994     2   0.224      0.963 0.036 0.964
#> GSM96996     1   0.000      0.988 1.000 0.000
#> GSM96997     1   0.000      0.988 1.000 0.000
#> GSM97007     2   0.295      0.947 0.052 0.948
#> GSM96954     1   0.000      0.988 1.000 0.000
#> GSM96962     1   0.000      0.988 1.000 0.000
#> GSM96969     1   0.000      0.988 1.000 0.000
#> GSM96970     1   0.000      0.988 1.000 0.000
#> GSM96973     1   0.000      0.988 1.000 0.000
#> GSM96976     1   0.871      0.599 0.708 0.292
#> GSM96977     1   0.000      0.988 1.000 0.000
#> GSM96995     2   0.443      0.900 0.092 0.908
#> GSM97002     1   0.000      0.988 1.000 0.000
#> GSM97009     2   0.000      0.995 0.000 1.000
#> GSM97010     1   0.000      0.988 1.000 0.000
#> GSM96974     1   0.000      0.988 1.000 0.000
#> GSM96985     1   0.000      0.988 1.000 0.000
#> GSM96959     2   0.000      0.995 0.000 1.000
#> GSM96972     1   0.000      0.988 1.000 0.000
#> GSM96978     1   0.802      0.685 0.756 0.244
#> GSM96967     1   0.000      0.988 1.000 0.000
#> GSM96987     1   0.000      0.988 1.000 0.000
#> GSM97011     1   0.000      0.988 1.000 0.000
#> GSM96964     1   0.000      0.988 1.000 0.000
#> GSM96965     1   0.000      0.988 1.000 0.000
#> GSM96981     1   0.000      0.988 1.000 0.000
#> GSM96982     1   0.000      0.988 1.000 0.000
#> GSM96988     1   0.000      0.988 1.000 0.000
#> GSM97000     1   0.000      0.988 1.000 0.000
#> GSM97004     1   0.000      0.988 1.000 0.000
#> GSM97008     1   0.000      0.988 1.000 0.000
#> GSM96950     1   0.000      0.988 1.000 0.000
#> GSM96980     1   0.000      0.988 1.000 0.000
#> GSM96989     1   0.000      0.988 1.000 0.000
#> GSM96992     1   0.000      0.988 1.000 0.000
#> GSM96993     1   0.000      0.988 1.000 0.000
#> GSM96958     1   0.000      0.988 1.000 0.000
#> GSM96951     1   0.000      0.988 1.000 0.000
#> GSM96952     1   0.000      0.988 1.000 0.000
#> GSM96961     1   0.000      0.988 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
#> GSM97038     3  0.6309    -0.2149 0.000 0.500 0.500
#> GSM97045     2  0.6302     0.1149 0.000 0.520 0.480
#> GSM97047     2  0.5860     0.2246 0.024 0.748 0.228
#> GSM97025     2  0.6302     0.1149 0.000 0.520 0.480
#> GSM97030     2  0.1031     0.2466 0.000 0.976 0.024
#> GSM97027     2  0.6302     0.1149 0.000 0.520 0.480
#> GSM97033     3  0.6309    -0.2149 0.000 0.500 0.500
#> GSM97034     2  0.0475     0.2492 0.004 0.992 0.004
#> GSM97020     3  0.6309    -0.2149 0.000 0.500 0.500
#> GSM97026     2  0.6075     0.1906 0.008 0.676 0.316
#> GSM97012     2  0.6299     0.1180 0.000 0.524 0.476
#> GSM97015     2  0.0475     0.2503 0.004 0.992 0.004
#> GSM97016     2  0.6309     0.0832 0.000 0.500 0.500
#> GSM97017     1  0.2066     0.8196 0.940 0.060 0.000
#> GSM97019     2  0.6299     0.1180 0.000 0.524 0.476
#> GSM97022     2  0.6299     0.1180 0.000 0.524 0.476
#> GSM97035     2  0.6299     0.1180 0.000 0.524 0.476
#> GSM97036     1  0.1337     0.8307 0.972 0.016 0.012
#> GSM97039     2  0.6309     0.0832 0.000 0.500 0.500
#> GSM97046     3  0.6309    -0.2149 0.000 0.500 0.500
#> GSM97023     1  0.0848     0.8292 0.984 0.008 0.008
#> GSM97029     1  0.2878     0.8059 0.904 0.096 0.000
#> GSM97043     2  0.6299     0.1180 0.000 0.524 0.476
#> GSM97013     1  0.0892     0.8290 0.980 0.020 0.000
#> GSM96956     2  0.6308     0.0939 0.000 0.508 0.492
#> GSM97024     2  0.6299     0.1180 0.000 0.524 0.476
#> GSM97032     2  0.0237     0.2490 0.000 0.996 0.004
#> GSM97044     2  0.1031     0.2414 0.000 0.976 0.024
#> GSM97049     2  0.6309     0.0832 0.000 0.500 0.500
#> GSM96968     2  0.9277     0.0452 0.328 0.496 0.176
#> GSM96971     3  0.7841     0.0637 0.052 0.468 0.480
#> GSM96986     2  0.9581     0.0369 0.288 0.476 0.236
#> GSM97003     1  0.5737     0.7938 0.804 0.092 0.104
#> GSM96957     1  0.3272     0.8001 0.892 0.104 0.004
#> GSM96960     1  0.3482     0.7992 0.872 0.000 0.128
#> GSM96975     1  0.1129     0.8299 0.976 0.020 0.004
#> GSM96998     1  0.1643     0.8248 0.956 0.000 0.044
#> GSM96999     1  0.3038     0.8010 0.896 0.104 0.000
#> GSM97001     1  0.3038     0.8010 0.896 0.104 0.000
#> GSM97005     1  0.3038     0.8010 0.896 0.104 0.000
#> GSM97006     1  0.2878     0.8121 0.904 0.000 0.096
#> GSM97021     1  0.4291     0.7376 0.820 0.180 0.000
#> GSM97028     2  0.5730     0.1538 0.060 0.796 0.144
#> GSM97031     1  0.4293     0.7540 0.832 0.164 0.004
#> GSM97037     2  0.6260     0.1289 0.000 0.552 0.448
#> GSM97018     2  0.0237     0.2501 0.004 0.996 0.000
#> GSM97014     2  0.8720     0.1579 0.108 0.480 0.412
#> GSM97042     2  0.6299     0.1180 0.000 0.524 0.476
#> GSM97040     2  0.6793    -0.0810 0.452 0.536 0.012
#> GSM97041     1  0.2796     0.8072 0.908 0.092 0.000
#> GSM96955     2  0.6267     0.1291 0.000 0.548 0.452
#> GSM96990     2  0.0983     0.2495 0.004 0.980 0.016
#> GSM96991     2  0.6299     0.1180 0.000 0.524 0.476
#> GSM97048     2  0.6309     0.0832 0.000 0.500 0.500
#> GSM96963     2  0.6299     0.1180 0.000 0.524 0.476
#> GSM96953     2  0.6299     0.1180 0.000 0.524 0.476
#> GSM96966     1  0.6260     0.5308 0.552 0.000 0.448
#> GSM96979     2  0.9598     0.0304 0.276 0.476 0.248
#> GSM96983     2  0.4834     0.1187 0.004 0.792 0.204
#> GSM96984     2  0.9557     0.0326 0.268 0.484 0.248
#> GSM96994     2  0.8175     0.0615 0.132 0.632 0.236
#> GSM96996     1  0.2796     0.8135 0.908 0.000 0.092
#> GSM96997     2  0.9598     0.0304 0.276 0.476 0.248
#> GSM97007     2  0.8058     0.0631 0.124 0.640 0.236
#> GSM96954     2  0.8865    -0.0804 0.404 0.476 0.120
#> GSM96962     2  0.9563     0.0386 0.284 0.480 0.236
#> GSM96969     1  0.6267     0.5267 0.548 0.000 0.452
#> GSM96970     1  0.6267     0.5267 0.548 0.000 0.452
#> GSM96973     1  0.6267     0.5267 0.548 0.000 0.452
#> GSM96976     3  0.7913     0.0978 0.056 0.452 0.492
#> GSM96977     1  0.5958     0.5758 0.692 0.300 0.008
#> GSM96995     2  0.7633     0.1323 0.264 0.652 0.084
#> GSM97002     1  0.3482     0.7992 0.872 0.000 0.128
#> GSM97009     2  0.9148     0.1937 0.236 0.544 0.220
#> GSM97010     1  0.5500     0.7848 0.816 0.084 0.100
#> GSM96974     3  0.9303     0.1350 0.184 0.316 0.500
#> GSM96985     3  0.9357     0.1134 0.196 0.304 0.500
#> GSM96959     2  0.4802     0.2105 0.156 0.824 0.020
#> GSM96972     1  0.6260     0.5308 0.552 0.000 0.448
#> GSM96978     2  0.8018    -0.1178 0.064 0.520 0.416
#> GSM96967     1  0.6267     0.5267 0.548 0.000 0.452
#> GSM96987     1  0.1411     0.8253 0.964 0.000 0.036
#> GSM97011     1  0.3619     0.7783 0.864 0.136 0.000
#> GSM96964     1  0.0848     0.8292 0.984 0.008 0.008
#> GSM96965     1  0.6754     0.5387 0.556 0.012 0.432
#> GSM96981     1  0.2066     0.8220 0.940 0.000 0.060
#> GSM96982     1  0.4346     0.7682 0.816 0.000 0.184
#> GSM96988     2  0.9464     0.0332 0.248 0.500 0.252
#> GSM97000     1  0.6026     0.4507 0.624 0.376 0.000
#> GSM97004     1  0.4504     0.7570 0.804 0.000 0.196
#> GSM97008     1  0.4235     0.7416 0.824 0.176 0.000
#> GSM96950     1  0.0892     0.8290 0.980 0.020 0.000
#> GSM96980     1  0.6111     0.5807 0.604 0.000 0.396
#> GSM96989     1  0.1411     0.8253 0.964 0.000 0.036
#> GSM96992     1  0.1643     0.8248 0.956 0.000 0.044
#> GSM96993     1  0.1860     0.8238 0.948 0.052 0.000
#> GSM96958     1  0.0424     0.8294 0.992 0.008 0.000
#> GSM96951     1  0.0592     0.8297 0.988 0.012 0.000
#> GSM96952     1  0.1529     0.8250 0.960 0.000 0.040
#> GSM96961     1  0.0661     0.8289 0.988 0.004 0.008

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.1302     0.9104 0.000 0.956 0.000 0.044
#> GSM97045     2  0.1305     0.9240 0.000 0.960 0.036 0.004
#> GSM97047     1  0.7987    -0.1569 0.412 0.392 0.180 0.016
#> GSM97025     2  0.1305     0.9240 0.000 0.960 0.036 0.004
#> GSM97030     3  0.2803     0.8696 0.008 0.080 0.900 0.012
#> GSM97027     2  0.1118     0.9239 0.000 0.964 0.036 0.000
#> GSM97033     2  0.1302     0.9104 0.000 0.956 0.000 0.044
#> GSM97034     3  0.2706     0.8801 0.024 0.064 0.908 0.004
#> GSM97020     2  0.1302     0.9104 0.000 0.956 0.000 0.044
#> GSM97026     2  0.6549     0.5081 0.308 0.604 0.080 0.008
#> GSM97012     2  0.1398     0.9236 0.000 0.956 0.040 0.004
#> GSM97015     3  0.3026     0.8784 0.032 0.056 0.900 0.012
#> GSM97016     2  0.1302     0.9104 0.000 0.956 0.000 0.044
#> GSM97017     1  0.0188     0.7529 0.996 0.000 0.004 0.000
#> GSM97019     2  0.1398     0.9236 0.000 0.956 0.040 0.004
#> GSM97022     2  0.1398     0.9236 0.000 0.956 0.040 0.004
#> GSM97035     2  0.1398     0.9236 0.000 0.956 0.040 0.004
#> GSM97036     1  0.1296     0.7530 0.964 0.004 0.004 0.028
#> GSM97039     2  0.1302     0.9104 0.000 0.956 0.000 0.044
#> GSM97046     2  0.1302     0.9104 0.000 0.956 0.000 0.044
#> GSM97023     1  0.3306     0.6940 0.840 0.000 0.004 0.156
#> GSM97029     1  0.0779     0.7496 0.980 0.004 0.016 0.000
#> GSM97043     2  0.1994     0.9122 0.008 0.936 0.052 0.004
#> GSM97013     1  0.0469     0.7536 0.988 0.000 0.000 0.012
#> GSM96956     2  0.4638     0.7395 0.000 0.776 0.180 0.044
#> GSM97024     2  0.1545     0.9225 0.000 0.952 0.040 0.008
#> GSM97032     3  0.2803     0.8714 0.012 0.080 0.900 0.008
#> GSM97044     3  0.2207     0.8859 0.012 0.056 0.928 0.004
#> GSM97049     2  0.1302     0.9104 0.000 0.956 0.000 0.044
#> GSM96968     3  0.2125     0.8792 0.076 0.004 0.920 0.000
#> GSM96971     3  0.4220     0.6736 0.004 0.000 0.748 0.248
#> GSM96986     3  0.1888     0.8902 0.016 0.000 0.940 0.044
#> GSM97003     1  0.5837     0.4104 0.564 0.000 0.036 0.400
#> GSM96957     1  0.0937     0.7523 0.976 0.000 0.012 0.012
#> GSM96960     1  0.5594     0.2689 0.520 0.000 0.020 0.460
#> GSM96975     1  0.0804     0.7540 0.980 0.000 0.012 0.008
#> GSM96998     1  0.5269     0.4812 0.620 0.000 0.016 0.364
#> GSM96999     1  0.0779     0.7537 0.980 0.000 0.016 0.004
#> GSM97001     1  0.0804     0.7528 0.980 0.000 0.012 0.008
#> GSM97005     1  0.0927     0.7530 0.976 0.000 0.016 0.008
#> GSM97006     1  0.5517     0.3865 0.568 0.000 0.020 0.412
#> GSM97021     1  0.1256     0.7425 0.964 0.000 0.028 0.008
#> GSM97028     3  0.1958     0.8972 0.028 0.008 0.944 0.020
#> GSM97031     1  0.2214     0.7490 0.928 0.000 0.028 0.044
#> GSM97037     2  0.6087     0.4335 0.004 0.596 0.352 0.048
#> GSM97018     3  0.3144     0.8755 0.020 0.072 0.892 0.016
#> GSM97014     1  0.6466    -0.0945 0.496 0.452 0.024 0.028
#> GSM97042     2  0.1398     0.9236 0.000 0.956 0.040 0.004
#> GSM97040     1  0.3882     0.6502 0.848 0.028 0.112 0.012
#> GSM97041     1  0.0336     0.7524 0.992 0.000 0.008 0.000
#> GSM96955     2  0.4534     0.8403 0.072 0.832 0.064 0.032
#> GSM96990     3  0.2718     0.8827 0.020 0.056 0.912 0.012
#> GSM96991     2  0.1545     0.9227 0.000 0.952 0.040 0.008
#> GSM97048     2  0.1302     0.9104 0.000 0.956 0.000 0.044
#> GSM96963     2  0.1356     0.9233 0.000 0.960 0.032 0.008
#> GSM96953     2  0.1209     0.9237 0.000 0.964 0.032 0.004
#> GSM96966     4  0.2813     0.8193 0.080 0.000 0.024 0.896
#> GSM96979     3  0.1888     0.8902 0.016 0.000 0.940 0.044
#> GSM96983     3  0.1396     0.8969 0.004 0.004 0.960 0.032
#> GSM96984     3  0.1888     0.8902 0.016 0.000 0.940 0.044
#> GSM96994     3  0.1109     0.8976 0.004 0.000 0.968 0.028
#> GSM96996     1  0.5414     0.4574 0.604 0.000 0.020 0.376
#> GSM96997     3  0.1888     0.8902 0.016 0.000 0.940 0.044
#> GSM97007     3  0.1109     0.8976 0.004 0.000 0.968 0.028
#> GSM96954     3  0.2197     0.8751 0.080 0.000 0.916 0.004
#> GSM96962     3  0.1888     0.8902 0.016 0.000 0.940 0.044
#> GSM96969     4  0.2813     0.8193 0.080 0.000 0.024 0.896
#> GSM96970     4  0.2813     0.8193 0.080 0.000 0.024 0.896
#> GSM96973     4  0.2670     0.8171 0.072 0.000 0.024 0.904
#> GSM96976     4  0.4134     0.5915 0.000 0.000 0.260 0.740
#> GSM96977     1  0.2944     0.6794 0.868 0.000 0.128 0.004
#> GSM96995     3  0.2660     0.8799 0.072 0.008 0.908 0.012
#> GSM97002     1  0.5590     0.2797 0.524 0.000 0.020 0.456
#> GSM97009     1  0.6926     0.4133 0.636 0.216 0.128 0.020
#> GSM97010     1  0.2926     0.7347 0.896 0.000 0.048 0.056
#> GSM96974     4  0.4008     0.6160 0.000 0.000 0.244 0.756
#> GSM96985     4  0.4741     0.5093 0.004 0.000 0.328 0.668
#> GSM96959     3  0.6042     0.4931 0.348 0.024 0.608 0.020
#> GSM96972     4  0.2593     0.8107 0.080 0.000 0.016 0.904
#> GSM96978     3  0.2156     0.8899 0.008 0.004 0.928 0.060
#> GSM96967     4  0.2813     0.8193 0.080 0.000 0.024 0.896
#> GSM96987     1  0.4855     0.5080 0.644 0.000 0.004 0.352
#> GSM97011     1  0.1284     0.7447 0.964 0.000 0.024 0.012
#> GSM96964     1  0.2654     0.7241 0.888 0.000 0.004 0.108
#> GSM96965     4  0.4426     0.7013 0.204 0.000 0.024 0.772
#> GSM96981     1  0.4621     0.5610 0.708 0.000 0.008 0.284
#> GSM96982     1  0.5277     0.2997 0.532 0.000 0.008 0.460
#> GSM96988     3  0.1545     0.8961 0.008 0.000 0.952 0.040
#> GSM97000     1  0.3161     0.6669 0.864 0.000 0.124 0.012
#> GSM97004     4  0.5511    -0.2391 0.484 0.000 0.016 0.500
#> GSM97008     1  0.1488     0.7405 0.956 0.000 0.032 0.012
#> GSM96950     1  0.0592     0.7533 0.984 0.000 0.000 0.016
#> GSM96980     4  0.2149     0.7949 0.088 0.000 0.000 0.912
#> GSM96989     1  0.4837     0.5128 0.648 0.000 0.004 0.348
#> GSM96992     1  0.5143     0.4904 0.628 0.000 0.012 0.360
#> GSM96993     1  0.1059     0.7535 0.972 0.000 0.012 0.016
#> GSM96958     1  0.0927     0.7538 0.976 0.000 0.008 0.016
#> GSM96951     1  0.2142     0.7434 0.928 0.000 0.016 0.056
#> GSM96952     1  0.5040     0.4883 0.628 0.000 0.008 0.364
#> GSM96961     1  0.3852     0.6752 0.808 0.000 0.012 0.180

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97038     2  0.3305     0.8313 0.000 0.776 0.000 0.224 0.000
#> GSM97045     2  0.0579     0.8708 0.000 0.984 0.008 0.008 0.000
#> GSM97047     5  0.5824     0.4855 0.000 0.104 0.248 0.016 0.632
#> GSM97025     2  0.0579     0.8708 0.000 0.984 0.008 0.008 0.000
#> GSM97030     3  0.2127     0.6989 0.000 0.108 0.892 0.000 0.000
#> GSM97027     2  0.0579     0.8708 0.000 0.984 0.008 0.008 0.000
#> GSM97033     2  0.3305     0.8313 0.000 0.776 0.000 0.224 0.000
#> GSM97034     3  0.2568     0.7018 0.000 0.092 0.888 0.004 0.016
#> GSM97020     2  0.3305     0.8313 0.000 0.776 0.000 0.224 0.000
#> GSM97026     5  0.7079     0.1530 0.000 0.316 0.276 0.012 0.396
#> GSM97012     2  0.0579     0.8695 0.000 0.984 0.008 0.008 0.000
#> GSM97015     3  0.2570     0.7046 0.000 0.084 0.888 0.000 0.028
#> GSM97016     2  0.3305     0.8313 0.000 0.776 0.000 0.224 0.000
#> GSM97017     5  0.0932     0.7560 0.020 0.000 0.004 0.004 0.972
#> GSM97019     2  0.0579     0.8695 0.000 0.984 0.008 0.008 0.000
#> GSM97022     2  0.0579     0.8695 0.000 0.984 0.008 0.008 0.000
#> GSM97035     2  0.0579     0.8695 0.000 0.984 0.008 0.008 0.000
#> GSM97036     5  0.4108     0.6597 0.188 0.004 0.024 0.008 0.776
#> GSM97039     2  0.3305     0.8313 0.000 0.776 0.000 0.224 0.000
#> GSM97046     2  0.3305     0.8313 0.000 0.776 0.000 0.224 0.000
#> GSM97023     5  0.4151     0.3726 0.344 0.000 0.000 0.004 0.652
#> GSM97029     5  0.1518     0.7521 0.048 0.000 0.004 0.004 0.944
#> GSM97043     2  0.3422     0.7030 0.000 0.792 0.200 0.004 0.004
#> GSM97013     5  0.2228     0.7334 0.092 0.000 0.004 0.004 0.900
#> GSM96956     2  0.6285     0.5637 0.000 0.536 0.244 0.220 0.000
#> GSM97024     2  0.1341     0.8442 0.000 0.944 0.056 0.000 0.000
#> GSM97032     3  0.2304     0.7009 0.000 0.100 0.892 0.000 0.008
#> GSM97044     3  0.2069     0.7159 0.000 0.076 0.912 0.012 0.000
#> GSM97049     2  0.3305     0.8313 0.000 0.776 0.000 0.224 0.000
#> GSM96968     3  0.2989     0.7146 0.000 0.000 0.868 0.072 0.060
#> GSM96971     4  0.5651    -0.2006 0.044 0.000 0.428 0.512 0.016
#> GSM96986     3  0.5033     0.6247 0.016 0.000 0.660 0.292 0.032
#> GSM97003     1  0.6228     0.4622 0.592 0.000 0.012 0.176 0.220
#> GSM96957     5  0.1430     0.7534 0.052 0.000 0.004 0.000 0.944
#> GSM96960     1  0.4438     0.5725 0.732 0.000 0.004 0.040 0.224
#> GSM96975     5  0.3805     0.6456 0.192 0.000 0.016 0.008 0.784
#> GSM96998     1  0.4130     0.5375 0.696 0.000 0.000 0.012 0.292
#> GSM96999     5  0.1430     0.7534 0.052 0.000 0.004 0.000 0.944
#> GSM97001     5  0.0703     0.7561 0.024 0.000 0.000 0.000 0.976
#> GSM97005     5  0.0693     0.7557 0.012 0.000 0.000 0.008 0.980
#> GSM97006     1  0.4552     0.5664 0.716 0.000 0.004 0.040 0.240
#> GSM97021     5  0.1557     0.7469 0.000 0.000 0.052 0.008 0.940
#> GSM97028     3  0.1960     0.7006 0.000 0.020 0.928 0.048 0.004
#> GSM97031     5  0.3021     0.7199 0.064 0.000 0.004 0.060 0.872
#> GSM97037     3  0.6477    -0.0911 0.000 0.352 0.456 0.192 0.000
#> GSM97018     3  0.2734     0.6986 0.000 0.076 0.888 0.028 0.008
#> GSM97014     5  0.4759     0.6434 0.000 0.088 0.072 0.060 0.780
#> GSM97042     2  0.0579     0.8695 0.000 0.984 0.008 0.008 0.000
#> GSM97040     5  0.3622     0.6642 0.000 0.016 0.172 0.008 0.804
#> GSM97041     5  0.0932     0.7560 0.020 0.000 0.004 0.004 0.972
#> GSM96955     2  0.5964     0.6492 0.004 0.692 0.144 0.076 0.084
#> GSM96990     3  0.2450     0.7086 0.000 0.076 0.896 0.000 0.028
#> GSM96991     2  0.1012     0.8646 0.000 0.968 0.020 0.012 0.000
#> GSM97048     2  0.3305     0.8313 0.000 0.776 0.000 0.224 0.000
#> GSM96963     2  0.1216     0.8655 0.000 0.960 0.020 0.020 0.000
#> GSM96953     2  0.0992     0.8694 0.000 0.968 0.008 0.024 0.000
#> GSM96966     1  0.4464    -0.2072 0.584 0.000 0.000 0.408 0.008
#> GSM96979     3  0.5102     0.6230 0.020 0.000 0.660 0.288 0.032
#> GSM96983     3  0.2497     0.7017 0.000 0.004 0.880 0.112 0.004
#> GSM96984     3  0.5012     0.6263 0.016 0.000 0.664 0.288 0.032
#> GSM96994     3  0.4673     0.6251 0.012 0.000 0.680 0.288 0.020
#> GSM96996     1  0.4016     0.5503 0.716 0.000 0.000 0.012 0.272
#> GSM96997     3  0.5226     0.6116 0.024 0.000 0.648 0.296 0.032
#> GSM97007     3  0.4935     0.6277 0.016 0.000 0.668 0.288 0.028
#> GSM96954     3  0.5139     0.6364 0.004 0.000 0.680 0.236 0.080
#> GSM96962     3  0.5012     0.6263 0.016 0.000 0.664 0.288 0.032
#> GSM96969     1  0.4350    -0.2156 0.588 0.000 0.000 0.408 0.004
#> GSM96970     1  0.4350    -0.2156 0.588 0.000 0.000 0.408 0.004
#> GSM96973     1  0.4499    -0.2235 0.584 0.000 0.004 0.408 0.004
#> GSM96976     4  0.6195     0.5502 0.360 0.000 0.128 0.508 0.004
#> GSM96977     5  0.4107     0.7201 0.072 0.000 0.120 0.008 0.800
#> GSM96995     3  0.1704     0.7042 0.000 0.000 0.928 0.004 0.068
#> GSM97002     1  0.3934     0.5708 0.740 0.000 0.000 0.016 0.244
#> GSM97009     5  0.4458     0.6669 0.008 0.044 0.132 0.024 0.792
#> GSM97010     5  0.4037     0.6921 0.176 0.000 0.028 0.012 0.784
#> GSM96974     4  0.6281     0.5245 0.388 0.000 0.152 0.460 0.000
#> GSM96985     1  0.6477    -0.3816 0.464 0.000 0.340 0.196 0.000
#> GSM96959     5  0.5198     0.3499 0.000 0.020 0.372 0.020 0.588
#> GSM96972     1  0.4359    -0.2183 0.584 0.000 0.000 0.412 0.004
#> GSM96978     3  0.2911     0.6935 0.004 0.000 0.852 0.136 0.008
#> GSM96967     1  0.4350    -0.2156 0.588 0.000 0.000 0.408 0.004
#> GSM96987     1  0.4009     0.5226 0.684 0.000 0.000 0.004 0.312
#> GSM97011     5  0.1949     0.7490 0.012 0.000 0.040 0.016 0.932
#> GSM96964     5  0.4430     0.0800 0.456 0.000 0.000 0.004 0.540
#> GSM96965     1  0.6100    -0.3098 0.472 0.000 0.004 0.416 0.108
#> GSM96981     1  0.5020     0.2969 0.564 0.000 0.012 0.016 0.408
#> GSM96982     1  0.4684     0.5686 0.720 0.000 0.028 0.020 0.232
#> GSM96988     3  0.2228     0.7029 0.004 0.000 0.900 0.092 0.004
#> GSM97000     5  0.2642     0.7264 0.004 0.000 0.084 0.024 0.888
#> GSM97004     1  0.3663     0.5800 0.776 0.000 0.000 0.016 0.208
#> GSM97008     5  0.1596     0.7533 0.012 0.000 0.028 0.012 0.948
#> GSM96950     5  0.2964     0.6929 0.152 0.000 0.004 0.004 0.840
#> GSM96980     1  0.2462     0.2622 0.880 0.000 0.000 0.112 0.008
#> GSM96989     1  0.4029     0.5178 0.680 0.000 0.000 0.004 0.316
#> GSM96992     1  0.4059     0.5354 0.700 0.000 0.004 0.004 0.292
#> GSM96993     5  0.3691     0.6856 0.164 0.000 0.028 0.004 0.804
#> GSM96958     5  0.3969     0.4891 0.304 0.000 0.004 0.000 0.692
#> GSM96951     5  0.4426     0.3199 0.380 0.000 0.004 0.004 0.612
#> GSM96952     1  0.3906     0.5327 0.704 0.000 0.004 0.000 0.292
#> GSM96961     1  0.4545     0.2076 0.560 0.000 0.004 0.004 0.432

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.5438     0.7301 0.008 0.636 0.004 0.088 0.016 0.248
#> GSM97045     2  0.0363     0.7987 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM97047     5  0.3505     0.6496 0.000 0.048 0.136 0.008 0.808 0.000
#> GSM97025     2  0.0363     0.7987 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM97030     3  0.3521     0.6021 0.000 0.120 0.812 0.000 0.060 0.008
#> GSM97027     2  0.0363     0.7987 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM97033     2  0.5281     0.7332 0.008 0.644 0.000 0.088 0.016 0.244
#> GSM97034     3  0.3618     0.6150 0.000 0.104 0.808 0.008 0.080 0.000
#> GSM97020     2  0.5281     0.7332 0.008 0.644 0.000 0.088 0.016 0.244
#> GSM97026     5  0.7378     0.0255 0.008 0.272 0.272 0.008 0.380 0.060
#> GSM97012     2  0.0146     0.8004 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM97015     3  0.3325     0.6111 0.000 0.084 0.820 0.000 0.096 0.000
#> GSM97016     2  0.5303     0.7322 0.008 0.640 0.000 0.088 0.016 0.248
#> GSM97017     5  0.3053     0.7487 0.100 0.000 0.008 0.004 0.852 0.036
#> GSM97019     2  0.0363     0.7987 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM97022     2  0.0363     0.7987 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM97035     2  0.0000     0.8005 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97036     5  0.5988     0.3581 0.368 0.000 0.024 0.008 0.500 0.100
#> GSM97039     2  0.5303     0.7322 0.008 0.640 0.000 0.088 0.016 0.248
#> GSM97046     2  0.5323     0.7307 0.008 0.636 0.000 0.088 0.016 0.252
#> GSM97023     1  0.4865     0.4565 0.632 0.000 0.000 0.004 0.284 0.080
#> GSM97029     5  0.3892     0.7363 0.116 0.000 0.008 0.004 0.792 0.080
#> GSM97043     2  0.3422     0.5980 0.000 0.788 0.176 0.000 0.036 0.000
#> GSM97013     5  0.5099     0.6324 0.232 0.000 0.000 0.012 0.648 0.108
#> GSM96956     2  0.7814     0.3399 0.008 0.360 0.272 0.088 0.020 0.252
#> GSM97024     2  0.1152     0.7767 0.000 0.952 0.044 0.000 0.004 0.000
#> GSM97032     3  0.3285     0.6084 0.000 0.116 0.820 0.000 0.064 0.000
#> GSM97044     3  0.3819     0.5796 0.000 0.084 0.812 0.000 0.048 0.056
#> GSM97049     2  0.5303     0.7322 0.008 0.640 0.000 0.088 0.016 0.248
#> GSM96968     3  0.3992     0.4883 0.008 0.000 0.788 0.008 0.120 0.076
#> GSM96971     6  0.6252     0.3247 0.004 0.000 0.236 0.368 0.004 0.388
#> GSM96986     6  0.4644     0.8505 0.012 0.000 0.456 0.000 0.020 0.512
#> GSM97003     1  0.4666     0.6006 0.688 0.000 0.012 0.020 0.028 0.252
#> GSM96957     5  0.3821     0.7229 0.156 0.000 0.000 0.004 0.776 0.064
#> GSM96960     1  0.2112     0.7806 0.916 0.000 0.000 0.036 0.020 0.028
#> GSM96975     5  0.5230     0.4959 0.312 0.000 0.020 0.004 0.604 0.060
#> GSM96998     1  0.2803     0.7970 0.872 0.000 0.000 0.012 0.052 0.064
#> GSM96999     5  0.3959     0.7126 0.172 0.000 0.000 0.004 0.760 0.064
#> GSM97001     5  0.2333     0.7454 0.120 0.000 0.000 0.004 0.872 0.004
#> GSM97005     5  0.2275     0.7528 0.096 0.000 0.000 0.008 0.888 0.008
#> GSM97006     1  0.1851     0.7815 0.928 0.000 0.000 0.036 0.012 0.024
#> GSM97021     5  0.2170     0.7574 0.044 0.000 0.016 0.008 0.916 0.016
#> GSM97028     3  0.3540     0.5481 0.004 0.020 0.848 0.040 0.024 0.064
#> GSM97031     5  0.4394     0.6762 0.148 0.000 0.000 0.008 0.736 0.108
#> GSM97037     3  0.7637     0.0402 0.004 0.244 0.420 0.056 0.044 0.232
#> GSM97018     3  0.4266     0.6162 0.000 0.080 0.796 0.020 0.068 0.036
#> GSM97014     5  0.1743     0.7452 0.000 0.004 0.028 0.008 0.936 0.024
#> GSM97042     2  0.0000     0.8005 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97040     5  0.2312     0.7336 0.012 0.000 0.080 0.008 0.896 0.004
#> GSM97041     5  0.3170     0.7482 0.104 0.000 0.008 0.004 0.844 0.040
#> GSM96955     2  0.7340     0.3041 0.004 0.504 0.232 0.036 0.124 0.100
#> GSM96990     3  0.3112     0.6128 0.000 0.068 0.836 0.000 0.096 0.000
#> GSM96991     2  0.1053     0.7908 0.000 0.964 0.020 0.004 0.000 0.012
#> GSM97048     2  0.5303     0.7322 0.008 0.640 0.000 0.088 0.016 0.248
#> GSM96963     2  0.1237     0.7915 0.000 0.956 0.020 0.004 0.000 0.020
#> GSM96953     2  0.0405     0.8002 0.000 0.988 0.000 0.004 0.000 0.008
#> GSM96966     4  0.2378     0.9252 0.152 0.000 0.000 0.848 0.000 0.000
#> GSM96979     6  0.4540     0.8717 0.012 0.000 0.472 0.004 0.008 0.504
#> GSM96983     3  0.3685     0.4461 0.004 0.008 0.812 0.040 0.008 0.128
#> GSM96984     6  0.4541     0.8703 0.012 0.000 0.476 0.004 0.008 0.500
#> GSM96994     6  0.4639     0.8694 0.012 0.000 0.472 0.008 0.008 0.500
#> GSM96996     1  0.2434     0.7992 0.896 0.000 0.000 0.016 0.056 0.032
#> GSM96997     6  0.4624     0.8491 0.024 0.000 0.452 0.000 0.008 0.516
#> GSM97007     6  0.4541     0.8703 0.012 0.000 0.476 0.004 0.008 0.500
#> GSM96954     3  0.5748    -0.4116 0.004 0.000 0.512 0.008 0.124 0.352
#> GSM96962     6  0.4540     0.8717 0.012 0.000 0.472 0.004 0.008 0.504
#> GSM96969     4  0.2378     0.9252 0.152 0.000 0.000 0.848 0.000 0.000
#> GSM96970     4  0.2378     0.9252 0.152 0.000 0.000 0.848 0.000 0.000
#> GSM96973     4  0.2378     0.9252 0.152 0.000 0.000 0.848 0.000 0.000
#> GSM96976     4  0.3038     0.8074 0.012 0.000 0.060 0.856 0.000 0.072
#> GSM96977     5  0.5459     0.6819 0.076 0.000 0.128 0.012 0.696 0.088
#> GSM96995     3  0.2982     0.5438 0.000 0.000 0.820 0.004 0.164 0.012
#> GSM97002     1  0.2024     0.7902 0.920 0.000 0.000 0.036 0.028 0.016
#> GSM97009     5  0.2423     0.7346 0.004 0.016 0.064 0.004 0.900 0.012
#> GSM97010     5  0.5455     0.6398 0.216 0.000 0.024 0.012 0.652 0.096
#> GSM96974     4  0.2858     0.8122 0.016 0.000 0.092 0.864 0.000 0.028
#> GSM96985     3  0.7536     0.0926 0.204 0.004 0.440 0.188 0.008 0.156
#> GSM96959     5  0.3627     0.5988 0.004 0.000 0.200 0.012 0.772 0.012
#> GSM96972     4  0.2814     0.9041 0.172 0.000 0.000 0.820 0.000 0.008
#> GSM96978     3  0.4060     0.4118 0.004 0.008 0.772 0.040 0.008 0.168
#> GSM96967     4  0.2378     0.9252 0.152 0.000 0.000 0.848 0.000 0.000
#> GSM96987     1  0.3204     0.7684 0.836 0.000 0.000 0.004 0.068 0.092
#> GSM97011     5  0.1484     0.7587 0.040 0.000 0.008 0.004 0.944 0.004
#> GSM96964     1  0.4633     0.6163 0.704 0.000 0.000 0.008 0.188 0.100
#> GSM96965     4  0.3516     0.8411 0.072 0.000 0.008 0.832 0.076 0.012
#> GSM96981     1  0.5007     0.5461 0.660 0.000 0.024 0.012 0.264 0.040
#> GSM96982     1  0.4273     0.7156 0.800 0.000 0.076 0.028 0.052 0.044
#> GSM96988     3  0.3833     0.4640 0.004 0.008 0.808 0.040 0.016 0.124
#> GSM97000     5  0.1819     0.7483 0.024 0.000 0.032 0.004 0.932 0.008
#> GSM97004     1  0.1850     0.7779 0.924 0.000 0.000 0.052 0.008 0.016
#> GSM97008     5  0.1872     0.7549 0.064 0.000 0.004 0.004 0.920 0.008
#> GSM96950     5  0.5378     0.5254 0.304 0.000 0.000 0.008 0.576 0.112
#> GSM96980     1  0.4083     0.3490 0.668 0.000 0.000 0.304 0.000 0.028
#> GSM96989     1  0.3260     0.7666 0.832 0.000 0.000 0.004 0.072 0.092
#> GSM96992     1  0.1942     0.8023 0.916 0.000 0.000 0.012 0.064 0.008
#> GSM96993     5  0.6054     0.3941 0.348 0.000 0.024 0.008 0.508 0.112
#> GSM96958     5  0.5302     0.1667 0.448 0.000 0.000 0.012 0.472 0.068
#> GSM96951     1  0.4728     0.3724 0.616 0.000 0.000 0.004 0.324 0.056
#> GSM96952     1  0.1728     0.8014 0.924 0.000 0.000 0.004 0.064 0.008
#> GSM96961     1  0.2752     0.7697 0.856 0.000 0.000 0.000 0.108 0.036

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-kmeans-collect-classes

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

test_to_known_factors(res)
#>             n disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:kmeans 100         1.13e-05       0.298     4.23e-14   0.1231 2
#> CV:kmeans  44               NA          NA           NA       NA 3
#> CV:kmeans  85         2.83e-04       0.141     1.07e-17   0.0345 4
#> CV:kmeans  79         5.99e-03       0.390     3.70e-13   0.1147 5
#> CV:kmeans  82         4.78e-05       0.206     1.42e-15   0.0045 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 21168 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.983       0.992         0.5002 0.500   0.500
#> 3 3 0.671           0.414       0.731         0.3219 0.754   0.543
#> 4 4 0.681           0.740       0.870         0.1324 0.806   0.495
#> 5 5 0.643           0.589       0.724         0.0591 0.904   0.647
#> 6 6 0.640           0.493       0.704         0.0424 0.940   0.726

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
#> GSM97038     2  0.0000      0.991 0.000 1.000
#> GSM97045     2  0.0000      0.991 0.000 1.000
#> GSM97047     2  0.0000      0.991 0.000 1.000
#> GSM97025     2  0.0000      0.991 0.000 1.000
#> GSM97030     2  0.0000      0.991 0.000 1.000
#> GSM97027     2  0.0000      0.991 0.000 1.000
#> GSM97033     2  0.0000      0.991 0.000 1.000
#> GSM97034     2  0.0000      0.991 0.000 1.000
#> GSM97020     2  0.0000      0.991 0.000 1.000
#> GSM97026     2  0.0000      0.991 0.000 1.000
#> GSM97012     2  0.0000      0.991 0.000 1.000
#> GSM97015     2  0.0000      0.991 0.000 1.000
#> GSM97016     2  0.0000      0.991 0.000 1.000
#> GSM97017     1  0.0672      0.988 0.992 0.008
#> GSM97019     2  0.0000      0.991 0.000 1.000
#> GSM97022     2  0.0000      0.991 0.000 1.000
#> GSM97035     2  0.0000      0.991 0.000 1.000
#> GSM97036     1  0.1633      0.974 0.976 0.024
#> GSM97039     2  0.0000      0.991 0.000 1.000
#> GSM97046     2  0.0000      0.991 0.000 1.000
#> GSM97023     1  0.0000      0.993 1.000 0.000
#> GSM97029     1  0.0938      0.984 0.988 0.012
#> GSM97043     2  0.0000      0.991 0.000 1.000
#> GSM97013     1  0.0000      0.993 1.000 0.000
#> GSM96956     2  0.0000      0.991 0.000 1.000
#> GSM97024     2  0.0000      0.991 0.000 1.000
#> GSM97032     2  0.0000      0.991 0.000 1.000
#> GSM97044     2  0.0000      0.991 0.000 1.000
#> GSM97049     2  0.0000      0.991 0.000 1.000
#> GSM96968     1  0.7299      0.744 0.796 0.204
#> GSM96971     1  0.0000      0.993 1.000 0.000
#> GSM96986     1  0.0000      0.993 1.000 0.000
#> GSM97003     1  0.0000      0.993 1.000 0.000
#> GSM96957     1  0.0000      0.993 1.000 0.000
#> GSM96960     1  0.0000      0.993 1.000 0.000
#> GSM96975     1  0.0000      0.993 1.000 0.000
#> GSM96998     1  0.0000      0.993 1.000 0.000
#> GSM96999     1  0.0000      0.993 1.000 0.000
#> GSM97001     1  0.0000      0.993 1.000 0.000
#> GSM97005     1  0.0000      0.993 1.000 0.000
#> GSM97006     1  0.0000      0.993 1.000 0.000
#> GSM97021     1  0.1184      0.981 0.984 0.016
#> GSM97028     2  0.0000      0.991 0.000 1.000
#> GSM97031     1  0.0000      0.993 1.000 0.000
#> GSM97037     2  0.0000      0.991 0.000 1.000
#> GSM97018     2  0.0000      0.991 0.000 1.000
#> GSM97014     2  0.0000      0.991 0.000 1.000
#> GSM97042     2  0.0000      0.991 0.000 1.000
#> GSM97040     2  0.0000      0.991 0.000 1.000
#> GSM97041     1  0.0672      0.988 0.992 0.008
#> GSM96955     2  0.0000      0.991 0.000 1.000
#> GSM96990     2  0.0000      0.991 0.000 1.000
#> GSM96991     2  0.0000      0.991 0.000 1.000
#> GSM97048     2  0.0000      0.991 0.000 1.000
#> GSM96963     2  0.0000      0.991 0.000 1.000
#> GSM96953     2  0.0000      0.991 0.000 1.000
#> GSM96966     1  0.0000      0.993 1.000 0.000
#> GSM96979     1  0.0000      0.993 1.000 0.000
#> GSM96983     2  0.0000      0.991 0.000 1.000
#> GSM96984     2  0.7674      0.718 0.224 0.776
#> GSM96994     2  0.0000      0.991 0.000 1.000
#> GSM96996     1  0.0000      0.993 1.000 0.000
#> GSM96997     1  0.0000      0.993 1.000 0.000
#> GSM97007     2  0.0000      0.991 0.000 1.000
#> GSM96954     1  0.0000      0.993 1.000 0.000
#> GSM96962     1  0.0000      0.993 1.000 0.000
#> GSM96969     1  0.0000      0.993 1.000 0.000
#> GSM96970     1  0.0000      0.993 1.000 0.000
#> GSM96973     1  0.0000      0.993 1.000 0.000
#> GSM96976     2  0.1843      0.965 0.028 0.972
#> GSM96977     1  0.0000      0.993 1.000 0.000
#> GSM96995     2  0.0000      0.991 0.000 1.000
#> GSM97002     1  0.0000      0.993 1.000 0.000
#> GSM97009     2  0.0000      0.991 0.000 1.000
#> GSM97010     1  0.0000      0.993 1.000 0.000
#> GSM96974     1  0.1633      0.973 0.976 0.024
#> GSM96985     1  0.0000      0.993 1.000 0.000
#> GSM96959     2  0.0000      0.991 0.000 1.000
#> GSM96972     1  0.0000      0.993 1.000 0.000
#> GSM96978     2  0.6438      0.807 0.164 0.836
#> GSM96967     1  0.0000      0.993 1.000 0.000
#> GSM96987     1  0.0000      0.993 1.000 0.000
#> GSM97011     1  0.0672      0.988 0.992 0.008
#> GSM96964     1  0.0000      0.993 1.000 0.000
#> GSM96965     1  0.0000      0.993 1.000 0.000
#> GSM96981     1  0.0000      0.993 1.000 0.000
#> GSM96982     1  0.0000      0.993 1.000 0.000
#> GSM96988     1  0.2948      0.944 0.948 0.052
#> GSM97000     1  0.0000      0.993 1.000 0.000
#> GSM97004     1  0.0000      0.993 1.000 0.000
#> GSM97008     1  0.0000      0.993 1.000 0.000
#> GSM96950     1  0.0000      0.993 1.000 0.000
#> GSM96980     1  0.0000      0.993 1.000 0.000
#> GSM96989     1  0.0000      0.993 1.000 0.000
#> GSM96992     1  0.0000      0.993 1.000 0.000
#> GSM96993     1  0.0000      0.993 1.000 0.000
#> GSM96958     1  0.0000      0.993 1.000 0.000
#> GSM96951     1  0.0000      0.993 1.000 0.000
#> GSM96952     1  0.0000      0.993 1.000 0.000
#> GSM96961     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
#> GSM97038     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97045     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97047     2  0.0424     0.9066 0.000 0.992 0.008
#> GSM97025     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97030     2  0.5733     0.6573 0.000 0.676 0.324
#> GSM97027     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97033     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97034     2  0.6168     0.5472 0.000 0.588 0.412
#> GSM97020     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97026     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97012     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97015     2  0.6062     0.5862 0.000 0.616 0.384
#> GSM97016     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97017     3  0.6683    -0.4860 0.492 0.008 0.500
#> GSM97019     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97022     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97035     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97036     3  0.7493    -0.4751 0.480 0.036 0.484
#> GSM97039     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97046     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97023     3  0.6309    -0.4931 0.500 0.000 0.500
#> GSM97029     3  0.6954    -0.4807 0.484 0.016 0.500
#> GSM97043     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97013     3  0.6309    -0.4931 0.500 0.000 0.500
#> GSM96956     2  0.0592     0.9045 0.000 0.988 0.012
#> GSM97024     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97032     2  0.5859     0.6348 0.000 0.656 0.344
#> GSM97044     2  0.6305     0.4335 0.000 0.516 0.484
#> GSM97049     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM96968     3  0.6587     0.3144 0.424 0.008 0.568
#> GSM96971     3  0.6309     0.3298 0.500 0.000 0.500
#> GSM96986     3  0.6307     0.3316 0.488 0.000 0.512
#> GSM97003     1  0.4842     0.4624 0.776 0.000 0.224
#> GSM96957     1  0.6309     0.4591 0.500 0.000 0.500
#> GSM96960     1  0.4796     0.4869 0.780 0.000 0.220
#> GSM96975     1  0.6180     0.4891 0.584 0.000 0.416
#> GSM96998     1  0.6299     0.4717 0.524 0.000 0.476
#> GSM96999     1  0.6309     0.4591 0.500 0.000 0.500
#> GSM97001     3  0.6309    -0.4931 0.500 0.000 0.500
#> GSM97005     1  0.6309     0.4591 0.500 0.000 0.500
#> GSM97006     1  0.6204     0.4884 0.576 0.000 0.424
#> GSM97021     3  0.6669    -0.4705 0.468 0.008 0.524
#> GSM97028     3  0.9303    -0.0435 0.184 0.316 0.500
#> GSM97031     3  0.6252    -0.4559 0.444 0.000 0.556
#> GSM97037     2  0.0892     0.9002 0.000 0.980 0.020
#> GSM97018     2  0.5785     0.6459 0.000 0.668 0.332
#> GSM97014     2  0.1163     0.8900 0.000 0.972 0.028
#> GSM97042     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97040     2  0.5650     0.5742 0.000 0.688 0.312
#> GSM97041     3  0.6683    -0.4860 0.492 0.008 0.500
#> GSM96955     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM96990     2  0.6008     0.6022 0.000 0.628 0.372
#> GSM96991     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM97048     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM96963     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM96953     2  0.0000     0.9099 0.000 1.000 0.000
#> GSM96966     1  0.0000     0.3754 1.000 0.000 0.000
#> GSM96979     3  0.6309     0.3298 0.500 0.000 0.500
#> GSM96983     3  0.7578     0.3273 0.460 0.040 0.500
#> GSM96984     3  0.6521     0.3322 0.492 0.004 0.504
#> GSM96994     3  0.6825     0.3324 0.488 0.012 0.500
#> GSM96996     1  0.5926     0.5003 0.644 0.000 0.356
#> GSM96997     3  0.6307     0.3316 0.488 0.000 0.512
#> GSM97007     3  0.6954     0.3322 0.484 0.016 0.500
#> GSM96954     3  0.5621     0.2468 0.308 0.000 0.692
#> GSM96962     3  0.6307     0.3316 0.488 0.000 0.512
#> GSM96969     1  0.0000     0.3754 1.000 0.000 0.000
#> GSM96970     1  0.0000     0.3754 1.000 0.000 0.000
#> GSM96973     1  0.0000     0.3754 1.000 0.000 0.000
#> GSM96976     1  0.8721    -0.3143 0.504 0.112 0.384
#> GSM96977     3  0.5760    -0.1383 0.328 0.000 0.672
#> GSM96995     3  0.8807    -0.1853 0.120 0.376 0.504
#> GSM97002     1  0.5058     0.4937 0.756 0.000 0.244
#> GSM97009     2  0.0592     0.9027 0.000 0.988 0.012
#> GSM97010     1  0.2599     0.3252 0.932 0.016 0.052
#> GSM96974     1  0.6267    -0.3310 0.548 0.000 0.452
#> GSM96985     1  0.6260    -0.3275 0.552 0.000 0.448
#> GSM96959     2  0.4605     0.7769 0.000 0.796 0.204
#> GSM96972     1  0.0000     0.3754 1.000 0.000 0.000
#> GSM96978     3  0.6521     0.3311 0.496 0.004 0.500
#> GSM96967     1  0.0000     0.3754 1.000 0.000 0.000
#> GSM96987     1  0.6307     0.4666 0.512 0.000 0.488
#> GSM97011     3  0.7392    -0.4683 0.468 0.032 0.500
#> GSM96964     1  0.6309     0.4629 0.504 0.000 0.496
#> GSM96965     1  0.0747     0.3583 0.984 0.016 0.000
#> GSM96981     1  0.6008     0.4989 0.628 0.000 0.372
#> GSM96982     1  0.3482     0.4532 0.872 0.000 0.128
#> GSM96988     3  0.6309     0.3298 0.500 0.000 0.500
#> GSM97000     3  0.5560    -0.3387 0.300 0.000 0.700
#> GSM97004     1  0.5497     0.4999 0.708 0.000 0.292
#> GSM97008     3  0.6260    -0.4572 0.448 0.000 0.552
#> GSM96950     1  0.6309     0.4629 0.504 0.000 0.496
#> GSM96980     1  0.2625     0.4294 0.916 0.000 0.084
#> GSM96989     1  0.6305     0.4686 0.516 0.000 0.484
#> GSM96992     1  0.6308     0.4655 0.508 0.000 0.492
#> GSM96993     1  0.6307     0.4666 0.512 0.000 0.488
#> GSM96958     1  0.6309     0.4629 0.504 0.000 0.496
#> GSM96951     3  0.6309    -0.4931 0.500 0.000 0.500
#> GSM96952     1  0.6309     0.4629 0.504 0.000 0.496
#> GSM96961     1  0.6309     0.4591 0.500 0.000 0.500

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM97045     2  0.0188     0.9481 0.000 0.996 0.004 0.000
#> GSM97047     2  0.5337     0.6441 0.260 0.696 0.044 0.000
#> GSM97025     2  0.0188     0.9481 0.000 0.996 0.004 0.000
#> GSM97030     3  0.4134     0.7034 0.000 0.260 0.740 0.000
#> GSM97027     2  0.0188     0.9481 0.000 0.996 0.004 0.000
#> GSM97033     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM97034     3  0.3764     0.7552 0.000 0.216 0.784 0.000
#> GSM97020     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM97026     2  0.0937     0.9371 0.012 0.976 0.012 0.000
#> GSM97012     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM97015     3  0.3569     0.7711 0.000 0.196 0.804 0.000
#> GSM97016     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM97017     1  0.0000     0.7920 1.000 0.000 0.000 0.000
#> GSM97019     2  0.0188     0.9481 0.000 0.996 0.004 0.000
#> GSM97022     2  0.0188     0.9481 0.000 0.996 0.004 0.000
#> GSM97035     2  0.0188     0.9481 0.000 0.996 0.004 0.000
#> GSM97036     4  0.6499     0.2500 0.400 0.076 0.000 0.524
#> GSM97039     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM97023     1  0.3074     0.7442 0.848 0.000 0.000 0.152
#> GSM97029     1  0.1706     0.7894 0.948 0.016 0.000 0.036
#> GSM97043     2  0.0188     0.9481 0.000 0.996 0.004 0.000
#> GSM97013     1  0.2760     0.7578 0.872 0.000 0.000 0.128
#> GSM96956     2  0.2704     0.8234 0.000 0.876 0.124 0.000
#> GSM97024     2  0.0188     0.9481 0.000 0.996 0.004 0.000
#> GSM97032     3  0.4643     0.5725 0.000 0.344 0.656 0.000
#> GSM97044     3  0.2081     0.8387 0.000 0.084 0.916 0.000
#> GSM97049     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM96968     3  0.0524     0.8537 0.004 0.000 0.988 0.008
#> GSM96971     3  0.3610     0.7242 0.000 0.000 0.800 0.200
#> GSM96986     3  0.1059     0.8521 0.012 0.000 0.972 0.016
#> GSM97003     4  0.5993     0.6258 0.148 0.000 0.160 0.692
#> GSM96957     1  0.0657     0.7935 0.984 0.000 0.004 0.012
#> GSM96960     4  0.3479     0.7161 0.148 0.000 0.012 0.840
#> GSM96975     4  0.4888     0.2650 0.412 0.000 0.000 0.588
#> GSM96998     4  0.4356     0.5679 0.292 0.000 0.000 0.708
#> GSM96999     1  0.3810     0.7072 0.804 0.000 0.008 0.188
#> GSM97001     1  0.0336     0.7922 0.992 0.000 0.008 0.000
#> GSM97005     1  0.0469     0.7914 0.988 0.000 0.012 0.000
#> GSM97006     4  0.4699     0.5259 0.320 0.000 0.004 0.676
#> GSM97021     1  0.0336     0.7912 0.992 0.000 0.008 0.000
#> GSM97028     3  0.1256     0.8544 0.000 0.028 0.964 0.008
#> GSM97031     1  0.3687     0.7697 0.856 0.000 0.064 0.080
#> GSM97037     2  0.3123     0.7776 0.000 0.844 0.156 0.000
#> GSM97018     3  0.4790     0.4945 0.000 0.380 0.620 0.000
#> GSM97014     2  0.4877     0.4138 0.408 0.592 0.000 0.000
#> GSM97042     2  0.0188     0.9481 0.000 0.996 0.004 0.000
#> GSM97040     1  0.3959     0.6722 0.840 0.092 0.068 0.000
#> GSM97041     1  0.0000     0.7920 1.000 0.000 0.000 0.000
#> GSM96955     2  0.0804     0.9361 0.012 0.980 0.000 0.008
#> GSM96990     3  0.3975     0.7291 0.000 0.240 0.760 0.000
#> GSM96991     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM97048     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000     0.9486 0.000 1.000 0.000 0.000
#> GSM96966     4  0.0336     0.7592 0.000 0.000 0.008 0.992
#> GSM96979     3  0.3024     0.7683 0.000 0.000 0.852 0.148
#> GSM96983     3  0.1042     0.8540 0.000 0.008 0.972 0.020
#> GSM96984     3  0.0592     0.8527 0.000 0.000 0.984 0.016
#> GSM96994     3  0.0188     0.8537 0.000 0.000 0.996 0.004
#> GSM96996     4  0.3402     0.7055 0.164 0.000 0.004 0.832
#> GSM96997     3  0.0817     0.8513 0.000 0.000 0.976 0.024
#> GSM97007     3  0.0336     0.8531 0.000 0.000 0.992 0.008
#> GSM96954     3  0.2401     0.8066 0.092 0.000 0.904 0.004
#> GSM96962     3  0.0336     0.8531 0.000 0.000 0.992 0.008
#> GSM96969     4  0.0336     0.7592 0.000 0.000 0.008 0.992
#> GSM96970     4  0.0336     0.7592 0.000 0.000 0.008 0.992
#> GSM96973     4  0.0336     0.7592 0.000 0.000 0.008 0.992
#> GSM96976     4  0.6192     0.4125 0.000 0.104 0.244 0.652
#> GSM96977     1  0.7369     0.3665 0.524 0.000 0.228 0.248
#> GSM96995     3  0.1575     0.8501 0.028 0.012 0.956 0.004
#> GSM97002     4  0.2149     0.7477 0.088 0.000 0.000 0.912
#> GSM97009     2  0.4508     0.7509 0.184 0.780 0.036 0.000
#> GSM97010     4  0.2500     0.7481 0.040 0.000 0.044 0.916
#> GSM96974     4  0.3837     0.5772 0.000 0.000 0.224 0.776
#> GSM96985     4  0.2868     0.6761 0.000 0.000 0.136 0.864
#> GSM96959     3  0.7741     0.3396 0.296 0.264 0.440 0.000
#> GSM96972     4  0.0524     0.7598 0.004 0.000 0.008 0.988
#> GSM96978     3  0.2530     0.8091 0.000 0.000 0.888 0.112
#> GSM96967     4  0.0336     0.7592 0.000 0.000 0.008 0.992
#> GSM96987     4  0.4804     0.3964 0.384 0.000 0.000 0.616
#> GSM97011     1  0.1816     0.7776 0.948 0.004 0.024 0.024
#> GSM96964     1  0.4817     0.3648 0.612 0.000 0.000 0.388
#> GSM96965     4  0.1339     0.7530 0.024 0.004 0.008 0.964
#> GSM96981     4  0.2647     0.7277 0.120 0.000 0.000 0.880
#> GSM96982     4  0.0707     0.7602 0.020 0.000 0.000 0.980
#> GSM96988     3  0.1637     0.8416 0.000 0.000 0.940 0.060
#> GSM97000     1  0.2760     0.7119 0.872 0.000 0.128 0.000
#> GSM97004     4  0.2345     0.7436 0.100 0.000 0.000 0.900
#> GSM97008     1  0.0817     0.7879 0.976 0.000 0.024 0.000
#> GSM96950     1  0.4564     0.5215 0.672 0.000 0.000 0.328
#> GSM96980     4  0.0592     0.7597 0.016 0.000 0.000 0.984
#> GSM96989     4  0.4730     0.4419 0.364 0.000 0.000 0.636
#> GSM96992     4  0.5147     0.1727 0.460 0.000 0.004 0.536
#> GSM96993     1  0.4428     0.6074 0.720 0.000 0.004 0.276
#> GSM96958     1  0.4699     0.5315 0.676 0.000 0.004 0.320
#> GSM96951     1  0.4391     0.6380 0.740 0.000 0.008 0.252
#> GSM96952     4  0.5167     0.0552 0.488 0.000 0.004 0.508
#> GSM96961     1  0.4837     0.4668 0.648 0.000 0.004 0.348

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97038     2  0.1965    0.90261 0.024 0.924 0.000 0.000 0.052
#> GSM97045     2  0.0693    0.91115 0.008 0.980 0.000 0.000 0.012
#> GSM97047     5  0.5988    0.12639 0.044 0.400 0.036 0.000 0.520
#> GSM97025     2  0.0451    0.91200 0.004 0.988 0.000 0.000 0.008
#> GSM97030     3  0.6138    0.57741 0.044 0.280 0.604 0.000 0.072
#> GSM97027     2  0.0693    0.91173 0.008 0.980 0.000 0.000 0.012
#> GSM97033     2  0.1741    0.90526 0.024 0.936 0.000 0.000 0.040
#> GSM97034     3  0.6530    0.59160 0.084 0.268 0.584 0.000 0.064
#> GSM97020     2  0.2067    0.90240 0.032 0.920 0.000 0.000 0.048
#> GSM97026     2  0.5132    0.68090 0.152 0.728 0.020 0.000 0.100
#> GSM97012     2  0.0451    0.91136 0.004 0.988 0.000 0.000 0.008
#> GSM97015     3  0.6439    0.63812 0.076 0.172 0.636 0.000 0.116
#> GSM97016     2  0.1981    0.90266 0.028 0.924 0.000 0.000 0.048
#> GSM97017     5  0.4273    0.37946 0.448 0.000 0.000 0.000 0.552
#> GSM97019     2  0.0671    0.90936 0.004 0.980 0.000 0.000 0.016
#> GSM97022     2  0.0451    0.91027 0.004 0.988 0.000 0.000 0.008
#> GSM97035     2  0.0162    0.91191 0.000 0.996 0.000 0.000 0.004
#> GSM97036     1  0.6033    0.53360 0.668 0.056 0.000 0.168 0.108
#> GSM97039     2  0.2054    0.90124 0.028 0.920 0.000 0.000 0.052
#> GSM97046     2  0.2054    0.90124 0.028 0.920 0.000 0.000 0.052
#> GSM97023     1  0.5224    0.44635 0.644 0.000 0.000 0.080 0.276
#> GSM97029     1  0.5605   -0.21541 0.488 0.036 0.004 0.012 0.460
#> GSM97043     2  0.1498    0.89865 0.016 0.952 0.008 0.000 0.024
#> GSM97013     1  0.4221    0.39080 0.732 0.000 0.000 0.032 0.236
#> GSM96956     2  0.4683    0.77701 0.036 0.776 0.120 0.000 0.068
#> GSM97024     2  0.1095    0.90447 0.012 0.968 0.012 0.000 0.008
#> GSM97032     3  0.6586    0.45077 0.072 0.356 0.516 0.000 0.056
#> GSM97044     3  0.4380    0.71259 0.052 0.116 0.796 0.000 0.036
#> GSM97049     2  0.2139    0.90089 0.032 0.916 0.000 0.000 0.052
#> GSM96968     3  0.3802    0.71699 0.096 0.000 0.820 0.004 0.080
#> GSM96971     3  0.5459    0.15746 0.012 0.000 0.496 0.456 0.036
#> GSM96986     3  0.4075    0.67918 0.024 0.000 0.804 0.036 0.136
#> GSM97003     4  0.8113    0.00600 0.308 0.000 0.164 0.384 0.144
#> GSM96957     1  0.4306   -0.18346 0.508 0.000 0.000 0.000 0.492
#> GSM96960     4  0.6054   -0.03420 0.408 0.000 0.016 0.500 0.076
#> GSM96975     4  0.6674   -0.09533 0.324 0.000 0.000 0.428 0.248
#> GSM96998     1  0.4482    0.42233 0.636 0.000 0.000 0.348 0.016
#> GSM96999     1  0.6328    0.40008 0.540 0.000 0.016 0.120 0.324
#> GSM97001     5  0.3932    0.50963 0.328 0.000 0.000 0.000 0.672
#> GSM97005     5  0.3662    0.57678 0.252 0.000 0.004 0.000 0.744
#> GSM97006     1  0.6282    0.25931 0.492 0.000 0.028 0.404 0.076
#> GSM97021     5  0.3684    0.57345 0.280 0.000 0.000 0.000 0.720
#> GSM97028     3  0.4862    0.71801 0.076 0.056 0.784 0.008 0.076
#> GSM97031     5  0.6582    0.25921 0.292 0.000 0.084 0.060 0.564
#> GSM97037     2  0.5801    0.61416 0.052 0.676 0.196 0.000 0.076
#> GSM97018     3  0.7167    0.38364 0.084 0.368 0.456 0.000 0.092
#> GSM97014     5  0.5357    0.32561 0.068 0.344 0.000 0.000 0.588
#> GSM97042     2  0.0693    0.91005 0.008 0.980 0.000 0.000 0.012
#> GSM97040     5  0.4607    0.59410 0.136 0.036 0.052 0.000 0.776
#> GSM97041     5  0.4219    0.45084 0.416 0.000 0.000 0.000 0.584
#> GSM96955     2  0.4126    0.81900 0.036 0.808 0.008 0.016 0.132
#> GSM96990     3  0.6015    0.65937 0.084 0.160 0.676 0.000 0.080
#> GSM96991     2  0.0693    0.90965 0.008 0.980 0.000 0.000 0.012
#> GSM97048     2  0.2139    0.90089 0.032 0.916 0.000 0.000 0.052
#> GSM96963     2  0.1211    0.91045 0.016 0.960 0.000 0.000 0.024
#> GSM96953     2  0.0807    0.91180 0.012 0.976 0.000 0.000 0.012
#> GSM96966     4  0.0609    0.70472 0.020 0.000 0.000 0.980 0.000
#> GSM96979     3  0.4889    0.62148 0.024 0.000 0.740 0.176 0.060
#> GSM96983     3  0.2893    0.73090 0.052 0.008 0.888 0.004 0.048
#> GSM96984     3  0.2291    0.72371 0.012 0.000 0.916 0.024 0.048
#> GSM96994     3  0.1967    0.72806 0.012 0.000 0.932 0.020 0.036
#> GSM96996     1  0.5496    0.08574 0.492 0.000 0.020 0.460 0.028
#> GSM96997     3  0.3748    0.69588 0.020 0.000 0.836 0.056 0.088
#> GSM97007     3  0.1921    0.72649 0.012 0.000 0.932 0.012 0.044
#> GSM96954     3  0.5311    0.57920 0.096 0.000 0.692 0.012 0.200
#> GSM96962     3  0.2302    0.72504 0.016 0.000 0.916 0.020 0.048
#> GSM96969     4  0.0510    0.70468 0.016 0.000 0.000 0.984 0.000
#> GSM96970     4  0.0404    0.70492 0.012 0.000 0.000 0.988 0.000
#> GSM96973     4  0.0290    0.70416 0.008 0.000 0.000 0.992 0.000
#> GSM96976     4  0.4940    0.54147 0.032 0.040 0.140 0.768 0.020
#> GSM96977     1  0.8274    0.00916 0.376 0.000 0.172 0.176 0.276
#> GSM96995     3  0.4938    0.65368 0.064 0.012 0.716 0.000 0.208
#> GSM97002     4  0.4697    0.32600 0.360 0.000 0.008 0.620 0.012
#> GSM97009     2  0.6491    0.26663 0.052 0.524 0.048 0.008 0.368
#> GSM97010     4  0.6882    0.37208 0.280 0.000 0.092 0.548 0.080
#> GSM96974     4  0.2669    0.63110 0.020 0.000 0.104 0.876 0.000
#> GSM96985     4  0.3844    0.63218 0.044 0.000 0.104 0.828 0.024
#> GSM96959     5  0.6896    0.18060 0.060 0.132 0.252 0.000 0.556
#> GSM96972     4  0.0880    0.70235 0.032 0.000 0.000 0.968 0.000
#> GSM96978     3  0.4986    0.63225 0.036 0.000 0.720 0.208 0.036
#> GSM96967     4  0.0404    0.70492 0.012 0.000 0.000 0.988 0.000
#> GSM96987     1  0.3849    0.58242 0.752 0.000 0.000 0.232 0.016
#> GSM97011     5  0.3770    0.61332 0.160 0.012 0.004 0.016 0.808
#> GSM96964     1  0.3573    0.63237 0.812 0.000 0.000 0.152 0.036
#> GSM96965     4  0.1243    0.68930 0.028 0.004 0.000 0.960 0.008
#> GSM96981     4  0.5215    0.45345 0.240 0.000 0.000 0.664 0.096
#> GSM96982     4  0.3910    0.58585 0.196 0.000 0.000 0.772 0.032
#> GSM96988     3  0.4106    0.72177 0.048 0.004 0.824 0.088 0.036
#> GSM97000     5  0.3575    0.59781 0.120 0.000 0.056 0.000 0.824
#> GSM97004     4  0.4564    0.25140 0.388 0.000 0.004 0.600 0.008
#> GSM97008     5  0.3266    0.60471 0.200 0.000 0.004 0.000 0.796
#> GSM96950     1  0.4444    0.60288 0.760 0.000 0.000 0.136 0.104
#> GSM96980     4  0.2674    0.64515 0.140 0.000 0.000 0.856 0.004
#> GSM96989     1  0.3807    0.57526 0.748 0.000 0.000 0.240 0.012
#> GSM96992     1  0.5781    0.52921 0.596 0.000 0.004 0.292 0.108
#> GSM96993     1  0.3982    0.52244 0.812 0.000 0.012 0.060 0.116
#> GSM96958     1  0.5831    0.56633 0.608 0.000 0.000 0.172 0.220
#> GSM96951     1  0.6208    0.55008 0.592 0.000 0.016 0.140 0.252
#> GSM96952     1  0.5575    0.54736 0.612 0.000 0.000 0.280 0.108
#> GSM96961     1  0.5072    0.62315 0.696 0.000 0.000 0.188 0.116

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.3824    0.76607 0.016 0.792 0.156 0.016 0.020 0.000
#> GSM97045     2  0.1265    0.79966 0.008 0.948 0.044 0.000 0.000 0.000
#> GSM97047     5  0.6703    0.21870 0.020 0.320 0.196 0.000 0.444 0.020
#> GSM97025     2  0.1155    0.80007 0.004 0.956 0.036 0.004 0.000 0.000
#> GSM97030     3  0.5950    0.65692 0.000 0.172 0.480 0.004 0.004 0.340
#> GSM97027     2  0.1606    0.80094 0.008 0.932 0.056 0.004 0.000 0.000
#> GSM97033     2  0.3155    0.78459 0.012 0.844 0.116 0.016 0.012 0.000
#> GSM97034     3  0.6313    0.68062 0.008 0.220 0.456 0.000 0.008 0.308
#> GSM97020     2  0.3425    0.78024 0.016 0.828 0.124 0.016 0.016 0.000
#> GSM97026     2  0.6330    0.43153 0.100 0.588 0.224 0.004 0.076 0.008
#> GSM97012     2  0.1349    0.79269 0.004 0.940 0.056 0.000 0.000 0.000
#> GSM97015     3  0.5587    0.62533 0.000 0.084 0.532 0.000 0.024 0.360
#> GSM97016     2  0.3673    0.77238 0.016 0.808 0.140 0.016 0.020 0.000
#> GSM97017     5  0.4506    0.41131 0.348 0.000 0.044 0.000 0.608 0.000
#> GSM97019     2  0.1588    0.78729 0.004 0.924 0.072 0.000 0.000 0.000
#> GSM97022     2  0.1285    0.79168 0.004 0.944 0.052 0.000 0.000 0.000
#> GSM97035     2  0.0935    0.80026 0.004 0.964 0.032 0.000 0.000 0.000
#> GSM97036     1  0.6131    0.42269 0.668 0.072 0.116 0.088 0.052 0.004
#> GSM97039     2  0.3508    0.77606 0.016 0.820 0.132 0.016 0.016 0.000
#> GSM97046     2  0.3824    0.76344 0.016 0.792 0.156 0.016 0.020 0.000
#> GSM97023     1  0.5082    0.38602 0.624 0.000 0.048 0.032 0.296 0.000
#> GSM97029     1  0.6509   -0.20010 0.424 0.036 0.128 0.012 0.400 0.000
#> GSM97043     2  0.2553    0.73253 0.008 0.848 0.144 0.000 0.000 0.000
#> GSM97013     1  0.4774    0.36469 0.700 0.000 0.084 0.020 0.196 0.000
#> GSM96956     2  0.6001    0.55602 0.016 0.608 0.256 0.016 0.024 0.080
#> GSM97024     2  0.2809    0.72653 0.004 0.848 0.128 0.000 0.000 0.020
#> GSM97032     3  0.6161    0.65451 0.012 0.264 0.476 0.000 0.000 0.248
#> GSM97044     6  0.5297   -0.55985 0.004 0.088 0.412 0.000 0.000 0.496
#> GSM97049     2  0.4024    0.75968 0.020 0.780 0.160 0.016 0.024 0.000
#> GSM96968     6  0.5654    0.21878 0.044 0.000 0.264 0.016 0.056 0.620
#> GSM96971     6  0.4884    0.08964 0.000 0.000 0.048 0.460 0.004 0.488
#> GSM96986     6  0.2683    0.51298 0.020 0.000 0.024 0.008 0.060 0.888
#> GSM97003     6  0.8570   -0.28636 0.260 0.000 0.092 0.216 0.140 0.292
#> GSM96957     5  0.5935    0.14047 0.352 0.000 0.124 0.012 0.504 0.008
#> GSM96960     1  0.7383    0.35278 0.448 0.000 0.100 0.312 0.084 0.056
#> GSM96975     4  0.7535   -0.14460 0.280 0.000 0.104 0.340 0.268 0.008
#> GSM96998     1  0.4161    0.57857 0.752 0.000 0.040 0.188 0.016 0.004
#> GSM96999     1  0.6610    0.26032 0.444 0.000 0.072 0.088 0.384 0.012
#> GSM97001     5  0.3472    0.55609 0.136 0.000 0.044 0.004 0.812 0.004
#> GSM97005     5  0.2829    0.59014 0.096 0.000 0.024 0.000 0.864 0.016
#> GSM97006     1  0.6958    0.47652 0.524 0.000 0.076 0.252 0.112 0.036
#> GSM97021     5  0.3817    0.57674 0.152 0.000 0.052 0.000 0.784 0.012
#> GSM97028     3  0.5406    0.41546 0.004 0.048 0.504 0.008 0.012 0.424
#> GSM97031     5  0.7039    0.20357 0.220 0.000 0.048 0.048 0.520 0.164
#> GSM97037     2  0.6281    0.34781 0.016 0.508 0.352 0.008 0.024 0.092
#> GSM97018     3  0.6194    0.65786 0.004 0.208 0.524 0.000 0.020 0.244
#> GSM97014     5  0.6143    0.34378 0.040 0.272 0.120 0.008 0.560 0.000
#> GSM97042     2  0.1471    0.78907 0.004 0.932 0.064 0.000 0.000 0.000
#> GSM97040     5  0.4302    0.59615 0.060 0.036 0.116 0.000 0.780 0.008
#> GSM97041     5  0.4332    0.44754 0.316 0.000 0.040 0.000 0.644 0.000
#> GSM96955     2  0.6049    0.57269 0.024 0.592 0.256 0.032 0.096 0.000
#> GSM96990     3  0.5879    0.57270 0.004 0.104 0.488 0.000 0.020 0.384
#> GSM96991     2  0.2062    0.78390 0.008 0.900 0.088 0.000 0.004 0.000
#> GSM97048     2  0.3908    0.76270 0.020 0.788 0.156 0.016 0.020 0.000
#> GSM96963     2  0.2001    0.79245 0.008 0.912 0.068 0.000 0.012 0.000
#> GSM96953     2  0.1219    0.80104 0.004 0.948 0.048 0.000 0.000 0.000
#> GSM96966     4  0.1141    0.74789 0.052 0.000 0.000 0.948 0.000 0.000
#> GSM96979     6  0.4456    0.46916 0.044 0.000 0.052 0.120 0.012 0.772
#> GSM96983     6  0.4420   -0.00186 0.000 0.012 0.348 0.008 0.008 0.624
#> GSM96984     6  0.0405    0.51320 0.004 0.000 0.000 0.008 0.000 0.988
#> GSM96994     6  0.1493    0.48879 0.000 0.000 0.056 0.004 0.004 0.936
#> GSM96996     1  0.5926    0.41509 0.576 0.000 0.064 0.300 0.040 0.020
#> GSM96997     6  0.2666    0.51372 0.024 0.000 0.044 0.008 0.032 0.892
#> GSM97007     6  0.0777    0.50298 0.000 0.000 0.024 0.000 0.004 0.972
#> GSM96954     6  0.5787    0.33376 0.056 0.000 0.136 0.004 0.164 0.640
#> GSM96962     6  0.1036    0.50874 0.004 0.000 0.024 0.000 0.008 0.964
#> GSM96969     4  0.1152    0.75039 0.044 0.000 0.004 0.952 0.000 0.000
#> GSM96970     4  0.0713    0.75266 0.028 0.000 0.000 0.972 0.000 0.000
#> GSM96973     4  0.0858    0.75240 0.028 0.000 0.000 0.968 0.000 0.004
#> GSM96976     4  0.3306    0.67301 0.012 0.008 0.028 0.844 0.004 0.104
#> GSM96977     5  0.8725    0.06496 0.268 0.000 0.180 0.132 0.276 0.144
#> GSM96995     6  0.5806   -0.23627 0.008 0.004 0.428 0.004 0.104 0.452
#> GSM97002     1  0.5949    0.19187 0.472 0.000 0.056 0.420 0.036 0.016
#> GSM97009     2  0.7286   -0.07324 0.016 0.400 0.116 0.012 0.376 0.080
#> GSM97010     4  0.7688    0.17563 0.288 0.000 0.124 0.432 0.072 0.084
#> GSM96974     4  0.2434    0.71089 0.008 0.000 0.036 0.892 0.000 0.064
#> GSM96985     4  0.5133    0.61821 0.028 0.000 0.128 0.708 0.012 0.124
#> GSM96959     5  0.7395    0.16279 0.016 0.108 0.312 0.008 0.436 0.120
#> GSM96972     4  0.1866    0.72867 0.084 0.000 0.008 0.908 0.000 0.000
#> GSM96978     6  0.5356    0.32373 0.000 0.000 0.196 0.152 0.016 0.636
#> GSM96967     4  0.0713    0.75266 0.028 0.000 0.000 0.972 0.000 0.000
#> GSM96987     1  0.3042    0.61315 0.836 0.000 0.032 0.128 0.004 0.000
#> GSM97011     5  0.3403    0.60764 0.048 0.008 0.068 0.012 0.852 0.012
#> GSM96964     1  0.2945    0.58852 0.868 0.000 0.040 0.064 0.028 0.000
#> GSM96965     4  0.1649    0.72635 0.040 0.000 0.016 0.936 0.008 0.000
#> GSM96981     4  0.6582    0.26548 0.268 0.000 0.100 0.524 0.104 0.004
#> GSM96982     4  0.6128    0.32659 0.260 0.000 0.100 0.572 0.064 0.004
#> GSM96988     6  0.5573   -0.00132 0.004 0.008 0.336 0.084 0.008 0.560
#> GSM97000     5  0.2976    0.60159 0.020 0.000 0.020 0.000 0.852 0.108
#> GSM97004     1  0.5498    0.14414 0.460 0.000 0.060 0.452 0.028 0.000
#> GSM97008     5  0.2318    0.60134 0.048 0.000 0.020 0.000 0.904 0.028
#> GSM96950     1  0.5000    0.52200 0.728 0.000 0.068 0.092 0.108 0.004
#> GSM96980     4  0.3242    0.65221 0.148 0.000 0.032 0.816 0.004 0.000
#> GSM96989     1  0.3072    0.61628 0.836 0.000 0.036 0.124 0.004 0.000
#> GSM96992     1  0.6310    0.57591 0.584 0.000 0.076 0.156 0.180 0.004
#> GSM96993     1  0.4396    0.46879 0.780 0.004 0.084 0.028 0.096 0.008
#> GSM96958     1  0.6352    0.48403 0.556 0.000 0.080 0.092 0.264 0.008
#> GSM96951     1  0.6450    0.43082 0.512 0.000 0.056 0.076 0.332 0.024
#> GSM96952     1  0.5771    0.59233 0.640 0.000 0.052 0.148 0.156 0.004
#> GSM96961     1  0.5171    0.59327 0.696 0.000 0.040 0.100 0.160 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-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-skmeans-collect-classes

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

test_to_known_factors(res)
#>              n disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:skmeans 100         9.36e-05      0.1734     5.21e-13   0.0903 2
#> CV:skmeans  37         3.62e-01      1.0000     2.96e-03   0.2540 3
#> CV:skmeans  87         1.23e-04      0.1849     1.40e-17   0.0583 4
#> CV:skmeans  74         1.74e-05      0.0624     8.83e-17   0.0138 5
#> CV:skmeans  60         3.04e-04      0.3256     1.60e-17   0.0982 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 21168 rows and 100 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.626           0.862       0.929         0.4867 0.508   0.508
#> 3 3 0.518           0.701       0.854         0.3648 0.732   0.515
#> 4 4 0.528           0.551       0.760         0.1183 0.863   0.620
#> 5 5 0.627           0.645       0.795         0.0650 0.848   0.502
#> 6 6 0.627           0.495       0.686         0.0425 0.931   0.695

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

suggest_best_k(res)
#> [1] 2

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97038     2  0.0000      0.931 0.000 1.000
#> GSM97045     2  0.0376      0.929 0.004 0.996
#> GSM97047     2  0.0000      0.931 0.000 1.000
#> GSM97025     2  0.0000      0.931 0.000 1.000
#> GSM97030     2  0.0000      0.931 0.000 1.000
#> GSM97027     2  0.0000      0.931 0.000 1.000
#> GSM97033     2  0.0000      0.931 0.000 1.000
#> GSM97034     2  0.0376      0.929 0.004 0.996
#> GSM97020     2  0.0000      0.931 0.000 1.000
#> GSM97026     2  0.3879      0.876 0.076 0.924
#> GSM97012     2  0.0000      0.931 0.000 1.000
#> GSM97015     2  0.4562      0.869 0.096 0.904
#> GSM97016     2  0.0000      0.931 0.000 1.000
#> GSM97017     1  0.0672      0.916 0.992 0.008
#> GSM97019     2  0.0000      0.931 0.000 1.000
#> GSM97022     2  0.0000      0.931 0.000 1.000
#> GSM97035     2  0.0000      0.931 0.000 1.000
#> GSM97036     2  0.4022      0.874 0.080 0.920
#> GSM97039     2  0.0000      0.931 0.000 1.000
#> GSM97046     2  0.0000      0.931 0.000 1.000
#> GSM97023     1  0.0000      0.916 1.000 0.000
#> GSM97029     2  0.7139      0.773 0.196 0.804
#> GSM97043     2  0.2043      0.912 0.032 0.968
#> GSM97013     2  0.9944      0.244 0.456 0.544
#> GSM96956     2  0.0000      0.931 0.000 1.000
#> GSM97024     2  0.0000      0.931 0.000 1.000
#> GSM97032     2  0.0000      0.931 0.000 1.000
#> GSM97044     2  0.0000      0.931 0.000 1.000
#> GSM97049     2  0.0000      0.931 0.000 1.000
#> GSM96968     1  0.3431      0.903 0.936 0.064
#> GSM96971     1  0.2948      0.909 0.948 0.052
#> GSM96986     1  0.5519      0.877 0.872 0.128
#> GSM97003     1  0.3879      0.901 0.924 0.076
#> GSM96957     1  0.0000      0.916 1.000 0.000
#> GSM96960     1  0.0000      0.916 1.000 0.000
#> GSM96975     1  0.2778      0.910 0.952 0.048
#> GSM96998     1  0.0000      0.916 1.000 0.000
#> GSM96999     1  0.0000      0.916 1.000 0.000
#> GSM97001     1  0.5059      0.886 0.888 0.112
#> GSM97005     1  0.3584      0.903 0.932 0.068
#> GSM97006     1  0.0000      0.916 1.000 0.000
#> GSM97021     1  0.3274      0.907 0.940 0.060
#> GSM97028     1  0.4298      0.881 0.912 0.088
#> GSM97031     1  0.3733      0.902 0.928 0.072
#> GSM97037     2  0.0000      0.931 0.000 1.000
#> GSM97018     2  0.0000      0.931 0.000 1.000
#> GSM97014     2  0.3431      0.885 0.064 0.936
#> GSM97042     2  0.0000      0.931 0.000 1.000
#> GSM97040     2  0.4815      0.847 0.104 0.896
#> GSM97041     1  0.6623      0.838 0.828 0.172
#> GSM96955     2  0.8267      0.628 0.260 0.740
#> GSM96990     2  0.0000      0.931 0.000 1.000
#> GSM96991     2  0.0000      0.931 0.000 1.000
#> GSM97048     2  0.0000      0.931 0.000 1.000
#> GSM96963     2  0.0000      0.931 0.000 1.000
#> GSM96953     2  0.0000      0.931 0.000 1.000
#> GSM96966     1  0.0000      0.916 1.000 0.000
#> GSM96979     1  0.5519      0.877 0.872 0.128
#> GSM96983     1  0.9580      0.503 0.620 0.380
#> GSM96984     1  0.6148      0.859 0.848 0.152
#> GSM96994     1  0.9954      0.260 0.540 0.460
#> GSM96996     1  0.5408      0.879 0.876 0.124
#> GSM96997     1  0.5519      0.877 0.872 0.128
#> GSM97007     1  0.7139      0.821 0.804 0.196
#> GSM96954     1  0.0376      0.916 0.996 0.004
#> GSM96962     1  0.5519      0.877 0.872 0.128
#> GSM96969     1  0.0000      0.916 1.000 0.000
#> GSM96970     1  0.0000      0.916 1.000 0.000
#> GSM96973     1  0.0000      0.916 1.000 0.000
#> GSM96976     2  0.9323      0.424 0.348 0.652
#> GSM96977     1  0.4562      0.885 0.904 0.096
#> GSM96995     1  0.8608      0.690 0.716 0.284
#> GSM97002     1  0.0000      0.916 1.000 0.000
#> GSM97009     2  0.3274      0.889 0.060 0.940
#> GSM97010     1  0.7950      0.760 0.760 0.240
#> GSM96974     1  0.7056      0.757 0.808 0.192
#> GSM96985     1  0.0000      0.916 1.000 0.000
#> GSM96959     2  0.9754      0.234 0.408 0.592
#> GSM96972     1  0.0000      0.916 1.000 0.000
#> GSM96978     1  0.8016      0.753 0.756 0.244
#> GSM96967     1  0.0000      0.916 1.000 0.000
#> GSM96987     1  0.0000      0.916 1.000 0.000
#> GSM97011     1  0.5519      0.877 0.872 0.128
#> GSM96964     1  0.0000      0.916 1.000 0.000
#> GSM96965     2  0.9552      0.351 0.376 0.624
#> GSM96981     1  0.4161      0.899 0.916 0.084
#> GSM96982     1  0.0000      0.916 1.000 0.000
#> GSM96988     1  0.0000      0.916 1.000 0.000
#> GSM97000     1  0.5519      0.877 0.872 0.128
#> GSM97004     1  0.0000      0.916 1.000 0.000
#> GSM97008     1  0.4022      0.900 0.920 0.080
#> GSM96950     1  0.4690      0.882 0.900 0.100
#> GSM96980     1  0.0000      0.916 1.000 0.000
#> GSM96989     1  0.0000      0.916 1.000 0.000
#> GSM96992     1  0.0000      0.916 1.000 0.000
#> GSM96993     1  0.8386      0.667 0.732 0.268
#> GSM96958     1  0.0000      0.916 1.000 0.000
#> GSM96951     1  0.0376      0.916 0.996 0.004
#> GSM96952     1  0.0000      0.916 1.000 0.000
#> GSM96961     1  0.0000      0.916 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
#> GSM97038     2  0.4002     0.7394 0.000 0.840 0.160
#> GSM97045     2  0.0000     0.8499 0.000 1.000 0.000
#> GSM97047     3  0.6307    -0.0606 0.000 0.488 0.512
#> GSM97025     2  0.0000     0.8499 0.000 1.000 0.000
#> GSM97030     3  0.6079     0.3630 0.000 0.388 0.612
#> GSM97027     2  0.0000     0.8499 0.000 1.000 0.000
#> GSM97033     2  0.0000     0.8499 0.000 1.000 0.000
#> GSM97034     3  0.6192     0.2785 0.000 0.420 0.580
#> GSM97020     2  0.0000     0.8499 0.000 1.000 0.000
#> GSM97026     2  0.6979     0.6403 0.140 0.732 0.128
#> GSM97012     2  0.0000     0.8499 0.000 1.000 0.000
#> GSM97015     3  0.6000     0.6538 0.040 0.200 0.760
#> GSM97016     2  0.0237     0.8495 0.000 0.996 0.004
#> GSM97017     1  0.2689     0.8567 0.932 0.036 0.032
#> GSM97019     2  0.0747     0.8472 0.000 0.984 0.016
#> GSM97022     2  0.1031     0.8437 0.000 0.976 0.024
#> GSM97035     2  0.0000     0.8499 0.000 1.000 0.000
#> GSM97036     2  0.9334    -0.0968 0.164 0.428 0.408
#> GSM97039     2  0.0000     0.8499 0.000 1.000 0.000
#> GSM97046     2  0.1411     0.8343 0.000 0.964 0.036
#> GSM97023     1  0.0000     0.8760 1.000 0.000 0.000
#> GSM97029     2  0.7493     0.5946 0.136 0.696 0.168
#> GSM97043     2  0.1129     0.8426 0.020 0.976 0.004
#> GSM97013     2  0.5896     0.5434 0.292 0.700 0.008
#> GSM96956     2  0.5948     0.3575 0.000 0.640 0.360
#> GSM97024     2  0.3816     0.7391 0.000 0.852 0.148
#> GSM97032     3  0.4654     0.6417 0.000 0.208 0.792
#> GSM97044     3  0.4399     0.6615 0.000 0.188 0.812
#> GSM97049     2  0.0424     0.8483 0.000 0.992 0.008
#> GSM96968     3  0.5216     0.6510 0.260 0.000 0.740
#> GSM96971     3  0.2261     0.7453 0.068 0.000 0.932
#> GSM96986     3  0.1163     0.7454 0.028 0.000 0.972
#> GSM97003     1  0.4504     0.7669 0.804 0.000 0.196
#> GSM96957     1  0.2711     0.8360 0.912 0.000 0.088
#> GSM96960     1  0.0424     0.8755 0.992 0.000 0.008
#> GSM96975     1  0.3340     0.8295 0.880 0.000 0.120
#> GSM96998     1  0.0000     0.8760 1.000 0.000 0.000
#> GSM96999     1  0.0000     0.8760 1.000 0.000 0.000
#> GSM97001     1  0.5178     0.7101 0.744 0.000 0.256
#> GSM97005     1  0.3551     0.8132 0.868 0.000 0.132
#> GSM97006     1  0.0237     0.8764 0.996 0.000 0.004
#> GSM97021     1  0.4235     0.7825 0.824 0.000 0.176
#> GSM97028     3  0.4399     0.7145 0.188 0.000 0.812
#> GSM97031     1  0.4121     0.7862 0.832 0.000 0.168
#> GSM97037     2  0.5859     0.3911 0.000 0.656 0.344
#> GSM97018     3  0.4555     0.6474 0.000 0.200 0.800
#> GSM97014     2  0.5363     0.5999 0.000 0.724 0.276
#> GSM97042     2  0.1031     0.8437 0.000 0.976 0.024
#> GSM97040     3  0.6301     0.5232 0.028 0.260 0.712
#> GSM97041     1  0.7673     0.4898 0.652 0.260 0.088
#> GSM96955     3  0.6543     0.6732 0.076 0.176 0.748
#> GSM96990     3  0.3038     0.7202 0.000 0.104 0.896
#> GSM96991     2  0.1411     0.8372 0.000 0.964 0.036
#> GSM97048     2  0.0000     0.8499 0.000 1.000 0.000
#> GSM96963     2  0.0000     0.8499 0.000 1.000 0.000
#> GSM96953     2  0.0747     0.8472 0.000 0.984 0.016
#> GSM96966     1  0.1643     0.8664 0.956 0.000 0.044
#> GSM96979     3  0.1643     0.7468 0.044 0.000 0.956
#> GSM96983     3  0.3607     0.7401 0.112 0.008 0.880
#> GSM96984     3  0.0892     0.7438 0.020 0.000 0.980
#> GSM96994     3  0.0892     0.7438 0.020 0.000 0.980
#> GSM96996     1  0.6111     0.2871 0.604 0.000 0.396
#> GSM96997     1  0.4931     0.7319 0.768 0.000 0.232
#> GSM97007     3  0.1585     0.7443 0.028 0.008 0.964
#> GSM96954     1  0.6008     0.4327 0.628 0.000 0.372
#> GSM96962     3  0.4654     0.6385 0.208 0.000 0.792
#> GSM96969     1  0.1163     0.8719 0.972 0.000 0.028
#> GSM96970     1  0.1753     0.8711 0.952 0.000 0.048
#> GSM96973     1  0.1964     0.8656 0.944 0.000 0.056
#> GSM96976     3  0.3377     0.7240 0.012 0.092 0.896
#> GSM96977     3  0.6267     0.2647 0.452 0.000 0.548
#> GSM96995     3  0.0892     0.7438 0.020 0.000 0.980
#> GSM97002     1  0.0747     0.8745 0.984 0.000 0.016
#> GSM97009     2  0.6195     0.5703 0.020 0.704 0.276
#> GSM97010     3  0.9512     0.4233 0.248 0.260 0.492
#> GSM96974     3  0.5366     0.6840 0.208 0.016 0.776
#> GSM96985     1  0.6008     0.3313 0.628 0.000 0.372
#> GSM96959     3  0.5581     0.6573 0.036 0.176 0.788
#> GSM96972     1  0.0892     0.8701 0.980 0.000 0.020
#> GSM96978     3  0.2448     0.7488 0.076 0.000 0.924
#> GSM96967     1  0.0892     0.8701 0.980 0.000 0.020
#> GSM96987     1  0.0000     0.8760 1.000 0.000 0.000
#> GSM97011     3  0.6641     0.0530 0.448 0.008 0.544
#> GSM96964     1  0.0000     0.8760 1.000 0.000 0.000
#> GSM96965     2  0.8914     0.3434 0.164 0.556 0.280
#> GSM96981     1  0.2448     0.8570 0.924 0.000 0.076
#> GSM96982     1  0.0592     0.8753 0.988 0.000 0.012
#> GSM96988     3  0.6215     0.3608 0.428 0.000 0.572
#> GSM97000     3  0.6215     0.1410 0.428 0.000 0.572
#> GSM97004     1  0.0892     0.8701 0.980 0.000 0.020
#> GSM97008     1  0.4974     0.7252 0.764 0.000 0.236
#> GSM96950     1  0.6027     0.5506 0.712 0.016 0.272
#> GSM96980     1  0.1163     0.8719 0.972 0.000 0.028
#> GSM96989     1  0.0592     0.8746 0.988 0.000 0.012
#> GSM96992     1  0.0000     0.8760 1.000 0.000 0.000
#> GSM96993     3  0.5062     0.7097 0.184 0.016 0.800
#> GSM96958     1  0.2356     0.8571 0.928 0.000 0.072
#> GSM96951     1  0.3941     0.7964 0.844 0.000 0.156
#> GSM96952     1  0.0000     0.8760 1.000 0.000 0.000
#> GSM96961     1  0.0000     0.8760 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
#> GSM97038     2  0.1938     0.8462 0.000 0.936 0.052 0.012
#> GSM97045     2  0.0336     0.8835 0.000 0.992 0.000 0.008
#> GSM97047     4  0.7472     0.3360 0.000 0.232 0.264 0.504
#> GSM97025     2  0.0188     0.8835 0.000 0.996 0.000 0.004
#> GSM97030     3  0.5360     0.0864 0.000 0.436 0.552 0.012
#> GSM97027     2  0.0188     0.8831 0.000 0.996 0.000 0.004
#> GSM97033     2  0.0188     0.8831 0.000 0.996 0.000 0.004
#> GSM97034     3  0.3810     0.5700 0.000 0.188 0.804 0.008
#> GSM97020     2  0.0188     0.8831 0.000 0.996 0.000 0.004
#> GSM97026     2  0.6736     0.4160 0.092 0.588 0.312 0.008
#> GSM97012     2  0.0707     0.8817 0.000 0.980 0.000 0.020
#> GSM97015     3  0.5166     0.4855 0.004 0.216 0.736 0.044
#> GSM97016     2  0.0188     0.8831 0.000 0.996 0.000 0.004
#> GSM97017     1  0.5488     0.1651 0.576 0.008 0.008 0.408
#> GSM97019     2  0.3335     0.8036 0.000 0.860 0.120 0.020
#> GSM97022     2  0.3708     0.7757 0.000 0.832 0.148 0.020
#> GSM97035     2  0.0707     0.8817 0.000 0.980 0.000 0.020
#> GSM97036     3  0.7279     0.3862 0.128 0.288 0.568 0.016
#> GSM97039     2  0.0188     0.8831 0.000 0.996 0.000 0.004
#> GSM97046     2  0.0524     0.8811 0.000 0.988 0.008 0.004
#> GSM97023     1  0.0000     0.7319 1.000 0.000 0.000 0.000
#> GSM97029     2  0.8725     0.1222 0.160 0.440 0.328 0.072
#> GSM97043     2  0.1229     0.8802 0.008 0.968 0.004 0.020
#> GSM97013     2  0.6421     0.2242 0.368 0.556 0.000 0.076
#> GSM96956     2  0.4756     0.6791 0.000 0.784 0.144 0.072
#> GSM97024     2  0.4610     0.6669 0.000 0.744 0.236 0.020
#> GSM97032     3  0.2401     0.6336 0.000 0.092 0.904 0.004
#> GSM97044     3  0.2654     0.6241 0.000 0.108 0.888 0.004
#> GSM97049     2  0.0469     0.8808 0.000 0.988 0.000 0.012
#> GSM96968     3  0.7577     0.1324 0.216 0.000 0.468 0.316
#> GSM96971     3  0.4988     0.3267 0.020 0.000 0.692 0.288
#> GSM96986     3  0.5085     0.3102 0.008 0.000 0.616 0.376
#> GSM97003     1  0.6224     0.4871 0.668 0.000 0.144 0.188
#> GSM96957     1  0.3529     0.6826 0.836 0.000 0.012 0.152
#> GSM96960     1  0.0927     0.7310 0.976 0.000 0.008 0.016
#> GSM96975     1  0.6483     0.1464 0.532 0.000 0.076 0.392
#> GSM96998     1  0.0469     0.7301 0.988 0.000 0.000 0.012
#> GSM96999     1  0.2814     0.6913 0.868 0.000 0.000 0.132
#> GSM97001     4  0.6324     0.3461 0.340 0.000 0.076 0.584
#> GSM97005     1  0.5972     0.4057 0.640 0.000 0.068 0.292
#> GSM97006     1  0.0188     0.7321 0.996 0.000 0.004 0.000
#> GSM97021     1  0.6326     0.4269 0.636 0.000 0.108 0.256
#> GSM97028     3  0.2174     0.6370 0.052 0.000 0.928 0.020
#> GSM97031     1  0.4231     0.6462 0.824 0.000 0.080 0.096
#> GSM97037     2  0.3351     0.7471 0.000 0.844 0.148 0.008
#> GSM97018     3  0.2053     0.6382 0.000 0.072 0.924 0.004
#> GSM97014     4  0.6918     0.2928 0.000 0.420 0.108 0.472
#> GSM97042     2  0.1042     0.8811 0.000 0.972 0.008 0.020
#> GSM97040     4  0.6929     0.2641 0.008 0.084 0.416 0.492
#> GSM97041     4  0.6785     0.4165 0.360 0.092 0.004 0.544
#> GSM96955     4  0.6766     0.3667 0.036 0.052 0.304 0.608
#> GSM96990     3  0.4982     0.5717 0.000 0.092 0.772 0.136
#> GSM96991     2  0.1042     0.8818 0.000 0.972 0.008 0.020
#> GSM97048     2  0.0188     0.8831 0.000 0.996 0.000 0.004
#> GSM96963     2  0.0707     0.8817 0.000 0.980 0.000 0.020
#> GSM96953     2  0.1022     0.8795 0.000 0.968 0.000 0.032
#> GSM96966     1  0.6575     0.4532 0.560 0.000 0.092 0.348
#> GSM96979     3  0.4328     0.5247 0.008 0.000 0.748 0.244
#> GSM96983     3  0.1975     0.6390 0.048 0.000 0.936 0.016
#> GSM96984     3  0.3982     0.5382 0.004 0.000 0.776 0.220
#> GSM96994     3  0.3528     0.5677 0.000 0.000 0.808 0.192
#> GSM96996     4  0.6895     0.4746 0.276 0.000 0.148 0.576
#> GSM96997     1  0.7357     0.1402 0.524 0.000 0.216 0.260
#> GSM97007     3  0.1302     0.6295 0.000 0.000 0.956 0.044
#> GSM96954     1  0.6682     0.2979 0.576 0.000 0.312 0.112
#> GSM96962     3  0.5292     0.5252 0.064 0.000 0.728 0.208
#> GSM96969     1  0.6746     0.4586 0.580 0.000 0.124 0.296
#> GSM96970     4  0.4989    -0.3621 0.472 0.000 0.000 0.528
#> GSM96973     1  0.6549     0.4519 0.556 0.000 0.088 0.356
#> GSM96976     4  0.3743     0.3157 0.000 0.016 0.160 0.824
#> GSM96977     4  0.7031     0.4591 0.200 0.000 0.224 0.576
#> GSM96995     3  0.4948     0.1400 0.000 0.000 0.560 0.440
#> GSM97002     1  0.2999     0.6927 0.864 0.000 0.004 0.132
#> GSM97009     4  0.6670     0.4269 0.004 0.304 0.100 0.592
#> GSM97010     4  0.7919     0.5121 0.148 0.112 0.132 0.608
#> GSM96974     3  0.4883     0.4704 0.016 0.000 0.696 0.288
#> GSM96985     3  0.7660     0.1346 0.324 0.000 0.448 0.228
#> GSM96959     4  0.5961     0.4042 0.004 0.052 0.308 0.636
#> GSM96972     1  0.4277     0.5623 0.720 0.000 0.000 0.280
#> GSM96978     3  0.1584     0.6409 0.012 0.000 0.952 0.036
#> GSM96967     1  0.6229     0.4942 0.628 0.000 0.088 0.284
#> GSM96987     1  0.0469     0.7301 0.988 0.000 0.000 0.012
#> GSM97011     4  0.5982     0.5239 0.112 0.000 0.204 0.684
#> GSM96964     1  0.1211     0.7265 0.960 0.000 0.000 0.040
#> GSM96965     4  0.3427     0.4406 0.028 0.112 0.000 0.860
#> GSM96981     4  0.5512     0.0192 0.488 0.000 0.016 0.496
#> GSM96982     1  0.1824     0.7237 0.936 0.000 0.004 0.060
#> GSM96988     3  0.3401     0.5860 0.152 0.000 0.840 0.008
#> GSM97000     4  0.6216     0.5186 0.120 0.000 0.220 0.660
#> GSM97004     1  0.0188     0.7317 0.996 0.000 0.000 0.004
#> GSM97008     4  0.7210     0.2920 0.360 0.000 0.148 0.492
#> GSM96950     1  0.7583    -0.2367 0.432 0.004 0.168 0.396
#> GSM96980     1  0.3074     0.6799 0.848 0.000 0.000 0.152
#> GSM96989     1  0.1174     0.7278 0.968 0.000 0.020 0.012
#> GSM96992     1  0.0000     0.7319 1.000 0.000 0.000 0.000
#> GSM96993     3  0.7179     0.3182 0.180 0.000 0.544 0.276
#> GSM96958     1  0.3404     0.7026 0.864 0.000 0.032 0.104
#> GSM96951     1  0.5226     0.5960 0.744 0.000 0.076 0.180
#> GSM96952     1  0.0000     0.7319 1.000 0.000 0.000 0.000
#> GSM96961     1  0.0000     0.7319 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
#> GSM97038     2  0.0693     0.8779 0.000 0.980 0.008 0.000 0.012
#> GSM97045     2  0.1121     0.8850 0.000 0.956 0.000 0.044 0.000
#> GSM97047     5  0.4091     0.6182 0.000 0.076 0.124 0.004 0.796
#> GSM97025     2  0.1410     0.8842 0.000 0.940 0.000 0.060 0.000
#> GSM97030     2  0.5355     0.3246 0.000 0.536 0.420 0.012 0.032
#> GSM97027     2  0.0000     0.8829 0.000 1.000 0.000 0.000 0.000
#> GSM97033     2  0.0000     0.8829 0.000 1.000 0.000 0.000 0.000
#> GSM97034     3  0.2102     0.7102 0.000 0.068 0.916 0.004 0.012
#> GSM97020     2  0.0000     0.8829 0.000 1.000 0.000 0.000 0.000
#> GSM97026     2  0.6067     0.4115 0.096 0.560 0.332 0.004 0.008
#> GSM97012     2  0.2674     0.8728 0.000 0.856 0.000 0.140 0.004
#> GSM97015     3  0.5877     0.4745 0.008 0.236 0.632 0.004 0.120
#> GSM97016     2  0.0162     0.8827 0.000 0.996 0.000 0.000 0.004
#> GSM97017     5  0.4858     0.3200 0.424 0.008 0.000 0.012 0.556
#> GSM97019     2  0.4382     0.8255 0.000 0.772 0.084 0.140 0.004
#> GSM97022     2  0.4489     0.8189 0.000 0.764 0.092 0.140 0.004
#> GSM97035     2  0.2798     0.8732 0.000 0.852 0.000 0.140 0.008
#> GSM97036     3  0.6289     0.4973 0.164 0.216 0.600 0.000 0.020
#> GSM97039     2  0.0162     0.8827 0.000 0.996 0.000 0.000 0.004
#> GSM97046     2  0.0162     0.8827 0.000 0.996 0.000 0.000 0.004
#> GSM97023     1  0.0963     0.7789 0.964 0.000 0.000 0.036 0.000
#> GSM97029     3  0.7623    -0.0329 0.240 0.360 0.360 0.008 0.032
#> GSM97043     2  0.3078     0.8713 0.016 0.848 0.000 0.132 0.004
#> GSM97013     1  0.5162     0.3988 0.600 0.360 0.000 0.020 0.020
#> GSM96956     2  0.3202     0.7999 0.000 0.860 0.056 0.004 0.080
#> GSM97024     2  0.4641     0.7663 0.000 0.744 0.172 0.080 0.004
#> GSM97032     3  0.1329     0.7215 0.000 0.032 0.956 0.008 0.004
#> GSM97044     3  0.1830     0.7176 0.000 0.012 0.932 0.004 0.052
#> GSM97049     2  0.0162     0.8827 0.000 0.996 0.000 0.000 0.004
#> GSM96968     3  0.7438     0.2195 0.264 0.000 0.452 0.048 0.236
#> GSM96971     5  0.4891     0.0989 0.012 0.000 0.448 0.008 0.532
#> GSM96986     5  0.4808    -0.0241 0.000 0.000 0.400 0.024 0.576
#> GSM97003     5  0.6432     0.5247 0.256 0.000 0.120 0.036 0.588
#> GSM96957     1  0.3781     0.7169 0.828 0.000 0.016 0.048 0.108
#> GSM96960     1  0.2291     0.7579 0.908 0.000 0.056 0.036 0.000
#> GSM96975     5  0.6827     0.3887 0.316 0.000 0.084 0.072 0.528
#> GSM96998     1  0.0798     0.7801 0.976 0.000 0.000 0.016 0.008
#> GSM96999     1  0.5112     0.4554 0.664 0.000 0.004 0.064 0.268
#> GSM97001     5  0.2253     0.6818 0.036 0.000 0.016 0.028 0.920
#> GSM97005     5  0.3779     0.5822 0.236 0.000 0.000 0.012 0.752
#> GSM97006     1  0.1124     0.7784 0.960 0.000 0.004 0.036 0.000
#> GSM97021     5  0.4575     0.5931 0.212 0.000 0.040 0.012 0.736
#> GSM97028     3  0.0727     0.7215 0.012 0.000 0.980 0.004 0.004
#> GSM97031     1  0.4354     0.5470 0.712 0.000 0.000 0.032 0.256
#> GSM97037     2  0.2369     0.8325 0.000 0.908 0.056 0.004 0.032
#> GSM97018     3  0.1116     0.7223 0.000 0.028 0.964 0.004 0.004
#> GSM97014     5  0.3878     0.5802 0.000 0.236 0.000 0.016 0.748
#> GSM97042     2  0.2674     0.8728 0.000 0.856 0.000 0.140 0.004
#> GSM97040     5  0.2516     0.6243 0.000 0.000 0.140 0.000 0.860
#> GSM97041     5  0.4591     0.5015 0.332 0.012 0.000 0.008 0.648
#> GSM96955     5  0.6153     0.5085 0.000 0.072 0.228 0.064 0.636
#> GSM96990     3  0.4703     0.6382 0.000 0.096 0.744 0.004 0.156
#> GSM96991     2  0.3080     0.8712 0.000 0.844 0.008 0.140 0.008
#> GSM97048     2  0.0162     0.8827 0.000 0.996 0.000 0.000 0.004
#> GSM96963     2  0.2833     0.8723 0.000 0.852 0.004 0.140 0.004
#> GSM96953     2  0.2909     0.8727 0.000 0.848 0.000 0.140 0.012
#> GSM96966     4  0.3495     0.8436 0.160 0.000 0.000 0.812 0.028
#> GSM96979     3  0.4872     0.3159 0.000 0.000 0.540 0.024 0.436
#> GSM96983     3  0.1018     0.7217 0.000 0.000 0.968 0.016 0.016
#> GSM96984     3  0.4540     0.5150 0.000 0.000 0.656 0.024 0.320
#> GSM96994     3  0.3495     0.6433 0.000 0.000 0.812 0.028 0.160
#> GSM96996     5  0.6499     0.5177 0.248 0.000 0.100 0.056 0.596
#> GSM96997     5  0.7130     0.3159 0.156 0.000 0.260 0.060 0.524
#> GSM97007     3  0.2813     0.6956 0.000 0.000 0.868 0.024 0.108
#> GSM96954     1  0.6268     0.1448 0.484 0.000 0.156 0.000 0.360
#> GSM96962     3  0.4809     0.4964 0.008 0.000 0.648 0.024 0.320
#> GSM96969     4  0.3242     0.8426 0.216 0.000 0.000 0.784 0.000
#> GSM96970     4  0.3622     0.8354 0.136 0.000 0.000 0.816 0.048
#> GSM96973     4  0.3438     0.8502 0.172 0.000 0.000 0.808 0.020
#> GSM96976     4  0.3681     0.7093 0.000 0.008 0.036 0.820 0.136
#> GSM96977     5  0.4724     0.6463 0.152 0.000 0.064 0.024 0.760
#> GSM96995     5  0.4410     0.0442 0.000 0.000 0.440 0.004 0.556
#> GSM97002     1  0.5696     0.2337 0.604 0.000 0.044 0.032 0.320
#> GSM97009     5  0.3155     0.6511 0.000 0.128 0.016 0.008 0.848
#> GSM97010     5  0.5230     0.6401 0.164 0.056 0.008 0.036 0.736
#> GSM96974     4  0.3508     0.5948 0.000 0.000 0.252 0.748 0.000
#> GSM96985     3  0.6631     0.2996 0.160 0.000 0.568 0.240 0.032
#> GSM96959     5  0.1591     0.6617 0.000 0.004 0.052 0.004 0.940
#> GSM96972     4  0.3242     0.8426 0.216 0.000 0.000 0.784 0.000
#> GSM96978     3  0.0162     0.7222 0.000 0.000 0.996 0.000 0.004
#> GSM96967     4  0.3242     0.8426 0.216 0.000 0.000 0.784 0.000
#> GSM96987     1  0.0162     0.7777 0.996 0.000 0.000 0.000 0.004
#> GSM97011     5  0.1195     0.6689 0.000 0.000 0.028 0.012 0.960
#> GSM96964     1  0.1106     0.7719 0.964 0.000 0.000 0.012 0.024
#> GSM96965     4  0.4149     0.7063 0.000 0.080 0.004 0.792 0.124
#> GSM96981     5  0.5816     0.4162 0.320 0.000 0.020 0.068 0.592
#> GSM96982     1  0.2703     0.7703 0.896 0.000 0.024 0.060 0.020
#> GSM96988     3  0.1605     0.7188 0.040 0.000 0.944 0.012 0.004
#> GSM97000     5  0.0404     0.6639 0.000 0.000 0.012 0.000 0.988
#> GSM97004     1  0.1043     0.7777 0.960 0.000 0.000 0.040 0.000
#> GSM97008     5  0.2392     0.6730 0.104 0.000 0.004 0.004 0.888
#> GSM96950     1  0.5158     0.6109 0.748 0.004 0.108 0.032 0.108
#> GSM96980     4  0.3612     0.7858 0.268 0.000 0.000 0.732 0.000
#> GSM96989     1  0.0486     0.7788 0.988 0.000 0.004 0.004 0.004
#> GSM96992     1  0.0963     0.7789 0.964 0.000 0.000 0.036 0.000
#> GSM96993     1  0.7430    -0.1105 0.400 0.000 0.352 0.044 0.204
#> GSM96958     1  0.3130     0.7473 0.872 0.000 0.016 0.040 0.072
#> GSM96951     1  0.3967     0.5862 0.724 0.000 0.000 0.012 0.264
#> GSM96952     1  0.0963     0.7789 0.964 0.000 0.000 0.036 0.000
#> GSM96961     1  0.0963     0.7789 0.964 0.000 0.000 0.036 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
#> GSM97038     6  0.4088     0.4249 0.000 0.436 0.004 0.000 0.004 0.556
#> GSM97045     2  0.3464     0.2949 0.000 0.688 0.000 0.000 0.000 0.312
#> GSM97047     5  0.3294     0.5567 0.000 0.032 0.128 0.004 0.828 0.008
#> GSM97025     2  0.3428     0.3143 0.000 0.696 0.000 0.000 0.000 0.304
#> GSM97030     3  0.5976     0.0907 0.000 0.364 0.508 0.004 0.040 0.084
#> GSM97027     2  0.3797    -0.0520 0.000 0.580 0.000 0.000 0.000 0.420
#> GSM97033     2  0.3804    -0.0668 0.000 0.576 0.000 0.000 0.000 0.424
#> GSM97034     3  0.1615     0.6643 0.000 0.064 0.928 0.000 0.004 0.004
#> GSM97020     2  0.3804    -0.0634 0.000 0.576 0.000 0.000 0.000 0.424
#> GSM97026     3  0.7353    -0.0121 0.140 0.336 0.344 0.000 0.000 0.180
#> GSM97012     2  0.0146     0.6983 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM97015     3  0.6414     0.3963 0.004 0.096 0.568 0.000 0.216 0.116
#> GSM97016     6  0.3838     0.4284 0.000 0.448 0.000 0.000 0.000 0.552
#> GSM97017     5  0.6033     0.0970 0.436 0.020 0.000 0.020 0.444 0.080
#> GSM97019     2  0.0146     0.6985 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97022     2  0.0146     0.6985 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97035     2  0.2003     0.5912 0.000 0.884 0.000 0.000 0.000 0.116
#> GSM97036     3  0.8152     0.3152 0.196 0.156 0.436 0.032 0.024 0.156
#> GSM97039     6  0.3838     0.4284 0.000 0.448 0.000 0.000 0.000 0.552
#> GSM97046     6  0.3838     0.4284 0.000 0.448 0.000 0.000 0.000 0.552
#> GSM97023     1  0.0632     0.7559 0.976 0.000 0.000 0.024 0.000 0.000
#> GSM97029     3  0.7885     0.2030 0.128 0.240 0.348 0.004 0.016 0.264
#> GSM97043     2  0.1074     0.6855 0.012 0.960 0.000 0.000 0.000 0.028
#> GSM97013     6  0.4172    -0.2165 0.460 0.012 0.000 0.000 0.000 0.528
#> GSM96956     6  0.6074     0.3082 0.000 0.404 0.064 0.004 0.060 0.468
#> GSM97024     2  0.2416     0.5506 0.000 0.844 0.156 0.000 0.000 0.000
#> GSM97032     3  0.0837     0.6700 0.000 0.020 0.972 0.000 0.004 0.004
#> GSM97044     3  0.2568     0.6565 0.000 0.016 0.888 0.000 0.036 0.060
#> GSM97049     6  0.3838     0.4284 0.000 0.448 0.000 0.000 0.000 0.552
#> GSM96968     6  0.8222    -0.4214 0.136 0.000 0.264 0.068 0.168 0.364
#> GSM96971     5  0.4688     0.2892 0.012 0.000 0.352 0.020 0.608 0.008
#> GSM96986     5  0.6357     0.2149 0.004 0.000 0.216 0.072 0.568 0.140
#> GSM97003     5  0.7292     0.3906 0.284 0.000 0.084 0.028 0.456 0.148
#> GSM96957     1  0.4983     0.6389 0.676 0.000 0.000 0.068 0.032 0.224
#> GSM96960     1  0.3129     0.6983 0.820 0.000 0.004 0.024 0.000 0.152
#> GSM96975     5  0.7640     0.1239 0.332 0.000 0.040 0.072 0.364 0.192
#> GSM96998     1  0.2346     0.7316 0.868 0.000 0.000 0.008 0.000 0.124
#> GSM96999     1  0.5268     0.4428 0.656 0.000 0.000 0.060 0.228 0.056
#> GSM97001     5  0.5057     0.5673 0.088 0.000 0.000 0.040 0.692 0.180
#> GSM97005     5  0.3298     0.5245 0.236 0.000 0.000 0.008 0.756 0.000
#> GSM97006     1  0.1294     0.7541 0.956 0.000 0.004 0.024 0.008 0.008
#> GSM97021     5  0.4043     0.5336 0.212 0.000 0.036 0.012 0.740 0.000
#> GSM97028     3  0.0603     0.6676 0.004 0.000 0.980 0.000 0.000 0.016
#> GSM97031     1  0.4547     0.3312 0.628 0.000 0.000 0.020 0.332 0.020
#> GSM97037     6  0.5667     0.3401 0.000 0.412 0.060 0.004 0.032 0.492
#> GSM97018     3  0.0603     0.6697 0.000 0.016 0.980 0.000 0.000 0.004
#> GSM97014     5  0.4293     0.4884 0.000 0.032 0.000 0.016 0.704 0.248
#> GSM97042     2  0.0000     0.6985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97040     5  0.1663     0.5746 0.000 0.000 0.088 0.000 0.912 0.000
#> GSM97041     5  0.5511     0.3149 0.352 0.016 0.000 0.004 0.548 0.080
#> GSM96955     5  0.7287     0.4390 0.000 0.100 0.116 0.060 0.528 0.196
#> GSM96990     3  0.4356     0.5847 0.000 0.024 0.764 0.004 0.132 0.076
#> GSM96991     2  0.0260     0.6962 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM97048     6  0.3838     0.4284 0.000 0.448 0.000 0.000 0.000 0.552
#> GSM96963     2  0.0146     0.6975 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM96953     2  0.2135     0.5761 0.000 0.872 0.000 0.000 0.000 0.128
#> GSM96966     4  0.2006     0.8745 0.080 0.000 0.000 0.904 0.016 0.000
#> GSM96979     5  0.6270     0.1256 0.000 0.000 0.280 0.068 0.536 0.116
#> GSM96983     3  0.1991     0.6632 0.000 0.000 0.920 0.044 0.012 0.024
#> GSM96984     3  0.6653     0.1781 0.000 0.000 0.432 0.068 0.356 0.144
#> GSM96994     3  0.3843     0.6048 0.000 0.000 0.804 0.068 0.100 0.028
#> GSM96996     5  0.7105     0.3138 0.292 0.000 0.100 0.076 0.488 0.044
#> GSM96997     5  0.7504     0.3851 0.168 0.000 0.108 0.076 0.516 0.132
#> GSM97007     3  0.4683     0.5941 0.000 0.000 0.744 0.060 0.076 0.120
#> GSM96954     5  0.6860     0.1929 0.348 0.000 0.132 0.000 0.420 0.100
#> GSM96962     3  0.6370     0.2641 0.000 0.000 0.504 0.068 0.312 0.116
#> GSM96969     4  0.2219     0.8733 0.136 0.000 0.000 0.864 0.000 0.000
#> GSM96970     4  0.2066     0.8583 0.040 0.000 0.000 0.908 0.052 0.000
#> GSM96973     4  0.1753     0.8802 0.084 0.000 0.000 0.912 0.004 0.000
#> GSM96976     4  0.1667     0.8250 0.000 0.008 0.008 0.940 0.032 0.012
#> GSM96977     5  0.6310     0.5236 0.064 0.000 0.056 0.036 0.572 0.272
#> GSM96995     5  0.5287    -0.0233 0.000 0.000 0.448 0.024 0.480 0.048
#> GSM97002     1  0.6660     0.3479 0.532 0.000 0.016 0.048 0.192 0.212
#> GSM97009     5  0.3494     0.5928 0.000 0.036 0.000 0.004 0.792 0.168
#> GSM97010     5  0.5935     0.4658 0.196 0.000 0.000 0.028 0.572 0.204
#> GSM96974     4  0.2595     0.7500 0.000 0.000 0.160 0.836 0.000 0.004
#> GSM96985     3  0.5409     0.2790 0.068 0.000 0.572 0.336 0.020 0.004
#> GSM96959     5  0.2034     0.5817 0.000 0.000 0.060 0.004 0.912 0.024
#> GSM96972     4  0.2219     0.8733 0.136 0.000 0.000 0.864 0.000 0.000
#> GSM96978     3  0.2056     0.6526 0.000 0.000 0.904 0.012 0.004 0.080
#> GSM96967     4  0.2219     0.8733 0.136 0.000 0.000 0.864 0.000 0.000
#> GSM96987     1  0.2048     0.7283 0.880 0.000 0.000 0.000 0.000 0.120
#> GSM97011     5  0.1866     0.6046 0.000 0.000 0.000 0.008 0.908 0.084
#> GSM96964     1  0.2976     0.7195 0.844 0.000 0.000 0.020 0.012 0.124
#> GSM96965     4  0.3447     0.7717 0.000 0.008 0.000 0.820 0.064 0.108
#> GSM96981     5  0.6901     0.2320 0.288 0.000 0.004 0.076 0.460 0.172
#> GSM96982     1  0.4434     0.6755 0.748 0.000 0.008 0.064 0.016 0.164
#> GSM96988     3  0.2332     0.6653 0.020 0.000 0.904 0.040 0.000 0.036
#> GSM97000     5  0.0000     0.5920 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97004     1  0.1257     0.7555 0.952 0.000 0.000 0.028 0.000 0.020
#> GSM97008     5  0.1531     0.6085 0.068 0.000 0.000 0.004 0.928 0.000
#> GSM96950     1  0.6005     0.6162 0.636 0.004 0.040 0.044 0.060 0.216
#> GSM96980     4  0.3428     0.6704 0.304 0.000 0.000 0.696 0.000 0.000
#> GSM96989     1  0.2333     0.7292 0.872 0.000 0.004 0.004 0.000 0.120
#> GSM96992     1  0.0632     0.7559 0.976 0.000 0.000 0.024 0.000 0.000
#> GSM96993     1  0.7905     0.1669 0.416 0.000 0.244 0.048 0.140 0.152
#> GSM96958     1  0.4434     0.6692 0.740 0.000 0.000 0.060 0.028 0.172
#> GSM96951     1  0.3668     0.5540 0.728 0.000 0.000 0.008 0.256 0.008
#> GSM96952     1  0.0777     0.7562 0.972 0.000 0.000 0.024 0.000 0.004
#> GSM96961     1  0.0632     0.7559 0.976 0.000 0.000 0.024 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-pam-collect-classes

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

test_to_known_factors(res)
#>         n disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:pam 95         1.87e-09       0.519     9.94e-19   0.0483 2
#> CV:pam 84         3.06e-07       0.563     3.99e-15   0.1185 3
#> CV:pam 60         7.60e-04       0.594     2.81e-12   0.2431 4
#> CV:pam 79         3.36e-05       0.431     7.14e-15   0.1530 5
#> CV:pam 58         3.68e-02       0.497     2.34e-10   0.1339 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 21168 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-mclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.801           0.915       0.954         0.3505 0.665   0.665
#> 3 3 0.469           0.437       0.711         0.7263 0.792   0.692
#> 4 4 0.910           0.904       0.960         0.2091 0.698   0.422
#> 5 5 0.805           0.705       0.834         0.0585 0.956   0.846
#> 6 6 0.772           0.771       0.787         0.0460 0.874   0.545

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
#> GSM97038     2  0.0000     0.9497 0.000 1.000
#> GSM97045     2  0.0376     0.9466 0.004 0.996
#> GSM97047     1  0.6438     0.8536 0.836 0.164
#> GSM97025     2  0.0000     0.9497 0.000 1.000
#> GSM97030     1  0.6247     0.8620 0.844 0.156
#> GSM97027     2  0.0000     0.9497 0.000 1.000
#> GSM97033     2  0.0000     0.9497 0.000 1.000
#> GSM97034     1  0.5629     0.8855 0.868 0.132
#> GSM97020     2  0.0000     0.9497 0.000 1.000
#> GSM97026     1  0.5629     0.8855 0.868 0.132
#> GSM97012     2  0.0000     0.9497 0.000 1.000
#> GSM97015     1  0.5519     0.8890 0.872 0.128
#> GSM97016     2  0.0000     0.9497 0.000 1.000
#> GSM97017     1  0.0000     0.9504 1.000 0.000
#> GSM97019     2  0.0000     0.9497 0.000 1.000
#> GSM97022     2  0.0000     0.9497 0.000 1.000
#> GSM97035     2  0.0000     0.9497 0.000 1.000
#> GSM97036     1  0.0000     0.9504 1.000 0.000
#> GSM97039     2  0.0000     0.9497 0.000 1.000
#> GSM97046     2  0.0000     0.9497 0.000 1.000
#> GSM97023     1  0.0000     0.9504 1.000 0.000
#> GSM97029     1  0.0000     0.9504 1.000 0.000
#> GSM97043     2  0.0000     0.9497 0.000 1.000
#> GSM97013     1  0.0000     0.9504 1.000 0.000
#> GSM96956     2  0.9963     0.0253 0.464 0.536
#> GSM97024     2  0.7056     0.7353 0.192 0.808
#> GSM97032     1  0.6531     0.8488 0.832 0.168
#> GSM97044     1  0.5629     0.8855 0.868 0.132
#> GSM97049     2  0.0000     0.9497 0.000 1.000
#> GSM96968     1  0.4022     0.9233 0.920 0.080
#> GSM96971     1  0.4022     0.9233 0.920 0.080
#> GSM96986     1  0.4022     0.9233 0.920 0.080
#> GSM97003     1  0.0000     0.9504 1.000 0.000
#> GSM96957     1  0.0000     0.9504 1.000 0.000
#> GSM96960     1  0.0000     0.9504 1.000 0.000
#> GSM96975     1  0.0000     0.9504 1.000 0.000
#> GSM96998     1  0.0000     0.9504 1.000 0.000
#> GSM96999     1  0.0000     0.9504 1.000 0.000
#> GSM97001     1  0.0000     0.9504 1.000 0.000
#> GSM97005     1  0.0000     0.9504 1.000 0.000
#> GSM97006     1  0.0000     0.9504 1.000 0.000
#> GSM97021     1  0.0000     0.9504 1.000 0.000
#> GSM97028     1  0.4022     0.9233 0.920 0.080
#> GSM97031     1  0.0000     0.9504 1.000 0.000
#> GSM97037     2  0.8081     0.6419 0.248 0.752
#> GSM97018     1  0.5737     0.8818 0.864 0.136
#> GSM97014     1  0.4815     0.9078 0.896 0.104
#> GSM97042     2  0.0000     0.9497 0.000 1.000
#> GSM97040     1  0.0672     0.9486 0.992 0.008
#> GSM97041     1  0.0000     0.9504 1.000 0.000
#> GSM96955     1  0.7815     0.7634 0.768 0.232
#> GSM96990     1  0.5946     0.8745 0.856 0.144
#> GSM96991     1  0.8327     0.7120 0.736 0.264
#> GSM97048     2  0.0000     0.9497 0.000 1.000
#> GSM96963     1  0.9129     0.5899 0.672 0.328
#> GSM96953     2  0.0000     0.9497 0.000 1.000
#> GSM96966     1  0.0000     0.9504 1.000 0.000
#> GSM96979     1  0.4022     0.9233 0.920 0.080
#> GSM96983     1  0.4690     0.9108 0.900 0.100
#> GSM96984     1  0.4022     0.9233 0.920 0.080
#> GSM96994     1  0.4022     0.9233 0.920 0.080
#> GSM96996     1  0.0000     0.9504 1.000 0.000
#> GSM96997     1  0.4022     0.9233 0.920 0.080
#> GSM97007     1  0.4022     0.9233 0.920 0.080
#> GSM96954     1  0.4022     0.9233 0.920 0.080
#> GSM96962     1  0.4022     0.9233 0.920 0.080
#> GSM96969     1  0.0000     0.9504 1.000 0.000
#> GSM96970     1  0.0000     0.9504 1.000 0.000
#> GSM96973     1  0.0000     0.9504 1.000 0.000
#> GSM96976     1  0.0938     0.9476 0.988 0.012
#> GSM96977     1  0.0376     0.9495 0.996 0.004
#> GSM96995     1  0.4161     0.9211 0.916 0.084
#> GSM97002     1  0.0000     0.9504 1.000 0.000
#> GSM97009     1  0.4562     0.9135 0.904 0.096
#> GSM97010     1  0.0000     0.9504 1.000 0.000
#> GSM96974     1  0.0672     0.9485 0.992 0.008
#> GSM96985     1  0.0672     0.9485 0.992 0.008
#> GSM96959     1  0.5178     0.8989 0.884 0.116
#> GSM96972     1  0.0000     0.9504 1.000 0.000
#> GSM96978     1  0.4022     0.9233 0.920 0.080
#> GSM96967     1  0.0000     0.9504 1.000 0.000
#> GSM96987     1  0.0000     0.9504 1.000 0.000
#> GSM97011     1  0.0000     0.9504 1.000 0.000
#> GSM96964     1  0.0000     0.9504 1.000 0.000
#> GSM96965     1  0.0000     0.9504 1.000 0.000
#> GSM96981     1  0.0000     0.9504 1.000 0.000
#> GSM96982     1  0.0000     0.9504 1.000 0.000
#> GSM96988     1  0.4022     0.9233 0.920 0.080
#> GSM97000     1  0.0000     0.9504 1.000 0.000
#> GSM97004     1  0.0000     0.9504 1.000 0.000
#> GSM97008     1  0.0000     0.9504 1.000 0.000
#> GSM96950     1  0.0000     0.9504 1.000 0.000
#> GSM96980     1  0.0000     0.9504 1.000 0.000
#> GSM96989     1  0.0000     0.9504 1.000 0.000
#> GSM96992     1  0.0000     0.9504 1.000 0.000
#> GSM96993     1  0.0000     0.9504 1.000 0.000
#> GSM96958     1  0.0000     0.9504 1.000 0.000
#> GSM96951     1  0.0000     0.9504 1.000 0.000
#> GSM96952     1  0.0000     0.9504 1.000 0.000
#> GSM96961     1  0.0000     0.9504 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
#> GSM97038     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97045     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97047     1  0.8637    -0.3868 0.588 0.260 0.152
#> GSM97025     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97030     3  0.8069     0.9165 0.460 0.064 0.476
#> GSM97027     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97033     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97034     3  0.6683     0.9448 0.492 0.008 0.500
#> GSM97020     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97026     1  0.7208    -0.1066 0.644 0.308 0.048
#> GSM97012     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97015     1  0.6309    -0.9451 0.500 0.000 0.500
#> GSM97016     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97017     1  0.6282     0.5669 0.612 0.384 0.004
#> GSM97019     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97022     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97035     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97036     1  0.2584     0.4629 0.928 0.064 0.008
#> GSM97039     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97046     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97023     1  0.6282     0.5663 0.612 0.384 0.004
#> GSM97029     1  0.6451     0.5668 0.608 0.384 0.008
#> GSM97043     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97013     1  0.6282     0.5669 0.612 0.384 0.004
#> GSM96956     2  0.9234     0.1101 0.364 0.476 0.160
#> GSM97024     2  0.8130     0.8165 0.072 0.528 0.400
#> GSM97032     3  0.8138     0.9033 0.452 0.068 0.480
#> GSM97044     3  0.7487     0.9374 0.464 0.036 0.500
#> GSM97049     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM96968     1  0.6302    -0.9128 0.520 0.000 0.480
#> GSM96971     1  0.6280    -0.8740 0.540 0.000 0.460
#> GSM96986     3  0.6309     0.9440 0.496 0.000 0.504
#> GSM97003     1  0.1860     0.3479 0.948 0.000 0.052
#> GSM96957     1  0.7505     0.5560 0.572 0.384 0.044
#> GSM96960     1  0.0747     0.4139 0.984 0.000 0.016
#> GSM96975     1  0.5291     0.5518 0.732 0.268 0.000
#> GSM96998     1  0.6865     0.5619 0.596 0.384 0.020
#> GSM96999     1  0.6600     0.5658 0.604 0.384 0.012
#> GSM97001     1  0.7311     0.5594 0.580 0.384 0.036
#> GSM97005     1  0.7311     0.5589 0.580 0.384 0.036
#> GSM97006     1  0.3091     0.4735 0.912 0.072 0.016
#> GSM97021     1  0.7932     0.5469 0.552 0.384 0.064
#> GSM97028     3  0.6309     0.9396 0.500 0.000 0.500
#> GSM97031     1  0.2982     0.3756 0.920 0.024 0.056
#> GSM97037     2  0.8708     0.7198 0.108 0.488 0.404
#> GSM97018     3  0.7759     0.9281 0.476 0.048 0.476
#> GSM97014     1  0.5986     0.2469 0.736 0.240 0.024
#> GSM97042     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM97040     1  0.8297     0.5139 0.560 0.348 0.092
#> GSM97041     1  0.6451     0.5665 0.608 0.384 0.008
#> GSM96955     1  0.7184    -0.2627 0.504 0.472 0.024
#> GSM96990     3  0.8277     0.9031 0.460 0.076 0.464
#> GSM96991     2  0.7029     0.0191 0.440 0.540 0.020
#> GSM97048     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM96963     2  0.6786     0.0047 0.448 0.540 0.012
#> GSM96953     2  0.6079     0.9095 0.000 0.612 0.388
#> GSM96966     1  0.3112     0.4011 0.900 0.004 0.096
#> GSM96979     1  0.5529    -0.4157 0.704 0.000 0.296
#> GSM96983     3  0.7487     0.9374 0.464 0.036 0.500
#> GSM96984     3  0.6309     0.9440 0.496 0.000 0.504
#> GSM96994     3  0.6309     0.9440 0.496 0.000 0.504
#> GSM96996     1  0.6814     0.5655 0.608 0.372 0.020
#> GSM96997     1  0.6260    -0.8442 0.552 0.000 0.448
#> GSM97007     3  0.6309     0.9440 0.496 0.000 0.504
#> GSM96954     1  0.6215    -0.8039 0.572 0.000 0.428
#> GSM96962     3  0.6309     0.9440 0.496 0.000 0.504
#> GSM96969     1  0.3425     0.3959 0.884 0.004 0.112
#> GSM96970     1  0.3425     0.3959 0.884 0.004 0.112
#> GSM96973     1  0.3425     0.3959 0.884 0.004 0.112
#> GSM96976     1  0.6276    -0.1404 0.736 0.040 0.224
#> GSM96977     1  0.3910     0.2756 0.876 0.020 0.104
#> GSM96995     1  0.6307    -0.9266 0.512 0.000 0.488
#> GSM97002     1  0.1411     0.4142 0.964 0.000 0.036
#> GSM97009     1  0.6981    -0.1583 0.732 0.132 0.136
#> GSM97010     1  0.0747     0.3896 0.984 0.000 0.016
#> GSM96974     1  0.5138    -0.1566 0.748 0.000 0.252
#> GSM96985     1  0.4178     0.1414 0.828 0.000 0.172
#> GSM96959     1  0.7054    -0.9031 0.524 0.020 0.456
#> GSM96972     1  0.3425     0.3959 0.884 0.004 0.112
#> GSM96978     1  0.6302    -0.9125 0.520 0.000 0.480
#> GSM96967     1  0.3425     0.3959 0.884 0.004 0.112
#> GSM96987     1  0.6773     0.5647 0.636 0.340 0.024
#> GSM97011     1  0.7311     0.5598 0.580 0.384 0.036
#> GSM96964     1  0.6451     0.5654 0.608 0.384 0.008
#> GSM96965     1  0.1753     0.3992 0.952 0.000 0.048
#> GSM96981     1  0.1170     0.4218 0.976 0.008 0.016
#> GSM96982     1  0.2066     0.4086 0.940 0.000 0.060
#> GSM96988     1  0.5882    -0.5823 0.652 0.000 0.348
#> GSM97000     1  0.6325     0.3799 0.772 0.112 0.116
#> GSM97004     1  0.2356     0.4076 0.928 0.000 0.072
#> GSM97008     1  0.7932     0.5469 0.552 0.384 0.064
#> GSM96950     1  0.6062     0.5667 0.616 0.384 0.000
#> GSM96980     1  0.3425     0.3959 0.884 0.004 0.112
#> GSM96989     1  0.6600     0.5646 0.604 0.384 0.012
#> GSM96992     1  0.6721     0.5645 0.604 0.380 0.016
#> GSM96993     1  0.6282     0.5669 0.612 0.384 0.004
#> GSM96958     1  0.6062     0.5667 0.616 0.384 0.000
#> GSM96951     1  0.6737     0.5649 0.600 0.384 0.016
#> GSM96952     1  0.6721     0.5645 0.604 0.380 0.016
#> GSM96961     1  0.6282     0.5663 0.612 0.384 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97045     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97047     2  0.0895     0.9330 0.020 0.976 0.004 0.000
#> GSM97025     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97030     3  0.0707     0.9406 0.000 0.020 0.980 0.000
#> GSM97027     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97033     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97034     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM97020     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97026     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97012     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97015     3  0.0336     0.9508 0.000 0.008 0.992 0.000
#> GSM97016     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97017     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM97019     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97036     1  0.0469     0.9544 0.988 0.000 0.000 0.012
#> GSM97039     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97023     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM97029     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM97043     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97013     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96956     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97024     2  0.0188     0.9525 0.000 0.996 0.004 0.000
#> GSM97032     3  0.4877     0.3111 0.000 0.408 0.592 0.000
#> GSM97044     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM97049     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM96968     3  0.0188     0.9534 0.004 0.000 0.996 0.000
#> GSM96971     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM96986     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM97003     1  0.0804     0.9514 0.980 0.000 0.012 0.008
#> GSM96957     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96960     1  0.3311     0.8284 0.828 0.000 0.000 0.172
#> GSM96975     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96998     1  0.2647     0.8828 0.880 0.000 0.000 0.120
#> GSM96999     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM97001     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM97005     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM97006     1  0.3074     0.8509 0.848 0.000 0.000 0.152
#> GSM97021     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM97028     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM97031     1  0.0188     0.9574 0.996 0.000 0.004 0.000
#> GSM97037     2  0.0188     0.9525 0.000 0.996 0.004 0.000
#> GSM97018     2  0.5000    -0.0453 0.000 0.504 0.496 0.000
#> GSM97014     2  0.5000     0.0336 0.496 0.504 0.000 0.000
#> GSM97042     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97040     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM97041     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96955     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM96990     3  0.3688     0.7289 0.000 0.208 0.792 0.000
#> GSM96991     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM97048     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000     0.9557 0.000 1.000 0.000 0.000
#> GSM96966     4  0.0000     0.9276 0.000 0.000 0.000 1.000
#> GSM96979     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM96983     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM96984     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM96994     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM96996     1  0.3024     0.8561 0.852 0.000 0.000 0.148
#> GSM96997     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM97007     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM96954     3  0.0817     0.9352 0.024 0.000 0.976 0.000
#> GSM96962     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM96969     4  0.0000     0.9276 0.000 0.000 0.000 1.000
#> GSM96970     4  0.0000     0.9276 0.000 0.000 0.000 1.000
#> GSM96973     4  0.0000     0.9276 0.000 0.000 0.000 1.000
#> GSM96976     4  0.3528     0.7347 0.000 0.000 0.192 0.808
#> GSM96977     1  0.0817     0.9444 0.976 0.000 0.024 0.000
#> GSM96995     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM97002     4  0.4746     0.3553 0.368 0.000 0.000 0.632
#> GSM97009     1  0.4244     0.7516 0.800 0.168 0.032 0.000
#> GSM97010     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96974     4  0.1867     0.8739 0.000 0.000 0.072 0.928
#> GSM96985     4  0.0336     0.9235 0.000 0.000 0.008 0.992
#> GSM96959     3  0.2563     0.8723 0.072 0.020 0.908 0.000
#> GSM96972     4  0.0000     0.9276 0.000 0.000 0.000 1.000
#> GSM96978     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM96967     4  0.0000     0.9276 0.000 0.000 0.000 1.000
#> GSM96987     1  0.3172     0.8433 0.840 0.000 0.000 0.160
#> GSM97011     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96964     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96965     4  0.2704     0.8377 0.124 0.000 0.000 0.876
#> GSM96981     1  0.2589     0.8776 0.884 0.000 0.000 0.116
#> GSM96982     4  0.1389     0.8977 0.048 0.000 0.000 0.952
#> GSM96988     3  0.0000     0.9561 0.000 0.000 1.000 0.000
#> GSM97000     1  0.0188     0.9574 0.996 0.000 0.004 0.000
#> GSM97004     4  0.0000     0.9276 0.000 0.000 0.000 1.000
#> GSM97008     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96950     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96980     4  0.0000     0.9276 0.000 0.000 0.000 1.000
#> GSM96989     1  0.1302     0.9367 0.956 0.000 0.000 0.044
#> GSM96992     1  0.2589     0.8849 0.884 0.000 0.000 0.116
#> GSM96993     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96958     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96951     1  0.0000     0.9594 1.000 0.000 0.000 0.000
#> GSM96952     1  0.1940     0.9155 0.924 0.000 0.000 0.076
#> GSM96961     1  0.0000     0.9594 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
#> GSM97038     2  0.0000      0.931 0.000 1.000 0.000 0.000 0.000
#> GSM97045     2  0.0290      0.931 0.000 0.992 0.000 0.000 0.008
#> GSM97047     5  0.4859      0.506 0.020 0.288 0.020 0.000 0.672
#> GSM97025     2  0.0162      0.931 0.000 0.996 0.000 0.000 0.004
#> GSM97030     3  0.4497      0.643 0.000 0.016 0.632 0.000 0.352
#> GSM97027     2  0.0162      0.931 0.000 0.996 0.000 0.000 0.004
#> GSM97033     2  0.0290      0.931 0.000 0.992 0.000 0.000 0.008
#> GSM97034     3  0.4298      0.650 0.000 0.008 0.640 0.000 0.352
#> GSM97020     2  0.0290      0.931 0.000 0.992 0.000 0.000 0.008
#> GSM97026     2  0.1901      0.886 0.004 0.928 0.012 0.000 0.056
#> GSM97012     2  0.1121      0.917 0.000 0.956 0.000 0.000 0.044
#> GSM97015     3  0.4402      0.647 0.000 0.012 0.636 0.000 0.352
#> GSM97016     2  0.0162      0.931 0.000 0.996 0.000 0.000 0.004
#> GSM97017     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM97019     2  0.0510      0.929 0.000 0.984 0.000 0.000 0.016
#> GSM97022     2  0.0703      0.927 0.000 0.976 0.000 0.000 0.024
#> GSM97035     2  0.0404      0.930 0.000 0.988 0.000 0.000 0.012
#> GSM97036     1  0.4624      0.620 0.636 0.000 0.000 0.024 0.340
#> GSM97039     2  0.0162      0.931 0.000 0.996 0.000 0.000 0.004
#> GSM97046     2  0.0162      0.931 0.000 0.996 0.000 0.000 0.004
#> GSM97023     1  0.0798      0.634 0.976 0.000 0.000 0.008 0.016
#> GSM97029     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM97043     2  0.0579      0.928 0.000 0.984 0.008 0.000 0.008
#> GSM97013     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM96956     2  0.3890      0.599 0.000 0.736 0.012 0.000 0.252
#> GSM97024     2  0.4283      0.413 0.000 0.644 0.008 0.000 0.348
#> GSM97032     3  0.6455      0.385 0.000 0.188 0.460 0.000 0.352
#> GSM97044     3  0.4030      0.655 0.000 0.000 0.648 0.000 0.352
#> GSM97049     2  0.0290      0.931 0.000 0.992 0.000 0.000 0.008
#> GSM96968     3  0.1124      0.787 0.004 0.000 0.960 0.000 0.036
#> GSM96971     3  0.0000      0.794 0.000 0.000 1.000 0.000 0.000
#> GSM96986     3  0.0162      0.793 0.000 0.000 0.996 0.000 0.004
#> GSM97003     1  0.1661      0.603 0.940 0.000 0.036 0.024 0.000
#> GSM96957     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM96960     1  0.2813      0.538 0.832 0.000 0.000 0.168 0.000
#> GSM96975     1  0.1608      0.641 0.928 0.000 0.000 0.000 0.072
#> GSM96998     1  0.2605      0.558 0.852 0.000 0.000 0.148 0.000
#> GSM96999     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM97001     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM97005     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM97006     1  0.2605      0.556 0.852 0.000 0.000 0.148 0.000
#> GSM97021     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM97028     3  0.3177      0.728 0.000 0.000 0.792 0.000 0.208
#> GSM97031     1  0.3366      0.643 0.784 0.000 0.000 0.004 0.212
#> GSM97037     2  0.4269      0.503 0.000 0.684 0.016 0.000 0.300
#> GSM97018     3  0.6742      0.223 0.000 0.260 0.388 0.000 0.352
#> GSM97014     1  0.6606      0.167 0.460 0.192 0.004 0.000 0.344
#> GSM97042     2  0.0963      0.921 0.000 0.964 0.000 0.000 0.036
#> GSM97040     1  0.4464      0.509 0.584 0.000 0.008 0.000 0.408
#> GSM97041     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM96955     2  0.1195      0.917 0.000 0.960 0.012 0.000 0.028
#> GSM96990     3  0.5804      0.537 0.000 0.104 0.544 0.000 0.352
#> GSM96991     2  0.2017      0.889 0.000 0.912 0.008 0.000 0.080
#> GSM97048     2  0.0290      0.931 0.000 0.992 0.000 0.000 0.008
#> GSM96963     2  0.2017      0.889 0.000 0.912 0.008 0.000 0.080
#> GSM96953     2  0.0609      0.928 0.000 0.980 0.000 0.000 0.020
#> GSM96966     4  0.0162      0.890 0.004 0.000 0.000 0.996 0.000
#> GSM96979     3  0.0000      0.794 0.000 0.000 1.000 0.000 0.000
#> GSM96983     3  0.0794      0.782 0.000 0.000 0.972 0.000 0.028
#> GSM96984     3  0.0000      0.794 0.000 0.000 1.000 0.000 0.000
#> GSM96994     3  0.0000      0.794 0.000 0.000 1.000 0.000 0.000
#> GSM96996     1  0.2813      0.543 0.832 0.000 0.000 0.168 0.000
#> GSM96997     3  0.0162      0.793 0.000 0.000 0.996 0.000 0.004
#> GSM97007     3  0.0000      0.794 0.000 0.000 1.000 0.000 0.000
#> GSM96954     3  0.0703      0.781 0.024 0.000 0.976 0.000 0.000
#> GSM96962     3  0.0162      0.793 0.000 0.000 0.996 0.000 0.004
#> GSM96969     4  0.0000      0.891 0.000 0.000 0.000 1.000 0.000
#> GSM96970     4  0.0000      0.891 0.000 0.000 0.000 1.000 0.000
#> GSM96973     4  0.0290      0.890 0.000 0.000 0.000 0.992 0.008
#> GSM96976     4  0.5167      0.711 0.000 0.000 0.088 0.664 0.248
#> GSM96977     1  0.4419      0.623 0.668 0.000 0.020 0.000 0.312
#> GSM96995     3  0.4030      0.655 0.000 0.000 0.648 0.000 0.352
#> GSM97002     1  0.4302     -0.161 0.520 0.000 0.000 0.480 0.000
#> GSM97009     5  0.4997      0.393 0.248 0.044 0.016 0.000 0.692
#> GSM97010     1  0.4135      0.629 0.656 0.000 0.004 0.000 0.340
#> GSM96974     4  0.4555      0.760 0.000 0.000 0.056 0.720 0.224
#> GSM96985     4  0.3882      0.789 0.000 0.000 0.020 0.756 0.224
#> GSM96959     3  0.5719      0.417 0.048 0.016 0.500 0.000 0.436
#> GSM96972     4  0.0000      0.891 0.000 0.000 0.000 1.000 0.000
#> GSM96978     3  0.0963      0.778 0.000 0.000 0.964 0.000 0.036
#> GSM96967     4  0.0290      0.890 0.000 0.000 0.000 0.992 0.008
#> GSM96987     1  0.2966      0.523 0.816 0.000 0.000 0.184 0.000
#> GSM97011     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM96964     1  0.0451      0.632 0.988 0.000 0.000 0.004 0.008
#> GSM96965     4  0.3124      0.748 0.144 0.000 0.008 0.840 0.008
#> GSM96981     1  0.3318      0.512 0.800 0.000 0.000 0.192 0.008
#> GSM96982     4  0.1478      0.853 0.064 0.000 0.000 0.936 0.000
#> GSM96988     3  0.0162      0.793 0.000 0.000 0.996 0.004 0.000
#> GSM97000     1  0.4371      0.619 0.644 0.000 0.012 0.000 0.344
#> GSM97004     4  0.3395      0.674 0.236 0.000 0.000 0.764 0.000
#> GSM97008     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM96950     1  0.3452      0.644 0.756 0.000 0.000 0.000 0.244
#> GSM96980     4  0.0000      0.891 0.000 0.000 0.000 1.000 0.000
#> GSM96989     1  0.2068      0.596 0.904 0.000 0.000 0.092 0.004
#> GSM96992     1  0.2516      0.562 0.860 0.000 0.000 0.140 0.000
#> GSM96993     1  0.3999      0.632 0.656 0.000 0.000 0.000 0.344
#> GSM96958     1  0.0771      0.635 0.976 0.000 0.000 0.004 0.020
#> GSM96951     1  0.0324      0.631 0.992 0.000 0.000 0.004 0.004
#> GSM96952     1  0.2329      0.573 0.876 0.000 0.000 0.124 0.000
#> GSM96961     1  0.0609      0.625 0.980 0.000 0.000 0.020 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
#> GSM97038     2  0.0260     0.9332 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM97045     2  0.1049     0.9316 0.000 0.960 0.008 0.000 0.000 0.032
#> GSM97047     3  0.4518     0.5981 0.000 0.072 0.688 0.000 0.236 0.004
#> GSM97025     2  0.0790     0.9329 0.000 0.968 0.000 0.000 0.000 0.032
#> GSM97030     3  0.1367     0.7695 0.000 0.012 0.944 0.000 0.000 0.044
#> GSM97027     2  0.0790     0.9329 0.000 0.968 0.000 0.000 0.000 0.032
#> GSM97033     2  0.1320     0.9285 0.000 0.948 0.016 0.000 0.000 0.036
#> GSM97034     3  0.1152     0.7643 0.000 0.004 0.952 0.000 0.000 0.044
#> GSM97020     2  0.1320     0.9285 0.000 0.948 0.016 0.000 0.000 0.036
#> GSM97026     2  0.3698     0.7664 0.000 0.788 0.116 0.000 0.096 0.000
#> GSM97012     2  0.2287     0.9179 0.048 0.904 0.012 0.000 0.000 0.036
#> GSM97015     3  0.1219     0.7655 0.000 0.004 0.948 0.000 0.000 0.048
#> GSM97016     2  0.0260     0.9341 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM97017     5  0.0000     0.8456 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97019     2  0.1483     0.9290 0.036 0.944 0.008 0.000 0.000 0.012
#> GSM97022     2  0.2046     0.9224 0.044 0.916 0.008 0.000 0.000 0.032
#> GSM97035     2  0.1382     0.9300 0.036 0.948 0.008 0.000 0.000 0.008
#> GSM97036     5  0.1007     0.8278 0.004 0.000 0.004 0.016 0.968 0.008
#> GSM97039     2  0.1245     0.9297 0.000 0.952 0.016 0.000 0.000 0.032
#> GSM97046     2  0.1168     0.9310 0.000 0.956 0.016 0.000 0.000 0.028
#> GSM97023     1  0.3986     0.7146 0.532 0.000 0.000 0.004 0.464 0.000
#> GSM97029     5  0.0291     0.8432 0.004 0.000 0.004 0.000 0.992 0.000
#> GSM97043     2  0.1448     0.9278 0.016 0.948 0.024 0.000 0.000 0.012
#> GSM97013     5  0.0000     0.8456 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM96956     3  0.3983     0.5191 0.004 0.348 0.640 0.000 0.000 0.008
#> GSM97024     3  0.3398     0.6704 0.000 0.252 0.740 0.000 0.000 0.008
#> GSM97032     3  0.1531     0.7822 0.000 0.068 0.928 0.000 0.000 0.004
#> GSM97044     3  0.1327     0.7562 0.000 0.000 0.936 0.000 0.000 0.064
#> GSM97049     2  0.1320     0.9285 0.000 0.948 0.016 0.000 0.000 0.036
#> GSM96968     6  0.3819     0.7902 0.000 0.000 0.372 0.000 0.004 0.624
#> GSM96971     6  0.4451     0.9147 0.072 0.000 0.248 0.000 0.000 0.680
#> GSM96986     6  0.2996     0.9401 0.000 0.000 0.228 0.000 0.000 0.772
#> GSM97003     1  0.5423     0.7830 0.572 0.000 0.020 0.012 0.344 0.052
#> GSM96957     5  0.0291     0.8455 0.004 0.000 0.004 0.000 0.992 0.000
#> GSM96960     1  0.5343     0.8187 0.580 0.000 0.000 0.156 0.264 0.000
#> GSM96975     5  0.4129    -0.5095 0.424 0.000 0.000 0.000 0.564 0.012
#> GSM96998     1  0.5720     0.8294 0.548 0.000 0.000 0.148 0.292 0.012
#> GSM96999     5  0.0146     0.8452 0.004 0.000 0.000 0.000 0.996 0.000
#> GSM97001     5  0.0291     0.8455 0.004 0.000 0.004 0.000 0.992 0.000
#> GSM97005     5  0.0520     0.8435 0.008 0.000 0.008 0.000 0.984 0.000
#> GSM97006     1  0.5289     0.8337 0.576 0.000 0.000 0.136 0.288 0.000
#> GSM97021     5  0.0405     0.8447 0.004 0.000 0.008 0.000 0.988 0.000
#> GSM97028     3  0.3489     0.2539 0.000 0.004 0.708 0.000 0.000 0.288
#> GSM97031     5  0.4250    -0.1847 0.360 0.000 0.012 0.004 0.620 0.004
#> GSM97037     3  0.3555     0.6380 0.000 0.280 0.712 0.000 0.000 0.008
#> GSM97018     3  0.1918     0.7754 0.000 0.088 0.904 0.000 0.000 0.008
#> GSM97014     5  0.2170     0.7050 0.000 0.100 0.012 0.000 0.888 0.000
#> GSM97042     2  0.2113     0.9209 0.048 0.912 0.008 0.000 0.000 0.032
#> GSM97040     5  0.1501     0.7768 0.000 0.000 0.076 0.000 0.924 0.000
#> GSM97041     5  0.0000     0.8456 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM96955     2  0.3288     0.8767 0.052 0.848 0.064 0.000 0.000 0.036
#> GSM96990     3  0.1333     0.7836 0.000 0.048 0.944 0.000 0.000 0.008
#> GSM96991     2  0.3643     0.8684 0.088 0.820 0.028 0.000 0.000 0.064
#> GSM97048     2  0.1320     0.9285 0.000 0.948 0.016 0.000 0.000 0.036
#> GSM96963     2  0.3643     0.8684 0.088 0.820 0.028 0.000 0.000 0.064
#> GSM96953     2  0.1649     0.9272 0.040 0.936 0.008 0.000 0.000 0.016
#> GSM96966     4  0.0363     0.8116 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM96979     6  0.3265     0.9358 0.000 0.004 0.248 0.000 0.000 0.748
#> GSM96983     6  0.4843     0.8767 0.116 0.000 0.232 0.000 0.000 0.652
#> GSM96984     6  0.3023     0.9410 0.000 0.000 0.232 0.000 0.000 0.768
#> GSM96994     6  0.3050     0.9408 0.000 0.000 0.236 0.000 0.000 0.764
#> GSM96996     1  0.5804     0.8238 0.532 0.000 0.000 0.156 0.300 0.012
#> GSM96997     6  0.2996     0.9401 0.000 0.000 0.228 0.000 0.000 0.772
#> GSM97007     6  0.3023     0.9410 0.000 0.000 0.232 0.000 0.000 0.768
#> GSM96954     6  0.3420     0.9318 0.000 0.000 0.240 0.000 0.012 0.748
#> GSM96962     6  0.2996     0.9401 0.000 0.000 0.228 0.000 0.000 0.772
#> GSM96969     4  0.0260     0.8116 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM96970     4  0.0363     0.8116 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM96973     4  0.0000     0.8109 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96976     4  0.5789     0.5590 0.364 0.000 0.012 0.492 0.000 0.132
#> GSM96977     5  0.2747     0.7016 0.108 0.000 0.028 0.000 0.860 0.004
#> GSM96995     3  0.1082     0.7640 0.000 0.000 0.956 0.000 0.004 0.040
#> GSM97002     4  0.4783    -0.0736 0.460 0.000 0.000 0.500 0.028 0.012
#> GSM97009     5  0.4534    -0.1169 0.000 0.032 0.472 0.000 0.496 0.000
#> GSM97010     5  0.0777     0.8292 0.024 0.000 0.004 0.000 0.972 0.000
#> GSM96974     4  0.5557     0.5897 0.340 0.000 0.008 0.532 0.000 0.120
#> GSM96985     4  0.5502     0.5985 0.332 0.000 0.008 0.544 0.000 0.116
#> GSM96959     3  0.2095     0.7488 0.000 0.016 0.904 0.000 0.076 0.004
#> GSM96972     4  0.0458     0.8106 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM96978     6  0.5054     0.8653 0.124 0.004 0.232 0.000 0.000 0.640
#> GSM96967     4  0.0000     0.8109 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96987     1  0.5945     0.7874 0.524 0.000 0.000 0.200 0.264 0.012
#> GSM97011     5  0.0000     0.8456 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM96964     1  0.4303     0.7330 0.524 0.000 0.000 0.004 0.460 0.012
#> GSM96965     4  0.3319     0.7135 0.020 0.000 0.008 0.836 0.116 0.020
#> GSM96981     1  0.6316     0.6150 0.448 0.000 0.000 0.268 0.268 0.016
#> GSM96982     4  0.1867     0.7713 0.064 0.000 0.000 0.916 0.020 0.000
#> GSM96988     6  0.4454     0.9144 0.060 0.004 0.252 0.000 0.000 0.684
#> GSM97000     5  0.0622     0.8418 0.008 0.000 0.012 0.000 0.980 0.000
#> GSM97004     4  0.3729     0.4599 0.296 0.000 0.000 0.692 0.000 0.012
#> GSM97008     5  0.0622     0.8418 0.008 0.000 0.012 0.000 0.980 0.000
#> GSM96950     5  0.2631     0.5369 0.180 0.000 0.000 0.000 0.820 0.000
#> GSM96980     4  0.0458     0.8106 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM96989     1  0.5406     0.8063 0.520 0.000 0.000 0.084 0.384 0.012
#> GSM96992     1  0.5271     0.8350 0.576 0.000 0.000 0.132 0.292 0.000
#> GSM96993     5  0.0146     0.8448 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM96958     1  0.3851     0.7183 0.540 0.000 0.000 0.000 0.460 0.000
#> GSM96951     1  0.4172     0.7555 0.564 0.000 0.008 0.004 0.424 0.000
#> GSM96952     1  0.5405     0.8355 0.572 0.000 0.000 0.132 0.292 0.004
#> GSM96961     1  0.4184     0.7848 0.576 0.000 0.000 0.016 0.408 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-mclust-collect-classes

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

test_to_known_factors(res)
#>            n disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:mclust 99         6.56e-07      0.5696     2.99e-10   0.0308 2
#> CV:mclust 59         3.59e-03      0.3146     6.24e-13   0.2008 3
#> CV:mclust 96         8.49e-06      0.0410     2.31e-19   0.0171 4
#> CV:mclust 93         3.60e-05      0.0441     9.45e-18   0.0124 5
#> CV:mclust 94         3.88e-06      0.1120     4.63e-20   0.0189 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 21168 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-NMF-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.972       0.988         0.4964 0.505   0.505
#> 3 3 0.529           0.701       0.840         0.3248 0.807   0.634
#> 4 4 0.587           0.564       0.793         0.1264 0.827   0.567
#> 5 5 0.591           0.526       0.746         0.0726 0.817   0.439
#> 6 6 0.626           0.485       0.696         0.0467 0.884   0.512

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
#> GSM97038     2  0.0000      0.990 0.000 1.000
#> GSM97045     2  0.0000      0.990 0.000 1.000
#> GSM97047     2  0.0000      0.990 0.000 1.000
#> GSM97025     2  0.0000      0.990 0.000 1.000
#> GSM97030     2  0.0000      0.990 0.000 1.000
#> GSM97027     2  0.0000      0.990 0.000 1.000
#> GSM97033     2  0.0000      0.990 0.000 1.000
#> GSM97034     2  0.0000      0.990 0.000 1.000
#> GSM97020     2  0.0000      0.990 0.000 1.000
#> GSM97026     2  0.0000      0.990 0.000 1.000
#> GSM97012     2  0.0000      0.990 0.000 1.000
#> GSM97015     2  0.0000      0.990 0.000 1.000
#> GSM97016     2  0.0000      0.990 0.000 1.000
#> GSM97017     1  0.0376      0.983 0.996 0.004
#> GSM97019     2  0.0000      0.990 0.000 1.000
#> GSM97022     2  0.0000      0.990 0.000 1.000
#> GSM97035     2  0.0000      0.990 0.000 1.000
#> GSM97036     1  0.1843      0.963 0.972 0.028
#> GSM97039     2  0.0000      0.990 0.000 1.000
#> GSM97046     2  0.0000      0.990 0.000 1.000
#> GSM97023     1  0.0000      0.985 1.000 0.000
#> GSM97029     1  0.2603      0.948 0.956 0.044
#> GSM97043     2  0.0000      0.990 0.000 1.000
#> GSM97013     1  0.0000      0.985 1.000 0.000
#> GSM96956     2  0.0000      0.990 0.000 1.000
#> GSM97024     2  0.0000      0.990 0.000 1.000
#> GSM97032     2  0.0000      0.990 0.000 1.000
#> GSM97044     2  0.0000      0.990 0.000 1.000
#> GSM97049     2  0.0000      0.990 0.000 1.000
#> GSM96968     1  0.7376      0.741 0.792 0.208
#> GSM96971     1  0.0000      0.985 1.000 0.000
#> GSM96986     1  0.0000      0.985 1.000 0.000
#> GSM97003     1  0.0000      0.985 1.000 0.000
#> GSM96957     1  0.0376      0.983 0.996 0.004
#> GSM96960     1  0.0000      0.985 1.000 0.000
#> GSM96975     1  0.0000      0.985 1.000 0.000
#> GSM96998     1  0.0000      0.985 1.000 0.000
#> GSM96999     1  0.0000      0.985 1.000 0.000
#> GSM97001     1  0.0000      0.985 1.000 0.000
#> GSM97005     1  0.0000      0.985 1.000 0.000
#> GSM97006     1  0.0000      0.985 1.000 0.000
#> GSM97021     1  0.0938      0.977 0.988 0.012
#> GSM97028     2  0.1843      0.966 0.028 0.972
#> GSM97031     1  0.0000      0.985 1.000 0.000
#> GSM97037     2  0.0000      0.990 0.000 1.000
#> GSM97018     2  0.0000      0.990 0.000 1.000
#> GSM97014     2  0.0000      0.990 0.000 1.000
#> GSM97042     2  0.0000      0.990 0.000 1.000
#> GSM97040     2  0.0672      0.984 0.008 0.992
#> GSM97041     1  0.5842      0.838 0.860 0.140
#> GSM96955     2  0.0000      0.990 0.000 1.000
#> GSM96990     2  0.0000      0.990 0.000 1.000
#> GSM96991     2  0.0000      0.990 0.000 1.000
#> GSM97048     2  0.0000      0.990 0.000 1.000
#> GSM96963     2  0.0000      0.990 0.000 1.000
#> GSM96953     2  0.0000      0.990 0.000 1.000
#> GSM96966     1  0.0000      0.985 1.000 0.000
#> GSM96979     1  0.0000      0.985 1.000 0.000
#> GSM96983     2  0.0000      0.990 0.000 1.000
#> GSM96984     1  0.1843      0.963 0.972 0.028
#> GSM96994     2  0.0938      0.980 0.012 0.988
#> GSM96996     1  0.0000      0.985 1.000 0.000
#> GSM96997     1  0.0000      0.985 1.000 0.000
#> GSM97007     2  0.2423      0.954 0.040 0.960
#> GSM96954     1  0.0000      0.985 1.000 0.000
#> GSM96962     1  0.0000      0.985 1.000 0.000
#> GSM96969     1  0.0000      0.985 1.000 0.000
#> GSM96970     1  0.0000      0.985 1.000 0.000
#> GSM96973     1  0.0000      0.985 1.000 0.000
#> GSM96976     2  0.8763      0.569 0.296 0.704
#> GSM96977     1  0.0000      0.985 1.000 0.000
#> GSM96995     2  0.1843      0.966 0.028 0.972
#> GSM97002     1  0.0000      0.985 1.000 0.000
#> GSM97009     2  0.0000      0.990 0.000 1.000
#> GSM97010     1  0.0672      0.980 0.992 0.008
#> GSM96974     1  0.0000      0.985 1.000 0.000
#> GSM96985     1  0.0000      0.985 1.000 0.000
#> GSM96959     2  0.0000      0.990 0.000 1.000
#> GSM96972     1  0.0000      0.985 1.000 0.000
#> GSM96978     1  0.9044      0.536 0.680 0.320
#> GSM96967     1  0.0000      0.985 1.000 0.000
#> GSM96987     1  0.0000      0.985 1.000 0.000
#> GSM97011     1  0.0938      0.977 0.988 0.012
#> GSM96964     1  0.0000      0.985 1.000 0.000
#> GSM96965     1  0.0938      0.977 0.988 0.012
#> GSM96981     1  0.0000      0.985 1.000 0.000
#> GSM96982     1  0.0000      0.985 1.000 0.000
#> GSM96988     1  0.0000      0.985 1.000 0.000
#> GSM97000     1  0.0000      0.985 1.000 0.000
#> GSM97004     1  0.0000      0.985 1.000 0.000
#> GSM97008     1  0.0000      0.985 1.000 0.000
#> GSM96950     1  0.0000      0.985 1.000 0.000
#> GSM96980     1  0.0000      0.985 1.000 0.000
#> GSM96989     1  0.0000      0.985 1.000 0.000
#> GSM96992     1  0.0000      0.985 1.000 0.000
#> GSM96993     1  0.0000      0.985 1.000 0.000
#> GSM96958     1  0.0000      0.985 1.000 0.000
#> GSM96951     1  0.0000      0.985 1.000 0.000
#> GSM96952     1  0.0000      0.985 1.000 0.000
#> GSM96961     1  0.0000      0.985 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97038     2  0.1753     0.8202 0.000 0.952 0.048
#> GSM97045     2  0.0237     0.8110 0.004 0.996 0.000
#> GSM97047     2  0.1999     0.7856 0.036 0.952 0.012
#> GSM97025     2  0.0892     0.8175 0.000 0.980 0.020
#> GSM97030     2  0.6309     0.2294 0.000 0.504 0.496
#> GSM97027     2  0.0475     0.8102 0.004 0.992 0.004
#> GSM97033     2  0.0237     0.8120 0.000 0.996 0.004
#> GSM97034     3  0.6308    -0.2311 0.000 0.492 0.508
#> GSM97020     2  0.0237     0.8110 0.004 0.996 0.000
#> GSM97026     2  0.0424     0.8151 0.000 0.992 0.008
#> GSM97012     2  0.4399     0.7779 0.000 0.812 0.188
#> GSM97015     2  0.5020     0.7561 0.012 0.796 0.192
#> GSM97016     2  0.2066     0.8204 0.000 0.940 0.060
#> GSM97017     1  0.4861     0.7222 0.800 0.192 0.008
#> GSM97019     2  0.3192     0.8105 0.000 0.888 0.112
#> GSM97022     2  0.4121     0.7897 0.000 0.832 0.168
#> GSM97035     2  0.4062     0.7909 0.000 0.836 0.164
#> GSM97036     1  0.4514     0.7633 0.832 0.156 0.012
#> GSM97039     2  0.1411     0.8193 0.000 0.964 0.036
#> GSM97046     2  0.1964     0.8207 0.000 0.944 0.056
#> GSM97023     1  0.1453     0.8235 0.968 0.024 0.008
#> GSM97029     1  0.4784     0.7165 0.796 0.200 0.004
#> GSM97043     2  0.2448     0.8186 0.000 0.924 0.076
#> GSM97013     1  0.5461     0.6686 0.748 0.244 0.008
#> GSM96956     2  0.6140     0.4971 0.000 0.596 0.404
#> GSM97024     2  0.4178     0.7907 0.000 0.828 0.172
#> GSM97032     2  0.6244     0.4044 0.000 0.560 0.440
#> GSM97044     3  0.6111     0.0984 0.000 0.396 0.604
#> GSM97049     2  0.0424     0.8092 0.008 0.992 0.000
#> GSM96968     3  0.4539     0.7058 0.148 0.016 0.836
#> GSM96971     3  0.1860     0.7556 0.052 0.000 0.948
#> GSM96986     3  0.4842     0.5902 0.224 0.000 0.776
#> GSM97003     1  0.4974     0.7510 0.764 0.000 0.236
#> GSM96957     1  0.6217     0.6359 0.712 0.264 0.024
#> GSM96960     1  0.4291     0.7849 0.820 0.000 0.180
#> GSM96975     1  0.2796     0.8232 0.908 0.000 0.092
#> GSM96998     1  0.1411     0.8330 0.964 0.000 0.036
#> GSM96999     1  0.1832     0.8216 0.956 0.036 0.008
#> GSM97001     1  0.5680     0.6950 0.764 0.212 0.024
#> GSM97005     1  0.2313     0.8179 0.944 0.032 0.024
#> GSM97006     1  0.1964     0.8325 0.944 0.000 0.056
#> GSM97021     1  0.5402     0.7235 0.792 0.180 0.028
#> GSM97028     3  0.3941     0.6328 0.000 0.156 0.844
#> GSM97031     1  0.1964     0.8270 0.944 0.000 0.056
#> GSM97037     2  0.5363     0.6973 0.000 0.724 0.276
#> GSM97018     3  0.6267    -0.1189 0.000 0.452 0.548
#> GSM97014     2  0.4099     0.6736 0.140 0.852 0.008
#> GSM97042     2  0.4399     0.7779 0.000 0.812 0.188
#> GSM97040     2  0.5331     0.5999 0.184 0.792 0.024
#> GSM97041     1  0.6387     0.5887 0.680 0.300 0.020
#> GSM96955     2  0.5591     0.6651 0.000 0.696 0.304
#> GSM96990     2  0.6111     0.5014 0.000 0.604 0.396
#> GSM96991     2  0.6045     0.5460 0.000 0.620 0.380
#> GSM97048     2  0.0237     0.8140 0.000 0.996 0.004
#> GSM96963     2  0.5138     0.7284 0.000 0.748 0.252
#> GSM96953     2  0.4974     0.7398 0.000 0.764 0.236
#> GSM96966     1  0.5363     0.6948 0.724 0.000 0.276
#> GSM96979     3  0.4235     0.6479 0.176 0.000 0.824
#> GSM96983     3  0.2261     0.7242 0.000 0.068 0.932
#> GSM96984     3  0.0829     0.7496 0.004 0.012 0.984
#> GSM96994     3  0.2711     0.7058 0.000 0.088 0.912
#> GSM96996     1  0.2625     0.8262 0.916 0.000 0.084
#> GSM96997     3  0.4605     0.6107 0.204 0.000 0.796
#> GSM97007     3  0.3192     0.6800 0.000 0.112 0.888
#> GSM96954     3  0.6302    -0.1059 0.480 0.000 0.520
#> GSM96962     3  0.2796     0.7466 0.092 0.000 0.908
#> GSM96969     1  0.5948     0.5679 0.640 0.000 0.360
#> GSM96970     1  0.5327     0.6996 0.728 0.000 0.272
#> GSM96973     1  0.6280     0.3458 0.540 0.000 0.460
#> GSM96976     3  0.2297     0.7453 0.020 0.036 0.944
#> GSM96977     1  0.3941     0.8045 0.844 0.000 0.156
#> GSM96995     3  0.5958     0.3759 0.008 0.300 0.692
#> GSM97002     1  0.3686     0.8053 0.860 0.000 0.140
#> GSM97009     2  0.1170     0.8019 0.016 0.976 0.008
#> GSM97010     1  0.4293     0.7919 0.832 0.004 0.164
#> GSM96974     3  0.2400     0.7539 0.064 0.004 0.932
#> GSM96985     3  0.2356     0.7520 0.072 0.000 0.928
#> GSM96959     2  0.2681     0.7881 0.028 0.932 0.040
#> GSM96972     1  0.5098     0.7264 0.752 0.000 0.248
#> GSM96978     3  0.1453     0.7489 0.008 0.024 0.968
#> GSM96967     1  0.6154     0.4722 0.592 0.000 0.408
#> GSM96987     1  0.1411     0.8330 0.964 0.000 0.036
#> GSM97011     1  0.3550     0.7977 0.896 0.080 0.024
#> GSM96964     1  0.0661     0.8281 0.988 0.008 0.004
#> GSM96965     1  0.6526     0.6981 0.704 0.036 0.260
#> GSM96981     1  0.3192     0.8170 0.888 0.000 0.112
#> GSM96982     1  0.5327     0.7000 0.728 0.000 0.272
#> GSM96988     3  0.1753     0.7563 0.048 0.000 0.952
#> GSM97000     1  0.3337     0.8107 0.908 0.032 0.060
#> GSM97004     1  0.3816     0.8010 0.852 0.000 0.148
#> GSM97008     1  0.3832     0.7970 0.888 0.076 0.036
#> GSM96950     1  0.1170     0.8316 0.976 0.008 0.016
#> GSM96980     1  0.4702     0.7580 0.788 0.000 0.212
#> GSM96989     1  0.1411     0.8330 0.964 0.000 0.036
#> GSM96992     1  0.1753     0.8331 0.952 0.000 0.048
#> GSM96993     1  0.2878     0.7994 0.904 0.096 0.000
#> GSM96958     1  0.1289     0.8330 0.968 0.000 0.032
#> GSM96951     1  0.1643     0.8311 0.956 0.000 0.044
#> GSM96952     1  0.1529     0.8328 0.960 0.000 0.040
#> GSM96961     1  0.0892     0.8310 0.980 0.000 0.020

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.0707     0.8122 0.000 0.980 0.000 0.020
#> GSM97045     2  0.0524     0.8095 0.008 0.988 0.000 0.004
#> GSM97047     2  0.2489     0.7556 0.068 0.912 0.020 0.000
#> GSM97025     2  0.0707     0.8125 0.000 0.980 0.000 0.020
#> GSM97030     3  0.2450     0.7944 0.000 0.072 0.912 0.016
#> GSM97027     2  0.0188     0.8092 0.004 0.996 0.000 0.000
#> GSM97033     2  0.0188     0.8092 0.004 0.996 0.000 0.000
#> GSM97034     3  0.3732     0.7694 0.000 0.092 0.852 0.056
#> GSM97020     2  0.0188     0.8092 0.004 0.996 0.000 0.000
#> GSM97026     2  0.2973     0.7825 0.000 0.856 0.000 0.144
#> GSM97012     2  0.4898     0.5309 0.000 0.584 0.000 0.416
#> GSM97015     3  0.2412     0.7924 0.008 0.084 0.908 0.000
#> GSM97016     2  0.0921     0.8119 0.000 0.972 0.000 0.028
#> GSM97017     1  0.3355     0.6200 0.836 0.160 0.000 0.004
#> GSM97019     2  0.3764     0.7421 0.000 0.784 0.000 0.216
#> GSM97022     2  0.4304     0.6882 0.000 0.716 0.000 0.284
#> GSM97035     2  0.4277     0.6891 0.000 0.720 0.000 0.280
#> GSM97036     1  0.5766     0.5004 0.704 0.104 0.000 0.192
#> GSM97039     2  0.0188     0.8107 0.000 0.996 0.000 0.004
#> GSM97046     2  0.1302     0.8103 0.000 0.956 0.000 0.044
#> GSM97023     1  0.0188     0.6904 0.996 0.000 0.004 0.000
#> GSM97029     1  0.3486     0.6002 0.812 0.188 0.000 0.000
#> GSM97043     2  0.2921     0.7838 0.000 0.860 0.000 0.140
#> GSM97013     1  0.4313     0.5365 0.736 0.260 0.000 0.004
#> GSM96956     2  0.6386     0.5962 0.000 0.640 0.124 0.236
#> GSM97024     2  0.3895     0.7777 0.000 0.832 0.036 0.132
#> GSM97032     3  0.7228     0.2318 0.000 0.340 0.504 0.156
#> GSM97044     3  0.0524     0.8118 0.000 0.008 0.988 0.004
#> GSM97049     2  0.0188     0.8092 0.004 0.996 0.000 0.000
#> GSM96968     3  0.0376     0.8119 0.004 0.004 0.992 0.000
#> GSM96971     3  0.4040     0.6801 0.000 0.000 0.752 0.248
#> GSM96986     3  0.0469     0.8099 0.012 0.000 0.988 0.000
#> GSM97003     3  0.5881     0.5206 0.240 0.000 0.676 0.084
#> GSM96957     1  0.5290     0.3133 0.584 0.404 0.012 0.000
#> GSM96960     1  0.5231     0.4667 0.676 0.000 0.028 0.296
#> GSM96975     1  0.3791     0.5979 0.796 0.000 0.004 0.200
#> GSM96998     1  0.2704     0.6606 0.876 0.000 0.000 0.124
#> GSM96999     1  0.0927     0.6878 0.976 0.016 0.008 0.000
#> GSM97001     1  0.4769     0.4784 0.684 0.308 0.008 0.000
#> GSM97005     1  0.1975     0.6762 0.936 0.016 0.048 0.000
#> GSM97006     1  0.3037     0.6810 0.888 0.000 0.036 0.076
#> GSM97021     1  0.6124     0.4495 0.640 0.276 0.084 0.000
#> GSM97028     3  0.4158     0.7204 0.000 0.008 0.768 0.224
#> GSM97031     3  0.4898     0.3016 0.416 0.000 0.584 0.000
#> GSM97037     2  0.4100     0.7659 0.000 0.824 0.048 0.128
#> GSM97018     2  0.7412     0.3600 0.000 0.444 0.168 0.388
#> GSM97014     2  0.2973     0.6831 0.144 0.856 0.000 0.000
#> GSM97042     2  0.4790     0.5806 0.000 0.620 0.000 0.380
#> GSM97040     2  0.5498     0.1794 0.404 0.576 0.020 0.000
#> GSM97041     1  0.4624     0.4465 0.660 0.340 0.000 0.000
#> GSM96955     4  0.4999    -0.4283 0.000 0.492 0.000 0.508
#> GSM96990     3  0.6148     0.5016 0.000 0.280 0.636 0.084
#> GSM96991     4  0.4961    -0.3492 0.000 0.448 0.000 0.552
#> GSM97048     2  0.0000     0.8100 0.000 1.000 0.000 0.000
#> GSM96963     4  0.4977    -0.3681 0.000 0.460 0.000 0.540
#> GSM96953     2  0.4776     0.5872 0.000 0.624 0.000 0.376
#> GSM96966     4  0.4955     0.0883 0.444 0.000 0.000 0.556
#> GSM96979     3  0.1637     0.8013 0.000 0.000 0.940 0.060
#> GSM96983     3  0.4456     0.6750 0.000 0.004 0.716 0.280
#> GSM96984     3  0.0707     0.8101 0.000 0.000 0.980 0.020
#> GSM96994     3  0.1109     0.8094 0.000 0.004 0.968 0.028
#> GSM96996     1  0.4401     0.5186 0.724 0.000 0.004 0.272
#> GSM96997     3  0.0657     0.8101 0.012 0.000 0.984 0.004
#> GSM97007     3  0.0657     0.8111 0.000 0.004 0.984 0.012
#> GSM96954     3  0.0592     0.8091 0.016 0.000 0.984 0.000
#> GSM96962     3  0.0000     0.8110 0.000 0.000 1.000 0.000
#> GSM96969     4  0.5263     0.0623 0.448 0.000 0.008 0.544
#> GSM96970     4  0.4941     0.1108 0.436 0.000 0.000 0.564
#> GSM96973     4  0.4697     0.2555 0.356 0.000 0.000 0.644
#> GSM96976     4  0.0895     0.4680 0.000 0.020 0.004 0.976
#> GSM96977     1  0.4950     0.5604 0.760 0.008 0.196 0.036
#> GSM96995     3  0.0657     0.8117 0.004 0.012 0.984 0.000
#> GSM97002     1  0.5016     0.3069 0.600 0.000 0.004 0.396
#> GSM97009     2  0.1305     0.7890 0.036 0.960 0.004 0.000
#> GSM97010     1  0.5364     0.2911 0.592 0.016 0.000 0.392
#> GSM96974     4  0.0188     0.4793 0.000 0.000 0.004 0.996
#> GSM96985     4  0.0188     0.4793 0.000 0.000 0.004 0.996
#> GSM96959     3  0.4728     0.6796 0.032 0.216 0.752 0.000
#> GSM96972     1  0.5290     0.0785 0.516 0.000 0.008 0.476
#> GSM96978     3  0.4994     0.4218 0.000 0.000 0.520 0.480
#> GSM96967     4  0.4843     0.1944 0.396 0.000 0.000 0.604
#> GSM96987     1  0.2868     0.6534 0.864 0.000 0.000 0.136
#> GSM97011     1  0.2714     0.6481 0.884 0.112 0.004 0.000
#> GSM96964     1  0.0817     0.6913 0.976 0.000 0.000 0.024
#> GSM96965     4  0.4511     0.3496 0.268 0.008 0.000 0.724
#> GSM96981     1  0.4830     0.3186 0.608 0.000 0.000 0.392
#> GSM96982     1  0.5167     0.0472 0.508 0.000 0.004 0.488
#> GSM96988     3  0.4866     0.5457 0.000 0.000 0.596 0.404
#> GSM97000     3  0.5291     0.5020 0.324 0.024 0.652 0.000
#> GSM97004     1  0.5050     0.2787 0.588 0.000 0.004 0.408
#> GSM97008     1  0.6123     0.4797 0.676 0.132 0.192 0.000
#> GSM96950     1  0.0921     0.6910 0.972 0.000 0.000 0.028
#> GSM96980     1  0.4989     0.1064 0.528 0.000 0.000 0.472
#> GSM96989     1  0.2814     0.6559 0.868 0.000 0.000 0.132
#> GSM96992     1  0.2124     0.6846 0.924 0.000 0.008 0.068
#> GSM96993     1  0.1151     0.6902 0.968 0.024 0.000 0.008
#> GSM96958     1  0.1174     0.6917 0.968 0.000 0.012 0.020
#> GSM96951     1  0.2342     0.6703 0.912 0.000 0.080 0.008
#> GSM96952     1  0.1824     0.6859 0.936 0.000 0.004 0.060
#> GSM96961     1  0.0804     0.6913 0.980 0.000 0.008 0.012

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97038     2  0.1124    0.73604 0.004 0.960 0.000 0.000 0.036
#> GSM97045     2  0.6301    0.12828 0.180 0.512 0.000 0.000 0.308
#> GSM97047     1  0.7068   -0.30896 0.400 0.388 0.024 0.000 0.188
#> GSM97025     2  0.6188   -0.13706 0.136 0.448 0.000 0.000 0.416
#> GSM97030     3  0.3511    0.71463 0.020 0.020 0.836 0.000 0.124
#> GSM97027     2  0.5948    0.27409 0.156 0.580 0.000 0.000 0.264
#> GSM97033     2  0.0693    0.74116 0.008 0.980 0.000 0.000 0.012
#> GSM97034     5  0.6537    0.42703 0.156 0.016 0.296 0.000 0.532
#> GSM97020     2  0.0898    0.74034 0.008 0.972 0.000 0.000 0.020
#> GSM97026     5  0.5624    0.57013 0.208 0.140 0.000 0.004 0.648
#> GSM97012     5  0.3340    0.65234 0.004 0.156 0.000 0.016 0.824
#> GSM97015     3  0.5890    0.53911 0.120 0.032 0.664 0.000 0.184
#> GSM97016     2  0.0609    0.73991 0.000 0.980 0.000 0.000 0.020
#> GSM97017     1  0.3033    0.64392 0.880 0.032 0.000 0.064 0.024
#> GSM97019     5  0.4814    0.63358 0.080 0.192 0.000 0.004 0.724
#> GSM97022     5  0.4595    0.61163 0.044 0.236 0.000 0.004 0.716
#> GSM97035     5  0.4235    0.49497 0.008 0.336 0.000 0.000 0.656
#> GSM97036     1  0.6763    0.16399 0.432 0.008 0.000 0.196 0.364
#> GSM97039     2  0.0609    0.74006 0.000 0.980 0.000 0.000 0.020
#> GSM97046     2  0.0609    0.73934 0.000 0.980 0.000 0.000 0.020
#> GSM97023     1  0.3496    0.63529 0.788 0.000 0.000 0.200 0.012
#> GSM97029     1  0.3086    0.60691 0.876 0.036 0.000 0.020 0.068
#> GSM97043     5  0.5270    0.62640 0.112 0.172 0.012 0.000 0.704
#> GSM97013     1  0.6449    0.54449 0.580 0.196 0.000 0.204 0.020
#> GSM96956     2  0.2067    0.70789 0.000 0.920 0.048 0.000 0.032
#> GSM97024     5  0.6717    0.56754 0.108 0.232 0.072 0.000 0.588
#> GSM97032     5  0.6072    0.49158 0.080 0.032 0.288 0.000 0.600
#> GSM97044     3  0.3283    0.71003 0.028 0.000 0.832 0.000 0.140
#> GSM97049     2  0.0000    0.73936 0.000 1.000 0.000 0.000 0.000
#> GSM96968     3  0.1805    0.77955 0.020 0.008 0.944 0.016 0.012
#> GSM96971     3  0.4991    0.53034 0.004 0.000 0.636 0.320 0.040
#> GSM96986     3  0.2362    0.76206 0.040 0.000 0.912 0.040 0.008
#> GSM97003     3  0.5352    0.58245 0.096 0.000 0.676 0.220 0.008
#> GSM96957     2  0.5419    0.00266 0.432 0.528 0.012 0.012 0.016
#> GSM96960     4  0.4935    0.55904 0.188 0.000 0.068 0.728 0.016
#> GSM96975     4  0.5532    0.19656 0.392 0.008 0.008 0.556 0.036
#> GSM96998     4  0.4449   -0.17600 0.484 0.000 0.000 0.512 0.004
#> GSM96999     1  0.4975    0.55438 0.648 0.008 0.020 0.316 0.008
#> GSM97001     1  0.6194    0.49065 0.604 0.288 0.020 0.072 0.016
#> GSM97005     1  0.4661    0.63295 0.776 0.012 0.064 0.136 0.012
#> GSM97006     4  0.5178   -0.22771 0.476 0.000 0.040 0.484 0.000
#> GSM97021     1  0.1964    0.62422 0.936 0.012 0.024 0.004 0.024
#> GSM97028     5  0.3690    0.56616 0.012 0.000 0.224 0.000 0.764
#> GSM97031     3  0.5294    0.40153 0.352 0.000 0.596 0.044 0.008
#> GSM97037     2  0.4159    0.58143 0.000 0.776 0.068 0.000 0.156
#> GSM97018     5  0.3817    0.66668 0.020 0.032 0.128 0.000 0.820
#> GSM97014     2  0.1732    0.70939 0.080 0.920 0.000 0.000 0.000
#> GSM97042     5  0.3365    0.64960 0.004 0.180 0.000 0.008 0.808
#> GSM97040     1  0.4286    0.54659 0.800 0.096 0.020 0.000 0.084
#> GSM97041     1  0.2521    0.61924 0.900 0.068 0.000 0.008 0.024
#> GSM96955     5  0.5932    0.16901 0.016 0.368 0.000 0.072 0.544
#> GSM96990     3  0.5725    0.28316 0.016 0.048 0.572 0.004 0.360
#> GSM96991     5  0.2954    0.64057 0.000 0.056 0.004 0.064 0.876
#> GSM97048     2  0.0000    0.73936 0.000 1.000 0.000 0.000 0.000
#> GSM96963     5  0.4075    0.59959 0.000 0.100 0.004 0.096 0.800
#> GSM96953     2  0.4684    0.04814 0.004 0.536 0.000 0.008 0.452
#> GSM96966     4  0.1300    0.69441 0.016 0.000 0.000 0.956 0.028
#> GSM96979     3  0.2997    0.72523 0.000 0.000 0.840 0.148 0.012
#> GSM96983     3  0.4677    0.52172 0.000 0.000 0.664 0.036 0.300
#> GSM96984     3  0.0955    0.77688 0.000 0.000 0.968 0.028 0.004
#> GSM96994     3  0.1124    0.77090 0.000 0.000 0.960 0.004 0.036
#> GSM96996     4  0.4425    0.19057 0.392 0.000 0.000 0.600 0.008
#> GSM96997     3  0.1483    0.77480 0.012 0.000 0.952 0.028 0.008
#> GSM97007     3  0.0771    0.77441 0.004 0.000 0.976 0.000 0.020
#> GSM96954     3  0.0703    0.77834 0.024 0.000 0.976 0.000 0.000
#> GSM96962     3  0.0727    0.77613 0.004 0.000 0.980 0.004 0.012
#> GSM96969     4  0.1399    0.69389 0.020 0.000 0.000 0.952 0.028
#> GSM96970     4  0.1082    0.69260 0.008 0.000 0.000 0.964 0.028
#> GSM96973     4  0.0955    0.68758 0.000 0.000 0.004 0.968 0.028
#> GSM96976     4  0.5181    0.38239 0.000 0.032 0.028 0.668 0.272
#> GSM96977     1  0.6229    0.52456 0.612 0.004 0.092 0.260 0.032
#> GSM96995     3  0.2078    0.77501 0.036 0.004 0.924 0.000 0.036
#> GSM97002     4  0.3675    0.56635 0.216 0.000 0.004 0.772 0.008
#> GSM97009     2  0.2304    0.70232 0.100 0.892 0.000 0.000 0.008
#> GSM97010     4  0.5918    0.29075 0.044 0.376 0.016 0.552 0.012
#> GSM96974     4  0.4473    0.34958 0.000 0.000 0.020 0.656 0.324
#> GSM96985     5  0.4702   -0.11028 0.004 0.000 0.008 0.476 0.512
#> GSM96959     2  0.6182    0.03008 0.096 0.484 0.408 0.000 0.012
#> GSM96972     4  0.1356    0.68969 0.028 0.000 0.012 0.956 0.004
#> GSM96978     3  0.5612    0.51122 0.000 0.000 0.624 0.128 0.248
#> GSM96967     4  0.1012    0.69405 0.012 0.000 0.000 0.968 0.020
#> GSM96987     1  0.4833    0.38072 0.564 0.000 0.000 0.412 0.024
#> GSM97011     1  0.5309    0.60231 0.736 0.132 0.012 0.100 0.020
#> GSM96964     1  0.4181    0.59779 0.712 0.000 0.000 0.268 0.020
#> GSM96965     4  0.2770    0.65118 0.000 0.044 0.000 0.880 0.076
#> GSM96981     4  0.4820    0.55847 0.232 0.008 0.000 0.708 0.052
#> GSM96982     4  0.4149    0.64347 0.128 0.000 0.000 0.784 0.088
#> GSM96988     5  0.4106    0.50463 0.000 0.000 0.256 0.020 0.724
#> GSM97000     3  0.5557    0.31419 0.408 0.020 0.544 0.016 0.012
#> GSM97004     4  0.3388    0.59209 0.200 0.000 0.000 0.792 0.008
#> GSM97008     1  0.4893    0.54529 0.756 0.032 0.168 0.028 0.016
#> GSM96950     1  0.4491    0.54737 0.652 0.000 0.000 0.328 0.020
#> GSM96980     4  0.2046    0.68014 0.068 0.000 0.000 0.916 0.016
#> GSM96989     1  0.4746    0.45855 0.600 0.000 0.000 0.376 0.024
#> GSM96992     1  0.4517    0.43125 0.616 0.000 0.004 0.372 0.008
#> GSM96993     1  0.3948    0.63658 0.808 0.008 0.000 0.128 0.056
#> GSM96958     1  0.5308    0.52647 0.624 0.004 0.036 0.324 0.012
#> GSM96951     1  0.5196    0.60462 0.712 0.000 0.092 0.180 0.016
#> GSM96952     1  0.4464    0.46951 0.632 0.000 0.004 0.356 0.008
#> GSM96961     1  0.3883    0.60579 0.744 0.000 0.004 0.244 0.008

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     3  0.1408     0.7840 0.000 0.020 0.944 0.000 0.036 0.000
#> GSM97045     5  0.6085    -0.2418 0.004 0.388 0.168 0.008 0.432 0.000
#> GSM97047     5  0.5296     0.3195 0.024 0.180 0.104 0.000 0.680 0.012
#> GSM97025     2  0.5645     0.3836 0.000 0.508 0.172 0.000 0.320 0.000
#> GSM97030     6  0.2463     0.7464 0.004 0.080 0.004 0.000 0.024 0.888
#> GSM97027     5  0.6132    -0.2204 0.004 0.356 0.240 0.000 0.400 0.000
#> GSM97033     3  0.2412     0.7473 0.000 0.028 0.880 0.000 0.092 0.000
#> GSM97034     2  0.5837     0.4632 0.004 0.524 0.004 0.000 0.296 0.172
#> GSM97020     3  0.2201     0.7573 0.000 0.048 0.900 0.000 0.052 0.000
#> GSM97026     2  0.5439     0.5259 0.116 0.648 0.020 0.000 0.208 0.008
#> GSM97012     2  0.2303     0.6451 0.000 0.904 0.020 0.052 0.024 0.000
#> GSM97015     6  0.5614     0.4637 0.032 0.232 0.004 0.000 0.108 0.624
#> GSM97016     3  0.0363     0.7919 0.000 0.012 0.988 0.000 0.000 0.000
#> GSM97017     5  0.4413     0.1108 0.484 0.012 0.000 0.008 0.496 0.000
#> GSM97019     2  0.4130     0.6085 0.000 0.740 0.028 0.016 0.212 0.004
#> GSM97022     2  0.4495     0.6079 0.000 0.724 0.056 0.016 0.200 0.004
#> GSM97035     2  0.4225     0.6252 0.000 0.764 0.116 0.016 0.104 0.000
#> GSM97036     1  0.6384     0.0959 0.492 0.308 0.000 0.048 0.152 0.000
#> GSM97039     3  0.0622     0.7914 0.000 0.012 0.980 0.000 0.008 0.000
#> GSM97046     3  0.0363     0.7908 0.000 0.012 0.988 0.000 0.000 0.000
#> GSM97023     1  0.4261     0.5386 0.732 0.000 0.000 0.112 0.156 0.000
#> GSM97029     5  0.5214     0.4452 0.224 0.148 0.000 0.004 0.624 0.000
#> GSM97043     2  0.4430     0.6133 0.024 0.748 0.028 0.000 0.180 0.020
#> GSM97013     1  0.5434     0.4848 0.664 0.000 0.112 0.172 0.052 0.000
#> GSM96956     3  0.0820     0.7870 0.000 0.012 0.972 0.000 0.000 0.016
#> GSM97024     2  0.5848     0.4137 0.000 0.512 0.044 0.008 0.380 0.056
#> GSM97032     2  0.5317     0.4921 0.004 0.608 0.004 0.000 0.120 0.264
#> GSM97044     6  0.2954     0.7216 0.000 0.108 0.000 0.000 0.048 0.844
#> GSM97049     3  0.0146     0.7911 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM96968     6  0.3397     0.7381 0.020 0.024 0.092 0.000 0.020 0.844
#> GSM96971     4  0.4707     0.2368 0.004 0.000 0.000 0.580 0.044 0.372
#> GSM96986     6  0.1977     0.7606 0.008 0.000 0.000 0.040 0.032 0.920
#> GSM97003     6  0.6260     0.3037 0.072 0.000 0.000 0.284 0.108 0.536
#> GSM96957     3  0.4494     0.5146 0.224 0.000 0.696 0.000 0.076 0.004
#> GSM96960     1  0.6081     0.3150 0.532 0.000 0.004 0.308 0.124 0.032
#> GSM96975     1  0.6216     0.1736 0.400 0.000 0.004 0.224 0.368 0.004
#> GSM96998     1  0.4012     0.4358 0.640 0.000 0.000 0.344 0.016 0.000
#> GSM96999     1  0.5103     0.4507 0.664 0.000 0.016 0.120 0.200 0.000
#> GSM97001     5  0.5920     0.2300 0.380 0.000 0.148 0.012 0.460 0.000
#> GSM97005     5  0.5094     0.3483 0.336 0.000 0.004 0.044 0.596 0.020
#> GSM97006     1  0.5157     0.3481 0.548 0.000 0.000 0.384 0.044 0.024
#> GSM97021     5  0.3652     0.5103 0.196 0.032 0.000 0.000 0.768 0.004
#> GSM97028     2  0.4868     0.4939 0.012 0.704 0.000 0.012 0.080 0.192
#> GSM97031     5  0.6249     0.0633 0.112 0.000 0.000 0.048 0.420 0.420
#> GSM97037     3  0.3593     0.6764 0.004 0.064 0.800 0.000 0.000 0.132
#> GSM97018     2  0.3511     0.6339 0.000 0.808 0.004 0.000 0.064 0.124
#> GSM97014     3  0.4428     0.4760 0.012 0.008 0.644 0.012 0.324 0.000
#> GSM97042     2  0.2812     0.6497 0.000 0.876 0.016 0.032 0.072 0.004
#> GSM97040     5  0.4146     0.5284 0.152 0.052 0.028 0.000 0.768 0.000
#> GSM97041     5  0.4704     0.3993 0.344 0.028 0.012 0.004 0.612 0.000
#> GSM96955     2  0.7638     0.1246 0.060 0.416 0.056 0.272 0.196 0.000
#> GSM96990     6  0.4786     0.4615 0.024 0.312 0.020 0.000 0.008 0.636
#> GSM96991     2  0.2812     0.6158 0.000 0.860 0.008 0.104 0.028 0.000
#> GSM97048     3  0.0146     0.7911 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM96963     2  0.3965     0.5631 0.000 0.764 0.004 0.160 0.072 0.000
#> GSM96953     2  0.5858     0.3692 0.000 0.540 0.332 0.072 0.056 0.000
#> GSM96966     4  0.2573     0.6882 0.104 0.012 0.000 0.872 0.012 0.000
#> GSM96979     6  0.3230     0.6373 0.000 0.000 0.000 0.212 0.012 0.776
#> GSM96983     6  0.5864     0.2921 0.000 0.352 0.000 0.028 0.108 0.512
#> GSM96984     6  0.1010     0.7749 0.000 0.000 0.000 0.036 0.004 0.960
#> GSM96994     6  0.1223     0.7783 0.004 0.008 0.000 0.016 0.012 0.960
#> GSM96996     1  0.4463     0.4206 0.616 0.004 0.000 0.352 0.024 0.004
#> GSM96997     6  0.1970     0.7647 0.008 0.000 0.000 0.044 0.028 0.920
#> GSM97007     6  0.0798     0.7768 0.004 0.004 0.000 0.012 0.004 0.976
#> GSM96954     6  0.1471     0.7662 0.000 0.004 0.000 0.000 0.064 0.932
#> GSM96962     6  0.0363     0.7759 0.000 0.000 0.000 0.012 0.000 0.988
#> GSM96969     4  0.1594     0.7093 0.052 0.000 0.000 0.932 0.016 0.000
#> GSM96970     4  0.1801     0.7090 0.056 0.004 0.000 0.924 0.016 0.000
#> GSM96973     4  0.1409     0.7097 0.032 0.000 0.000 0.948 0.008 0.012
#> GSM96976     4  0.3142     0.6502 0.000 0.092 0.000 0.848 0.016 0.044
#> GSM96977     1  0.6555     0.0696 0.472 0.028 0.004 0.060 0.380 0.056
#> GSM96995     6  0.4842     0.6438 0.116 0.032 0.004 0.000 0.120 0.728
#> GSM97002     1  0.4553     0.2822 0.548 0.004 0.000 0.424 0.020 0.004
#> GSM97009     3  0.5515     0.2867 0.028 0.012 0.528 0.020 0.400 0.012
#> GSM97010     3  0.4678     0.3697 0.028 0.000 0.620 0.336 0.004 0.012
#> GSM96974     4  0.3905     0.6035 0.004 0.164 0.000 0.776 0.008 0.048
#> GSM96985     2  0.5898     0.2211 0.020 0.552 0.000 0.304 0.116 0.008
#> GSM96959     3  0.6873     0.0583 0.080 0.000 0.420 0.004 0.356 0.140
#> GSM96972     4  0.3829     0.5405 0.200 0.000 0.000 0.760 0.016 0.024
#> GSM96978     6  0.7007     0.2596 0.004 0.300 0.000 0.120 0.124 0.452
#> GSM96967     4  0.2213     0.6839 0.100 0.008 0.000 0.888 0.004 0.000
#> GSM96987     1  0.3002     0.5850 0.836 0.008 0.000 0.136 0.020 0.000
#> GSM97011     5  0.5264     0.3439 0.308 0.004 0.032 0.048 0.608 0.000
#> GSM96964     1  0.2750     0.5701 0.868 0.004 0.000 0.080 0.048 0.000
#> GSM96965     4  0.1887     0.7078 0.028 0.012 0.012 0.932 0.016 0.000
#> GSM96981     4  0.6572    -0.0404 0.316 0.016 0.004 0.380 0.284 0.000
#> GSM96982     4  0.6704     0.2167 0.272 0.064 0.000 0.472 0.192 0.000
#> GSM96988     2  0.5060     0.3334 0.004 0.628 0.000 0.020 0.052 0.296
#> GSM97000     5  0.5126     0.3774 0.096 0.000 0.000 0.008 0.616 0.280
#> GSM97004     1  0.4361     0.2512 0.544 0.004 0.000 0.436 0.016 0.000
#> GSM97008     5  0.5398     0.3716 0.316 0.000 0.020 0.008 0.592 0.064
#> GSM96950     1  0.3519     0.5827 0.804 0.008 0.000 0.144 0.044 0.000
#> GSM96980     4  0.4595     0.4364 0.264 0.020 0.000 0.676 0.040 0.000
#> GSM96989     1  0.2877     0.5890 0.848 0.008 0.000 0.124 0.020 0.000
#> GSM96992     1  0.4774     0.4885 0.672 0.000 0.000 0.136 0.192 0.000
#> GSM96993     1  0.5108     0.3078 0.688 0.152 0.000 0.020 0.136 0.004
#> GSM96958     1  0.4373     0.4479 0.720 0.000 0.004 0.084 0.192 0.000
#> GSM96951     1  0.5325     0.1666 0.568 0.000 0.004 0.052 0.352 0.024
#> GSM96952     1  0.4934     0.4566 0.660 0.000 0.004 0.124 0.212 0.000
#> GSM96961     1  0.2923     0.5344 0.848 0.000 0.000 0.052 0.100 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-NMF-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-NMF-collect-classes

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

test_to_known_factors(res)
#>          n disease.state(p) specimen(p) cell.type(p) other(p) k
#> CV:NMF 100         2.42e-05       0.251     1.12e-13   0.1801 2
#> CV:NMF  90         8.38e-06       0.106     9.92e-20   0.0238 3
#> CV:NMF  70         3.14e-04       0.469     2.72e-14   0.1386 4
#> CV:NMF  72         1.45e-02       0.612     1.16e-13   0.1118 5
#> CV:NMF  50         3.71e-04       0.251     9.45e-12   0.0525 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 21168 rows and 100 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 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-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.399           0.685       0.857         0.4291 0.602   0.602
#> 3 3 0.488           0.809       0.885         0.4433 0.743   0.588
#> 4 4 0.565           0.741       0.830         0.1299 0.920   0.793
#> 5 5 0.625           0.687       0.767         0.0862 0.909   0.704
#> 6 6 0.687           0.721       0.806         0.0549 0.962   0.827

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
#> GSM97038     2  0.6801     0.6883 0.180 0.820
#> GSM97045     2  0.0672     0.8442 0.008 0.992
#> GSM97047     1  0.8608     0.6251 0.716 0.284
#> GSM97025     2  0.0672     0.8442 0.008 0.992
#> GSM97030     2  0.9970    -0.0386 0.468 0.532
#> GSM97027     2  0.0672     0.8442 0.008 0.992
#> GSM97033     2  0.0000     0.8472 0.000 1.000
#> GSM97034     1  0.6973     0.7451 0.812 0.188
#> GSM97020     2  0.0376     0.8451 0.004 0.996
#> GSM97026     1  0.7219     0.7273 0.800 0.200
#> GSM97012     2  0.0000     0.8472 0.000 1.000
#> GSM97015     1  1.0000     0.1322 0.500 0.500
#> GSM97016     2  0.0000     0.8472 0.000 1.000
#> GSM97017     1  0.6531     0.7506 0.832 0.168
#> GSM97019     2  0.0000     0.8472 0.000 1.000
#> GSM97022     2  0.0000     0.8472 0.000 1.000
#> GSM97035     2  0.0000     0.8472 0.000 1.000
#> GSM97036     1  0.2423     0.8111 0.960 0.040
#> GSM97039     2  0.0000     0.8472 0.000 1.000
#> GSM97046     2  0.0000     0.8472 0.000 1.000
#> GSM97023     1  0.0000     0.8107 1.000 0.000
#> GSM97029     1  0.6973     0.7451 0.812 0.188
#> GSM97043     2  0.9881     0.1069 0.436 0.564
#> GSM97013     1  0.0938     0.8113 0.988 0.012
#> GSM96956     2  0.9710     0.1949 0.400 0.600
#> GSM97024     2  0.4161     0.7901 0.084 0.916
#> GSM97032     2  0.9963    -0.0141 0.464 0.536
#> GSM97044     1  0.9998     0.1549 0.508 0.492
#> GSM97049     2  0.0000     0.8472 0.000 1.000
#> GSM96968     1  0.9635     0.4819 0.612 0.388
#> GSM96971     1  0.9248     0.5179 0.660 0.340
#> GSM96986     1  0.9427     0.4887 0.640 0.360
#> GSM97003     1  0.0000     0.8107 1.000 0.000
#> GSM96957     1  0.4022     0.7993 0.920 0.080
#> GSM96960     1  0.0000     0.8107 1.000 0.000
#> GSM96975     1  0.2423     0.8122 0.960 0.040
#> GSM96998     1  0.0376     0.8113 0.996 0.004
#> GSM96999     1  0.4022     0.7993 0.920 0.080
#> GSM97001     1  0.4022     0.7993 0.920 0.080
#> GSM97005     1  0.1633     0.8128 0.976 0.024
#> GSM97006     1  0.0000     0.8107 1.000 0.000
#> GSM97021     1  0.6531     0.7504 0.832 0.168
#> GSM97028     1  0.8499     0.6245 0.724 0.276
#> GSM97031     1  0.5629     0.7575 0.868 0.132
#> GSM97037     2  0.9881     0.0717 0.436 0.564
#> GSM97018     1  0.9580     0.4816 0.620 0.380
#> GSM97014     1  0.8016     0.6799 0.756 0.244
#> GSM97042     2  0.0000     0.8472 0.000 1.000
#> GSM97040     1  0.7815     0.6910 0.768 0.232
#> GSM97041     1  0.6438     0.7534 0.836 0.164
#> GSM96955     2  0.7674     0.6240 0.224 0.776
#> GSM96990     1  0.9954     0.2779 0.540 0.460
#> GSM96991     2  0.0000     0.8472 0.000 1.000
#> GSM97048     2  0.0000     0.8472 0.000 1.000
#> GSM96963     2  0.0000     0.8472 0.000 1.000
#> GSM96953     2  0.0000     0.8472 0.000 1.000
#> GSM96966     1  0.0376     0.8109 0.996 0.004
#> GSM96979     1  0.9393     0.4963 0.644 0.356
#> GSM96983     1  0.9686     0.4100 0.604 0.396
#> GSM96984     1  0.9661     0.4190 0.608 0.392
#> GSM96994     1  0.9460     0.4806 0.636 0.364
#> GSM96996     1  0.0376     0.8109 0.996 0.004
#> GSM96997     1  0.9635     0.4283 0.612 0.388
#> GSM97007     1  0.9661     0.4190 0.608 0.392
#> GSM96954     1  0.9248     0.5179 0.660 0.340
#> GSM96962     1  0.9393     0.4963 0.644 0.356
#> GSM96969     1  0.0000     0.8107 1.000 0.000
#> GSM96970     1  0.0000     0.8107 1.000 0.000
#> GSM96973     1  0.1843     0.8104 0.972 0.028
#> GSM96976     1  0.4161     0.8019 0.916 0.084
#> GSM96977     1  0.3733     0.8053 0.928 0.072
#> GSM96995     1  0.9635     0.4819 0.612 0.388
#> GSM97002     1  0.0000     0.8107 1.000 0.000
#> GSM97009     1  0.8267     0.6607 0.740 0.260
#> GSM97010     1  0.3274     0.8064 0.940 0.060
#> GSM96974     1  0.3431     0.8056 0.936 0.064
#> GSM96985     1  0.9686     0.4100 0.604 0.396
#> GSM96959     2  0.9044     0.4409 0.320 0.680
#> GSM96972     1  0.0000     0.8107 1.000 0.000
#> GSM96978     1  0.9686     0.4100 0.604 0.396
#> GSM96967     1  0.0000     0.8107 1.000 0.000
#> GSM96987     1  0.0376     0.8113 0.996 0.004
#> GSM97011     1  0.8081     0.6738 0.752 0.248
#> GSM96964     1  0.0376     0.8115 0.996 0.004
#> GSM96965     1  0.4431     0.8006 0.908 0.092
#> GSM96981     1  0.0672     0.8121 0.992 0.008
#> GSM96982     1  0.0672     0.8121 0.992 0.008
#> GSM96988     1  0.8555     0.6190 0.720 0.280
#> GSM97000     1  0.6623     0.7427 0.828 0.172
#> GSM97004     1  0.0000     0.8107 1.000 0.000
#> GSM97008     1  0.3879     0.8037 0.924 0.076
#> GSM96950     1  0.2423     0.8101 0.960 0.040
#> GSM96980     1  0.0000     0.8107 1.000 0.000
#> GSM96989     1  0.0376     0.8113 0.996 0.004
#> GSM96992     1  0.0000     0.8107 1.000 0.000
#> GSM96993     1  0.2236     0.8115 0.964 0.036
#> GSM96958     1  0.2603     0.8121 0.956 0.044
#> GSM96951     1  0.0000     0.8107 1.000 0.000
#> GSM96952     1  0.0000     0.8107 1.000 0.000
#> GSM96961     1  0.0000     0.8107 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
#> GSM97038     2  0.5966      0.726 0.104 0.792 0.104
#> GSM97045     2  0.0661      0.935 0.008 0.988 0.004
#> GSM97047     1  0.7880      0.630 0.636 0.268 0.096
#> GSM97025     2  0.0661      0.935 0.008 0.988 0.004
#> GSM97030     3  0.3879      0.785 0.000 0.152 0.848
#> GSM97027     2  0.0661      0.935 0.008 0.988 0.004
#> GSM97033     2  0.0000      0.942 0.000 1.000 0.000
#> GSM97034     1  0.6543      0.756 0.748 0.176 0.076
#> GSM97020     2  0.0475      0.938 0.004 0.992 0.004
#> GSM97026     1  0.5901      0.773 0.768 0.192 0.040
#> GSM97012     2  0.0000      0.942 0.000 1.000 0.000
#> GSM97015     3  0.3682      0.806 0.008 0.116 0.876
#> GSM97016     2  0.0000      0.942 0.000 1.000 0.000
#> GSM97017     1  0.5239      0.800 0.808 0.160 0.032
#> GSM97019     2  0.0000      0.942 0.000 1.000 0.000
#> GSM97022     2  0.0000      0.942 0.000 1.000 0.000
#> GSM97035     2  0.0000      0.942 0.000 1.000 0.000
#> GSM97036     1  0.1411      0.865 0.964 0.036 0.000
#> GSM97039     2  0.0000      0.942 0.000 1.000 0.000
#> GSM97046     2  0.0000      0.942 0.000 1.000 0.000
#> GSM97023     1  0.0237      0.865 0.996 0.000 0.004
#> GSM97029     1  0.6372      0.762 0.756 0.176 0.068
#> GSM97043     3  0.8198      0.544 0.100 0.304 0.596
#> GSM97013     1  0.0424      0.867 0.992 0.008 0.000
#> GSM96956     3  0.5216      0.678 0.000 0.260 0.740
#> GSM97024     2  0.4062      0.769 0.000 0.836 0.164
#> GSM97032     3  0.5559      0.751 0.028 0.192 0.780
#> GSM97044     3  0.3038      0.809 0.000 0.104 0.896
#> GSM97049     2  0.0000      0.942 0.000 1.000 0.000
#> GSM96968     3  0.8350      0.570 0.280 0.120 0.600
#> GSM96971     3  0.3267      0.804 0.116 0.000 0.884
#> GSM96986     3  0.1860      0.836 0.052 0.000 0.948
#> GSM97003     1  0.0237      0.865 0.996 0.000 0.004
#> GSM96957     1  0.3856      0.849 0.888 0.072 0.040
#> GSM96960     1  0.0237      0.865 0.996 0.000 0.004
#> GSM96975     1  0.2443      0.865 0.940 0.028 0.032
#> GSM96998     1  0.0000      0.865 1.000 0.000 0.000
#> GSM96999     1  0.3856      0.849 0.888 0.072 0.040
#> GSM97001     1  0.3856      0.849 0.888 0.072 0.040
#> GSM97005     1  0.1491      0.868 0.968 0.016 0.016
#> GSM97006     1  0.0237      0.865 0.996 0.000 0.004
#> GSM97021     1  0.5466      0.797 0.800 0.160 0.040
#> GSM97028     3  0.6506      0.680 0.236 0.044 0.720
#> GSM97031     1  0.5733      0.478 0.676 0.000 0.324
#> GSM97037     3  0.4883      0.739 0.004 0.208 0.788
#> GSM97018     3  0.7906      0.676 0.220 0.124 0.656
#> GSM97014     1  0.7187      0.701 0.692 0.232 0.076
#> GSM97042     2  0.0000      0.942 0.000 1.000 0.000
#> GSM97040     1  0.7222      0.704 0.696 0.220 0.084
#> GSM97041     1  0.5060      0.805 0.816 0.156 0.028
#> GSM96955     2  0.6561      0.670 0.144 0.756 0.100
#> GSM96990     3  0.4399      0.819 0.044 0.092 0.864
#> GSM96991     2  0.0000      0.942 0.000 1.000 0.000
#> GSM97048     2  0.0000      0.942 0.000 1.000 0.000
#> GSM96963     2  0.0000      0.942 0.000 1.000 0.000
#> GSM96953     2  0.0000      0.942 0.000 1.000 0.000
#> GSM96966     1  0.4178      0.777 0.828 0.000 0.172
#> GSM96979     3  0.1964      0.835 0.056 0.000 0.944
#> GSM96983     3  0.0237      0.830 0.000 0.004 0.996
#> GSM96984     3  0.0000      0.829 0.000 0.000 1.000
#> GSM96994     3  0.1753      0.836 0.048 0.000 0.952
#> GSM96996     1  0.0829      0.867 0.984 0.004 0.012
#> GSM96997     3  0.0237      0.830 0.004 0.000 0.996
#> GSM97007     3  0.0000      0.829 0.000 0.000 1.000
#> GSM96954     3  0.3267      0.804 0.116 0.000 0.884
#> GSM96962     3  0.1964      0.835 0.056 0.000 0.944
#> GSM96969     1  0.3482      0.805 0.872 0.000 0.128
#> GSM96970     1  0.3551      0.803 0.868 0.000 0.132
#> GSM96973     1  0.5024      0.731 0.776 0.004 0.220
#> GSM96976     1  0.7141      0.480 0.600 0.032 0.368
#> GSM96977     1  0.3993      0.849 0.884 0.052 0.064
#> GSM96995     3  0.8350      0.570 0.280 0.120 0.600
#> GSM97002     1  0.0237      0.865 0.996 0.000 0.004
#> GSM97009     1  0.7303      0.685 0.680 0.244 0.076
#> GSM97010     1  0.3993      0.850 0.884 0.052 0.064
#> GSM96974     1  0.6617      0.463 0.600 0.012 0.388
#> GSM96985     3  0.0237      0.830 0.000 0.004 0.996
#> GSM96959     2  0.7835      0.497 0.232 0.656 0.112
#> GSM96972     1  0.3340      0.810 0.880 0.000 0.120
#> GSM96978     3  0.0237      0.830 0.000 0.004 0.996
#> GSM96967     1  0.3482      0.805 0.872 0.000 0.128
#> GSM96987     1  0.0000      0.865 1.000 0.000 0.000
#> GSM97011     1  0.7226      0.694 0.688 0.236 0.076
#> GSM96964     1  0.0424      0.866 0.992 0.000 0.008
#> GSM96965     1  0.7170      0.500 0.612 0.036 0.352
#> GSM96981     1  0.0661      0.867 0.988 0.008 0.004
#> GSM96982     1  0.0661      0.867 0.988 0.008 0.004
#> GSM96988     3  0.6423      0.691 0.228 0.044 0.728
#> GSM97000     1  0.6488      0.763 0.756 0.160 0.084
#> GSM97004     1  0.0237      0.865 0.996 0.000 0.004
#> GSM97008     1  0.4194      0.844 0.876 0.064 0.060
#> GSM96950     1  0.2689      0.863 0.932 0.032 0.036
#> GSM96980     1  0.1031      0.861 0.976 0.000 0.024
#> GSM96989     1  0.0000      0.865 1.000 0.000 0.000
#> GSM96992     1  0.0237      0.865 0.996 0.000 0.004
#> GSM96993     1  0.1711      0.866 0.960 0.032 0.008
#> GSM96958     1  0.2564      0.865 0.936 0.028 0.036
#> GSM96951     1  0.0237      0.865 0.996 0.000 0.004
#> GSM96952     1  0.0237      0.865 0.996 0.000 0.004
#> GSM96961     1  0.0237      0.865 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
#> GSM97038     2  0.5649      0.726 0.084 0.772 0.056 0.088
#> GSM97045     2  0.0779      0.930 0.004 0.980 0.000 0.016
#> GSM97047     1  0.7703      0.502 0.564 0.232 0.028 0.176
#> GSM97025     2  0.0779      0.930 0.004 0.980 0.000 0.016
#> GSM97030     3  0.4050      0.761 0.000 0.144 0.820 0.036
#> GSM97027     2  0.0779      0.930 0.004 0.980 0.000 0.016
#> GSM97033     2  0.0336      0.936 0.000 0.992 0.000 0.008
#> GSM97034     1  0.6616      0.626 0.680 0.144 0.024 0.152
#> GSM97020     2  0.0657      0.933 0.004 0.984 0.000 0.012
#> GSM97026     1  0.6128      0.650 0.692 0.152 0.004 0.152
#> GSM97012     2  0.0000      0.939 0.000 1.000 0.000 0.000
#> GSM97015     3  0.3974      0.773 0.008 0.108 0.844 0.040
#> GSM97016     2  0.0000      0.939 0.000 1.000 0.000 0.000
#> GSM97017     1  0.5528      0.683 0.732 0.124 0.000 0.144
#> GSM97019     2  0.0000      0.939 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000      0.939 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000      0.939 0.000 1.000 0.000 0.000
#> GSM97036     1  0.1510      0.774 0.956 0.028 0.000 0.016
#> GSM97039     2  0.0000      0.939 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000      0.939 0.000 1.000 0.000 0.000
#> GSM97023     1  0.1389      0.762 0.952 0.000 0.000 0.048
#> GSM97029     1  0.6473      0.633 0.688 0.144 0.020 0.148
#> GSM97043     3  0.7578      0.536 0.096 0.288 0.568 0.048
#> GSM97013     1  0.0779      0.770 0.980 0.004 0.000 0.016
#> GSM96956     3  0.5198      0.674 0.000 0.252 0.708 0.040
#> GSM97024     2  0.3647      0.768 0.000 0.832 0.152 0.016
#> GSM97032     3  0.5378      0.729 0.028 0.184 0.752 0.036
#> GSM97044     3  0.3463      0.776 0.000 0.096 0.864 0.040
#> GSM97049     2  0.0000      0.939 0.000 1.000 0.000 0.000
#> GSM96968     3  0.8181      0.488 0.248 0.096 0.552 0.104
#> GSM96971     3  0.4332      0.711 0.032 0.000 0.792 0.176
#> GSM96986     3  0.2399      0.784 0.032 0.000 0.920 0.048
#> GSM97003     1  0.2149      0.739 0.912 0.000 0.000 0.088
#> GSM96957     1  0.3764      0.749 0.844 0.040 0.000 0.116
#> GSM96960     1  0.2345      0.731 0.900 0.000 0.000 0.100
#> GSM96975     1  0.3853      0.760 0.848 0.020 0.016 0.116
#> GSM96998     1  0.1792      0.751 0.932 0.000 0.000 0.068
#> GSM96999     1  0.3764      0.749 0.844 0.040 0.000 0.116
#> GSM97001     1  0.3764      0.749 0.844 0.040 0.000 0.116
#> GSM97005     1  0.3102      0.770 0.872 0.004 0.008 0.116
#> GSM97006     1  0.2345      0.731 0.900 0.000 0.000 0.100
#> GSM97021     1  0.5747      0.679 0.724 0.120 0.004 0.152
#> GSM97028     3  0.5482      0.598 0.232 0.040 0.716 0.012
#> GSM97031     1  0.6654      0.215 0.588 0.000 0.296 0.116
#> GSM97037     3  0.4935      0.723 0.004 0.200 0.756 0.040
#> GSM97018     3  0.7443      0.580 0.212 0.112 0.620 0.056
#> GSM97014     1  0.6929      0.572 0.620 0.192 0.008 0.180
#> GSM97042     2  0.0000      0.939 0.000 1.000 0.000 0.000
#> GSM97040     1  0.7089      0.573 0.620 0.180 0.016 0.184
#> GSM97041     1  0.5428      0.687 0.740 0.120 0.000 0.140
#> GSM96955     2  0.6232      0.660 0.096 0.720 0.036 0.148
#> GSM96990     3  0.4909      0.767 0.036 0.076 0.812 0.076
#> GSM96991     2  0.0188      0.937 0.000 0.996 0.004 0.000
#> GSM97048     2  0.0000      0.939 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0188      0.937 0.000 0.996 0.004 0.000
#> GSM96953     2  0.0000      0.939 0.000 1.000 0.000 0.000
#> GSM96966     4  0.5250      0.763 0.316 0.000 0.024 0.660
#> GSM96979     3  0.2644      0.783 0.032 0.000 0.908 0.060
#> GSM96983     3  0.0188      0.787 0.000 0.000 0.996 0.004
#> GSM96984     3  0.0817      0.786 0.000 0.000 0.976 0.024
#> GSM96994     3  0.2300      0.785 0.028 0.000 0.924 0.048
#> GSM96996     1  0.2216      0.751 0.908 0.000 0.000 0.092
#> GSM96997     3  0.0921      0.786 0.000 0.000 0.972 0.028
#> GSM97007     3  0.0817      0.786 0.000 0.000 0.976 0.024
#> GSM96954     3  0.4332      0.711 0.032 0.000 0.792 0.176
#> GSM96962     3  0.2644      0.783 0.032 0.000 0.908 0.060
#> GSM96969     4  0.4819      0.750 0.344 0.000 0.004 0.652
#> GSM96970     4  0.4781      0.756 0.336 0.000 0.004 0.660
#> GSM96973     4  0.4840      0.759 0.240 0.000 0.028 0.732
#> GSM96976     4  0.3975      0.620 0.064 0.016 0.064 0.856
#> GSM96977     1  0.4414      0.739 0.824 0.036 0.020 0.120
#> GSM96995     3  0.8181      0.488 0.248 0.096 0.552 0.104
#> GSM97002     1  0.2149      0.739 0.912 0.000 0.000 0.088
#> GSM97009     1  0.7146      0.562 0.612 0.204 0.016 0.168
#> GSM97010     1  0.4573      0.750 0.816 0.036 0.024 0.124
#> GSM96974     4  0.3687      0.612 0.064 0.000 0.080 0.856
#> GSM96985     3  0.0469      0.787 0.000 0.000 0.988 0.012
#> GSM96959     2  0.7486      0.481 0.180 0.616 0.044 0.160
#> GSM96972     4  0.4697      0.734 0.356 0.000 0.000 0.644
#> GSM96978     3  0.0469      0.787 0.000 0.000 0.988 0.012
#> GSM96967     4  0.4800      0.753 0.340 0.000 0.004 0.656
#> GSM96987     1  0.0336      0.769 0.992 0.000 0.000 0.008
#> GSM97011     1  0.7045      0.566 0.616 0.196 0.012 0.176
#> GSM96964     1  0.1022      0.769 0.968 0.000 0.000 0.032
#> GSM96965     4  0.4150      0.625 0.076 0.020 0.056 0.848
#> GSM96981     1  0.2345      0.745 0.900 0.000 0.000 0.100
#> GSM96982     1  0.2345      0.745 0.900 0.000 0.000 0.100
#> GSM96988     3  0.5636      0.604 0.224 0.040 0.716 0.020
#> GSM97000     1  0.6433      0.641 0.684 0.128 0.016 0.172
#> GSM97004     1  0.2345      0.731 0.900 0.000 0.000 0.100
#> GSM97008     1  0.4520      0.733 0.800 0.036 0.008 0.156
#> GSM96950     1  0.2662      0.766 0.900 0.016 0.000 0.084
#> GSM96980     1  0.4431      0.353 0.696 0.000 0.000 0.304
#> GSM96989     1  0.0336      0.769 0.992 0.000 0.000 0.008
#> GSM96992     1  0.2281      0.734 0.904 0.000 0.000 0.096
#> GSM96993     1  0.1733      0.774 0.948 0.028 0.000 0.024
#> GSM96958     1  0.3614      0.762 0.864 0.020 0.016 0.100
#> GSM96951     1  0.1867      0.758 0.928 0.000 0.000 0.072
#> GSM96952     1  0.2281      0.734 0.904 0.000 0.000 0.096
#> GSM96961     1  0.2281      0.734 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
#> GSM97038     2  0.4649      0.705 0.000 0.740 0.044 0.016 0.200
#> GSM97045     2  0.1121      0.909 0.000 0.956 0.000 0.000 0.044
#> GSM97047     5  0.3842      0.574 0.004 0.132 0.016 0.028 0.820
#> GSM97025     2  0.1043      0.912 0.000 0.960 0.000 0.000 0.040
#> GSM97030     3  0.3952      0.718 0.000 0.132 0.812 0.024 0.032
#> GSM97027     2  0.1121      0.909 0.000 0.956 0.000 0.000 0.044
#> GSM97033     2  0.0703      0.919 0.000 0.976 0.000 0.000 0.024
#> GSM97034     5  0.4726      0.620 0.076 0.088 0.016 0.028 0.792
#> GSM97020     2  0.1043      0.912 0.000 0.960 0.000 0.000 0.040
#> GSM97026     5  0.2756      0.656 0.036 0.060 0.000 0.012 0.892
#> GSM97012     2  0.0000      0.926 0.000 1.000 0.000 0.000 0.000
#> GSM97015     3  0.3800      0.728 0.000 0.084 0.836 0.028 0.052
#> GSM97016     2  0.0162      0.925 0.004 0.996 0.000 0.000 0.000
#> GSM97017     5  0.2424      0.669 0.052 0.032 0.000 0.008 0.908
#> GSM97019     2  0.0000      0.926 0.000 1.000 0.000 0.000 0.000
#> GSM97022     2  0.0000      0.926 0.000 1.000 0.000 0.000 0.000
#> GSM97035     2  0.0000      0.926 0.000 1.000 0.000 0.000 0.000
#> GSM97036     5  0.3992      0.536 0.280 0.004 0.000 0.004 0.712
#> GSM97039     2  0.0162      0.925 0.004 0.996 0.000 0.000 0.000
#> GSM97046     2  0.0162      0.925 0.004 0.996 0.000 0.000 0.000
#> GSM97023     5  0.4114      0.321 0.376 0.000 0.000 0.000 0.624
#> GSM97029     5  0.4740      0.621 0.084 0.088 0.012 0.028 0.788
#> GSM97043     3  0.6550      0.537 0.000 0.240 0.560 0.020 0.180
#> GSM97013     5  0.3876      0.476 0.316 0.000 0.000 0.000 0.684
#> GSM96956     3  0.4934      0.633 0.000 0.244 0.700 0.028 0.028
#> GSM97024     2  0.3474      0.757 0.000 0.824 0.148 0.008 0.020
#> GSM97032     3  0.4922      0.697 0.000 0.160 0.744 0.024 0.072
#> GSM97044     3  0.3426      0.729 0.000 0.084 0.856 0.028 0.032
#> GSM97049     2  0.0162      0.925 0.004 0.996 0.000 0.000 0.000
#> GSM96968     3  0.7026      0.522 0.040 0.052 0.544 0.052 0.312
#> GSM96971     3  0.5814      0.606 0.180 0.000 0.612 0.208 0.000
#> GSM96986     3  0.4361      0.712 0.204 0.000 0.752 0.032 0.012
#> GSM97003     1  0.3586      0.829 0.736 0.000 0.000 0.000 0.264
#> GSM96957     5  0.3422      0.629 0.200 0.004 0.000 0.004 0.792
#> GSM96960     1  0.3461      0.824 0.772 0.000 0.000 0.004 0.224
#> GSM96975     5  0.5326     -0.215 0.464 0.000 0.012 0.028 0.496
#> GSM96998     1  0.4060      0.697 0.640 0.000 0.000 0.000 0.360
#> GSM96999     5  0.3422      0.629 0.200 0.004 0.000 0.004 0.792
#> GSM97001     5  0.3422      0.629 0.200 0.004 0.000 0.004 0.792
#> GSM97005     5  0.3730      0.514 0.288 0.000 0.000 0.000 0.712
#> GSM97006     1  0.3461      0.824 0.772 0.000 0.000 0.004 0.224
#> GSM97021     5  0.2228      0.666 0.040 0.028 0.000 0.012 0.920
#> GSM97028     3  0.4975      0.633 0.024 0.032 0.712 0.004 0.228
#> GSM97031     1  0.6000      0.236 0.636 0.000 0.140 0.020 0.204
#> GSM97037     3  0.4625      0.681 0.000 0.192 0.748 0.028 0.032
#> GSM97018     3  0.6390      0.601 0.016 0.084 0.608 0.028 0.264
#> GSM97014     5  0.3052      0.624 0.008 0.092 0.000 0.032 0.868
#> GSM97042     2  0.0000      0.926 0.000 1.000 0.000 0.000 0.000
#> GSM97040     5  0.3434      0.626 0.016 0.084 0.008 0.032 0.860
#> GSM97041     5  0.2139      0.669 0.052 0.032 0.000 0.000 0.916
#> GSM96955     2  0.5508      0.598 0.008 0.648 0.024 0.036 0.284
#> GSM96990     3  0.4344      0.724 0.000 0.056 0.804 0.044 0.096
#> GSM96991     2  0.0162      0.925 0.004 0.996 0.000 0.000 0.000
#> GSM97048     2  0.0162      0.925 0.004 0.996 0.000 0.000 0.000
#> GSM96963     2  0.0162      0.925 0.004 0.996 0.000 0.000 0.000
#> GSM96953     2  0.0000      0.926 0.000 1.000 0.000 0.000 0.000
#> GSM96966     4  0.4914      0.726 0.336 0.000 0.004 0.628 0.032
#> GSM96979     3  0.4703      0.712 0.204 0.000 0.736 0.040 0.020
#> GSM96983     3  0.0880      0.738 0.032 0.000 0.968 0.000 0.000
#> GSM96984     3  0.3419      0.724 0.180 0.000 0.804 0.016 0.000
#> GSM96994     3  0.4295      0.715 0.196 0.000 0.760 0.032 0.012
#> GSM96996     1  0.3876      0.779 0.684 0.000 0.000 0.000 0.316
#> GSM96997     3  0.3456      0.723 0.184 0.000 0.800 0.016 0.000
#> GSM97007     3  0.3419      0.724 0.180 0.000 0.804 0.016 0.000
#> GSM96954     3  0.5814      0.606 0.180 0.000 0.612 0.208 0.000
#> GSM96962     3  0.4703      0.712 0.204 0.000 0.736 0.040 0.020
#> GSM96969     4  0.4930      0.704 0.388 0.000 0.000 0.580 0.032
#> GSM96970     4  0.4846      0.713 0.384 0.000 0.000 0.588 0.028
#> GSM96973     4  0.4372      0.731 0.260 0.000 0.004 0.712 0.024
#> GSM96976     4  0.1074      0.634 0.000 0.016 0.012 0.968 0.004
#> GSM96977     5  0.4659      0.589 0.220 0.004 0.016 0.028 0.732
#> GSM96995     3  0.7026      0.522 0.040 0.052 0.544 0.052 0.312
#> GSM97002     1  0.3586      0.829 0.736 0.000 0.000 0.000 0.264
#> GSM97009     5  0.3612      0.617 0.016 0.100 0.004 0.036 0.844
#> GSM97010     1  0.5987      0.520 0.536 0.024 0.012 0.036 0.392
#> GSM96974     4  0.0865      0.630 0.000 0.000 0.024 0.972 0.004
#> GSM96985     3  0.1281      0.737 0.032 0.000 0.956 0.012 0.000
#> GSM96959     2  0.5938      0.368 0.004 0.528 0.036 0.032 0.400
#> GSM96972     4  0.4966      0.682 0.404 0.000 0.000 0.564 0.032
#> GSM96978     3  0.1281      0.737 0.032 0.000 0.956 0.012 0.000
#> GSM96967     4  0.4920      0.709 0.384 0.000 0.000 0.584 0.032
#> GSM96987     5  0.4045      0.387 0.356 0.000 0.000 0.000 0.644
#> GSM97011     5  0.3424      0.621 0.016 0.092 0.004 0.032 0.856
#> GSM96964     5  0.4101      0.350 0.372 0.000 0.000 0.000 0.628
#> GSM96965     4  0.1565      0.639 0.004 0.016 0.008 0.952 0.020
#> GSM96981     1  0.3814      0.820 0.720 0.000 0.000 0.004 0.276
#> GSM96982     1  0.3814      0.820 0.720 0.000 0.000 0.004 0.276
#> GSM96988     3  0.5143      0.637 0.024 0.032 0.712 0.012 0.220
#> GSM97000     5  0.4094      0.650 0.084 0.048 0.008 0.032 0.828
#> GSM97004     1  0.3461      0.824 0.772 0.000 0.000 0.004 0.224
#> GSM97008     5  0.3767      0.643 0.168 0.008 0.000 0.024 0.800
#> GSM96950     5  0.4070      0.571 0.256 0.004 0.000 0.012 0.728
#> GSM96980     1  0.5680      0.492 0.628 0.000 0.000 0.212 0.160
#> GSM96989     5  0.4045      0.387 0.356 0.000 0.000 0.000 0.644
#> GSM96992     1  0.3508      0.834 0.748 0.000 0.000 0.000 0.252
#> GSM96993     5  0.3766      0.550 0.268 0.004 0.000 0.000 0.728
#> GSM96958     5  0.4877      0.451 0.312 0.000 0.012 0.024 0.652
#> GSM96951     1  0.4101      0.670 0.628 0.000 0.000 0.000 0.372
#> GSM96952     1  0.3508      0.834 0.748 0.000 0.000 0.000 0.252
#> GSM96961     1  0.3534      0.833 0.744 0.000 0.000 0.000 0.256

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.5206      0.624 0.000 0.696 0.092 0.004 0.160 0.048
#> GSM97045     2  0.1075      0.893 0.000 0.952 0.000 0.000 0.048 0.000
#> GSM97047     5  0.4181      0.652 0.000 0.064 0.076 0.012 0.800 0.048
#> GSM97025     2  0.1007      0.895 0.000 0.956 0.000 0.000 0.044 0.000
#> GSM97030     3  0.3466      0.684 0.000 0.096 0.816 0.000 0.004 0.084
#> GSM97027     2  0.1075      0.893 0.000 0.952 0.000 0.000 0.048 0.000
#> GSM97033     2  0.0632      0.905 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM97034     5  0.4745      0.701 0.040 0.068 0.060 0.008 0.780 0.044
#> GSM97020     2  0.0937      0.898 0.000 0.960 0.000 0.000 0.040 0.000
#> GSM97026     5  0.2314      0.742 0.012 0.032 0.016 0.008 0.916 0.016
#> GSM97012     2  0.0000      0.911 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97015     3  0.3095      0.694 0.000 0.052 0.856 0.000 0.020 0.072
#> GSM97016     2  0.0551      0.908 0.000 0.984 0.004 0.000 0.004 0.008
#> GSM97017     5  0.1910      0.752 0.028 0.004 0.016 0.004 0.932 0.016
#> GSM97019     2  0.0146      0.911 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM97022     2  0.0000      0.911 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97035     2  0.0000      0.911 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97036     5  0.4105      0.689 0.236 0.000 0.008 0.000 0.720 0.036
#> GSM97039     2  0.0551      0.908 0.000 0.984 0.004 0.000 0.004 0.008
#> GSM97046     2  0.0551      0.908 0.000 0.984 0.004 0.000 0.004 0.008
#> GSM97023     5  0.4614      0.581 0.336 0.000 0.004 0.004 0.620 0.036
#> GSM97029     5  0.4756      0.708 0.048 0.068 0.052 0.008 0.780 0.044
#> GSM97043     3  0.5323      0.588 0.000 0.204 0.632 0.000 0.152 0.012
#> GSM97013     5  0.4541      0.658 0.272 0.000 0.012 0.004 0.676 0.036
#> GSM96956     3  0.3924      0.617 0.000 0.208 0.740 0.000 0.000 0.052
#> GSM97024     2  0.2955      0.735 0.000 0.816 0.172 0.000 0.004 0.008
#> GSM97032     3  0.4255      0.687 0.000 0.128 0.772 0.000 0.048 0.052
#> GSM97044     3  0.2814      0.685 0.000 0.052 0.864 0.000 0.004 0.080
#> GSM97049     2  0.0551      0.908 0.000 0.984 0.004 0.000 0.004 0.008
#> GSM96968     3  0.6073      0.542 0.028 0.016 0.584 0.008 0.276 0.088
#> GSM96971     6  0.4691      0.777 0.000 0.000 0.124 0.196 0.000 0.680
#> GSM96986     6  0.2346      0.897 0.000 0.000 0.124 0.000 0.008 0.868
#> GSM97003     1  0.0937      0.805 0.960 0.000 0.000 0.000 0.040 0.000
#> GSM96957     5  0.3729      0.733 0.208 0.004 0.012 0.004 0.764 0.008
#> GSM96960     1  0.0291      0.781 0.992 0.000 0.004 0.000 0.000 0.004
#> GSM96975     1  0.5185      0.104 0.552 0.000 0.016 0.008 0.384 0.040
#> GSM96998     1  0.2773      0.733 0.828 0.000 0.004 0.000 0.164 0.004
#> GSM96999     5  0.3729      0.733 0.208 0.004 0.012 0.004 0.764 0.008
#> GSM97001     5  0.3729      0.733 0.208 0.004 0.012 0.004 0.764 0.008
#> GSM97005     5  0.4074      0.668 0.288 0.000 0.000 0.004 0.684 0.024
#> GSM97006     1  0.0291      0.781 0.992 0.000 0.004 0.000 0.000 0.004
#> GSM97021     5  0.1849      0.751 0.024 0.004 0.012 0.008 0.936 0.016
#> GSM97028     3  0.6048      0.537 0.004 0.020 0.572 0.004 0.220 0.180
#> GSM97031     1  0.6219      0.243 0.424 0.000 0.008 0.004 0.200 0.364
#> GSM97037     3  0.3707      0.660 0.000 0.156 0.784 0.000 0.004 0.056
#> GSM97018     3  0.5840      0.614 0.004 0.056 0.632 0.012 0.228 0.068
#> GSM97014     5  0.3365      0.699 0.000 0.044 0.040 0.016 0.856 0.044
#> GSM97042     2  0.0000      0.911 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97040     5  0.3630      0.701 0.012 0.028 0.052 0.016 0.848 0.044
#> GSM97041     5  0.1672      0.753 0.028 0.004 0.016 0.000 0.940 0.012
#> GSM96955     2  0.6160      0.478 0.000 0.588 0.080 0.016 0.252 0.064
#> GSM96990     3  0.3924      0.689 0.000 0.032 0.812 0.008 0.072 0.076
#> GSM96991     2  0.0146      0.911 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97048     2  0.0551      0.908 0.000 0.984 0.004 0.000 0.004 0.008
#> GSM96963     2  0.0146      0.911 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM96953     2  0.0000      0.911 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96966     4  0.3807      0.706 0.368 0.000 0.004 0.628 0.000 0.000
#> GSM96979     6  0.2806      0.892 0.000 0.000 0.136 0.004 0.016 0.844
#> GSM96983     3  0.2668      0.578 0.000 0.000 0.828 0.004 0.000 0.168
#> GSM96984     6  0.2491      0.890 0.000 0.000 0.164 0.000 0.000 0.836
#> GSM96994     6  0.2431      0.899 0.000 0.000 0.132 0.000 0.008 0.860
#> GSM96996     1  0.2146      0.774 0.880 0.000 0.000 0.000 0.116 0.004
#> GSM96997     6  0.2454      0.892 0.000 0.000 0.160 0.000 0.000 0.840
#> GSM97007     6  0.2491      0.890 0.000 0.000 0.164 0.000 0.000 0.836
#> GSM96954     6  0.4691      0.777 0.000 0.000 0.124 0.196 0.000 0.680
#> GSM96962     6  0.2806      0.892 0.000 0.000 0.136 0.004 0.016 0.844
#> GSM96969     4  0.3930      0.682 0.420 0.000 0.004 0.576 0.000 0.000
#> GSM96970     4  0.3915      0.692 0.412 0.000 0.004 0.584 0.000 0.000
#> GSM96973     4  0.3309      0.710 0.280 0.000 0.000 0.720 0.000 0.000
#> GSM96976     4  0.0810      0.597 0.000 0.008 0.008 0.976 0.004 0.004
#> GSM96977     5  0.4831      0.701 0.220 0.000 0.032 0.012 0.700 0.036
#> GSM96995     3  0.6073      0.542 0.028 0.016 0.584 0.008 0.276 0.088
#> GSM97002     1  0.0937      0.805 0.960 0.000 0.000 0.000 0.040 0.000
#> GSM97009     5  0.3837      0.700 0.012 0.036 0.056 0.016 0.836 0.044
#> GSM97010     1  0.4676      0.648 0.744 0.012 0.048 0.012 0.168 0.016
#> GSM96974     4  0.0692      0.594 0.000 0.000 0.020 0.976 0.000 0.004
#> GSM96985     3  0.2968      0.575 0.000 0.000 0.816 0.016 0.000 0.168
#> GSM96959     2  0.6537      0.249 0.000 0.464 0.092 0.016 0.372 0.056
#> GSM96972     4  0.3955      0.657 0.436 0.000 0.004 0.560 0.000 0.000
#> GSM96978     3  0.2968      0.575 0.000 0.000 0.816 0.016 0.000 0.168
#> GSM96967     4  0.3923      0.688 0.416 0.000 0.004 0.580 0.000 0.000
#> GSM96987     5  0.4450      0.587 0.336 0.000 0.008 0.000 0.628 0.028
#> GSM97011     5  0.3706      0.703 0.012 0.032 0.048 0.016 0.844 0.048
#> GSM96964     5  0.4353      0.558 0.360 0.000 0.004 0.000 0.612 0.024
#> GSM96965     4  0.1354      0.601 0.004 0.008 0.004 0.956 0.020 0.008
#> GSM96981     1  0.1625      0.801 0.928 0.000 0.000 0.000 0.060 0.012
#> GSM96982     1  0.1625      0.801 0.928 0.000 0.000 0.000 0.060 0.012
#> GSM96988     3  0.6248      0.533 0.004 0.020 0.564 0.012 0.212 0.188
#> GSM97000     5  0.4156      0.734 0.092 0.004 0.048 0.012 0.804 0.040
#> GSM97004     1  0.0291      0.781 0.992 0.000 0.004 0.000 0.000 0.004
#> GSM97008     5  0.4517      0.739 0.184 0.004 0.024 0.016 0.744 0.028
#> GSM96950     5  0.4362      0.698 0.256 0.000 0.016 0.008 0.700 0.020
#> GSM96980     1  0.3134      0.449 0.784 0.000 0.004 0.208 0.004 0.000
#> GSM96989     5  0.4450      0.587 0.336 0.000 0.008 0.000 0.628 0.028
#> GSM96992     1  0.1010      0.804 0.960 0.000 0.000 0.000 0.036 0.004
#> GSM96993     5  0.3960      0.701 0.224 0.000 0.008 0.000 0.736 0.032
#> GSM96958     5  0.5006      0.607 0.316 0.000 0.020 0.008 0.620 0.036
#> GSM96951     1  0.3121      0.713 0.804 0.000 0.000 0.004 0.180 0.012
#> GSM96952     1  0.1010      0.804 0.960 0.000 0.000 0.000 0.036 0.004
#> GSM96961     1  0.1082      0.805 0.956 0.000 0.000 0.000 0.040 0.004

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-hclust-collect-classes

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

test_to_known_factors(res)
#>             n disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:hclust 78         0.000412      0.1991     7.19e-12  0.00845 2
#> MAD:hclust 95         0.002696      0.1882     1.66e-13  0.03007 3
#> MAD:hclust 95         0.001093      0.0924     8.74e-15  0.03654 4
#> MAD:hclust 90         0.000191      0.1509     8.12e-13  0.09718 5
#> MAD:hclust 95         0.000267      0.2186     3.97e-16  0.02322 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 21168 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.963       0.985         0.4866 0.519   0.519
#> 3 3 0.727           0.827       0.904         0.3351 0.759   0.566
#> 4 4 0.801           0.744       0.864         0.1391 0.827   0.549
#> 5 5 0.717           0.774       0.828         0.0624 0.909   0.667
#> 6 6 0.747           0.731       0.787         0.0447 0.967   0.844

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
#> GSM97038     2  0.0000      0.998 0.000 1.000
#> GSM97045     2  0.0000      0.998 0.000 1.000
#> GSM97047     2  0.0000      0.998 0.000 1.000
#> GSM97025     2  0.0000      0.998 0.000 1.000
#> GSM97030     2  0.0000      0.998 0.000 1.000
#> GSM97027     2  0.0000      0.998 0.000 1.000
#> GSM97033     2  0.0000      0.998 0.000 1.000
#> GSM97034     2  0.0000      0.998 0.000 1.000
#> GSM97020     2  0.0000      0.998 0.000 1.000
#> GSM97026     2  0.0000      0.998 0.000 1.000
#> GSM97012     2  0.0000      0.998 0.000 1.000
#> GSM97015     2  0.0000      0.998 0.000 1.000
#> GSM97016     2  0.0000      0.998 0.000 1.000
#> GSM97017     1  0.0000      0.975 1.000 0.000
#> GSM97019     2  0.0000      0.998 0.000 1.000
#> GSM97022     2  0.0000      0.998 0.000 1.000
#> GSM97035     2  0.0000      0.998 0.000 1.000
#> GSM97036     1  0.0000      0.975 1.000 0.000
#> GSM97039     2  0.0000      0.998 0.000 1.000
#> GSM97046     2  0.0000      0.998 0.000 1.000
#> GSM97023     1  0.0000      0.975 1.000 0.000
#> GSM97029     1  0.0000      0.975 1.000 0.000
#> GSM97043     2  0.0000      0.998 0.000 1.000
#> GSM97013     1  0.0000      0.975 1.000 0.000
#> GSM96956     2  0.0000      0.998 0.000 1.000
#> GSM97024     2  0.0000      0.998 0.000 1.000
#> GSM97032     2  0.0000      0.998 0.000 1.000
#> GSM97044     2  0.0000      0.998 0.000 1.000
#> GSM97049     2  0.0000      0.998 0.000 1.000
#> GSM96968     1  0.0000      0.975 1.000 0.000
#> GSM96971     1  0.0000      0.975 1.000 0.000
#> GSM96986     1  0.0000      0.975 1.000 0.000
#> GSM97003     1  0.0000      0.975 1.000 0.000
#> GSM96957     1  0.0000      0.975 1.000 0.000
#> GSM96960     1  0.0000      0.975 1.000 0.000
#> GSM96975     1  0.0000      0.975 1.000 0.000
#> GSM96998     1  0.0000      0.975 1.000 0.000
#> GSM96999     1  0.0000      0.975 1.000 0.000
#> GSM97001     1  0.0000      0.975 1.000 0.000
#> GSM97005     1  0.0000      0.975 1.000 0.000
#> GSM97006     1  0.0000      0.975 1.000 0.000
#> GSM97021     1  0.0000      0.975 1.000 0.000
#> GSM97028     1  0.9087      0.533 0.676 0.324
#> GSM97031     1  0.0000      0.975 1.000 0.000
#> GSM97037     2  0.0000      0.998 0.000 1.000
#> GSM97018     2  0.0000      0.998 0.000 1.000
#> GSM97014     2  0.0376      0.995 0.004 0.996
#> GSM97042     2  0.0000      0.998 0.000 1.000
#> GSM97040     1  0.9944      0.190 0.544 0.456
#> GSM97041     1  0.0000      0.975 1.000 0.000
#> GSM96955     2  0.0000      0.998 0.000 1.000
#> GSM96990     2  0.0000      0.998 0.000 1.000
#> GSM96991     2  0.0000      0.998 0.000 1.000
#> GSM97048     2  0.0000      0.998 0.000 1.000
#> GSM96963     2  0.0000      0.998 0.000 1.000
#> GSM96953     2  0.0000      0.998 0.000 1.000
#> GSM96966     1  0.0000      0.975 1.000 0.000
#> GSM96979     1  0.0000      0.975 1.000 0.000
#> GSM96983     2  0.0000      0.998 0.000 1.000
#> GSM96984     1  0.6801      0.780 0.820 0.180
#> GSM96994     2  0.0672      0.991 0.008 0.992
#> GSM96996     1  0.0000      0.975 1.000 0.000
#> GSM96997     1  0.0000      0.975 1.000 0.000
#> GSM97007     2  0.0672      0.991 0.008 0.992
#> GSM96954     1  0.0000      0.975 1.000 0.000
#> GSM96962     1  0.0000      0.975 1.000 0.000
#> GSM96969     1  0.0000      0.975 1.000 0.000
#> GSM96970     1  0.0000      0.975 1.000 0.000
#> GSM96973     1  0.0000      0.975 1.000 0.000
#> GSM96976     1  0.7674      0.719 0.776 0.224
#> GSM96977     1  0.0000      0.975 1.000 0.000
#> GSM96995     1  0.8661      0.612 0.712 0.288
#> GSM97002     1  0.0000      0.975 1.000 0.000
#> GSM97009     2  0.2948      0.944 0.052 0.948
#> GSM97010     1  0.0000      0.975 1.000 0.000
#> GSM96974     1  0.0000      0.975 1.000 0.000
#> GSM96985     1  0.0000      0.975 1.000 0.000
#> GSM96959     2  0.0000      0.998 0.000 1.000
#> GSM96972     1  0.0000      0.975 1.000 0.000
#> GSM96978     1  0.0000      0.975 1.000 0.000
#> GSM96967     1  0.0000      0.975 1.000 0.000
#> GSM96987     1  0.0000      0.975 1.000 0.000
#> GSM97011     1  0.0000      0.975 1.000 0.000
#> GSM96964     1  0.0000      0.975 1.000 0.000
#> GSM96965     1  0.0000      0.975 1.000 0.000
#> GSM96981     1  0.0000      0.975 1.000 0.000
#> GSM96982     1  0.0000      0.975 1.000 0.000
#> GSM96988     1  0.0000      0.975 1.000 0.000
#> GSM97000     1  0.0000      0.975 1.000 0.000
#> GSM97004     1  0.0000      0.975 1.000 0.000
#> GSM97008     1  0.0000      0.975 1.000 0.000
#> GSM96950     1  0.0000      0.975 1.000 0.000
#> GSM96980     1  0.0000      0.975 1.000 0.000
#> GSM96989     1  0.0000      0.975 1.000 0.000
#> GSM96992     1  0.0000      0.975 1.000 0.000
#> GSM96993     1  0.0000      0.975 1.000 0.000
#> GSM96958     1  0.0000      0.975 1.000 0.000
#> GSM96951     1  0.0000      0.975 1.000 0.000
#> GSM96952     1  0.0000      0.975 1.000 0.000
#> GSM96961     1  0.0000      0.975 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
#> GSM97038     2  0.0000     0.9386 0.000 1.000 0.000
#> GSM97045     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM97047     2  0.4733     0.6897 0.004 0.800 0.196
#> GSM97025     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM97030     3  0.5733     0.6319 0.000 0.324 0.676
#> GSM97027     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM97033     2  0.0000     0.9386 0.000 1.000 0.000
#> GSM97034     3  0.5706     0.6377 0.000 0.320 0.680
#> GSM97020     2  0.0000     0.9386 0.000 1.000 0.000
#> GSM97026     2  0.2590     0.8712 0.004 0.924 0.072
#> GSM97012     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM97015     3  0.5706     0.6377 0.000 0.320 0.680
#> GSM97016     2  0.0000     0.9386 0.000 1.000 0.000
#> GSM97017     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM97019     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM97022     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM97035     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM97036     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM97039     2  0.0000     0.9386 0.000 1.000 0.000
#> GSM97046     2  0.0000     0.9386 0.000 1.000 0.000
#> GSM97023     1  0.0237     0.9160 0.996 0.000 0.004
#> GSM97029     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM97043     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM97013     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM96956     2  0.6244    -0.0575 0.000 0.560 0.440
#> GSM97024     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM97032     3  0.5706     0.6377 0.000 0.320 0.680
#> GSM97044     3  0.5706     0.6377 0.000 0.320 0.680
#> GSM97049     2  0.0000     0.9386 0.000 1.000 0.000
#> GSM96968     3  0.3412     0.8014 0.124 0.000 0.876
#> GSM96971     3  0.0237     0.7995 0.004 0.000 0.996
#> GSM96986     3  0.2625     0.8181 0.084 0.000 0.916
#> GSM97003     1  0.2878     0.8804 0.904 0.000 0.096
#> GSM96957     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM96960     1  0.3038     0.8750 0.896 0.000 0.104
#> GSM96975     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM96998     1  0.0237     0.9160 0.996 0.000 0.004
#> GSM96999     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM97001     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM97005     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM97006     1  0.2625     0.8860 0.916 0.000 0.084
#> GSM97021     1  0.0747     0.9113 0.984 0.000 0.016
#> GSM97028     3  0.3009     0.8205 0.052 0.028 0.920
#> GSM97031     1  0.1860     0.9022 0.948 0.000 0.052
#> GSM97037     3  0.6267     0.3534 0.000 0.452 0.548
#> GSM97018     3  0.5706     0.6377 0.000 0.320 0.680
#> GSM97014     2  0.3805     0.8223 0.092 0.884 0.024
#> GSM97042     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM97040     1  0.4842     0.6795 0.776 0.000 0.224
#> GSM97041     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM96955     2  0.1399     0.9132 0.004 0.968 0.028
#> GSM96990     3  0.5706     0.6377 0.000 0.320 0.680
#> GSM96991     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM97048     2  0.0000     0.9386 0.000 1.000 0.000
#> GSM96963     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM96953     2  0.0237     0.9395 0.000 0.996 0.004
#> GSM96966     1  0.5706     0.6874 0.680 0.000 0.320
#> GSM96979     3  0.2625     0.8181 0.084 0.000 0.916
#> GSM96983     3  0.2711     0.8017 0.000 0.088 0.912
#> GSM96984     3  0.2625     0.8181 0.084 0.000 0.916
#> GSM96994     3  0.2774     0.8092 0.008 0.072 0.920
#> GSM96996     1  0.0592     0.9151 0.988 0.000 0.012
#> GSM96997     3  0.2625     0.8181 0.084 0.000 0.916
#> GSM97007     3  0.2774     0.8092 0.008 0.072 0.920
#> GSM96954     3  0.2711     0.8168 0.088 0.000 0.912
#> GSM96962     3  0.2625     0.8181 0.084 0.000 0.916
#> GSM96969     1  0.5706     0.6874 0.680 0.000 0.320
#> GSM96970     1  0.5706     0.6874 0.680 0.000 0.320
#> GSM96973     1  0.5706     0.6874 0.680 0.000 0.320
#> GSM96976     3  0.0424     0.8001 0.008 0.000 0.992
#> GSM96977     1  0.4291     0.7490 0.820 0.000 0.180
#> GSM96995     3  0.4953     0.7624 0.176 0.016 0.808
#> GSM97002     1  0.2356     0.8934 0.928 0.000 0.072
#> GSM97009     2  0.8765     0.3523 0.252 0.580 0.168
#> GSM97010     1  0.2796     0.8649 0.908 0.000 0.092
#> GSM96974     3  0.0424     0.7991 0.008 0.000 0.992
#> GSM96985     3  0.4750     0.5908 0.216 0.000 0.784
#> GSM96959     3  0.6835     0.6594 0.040 0.284 0.676
#> GSM96972     1  0.5706     0.6874 0.680 0.000 0.320
#> GSM96978     3  0.1163     0.8090 0.028 0.000 0.972
#> GSM96967     1  0.5706     0.6874 0.680 0.000 0.320
#> GSM96987     1  0.0237     0.9160 0.996 0.000 0.004
#> GSM97011     1  0.1031     0.9071 0.976 0.000 0.024
#> GSM96964     1  0.0237     0.9160 0.996 0.000 0.004
#> GSM96965     1  0.5178     0.7472 0.744 0.000 0.256
#> GSM96981     1  0.0424     0.9144 0.992 0.000 0.008
#> GSM96982     1  0.1289     0.9098 0.968 0.000 0.032
#> GSM96988     3  0.2625     0.8181 0.084 0.000 0.916
#> GSM97000     1  0.4796     0.6861 0.780 0.000 0.220
#> GSM97004     1  0.2625     0.8868 0.916 0.000 0.084
#> GSM97008     1  0.1163     0.9052 0.972 0.000 0.028
#> GSM96950     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM96980     1  0.4002     0.8412 0.840 0.000 0.160
#> GSM96989     1  0.0237     0.9160 0.996 0.000 0.004
#> GSM96992     1  0.0747     0.9143 0.984 0.000 0.016
#> GSM96993     1  0.0237     0.9159 0.996 0.000 0.004
#> GSM96958     1  0.0237     0.9160 0.996 0.000 0.004
#> GSM96951     1  0.0237     0.9160 0.996 0.000 0.004
#> GSM96952     1  0.0424     0.9153 0.992 0.000 0.008
#> GSM96961     1  0.0237     0.9160 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
#> GSM97038     2  0.1118      0.965 0.000 0.964 0.000 0.036
#> GSM97045     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM97047     1  0.6265      0.404 0.644 0.284 0.056 0.016
#> GSM97025     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM97030     3  0.1510      0.919 0.016 0.028 0.956 0.000
#> GSM97027     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM97033     2  0.1118      0.965 0.000 0.964 0.000 0.036
#> GSM97034     3  0.1520      0.920 0.024 0.020 0.956 0.000
#> GSM97020     2  0.1118      0.965 0.000 0.964 0.000 0.036
#> GSM97026     1  0.5668      0.370 0.636 0.328 0.032 0.004
#> GSM97012     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM97015     3  0.1520      0.920 0.024 0.020 0.956 0.000
#> GSM97016     2  0.1118      0.965 0.000 0.964 0.000 0.036
#> GSM97017     1  0.0592      0.799 0.984 0.000 0.000 0.016
#> GSM97019     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM97036     1  0.1211      0.790 0.960 0.000 0.000 0.040
#> GSM97039     2  0.1118      0.965 0.000 0.964 0.000 0.036
#> GSM97046     2  0.1118      0.965 0.000 0.964 0.000 0.036
#> GSM97023     1  0.4855      0.153 0.644 0.000 0.004 0.352
#> GSM97029     1  0.0921      0.797 0.972 0.000 0.000 0.028
#> GSM97043     2  0.0657      0.962 0.012 0.984 0.004 0.000
#> GSM97013     1  0.1398      0.788 0.956 0.000 0.004 0.040
#> GSM96956     3  0.5430      0.629 0.008 0.252 0.704 0.036
#> GSM97024     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM97032     3  0.1510      0.919 0.016 0.028 0.956 0.000
#> GSM97044     3  0.1510      0.919 0.016 0.028 0.956 0.000
#> GSM97049     2  0.1118      0.965 0.000 0.964 0.000 0.036
#> GSM96968     3  0.0921      0.920 0.028 0.000 0.972 0.000
#> GSM96971     3  0.0921      0.919 0.000 0.000 0.972 0.028
#> GSM96986     3  0.0707      0.922 0.000 0.000 0.980 0.020
#> GSM97003     4  0.5127      0.653 0.356 0.000 0.012 0.632
#> GSM96957     1  0.0817      0.798 0.976 0.000 0.000 0.024
#> GSM96960     4  0.4819      0.661 0.344 0.000 0.004 0.652
#> GSM96975     1  0.0921      0.797 0.972 0.000 0.000 0.028
#> GSM96998     4  0.5088      0.579 0.424 0.000 0.004 0.572
#> GSM96999     1  0.1004      0.797 0.972 0.000 0.004 0.024
#> GSM97001     1  0.0592      0.799 0.984 0.000 0.000 0.016
#> GSM97005     1  0.0592      0.799 0.984 0.000 0.000 0.016
#> GSM97006     4  0.4872      0.656 0.356 0.000 0.004 0.640
#> GSM97021     1  0.0000      0.796 1.000 0.000 0.000 0.000
#> GSM97028     3  0.0657      0.924 0.012 0.004 0.984 0.000
#> GSM97031     1  0.4792      0.251 0.680 0.000 0.008 0.312
#> GSM97037     3  0.4282      0.800 0.016 0.140 0.820 0.024
#> GSM97018     3  0.1520      0.920 0.024 0.020 0.956 0.000
#> GSM97014     1  0.5254      0.418 0.672 0.300 0.000 0.028
#> GSM97042     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM97040     1  0.1661      0.755 0.944 0.000 0.052 0.004
#> GSM97041     1  0.0336      0.798 0.992 0.000 0.000 0.008
#> GSM96955     2  0.5460      0.481 0.340 0.632 0.000 0.028
#> GSM96990     3  0.1520      0.920 0.024 0.020 0.956 0.000
#> GSM96991     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM97048     2  0.1118      0.965 0.000 0.964 0.000 0.036
#> GSM96963     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000      0.971 0.000 1.000 0.000 0.000
#> GSM96966     4  0.2363      0.637 0.056 0.000 0.024 0.920
#> GSM96979     3  0.0707      0.922 0.000 0.000 0.980 0.020
#> GSM96983     3  0.0376      0.923 0.000 0.004 0.992 0.004
#> GSM96984     3  0.0707      0.922 0.000 0.000 0.980 0.020
#> GSM96994     3  0.0895      0.922 0.000 0.004 0.976 0.020
#> GSM96996     4  0.5060      0.598 0.412 0.000 0.004 0.584
#> GSM96997     3  0.0707      0.922 0.000 0.000 0.980 0.020
#> GSM97007     3  0.0895      0.922 0.000 0.004 0.976 0.020
#> GSM96954     3  0.0895      0.922 0.020 0.000 0.976 0.004
#> GSM96962     3  0.0707      0.922 0.000 0.000 0.980 0.020
#> GSM96969     4  0.2363      0.637 0.056 0.000 0.024 0.920
#> GSM96970     4  0.2363      0.637 0.056 0.000 0.024 0.920
#> GSM96973     4  0.2363      0.637 0.056 0.000 0.024 0.920
#> GSM96976     3  0.4888      0.450 0.000 0.000 0.588 0.412
#> GSM96977     1  0.1389      0.761 0.952 0.000 0.048 0.000
#> GSM96995     3  0.1637      0.904 0.060 0.000 0.940 0.000
#> GSM97002     4  0.4837      0.660 0.348 0.000 0.004 0.648
#> GSM97009     1  0.3674      0.687 0.868 0.084 0.028 0.020
#> GSM97010     1  0.1388      0.795 0.960 0.000 0.012 0.028
#> GSM96974     4  0.4925     -0.101 0.000 0.000 0.428 0.572
#> GSM96985     4  0.4722      0.312 0.008 0.000 0.300 0.692
#> GSM96959     3  0.5396      0.214 0.464 0.000 0.524 0.012
#> GSM96972     4  0.2363      0.637 0.056 0.000 0.024 0.920
#> GSM96978     3  0.0469      0.922 0.000 0.000 0.988 0.012
#> GSM96967     4  0.2363      0.637 0.056 0.000 0.024 0.920
#> GSM96987     4  0.5105      0.564 0.432 0.000 0.004 0.564
#> GSM97011     1  0.0000      0.796 1.000 0.000 0.000 0.000
#> GSM96964     1  0.4905      0.108 0.632 0.000 0.004 0.364
#> GSM96965     4  0.5476      0.170 0.396 0.000 0.020 0.584
#> GSM96981     4  0.4907      0.594 0.420 0.000 0.000 0.580
#> GSM96982     4  0.4872      0.656 0.356 0.000 0.004 0.640
#> GSM96988     3  0.0188      0.923 0.000 0.000 0.996 0.004
#> GSM97000     1  0.1211      0.768 0.960 0.000 0.040 0.000
#> GSM97004     4  0.4781      0.662 0.336 0.000 0.004 0.660
#> GSM97008     1  0.0000      0.796 1.000 0.000 0.000 0.000
#> GSM96950     1  0.1489      0.785 0.952 0.000 0.004 0.044
#> GSM96980     4  0.1557      0.638 0.056 0.000 0.000 0.944
#> GSM96989     4  0.5105      0.564 0.432 0.000 0.004 0.564
#> GSM96992     4  0.4964      0.637 0.380 0.000 0.004 0.616
#> GSM96993     1  0.1022      0.795 0.968 0.000 0.000 0.032
#> GSM96958     1  0.4837      0.166 0.648 0.000 0.004 0.348
#> GSM96951     1  0.4889      0.124 0.636 0.000 0.004 0.360
#> GSM96952     4  0.4964      0.637 0.380 0.000 0.004 0.616
#> GSM96961     4  0.5112      0.555 0.436 0.000 0.004 0.560

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97038     2  0.3474      0.901 0.000 0.836 0.004 0.116 0.044
#> GSM97045     2  0.0579      0.933 0.000 0.984 0.000 0.008 0.008
#> GSM97047     5  0.3433      0.690 0.000 0.032 0.132 0.004 0.832
#> GSM97025     2  0.0451      0.933 0.000 0.988 0.000 0.004 0.008
#> GSM97030     3  0.1442      0.845 0.000 0.004 0.952 0.012 0.032
#> GSM97027     2  0.0579      0.933 0.000 0.984 0.000 0.008 0.008
#> GSM97033     2  0.3165      0.906 0.000 0.848 0.000 0.116 0.036
#> GSM97034     3  0.1618      0.839 0.000 0.008 0.944 0.008 0.040
#> GSM97020     2  0.3291      0.904 0.000 0.840 0.000 0.120 0.040
#> GSM97026     5  0.4429      0.711 0.012 0.076 0.080 0.024 0.808
#> GSM97012     2  0.0451      0.934 0.000 0.988 0.008 0.004 0.000
#> GSM97015     3  0.1285      0.841 0.000 0.004 0.956 0.004 0.036
#> GSM97016     2  0.3242      0.905 0.000 0.844 0.000 0.116 0.040
#> GSM97017     5  0.2997      0.821 0.148 0.000 0.000 0.012 0.840
#> GSM97019     2  0.0579      0.933 0.000 0.984 0.008 0.008 0.000
#> GSM97022     2  0.0451      0.934 0.000 0.988 0.008 0.004 0.000
#> GSM97035     2  0.0451      0.934 0.000 0.988 0.008 0.004 0.000
#> GSM97036     5  0.5124      0.684 0.316 0.000 0.012 0.036 0.636
#> GSM97039     2  0.3165      0.906 0.000 0.848 0.000 0.116 0.036
#> GSM97046     2  0.3242      0.905 0.000 0.844 0.000 0.116 0.040
#> GSM97023     1  0.3123      0.740 0.828 0.000 0.000 0.012 0.160
#> GSM97029     5  0.4649      0.776 0.232 0.000 0.012 0.036 0.720
#> GSM97043     2  0.2868      0.868 0.000 0.884 0.072 0.012 0.032
#> GSM97013     5  0.4679      0.692 0.316 0.000 0.000 0.032 0.652
#> GSM96956     3  0.5859      0.570 0.000 0.168 0.676 0.116 0.040
#> GSM97024     2  0.0579      0.933 0.000 0.984 0.008 0.008 0.000
#> GSM97032     3  0.1538      0.839 0.000 0.008 0.948 0.008 0.036
#> GSM97044     3  0.1173      0.847 0.000 0.004 0.964 0.012 0.020
#> GSM97049     2  0.3242      0.905 0.000 0.844 0.000 0.116 0.040
#> GSM96968     3  0.1197      0.842 0.000 0.000 0.952 0.000 0.048
#> GSM96971     3  0.5312      0.693 0.008 0.000 0.628 0.308 0.056
#> GSM96986     3  0.4792      0.783 0.008 0.000 0.712 0.228 0.052
#> GSM97003     1  0.2787      0.708 0.856 0.000 0.004 0.136 0.004
#> GSM96957     5  0.3727      0.796 0.216 0.000 0.000 0.016 0.768
#> GSM96960     1  0.1121      0.761 0.956 0.000 0.000 0.044 0.000
#> GSM96975     5  0.3759      0.795 0.220 0.000 0.000 0.016 0.764
#> GSM96998     1  0.2193      0.800 0.912 0.000 0.000 0.028 0.060
#> GSM96999     5  0.4249      0.729 0.296 0.000 0.000 0.016 0.688
#> GSM97001     5  0.3039      0.820 0.152 0.000 0.000 0.012 0.836
#> GSM97005     5  0.2930      0.818 0.164 0.000 0.000 0.004 0.832
#> GSM97006     1  0.1121      0.761 0.956 0.000 0.000 0.044 0.000
#> GSM97021     5  0.2976      0.823 0.132 0.000 0.004 0.012 0.852
#> GSM97028     3  0.1364      0.846 0.000 0.000 0.952 0.012 0.036
#> GSM97031     1  0.4873      0.548 0.688 0.000 0.000 0.068 0.244
#> GSM97037     3  0.3937      0.752 0.000 0.072 0.832 0.052 0.044
#> GSM97018     3  0.1695      0.838 0.000 0.008 0.940 0.008 0.044
#> GSM97014     5  0.2337      0.746 0.004 0.080 0.004 0.008 0.904
#> GSM97042     2  0.0451      0.934 0.000 0.988 0.008 0.004 0.000
#> GSM97040     5  0.2813      0.796 0.064 0.000 0.048 0.004 0.884
#> GSM97041     5  0.2997      0.821 0.148 0.000 0.000 0.012 0.840
#> GSM96955     5  0.5192      0.214 0.000 0.388 0.032 0.008 0.572
#> GSM96990     3  0.1285      0.841 0.000 0.004 0.956 0.004 0.036
#> GSM96991     2  0.0451      0.934 0.000 0.988 0.008 0.004 0.000
#> GSM97048     2  0.3242      0.905 0.000 0.844 0.000 0.116 0.040
#> GSM96963     2  0.0613      0.934 0.000 0.984 0.008 0.004 0.004
#> GSM96953     2  0.0613      0.934 0.000 0.984 0.008 0.004 0.004
#> GSM96966     4  0.4138      0.797 0.384 0.000 0.000 0.616 0.000
#> GSM96979     3  0.4792      0.783 0.008 0.000 0.712 0.228 0.052
#> GSM96983     3  0.1331      0.845 0.000 0.000 0.952 0.040 0.008
#> GSM96984     3  0.4792      0.783 0.008 0.000 0.712 0.228 0.052
#> GSM96994     3  0.4764      0.784 0.008 0.000 0.716 0.224 0.052
#> GSM96996     1  0.1872      0.803 0.928 0.000 0.000 0.020 0.052
#> GSM96997     3  0.4898      0.781 0.012 0.000 0.708 0.228 0.052
#> GSM97007     3  0.4764      0.784 0.008 0.000 0.716 0.224 0.052
#> GSM96954     3  0.4045      0.813 0.004 0.000 0.796 0.136 0.064
#> GSM96962     3  0.4792      0.783 0.008 0.000 0.712 0.228 0.052
#> GSM96969     4  0.4138      0.797 0.384 0.000 0.000 0.616 0.000
#> GSM96970     4  0.4138      0.797 0.384 0.000 0.000 0.616 0.000
#> GSM96973     4  0.4138      0.797 0.384 0.000 0.000 0.616 0.000
#> GSM96976     4  0.4459      0.504 0.052 0.000 0.200 0.744 0.004
#> GSM96977     5  0.3405      0.815 0.104 0.000 0.036 0.012 0.848
#> GSM96995     3  0.1410      0.837 0.000 0.000 0.940 0.000 0.060
#> GSM97002     1  0.1408      0.766 0.948 0.000 0.000 0.044 0.008
#> GSM97009     5  0.2833      0.807 0.084 0.008 0.020 0.004 0.884
#> GSM97010     5  0.4315      0.730 0.276 0.000 0.000 0.024 0.700
#> GSM96974     4  0.5083      0.616 0.120 0.000 0.184 0.696 0.000
#> GSM96985     1  0.7043     -0.307 0.416 0.000 0.296 0.276 0.012
#> GSM96959     5  0.3895      0.470 0.000 0.000 0.320 0.000 0.680
#> GSM96972     4  0.4126      0.794 0.380 0.000 0.000 0.620 0.000
#> GSM96978     3  0.1740      0.842 0.000 0.000 0.932 0.056 0.012
#> GSM96967     4  0.4138      0.797 0.384 0.000 0.000 0.616 0.000
#> GSM96987     1  0.2423      0.794 0.896 0.000 0.000 0.024 0.080
#> GSM97011     5  0.2583      0.820 0.132 0.000 0.004 0.000 0.864
#> GSM96964     1  0.3602      0.719 0.796 0.000 0.000 0.024 0.180
#> GSM96965     4  0.5725      0.564 0.156 0.000 0.000 0.620 0.224
#> GSM96981     1  0.2270      0.800 0.904 0.000 0.000 0.020 0.076
#> GSM96982     1  0.1310      0.785 0.956 0.000 0.000 0.024 0.020
#> GSM96988     3  0.1872      0.843 0.000 0.000 0.928 0.052 0.020
#> GSM97000     5  0.2835      0.815 0.112 0.000 0.016 0.004 0.868
#> GSM97004     1  0.1341      0.752 0.944 0.000 0.000 0.056 0.000
#> GSM97008     5  0.2719      0.820 0.144 0.000 0.004 0.000 0.852
#> GSM96950     5  0.4975      0.688 0.316 0.000 0.012 0.028 0.644
#> GSM96980     1  0.4015     -0.132 0.652 0.000 0.000 0.348 0.000
#> GSM96989     1  0.2482      0.792 0.892 0.000 0.000 0.024 0.084
#> GSM96992     1  0.1469      0.799 0.948 0.000 0.000 0.016 0.036
#> GSM96993     5  0.5033      0.690 0.312 0.000 0.012 0.032 0.644
#> GSM96958     1  0.3419      0.722 0.804 0.000 0.000 0.016 0.180
#> GSM96951     1  0.2970      0.738 0.828 0.000 0.000 0.004 0.168
#> GSM96952     1  0.1251      0.801 0.956 0.000 0.000 0.008 0.036
#> GSM96961     1  0.1341      0.804 0.944 0.000 0.000 0.000 0.056

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.4853      0.821 0.008 0.716 0.012 0.060 0.012 0.192
#> GSM97045     2  0.0260      0.891 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM97047     5  0.2062      0.736 0.000 0.004 0.088 0.008 0.900 0.000
#> GSM97025     2  0.0260      0.891 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM97030     3  0.0862      0.730 0.000 0.004 0.972 0.000 0.008 0.016
#> GSM97027     2  0.0260      0.891 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM97033     2  0.4441      0.830 0.008 0.732 0.000 0.064 0.008 0.188
#> GSM97034     3  0.1406      0.739 0.000 0.004 0.952 0.020 0.008 0.016
#> GSM97020     2  0.4441      0.830 0.008 0.732 0.000 0.064 0.008 0.188
#> GSM97026     5  0.5108      0.716 0.012 0.008 0.112 0.036 0.732 0.100
#> GSM97012     2  0.0000      0.892 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97015     3  0.0551      0.739 0.000 0.004 0.984 0.004 0.008 0.000
#> GSM97016     2  0.4610      0.827 0.008 0.724 0.004 0.064 0.008 0.192
#> GSM97017     5  0.2862      0.764 0.052 0.000 0.000 0.020 0.872 0.056
#> GSM97019     2  0.0000      0.892 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97022     2  0.0000      0.892 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97035     2  0.0000      0.892 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97036     5  0.6906      0.450 0.300 0.000 0.016 0.056 0.468 0.160
#> GSM97039     2  0.4471      0.828 0.008 0.728 0.000 0.064 0.008 0.192
#> GSM97046     2  0.4610      0.827 0.008 0.724 0.004 0.064 0.008 0.192
#> GSM97023     1  0.3959      0.757 0.796 0.000 0.000 0.028 0.084 0.092
#> GSM97029     5  0.6563      0.569 0.228 0.000 0.012 0.056 0.544 0.160
#> GSM97043     2  0.2100      0.809 0.000 0.884 0.112 0.004 0.000 0.000
#> GSM97013     5  0.6508      0.494 0.288 0.000 0.004 0.048 0.500 0.160
#> GSM96956     3  0.5182      0.369 0.000 0.104 0.676 0.024 0.004 0.192
#> GSM97024     2  0.0146      0.890 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM97032     3  0.0665      0.739 0.000 0.004 0.980 0.008 0.008 0.000
#> GSM97044     3  0.0858      0.720 0.000 0.004 0.968 0.000 0.000 0.028
#> GSM97049     2  0.4610      0.827 0.008 0.724 0.004 0.064 0.008 0.192
#> GSM96968     3  0.1369      0.731 0.000 0.000 0.952 0.016 0.016 0.016
#> GSM96971     6  0.5373      0.779 0.000 0.000 0.384 0.100 0.004 0.512
#> GSM96986     6  0.3810      0.927 0.000 0.000 0.428 0.000 0.000 0.572
#> GSM97003     1  0.3964      0.646 0.724 0.000 0.000 0.044 0.000 0.232
#> GSM96957     5  0.4870      0.692 0.200 0.000 0.004 0.024 0.700 0.072
#> GSM96960     1  0.2826      0.757 0.856 0.000 0.000 0.092 0.000 0.052
#> GSM96975     5  0.4639      0.697 0.216 0.000 0.008 0.028 0.712 0.036
#> GSM96998     1  0.4014      0.741 0.784 0.000 0.000 0.036 0.044 0.136
#> GSM96999     5  0.5249      0.624 0.264 0.000 0.004 0.024 0.636 0.072
#> GSM97001     5  0.2001      0.776 0.068 0.000 0.000 0.008 0.912 0.012
#> GSM97005     5  0.2186      0.773 0.056 0.000 0.000 0.012 0.908 0.024
#> GSM97006     1  0.2837      0.758 0.856 0.000 0.000 0.088 0.000 0.056
#> GSM97021     5  0.2115      0.776 0.032 0.000 0.000 0.020 0.916 0.032
#> GSM97028     3  0.2190      0.705 0.000 0.000 0.908 0.044 0.008 0.040
#> GSM97031     1  0.6017      0.411 0.504 0.000 0.000 0.020 0.156 0.320
#> GSM97037     3  0.3161      0.612 0.000 0.028 0.852 0.016 0.008 0.096
#> GSM97018     3  0.1579      0.737 0.000 0.004 0.944 0.024 0.008 0.020
#> GSM97014     5  0.1368      0.769 0.004 0.016 0.012 0.008 0.956 0.004
#> GSM97042     2  0.0000      0.892 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97040     5  0.1007      0.764 0.000 0.000 0.044 0.000 0.956 0.000
#> GSM97041     5  0.2981      0.764 0.052 0.000 0.000 0.020 0.864 0.064
#> GSM96955     5  0.4897      0.552 0.000 0.208 0.044 0.028 0.704 0.016
#> GSM96990     3  0.0551      0.739 0.000 0.004 0.984 0.004 0.008 0.000
#> GSM96991     2  0.0146      0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM97048     2  0.4610      0.827 0.008 0.724 0.004 0.064 0.008 0.192
#> GSM96963     2  0.0146      0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM96953     2  0.0146      0.891 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM96966     4  0.2730      0.873 0.192 0.000 0.000 0.808 0.000 0.000
#> GSM96979     6  0.3817      0.930 0.000 0.000 0.432 0.000 0.000 0.568
#> GSM96983     3  0.2854      0.650 0.000 0.000 0.860 0.048 0.004 0.088
#> GSM96984     6  0.3975      0.936 0.000 0.000 0.452 0.004 0.000 0.544
#> GSM96994     6  0.3975      0.936 0.000 0.000 0.452 0.004 0.000 0.544
#> GSM96996     1  0.2782      0.792 0.876 0.000 0.000 0.024 0.032 0.068
#> GSM96997     6  0.3756      0.886 0.000 0.000 0.400 0.000 0.000 0.600
#> GSM97007     6  0.3975      0.936 0.000 0.000 0.452 0.004 0.000 0.544
#> GSM96954     3  0.4442     -0.720 0.000 0.000 0.536 0.020 0.004 0.440
#> GSM96962     6  0.3975      0.936 0.000 0.000 0.452 0.004 0.000 0.544
#> GSM96969     4  0.2730      0.873 0.192 0.000 0.000 0.808 0.000 0.000
#> GSM96970     4  0.2730      0.873 0.192 0.000 0.000 0.808 0.000 0.000
#> GSM96973     4  0.2730      0.873 0.192 0.000 0.000 0.808 0.000 0.000
#> GSM96976     4  0.3865      0.686 0.004 0.000 0.088 0.800 0.012 0.096
#> GSM96977     5  0.4015      0.768 0.044 0.000 0.052 0.036 0.820 0.048
#> GSM96995     3  0.1873      0.700 0.000 0.000 0.924 0.020 0.048 0.008
#> GSM97002     1  0.3128      0.761 0.848 0.000 0.000 0.088 0.012 0.052
#> GSM97009     5  0.1866      0.764 0.016 0.004 0.036 0.008 0.932 0.004
#> GSM97010     5  0.5925      0.633 0.212 0.000 0.020 0.044 0.628 0.096
#> GSM96974     4  0.3897      0.711 0.028 0.000 0.100 0.800 0.000 0.072
#> GSM96985     3  0.7423     -0.035 0.284 0.000 0.356 0.252 0.004 0.104
#> GSM96959     5  0.4071      0.556 0.000 0.000 0.248 0.020 0.716 0.016
#> GSM96972     4  0.2793      0.867 0.200 0.000 0.000 0.800 0.000 0.000
#> GSM96978     3  0.3248      0.592 0.000 0.000 0.828 0.052 0.004 0.116
#> GSM96967     4  0.2730      0.873 0.192 0.000 0.000 0.808 0.000 0.000
#> GSM96987     1  0.4232      0.717 0.772 0.000 0.000 0.044 0.052 0.132
#> GSM97011     5  0.1598      0.771 0.040 0.000 0.008 0.008 0.940 0.004
#> GSM96964     1  0.4850      0.684 0.732 0.000 0.004 0.044 0.088 0.132
#> GSM96965     4  0.3837      0.713 0.068 0.000 0.008 0.784 0.140 0.000
#> GSM96981     1  0.2113      0.794 0.916 0.000 0.004 0.028 0.044 0.008
#> GSM96982     1  0.1900      0.787 0.916 0.000 0.000 0.068 0.008 0.008
#> GSM96988     3  0.3017      0.621 0.000 0.000 0.848 0.052 0.004 0.096
#> GSM97000     5  0.1965      0.772 0.040 0.000 0.004 0.008 0.924 0.024
#> GSM97004     1  0.2747      0.757 0.860 0.000 0.000 0.096 0.000 0.044
#> GSM97008     5  0.1768      0.772 0.040 0.000 0.004 0.004 0.932 0.020
#> GSM96950     5  0.6594      0.470 0.300 0.000 0.004 0.052 0.484 0.160
#> GSM96980     1  0.3717      0.214 0.616 0.000 0.000 0.384 0.000 0.000
#> GSM96989     1  0.4372      0.714 0.768 0.000 0.004 0.044 0.052 0.132
#> GSM96992     1  0.1820      0.791 0.924 0.000 0.000 0.056 0.012 0.008
#> GSM96993     5  0.6881      0.459 0.300 0.000 0.016 0.056 0.472 0.156
#> GSM96958     1  0.4134      0.718 0.784 0.000 0.000 0.040 0.112 0.064
#> GSM96951     1  0.3097      0.779 0.856 0.000 0.000 0.028 0.080 0.036
#> GSM96952     1  0.1434      0.793 0.940 0.000 0.000 0.048 0.012 0.000
#> GSM96961     1  0.1874      0.796 0.928 0.000 0.000 0.028 0.028 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-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-kmeans-collect-classes

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

test_to_known_factors(res)
#>             n disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:kmeans 99         4.79e-06       0.212     5.56e-16   0.0326 2
#> MAD:kmeans 97         3.86e-05       0.294     5.38e-19   0.0178 3
#> MAD:kmeans 86         4.63e-05       0.238     4.32e-13   0.0220 4
#> MAD:kmeans 96         5.29e-05       0.214     2.61e-15   0.1319 5
#> MAD:kmeans 91         7.04e-05       0.388     1.34e-15   0.0362 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 21168 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.986       0.993         0.4998 0.500   0.500
#> 3 3 0.974           0.953       0.976         0.3071 0.788   0.600
#> 4 4 0.761           0.672       0.848         0.1403 0.844   0.585
#> 5 5 0.714           0.715       0.826         0.0631 0.879   0.584
#> 6 6 0.705           0.548       0.720         0.0399 0.977   0.894

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97038     2   0.000      0.989 0.000 1.000
#> GSM97045     2   0.000      0.989 0.000 1.000
#> GSM97047     2   0.000      0.989 0.000 1.000
#> GSM97025     2   0.000      0.989 0.000 1.000
#> GSM97030     2   0.000      0.989 0.000 1.000
#> GSM97027     2   0.000      0.989 0.000 1.000
#> GSM97033     2   0.000      0.989 0.000 1.000
#> GSM97034     2   0.000      0.989 0.000 1.000
#> GSM97020     2   0.000      0.989 0.000 1.000
#> GSM97026     2   0.000      0.989 0.000 1.000
#> GSM97012     2   0.000      0.989 0.000 1.000
#> GSM97015     2   0.000      0.989 0.000 1.000
#> GSM97016     2   0.000      0.989 0.000 1.000
#> GSM97017     1   0.000      0.997 1.000 0.000
#> GSM97019     2   0.000      0.989 0.000 1.000
#> GSM97022     2   0.000      0.989 0.000 1.000
#> GSM97035     2   0.000      0.989 0.000 1.000
#> GSM97036     1   0.000      0.997 1.000 0.000
#> GSM97039     2   0.000      0.989 0.000 1.000
#> GSM97046     2   0.000      0.989 0.000 1.000
#> GSM97023     1   0.000      0.997 1.000 0.000
#> GSM97029     1   0.000      0.997 1.000 0.000
#> GSM97043     2   0.000      0.989 0.000 1.000
#> GSM97013     1   0.000      0.997 1.000 0.000
#> GSM96956     2   0.000      0.989 0.000 1.000
#> GSM97024     2   0.000      0.989 0.000 1.000
#> GSM97032     2   0.000      0.989 0.000 1.000
#> GSM97044     2   0.000      0.989 0.000 1.000
#> GSM97049     2   0.000      0.989 0.000 1.000
#> GSM96968     1   0.644      0.801 0.836 0.164
#> GSM96971     1   0.000      0.997 1.000 0.000
#> GSM96986     1   0.000      0.997 1.000 0.000
#> GSM97003     1   0.000      0.997 1.000 0.000
#> GSM96957     1   0.000      0.997 1.000 0.000
#> GSM96960     1   0.000      0.997 1.000 0.000
#> GSM96975     1   0.000      0.997 1.000 0.000
#> GSM96998     1   0.000      0.997 1.000 0.000
#> GSM96999     1   0.000      0.997 1.000 0.000
#> GSM97001     1   0.000      0.997 1.000 0.000
#> GSM97005     1   0.000      0.997 1.000 0.000
#> GSM97006     1   0.000      0.997 1.000 0.000
#> GSM97021     1   0.000      0.997 1.000 0.000
#> GSM97028     2   0.518      0.870 0.116 0.884
#> GSM97031     1   0.000      0.997 1.000 0.000
#> GSM97037     2   0.000      0.989 0.000 1.000
#> GSM97018     2   0.000      0.989 0.000 1.000
#> GSM97014     2   0.000      0.989 0.000 1.000
#> GSM97042     2   0.000      0.989 0.000 1.000
#> GSM97040     2   0.000      0.989 0.000 1.000
#> GSM97041     1   0.000      0.997 1.000 0.000
#> GSM96955     2   0.000      0.989 0.000 1.000
#> GSM96990     2   0.000      0.989 0.000 1.000
#> GSM96991     2   0.000      0.989 0.000 1.000
#> GSM97048     2   0.000      0.989 0.000 1.000
#> GSM96963     2   0.000      0.989 0.000 1.000
#> GSM96953     2   0.000      0.989 0.000 1.000
#> GSM96966     1   0.000      0.997 1.000 0.000
#> GSM96979     1   0.000      0.997 1.000 0.000
#> GSM96983     2   0.000      0.989 0.000 1.000
#> GSM96984     2   0.469      0.888 0.100 0.900
#> GSM96994     2   0.000      0.989 0.000 1.000
#> GSM96996     1   0.000      0.997 1.000 0.000
#> GSM96997     1   0.000      0.997 1.000 0.000
#> GSM97007     2   0.000      0.989 0.000 1.000
#> GSM96954     1   0.000      0.997 1.000 0.000
#> GSM96962     1   0.000      0.997 1.000 0.000
#> GSM96969     1   0.000      0.997 1.000 0.000
#> GSM96970     1   0.000      0.997 1.000 0.000
#> GSM96973     1   0.000      0.997 1.000 0.000
#> GSM96976     2   0.000      0.989 0.000 1.000
#> GSM96977     1   0.000      0.997 1.000 0.000
#> GSM96995     2   0.000      0.989 0.000 1.000
#> GSM97002     1   0.000      0.997 1.000 0.000
#> GSM97009     2   0.000      0.989 0.000 1.000
#> GSM97010     1   0.000      0.997 1.000 0.000
#> GSM96974     1   0.000      0.997 1.000 0.000
#> GSM96985     1   0.000      0.997 1.000 0.000
#> GSM96959     2   0.000      0.989 0.000 1.000
#> GSM96972     1   0.000      0.997 1.000 0.000
#> GSM96978     2   0.821      0.662 0.256 0.744
#> GSM96967     1   0.000      0.997 1.000 0.000
#> GSM96987     1   0.000      0.997 1.000 0.000
#> GSM97011     1   0.118      0.981 0.984 0.016
#> GSM96964     1   0.000      0.997 1.000 0.000
#> GSM96965     1   0.000      0.997 1.000 0.000
#> GSM96981     1   0.000      0.997 1.000 0.000
#> GSM96982     1   0.000      0.997 1.000 0.000
#> GSM96988     1   0.000      0.997 1.000 0.000
#> GSM97000     1   0.000      0.997 1.000 0.000
#> GSM97004     1   0.000      0.997 1.000 0.000
#> GSM97008     1   0.000      0.997 1.000 0.000
#> GSM96950     1   0.000      0.997 1.000 0.000
#> GSM96980     1   0.000      0.997 1.000 0.000
#> GSM96989     1   0.000      0.997 1.000 0.000
#> GSM96992     1   0.000      0.997 1.000 0.000
#> GSM96993     1   0.000      0.997 1.000 0.000
#> GSM96958     1   0.000      0.997 1.000 0.000
#> GSM96951     1   0.000      0.997 1.000 0.000
#> GSM96952     1   0.000      0.997 1.000 0.000
#> GSM96961     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
#> GSM97038     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97045     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97047     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97025     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97030     3  0.2165      0.928 0.000 0.064 0.936
#> GSM97027     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97033     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97034     3  0.1964      0.934 0.000 0.056 0.944
#> GSM97020     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97026     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97012     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97015     3  0.1964      0.934 0.000 0.056 0.944
#> GSM97016     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97017     1  0.0000      0.981 1.000 0.000 0.000
#> GSM97019     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97022     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97035     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97036     1  0.0000      0.981 1.000 0.000 0.000
#> GSM97039     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97046     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97023     1  0.0000      0.981 1.000 0.000 0.000
#> GSM97029     1  0.0424      0.977 0.992 0.008 0.000
#> GSM97043     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97013     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96956     2  0.4235      0.787 0.000 0.824 0.176
#> GSM97024     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97032     3  0.4702      0.754 0.000 0.212 0.788
#> GSM97044     3  0.1753      0.938 0.000 0.048 0.952
#> GSM97049     2  0.0000      0.975 0.000 1.000 0.000
#> GSM96968     3  0.0237      0.959 0.004 0.000 0.996
#> GSM96971     3  0.0000      0.961 0.000 0.000 1.000
#> GSM96986     3  0.0000      0.961 0.000 0.000 1.000
#> GSM97003     1  0.0592      0.978 0.988 0.000 0.012
#> GSM96957     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96960     1  0.0592      0.978 0.988 0.000 0.012
#> GSM96975     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96998     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96999     1  0.0000      0.981 1.000 0.000 0.000
#> GSM97001     1  0.0000      0.981 1.000 0.000 0.000
#> GSM97005     1  0.0000      0.981 1.000 0.000 0.000
#> GSM97006     1  0.0424      0.979 0.992 0.000 0.008
#> GSM97021     1  0.0000      0.981 1.000 0.000 0.000
#> GSM97028     3  0.0000      0.961 0.000 0.000 1.000
#> GSM97031     1  0.0592      0.978 0.988 0.000 0.012
#> GSM97037     2  0.4504      0.759 0.000 0.804 0.196
#> GSM97018     3  0.3941      0.836 0.000 0.156 0.844
#> GSM97014     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97042     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97040     2  0.1411      0.938 0.036 0.964 0.000
#> GSM97041     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96955     2  0.0000      0.975 0.000 1.000 0.000
#> GSM96990     3  0.2165      0.928 0.000 0.064 0.936
#> GSM96991     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97048     2  0.0000      0.975 0.000 1.000 0.000
#> GSM96963     2  0.0000      0.975 0.000 1.000 0.000
#> GSM96953     2  0.0000      0.975 0.000 1.000 0.000
#> GSM96966     1  0.1753      0.957 0.952 0.000 0.048
#> GSM96979     3  0.0000      0.961 0.000 0.000 1.000
#> GSM96983     3  0.0000      0.961 0.000 0.000 1.000
#> GSM96984     3  0.0000      0.961 0.000 0.000 1.000
#> GSM96994     3  0.0000      0.961 0.000 0.000 1.000
#> GSM96996     1  0.0237      0.980 0.996 0.000 0.004
#> GSM96997     3  0.0000      0.961 0.000 0.000 1.000
#> GSM97007     3  0.0000      0.961 0.000 0.000 1.000
#> GSM96954     3  0.0000      0.961 0.000 0.000 1.000
#> GSM96962     3  0.0000      0.961 0.000 0.000 1.000
#> GSM96969     1  0.1753      0.957 0.952 0.000 0.048
#> GSM96970     1  0.1753      0.957 0.952 0.000 0.048
#> GSM96973     1  0.1753      0.957 0.952 0.000 0.048
#> GSM96976     3  0.1289      0.946 0.000 0.032 0.968
#> GSM96977     1  0.2448      0.922 0.924 0.000 0.076
#> GSM96995     3  0.0747      0.955 0.000 0.016 0.984
#> GSM97002     1  0.0424      0.979 0.992 0.000 0.008
#> GSM97009     2  0.0000      0.975 0.000 1.000 0.000
#> GSM97010     1  0.1765      0.961 0.956 0.004 0.040
#> GSM96974     3  0.0000      0.961 0.000 0.000 1.000
#> GSM96985     3  0.4178      0.778 0.172 0.000 0.828
#> GSM96959     2  0.5291      0.639 0.000 0.732 0.268
#> GSM96972     1  0.1753      0.957 0.952 0.000 0.048
#> GSM96978     3  0.0000      0.961 0.000 0.000 1.000
#> GSM96967     1  0.1753      0.957 0.952 0.000 0.048
#> GSM96987     1  0.0000      0.981 1.000 0.000 0.000
#> GSM97011     1  0.2448      0.914 0.924 0.076 0.000
#> GSM96964     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96965     1  0.1753      0.957 0.952 0.000 0.048
#> GSM96981     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96982     1  0.0237      0.980 0.996 0.000 0.004
#> GSM96988     3  0.0000      0.961 0.000 0.000 1.000
#> GSM97000     1  0.4974      0.693 0.764 0.000 0.236
#> GSM97004     1  0.0424      0.979 0.992 0.000 0.008
#> GSM97008     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96950     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96980     1  0.0592      0.978 0.988 0.000 0.012
#> GSM96989     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96992     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96993     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96958     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96951     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96952     1  0.0000      0.981 1.000 0.000 0.000
#> GSM96961     1  0.0000      0.981 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
#> GSM97038     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97045     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97047     2  0.4804      0.486 0.384 0.616 0.000 0.000
#> GSM97025     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97030     3  0.1743      0.903 0.004 0.056 0.940 0.000
#> GSM97027     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97033     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97034     3  0.1576      0.909 0.004 0.048 0.948 0.000
#> GSM97020     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97026     2  0.0921      0.924 0.028 0.972 0.000 0.000
#> GSM97012     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97015     3  0.1004      0.920 0.004 0.024 0.972 0.000
#> GSM97016     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97017     1  0.0188      0.692 0.996 0.000 0.000 0.004
#> GSM97019     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97036     1  0.4989      0.036 0.528 0.000 0.000 0.472
#> GSM97039     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97023     1  0.4941      0.169 0.564 0.000 0.000 0.436
#> GSM97029     1  0.4936      0.478 0.700 0.020 0.000 0.280
#> GSM97043     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97013     1  0.4406      0.453 0.700 0.000 0.000 0.300
#> GSM96956     2  0.4331      0.570 0.000 0.712 0.288 0.000
#> GSM97024     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97032     3  0.4584      0.589 0.004 0.300 0.696 0.000
#> GSM97044     3  0.0376      0.927 0.004 0.004 0.992 0.000
#> GSM97049     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM96968     3  0.0188      0.927 0.004 0.000 0.996 0.000
#> GSM96971     3  0.2081      0.877 0.000 0.000 0.916 0.084
#> GSM96986     3  0.0469      0.924 0.000 0.000 0.988 0.012
#> GSM97003     4  0.2675      0.681 0.100 0.000 0.008 0.892
#> GSM96957     1  0.0817      0.689 0.976 0.000 0.000 0.024
#> GSM96960     4  0.2011      0.688 0.080 0.000 0.000 0.920
#> GSM96975     4  0.4941      0.179 0.436 0.000 0.000 0.564
#> GSM96998     4  0.4643      0.420 0.344 0.000 0.000 0.656
#> GSM96999     1  0.4925      0.155 0.572 0.000 0.000 0.428
#> GSM97001     1  0.0188      0.692 0.996 0.000 0.000 0.004
#> GSM97005     1  0.0469      0.693 0.988 0.000 0.000 0.012
#> GSM97006     4  0.2647      0.669 0.120 0.000 0.000 0.880
#> GSM97021     1  0.0469      0.693 0.988 0.000 0.000 0.012
#> GSM97028     3  0.0376      0.927 0.004 0.004 0.992 0.000
#> GSM97031     1  0.5414      0.319 0.604 0.000 0.020 0.376
#> GSM97037     2  0.4800      0.451 0.004 0.656 0.340 0.000
#> GSM97018     3  0.4188      0.687 0.004 0.244 0.752 0.000
#> GSM97014     1  0.4977     -0.192 0.540 0.460 0.000 0.000
#> GSM97042     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97040     1  0.1118      0.667 0.964 0.036 0.000 0.000
#> GSM97041     1  0.0188      0.692 0.996 0.000 0.000 0.004
#> GSM96955     2  0.1792      0.890 0.068 0.932 0.000 0.000
#> GSM96990     3  0.1978      0.894 0.004 0.068 0.928 0.000
#> GSM96991     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM97048     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000      0.943 0.000 1.000 0.000 0.000
#> GSM96966     4  0.0188      0.688 0.000 0.000 0.004 0.996
#> GSM96979     3  0.2345      0.855 0.000 0.000 0.900 0.100
#> GSM96983     3  0.0000      0.928 0.000 0.000 1.000 0.000
#> GSM96984     3  0.0000      0.928 0.000 0.000 1.000 0.000
#> GSM96994     3  0.0000      0.928 0.000 0.000 1.000 0.000
#> GSM96996     4  0.2345      0.680 0.100 0.000 0.000 0.900
#> GSM96997     3  0.0336      0.926 0.000 0.000 0.992 0.008
#> GSM97007     3  0.0000      0.928 0.000 0.000 1.000 0.000
#> GSM96954     3  0.0188      0.927 0.004 0.000 0.996 0.000
#> GSM96962     3  0.0000      0.928 0.000 0.000 1.000 0.000
#> GSM96969     4  0.0188      0.688 0.000 0.000 0.004 0.996
#> GSM96970     4  0.0188      0.688 0.000 0.000 0.004 0.996
#> GSM96973     4  0.0188      0.688 0.000 0.000 0.004 0.996
#> GSM96976     4  0.7171     -0.148 0.000 0.136 0.400 0.464
#> GSM96977     1  0.5025      0.518 0.716 0.000 0.032 0.252
#> GSM96995     3  0.0921      0.919 0.028 0.000 0.972 0.000
#> GSM97002     4  0.2011      0.687 0.080 0.000 0.000 0.920
#> GSM97009     2  0.4431      0.614 0.304 0.696 0.000 0.000
#> GSM97010     4  0.2353      0.654 0.056 0.012 0.008 0.924
#> GSM96974     4  0.4855      0.112 0.000 0.000 0.400 0.600
#> GSM96985     4  0.2647      0.590 0.000 0.000 0.120 0.880
#> GSM96959     3  0.7344      0.286 0.380 0.160 0.460 0.000
#> GSM96972     4  0.0188      0.688 0.000 0.000 0.004 0.996
#> GSM96978     3  0.0188      0.927 0.000 0.000 0.996 0.004
#> GSM96967     4  0.0188      0.688 0.000 0.000 0.004 0.996
#> GSM96987     4  0.4948      0.227 0.440 0.000 0.000 0.560
#> GSM97011     1  0.1174      0.685 0.968 0.012 0.000 0.020
#> GSM96964     4  0.4972      0.181 0.456 0.000 0.000 0.544
#> GSM96965     4  0.0895      0.682 0.020 0.000 0.004 0.976
#> GSM96981     4  0.3528      0.604 0.192 0.000 0.000 0.808
#> GSM96982     4  0.1302      0.691 0.044 0.000 0.000 0.956
#> GSM96988     3  0.0592      0.923 0.000 0.000 0.984 0.016
#> GSM97000     1  0.1767      0.665 0.944 0.000 0.044 0.012
#> GSM97004     4  0.1867      0.689 0.072 0.000 0.000 0.928
#> GSM97008     1  0.0469      0.693 0.988 0.000 0.000 0.012
#> GSM96950     1  0.4955      0.129 0.556 0.000 0.000 0.444
#> GSM96980     4  0.0000      0.688 0.000 0.000 0.000 1.000
#> GSM96989     4  0.4948      0.227 0.440 0.000 0.000 0.560
#> GSM96992     4  0.4776      0.354 0.376 0.000 0.000 0.624
#> GSM96993     1  0.4933      0.165 0.568 0.000 0.000 0.432
#> GSM96958     4  0.4972      0.166 0.456 0.000 0.000 0.544
#> GSM96951     4  0.4992      0.104 0.476 0.000 0.000 0.524
#> GSM96952     4  0.4888      0.282 0.412 0.000 0.000 0.588
#> GSM96961     4  0.4955      0.204 0.444 0.000 0.000 0.556

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97038     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97045     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97047     5  0.4232     0.5622 0.000 0.312 0.012 0.000 0.676
#> GSM97025     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97030     3  0.2077     0.7974 0.000 0.084 0.908 0.000 0.008
#> GSM97027     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97033     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97034     3  0.3163     0.7590 0.004 0.124 0.852 0.008 0.012
#> GSM97020     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97026     2  0.3639     0.7975 0.044 0.848 0.020 0.004 0.084
#> GSM97012     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97015     3  0.1173     0.8276 0.000 0.020 0.964 0.004 0.012
#> GSM97016     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97017     5  0.3048     0.7546 0.176 0.000 0.000 0.004 0.820
#> GSM97019     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97022     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97035     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97036     1  0.3229     0.6500 0.840 0.000 0.000 0.032 0.128
#> GSM97039     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97046     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97023     1  0.3226     0.6880 0.852 0.000 0.000 0.060 0.088
#> GSM97029     1  0.4265     0.4884 0.712 0.012 0.000 0.008 0.268
#> GSM97043     2  0.0290     0.9381 0.000 0.992 0.008 0.000 0.000
#> GSM97013     1  0.3388     0.5655 0.792 0.000 0.000 0.008 0.200
#> GSM96956     2  0.4225     0.4052 0.000 0.632 0.364 0.000 0.004
#> GSM97024     2  0.0324     0.9377 0.000 0.992 0.004 0.000 0.004
#> GSM97032     3  0.4403     0.4475 0.000 0.340 0.648 0.004 0.008
#> GSM97044     3  0.0290     0.8317 0.000 0.000 0.992 0.000 0.008
#> GSM97049     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM96968     3  0.1372     0.8353 0.004 0.000 0.956 0.016 0.024
#> GSM96971     3  0.4953     0.4462 0.000 0.000 0.532 0.440 0.028
#> GSM96986     3  0.3844     0.8170 0.000 0.000 0.792 0.164 0.044
#> GSM97003     1  0.6102     0.2965 0.488 0.000 0.020 0.420 0.072
#> GSM96957     1  0.4310     0.2622 0.604 0.000 0.000 0.004 0.392
#> GSM96960     1  0.4851     0.4569 0.624 0.000 0.000 0.340 0.036
#> GSM96975     1  0.6227     0.4263 0.536 0.000 0.000 0.280 0.184
#> GSM96998     1  0.2079     0.6801 0.916 0.000 0.000 0.064 0.020
#> GSM96999     1  0.4350     0.6633 0.764 0.000 0.000 0.084 0.152
#> GSM97001     5  0.3160     0.7401 0.188 0.000 0.000 0.004 0.808
#> GSM97005     5  0.2179     0.7919 0.112 0.000 0.000 0.000 0.888
#> GSM97006     1  0.4822     0.5289 0.664 0.000 0.000 0.288 0.048
#> GSM97021     5  0.2424     0.7844 0.132 0.000 0.000 0.000 0.868
#> GSM97028     3  0.1168     0.8387 0.000 0.000 0.960 0.032 0.008
#> GSM97031     1  0.7208     0.4013 0.452 0.000 0.036 0.192 0.320
#> GSM97037     2  0.4542     0.1416 0.000 0.536 0.456 0.000 0.008
#> GSM97018     3  0.4893     0.3930 0.000 0.360 0.612 0.012 0.016
#> GSM97014     5  0.2930     0.7376 0.000 0.164 0.000 0.004 0.832
#> GSM97042     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97040     5  0.1764     0.8021 0.036 0.012 0.012 0.000 0.940
#> GSM97041     5  0.3461     0.7124 0.224 0.000 0.000 0.004 0.772
#> GSM96955     2  0.2813     0.7463 0.000 0.832 0.000 0.000 0.168
#> GSM96990     3  0.1894     0.8050 0.000 0.072 0.920 0.000 0.008
#> GSM96991     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM97048     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM96963     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM96953     2  0.0000     0.9439 0.000 1.000 0.000 0.000 0.000
#> GSM96966     4  0.2773     0.8285 0.164 0.000 0.000 0.836 0.000
#> GSM96979     3  0.4477     0.7498 0.000 0.000 0.708 0.252 0.040
#> GSM96983     3  0.1124     0.8400 0.000 0.000 0.960 0.036 0.004
#> GSM96984     3  0.3409     0.8305 0.000 0.000 0.824 0.144 0.032
#> GSM96994     3  0.3283     0.8323 0.000 0.000 0.832 0.140 0.028
#> GSM96996     1  0.4522     0.5017 0.660 0.000 0.000 0.316 0.024
#> GSM96997     3  0.3973     0.8158 0.008 0.000 0.792 0.164 0.036
#> GSM97007     3  0.3409     0.8305 0.000 0.000 0.824 0.144 0.032
#> GSM96954     3  0.2359     0.8423 0.000 0.000 0.904 0.060 0.036
#> GSM96962     3  0.3409     0.8305 0.000 0.000 0.824 0.144 0.032
#> GSM96969     4  0.2773     0.8285 0.164 0.000 0.000 0.836 0.000
#> GSM96970     4  0.2732     0.8300 0.160 0.000 0.000 0.840 0.000
#> GSM96973     4  0.2732     0.8300 0.160 0.000 0.000 0.840 0.000
#> GSM96976     4  0.2678     0.6372 0.000 0.016 0.100 0.880 0.004
#> GSM96977     1  0.7265    -0.0745 0.408 0.000 0.056 0.140 0.396
#> GSM96995     3  0.2237     0.8051 0.000 0.004 0.904 0.008 0.084
#> GSM97002     1  0.4768     0.3768 0.592 0.000 0.000 0.384 0.024
#> GSM97009     5  0.4613     0.3582 0.004 0.408 0.000 0.008 0.580
#> GSM97010     4  0.5152     0.4625 0.344 0.004 0.000 0.608 0.044
#> GSM96974     4  0.2574     0.6788 0.012 0.000 0.112 0.876 0.000
#> GSM96985     4  0.4022     0.7339 0.100 0.000 0.092 0.804 0.004
#> GSM96959     5  0.5155     0.5357 0.000 0.056 0.276 0.008 0.660
#> GSM96972     4  0.2773     0.8285 0.164 0.000 0.000 0.836 0.000
#> GSM96978     3  0.2753     0.8314 0.000 0.000 0.856 0.136 0.008
#> GSM96967     4  0.2732     0.8300 0.160 0.000 0.000 0.840 0.000
#> GSM96987     1  0.1399     0.6810 0.952 0.000 0.000 0.020 0.028
#> GSM97011     5  0.1877     0.7979 0.064 0.000 0.000 0.012 0.924
#> GSM96964     1  0.1251     0.6817 0.956 0.000 0.000 0.008 0.036
#> GSM96965     4  0.3280     0.8042 0.176 0.000 0.000 0.812 0.012
#> GSM96981     1  0.5232     0.4409 0.600 0.000 0.000 0.340 0.060
#> GSM96982     1  0.4961     0.1892 0.524 0.000 0.000 0.448 0.028
#> GSM96988     3  0.3552     0.8141 0.012 0.000 0.812 0.164 0.012
#> GSM97000     5  0.1924     0.7923 0.064 0.000 0.008 0.004 0.924
#> GSM97004     1  0.4524     0.4756 0.644 0.000 0.000 0.336 0.020
#> GSM97008     5  0.1732     0.7962 0.080 0.000 0.000 0.000 0.920
#> GSM96950     1  0.2674     0.6554 0.868 0.000 0.000 0.012 0.120
#> GSM96980     4  0.3876     0.5641 0.316 0.000 0.000 0.684 0.000
#> GSM96989     1  0.1403     0.6806 0.952 0.000 0.000 0.024 0.024
#> GSM96992     1  0.3929     0.6232 0.764 0.000 0.000 0.208 0.028
#> GSM96993     1  0.2286     0.6552 0.888 0.000 0.000 0.004 0.108
#> GSM96958     1  0.3702     0.6825 0.820 0.000 0.000 0.084 0.096
#> GSM96951     1  0.3644     0.6875 0.824 0.000 0.000 0.080 0.096
#> GSM96952     1  0.3452     0.6594 0.820 0.000 0.000 0.148 0.032
#> GSM96961     1  0.2491     0.6864 0.896 0.000 0.000 0.068 0.036

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.2144    0.90283 0.000 0.908 0.012 0.004 0.008 0.068
#> GSM97045     2  0.0603    0.91922 0.000 0.980 0.000 0.000 0.004 0.016
#> GSM97047     5  0.4268    0.65054 0.000 0.220 0.020 0.004 0.728 0.028
#> GSM97025     2  0.0146    0.91916 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM97030     3  0.1333    0.48828 0.000 0.048 0.944 0.000 0.000 0.008
#> GSM97027     2  0.0363    0.91964 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM97033     2  0.1621    0.91242 0.000 0.936 0.008 0.004 0.004 0.048
#> GSM97034     3  0.3636    0.45197 0.000 0.128 0.804 0.004 0.004 0.060
#> GSM97020     2  0.1863    0.90943 0.000 0.924 0.008 0.004 0.008 0.056
#> GSM97026     2  0.5823    0.59429 0.056 0.688 0.044 0.004 0.080 0.128
#> GSM97012     2  0.0000    0.91940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97015     3  0.1092    0.48429 0.000 0.020 0.960 0.000 0.000 0.020
#> GSM97016     2  0.2144    0.90478 0.000 0.908 0.012 0.004 0.008 0.068
#> GSM97017     5  0.4279    0.67130 0.140 0.000 0.000 0.000 0.732 0.128
#> GSM97019     2  0.0000    0.91940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97022     2  0.0000    0.91940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97035     2  0.0260    0.92051 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM97036     1  0.5393    0.46505 0.656 0.004 0.004 0.024 0.096 0.216
#> GSM97039     2  0.1985    0.90688 0.000 0.916 0.008 0.004 0.008 0.064
#> GSM97046     2  0.2202    0.90306 0.000 0.904 0.012 0.004 0.008 0.072
#> GSM97023     1  0.4592    0.62260 0.756 0.000 0.000 0.084 0.088 0.072
#> GSM97029     1  0.6039    0.31976 0.572 0.028 0.004 0.000 0.184 0.212
#> GSM97043     2  0.0806    0.91269 0.000 0.972 0.020 0.000 0.000 0.008
#> GSM97013     1  0.5096    0.41145 0.652 0.000 0.000 0.008 0.136 0.204
#> GSM96956     2  0.5223    0.21656 0.000 0.508 0.416 0.004 0.004 0.068
#> GSM97024     2  0.0692    0.91255 0.000 0.976 0.020 0.000 0.000 0.004
#> GSM97032     3  0.3608    0.36177 0.000 0.272 0.716 0.000 0.000 0.012
#> GSM97044     3  0.1151    0.46573 0.000 0.012 0.956 0.000 0.000 0.032
#> GSM97049     2  0.2101    0.90495 0.000 0.908 0.008 0.004 0.008 0.072
#> GSM96968     3  0.3657    0.36890 0.012 0.000 0.788 0.024 0.004 0.172
#> GSM96971     6  0.6205    0.31595 0.000 0.000 0.276 0.340 0.004 0.380
#> GSM96986     6  0.4211    0.58418 0.000 0.000 0.456 0.004 0.008 0.532
#> GSM97003     1  0.6827    0.29464 0.412 0.000 0.008 0.264 0.032 0.284
#> GSM96957     1  0.5914    0.29320 0.556 0.000 0.000 0.028 0.272 0.144
#> GSM96960     1  0.5211    0.45565 0.580 0.000 0.000 0.340 0.024 0.056
#> GSM96975     1  0.7027    0.37078 0.412 0.000 0.000 0.288 0.220 0.080
#> GSM96998     1  0.3857    0.61656 0.788 0.000 0.000 0.112 0.008 0.092
#> GSM96999     1  0.5693    0.57692 0.656 0.000 0.000 0.100 0.124 0.120
#> GSM97001     5  0.4389    0.66687 0.168 0.000 0.000 0.012 0.736 0.084
#> GSM97005     5  0.2866    0.74418 0.084 0.000 0.000 0.004 0.860 0.052
#> GSM97006     1  0.5419    0.48491 0.588 0.000 0.000 0.308 0.028 0.076
#> GSM97021     5  0.3472    0.73041 0.092 0.000 0.000 0.000 0.808 0.100
#> GSM97028     3  0.2362    0.42165 0.000 0.000 0.860 0.004 0.000 0.136
#> GSM97031     1  0.7904    0.29290 0.324 0.000 0.016 0.164 0.220 0.276
#> GSM97037     3  0.4756    0.26349 0.000 0.332 0.608 0.000 0.004 0.056
#> GSM97018     3  0.4460    0.39852 0.000 0.200 0.728 0.004 0.020 0.048
#> GSM97014     5  0.3780    0.73587 0.020 0.096 0.000 0.004 0.812 0.068
#> GSM97042     2  0.0000    0.91940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97040     5  0.2421    0.76526 0.028 0.004 0.032 0.000 0.904 0.032
#> GSM97041     5  0.5198    0.53592 0.240 0.000 0.000 0.000 0.608 0.152
#> GSM96955     2  0.5224    0.58674 0.000 0.668 0.020 0.012 0.220 0.080
#> GSM96990     3  0.2003    0.48587 0.000 0.044 0.912 0.000 0.000 0.044
#> GSM96991     2  0.0000    0.91940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97048     2  0.2101    0.90495 0.000 0.908 0.008 0.004 0.008 0.072
#> GSM96963     2  0.0363    0.92036 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM96953     2  0.0458    0.92034 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM96966     4  0.1010    0.81879 0.036 0.000 0.000 0.960 0.000 0.004
#> GSM96979     6  0.4857    0.60891 0.000 0.000 0.408 0.060 0.000 0.532
#> GSM96983     3  0.2491    0.34454 0.000 0.000 0.836 0.000 0.000 0.164
#> GSM96984     3  0.3868   -0.60291 0.000 0.000 0.504 0.000 0.000 0.496
#> GSM96994     3  0.3867   -0.58770 0.000 0.000 0.512 0.000 0.000 0.488
#> GSM96996     1  0.5225    0.50398 0.608 0.000 0.000 0.292 0.016 0.084
#> GSM96997     6  0.4306    0.57317 0.012 0.000 0.464 0.004 0.000 0.520
#> GSM97007     3  0.3857   -0.55316 0.000 0.000 0.532 0.000 0.000 0.468
#> GSM96954     3  0.4261   -0.20894 0.004 0.000 0.620 0.008 0.008 0.360
#> GSM96962     3  0.3868   -0.59679 0.000 0.000 0.508 0.000 0.000 0.492
#> GSM96969     4  0.1219    0.80792 0.048 0.000 0.000 0.948 0.000 0.004
#> GSM96970     4  0.1010    0.81879 0.036 0.000 0.000 0.960 0.000 0.004
#> GSM96973     4  0.1010    0.81879 0.036 0.000 0.000 0.960 0.000 0.004
#> GSM96976     4  0.3737    0.60978 0.000 0.008 0.036 0.772 0.000 0.184
#> GSM96977     1  0.7878   -0.00192 0.384 0.000 0.052 0.100 0.296 0.168
#> GSM96995     3  0.3864    0.40139 0.000 0.000 0.796 0.016 0.096 0.092
#> GSM97002     1  0.4992    0.41397 0.564 0.000 0.000 0.376 0.016 0.044
#> GSM97009     5  0.5762    0.40123 0.004 0.320 0.008 0.008 0.552 0.108
#> GSM97010     4  0.6663    0.12895 0.296 0.000 0.004 0.400 0.024 0.276
#> GSM96974     4  0.3295    0.67808 0.000 0.000 0.056 0.816 0.000 0.128
#> GSM96985     4  0.4584    0.70550 0.080 0.000 0.036 0.752 0.004 0.128
#> GSM96959     5  0.5766    0.49469 0.000 0.008 0.256 0.016 0.588 0.132
#> GSM96972     4  0.1082    0.81360 0.040 0.000 0.000 0.956 0.000 0.004
#> GSM96978     3  0.4593   -0.08619 0.000 0.000 0.620 0.056 0.000 0.324
#> GSM96967     4  0.1010    0.81879 0.036 0.000 0.000 0.960 0.000 0.004
#> GSM96987     1  0.3507    0.59743 0.816 0.000 0.000 0.044 0.016 0.124
#> GSM97011     5  0.1649    0.76012 0.036 0.000 0.000 0.000 0.932 0.032
#> GSM96964     1  0.3337    0.60111 0.832 0.000 0.000 0.032 0.024 0.112
#> GSM96965     4  0.1887    0.79305 0.048 0.000 0.000 0.924 0.012 0.016
#> GSM96981     1  0.5768    0.42537 0.528 0.000 0.000 0.356 0.068 0.048
#> GSM96982     1  0.5063    0.28897 0.496 0.000 0.000 0.448 0.024 0.032
#> GSM96988     3  0.5125   -0.02934 0.008 0.000 0.612 0.076 0.004 0.300
#> GSM97000     5  0.2468    0.75035 0.016 0.000 0.008 0.000 0.880 0.096
#> GSM97004     1  0.4864    0.42356 0.576 0.000 0.000 0.372 0.016 0.036
#> GSM97008     5  0.2471    0.74174 0.052 0.000 0.000 0.004 0.888 0.056
#> GSM96950     1  0.4331    0.49844 0.728 0.000 0.000 0.008 0.072 0.192
#> GSM96980     4  0.3915    0.37498 0.288 0.000 0.000 0.692 0.004 0.016
#> GSM96989     1  0.3310    0.60068 0.832 0.000 0.000 0.040 0.016 0.112
#> GSM96992     1  0.4920    0.55063 0.668 0.000 0.000 0.248 0.044 0.040
#> GSM96993     1  0.4898    0.47643 0.692 0.000 0.004 0.020 0.076 0.208
#> GSM96958     1  0.5052    0.61055 0.716 0.000 0.000 0.116 0.084 0.084
#> GSM96951     1  0.4962    0.61307 0.720 0.000 0.000 0.124 0.096 0.060
#> GSM96952     1  0.4377    0.58214 0.728 0.000 0.000 0.204 0.040 0.028
#> GSM96961     1  0.3258    0.61753 0.832 0.000 0.000 0.120 0.032 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-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-skmeans-collect-classes

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

test_to_known_factors(res)
#>               n disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:skmeans 100         9.36e-05       0.173     5.21e-13   0.0903 2
#> MAD:skmeans 100         1.14e-04       0.290     6.36e-17   0.0685 3
#> MAD:skmeans  76         7.71e-05       0.481     5.77e-13   0.0246 4
#> MAD:skmeans  82         2.08e-05       0.437     4.16e-16   0.0648 5
#> MAD:skmeans  59         6.82e-05       0.421     1.51e-15   0.1276 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 21168 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.898           0.946       0.971         0.4625 0.540   0.540
#> 3 3 0.473           0.503       0.752         0.3681 0.757   0.569
#> 4 4 0.580           0.654       0.809         0.1546 0.812   0.529
#> 5 5 0.699           0.774       0.837         0.0753 0.874   0.583
#> 6 6 0.723           0.598       0.750         0.0516 0.950   0.767

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
#> GSM97038     2  0.0000      0.971 0.000 1.000
#> GSM97045     2  0.0000      0.971 0.000 1.000
#> GSM97047     2  0.4690      0.876 0.100 0.900
#> GSM97025     2  0.0000      0.971 0.000 1.000
#> GSM97030     2  0.0000      0.971 0.000 1.000
#> GSM97027     2  0.0000      0.971 0.000 1.000
#> GSM97033     2  0.0000      0.971 0.000 1.000
#> GSM97034     2  0.0000      0.971 0.000 1.000
#> GSM97020     2  0.0000      0.971 0.000 1.000
#> GSM97026     2  0.0000      0.971 0.000 1.000
#> GSM97012     2  0.0000      0.971 0.000 1.000
#> GSM97015     2  0.0672      0.966 0.008 0.992
#> GSM97016     2  0.0000      0.971 0.000 1.000
#> GSM97017     1  0.0672      0.968 0.992 0.008
#> GSM97019     2  0.0000      0.971 0.000 1.000
#> GSM97022     2  0.0000      0.971 0.000 1.000
#> GSM97035     2  0.0000      0.971 0.000 1.000
#> GSM97036     1  0.7453      0.763 0.788 0.212
#> GSM97039     2  0.0000      0.971 0.000 1.000
#> GSM97046     2  0.0000      0.971 0.000 1.000
#> GSM97023     1  0.0000      0.970 1.000 0.000
#> GSM97029     1  0.1843      0.960 0.972 0.028
#> GSM97043     2  0.0000      0.971 0.000 1.000
#> GSM97013     1  0.8081      0.686 0.752 0.248
#> GSM96956     2  0.0000      0.971 0.000 1.000
#> GSM97024     2  0.0000      0.971 0.000 1.000
#> GSM97032     2  0.0000      0.971 0.000 1.000
#> GSM97044     2  0.0000      0.971 0.000 1.000
#> GSM97049     2  0.0000      0.971 0.000 1.000
#> GSM96968     1  0.2423      0.954 0.960 0.040
#> GSM96971     1  0.1184      0.966 0.984 0.016
#> GSM96986     1  0.0000      0.970 1.000 0.000
#> GSM97003     1  0.0000      0.970 1.000 0.000
#> GSM96957     1  0.0000      0.970 1.000 0.000
#> GSM96960     1  0.0000      0.970 1.000 0.000
#> GSM96975     1  0.0000      0.970 1.000 0.000
#> GSM96998     1  0.0000      0.970 1.000 0.000
#> GSM96999     1  0.0000      0.970 1.000 0.000
#> GSM97001     1  0.0000      0.970 1.000 0.000
#> GSM97005     1  0.0000      0.970 1.000 0.000
#> GSM97006     1  0.0000      0.970 1.000 0.000
#> GSM97021     1  0.0376      0.969 0.996 0.004
#> GSM97028     1  0.1843      0.962 0.972 0.028
#> GSM97031     1  0.0000      0.970 1.000 0.000
#> GSM97037     2  0.0000      0.971 0.000 1.000
#> GSM97018     2  0.2948      0.927 0.052 0.948
#> GSM97014     1  0.7745      0.749 0.772 0.228
#> GSM97042     2  0.0000      0.971 0.000 1.000
#> GSM97040     1  0.3431      0.938 0.936 0.064
#> GSM97041     1  0.5178      0.876 0.884 0.116
#> GSM96955     1  0.5519      0.876 0.872 0.128
#> GSM96990     2  0.0376      0.969 0.004 0.996
#> GSM96991     2  0.0000      0.971 0.000 1.000
#> GSM97048     2  0.0000      0.971 0.000 1.000
#> GSM96963     2  0.0000      0.971 0.000 1.000
#> GSM96953     2  0.0000      0.971 0.000 1.000
#> GSM96966     1  0.0000      0.970 1.000 0.000
#> GSM96979     1  0.1184      0.966 0.984 0.016
#> GSM96983     2  0.8207      0.668 0.256 0.744
#> GSM96984     2  0.9044      0.547 0.320 0.680
#> GSM96994     1  0.3584      0.934 0.932 0.068
#> GSM96996     1  0.0000      0.970 1.000 0.000
#> GSM96997     1  0.0938      0.967 0.988 0.012
#> GSM97007     2  0.7139      0.765 0.196 0.804
#> GSM96954     1  0.1184      0.966 0.984 0.016
#> GSM96962     1  0.1184      0.966 0.984 0.016
#> GSM96969     1  0.0000      0.970 1.000 0.000
#> GSM96970     1  0.0000      0.970 1.000 0.000
#> GSM96973     1  0.0000      0.970 1.000 0.000
#> GSM96976     1  0.3733      0.931 0.928 0.072
#> GSM96977     1  0.1184      0.966 0.984 0.016
#> GSM96995     1  0.3114      0.943 0.944 0.056
#> GSM97002     1  0.0000      0.970 1.000 0.000
#> GSM97009     1  0.7219      0.789 0.800 0.200
#> GSM97010     1  0.2948      0.947 0.948 0.052
#> GSM96974     1  0.2423      0.954 0.960 0.040
#> GSM96985     1  0.1184      0.966 0.984 0.016
#> GSM96959     1  0.3431      0.938 0.936 0.064
#> GSM96972     1  0.0000      0.970 1.000 0.000
#> GSM96978     1  0.1633      0.963 0.976 0.024
#> GSM96967     1  0.0000      0.970 1.000 0.000
#> GSM96987     1  0.0000      0.970 1.000 0.000
#> GSM97011     1  0.2043      0.959 0.968 0.032
#> GSM96964     1  0.0000      0.970 1.000 0.000
#> GSM96965     1  0.3274      0.940 0.940 0.060
#> GSM96981     1  0.0000      0.970 1.000 0.000
#> GSM96982     1  0.0000      0.970 1.000 0.000
#> GSM96988     1  0.1184      0.966 0.984 0.016
#> GSM97000     1  0.0000      0.970 1.000 0.000
#> GSM97004     1  0.0000      0.970 1.000 0.000
#> GSM97008     1  0.0000      0.970 1.000 0.000
#> GSM96950     1  0.0376      0.969 0.996 0.004
#> GSM96980     1  0.0000      0.970 1.000 0.000
#> GSM96989     1  0.0000      0.970 1.000 0.000
#> GSM96992     1  0.0000      0.970 1.000 0.000
#> GSM96993     1  0.2236      0.958 0.964 0.036
#> GSM96958     1  0.0000      0.970 1.000 0.000
#> GSM96951     1  0.0000      0.970 1.000 0.000
#> GSM96952     1  0.0000      0.970 1.000 0.000
#> GSM96961     1  0.0000      0.970 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
#> GSM97038     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97045     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97047     2  0.5178     0.7562 0.000 0.744 0.256
#> GSM97025     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97030     2  0.5363     0.7533 0.000 0.724 0.276
#> GSM97027     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97033     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97034     2  0.5138     0.7727 0.000 0.748 0.252
#> GSM97020     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97026     2  0.0747     0.8838 0.000 0.984 0.016
#> GSM97012     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97015     2  0.5733     0.7075 0.000 0.676 0.324
#> GSM97016     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97017     3  0.6527     0.3825 0.320 0.020 0.660
#> GSM97019     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97022     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97035     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97036     3  0.7699     0.3762 0.116 0.212 0.672
#> GSM97039     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97046     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97023     1  0.5560     0.5263 0.700 0.000 0.300
#> GSM97029     3  0.7140     0.3689 0.328 0.040 0.632
#> GSM97043     2  0.2261     0.8673 0.000 0.932 0.068
#> GSM97013     1  0.9857     0.2090 0.416 0.276 0.308
#> GSM96956     2  0.4605     0.8011 0.000 0.796 0.204
#> GSM97024     2  0.2261     0.8682 0.000 0.932 0.068
#> GSM97032     2  0.4605     0.8011 0.000 0.796 0.204
#> GSM97044     2  0.5859     0.6947 0.000 0.656 0.344
#> GSM97049     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM96968     3  0.4062     0.5341 0.164 0.000 0.836
#> GSM96971     3  0.5733     0.2187 0.324 0.000 0.676
#> GSM96986     3  0.2261     0.4919 0.068 0.000 0.932
#> GSM97003     3  0.5621     0.4352 0.308 0.000 0.692
#> GSM96957     3  0.5178     0.4890 0.256 0.000 0.744
#> GSM96960     1  0.5591     0.5235 0.696 0.000 0.304
#> GSM96975     3  0.4796     0.5162 0.220 0.000 0.780
#> GSM96998     1  0.5560     0.5263 0.700 0.000 0.300
#> GSM96999     3  0.5650     0.4189 0.312 0.000 0.688
#> GSM97001     3  0.5363     0.4670 0.276 0.000 0.724
#> GSM97005     1  0.5706     0.5024 0.680 0.000 0.320
#> GSM97006     1  0.6225     0.3845 0.568 0.000 0.432
#> GSM97021     3  0.5678     0.4239 0.316 0.000 0.684
#> GSM97028     3  0.3028     0.4659 0.032 0.048 0.920
#> GSM97031     1  0.6235     0.3810 0.564 0.000 0.436
#> GSM97037     2  0.4605     0.8009 0.000 0.796 0.204
#> GSM97018     2  0.6096     0.7673 0.040 0.752 0.208
#> GSM97014     2  0.7841     0.1104 0.064 0.576 0.360
#> GSM97042     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97040     3  0.3941     0.5344 0.156 0.000 0.844
#> GSM97041     3  0.9617    -0.0263 0.280 0.248 0.472
#> GSM96955     3  0.9217     0.2356 0.164 0.344 0.492
#> GSM96990     2  0.5835     0.6978 0.000 0.660 0.340
#> GSM96991     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM97048     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM96963     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM96953     2  0.0000     0.8884 0.000 1.000 0.000
#> GSM96966     1  0.5882     0.0390 0.652 0.000 0.348
#> GSM96979     3  0.1860     0.4310 0.052 0.000 0.948
#> GSM96983     2  0.6126     0.6171 0.000 0.600 0.400
#> GSM96984     3  0.5706     0.1641 0.000 0.320 0.680
#> GSM96994     3  0.0000     0.4671 0.000 0.000 1.000
#> GSM96996     3  0.5859     0.3597 0.344 0.000 0.656
#> GSM96997     3  0.5058     0.1987 0.244 0.000 0.756
#> GSM97007     3  0.6381     0.0947 0.012 0.340 0.648
#> GSM96954     3  0.5926    -0.0815 0.356 0.000 0.644
#> GSM96962     3  0.5733    -0.0288 0.324 0.000 0.676
#> GSM96969     1  0.5706     0.0855 0.680 0.000 0.320
#> GSM96970     1  0.5948     0.0212 0.640 0.000 0.360
#> GSM96973     1  0.5948     0.0212 0.640 0.000 0.360
#> GSM96976     3  0.6286     0.2170 0.464 0.000 0.536
#> GSM96977     3  0.4178     0.5337 0.172 0.000 0.828
#> GSM96995     3  0.4002     0.5348 0.160 0.000 0.840
#> GSM97002     3  0.5926     0.3408 0.356 0.000 0.644
#> GSM97009     3  0.7366     0.3346 0.072 0.260 0.668
#> GSM97010     3  0.6544     0.5036 0.164 0.084 0.752
#> GSM96974     3  0.5785     0.2218 0.332 0.000 0.668
#> GSM96985     3  0.6302     0.2021 0.480 0.000 0.520
#> GSM96959     3  0.3941     0.5344 0.156 0.000 0.844
#> GSM96972     1  0.0000     0.3755 1.000 0.000 0.000
#> GSM96978     3  0.4235     0.3912 0.176 0.000 0.824
#> GSM96967     1  0.5591     0.1093 0.696 0.000 0.304
#> GSM96987     1  0.5560     0.5263 0.700 0.000 0.300
#> GSM97011     3  0.5631     0.5276 0.164 0.044 0.792
#> GSM96964     1  0.5591     0.5224 0.696 0.000 0.304
#> GSM96965     1  0.9319    -0.1159 0.464 0.168 0.368
#> GSM96981     3  0.5859     0.3597 0.344 0.000 0.656
#> GSM96982     3  0.6235     0.1504 0.436 0.000 0.564
#> GSM96988     3  0.1529     0.4745 0.040 0.000 0.960
#> GSM97000     3  0.4555     0.5247 0.200 0.000 0.800
#> GSM97004     1  0.0000     0.3755 1.000 0.000 0.000
#> GSM97008     3  0.5016     0.5020 0.240 0.000 0.760
#> GSM96950     1  0.6476     0.2085 0.548 0.004 0.448
#> GSM96980     1  0.5058     0.1854 0.756 0.000 0.244
#> GSM96989     1  0.5560     0.5263 0.700 0.000 0.300
#> GSM96992     1  0.5560     0.5263 0.700 0.000 0.300
#> GSM96993     3  0.6799    -0.1233 0.456 0.012 0.532
#> GSM96958     3  0.5988     0.3201 0.368 0.000 0.632
#> GSM96951     1  0.5591     0.5224 0.696 0.000 0.304
#> GSM96952     1  0.5560     0.5263 0.700 0.000 0.300
#> GSM96961     1  0.5560     0.5263 0.700 0.000 0.300

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97045     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97047     2  0.6678      0.382 0.016 0.564 0.360 0.060
#> GSM97025     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97030     2  0.4925      0.425 0.000 0.572 0.428 0.000
#> GSM97027     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97033     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97034     2  0.5353      0.408 0.000 0.556 0.432 0.012
#> GSM97020     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97026     2  0.1635      0.812 0.000 0.948 0.044 0.008
#> GSM97012     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97015     2  0.6008      0.284 0.020 0.504 0.464 0.012
#> GSM97016     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97017     4  0.6526      0.703 0.204 0.032 0.084 0.680
#> GSM97019     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97036     4  0.9427      0.281 0.188 0.332 0.124 0.356
#> GSM97039     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97023     1  0.0000      0.817 1.000 0.000 0.000 0.000
#> GSM97029     4  0.5442      0.649 0.288 0.040 0.000 0.672
#> GSM97043     2  0.3626      0.720 0.000 0.812 0.184 0.004
#> GSM97013     1  0.4746      0.439 0.632 0.368 0.000 0.000
#> GSM96956     2  0.4746      0.528 0.000 0.632 0.368 0.000
#> GSM97024     2  0.3764      0.696 0.000 0.784 0.216 0.000
#> GSM97032     2  0.5085      0.509 0.000 0.616 0.376 0.008
#> GSM97044     3  0.2408      0.745 0.000 0.104 0.896 0.000
#> GSM97049     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM96968     4  0.5968      0.690 0.092 0.000 0.236 0.672
#> GSM96971     3  0.3539      0.694 0.004 0.000 0.820 0.176
#> GSM96986     3  0.4134      0.565 0.000 0.000 0.740 0.260
#> GSM97003     4  0.6570      0.712 0.204 0.000 0.164 0.632
#> GSM96957     4  0.5732      0.682 0.264 0.000 0.064 0.672
#> GSM96960     1  0.0000      0.817 1.000 0.000 0.000 0.000
#> GSM96975     4  0.6118      0.706 0.208 0.000 0.120 0.672
#> GSM96998     1  0.0000      0.817 1.000 0.000 0.000 0.000
#> GSM96999     4  0.5344      0.658 0.300 0.000 0.032 0.668
#> GSM97001     4  0.6078      0.715 0.152 0.000 0.164 0.684
#> GSM97005     1  0.3616      0.707 0.852 0.000 0.112 0.036
#> GSM97006     1  0.0000      0.817 1.000 0.000 0.000 0.000
#> GSM97021     4  0.6650      0.695 0.200 0.000 0.176 0.624
#> GSM97028     3  0.5430      0.595 0.012 0.036 0.716 0.236
#> GSM97031     1  0.2469      0.732 0.892 0.000 0.108 0.000
#> GSM97037     2  0.4761      0.523 0.000 0.628 0.372 0.000
#> GSM97018     2  0.5414      0.494 0.000 0.604 0.376 0.020
#> GSM97014     2  0.6965     -0.246 0.000 0.460 0.112 0.428
#> GSM97042     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM97040     4  0.6133      0.665 0.088 0.000 0.268 0.644
#> GSM97041     1  0.7889      0.217 0.460 0.336 0.012 0.192
#> GSM96955     4  0.6033      0.557 0.000 0.204 0.116 0.680
#> GSM96990     3  0.1452      0.808 0.000 0.036 0.956 0.008
#> GSM96991     2  0.0188      0.835 0.000 0.996 0.004 0.000
#> GSM97048     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000      0.836 0.000 1.000 0.000 0.000
#> GSM96966     4  0.0592      0.655 0.016 0.000 0.000 0.984
#> GSM96979     3  0.2737      0.784 0.008 0.000 0.888 0.104
#> GSM96983     3  0.2530      0.732 0.000 0.112 0.888 0.000
#> GSM96984     3  0.0336      0.817 0.000 0.008 0.992 0.000
#> GSM96994     3  0.0000      0.817 0.000 0.000 1.000 0.000
#> GSM96996     4  0.4564      0.630 0.328 0.000 0.000 0.672
#> GSM96997     3  0.4059      0.683 0.200 0.000 0.788 0.012
#> GSM97007     3  0.0000      0.817 0.000 0.000 1.000 0.000
#> GSM96954     3  0.2329      0.801 0.072 0.000 0.916 0.012
#> GSM96962     3  0.0469      0.818 0.012 0.000 0.988 0.000
#> GSM96969     4  0.2216      0.617 0.092 0.000 0.000 0.908
#> GSM96970     4  0.0592      0.655 0.016 0.000 0.000 0.984
#> GSM96973     4  0.0592      0.655 0.016 0.000 0.000 0.984
#> GSM96976     4  0.0469      0.650 0.000 0.000 0.012 0.988
#> GSM96977     4  0.5964      0.691 0.096 0.000 0.228 0.676
#> GSM96995     4  0.6295      0.641 0.088 0.000 0.296 0.616
#> GSM97002     4  0.4730      0.593 0.364 0.000 0.000 0.636
#> GSM97009     4  0.8660      0.391 0.088 0.372 0.120 0.420
#> GSM97010     4  0.7046      0.697 0.092 0.060 0.188 0.660
#> GSM96974     4  0.4994     -0.363 0.000 0.000 0.480 0.520
#> GSM96985     4  0.0657      0.650 0.004 0.000 0.012 0.984
#> GSM96959     4  0.6508      0.574 0.088 0.000 0.344 0.568
#> GSM96972     1  0.4500      0.529 0.684 0.000 0.000 0.316
#> GSM96978     3  0.4697      0.546 0.000 0.000 0.644 0.356
#> GSM96967     4  0.2921      0.570 0.140 0.000 0.000 0.860
#> GSM96987     1  0.0000      0.817 1.000 0.000 0.000 0.000
#> GSM97011     4  0.5848      0.689 0.088 0.000 0.228 0.684
#> GSM96964     1  0.0336      0.813 0.992 0.000 0.000 0.008
#> GSM96965     4  0.0469      0.651 0.000 0.012 0.000 0.988
#> GSM96981     4  0.4585      0.627 0.332 0.000 0.000 0.668
#> GSM96982     1  0.4992     -0.322 0.524 0.000 0.000 0.476
#> GSM96988     3  0.6576      0.554 0.152 0.000 0.628 0.220
#> GSM97000     4  0.6081      0.670 0.088 0.000 0.260 0.652
#> GSM97004     1  0.2216      0.746 0.908 0.000 0.000 0.092
#> GSM97008     4  0.5944      0.699 0.104 0.000 0.212 0.684
#> GSM96950     1  0.4431      0.338 0.696 0.000 0.000 0.304
#> GSM96980     4  0.4072      0.388 0.252 0.000 0.000 0.748
#> GSM96989     1  0.0000      0.817 1.000 0.000 0.000 0.000
#> GSM96992     1  0.0000      0.817 1.000 0.000 0.000 0.000
#> GSM96993     1  0.6451      0.485 0.656 0.004 0.204 0.136
#> GSM96958     4  0.4804      0.568 0.384 0.000 0.000 0.616
#> GSM96951     1  0.0592      0.808 0.984 0.000 0.000 0.016
#> GSM96952     1  0.0000      0.817 1.000 0.000 0.000 0.000
#> GSM96961     1  0.0000      0.817 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
#> GSM97038     2  0.0000     0.8619 0.000 1.000 0.000 0.000 0.000
#> GSM97045     2  0.0510     0.8601 0.000 0.984 0.000 0.016 0.000
#> GSM97047     5  0.5237     0.6067 0.000 0.160 0.140 0.004 0.696
#> GSM97025     2  0.0162     0.8617 0.000 0.996 0.000 0.004 0.000
#> GSM97030     2  0.4331     0.5243 0.000 0.596 0.400 0.004 0.000
#> GSM97027     2  0.0162     0.8617 0.000 0.996 0.000 0.004 0.000
#> GSM97033     2  0.0000     0.8619 0.000 1.000 0.000 0.000 0.000
#> GSM97034     2  0.6093     0.6690 0.000 0.612 0.204 0.012 0.172
#> GSM97020     2  0.0000     0.8619 0.000 1.000 0.000 0.000 0.000
#> GSM97026     2  0.1560     0.8480 0.000 0.948 0.020 0.004 0.028
#> GSM97012     2  0.2793     0.8540 0.000 0.876 0.000 0.036 0.088
#> GSM97015     2  0.5949     0.4353 0.000 0.528 0.368 0.004 0.100
#> GSM97016     2  0.0000     0.8619 0.000 1.000 0.000 0.000 0.000
#> GSM97017     5  0.2879     0.7550 0.100 0.032 0.000 0.000 0.868
#> GSM97019     2  0.2793     0.8540 0.000 0.876 0.000 0.036 0.088
#> GSM97022     2  0.2952     0.8536 0.000 0.872 0.004 0.036 0.088
#> GSM97035     2  0.2952     0.8536 0.000 0.872 0.004 0.036 0.088
#> GSM97036     5  0.8336     0.1734 0.248 0.312 0.112 0.004 0.324
#> GSM97039     2  0.0000     0.8619 0.000 1.000 0.000 0.000 0.000
#> GSM97046     2  0.0000     0.8619 0.000 1.000 0.000 0.000 0.000
#> GSM97023     1  0.0000     0.8650 1.000 0.000 0.000 0.000 0.000
#> GSM97029     5  0.6586     0.0318 0.384 0.208 0.000 0.000 0.408
#> GSM97043     2  0.2694     0.8137 0.000 0.864 0.128 0.004 0.004
#> GSM97013     1  0.4060     0.4771 0.640 0.360 0.000 0.000 0.000
#> GSM96956     2  0.3790     0.7116 0.000 0.724 0.272 0.004 0.000
#> GSM97024     2  0.5143     0.7877 0.000 0.740 0.136 0.036 0.088
#> GSM97032     2  0.5213     0.6436 0.000 0.652 0.276 0.004 0.068
#> GSM97044     3  0.0324     0.8589 0.000 0.000 0.992 0.004 0.004
#> GSM97049     2  0.0000     0.8619 0.000 1.000 0.000 0.000 0.000
#> GSM96968     3  0.3980     0.6078 0.000 0.008 0.708 0.000 0.284
#> GSM96971     3  0.3098     0.8212 0.000 0.000 0.836 0.016 0.148
#> GSM96986     3  0.3003     0.7911 0.000 0.000 0.812 0.000 0.188
#> GSM97003     5  0.4149     0.7211 0.128 0.000 0.088 0.000 0.784
#> GSM96957     1  0.4863     0.5639 0.672 0.000 0.056 0.000 0.272
#> GSM96960     1  0.0000     0.8650 1.000 0.000 0.000 0.000 0.000
#> GSM96975     5  0.2685     0.7662 0.028 0.000 0.092 0.000 0.880
#> GSM96998     1  0.0000     0.8650 1.000 0.000 0.000 0.000 0.000
#> GSM96999     1  0.4464     0.5828 0.684 0.000 0.028 0.000 0.288
#> GSM97001     5  0.2228     0.7706 0.040 0.000 0.048 0.000 0.912
#> GSM97005     5  0.4015     0.4849 0.348 0.000 0.000 0.000 0.652
#> GSM97006     1  0.0000     0.8650 1.000 0.000 0.000 0.000 0.000
#> GSM97021     5  0.2853     0.7656 0.072 0.000 0.052 0.000 0.876
#> GSM97028     3  0.3561     0.6537 0.000 0.000 0.740 0.000 0.260
#> GSM97031     1  0.0510     0.8564 0.984 0.000 0.000 0.000 0.016
#> GSM97037     2  0.3766     0.7156 0.000 0.728 0.268 0.004 0.000
#> GSM97018     2  0.5706     0.5920 0.000 0.612 0.276 0.004 0.108
#> GSM97014     5  0.3895     0.6148 0.000 0.320 0.000 0.000 0.680
#> GSM97042     2  0.2793     0.8540 0.000 0.876 0.000 0.036 0.088
#> GSM97040     5  0.1965     0.7595 0.000 0.000 0.096 0.000 0.904
#> GSM97041     5  0.5354     0.6313 0.108 0.240 0.000 0.000 0.652
#> GSM96955     5  0.3532     0.7544 0.000 0.076 0.092 0.000 0.832
#> GSM96990     3  0.2928     0.7886 0.000 0.032 0.872 0.004 0.092
#> GSM96991     2  0.2793     0.8540 0.000 0.876 0.000 0.036 0.088
#> GSM97048     2  0.0000     0.8619 0.000 1.000 0.000 0.000 0.000
#> GSM96963     2  0.2793     0.8540 0.000 0.876 0.000 0.036 0.088
#> GSM96953     2  0.2793     0.8540 0.000 0.876 0.000 0.036 0.088
#> GSM96966     4  0.1043     0.9611 0.000 0.000 0.000 0.960 0.040
#> GSM96979     3  0.3967     0.7854 0.000 0.000 0.800 0.108 0.092
#> GSM96983     3  0.0162     0.8593 0.000 0.000 0.996 0.004 0.000
#> GSM96984     3  0.0000     0.8603 0.000 0.000 1.000 0.000 0.000
#> GSM96994     3  0.0162     0.8611 0.000 0.000 0.996 0.000 0.004
#> GSM96996     5  0.3992     0.5894 0.268 0.000 0.000 0.012 0.720
#> GSM96997     3  0.3812     0.8012 0.096 0.000 0.812 0.000 0.092
#> GSM97007     3  0.0000     0.8603 0.000 0.000 1.000 0.000 0.000
#> GSM96954     3  0.2820     0.8500 0.056 0.000 0.884 0.004 0.056
#> GSM96962     3  0.1597     0.8612 0.012 0.000 0.940 0.000 0.048
#> GSM96969     4  0.1195     0.9551 0.028 0.000 0.000 0.960 0.012
#> GSM96970     4  0.1043     0.9611 0.000 0.000 0.000 0.960 0.040
#> GSM96973     4  0.1043     0.9611 0.000 0.000 0.000 0.960 0.040
#> GSM96976     4  0.1043     0.9611 0.000 0.000 0.000 0.960 0.040
#> GSM96977     5  0.1952     0.7630 0.004 0.000 0.084 0.000 0.912
#> GSM96995     5  0.2561     0.7396 0.000 0.000 0.144 0.000 0.856
#> GSM97002     1  0.3756     0.6668 0.744 0.000 0.000 0.008 0.248
#> GSM97009     5  0.3999     0.5870 0.000 0.344 0.000 0.000 0.656
#> GSM97010     5  0.3861     0.7265 0.000 0.128 0.068 0.000 0.804
#> GSM96974     4  0.1082     0.9439 0.000 0.000 0.028 0.964 0.008
#> GSM96985     4  0.1282     0.9570 0.000 0.000 0.004 0.952 0.044
#> GSM96959     5  0.2280     0.7509 0.000 0.000 0.120 0.000 0.880
#> GSM96972     4  0.1043     0.9486 0.040 0.000 0.000 0.960 0.000
#> GSM96978     3  0.2389     0.8315 0.000 0.000 0.880 0.004 0.116
#> GSM96967     4  0.1043     0.9486 0.040 0.000 0.000 0.960 0.000
#> GSM96987     1  0.0000     0.8650 1.000 0.000 0.000 0.000 0.000
#> GSM97011     5  0.1851     0.7606 0.000 0.000 0.088 0.000 0.912
#> GSM96964     1  0.0000     0.8650 1.000 0.000 0.000 0.000 0.000
#> GSM96965     4  0.2424     0.8586 0.000 0.000 0.000 0.868 0.132
#> GSM96981     5  0.3885     0.5919 0.268 0.000 0.000 0.008 0.724
#> GSM96982     1  0.3109     0.7231 0.800 0.000 0.000 0.000 0.200
#> GSM96988     3  0.3967     0.8039 0.000 0.000 0.800 0.092 0.108
#> GSM97000     5  0.2230     0.7496 0.000 0.000 0.116 0.000 0.884
#> GSM97004     1  0.0510     0.8564 0.984 0.000 0.000 0.016 0.000
#> GSM97008     5  0.2171     0.7696 0.024 0.000 0.064 0.000 0.912
#> GSM96950     1  0.3003     0.7491 0.812 0.000 0.000 0.000 0.188
#> GSM96980     4  0.1043     0.9486 0.040 0.000 0.000 0.960 0.000
#> GSM96989     1  0.0000     0.8650 1.000 0.000 0.000 0.000 0.000
#> GSM96992     1  0.0000     0.8650 1.000 0.000 0.000 0.000 0.000
#> GSM96993     1  0.5869     0.5462 0.656 0.012 0.160 0.004 0.168
#> GSM96958     1  0.3534     0.6601 0.744 0.000 0.000 0.000 0.256
#> GSM96951     1  0.0000     0.8650 1.000 0.000 0.000 0.000 0.000
#> GSM96952     1  0.0000     0.8650 1.000 0.000 0.000 0.000 0.000
#> GSM96961     1  0.0000     0.8650 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
#> GSM97038     2  0.0713     0.6085 0.000 0.972 0.028 0.000 0.000 0.000
#> GSM97045     2  0.3607     0.0847 0.000 0.652 0.348 0.000 0.000 0.000
#> GSM97047     5  0.5279     0.5438 0.000 0.048 0.312 0.004 0.604 0.032
#> GSM97025     2  0.2378     0.5184 0.000 0.848 0.152 0.000 0.000 0.000
#> GSM97030     2  0.6546     0.2008 0.000 0.464 0.260 0.004 0.028 0.244
#> GSM97027     2  0.2300     0.5286 0.000 0.856 0.144 0.000 0.000 0.000
#> GSM97033     2  0.1610     0.5809 0.000 0.916 0.084 0.000 0.000 0.000
#> GSM97034     3  0.6310    -0.0124 0.000 0.204 0.584 0.004 0.112 0.096
#> GSM97020     2  0.1765     0.5724 0.000 0.904 0.096 0.000 0.000 0.000
#> GSM97026     2  0.3841     0.5190 0.000 0.780 0.164 0.000 0.036 0.020
#> GSM97012     3  0.3797     0.3883 0.000 0.420 0.580 0.000 0.000 0.000
#> GSM97015     3  0.7118    -0.0935 0.000 0.320 0.420 0.004 0.144 0.112
#> GSM97016     2  0.0000     0.6167 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97017     5  0.3771     0.7299 0.056 0.000 0.180 0.000 0.764 0.000
#> GSM97019     3  0.3797     0.3883 0.000 0.420 0.580 0.000 0.000 0.000
#> GSM97022     3  0.3607     0.3906 0.000 0.348 0.652 0.000 0.000 0.000
#> GSM97035     3  0.3756     0.3305 0.000 0.400 0.600 0.000 0.000 0.000
#> GSM97036     3  0.8648    -0.0207 0.152 0.200 0.320 0.004 0.236 0.088
#> GSM97039     2  0.0363     0.6130 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM97046     2  0.0000     0.6167 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97023     1  0.0000     0.8199 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97029     5  0.6552     0.0521 0.320 0.100 0.084 0.004 0.492 0.000
#> GSM97043     2  0.4676     0.4508 0.000 0.684 0.216 0.004 0.000 0.096
#> GSM97013     1  0.3823     0.2241 0.564 0.436 0.000 0.000 0.000 0.000
#> GSM96956     2  0.5329     0.4011 0.000 0.656 0.216 0.004 0.028 0.096
#> GSM97024     3  0.2969     0.3294 0.000 0.224 0.776 0.000 0.000 0.000
#> GSM97032     2  0.6512     0.2397 0.000 0.484 0.336 0.004 0.080 0.096
#> GSM97044     6  0.3608     0.6872 0.000 0.000 0.248 0.004 0.012 0.736
#> GSM97049     2  0.0000     0.6167 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96968     6  0.5594     0.1756 0.004 0.008 0.080 0.004 0.440 0.464
#> GSM96971     6  0.2527     0.7894 0.000 0.000 0.000 0.024 0.108 0.868
#> GSM96986     6  0.1765     0.7904 0.000 0.000 0.000 0.000 0.096 0.904
#> GSM97003     5  0.3308     0.6610 0.096 0.000 0.000 0.004 0.828 0.072
#> GSM96957     1  0.3944     0.4162 0.568 0.000 0.000 0.004 0.428 0.000
#> GSM96960     1  0.0146     0.8188 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM96975     5  0.1049     0.7324 0.032 0.000 0.000 0.008 0.960 0.000
#> GSM96998     1  0.0000     0.8199 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96999     1  0.4062     0.3912 0.552 0.000 0.000 0.008 0.440 0.000
#> GSM97001     5  0.0603     0.7394 0.016 0.000 0.000 0.004 0.980 0.000
#> GSM97005     5  0.5998     0.5490 0.240 0.000 0.176 0.000 0.556 0.028
#> GSM97006     1  0.0146     0.8188 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM97021     5  0.4196     0.7154 0.040 0.000 0.180 0.000 0.752 0.028
#> GSM97028     3  0.6095    -0.3308 0.000 0.000 0.392 0.004 0.224 0.380
#> GSM97031     1  0.1036     0.8017 0.964 0.000 0.000 0.004 0.024 0.008
#> GSM97037     2  0.5225     0.4113 0.000 0.672 0.200 0.004 0.028 0.096
#> GSM97018     2  0.6996     0.0956 0.000 0.388 0.376 0.004 0.136 0.096
#> GSM97014     5  0.5475     0.4803 0.000 0.316 0.148 0.000 0.536 0.000
#> GSM97042     3  0.3797     0.3883 0.000 0.420 0.580 0.000 0.000 0.000
#> GSM97040     5  0.3345     0.7197 0.000 0.000 0.184 0.000 0.788 0.028
#> GSM97041     5  0.6409     0.5385 0.064 0.216 0.180 0.000 0.540 0.000
#> GSM96955     5  0.1908     0.7143 0.000 0.096 0.000 0.004 0.900 0.000
#> GSM96990     6  0.5518     0.4740 0.000 0.000 0.316 0.004 0.136 0.544
#> GSM96991     3  0.3774     0.3904 0.000 0.408 0.592 0.000 0.000 0.000
#> GSM97048     2  0.0000     0.6167 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96963     3  0.3797     0.3883 0.000 0.420 0.580 0.000 0.000 0.000
#> GSM96953     2  0.3864    -0.3298 0.000 0.520 0.480 0.000 0.000 0.000
#> GSM96966     4  0.0146     0.9722 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM96979     6  0.1765     0.7904 0.000 0.000 0.000 0.000 0.096 0.904
#> GSM96983     6  0.3517     0.7237 0.000 0.000 0.188 0.004 0.028 0.780
#> GSM96984     6  0.0713     0.8122 0.000 0.000 0.028 0.000 0.000 0.972
#> GSM96994     6  0.0547     0.8144 0.000 0.000 0.020 0.000 0.000 0.980
#> GSM96996     5  0.3740     0.5180 0.228 0.000 0.000 0.032 0.740 0.000
#> GSM96997     6  0.1765     0.7904 0.000 0.000 0.000 0.000 0.096 0.904
#> GSM97007     6  0.0713     0.8122 0.000 0.000 0.028 0.000 0.000 0.972
#> GSM96954     6  0.2683     0.7961 0.004 0.000 0.020 0.004 0.104 0.868
#> GSM96962     6  0.0547     0.8148 0.000 0.000 0.000 0.000 0.020 0.980
#> GSM96969     4  0.0260     0.9709 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM96970     4  0.0146     0.9722 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM96973     4  0.0146     0.9722 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM96976     4  0.0363     0.9677 0.000 0.000 0.000 0.988 0.012 0.000
#> GSM96977     5  0.0551     0.7385 0.008 0.000 0.000 0.004 0.984 0.004
#> GSM96995     5  0.3952     0.6879 0.000 0.000 0.108 0.008 0.780 0.104
#> GSM97002     1  0.4301     0.4579 0.584 0.000 0.000 0.024 0.392 0.000
#> GSM97009     5  0.3619     0.5309 0.000 0.316 0.004 0.000 0.680 0.000
#> GSM97010     5  0.2951     0.6932 0.004 0.092 0.008 0.004 0.864 0.028
#> GSM96974     4  0.0000     0.9710 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96985     4  0.0717     0.9641 0.000 0.000 0.000 0.976 0.016 0.008
#> GSM96959     5  0.3377     0.7184 0.000 0.000 0.188 0.000 0.784 0.028
#> GSM96972     4  0.0260     0.9709 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM96978     6  0.1285     0.8100 0.000 0.000 0.004 0.000 0.052 0.944
#> GSM96967     4  0.0260     0.9709 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM96987     1  0.0000     0.8199 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97011     5  0.0291     0.7379 0.000 0.000 0.000 0.004 0.992 0.004
#> GSM96964     1  0.0000     0.8199 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96965     4  0.2703     0.7837 0.000 0.004 0.000 0.824 0.172 0.000
#> GSM96981     5  0.3566     0.5302 0.224 0.000 0.000 0.024 0.752 0.000
#> GSM96982     1  0.3619     0.5716 0.680 0.000 0.000 0.004 0.316 0.000
#> GSM96988     6  0.4734     0.7317 0.000 0.000 0.152 0.080 0.040 0.728
#> GSM97000     5  0.3712     0.7117 0.000 0.000 0.180 0.000 0.768 0.052
#> GSM97004     1  0.0547     0.8117 0.980 0.000 0.000 0.020 0.000 0.000
#> GSM97008     5  0.3562     0.7233 0.008 0.000 0.180 0.000 0.784 0.028
#> GSM96950     1  0.3445     0.6542 0.744 0.000 0.012 0.000 0.244 0.000
#> GSM96980     4  0.0363     0.9687 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM96989     1  0.0000     0.8199 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96992     1  0.0000     0.8199 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96993     1  0.6388     0.3964 0.580 0.000 0.132 0.004 0.188 0.096
#> GSM96958     1  0.3841     0.4869 0.616 0.000 0.000 0.004 0.380 0.000
#> GSM96951     1  0.0000     0.8199 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96952     1  0.0146     0.8188 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM96961     1  0.0000     0.8199 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-MAD-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-pam-collect-classes

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

test_to_known_factors(res)
#>           n disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:pam 100         1.39e-06       0.440     9.32e-16  0.05269 2
#> MAD:pam  54         3.15e-03       0.810     1.13e-13  0.12815 3
#> MAD:pam  85         1.60e-05       0.826     1.90e-17  0.00887 4
#> MAD:pam  95         1.81e-07       0.279     1.77e-20  0.01760 5
#> MAD:pam  70         1.72e-06       0.339     2.38e-14  0.01998 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 21168 rows and 100 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 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-mclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.974       0.980         0.3429 0.665   0.665
#> 3 3 0.862           0.879       0.946         0.8111 0.659   0.507
#> 4 4 0.853           0.868       0.936         0.1777 0.876   0.678
#> 5 5 0.791           0.860       0.877         0.0764 0.898   0.649
#> 6 6 0.827           0.833       0.838         0.0429 0.948   0.756

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
#> GSM97038     2  0.1184      0.995 0.016 0.984
#> GSM97045     2  0.1184      0.995 0.016 0.984
#> GSM97047     1  0.2423      0.965 0.960 0.040
#> GSM97025     2  0.1184      0.995 0.016 0.984
#> GSM97030     1  0.2603      0.962 0.956 0.044
#> GSM97027     2  0.1184      0.995 0.016 0.984
#> GSM97033     2  0.1184      0.995 0.016 0.984
#> GSM97034     1  0.2236      0.968 0.964 0.036
#> GSM97020     2  0.1184      0.995 0.016 0.984
#> GSM97026     1  0.2423      0.965 0.960 0.040
#> GSM97012     2  0.1184      0.995 0.016 0.984
#> GSM97015     1  0.1414      0.978 0.980 0.020
#> GSM97016     2  0.1184      0.995 0.016 0.984
#> GSM97017     1  0.0000      0.981 1.000 0.000
#> GSM97019     2  0.1184      0.995 0.016 0.984
#> GSM97022     2  0.1184      0.995 0.016 0.984
#> GSM97035     2  0.1184      0.995 0.016 0.984
#> GSM97036     1  0.0000      0.981 1.000 0.000
#> GSM97039     2  0.1184      0.995 0.016 0.984
#> GSM97046     2  0.1184      0.995 0.016 0.984
#> GSM97023     1  0.0000      0.981 1.000 0.000
#> GSM97029     1  0.0000      0.981 1.000 0.000
#> GSM97043     2  0.1184      0.995 0.016 0.984
#> GSM97013     1  0.0000      0.981 1.000 0.000
#> GSM96956     1  0.8386      0.658 0.732 0.268
#> GSM97024     2  0.1184      0.995 0.016 0.984
#> GSM97032     1  0.2423      0.965 0.960 0.040
#> GSM97044     1  0.2423      0.965 0.960 0.040
#> GSM97049     2  0.1184      0.995 0.016 0.984
#> GSM96968     1  0.1184      0.980 0.984 0.016
#> GSM96971     1  0.1184      0.980 0.984 0.016
#> GSM96986     1  0.1184      0.980 0.984 0.016
#> GSM97003     1  0.0672      0.981 0.992 0.008
#> GSM96957     1  0.0376      0.982 0.996 0.004
#> GSM96960     1  0.0000      0.981 1.000 0.000
#> GSM96975     1  0.0000      0.981 1.000 0.000
#> GSM96998     1  0.0000      0.981 1.000 0.000
#> GSM96999     1  0.0376      0.982 0.996 0.004
#> GSM97001     1  0.0000      0.981 1.000 0.000
#> GSM97005     1  0.0672      0.981 0.992 0.008
#> GSM97006     1  0.0000      0.981 1.000 0.000
#> GSM97021     1  0.0672      0.981 0.992 0.008
#> GSM97028     1  0.1184      0.980 0.984 0.016
#> GSM97031     1  0.0672      0.981 0.992 0.008
#> GSM97037     1  0.8327      0.665 0.736 0.264
#> GSM97018     1  0.2423      0.965 0.960 0.040
#> GSM97014     1  0.1633      0.975 0.976 0.024
#> GSM97042     2  0.1184      0.995 0.016 0.984
#> GSM97040     1  0.0672      0.981 0.992 0.008
#> GSM97041     1  0.0376      0.982 0.996 0.004
#> GSM96955     1  0.4298      0.919 0.912 0.088
#> GSM96990     1  0.2423      0.965 0.960 0.040
#> GSM96991     2  0.4690      0.911 0.100 0.900
#> GSM97048     2  0.1184      0.995 0.016 0.984
#> GSM96963     2  0.1633      0.988 0.024 0.976
#> GSM96953     2  0.1184      0.995 0.016 0.984
#> GSM96966     1  0.1184      0.972 0.984 0.016
#> GSM96979     1  0.1184      0.980 0.984 0.016
#> GSM96983     1  0.1414      0.978 0.980 0.020
#> GSM96984     1  0.1184      0.980 0.984 0.016
#> GSM96994     1  0.1184      0.980 0.984 0.016
#> GSM96996     1  0.0000      0.981 1.000 0.000
#> GSM96997     1  0.1184      0.980 0.984 0.016
#> GSM97007     1  0.1184      0.980 0.984 0.016
#> GSM96954     1  0.1184      0.980 0.984 0.016
#> GSM96962     1  0.1184      0.980 0.984 0.016
#> GSM96969     1  0.1184      0.972 0.984 0.016
#> GSM96970     1  0.1184      0.972 0.984 0.016
#> GSM96973     1  0.1184      0.972 0.984 0.016
#> GSM96976     1  0.0672      0.981 0.992 0.008
#> GSM96977     1  0.0672      0.981 0.992 0.008
#> GSM96995     1  0.1184      0.980 0.984 0.016
#> GSM97002     1  0.0938      0.975 0.988 0.012
#> GSM97009     1  0.1633      0.976 0.976 0.024
#> GSM97010     1  0.0000      0.981 1.000 0.000
#> GSM96974     1  0.0672      0.981 0.992 0.008
#> GSM96985     1  0.0672      0.981 0.992 0.008
#> GSM96959     1  0.1414      0.978 0.980 0.020
#> GSM96972     1  0.1184      0.972 0.984 0.016
#> GSM96978     1  0.1184      0.980 0.984 0.016
#> GSM96967     1  0.1184      0.972 0.984 0.016
#> GSM96987     1  0.0000      0.981 1.000 0.000
#> GSM97011     1  0.0672      0.981 0.992 0.008
#> GSM96964     1  0.0000      0.981 1.000 0.000
#> GSM96965     1  0.0000      0.981 1.000 0.000
#> GSM96981     1  0.0000      0.981 1.000 0.000
#> GSM96982     1  0.0376      0.980 0.996 0.004
#> GSM96988     1  0.1184      0.980 0.984 0.016
#> GSM97000     1  0.0672      0.981 0.992 0.008
#> GSM97004     1  0.1184      0.972 0.984 0.016
#> GSM97008     1  0.0672      0.981 0.992 0.008
#> GSM96950     1  0.0000      0.981 1.000 0.000
#> GSM96980     1  0.1184      0.972 0.984 0.016
#> GSM96989     1  0.0000      0.981 1.000 0.000
#> GSM96992     1  0.0000      0.981 1.000 0.000
#> GSM96993     1  0.0000      0.981 1.000 0.000
#> GSM96958     1  0.0000      0.981 1.000 0.000
#> GSM96951     1  0.0672      0.981 0.992 0.008
#> GSM96952     1  0.0000      0.981 1.000 0.000
#> GSM96961     1  0.0000      0.981 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97038     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97045     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97047     2  0.8331     0.5012 0.208 0.628 0.164
#> GSM97025     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97030     3  0.0237     0.9240 0.000 0.004 0.996
#> GSM97027     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97033     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97034     3  0.0475     0.9253 0.004 0.004 0.992
#> GSM97020     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97026     2  0.7001     0.4539 0.340 0.628 0.032
#> GSM97012     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97015     3  0.0237     0.9267 0.004 0.000 0.996
#> GSM97016     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97017     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM97019     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97022     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97035     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97036     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM97039     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97046     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97023     1  0.0000     0.9604 1.000 0.000 0.000
#> GSM97029     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM97043     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97013     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM96956     2  0.5760     0.4952 0.000 0.672 0.328
#> GSM97024     2  0.0237     0.9042 0.000 0.996 0.004
#> GSM97032     3  0.6026     0.3667 0.000 0.376 0.624
#> GSM97044     3  0.0237     0.9267 0.004 0.000 0.996
#> GSM97049     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM96968     3  0.3941     0.7826 0.156 0.000 0.844
#> GSM96971     3  0.0237     0.9267 0.004 0.000 0.996
#> GSM96986     3  0.0237     0.9267 0.004 0.000 0.996
#> GSM97003     1  0.1289     0.9577 0.968 0.000 0.032
#> GSM96957     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM96960     1  0.0747     0.9600 0.984 0.000 0.016
#> GSM96975     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM96998     1  0.0000     0.9604 1.000 0.000 0.000
#> GSM96999     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM97001     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM97005     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM97006     1  0.0747     0.9600 0.984 0.000 0.016
#> GSM97021     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM97028     3  0.0237     0.9267 0.004 0.000 0.996
#> GSM97031     1  0.1289     0.9577 0.968 0.000 0.032
#> GSM97037     2  0.5882     0.4523 0.000 0.652 0.348
#> GSM97018     3  0.6704     0.3535 0.016 0.376 0.608
#> GSM97014     2  0.7074     0.0979 0.480 0.500 0.020
#> GSM97042     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97040     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM97041     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM96955     2  0.3267     0.8348 0.044 0.912 0.044
#> GSM96990     3  0.0661     0.9232 0.004 0.008 0.988
#> GSM96991     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM97048     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM96963     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM96953     2  0.0000     0.9077 0.000 1.000 0.000
#> GSM96966     1  0.0892     0.9591 0.980 0.000 0.020
#> GSM96979     3  0.4291     0.7390 0.180 0.000 0.820
#> GSM96983     3  0.0237     0.9240 0.000 0.004 0.996
#> GSM96984     3  0.0237     0.9267 0.004 0.000 0.996
#> GSM96994     3  0.0237     0.9267 0.004 0.000 0.996
#> GSM96996     1  0.0000     0.9604 1.000 0.000 0.000
#> GSM96997     3  0.0237     0.9267 0.004 0.000 0.996
#> GSM97007     3  0.0237     0.9267 0.004 0.000 0.996
#> GSM96954     3  0.0592     0.9218 0.012 0.000 0.988
#> GSM96962     3  0.0237     0.9267 0.004 0.000 0.996
#> GSM96969     1  0.0892     0.9591 0.980 0.000 0.020
#> GSM96970     1  0.0892     0.9591 0.980 0.000 0.020
#> GSM96973     1  0.0892     0.9591 0.980 0.000 0.020
#> GSM96976     1  0.6309     0.0566 0.500 0.000 0.500
#> GSM96977     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM96995     3  0.3941     0.7823 0.156 0.000 0.844
#> GSM97002     1  0.0592     0.9601 0.988 0.000 0.012
#> GSM97009     1  0.5519     0.8029 0.812 0.120 0.068
#> GSM97010     1  0.1163     0.9597 0.972 0.000 0.028
#> GSM96974     1  0.4291     0.8003 0.820 0.000 0.180
#> GSM96985     1  0.2625     0.9164 0.916 0.000 0.084
#> GSM96959     3  0.1015     0.9193 0.008 0.012 0.980
#> GSM96972     1  0.0892     0.9591 0.980 0.000 0.020
#> GSM96978     3  0.0237     0.9267 0.004 0.000 0.996
#> GSM96967     1  0.0892     0.9591 0.980 0.000 0.020
#> GSM96987     1  0.0000     0.9604 1.000 0.000 0.000
#> GSM97011     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM96964     1  0.0000     0.9604 1.000 0.000 0.000
#> GSM96965     1  0.1411     0.9578 0.964 0.000 0.036
#> GSM96981     1  0.0237     0.9589 0.996 0.000 0.004
#> GSM96982     1  0.0892     0.9591 0.980 0.000 0.020
#> GSM96988     1  0.5968     0.4561 0.636 0.000 0.364
#> GSM97000     1  0.1289     0.9577 0.968 0.000 0.032
#> GSM97004     1  0.0892     0.9591 0.980 0.000 0.020
#> GSM97008     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM96950     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM96980     1  0.0892     0.9591 0.980 0.000 0.020
#> GSM96989     1  0.0000     0.9604 1.000 0.000 0.000
#> GSM96992     1  0.0000     0.9604 1.000 0.000 0.000
#> GSM96993     1  0.0747     0.9631 0.984 0.000 0.016
#> GSM96958     1  0.0592     0.9630 0.988 0.000 0.012
#> GSM96951     1  0.0592     0.9630 0.988 0.000 0.012
#> GSM96952     1  0.0000     0.9604 1.000 0.000 0.000
#> GSM96961     1  0.0000     0.9604 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
#> GSM97038     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97045     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97047     2  0.3024     0.8129 0.148 0.852 0.000 0.000
#> GSM97025     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97030     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM97027     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97033     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97034     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM97020     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97026     2  0.1940     0.9022 0.076 0.924 0.000 0.000
#> GSM97012     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97015     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM97016     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97017     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM97019     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97036     1  0.0188     0.8896 0.996 0.000 0.000 0.004
#> GSM97039     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97023     1  0.3266     0.8334 0.832 0.000 0.000 0.168
#> GSM97029     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM97043     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97013     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM96956     2  0.2081     0.8939 0.000 0.916 0.084 0.000
#> GSM97024     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97032     3  0.4776     0.4007 0.000 0.376 0.624 0.000
#> GSM97044     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM97049     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM96968     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM96971     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM96986     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM97003     1  0.4565     0.8075 0.796 0.000 0.064 0.140
#> GSM96957     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM96960     1  0.4790     0.5621 0.620 0.000 0.000 0.380
#> GSM96975     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM96998     1  0.3649     0.8107 0.796 0.000 0.000 0.204
#> GSM96999     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM97001     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM97005     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM97006     1  0.3907     0.7850 0.768 0.000 0.000 0.232
#> GSM97021     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM97028     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM97031     1  0.1557     0.8772 0.944 0.000 0.000 0.056
#> GSM97037     2  0.3837     0.7037 0.000 0.776 0.224 0.000
#> GSM97018     3  0.4713     0.4396 0.000 0.360 0.640 0.000
#> GSM97014     1  0.4356     0.5030 0.708 0.292 0.000 0.000
#> GSM97042     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97040     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM97041     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM96955     2  0.0817     0.9544 0.024 0.976 0.000 0.000
#> GSM96990     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM96991     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM97048     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000     0.9745 0.000 1.000 0.000 0.000
#> GSM96966     4  0.0000     0.8728 0.000 0.000 0.000 1.000
#> GSM96979     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM96983     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM96984     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM96994     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM96996     1  0.3688     0.8076 0.792 0.000 0.000 0.208
#> GSM96997     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM97007     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM96954     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM96962     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM96969     4  0.0000     0.8728 0.000 0.000 0.000 1.000
#> GSM96970     4  0.0000     0.8728 0.000 0.000 0.000 1.000
#> GSM96973     4  0.0000     0.8728 0.000 0.000 0.000 1.000
#> GSM96976     4  0.4356     0.5563 0.000 0.000 0.292 0.708
#> GSM96977     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM96995     3  0.0469     0.9390 0.012 0.000 0.988 0.000
#> GSM97002     1  0.4955     0.4120 0.556 0.000 0.000 0.444
#> GSM97009     1  0.0336     0.8867 0.992 0.008 0.000 0.000
#> GSM97010     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM96974     4  0.3610     0.6936 0.000 0.000 0.200 0.800
#> GSM96985     4  0.2868     0.7698 0.000 0.000 0.136 0.864
#> GSM96959     3  0.2216     0.8450 0.092 0.000 0.908 0.000
#> GSM96972     4  0.0000     0.8728 0.000 0.000 0.000 1.000
#> GSM96978     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM96967     4  0.0000     0.8728 0.000 0.000 0.000 1.000
#> GSM96987     1  0.3726     0.8045 0.788 0.000 0.000 0.212
#> GSM97011     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM96964     1  0.2973     0.8450 0.856 0.000 0.000 0.144
#> GSM96965     4  0.4103     0.6608 0.256 0.000 0.000 0.744
#> GSM96981     1  0.3444     0.8249 0.816 0.000 0.000 0.184
#> GSM96982     4  0.4898     0.0166 0.416 0.000 0.000 0.584
#> GSM96988     3  0.0000     0.9510 0.000 0.000 1.000 0.000
#> GSM97000     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM97004     4  0.0000     0.8728 0.000 0.000 0.000 1.000
#> GSM97008     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM96950     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM96980     4  0.0000     0.8728 0.000 0.000 0.000 1.000
#> GSM96989     1  0.3486     0.8218 0.812 0.000 0.000 0.188
#> GSM96992     1  0.3726     0.8045 0.788 0.000 0.000 0.212
#> GSM96993     1  0.0000     0.8901 1.000 0.000 0.000 0.000
#> GSM96958     1  0.0707     0.8867 0.980 0.000 0.000 0.020
#> GSM96951     1  0.2408     0.8613 0.896 0.000 0.000 0.104
#> GSM96952     1  0.3726     0.8045 0.788 0.000 0.000 0.212
#> GSM96961     1  0.3610     0.8138 0.800 0.000 0.000 0.200

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97038     2  0.0510      0.939 0.000 0.984 0.000 0.016 0.000
#> GSM97045     2  0.0162      0.940 0.000 0.996 0.000 0.004 0.000
#> GSM97047     5  0.5552      0.624 0.176 0.052 0.016 0.040 0.716
#> GSM97025     2  0.0000      0.940 0.000 1.000 0.000 0.000 0.000
#> GSM97030     3  0.3885      0.840 0.176 0.000 0.784 0.040 0.000
#> GSM97027     2  0.0162      0.940 0.000 0.996 0.000 0.004 0.000
#> GSM97033     2  0.0609      0.939 0.000 0.980 0.000 0.020 0.000
#> GSM97034     3  0.3885      0.840 0.176 0.000 0.784 0.040 0.000
#> GSM97020     2  0.0609      0.939 0.000 0.980 0.000 0.020 0.000
#> GSM97026     5  0.4489      0.563 0.004 0.280 0.008 0.012 0.696
#> GSM97012     2  0.0898      0.936 0.008 0.972 0.000 0.020 0.000
#> GSM97015     3  0.3885      0.840 0.176 0.000 0.784 0.040 0.000
#> GSM97016     2  0.0000      0.940 0.000 1.000 0.000 0.000 0.000
#> GSM97017     5  0.0290      0.914 0.000 0.000 0.000 0.008 0.992
#> GSM97019     2  0.0609      0.938 0.000 0.980 0.000 0.020 0.000
#> GSM97022     2  0.0703      0.938 0.000 0.976 0.000 0.024 0.000
#> GSM97035     2  0.0404      0.939 0.000 0.988 0.000 0.012 0.000
#> GSM97036     5  0.1907      0.884 0.028 0.000 0.000 0.044 0.928
#> GSM97039     2  0.0609      0.939 0.000 0.980 0.000 0.020 0.000
#> GSM97046     2  0.0609      0.939 0.000 0.980 0.000 0.020 0.000
#> GSM97023     1  0.3210      0.922 0.788 0.000 0.000 0.000 0.212
#> GSM97029     5  0.0963      0.904 0.000 0.000 0.000 0.036 0.964
#> GSM97043     2  0.0000      0.940 0.000 1.000 0.000 0.000 0.000
#> GSM97013     5  0.0510      0.912 0.000 0.000 0.000 0.016 0.984
#> GSM96956     2  0.5126      0.684 0.176 0.724 0.076 0.024 0.000
#> GSM97024     2  0.3531      0.789 0.148 0.816 0.000 0.036 0.000
#> GSM97032     3  0.6479      0.670 0.176 0.176 0.608 0.040 0.000
#> GSM97044     3  0.3885      0.840 0.176 0.000 0.784 0.040 0.000
#> GSM97049     2  0.0609      0.939 0.000 0.980 0.000 0.020 0.000
#> GSM96968     3  0.2395      0.867 0.040 0.000 0.912 0.012 0.036
#> GSM96971     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM96986     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM97003     1  0.4492      0.888 0.744 0.000 0.056 0.004 0.196
#> GSM96957     5  0.0000      0.915 0.000 0.000 0.000 0.000 1.000
#> GSM96960     1  0.3921      0.905 0.784 0.000 0.000 0.044 0.172
#> GSM96975     5  0.4101      0.086 0.372 0.000 0.000 0.000 0.628
#> GSM96998     1  0.3596      0.924 0.784 0.000 0.000 0.016 0.200
#> GSM96999     5  0.0510      0.908 0.016 0.000 0.000 0.000 0.984
#> GSM97001     5  0.0000      0.915 0.000 0.000 0.000 0.000 1.000
#> GSM97005     5  0.1121      0.884 0.044 0.000 0.000 0.000 0.956
#> GSM97006     1  0.3710      0.920 0.784 0.000 0.000 0.024 0.192
#> GSM97021     5  0.0000      0.915 0.000 0.000 0.000 0.000 1.000
#> GSM97028     3  0.2280      0.867 0.120 0.000 0.880 0.000 0.000
#> GSM97031     1  0.3752      0.848 0.708 0.000 0.000 0.000 0.292
#> GSM97037     2  0.7060      0.233 0.176 0.516 0.264 0.044 0.000
#> GSM97018     3  0.6416      0.680 0.176 0.168 0.616 0.040 0.000
#> GSM97014     5  0.0880      0.892 0.000 0.032 0.000 0.000 0.968
#> GSM97042     2  0.1251      0.930 0.008 0.956 0.000 0.036 0.000
#> GSM97040     5  0.0000      0.915 0.000 0.000 0.000 0.000 1.000
#> GSM97041     5  0.0000      0.915 0.000 0.000 0.000 0.000 1.000
#> GSM96955     2  0.2474      0.887 0.000 0.908 0.012 0.040 0.040
#> GSM96990     3  0.3885      0.840 0.176 0.000 0.784 0.040 0.000
#> GSM96991     2  0.1444      0.927 0.012 0.948 0.000 0.040 0.000
#> GSM97048     2  0.0609      0.939 0.000 0.980 0.000 0.020 0.000
#> GSM96963     2  0.1106      0.934 0.012 0.964 0.000 0.024 0.000
#> GSM96953     2  0.0771      0.938 0.004 0.976 0.000 0.020 0.000
#> GSM96966     4  0.2674      0.896 0.140 0.000 0.000 0.856 0.004
#> GSM96979     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM96983     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM96984     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM96994     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM96996     1  0.3863      0.921 0.772 0.000 0.000 0.028 0.200
#> GSM96997     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM97007     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM96954     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM96962     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM96969     4  0.2516      0.899 0.140 0.000 0.000 0.860 0.000
#> GSM96970     4  0.2516      0.899 0.140 0.000 0.000 0.860 0.000
#> GSM96973     4  0.2516      0.899 0.140 0.000 0.000 0.860 0.000
#> GSM96976     4  0.3177      0.751 0.000 0.000 0.208 0.792 0.000
#> GSM96977     5  0.0404      0.911 0.012 0.000 0.000 0.000 0.988
#> GSM96995     3  0.4464      0.829 0.176 0.000 0.764 0.040 0.020
#> GSM97002     1  0.4417      0.866 0.760 0.000 0.000 0.092 0.148
#> GSM97009     5  0.3089      0.802 0.076 0.000 0.012 0.040 0.872
#> GSM97010     5  0.0290      0.913 0.008 0.000 0.000 0.000 0.992
#> GSM96974     4  0.2891      0.790 0.000 0.000 0.176 0.824 0.000
#> GSM96985     4  0.3151      0.824 0.020 0.000 0.144 0.836 0.000
#> GSM96959     3  0.5970      0.739 0.176 0.000 0.664 0.040 0.120
#> GSM96972     4  0.2516      0.899 0.140 0.000 0.000 0.860 0.000
#> GSM96978     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM96967     4  0.2516      0.899 0.140 0.000 0.000 0.860 0.000
#> GSM96987     1  0.3690      0.923 0.780 0.000 0.000 0.020 0.200
#> GSM97011     5  0.0000      0.915 0.000 0.000 0.000 0.000 1.000
#> GSM96964     1  0.3519      0.919 0.776 0.000 0.000 0.008 0.216
#> GSM96965     4  0.3194      0.754 0.020 0.000 0.000 0.832 0.148
#> GSM96981     1  0.3663      0.919 0.776 0.000 0.000 0.016 0.208
#> GSM96982     1  0.4504      0.743 0.748 0.000 0.000 0.168 0.084
#> GSM96988     3  0.0000      0.886 0.000 0.000 1.000 0.000 0.000
#> GSM97000     5  0.0000      0.915 0.000 0.000 0.000 0.000 1.000
#> GSM97004     1  0.3966      0.393 0.664 0.000 0.000 0.336 0.000
#> GSM97008     5  0.0000      0.915 0.000 0.000 0.000 0.000 1.000
#> GSM96950     5  0.2409      0.847 0.068 0.000 0.000 0.032 0.900
#> GSM96980     4  0.2561      0.897 0.144 0.000 0.000 0.856 0.000
#> GSM96989     1  0.3724      0.922 0.776 0.000 0.000 0.020 0.204
#> GSM96992     1  0.3496      0.924 0.788 0.000 0.000 0.012 0.200
#> GSM96993     5  0.1041      0.905 0.004 0.000 0.000 0.032 0.964
#> GSM96958     1  0.3837      0.821 0.692 0.000 0.000 0.000 0.308
#> GSM96951     1  0.3534      0.889 0.744 0.000 0.000 0.000 0.256
#> GSM96952     1  0.3496      0.924 0.788 0.000 0.000 0.012 0.200
#> GSM96961     1  0.3496      0.924 0.788 0.000 0.000 0.012 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
#> GSM97038     2  0.1297     0.9314 0.012 0.948 0.040 0.000 0.000 0.000
#> GSM97045     2  0.1500     0.9270 0.012 0.936 0.052 0.000 0.000 0.000
#> GSM97047     5  0.5183     0.0746 0.000 0.024 0.456 0.000 0.480 0.040
#> GSM97025     2  0.0993     0.9326 0.012 0.964 0.024 0.000 0.000 0.000
#> GSM97030     3  0.3996     0.7096 0.000 0.004 0.512 0.000 0.000 0.484
#> GSM97027     2  0.1434     0.9279 0.012 0.940 0.048 0.000 0.000 0.000
#> GSM97033     2  0.1563     0.9262 0.012 0.932 0.056 0.000 0.000 0.000
#> GSM97034     3  0.3867     0.7048 0.000 0.000 0.512 0.000 0.000 0.488
#> GSM97020     2  0.1745     0.9218 0.012 0.920 0.068 0.000 0.000 0.000
#> GSM97026     5  0.3794     0.8164 0.012 0.092 0.036 0.012 0.828 0.020
#> GSM97012     2  0.2165     0.9117 0.000 0.884 0.108 0.008 0.000 0.000
#> GSM97015     3  0.3867     0.7048 0.000 0.000 0.512 0.000 0.000 0.488
#> GSM97016     2  0.0291     0.9332 0.004 0.992 0.004 0.000 0.000 0.000
#> GSM97017     5  0.1078     0.9174 0.008 0.000 0.012 0.016 0.964 0.000
#> GSM97019     2  0.1866     0.9209 0.000 0.908 0.084 0.008 0.000 0.000
#> GSM97022     2  0.1918     0.9194 0.000 0.904 0.088 0.008 0.000 0.000
#> GSM97035     2  0.1812     0.9216 0.000 0.912 0.080 0.008 0.000 0.000
#> GSM97036     5  0.3768     0.8408 0.044 0.000 0.076 0.064 0.816 0.000
#> GSM97039     2  0.0713     0.9336 0.000 0.972 0.028 0.000 0.000 0.000
#> GSM97046     2  0.1007     0.9330 0.000 0.956 0.044 0.000 0.000 0.000
#> GSM97023     1  0.1411     0.8170 0.936 0.000 0.000 0.004 0.060 0.000
#> GSM97029     5  0.2763     0.8831 0.040 0.000 0.028 0.052 0.880 0.000
#> GSM97043     2  0.1151     0.9318 0.012 0.956 0.032 0.000 0.000 0.000
#> GSM97013     5  0.1622     0.9104 0.016 0.000 0.016 0.028 0.940 0.000
#> GSM96956     3  0.5418     0.4366 0.000 0.352 0.520 0.000 0.000 0.128
#> GSM97024     3  0.4531     0.1170 0.000 0.464 0.504 0.000 0.000 0.032
#> GSM97032     3  0.4882     0.7099 0.000 0.060 0.512 0.000 0.000 0.428
#> GSM97044     3  0.3867     0.7048 0.000 0.000 0.512 0.000 0.000 0.488
#> GSM97049     2  0.1686     0.9236 0.012 0.924 0.064 0.000 0.000 0.000
#> GSM96968     6  0.1588     0.8401 0.000 0.000 0.072 0.000 0.004 0.924
#> GSM96971     6  0.0000     0.9622 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96986     6  0.0000     0.9622 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97003     1  0.2812     0.7774 0.868 0.000 0.004 0.004 0.040 0.084
#> GSM96957     5  0.0000     0.9221 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM96960     1  0.2000     0.8142 0.916 0.000 0.004 0.048 0.032 0.000
#> GSM96975     1  0.5990     0.4131 0.400 0.000 0.232 0.000 0.368 0.000
#> GSM96998     1  0.4442     0.7926 0.696 0.000 0.248 0.020 0.036 0.000
#> GSM96999     5  0.0405     0.9200 0.008 0.000 0.004 0.000 0.988 0.000
#> GSM97001     5  0.0000     0.9221 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97005     5  0.2234     0.8278 0.124 0.000 0.004 0.000 0.872 0.000
#> GSM97006     1  0.1924     0.8133 0.920 0.000 0.004 0.048 0.028 0.000
#> GSM97021     5  0.0000     0.9221 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97028     6  0.2762     0.5191 0.000 0.000 0.196 0.000 0.000 0.804
#> GSM97031     1  0.2562     0.7856 0.860 0.000 0.004 0.004 0.128 0.004
#> GSM97037     3  0.5708     0.5886 0.000 0.216 0.520 0.000 0.000 0.264
#> GSM97018     3  0.4837     0.7096 0.000 0.056 0.512 0.000 0.000 0.432
#> GSM97014     5  0.0363     0.9180 0.012 0.000 0.000 0.000 0.988 0.000
#> GSM97042     2  0.2212     0.9100 0.000 0.880 0.112 0.008 0.000 0.000
#> GSM97040     5  0.0000     0.9221 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97041     5  0.0000     0.9221 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM96955     2  0.3650     0.8225 0.004 0.820 0.108 0.000 0.040 0.028
#> GSM96990     3  0.3996     0.7096 0.000 0.004 0.512 0.000 0.000 0.484
#> GSM96991     2  0.2257     0.9082 0.000 0.876 0.116 0.008 0.000 0.000
#> GSM97048     2  0.1563     0.9262 0.012 0.932 0.056 0.000 0.000 0.000
#> GSM96963     2  0.2257     0.9082 0.000 0.876 0.116 0.008 0.000 0.000
#> GSM96953     2  0.1866     0.9206 0.000 0.908 0.084 0.008 0.000 0.000
#> GSM96966     4  0.1765     0.8932 0.096 0.000 0.000 0.904 0.000 0.000
#> GSM96979     6  0.0000     0.9622 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96983     6  0.0000     0.9622 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96984     6  0.0000     0.9622 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96994     6  0.0000     0.9622 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96996     1  0.4815     0.7853 0.676 0.000 0.244 0.052 0.028 0.000
#> GSM96997     6  0.0000     0.9622 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97007     6  0.0000     0.9622 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96954     6  0.0000     0.9622 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96962     6  0.0000     0.9622 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96969     4  0.1610     0.8998 0.084 0.000 0.000 0.916 0.000 0.000
#> GSM96970     4  0.1610     0.8998 0.084 0.000 0.000 0.916 0.000 0.000
#> GSM96973     4  0.1610     0.8998 0.084 0.000 0.000 0.916 0.000 0.000
#> GSM96976     4  0.3345     0.7620 0.000 0.000 0.028 0.788 0.000 0.184
#> GSM96977     5  0.0551     0.9209 0.008 0.000 0.004 0.000 0.984 0.004
#> GSM96995     3  0.4260     0.7068 0.000 0.000 0.512 0.000 0.016 0.472
#> GSM97002     1  0.4868     0.7627 0.672 0.000 0.216 0.104 0.008 0.000
#> GSM97009     5  0.2145     0.8604 0.000 0.000 0.072 0.000 0.900 0.028
#> GSM97010     5  0.1426     0.9131 0.028 0.000 0.008 0.016 0.948 0.000
#> GSM96974     4  0.3206     0.7990 0.004 0.000 0.028 0.816 0.000 0.152
#> GSM96985     4  0.3161     0.8136 0.008 0.000 0.028 0.828 0.000 0.136
#> GSM96959     3  0.4967     0.6705 0.000 0.000 0.512 0.000 0.068 0.420
#> GSM96972     4  0.1610     0.8998 0.084 0.000 0.000 0.916 0.000 0.000
#> GSM96978     6  0.0000     0.9622 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96967     4  0.1610     0.8998 0.084 0.000 0.000 0.916 0.000 0.000
#> GSM96987     1  0.4531     0.7872 0.680 0.000 0.264 0.020 0.036 0.000
#> GSM97011     5  0.0000     0.9221 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM96964     1  0.2750     0.8291 0.868 0.000 0.080 0.004 0.048 0.000
#> GSM96965     4  0.3932     0.7498 0.032 0.000 0.080 0.800 0.088 0.000
#> GSM96981     1  0.4492     0.7898 0.684 0.000 0.260 0.016 0.040 0.000
#> GSM96982     1  0.5277     0.7383 0.636 0.000 0.228 0.120 0.016 0.000
#> GSM96988     6  0.0260     0.9513 0.000 0.000 0.000 0.008 0.000 0.992
#> GSM97000     5  0.0622     0.9167 0.008 0.000 0.000 0.000 0.980 0.012
#> GSM97004     1  0.5438     0.5820 0.560 0.000 0.160 0.280 0.000 0.000
#> GSM97008     5  0.0000     0.9221 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM96950     5  0.3842     0.8206 0.096 0.000 0.052 0.044 0.808 0.000
#> GSM96980     4  0.1806     0.8961 0.088 0.000 0.004 0.908 0.000 0.000
#> GSM96989     1  0.4531     0.7872 0.680 0.000 0.264 0.020 0.036 0.000
#> GSM96992     1  0.1572     0.8179 0.936 0.000 0.000 0.028 0.036 0.000
#> GSM96993     5  0.2252     0.8970 0.028 0.000 0.020 0.044 0.908 0.000
#> GSM96958     1  0.2178     0.7882 0.868 0.000 0.000 0.000 0.132 0.000
#> GSM96951     1  0.2196     0.7995 0.884 0.000 0.004 0.004 0.108 0.000
#> GSM96952     1  0.2883     0.8271 0.868 0.000 0.076 0.020 0.036 0.000
#> GSM96961     1  0.1616     0.8169 0.932 0.000 0.000 0.020 0.048 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-mclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:mclust 100         6.54e-06      0.4378     1.48e-10  0.00517 2
#> MAD:mclust  92         8.69e-05      0.4307     9.63e-18  0.03403 3
#> MAD:mclust  96         1.04e-05      0.0566     5.29e-19  0.03038 4
#> MAD:mclust  97         1.30e-04      0.2812     4.26e-16  0.24324 5
#> MAD:mclust  96         8.80e-06      0.1944     1.18e-18  0.04965 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 21168 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.966       0.986         0.4937 0.508   0.508
#> 3 3 0.889           0.900       0.952         0.3218 0.791   0.609
#> 4 4 0.626           0.628       0.753         0.1367 0.844   0.595
#> 5 5 0.600           0.549       0.737         0.0727 0.844   0.495
#> 6 6 0.622           0.460       0.709         0.0441 0.852   0.417

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
#> GSM97038     2  0.0000    0.98907 0.000 1.000
#> GSM97045     2  0.0000    0.98907 0.000 1.000
#> GSM97047     2  0.0000    0.98907 0.000 1.000
#> GSM97025     2  0.0000    0.98907 0.000 1.000
#> GSM97030     2  0.0000    0.98907 0.000 1.000
#> GSM97027     2  0.0000    0.98907 0.000 1.000
#> GSM97033     2  0.0000    0.98907 0.000 1.000
#> GSM97034     2  0.0000    0.98907 0.000 1.000
#> GSM97020     2  0.0000    0.98907 0.000 1.000
#> GSM97026     2  0.0000    0.98907 0.000 1.000
#> GSM97012     2  0.0000    0.98907 0.000 1.000
#> GSM97015     2  0.0000    0.98907 0.000 1.000
#> GSM97016     2  0.0000    0.98907 0.000 1.000
#> GSM97017     1  0.0000    0.98304 1.000 0.000
#> GSM97019     2  0.0000    0.98907 0.000 1.000
#> GSM97022     2  0.0000    0.98907 0.000 1.000
#> GSM97035     2  0.0000    0.98907 0.000 1.000
#> GSM97036     1  0.0938    0.97438 0.988 0.012
#> GSM97039     2  0.0000    0.98907 0.000 1.000
#> GSM97046     2  0.0000    0.98907 0.000 1.000
#> GSM97023     1  0.0000    0.98304 1.000 0.000
#> GSM97029     1  0.2043    0.95731 0.968 0.032
#> GSM97043     2  0.0000    0.98907 0.000 1.000
#> GSM97013     1  0.0000    0.98304 1.000 0.000
#> GSM96956     2  0.0000    0.98907 0.000 1.000
#> GSM97024     2  0.0000    0.98907 0.000 1.000
#> GSM97032     2  0.0000    0.98907 0.000 1.000
#> GSM97044     2  0.0000    0.98907 0.000 1.000
#> GSM97049     2  0.0000    0.98907 0.000 1.000
#> GSM96968     1  0.4562    0.89062 0.904 0.096
#> GSM96971     1  0.0000    0.98304 1.000 0.000
#> GSM96986     1  0.0000    0.98304 1.000 0.000
#> GSM97003     1  0.0000    0.98304 1.000 0.000
#> GSM96957     1  0.0376    0.98041 0.996 0.004
#> GSM96960     1  0.0000    0.98304 1.000 0.000
#> GSM96975     1  0.0000    0.98304 1.000 0.000
#> GSM96998     1  0.0000    0.98304 1.000 0.000
#> GSM96999     1  0.0000    0.98304 1.000 0.000
#> GSM97001     1  0.0000    0.98304 1.000 0.000
#> GSM97005     1  0.0000    0.98304 1.000 0.000
#> GSM97006     1  0.0000    0.98304 1.000 0.000
#> GSM97021     1  0.0000    0.98304 1.000 0.000
#> GSM97028     1  1.0000    0.00385 0.504 0.496
#> GSM97031     1  0.0000    0.98304 1.000 0.000
#> GSM97037     2  0.0000    0.98907 0.000 1.000
#> GSM97018     2  0.0000    0.98907 0.000 1.000
#> GSM97014     2  0.0000    0.98907 0.000 1.000
#> GSM97042     2  0.0000    0.98907 0.000 1.000
#> GSM97040     2  0.1184    0.97420 0.016 0.984
#> GSM97041     1  0.3584    0.92260 0.932 0.068
#> GSM96955     2  0.0000    0.98907 0.000 1.000
#> GSM96990     2  0.0000    0.98907 0.000 1.000
#> GSM96991     2  0.0000    0.98907 0.000 1.000
#> GSM97048     2  0.0000    0.98907 0.000 1.000
#> GSM96963     2  0.0000    0.98907 0.000 1.000
#> GSM96953     2  0.0000    0.98907 0.000 1.000
#> GSM96966     1  0.0000    0.98304 1.000 0.000
#> GSM96979     1  0.0000    0.98304 1.000 0.000
#> GSM96983     2  0.0000    0.98907 0.000 1.000
#> GSM96984     1  0.6343    0.80969 0.840 0.160
#> GSM96994     2  0.0000    0.98907 0.000 1.000
#> GSM96996     1  0.0000    0.98304 1.000 0.000
#> GSM96997     1  0.0000    0.98304 1.000 0.000
#> GSM97007     2  0.0000    0.98907 0.000 1.000
#> GSM96954     1  0.0000    0.98304 1.000 0.000
#> GSM96962     1  0.0000    0.98304 1.000 0.000
#> GSM96969     1  0.0000    0.98304 1.000 0.000
#> GSM96970     1  0.0000    0.98304 1.000 0.000
#> GSM96973     1  0.0000    0.98304 1.000 0.000
#> GSM96976     2  0.6048    0.82213 0.148 0.852
#> GSM96977     1  0.0000    0.98304 1.000 0.000
#> GSM96995     2  0.8443    0.62121 0.272 0.728
#> GSM97002     1  0.0000    0.98304 1.000 0.000
#> GSM97009     2  0.0000    0.98907 0.000 1.000
#> GSM97010     1  0.1184    0.97140 0.984 0.016
#> GSM96974     1  0.0000    0.98304 1.000 0.000
#> GSM96985     1  0.0000    0.98304 1.000 0.000
#> GSM96959     2  0.0000    0.98907 0.000 1.000
#> GSM96972     1  0.0000    0.98304 1.000 0.000
#> GSM96978     1  0.2423    0.95021 0.960 0.040
#> GSM96967     1  0.0000    0.98304 1.000 0.000
#> GSM96987     1  0.0000    0.98304 1.000 0.000
#> GSM97011     1  0.1184    0.97131 0.984 0.016
#> GSM96964     1  0.0000    0.98304 1.000 0.000
#> GSM96965     1  0.0376    0.98041 0.996 0.004
#> GSM96981     1  0.0000    0.98304 1.000 0.000
#> GSM96982     1  0.0000    0.98304 1.000 0.000
#> GSM96988     1  0.0000    0.98304 1.000 0.000
#> GSM97000     1  0.0000    0.98304 1.000 0.000
#> GSM97004     1  0.0000    0.98304 1.000 0.000
#> GSM97008     1  0.0000    0.98304 1.000 0.000
#> GSM96950     1  0.0000    0.98304 1.000 0.000
#> GSM96980     1  0.0000    0.98304 1.000 0.000
#> GSM96989     1  0.0000    0.98304 1.000 0.000
#> GSM96992     1  0.0000    0.98304 1.000 0.000
#> GSM96993     1  0.0672    0.97757 0.992 0.008
#> GSM96958     1  0.0000    0.98304 1.000 0.000
#> GSM96951     1  0.0000    0.98304 1.000 0.000
#> GSM96952     1  0.0000    0.98304 1.000 0.000
#> GSM96961     1  0.0000    0.98304 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
#> GSM97038     2  0.0237     0.9311 0.000 0.996 0.004
#> GSM97045     2  0.0424     0.9278 0.008 0.992 0.000
#> GSM97047     2  0.0424     0.9278 0.008 0.992 0.000
#> GSM97025     2  0.0000     0.9305 0.000 1.000 0.000
#> GSM97030     3  0.3551     0.8338 0.000 0.132 0.868
#> GSM97027     2  0.0424     0.9278 0.008 0.992 0.000
#> GSM97033     2  0.0000     0.9305 0.000 1.000 0.000
#> GSM97034     3  0.5098     0.6748 0.000 0.248 0.752
#> GSM97020     2  0.0424     0.9278 0.008 0.992 0.000
#> GSM97026     2  0.0424     0.9278 0.008 0.992 0.000
#> GSM97012     2  0.0424     0.9305 0.000 0.992 0.008
#> GSM97015     3  0.4555     0.7498 0.000 0.200 0.800
#> GSM97016     2  0.0237     0.9311 0.000 0.996 0.004
#> GSM97017     1  0.2356     0.9213 0.928 0.072 0.000
#> GSM97019     2  0.0424     0.9305 0.000 0.992 0.008
#> GSM97022     2  0.0592     0.9286 0.000 0.988 0.012
#> GSM97035     2  0.0424     0.9305 0.000 0.992 0.008
#> GSM97036     1  0.3412     0.8713 0.876 0.124 0.000
#> GSM97039     2  0.0237     0.9311 0.000 0.996 0.004
#> GSM97046     2  0.0237     0.9311 0.000 0.996 0.004
#> GSM97023     1  0.0000     0.9652 1.000 0.000 0.000
#> GSM97029     1  0.3340     0.8752 0.880 0.120 0.000
#> GSM97043     2  0.0237     0.9311 0.000 0.996 0.004
#> GSM97013     1  0.1411     0.9503 0.964 0.036 0.000
#> GSM96956     3  0.6192     0.2667 0.000 0.420 0.580
#> GSM97024     2  0.0892     0.9230 0.000 0.980 0.020
#> GSM97032     2  0.5591     0.5617 0.000 0.696 0.304
#> GSM97044     3  0.2356     0.8921 0.000 0.072 0.928
#> GSM97049     2  0.0424     0.9278 0.008 0.992 0.000
#> GSM96968     3  0.0237     0.9378 0.004 0.000 0.996
#> GSM96971     3  0.0237     0.9378 0.004 0.000 0.996
#> GSM96986     3  0.0237     0.9378 0.004 0.000 0.996
#> GSM97003     1  0.5254     0.6913 0.736 0.000 0.264
#> GSM96957     1  0.0747     0.9607 0.984 0.016 0.000
#> GSM96960     1  0.2625     0.9251 0.916 0.000 0.084
#> GSM96975     1  0.0424     0.9655 0.992 0.000 0.008
#> GSM96998     1  0.0000     0.9652 1.000 0.000 0.000
#> GSM96999     1  0.0237     0.9643 0.996 0.004 0.000
#> GSM97001     1  0.1411     0.9501 0.964 0.036 0.000
#> GSM97005     1  0.0237     0.9643 0.996 0.004 0.000
#> GSM97006     1  0.1411     0.9570 0.964 0.000 0.036
#> GSM97021     1  0.0592     0.9621 0.988 0.012 0.000
#> GSM97028     3  0.0424     0.9372 0.000 0.008 0.992
#> GSM97031     1  0.2878     0.9141 0.904 0.000 0.096
#> GSM97037     2  0.4452     0.7421 0.000 0.808 0.192
#> GSM97018     2  0.6260     0.1874 0.000 0.552 0.448
#> GSM97014     2  0.1529     0.8998 0.040 0.960 0.000
#> GSM97042     2  0.0424     0.9305 0.000 0.992 0.008
#> GSM97040     2  0.2448     0.8619 0.076 0.924 0.000
#> GSM97041     1  0.3482     0.8672 0.872 0.128 0.000
#> GSM96955     2  0.0237     0.9311 0.000 0.996 0.004
#> GSM96990     2  0.6299     0.0767 0.000 0.524 0.476
#> GSM96991     2  0.0424     0.9305 0.000 0.992 0.008
#> GSM97048     2  0.0000     0.9305 0.000 1.000 0.000
#> GSM96963     2  0.0424     0.9305 0.000 0.992 0.008
#> GSM96953     2  0.0424     0.9305 0.000 0.992 0.008
#> GSM96966     1  0.1031     0.9623 0.976 0.000 0.024
#> GSM96979     3  0.0592     0.9324 0.012 0.000 0.988
#> GSM96983     3  0.0424     0.9372 0.000 0.008 0.992
#> GSM96984     3  0.0237     0.9378 0.000 0.004 0.996
#> GSM96994     3  0.0424     0.9372 0.000 0.008 0.992
#> GSM96996     1  0.0424     0.9655 0.992 0.000 0.008
#> GSM96997     3  0.0237     0.9378 0.004 0.000 0.996
#> GSM97007     3  0.0424     0.9372 0.000 0.008 0.992
#> GSM96954     3  0.0592     0.9324 0.012 0.000 0.988
#> GSM96962     3  0.0237     0.9378 0.004 0.000 0.996
#> GSM96969     1  0.2165     0.9403 0.936 0.000 0.064
#> GSM96970     1  0.1163     0.9607 0.972 0.000 0.028
#> GSM96973     1  0.2261     0.9380 0.932 0.000 0.068
#> GSM96976     3  0.0424     0.9372 0.000 0.008 0.992
#> GSM96977     1  0.0892     0.9638 0.980 0.000 0.020
#> GSM96995     3  0.1860     0.9099 0.000 0.052 0.948
#> GSM97002     1  0.0592     0.9652 0.988 0.000 0.012
#> GSM97009     2  0.0424     0.9278 0.008 0.992 0.000
#> GSM97010     1  0.0848     0.9659 0.984 0.008 0.008
#> GSM96974     3  0.0237     0.9378 0.004 0.000 0.996
#> GSM96985     3  0.0424     0.9351 0.008 0.000 0.992
#> GSM96959     2  0.5138     0.6556 0.000 0.748 0.252
#> GSM96972     1  0.2165     0.9403 0.936 0.000 0.064
#> GSM96978     3  0.0237     0.9378 0.000 0.004 0.996
#> GSM96967     1  0.2165     0.9405 0.936 0.000 0.064
#> GSM96987     1  0.0237     0.9643 0.996 0.004 0.000
#> GSM97011     1  0.1031     0.9575 0.976 0.024 0.000
#> GSM96964     1  0.0000     0.9652 1.000 0.000 0.000
#> GSM96965     1  0.0848     0.9658 0.984 0.008 0.008
#> GSM96981     1  0.0237     0.9654 0.996 0.000 0.004
#> GSM96982     1  0.0892     0.9636 0.980 0.000 0.020
#> GSM96988     3  0.0237     0.9378 0.004 0.000 0.996
#> GSM97000     1  0.1529     0.9550 0.960 0.000 0.040
#> GSM97004     1  0.0747     0.9645 0.984 0.000 0.016
#> GSM97008     1  0.0237     0.9643 0.996 0.004 0.000
#> GSM96950     1  0.0237     0.9643 0.996 0.004 0.000
#> GSM96980     1  0.0892     0.9636 0.980 0.000 0.020
#> GSM96989     1  0.0000     0.9652 1.000 0.000 0.000
#> GSM96992     1  0.0592     0.9652 0.988 0.000 0.012
#> GSM96993     1  0.1031     0.9573 0.976 0.024 0.000
#> GSM96958     1  0.0424     0.9655 0.992 0.000 0.008
#> GSM96951     1  0.0592     0.9652 0.988 0.000 0.012
#> GSM96952     1  0.0424     0.9655 0.992 0.000 0.008
#> GSM96961     1  0.0424     0.9655 0.992 0.000 0.008

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.0817     0.8288 0.000 0.976 0.000 0.024
#> GSM97045     2  0.0927     0.8179 0.016 0.976 0.000 0.008
#> GSM97047     2  0.3725     0.6522 0.180 0.812 0.000 0.008
#> GSM97025     2  0.1211     0.8311 0.000 0.960 0.000 0.040
#> GSM97030     3  0.0657     0.8799 0.000 0.012 0.984 0.004
#> GSM97027     2  0.0657     0.8168 0.012 0.984 0.000 0.004
#> GSM97033     2  0.0000     0.8230 0.000 1.000 0.000 0.000
#> GSM97034     3  0.4389     0.7713 0.000 0.072 0.812 0.116
#> GSM97020     2  0.0927     0.8179 0.016 0.976 0.000 0.008
#> GSM97026     2  0.2521     0.8284 0.024 0.912 0.000 0.064
#> GSM97012     2  0.4585     0.7560 0.000 0.668 0.000 0.332
#> GSM97015     3  0.1082     0.8762 0.004 0.020 0.972 0.004
#> GSM97016     2  0.1637     0.8321 0.000 0.940 0.000 0.060
#> GSM97017     1  0.3626     0.5948 0.812 0.184 0.000 0.004
#> GSM97019     2  0.4072     0.7944 0.000 0.748 0.000 0.252
#> GSM97022     2  0.4164     0.7896 0.000 0.736 0.000 0.264
#> GSM97035     2  0.4356     0.7767 0.000 0.708 0.000 0.292
#> GSM97036     1  0.5440     0.4151 0.736 0.104 0.000 0.160
#> GSM97039     2  0.1022     0.8298 0.000 0.968 0.000 0.032
#> GSM97046     2  0.2469     0.8281 0.000 0.892 0.000 0.108
#> GSM97023     1  0.0469     0.6330 0.988 0.000 0.000 0.012
#> GSM97029     1  0.4152     0.6019 0.808 0.160 0.000 0.032
#> GSM97043     2  0.1940     0.8307 0.000 0.924 0.000 0.076
#> GSM97013     1  0.3610     0.5893 0.800 0.200 0.000 0.000
#> GSM96956     2  0.7650     0.2442 0.000 0.424 0.364 0.212
#> GSM97024     2  0.2197     0.8309 0.000 0.916 0.004 0.080
#> GSM97032     3  0.6800    -0.0942 0.000 0.444 0.460 0.096
#> GSM97044     3  0.0336     0.8803 0.000 0.008 0.992 0.000
#> GSM97049     2  0.0804     0.8197 0.012 0.980 0.000 0.008
#> GSM96968     3  0.0336     0.8801 0.008 0.000 0.992 0.000
#> GSM96971     3  0.3975     0.6874 0.000 0.000 0.760 0.240
#> GSM96986     3  0.0188     0.8808 0.004 0.000 0.996 0.000
#> GSM97003     3  0.6626     0.1898 0.364 0.000 0.544 0.092
#> GSM96957     1  0.4792     0.5155 0.680 0.312 0.000 0.008
#> GSM96960     1  0.5372    -0.4225 0.544 0.000 0.012 0.444
#> GSM96975     1  0.4072     0.3191 0.748 0.000 0.000 0.252
#> GSM96998     1  0.3444     0.4755 0.816 0.000 0.000 0.184
#> GSM96999     1  0.0524     0.6355 0.988 0.008 0.000 0.004
#> GSM97001     1  0.4697     0.5280 0.696 0.296 0.000 0.008
#> GSM97005     1  0.1004     0.6352 0.972 0.024 0.000 0.004
#> GSM97006     1  0.3975     0.3545 0.760 0.000 0.000 0.240
#> GSM97021     1  0.4673     0.5307 0.700 0.292 0.000 0.008
#> GSM97028     3  0.0469     0.8802 0.000 0.000 0.988 0.012
#> GSM97031     1  0.5296    -0.0184 0.500 0.000 0.492 0.008
#> GSM97037     2  0.6359     0.6265 0.000 0.648 0.220 0.132
#> GSM97018     2  0.7085     0.6210 0.000 0.544 0.156 0.300
#> GSM97014     2  0.4328     0.5484 0.244 0.748 0.000 0.008
#> GSM97042     2  0.4585     0.7562 0.000 0.668 0.000 0.332
#> GSM97040     1  0.5203     0.3387 0.576 0.416 0.000 0.008
#> GSM97041     1  0.4973     0.4788 0.644 0.348 0.000 0.008
#> GSM96955     2  0.4250     0.7753 0.000 0.724 0.000 0.276
#> GSM96990     3  0.4235     0.7800 0.000 0.092 0.824 0.084
#> GSM96991     2  0.4817     0.7163 0.000 0.612 0.000 0.388
#> GSM97048     2  0.0188     0.8219 0.004 0.996 0.000 0.000
#> GSM96963     2  0.4761     0.7289 0.000 0.628 0.000 0.372
#> GSM96953     2  0.4500     0.7648 0.000 0.684 0.000 0.316
#> GSM96966     4  0.4973     0.7584 0.348 0.000 0.008 0.644
#> GSM96979     3  0.0707     0.8744 0.000 0.000 0.980 0.020
#> GSM96983     3  0.1302     0.8700 0.000 0.000 0.956 0.044
#> GSM96984     3  0.0000     0.8810 0.000 0.000 1.000 0.000
#> GSM96994     3  0.0188     0.8808 0.000 0.000 0.996 0.004
#> GSM96996     1  0.4877    -0.2518 0.592 0.000 0.000 0.408
#> GSM96997     3  0.0000     0.8810 0.000 0.000 1.000 0.000
#> GSM97007     3  0.0000     0.8810 0.000 0.000 1.000 0.000
#> GSM96954     3  0.0469     0.8793 0.012 0.000 0.988 0.000
#> GSM96962     3  0.0000     0.8810 0.000 0.000 1.000 0.000
#> GSM96969     4  0.5040     0.7518 0.364 0.000 0.008 0.628
#> GSM96970     4  0.4917     0.7602 0.336 0.000 0.008 0.656
#> GSM96973     4  0.4792     0.7539 0.312 0.000 0.008 0.680
#> GSM96976     4  0.1938     0.4626 0.000 0.052 0.012 0.936
#> GSM96977     1  0.0844     0.6357 0.980 0.004 0.004 0.012
#> GSM96995     3  0.0712     0.8799 0.004 0.008 0.984 0.004
#> GSM97002     4  0.4985     0.5967 0.468 0.000 0.000 0.532
#> GSM97009     2  0.2714     0.7366 0.112 0.884 0.000 0.004
#> GSM97010     1  0.5669    -0.4881 0.516 0.016 0.004 0.464
#> GSM96974     4  0.1362     0.5492 0.012 0.004 0.020 0.964
#> GSM96985     4  0.1674     0.5670 0.032 0.004 0.012 0.952
#> GSM96959     3  0.4867     0.7261 0.048 0.164 0.780 0.008
#> GSM96972     4  0.5085     0.7429 0.376 0.000 0.008 0.616
#> GSM96978     3  0.4679     0.6091 0.000 0.000 0.648 0.352
#> GSM96967     4  0.4877     0.7594 0.328 0.000 0.008 0.664
#> GSM96987     1  0.3074     0.5334 0.848 0.000 0.000 0.152
#> GSM97011     1  0.4228     0.5694 0.760 0.232 0.000 0.008
#> GSM96964     1  0.1211     0.6259 0.960 0.000 0.000 0.040
#> GSM96965     4  0.4049     0.6881 0.212 0.008 0.000 0.780
#> GSM96981     1  0.4925    -0.3312 0.572 0.000 0.000 0.428
#> GSM96982     4  0.4955     0.6498 0.444 0.000 0.000 0.556
#> GSM96988     3  0.4252     0.7152 0.004 0.000 0.744 0.252
#> GSM97000     1  0.5595     0.2009 0.576 0.012 0.404 0.008
#> GSM97004     4  0.4972     0.6256 0.456 0.000 0.000 0.544
#> GSM97008     1  0.4975     0.5690 0.752 0.208 0.032 0.008
#> GSM96950     1  0.1792     0.6103 0.932 0.000 0.000 0.068
#> GSM96980     4  0.4991     0.7315 0.388 0.000 0.004 0.608
#> GSM96989     1  0.3123     0.5265 0.844 0.000 0.000 0.156
#> GSM96992     1  0.2921     0.5382 0.860 0.000 0.000 0.140
#> GSM96993     1  0.1913     0.6365 0.940 0.040 0.000 0.020
#> GSM96958     1  0.1022     0.6270 0.968 0.000 0.000 0.032
#> GSM96951     1  0.1151     0.6312 0.968 0.000 0.008 0.024
#> GSM96952     1  0.2814     0.5480 0.868 0.000 0.000 0.132
#> GSM96961     1  0.1211     0.6232 0.960 0.000 0.000 0.040

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>          class entropy silhouette    p1    p2    p3    p4    p5
#> GSM97038     5  0.3355     0.6301 0.000 0.184 0.000 0.012 0.804
#> GSM97045     5  0.4855     0.2396 0.024 0.424 0.000 0.000 0.552
#> GSM97047     5  0.3651     0.5597 0.108 0.060 0.000 0.004 0.828
#> GSM97025     2  0.4371     0.4549 0.012 0.644 0.000 0.000 0.344
#> GSM97030     3  0.1768     0.7338 0.000 0.072 0.924 0.000 0.004
#> GSM97027     5  0.4978     0.0592 0.028 0.476 0.000 0.000 0.496
#> GSM97033     5  0.3395     0.6135 0.000 0.236 0.000 0.000 0.764
#> GSM97034     2  0.5186     0.3316 0.040 0.612 0.340 0.000 0.008
#> GSM97020     5  0.3700     0.6082 0.008 0.240 0.000 0.000 0.752
#> GSM97026     2  0.5278     0.5345 0.156 0.692 0.000 0.004 0.148
#> GSM97012     2  0.3596     0.6287 0.000 0.776 0.000 0.012 0.212
#> GSM97015     3  0.3381     0.6676 0.016 0.160 0.820 0.000 0.004
#> GSM97016     5  0.4060     0.4278 0.000 0.360 0.000 0.000 0.640
#> GSM97017     1  0.4197     0.6946 0.760 0.024 0.000 0.012 0.204
#> GSM97019     2  0.3300     0.6529 0.000 0.792 0.000 0.004 0.204
#> GSM97022     2  0.3607     0.6246 0.000 0.752 0.000 0.004 0.244
#> GSM97035     2  0.4130     0.5474 0.000 0.696 0.000 0.012 0.292
#> GSM97036     1  0.5505     0.4007 0.604 0.304 0.000 0.092 0.000
#> GSM97039     5  0.3452     0.6065 0.000 0.244 0.000 0.000 0.756
#> GSM97046     5  0.3700     0.6068 0.000 0.240 0.000 0.008 0.752
#> GSM97023     1  0.2409     0.7146 0.900 0.000 0.000 0.068 0.032
#> GSM97029     1  0.4106     0.6587 0.800 0.140 0.000 0.020 0.040
#> GSM97043     2  0.4031     0.6323 0.048 0.788 0.004 0.000 0.160
#> GSM97013     1  0.4001     0.6909 0.820 0.048 0.000 0.028 0.104
#> GSM96956     3  0.7158    -0.0909 0.000 0.236 0.404 0.020 0.340
#> GSM97024     2  0.4088     0.5913 0.004 0.712 0.008 0.000 0.276
#> GSM97032     2  0.5061     0.4300 0.020 0.644 0.312 0.000 0.024
#> GSM97044     3  0.1792     0.7314 0.000 0.084 0.916 0.000 0.000
#> GSM97049     5  0.3231     0.6318 0.004 0.196 0.000 0.000 0.800
#> GSM96968     3  0.0798     0.7499 0.008 0.016 0.976 0.000 0.000
#> GSM96971     4  0.4559    -0.0735 0.000 0.008 0.480 0.512 0.000
#> GSM96986     3  0.2424     0.7292 0.008 0.000 0.908 0.032 0.052
#> GSM97003     3  0.7455     0.1687 0.124 0.000 0.484 0.292 0.100
#> GSM96957     1  0.4517     0.4556 0.556 0.000 0.008 0.000 0.436
#> GSM96960     4  0.6029     0.4894 0.324 0.004 0.060 0.584 0.028
#> GSM96975     4  0.6614     0.1771 0.340 0.008 0.000 0.476 0.176
#> GSM96998     1  0.3920     0.4889 0.724 0.004 0.000 0.268 0.004
#> GSM96999     1  0.4998     0.6463 0.716 0.000 0.004 0.172 0.108
#> GSM97001     5  0.4655    -0.1082 0.384 0.000 0.004 0.012 0.600
#> GSM97005     1  0.5839     0.6327 0.648 0.000 0.028 0.092 0.232
#> GSM97006     1  0.5842     0.1668 0.536 0.000 0.032 0.392 0.040
#> GSM97021     1  0.3918     0.6794 0.752 0.008 0.008 0.000 0.232
#> GSM97028     3  0.4723     0.2645 0.016 0.448 0.536 0.000 0.000
#> GSM97031     3  0.6659     0.4052 0.208 0.000 0.596 0.056 0.140
#> GSM97037     2  0.6036     0.3767 0.004 0.540 0.340 0.000 0.116
#> GSM97018     2  0.3352     0.5531 0.004 0.800 0.192 0.000 0.004
#> GSM97014     5  0.2875     0.5953 0.056 0.052 0.000 0.008 0.884
#> GSM97042     2  0.3621     0.6458 0.000 0.788 0.000 0.020 0.192
#> GSM97040     1  0.5103     0.5325 0.616 0.024 0.016 0.000 0.344
#> GSM97041     1  0.4490     0.6565 0.724 0.052 0.000 0.000 0.224
#> GSM96955     5  0.5309     0.4992 0.012 0.236 0.000 0.076 0.676
#> GSM96990     3  0.4779     0.1349 0.012 0.448 0.536 0.000 0.004
#> GSM96991     2  0.2719     0.6217 0.000 0.884 0.000 0.048 0.068
#> GSM97048     5  0.3143     0.6302 0.000 0.204 0.000 0.000 0.796
#> GSM96963     2  0.4219     0.5700 0.000 0.772 0.000 0.072 0.156
#> GSM96953     5  0.5083     0.2481 0.000 0.432 0.000 0.036 0.532
#> GSM96966     4  0.1831     0.7405 0.076 0.004 0.000 0.920 0.000
#> GSM96979     3  0.2011     0.7311 0.004 0.000 0.908 0.088 0.000
#> GSM96983     3  0.3123     0.6968 0.000 0.160 0.828 0.012 0.000
#> GSM96984     3  0.0880     0.7491 0.000 0.000 0.968 0.032 0.000
#> GSM96994     3  0.0955     0.7500 0.000 0.000 0.968 0.028 0.004
#> GSM96996     4  0.4796     0.2014 0.468 0.004 0.000 0.516 0.012
#> GSM96997     3  0.1579     0.7444 0.000 0.000 0.944 0.024 0.032
#> GSM97007     3  0.0807     0.7505 0.000 0.012 0.976 0.012 0.000
#> GSM96954     3  0.1267     0.7504 0.024 0.012 0.960 0.000 0.004
#> GSM96962     3  0.0510     0.7495 0.000 0.000 0.984 0.016 0.000
#> GSM96969     4  0.1792     0.7400 0.084 0.000 0.000 0.916 0.000
#> GSM96970     4  0.1430     0.7398 0.052 0.000 0.000 0.944 0.004
#> GSM96973     4  0.0955     0.7354 0.028 0.000 0.004 0.968 0.000
#> GSM96976     4  0.3047     0.6747 0.000 0.096 0.012 0.868 0.024
#> GSM96977     1  0.5895     0.6695 0.704 0.016 0.040 0.104 0.136
#> GSM96995     3  0.1653     0.7499 0.028 0.024 0.944 0.000 0.004
#> GSM97002     4  0.4201     0.5558 0.328 0.008 0.000 0.664 0.000
#> GSM97009     5  0.2625     0.5799 0.056 0.028 0.000 0.016 0.900
#> GSM97010     4  0.5304     0.6501 0.108 0.000 0.020 0.712 0.160
#> GSM96974     4  0.2930     0.6661 0.004 0.164 0.000 0.832 0.000
#> GSM96985     4  0.4758     0.6253 0.040 0.248 0.004 0.704 0.004
#> GSM96959     5  0.5342     0.2995 0.072 0.000 0.268 0.008 0.652
#> GSM96972     4  0.2604     0.7337 0.108 0.004 0.004 0.880 0.004
#> GSM96978     3  0.6328     0.4353 0.000 0.228 0.528 0.244 0.000
#> GSM96967     4  0.1942     0.7412 0.068 0.012 0.000 0.920 0.000
#> GSM96987     1  0.3321     0.6528 0.832 0.032 0.000 0.136 0.000
#> GSM97011     5  0.4409     0.3712 0.220 0.004 0.000 0.040 0.736
#> GSM96964     1  0.2610     0.6944 0.892 0.028 0.000 0.076 0.004
#> GSM96965     4  0.2006     0.7245 0.024 0.020 0.000 0.932 0.024
#> GSM96981     4  0.6216     0.4284 0.280 0.012 0.000 0.572 0.136
#> GSM96982     4  0.5291     0.6471 0.220 0.040 0.000 0.696 0.044
#> GSM96988     3  0.5807     0.2496 0.020 0.444 0.488 0.048 0.000
#> GSM97000     3  0.7214     0.1740 0.252 0.000 0.464 0.032 0.252
#> GSM97004     4  0.4299     0.4654 0.388 0.004 0.000 0.608 0.000
#> GSM97008     1  0.6460     0.3810 0.472 0.000 0.092 0.028 0.408
#> GSM96950     1  0.3171     0.6893 0.864 0.044 0.000 0.084 0.008
#> GSM96980     4  0.2971     0.7173 0.156 0.008 0.000 0.836 0.000
#> GSM96989     1  0.3165     0.6681 0.848 0.036 0.000 0.116 0.000
#> GSM96992     1  0.4599     0.6224 0.752 0.004 0.004 0.176 0.064
#> GSM96993     1  0.3497     0.6732 0.840 0.108 0.000 0.044 0.008
#> GSM96958     1  0.4877     0.6703 0.732 0.000 0.004 0.136 0.128
#> GSM96951     1  0.4267     0.7035 0.800 0.000 0.028 0.052 0.120
#> GSM96952     1  0.3567     0.6589 0.820 0.004 0.000 0.144 0.032
#> GSM96961     1  0.2069     0.7051 0.912 0.000 0.000 0.076 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
#> GSM97038     3  0.2152     0.6871 0.004 0.024 0.904 0.000 0.068 0.000
#> GSM97045     2  0.6247     0.2835 0.020 0.416 0.384 0.000 0.180 0.000
#> GSM97047     5  0.4800     0.2808 0.012 0.040 0.316 0.004 0.628 0.000
#> GSM97025     2  0.5404     0.5193 0.024 0.576 0.324 0.000 0.076 0.000
#> GSM97030     6  0.2009     0.7430 0.000 0.084 0.004 0.000 0.008 0.904
#> GSM97027     2  0.6237     0.2711 0.028 0.412 0.408 0.000 0.152 0.000
#> GSM97033     3  0.3784     0.5368 0.000 0.144 0.776 0.000 0.080 0.000
#> GSM97034     2  0.5347     0.4741 0.060 0.648 0.008 0.004 0.028 0.252
#> GSM97020     3  0.2432     0.6514 0.008 0.080 0.888 0.000 0.024 0.000
#> GSM97026     2  0.5898     0.4497 0.328 0.536 0.092 0.000 0.044 0.000
#> GSM97012     2  0.3338     0.6327 0.004 0.800 0.176 0.012 0.008 0.000
#> GSM97015     6  0.4021     0.6967 0.048 0.120 0.008 0.000 0.028 0.796
#> GSM97016     3  0.1411     0.6869 0.000 0.060 0.936 0.000 0.004 0.000
#> GSM97017     5  0.4736     0.2597 0.432 0.008 0.032 0.000 0.528 0.000
#> GSM97019     2  0.3088     0.6433 0.000 0.808 0.172 0.000 0.020 0.000
#> GSM97022     2  0.3791     0.6210 0.000 0.732 0.236 0.000 0.032 0.000
#> GSM97035     2  0.3985     0.5818 0.004 0.688 0.292 0.004 0.012 0.000
#> GSM97036     1  0.3635     0.5304 0.788 0.176 0.008 0.016 0.012 0.000
#> GSM97039     3  0.1080     0.7048 0.004 0.032 0.960 0.000 0.004 0.000
#> GSM97046     3  0.0692     0.7099 0.000 0.020 0.976 0.000 0.004 0.000
#> GSM97023     1  0.3130     0.6033 0.828 0.000 0.000 0.048 0.124 0.000
#> GSM97029     1  0.4642     0.4106 0.688 0.240 0.020 0.000 0.052 0.000
#> GSM97043     2  0.4901     0.6314 0.072 0.728 0.156 0.000 0.024 0.020
#> GSM97013     1  0.3951     0.5637 0.792 0.012 0.140 0.040 0.016 0.000
#> GSM96956     3  0.4779     0.4178 0.000 0.052 0.684 0.004 0.020 0.240
#> GSM97024     2  0.4976     0.6134 0.004 0.676 0.228 0.000 0.072 0.020
#> GSM97032     2  0.5306     0.2594 0.028 0.556 0.020 0.000 0.020 0.376
#> GSM97044     6  0.2451     0.7354 0.004 0.108 0.000 0.004 0.008 0.876
#> GSM97049     3  0.0260     0.7122 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM96968     6  0.2432     0.7547 0.008 0.036 0.020 0.004 0.024 0.908
#> GSM96971     4  0.4586     0.3263 0.000 0.012 0.000 0.640 0.036 0.312
#> GSM96986     6  0.3067     0.7303 0.000 0.012 0.004 0.064 0.060 0.860
#> GSM97003     6  0.6655    -0.0743 0.012 0.012 0.004 0.376 0.212 0.384
#> GSM96957     3  0.5863    -0.1351 0.164 0.008 0.492 0.000 0.336 0.000
#> GSM96960     4  0.7324     0.0465 0.308 0.016 0.004 0.396 0.220 0.056
#> GSM96975     5  0.5082     0.4196 0.116 0.000 0.012 0.216 0.656 0.000
#> GSM96998     1  0.3455     0.5615 0.776 0.004 0.000 0.200 0.020 0.000
#> GSM96999     1  0.6197     0.2943 0.496 0.008 0.016 0.160 0.320 0.000
#> GSM97001     5  0.4899     0.5499 0.100 0.000 0.228 0.008 0.664 0.000
#> GSM97005     5  0.4409     0.5315 0.192 0.000 0.000 0.064 0.728 0.016
#> GSM97006     4  0.6897    -0.0403 0.396 0.012 0.004 0.408 0.112 0.068
#> GSM97021     5  0.4534     0.4494 0.296 0.016 0.024 0.000 0.660 0.004
#> GSM97028     2  0.5448    -0.1413 0.020 0.464 0.004 0.000 0.056 0.456
#> GSM97031     5  0.5892     0.1541 0.028 0.008 0.004 0.064 0.464 0.432
#> GSM97037     6  0.6264     0.1585 0.004 0.172 0.384 0.000 0.016 0.424
#> GSM97018     2  0.3904     0.5168 0.012 0.768 0.008 0.004 0.016 0.192
#> GSM97014     5  0.4235     0.1117 0.004 0.004 0.448 0.004 0.540 0.000
#> GSM97042     2  0.2837     0.6404 0.004 0.840 0.144 0.008 0.004 0.000
#> GSM97040     5  0.4440     0.5356 0.212 0.016 0.056 0.000 0.716 0.000
#> GSM97041     1  0.5561    -0.1800 0.484 0.020 0.080 0.000 0.416 0.000
#> GSM96955     5  0.7410     0.1915 0.012 0.192 0.192 0.148 0.456 0.000
#> GSM96990     6  0.5049     0.5751 0.020 0.208 0.072 0.000 0.012 0.688
#> GSM96991     2  0.3074     0.5991 0.008 0.872 0.056 0.036 0.024 0.004
#> GSM97048     3  0.0260     0.7122 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM96963     2  0.4277     0.5584 0.012 0.788 0.092 0.076 0.032 0.000
#> GSM96953     2  0.5492     0.3799 0.008 0.520 0.400 0.032 0.040 0.000
#> GSM96966     4  0.2519     0.7025 0.072 0.020 0.000 0.888 0.020 0.000
#> GSM96979     6  0.4127     0.5619 0.000 0.008 0.004 0.252 0.024 0.712
#> GSM96983     6  0.4811     0.5645 0.004 0.248 0.004 0.004 0.068 0.672
#> GSM96984     6  0.1965     0.7575 0.000 0.008 0.004 0.040 0.024 0.924
#> GSM96994     6  0.1780     0.7600 0.000 0.004 0.004 0.024 0.036 0.932
#> GSM96996     1  0.5639     0.0601 0.492 0.012 0.004 0.416 0.068 0.008
#> GSM96997     6  0.2826     0.7379 0.000 0.012 0.004 0.056 0.052 0.876
#> GSM97007     6  0.0964     0.7629 0.000 0.000 0.004 0.012 0.016 0.968
#> GSM96954     6  0.1478     0.7614 0.000 0.020 0.000 0.004 0.032 0.944
#> GSM96962     6  0.1495     0.7615 0.000 0.008 0.004 0.020 0.020 0.948
#> GSM96969     4  0.1951     0.7036 0.060 0.004 0.000 0.916 0.020 0.000
#> GSM96970     4  0.1616     0.7049 0.028 0.012 0.000 0.940 0.020 0.000
#> GSM96973     4  0.0653     0.7033 0.012 0.004 0.000 0.980 0.004 0.000
#> GSM96976     4  0.2737     0.6717 0.008 0.072 0.012 0.884 0.020 0.004
#> GSM96977     5  0.6044     0.3461 0.324 0.012 0.004 0.060 0.552 0.048
#> GSM96995     6  0.3638     0.6971 0.008 0.036 0.004 0.000 0.156 0.796
#> GSM97002     4  0.5339     0.1807 0.396 0.012 0.004 0.524 0.064 0.000
#> GSM97009     3  0.5439     0.0901 0.000 0.020 0.496 0.036 0.432 0.016
#> GSM97010     3  0.5791    -0.0852 0.032 0.012 0.456 0.456 0.008 0.036
#> GSM96974     4  0.3675     0.6215 0.012 0.192 0.000 0.776 0.012 0.008
#> GSM96985     4  0.7293     0.2551 0.084 0.380 0.004 0.384 0.128 0.020
#> GSM96959     5  0.5567     0.4416 0.000 0.000 0.272 0.016 0.584 0.128
#> GSM96972     4  0.2854     0.6715 0.108 0.004 0.000 0.860 0.012 0.016
#> GSM96978     6  0.7249     0.2888 0.008 0.292 0.004 0.148 0.104 0.444
#> GSM96967     4  0.2222     0.6943 0.084 0.012 0.000 0.896 0.008 0.000
#> GSM96987     1  0.2113     0.6461 0.908 0.004 0.000 0.060 0.028 0.000
#> GSM97011     5  0.3889     0.5414 0.016 0.004 0.180 0.028 0.772 0.000
#> GSM96964     1  0.1464     0.6380 0.944 0.004 0.000 0.016 0.036 0.000
#> GSM96965     4  0.1635     0.7013 0.016 0.016 0.012 0.944 0.012 0.000
#> GSM96981     5  0.5016     0.2949 0.096 0.000 0.000 0.312 0.592 0.000
#> GSM96982     4  0.5776     0.0775 0.112 0.016 0.000 0.448 0.424 0.000
#> GSM96988     2  0.6288    -0.1003 0.036 0.456 0.004 0.012 0.084 0.408
#> GSM97000     5  0.4383     0.5068 0.016 0.000 0.000 0.036 0.696 0.252
#> GSM97004     1  0.5244     0.0318 0.496 0.008 0.000 0.424 0.072 0.000
#> GSM97008     5  0.3149     0.5749 0.080 0.000 0.028 0.016 0.860 0.016
#> GSM96950     1  0.1511     0.6405 0.944 0.012 0.000 0.032 0.012 0.000
#> GSM96980     4  0.4256     0.6207 0.176 0.020 0.000 0.748 0.056 0.000
#> GSM96989     1  0.1410     0.6467 0.944 0.004 0.000 0.044 0.008 0.000
#> GSM96992     1  0.5339     0.0952 0.464 0.008 0.000 0.080 0.448 0.000
#> GSM96993     1  0.1524     0.6123 0.932 0.060 0.000 0.000 0.008 0.000
#> GSM96958     5  0.4945    -0.0299 0.452 0.000 0.000 0.064 0.484 0.000
#> GSM96951     5  0.4512     0.1515 0.436 0.008 0.000 0.004 0.540 0.012
#> GSM96952     1  0.5218     0.2812 0.540 0.008 0.000 0.076 0.376 0.000
#> GSM96961     1  0.3698     0.5397 0.756 0.004 0.000 0.028 0.212 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-NMF-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>          n disease.state(p) specimen(p) cell.type(p) other(p) k
#> MAD:NMF 99         1.61e-05      0.1658     3.04e-14   0.1381 2
#> MAD:NMF 97         7.29e-05      0.2888     5.42e-18   0.0784 3
#> MAD:NMF 84         1.19e-05      0.0649     5.06e-18   0.0322 4
#> MAD:NMF 69         2.76e-03      0.3427     4.61e-15   0.0176 5
#> MAD:NMF 60         1.92e-03      0.6206     9.68e-14   0.0968 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 21168 rows and 100 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 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-hclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-hclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.529           0.885       0.923         0.2501 0.818   0.818
#> 3 3 0.538           0.735       0.872         1.2495 0.596   0.506
#> 4 4 0.557           0.701       0.839         0.1975 0.903   0.765
#> 5 5 0.545           0.539       0.743         0.0892 0.939   0.808
#> 6 6 0.589           0.608       0.725         0.0537 0.834   0.478

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
#> GSM97038     2  0.0000      0.910 0.000 1.000
#> GSM97045     2  0.0000      0.910 0.000 1.000
#> GSM97047     2  0.0000      0.910 0.000 1.000
#> GSM97025     2  0.0000      0.910 0.000 1.000
#> GSM97030     2  0.0000      0.910 0.000 1.000
#> GSM97027     2  0.0000      0.910 0.000 1.000
#> GSM97033     2  0.0000      0.910 0.000 1.000
#> GSM97034     2  0.0000      0.910 0.000 1.000
#> GSM97020     2  0.0000      0.910 0.000 1.000
#> GSM97026     2  0.0000      0.910 0.000 1.000
#> GSM97012     2  0.0000      0.910 0.000 1.000
#> GSM97015     2  0.0000      0.910 0.000 1.000
#> GSM97016     2  0.0000      0.910 0.000 1.000
#> GSM97017     2  0.0000      0.910 0.000 1.000
#> GSM97019     2  0.0000      0.910 0.000 1.000
#> GSM97022     2  0.0000      0.910 0.000 1.000
#> GSM97035     2  0.0000      0.910 0.000 1.000
#> GSM97036     2  0.0000      0.910 0.000 1.000
#> GSM97039     2  0.0000      0.910 0.000 1.000
#> GSM97046     2  0.0000      0.910 0.000 1.000
#> GSM97023     2  0.5842      0.872 0.140 0.860
#> GSM97029     2  0.0000      0.910 0.000 1.000
#> GSM97043     2  0.0000      0.910 0.000 1.000
#> GSM97013     2  0.6973      0.847 0.188 0.812
#> GSM96956     2  0.0000      0.910 0.000 1.000
#> GSM97024     2  0.0000      0.910 0.000 1.000
#> GSM97032     2  0.0000      0.910 0.000 1.000
#> GSM97044     2  0.0000      0.910 0.000 1.000
#> GSM97049     2  0.0000      0.910 0.000 1.000
#> GSM96968     2  0.7602      0.823 0.220 0.780
#> GSM96971     1  0.7950      0.600 0.760 0.240
#> GSM96986     2  0.8327      0.776 0.264 0.736
#> GSM97003     2  0.7674      0.820 0.224 0.776
#> GSM96957     2  0.3584      0.896 0.068 0.932
#> GSM96960     2  0.7745      0.816 0.228 0.772
#> GSM96975     2  0.6801      0.854 0.180 0.820
#> GSM96998     2  0.6343      0.863 0.160 0.840
#> GSM96999     2  0.6801      0.854 0.180 0.820
#> GSM97001     2  0.3584      0.896 0.068 0.932
#> GSM97005     2  0.6973      0.847 0.188 0.812
#> GSM97006     2  0.7815      0.812 0.232 0.768
#> GSM97021     2  0.0000      0.910 0.000 1.000
#> GSM97028     2  0.0000      0.910 0.000 1.000
#> GSM97031     2  0.6973      0.847 0.188 0.812
#> GSM97037     2  0.0000      0.910 0.000 1.000
#> GSM97018     2  0.0000      0.910 0.000 1.000
#> GSM97014     2  0.0000      0.910 0.000 1.000
#> GSM97042     2  0.0000      0.910 0.000 1.000
#> GSM97040     2  0.0000      0.910 0.000 1.000
#> GSM97041     2  0.0000      0.910 0.000 1.000
#> GSM96955     2  0.0000      0.910 0.000 1.000
#> GSM96990     2  0.0000      0.910 0.000 1.000
#> GSM96991     2  0.0000      0.910 0.000 1.000
#> GSM97048     2  0.0000      0.910 0.000 1.000
#> GSM96963     2  0.0000      0.910 0.000 1.000
#> GSM96953     2  0.0000      0.910 0.000 1.000
#> GSM96966     1  0.0000      0.968 1.000 0.000
#> GSM96979     2  0.8327      0.776 0.264 0.736
#> GSM96983     2  0.0000      0.910 0.000 1.000
#> GSM96984     2  0.8327      0.776 0.264 0.736
#> GSM96994     2  0.0672      0.910 0.008 0.992
#> GSM96996     2  0.2043      0.905 0.032 0.968
#> GSM96997     2  0.8327      0.776 0.264 0.736
#> GSM97007     2  0.2043      0.905 0.032 0.968
#> GSM96954     2  0.8016      0.800 0.244 0.756
#> GSM96962     2  0.8327      0.776 0.264 0.736
#> GSM96969     1  0.0000      0.968 1.000 0.000
#> GSM96970     1  0.0000      0.968 1.000 0.000
#> GSM96973     1  0.0000      0.968 1.000 0.000
#> GSM96976     1  0.0000      0.968 1.000 0.000
#> GSM96977     2  0.7528      0.827 0.216 0.784
#> GSM96995     2  0.0000      0.910 0.000 1.000
#> GSM97002     2  0.7674      0.820 0.224 0.776
#> GSM97009     2  0.0376      0.910 0.004 0.996
#> GSM97010     2  0.7528      0.827 0.216 0.784
#> GSM96974     1  0.0000      0.968 1.000 0.000
#> GSM96985     2  0.6148      0.868 0.152 0.848
#> GSM96959     2  0.0000      0.910 0.000 1.000
#> GSM96972     1  0.0000      0.968 1.000 0.000
#> GSM96978     2  0.7674      0.820 0.224 0.776
#> GSM96967     1  0.0000      0.968 1.000 0.000
#> GSM96987     2  0.2236      0.904 0.036 0.964
#> GSM97011     2  0.0376      0.910 0.004 0.996
#> GSM96964     2  0.6343      0.864 0.160 0.840
#> GSM96965     1  0.0000      0.968 1.000 0.000
#> GSM96981     2  0.6801      0.854 0.180 0.820
#> GSM96982     2  0.6801      0.854 0.180 0.820
#> GSM96988     2  0.0938      0.909 0.012 0.988
#> GSM97000     2  0.6887      0.850 0.184 0.816
#> GSM97004     2  0.7745      0.816 0.228 0.772
#> GSM97008     2  0.6148      0.868 0.152 0.848
#> GSM96950     2  0.6973      0.847 0.188 0.812
#> GSM96980     2  0.7815      0.813 0.232 0.768
#> GSM96989     2  0.4562      0.888 0.096 0.904
#> GSM96992     2  0.6343      0.863 0.160 0.840
#> GSM96993     2  0.0000      0.910 0.000 1.000
#> GSM96958     2  0.7219      0.839 0.200 0.800
#> GSM96951     2  0.6973      0.847 0.188 0.812
#> GSM96952     2  0.6343      0.863 0.160 0.840
#> GSM96961     2  0.6343      0.863 0.160 0.840

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97038     2  0.1163     0.7976 0.028 0.972 0.000
#> GSM97045     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97047     2  0.5465     0.6684 0.288 0.712 0.000
#> GSM97025     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97030     1  0.6189     0.4129 0.632 0.364 0.004
#> GSM97027     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97033     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97034     2  0.5810     0.6012 0.336 0.664 0.000
#> GSM97020     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97026     2  0.3412     0.7711 0.124 0.876 0.000
#> GSM97012     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97015     2  0.5948     0.5556 0.360 0.640 0.000
#> GSM97016     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97017     2  0.5497     0.6645 0.292 0.708 0.000
#> GSM97019     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97022     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97035     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97036     1  0.6095     0.3156 0.608 0.392 0.000
#> GSM97039     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97046     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97023     1  0.1753     0.8364 0.952 0.048 0.000
#> GSM97029     2  0.5835     0.5953 0.340 0.660 0.000
#> GSM97043     2  0.1964     0.7946 0.056 0.944 0.000
#> GSM97013     1  0.0237     0.8445 0.996 0.000 0.004
#> GSM96956     2  0.5706     0.4922 0.320 0.680 0.000
#> GSM97024     2  0.1163     0.7966 0.028 0.972 0.000
#> GSM97032     2  0.5560     0.6481 0.300 0.700 0.000
#> GSM97044     1  0.6189     0.4129 0.632 0.364 0.004
#> GSM97049     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM96968     1  0.1999     0.8448 0.952 0.012 0.036
#> GSM96971     3  0.5058     0.6303 0.244 0.000 0.756
#> GSM96986     1  0.2878     0.8148 0.904 0.000 0.096
#> GSM97003     1  0.1643     0.8394 0.956 0.000 0.044
#> GSM96957     1  0.3752     0.7634 0.856 0.144 0.000
#> GSM96960     1  0.1643     0.8388 0.956 0.000 0.044
#> GSM96975     1  0.2793     0.8437 0.928 0.044 0.028
#> GSM96998     1  0.1525     0.8432 0.964 0.032 0.004
#> GSM96999     1  0.2176     0.8468 0.948 0.032 0.020
#> GSM97001     1  0.3752     0.7634 0.856 0.144 0.000
#> GSM97005     1  0.0237     0.8445 0.996 0.000 0.004
#> GSM97006     1  0.1860     0.8365 0.948 0.000 0.052
#> GSM97021     2  0.5497     0.6645 0.292 0.708 0.000
#> GSM97028     2  0.6215     0.3800 0.428 0.572 0.000
#> GSM97031     1  0.0237     0.8445 0.996 0.000 0.004
#> GSM97037     1  0.6189     0.4129 0.632 0.364 0.004
#> GSM97018     2  0.5733     0.6171 0.324 0.676 0.000
#> GSM97014     2  0.5465     0.6684 0.288 0.712 0.000
#> GSM97042     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97040     2  0.5497     0.6645 0.292 0.708 0.000
#> GSM97041     2  0.5497     0.6645 0.292 0.708 0.000
#> GSM96955     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM96990     2  0.5882     0.5779 0.348 0.652 0.000
#> GSM96991     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM97048     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM96963     2  0.0000     0.7968 0.000 1.000 0.000
#> GSM96953     2  0.1031     0.7964 0.024 0.976 0.000
#> GSM96966     3  0.0237     0.9684 0.004 0.000 0.996
#> GSM96979     1  0.2878     0.8148 0.904 0.000 0.096
#> GSM96983     1  0.5623     0.5998 0.716 0.280 0.004
#> GSM96984     1  0.2878     0.8148 0.904 0.000 0.096
#> GSM96994     1  0.5815     0.5526 0.692 0.304 0.004
#> GSM96996     1  0.5560     0.5319 0.700 0.300 0.000
#> GSM96997     1  0.2878     0.8148 0.904 0.000 0.096
#> GSM97007     1  0.5171     0.7083 0.784 0.204 0.012
#> GSM96954     1  0.2680     0.8315 0.924 0.008 0.068
#> GSM96962     1  0.2878     0.8148 0.904 0.000 0.096
#> GSM96969     3  0.0237     0.9684 0.004 0.000 0.996
#> GSM96970     3  0.0237     0.9684 0.004 0.000 0.996
#> GSM96973     3  0.0237     0.9684 0.004 0.000 0.996
#> GSM96976     3  0.0237     0.9684 0.004 0.000 0.996
#> GSM96977     1  0.1711     0.8448 0.960 0.008 0.032
#> GSM96995     2  0.5859     0.5860 0.344 0.656 0.000
#> GSM97002     1  0.1529     0.8397 0.960 0.000 0.040
#> GSM97009     1  0.6295    -0.0383 0.528 0.472 0.000
#> GSM97010     1  0.1525     0.8439 0.964 0.004 0.032
#> GSM96974     3  0.0237     0.9684 0.004 0.000 0.996
#> GSM96985     1  0.3765     0.8207 0.888 0.084 0.028
#> GSM96959     2  0.5859     0.5860 0.344 0.656 0.000
#> GSM96972     3  0.0237     0.9684 0.004 0.000 0.996
#> GSM96978     1  0.2903     0.8382 0.924 0.028 0.048
#> GSM96967     3  0.0237     0.9684 0.004 0.000 0.996
#> GSM96987     1  0.5905     0.4247 0.648 0.352 0.000
#> GSM97011     1  0.6295    -0.0383 0.528 0.472 0.000
#> GSM96964     1  0.1525     0.8447 0.964 0.032 0.004
#> GSM96965     3  0.0237     0.9684 0.004 0.000 0.996
#> GSM96981     1  0.2793     0.8437 0.928 0.044 0.028
#> GSM96982     1  0.2793     0.8437 0.928 0.044 0.028
#> GSM96988     2  0.6309     0.1390 0.496 0.504 0.000
#> GSM97000     1  0.0475     0.8454 0.992 0.004 0.004
#> GSM97004     1  0.1643     0.8388 0.956 0.000 0.044
#> GSM97008     1  0.1411     0.8413 0.964 0.036 0.000
#> GSM96950     1  0.0237     0.8445 0.996 0.000 0.004
#> GSM96980     1  0.1860     0.8377 0.948 0.000 0.052
#> GSM96989     1  0.5553     0.5914 0.724 0.272 0.004
#> GSM96992     1  0.1525     0.8432 0.964 0.032 0.004
#> GSM96993     1  0.6095     0.3156 0.608 0.392 0.000
#> GSM96958     1  0.0747     0.8444 0.984 0.000 0.016
#> GSM96951     1  0.0237     0.8445 0.996 0.000 0.004
#> GSM96952     1  0.1525     0.8432 0.964 0.032 0.004
#> GSM96961     1  0.1525     0.8432 0.964 0.032 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.1356     0.7586 0.032 0.960 0.008 0.000
#> GSM97045     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97047     2  0.5814     0.6171 0.300 0.644 0.056 0.000
#> GSM97025     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97030     3  0.4638     0.6602 0.044 0.180 0.776 0.000
#> GSM97027     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97033     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97034     2  0.6407     0.5561 0.332 0.584 0.084 0.000
#> GSM97020     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97026     2  0.4286     0.7215 0.136 0.812 0.052 0.000
#> GSM97012     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97015     2  0.7117     0.5739 0.264 0.556 0.180 0.000
#> GSM97016     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97017     2  0.5905     0.6111 0.304 0.636 0.060 0.000
#> GSM97019     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97036     1  0.6141     0.3814 0.624 0.300 0.076 0.000
#> GSM97039     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97023     1  0.1109     0.8065 0.968 0.004 0.028 0.000
#> GSM97029     2  0.6382     0.5454 0.340 0.580 0.080 0.000
#> GSM97043     2  0.2996     0.7439 0.064 0.892 0.044 0.000
#> GSM97013     1  0.1557     0.8082 0.944 0.000 0.056 0.000
#> GSM96956     2  0.5284     0.2465 0.016 0.616 0.368 0.000
#> GSM97024     2  0.1824     0.7397 0.004 0.936 0.060 0.000
#> GSM97032     2  0.6452     0.6250 0.268 0.620 0.112 0.000
#> GSM97044     3  0.4638     0.6602 0.044 0.180 0.776 0.000
#> GSM97049     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM96968     1  0.5523     0.3528 0.628 0.012 0.348 0.012
#> GSM96971     4  0.4072     0.6379 0.000 0.000 0.252 0.748
#> GSM96986     3  0.4356     0.7289 0.148 0.000 0.804 0.048
#> GSM97003     1  0.3166     0.7656 0.868 0.000 0.116 0.016
#> GSM96957     1  0.3370     0.7455 0.872 0.080 0.048 0.000
#> GSM96960     1  0.1743     0.8004 0.940 0.000 0.056 0.004
#> GSM96975     1  0.1452     0.8110 0.956 0.008 0.036 0.000
#> GSM96998     1  0.0524     0.8122 0.988 0.004 0.008 0.000
#> GSM96999     1  0.2384     0.7929 0.916 0.008 0.072 0.004
#> GSM97001     1  0.3370     0.7455 0.872 0.080 0.048 0.000
#> GSM97005     1  0.1557     0.8082 0.944 0.000 0.056 0.000
#> GSM97006     1  0.3224     0.7627 0.864 0.000 0.120 0.016
#> GSM97021     2  0.5905     0.6111 0.304 0.636 0.060 0.000
#> GSM97028     2  0.7489     0.4873 0.296 0.492 0.212 0.000
#> GSM97031     1  0.1637     0.8077 0.940 0.000 0.060 0.000
#> GSM97037     3  0.4638     0.6602 0.044 0.180 0.776 0.000
#> GSM97018     2  0.6613     0.6000 0.288 0.596 0.116 0.000
#> GSM97014     2  0.5814     0.6171 0.300 0.644 0.056 0.000
#> GSM97042     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97040     2  0.5905     0.6111 0.304 0.636 0.060 0.000
#> GSM97041     2  0.5905     0.6111 0.304 0.636 0.060 0.000
#> GSM96955     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM96990     2  0.6790     0.5770 0.296 0.576 0.128 0.000
#> GSM96991     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM97048     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000     0.7629 0.000 1.000 0.000 0.000
#> GSM96953     2  0.1389     0.7451 0.000 0.952 0.048 0.000
#> GSM96966     4  0.0000     0.9692 0.000 0.000 0.000 1.000
#> GSM96979     3  0.4356     0.7289 0.148 0.000 0.804 0.048
#> GSM96983     3  0.3652     0.7010 0.052 0.092 0.856 0.000
#> GSM96984     3  0.4356     0.7289 0.148 0.000 0.804 0.048
#> GSM96994     3  0.4673     0.6907 0.076 0.132 0.792 0.000
#> GSM96996     1  0.5494     0.5673 0.716 0.208 0.076 0.000
#> GSM96997     3  0.4356     0.7289 0.148 0.000 0.804 0.048
#> GSM97007     3  0.2256     0.7006 0.056 0.020 0.924 0.000
#> GSM96954     3  0.5966     0.4801 0.368 0.008 0.592 0.032
#> GSM96962     3  0.4356     0.7289 0.148 0.000 0.804 0.048
#> GSM96969     4  0.0000     0.9692 0.000 0.000 0.000 1.000
#> GSM96970     4  0.0000     0.9692 0.000 0.000 0.000 1.000
#> GSM96973     4  0.0000     0.9692 0.000 0.000 0.000 1.000
#> GSM96976     4  0.0000     0.9692 0.000 0.000 0.000 1.000
#> GSM96977     1  0.5270     0.4293 0.660 0.008 0.320 0.012
#> GSM96995     2  0.6739     0.5746 0.304 0.576 0.120 0.000
#> GSM97002     1  0.1661     0.8016 0.944 0.000 0.052 0.004
#> GSM97009     1  0.6357     0.0653 0.544 0.388 0.068 0.000
#> GSM97010     1  0.5112     0.4427 0.668 0.004 0.316 0.012
#> GSM96974     4  0.0000     0.9692 0.000 0.000 0.000 1.000
#> GSM96985     1  0.3015     0.7932 0.884 0.024 0.092 0.000
#> GSM96959     2  0.6739     0.5746 0.304 0.576 0.120 0.000
#> GSM96972     4  0.0000     0.9692 0.000 0.000 0.000 1.000
#> GSM96978     3  0.5633     0.5127 0.348 0.012 0.624 0.016
#> GSM96967     4  0.0000     0.9692 0.000 0.000 0.000 1.000
#> GSM96987     1  0.5900     0.4797 0.664 0.260 0.076 0.000
#> GSM97011     1  0.6357     0.0653 0.544 0.388 0.068 0.000
#> GSM96964     1  0.1767     0.8143 0.944 0.012 0.044 0.000
#> GSM96965     4  0.0000     0.9692 0.000 0.000 0.000 1.000
#> GSM96981     1  0.1452     0.8110 0.956 0.008 0.036 0.000
#> GSM96982     1  0.1452     0.8110 0.956 0.008 0.036 0.000
#> GSM96988     2  0.7910     0.2212 0.308 0.360 0.332 0.000
#> GSM97000     1  0.1792     0.8081 0.932 0.000 0.068 0.000
#> GSM97004     1  0.1743     0.8004 0.940 0.000 0.056 0.004
#> GSM97008     1  0.2413     0.8098 0.916 0.020 0.064 0.000
#> GSM96950     1  0.1557     0.8082 0.944 0.000 0.056 0.000
#> GSM96980     1  0.2021     0.7997 0.932 0.000 0.056 0.012
#> GSM96989     1  0.4914     0.6174 0.748 0.208 0.044 0.000
#> GSM96992     1  0.0524     0.8122 0.988 0.004 0.008 0.000
#> GSM96993     1  0.6141     0.3814 0.624 0.300 0.076 0.000
#> GSM96958     1  0.2266     0.7965 0.912 0.000 0.084 0.004
#> GSM96951     1  0.1557     0.8082 0.944 0.000 0.056 0.000
#> GSM96952     1  0.0524     0.8122 0.988 0.004 0.008 0.000
#> GSM96961     1  0.0524     0.8122 0.988 0.004 0.008 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
#> GSM97038     2  0.2873     0.6796 0.020 0.860 0.000 0.000 0.120
#> GSM97045     2  0.0324     0.7026 0.004 0.992 0.000 0.000 0.004
#> GSM97047     2  0.6459     0.4834 0.244 0.500 0.000 0.000 0.256
#> GSM97025     2  0.0324     0.7026 0.004 0.992 0.000 0.000 0.004
#> GSM97030     3  0.3911     0.6347 0.000 0.144 0.796 0.000 0.060
#> GSM97027     2  0.0324     0.7026 0.004 0.992 0.000 0.000 0.004
#> GSM97033     2  0.0324     0.7026 0.004 0.992 0.000 0.000 0.004
#> GSM97034     2  0.7135     0.4270 0.276 0.436 0.020 0.000 0.268
#> GSM97020     2  0.0324     0.7026 0.004 0.992 0.000 0.000 0.004
#> GSM97026     2  0.5190     0.6030 0.096 0.668 0.000 0.000 0.236
#> GSM97012     2  0.0000     0.7004 0.000 1.000 0.000 0.000 0.000
#> GSM97015     2  0.8023     0.4361 0.212 0.424 0.120 0.000 0.244
#> GSM97016     2  0.0324     0.7026 0.004 0.992 0.000 0.000 0.004
#> GSM97017     2  0.6491     0.4750 0.244 0.492 0.000 0.000 0.264
#> GSM97019     2  0.0000     0.7004 0.000 1.000 0.000 0.000 0.000
#> GSM97022     2  0.0000     0.7004 0.000 1.000 0.000 0.000 0.000
#> GSM97035     2  0.0000     0.7004 0.000 1.000 0.000 0.000 0.000
#> GSM97036     5  0.6075     0.1635 0.356 0.132 0.000 0.000 0.512
#> GSM97039     2  0.0000     0.7004 0.000 1.000 0.000 0.000 0.000
#> GSM97046     2  0.0000     0.7004 0.000 1.000 0.000 0.000 0.000
#> GSM97023     1  0.2074     0.5701 0.896 0.000 0.000 0.000 0.104
#> GSM97029     2  0.7078     0.4182 0.284 0.432 0.016 0.000 0.268
#> GSM97043     2  0.3944     0.6523 0.032 0.768 0.000 0.000 0.200
#> GSM97013     1  0.0162     0.6120 0.996 0.000 0.004 0.000 0.000
#> GSM96956     2  0.4862     0.1613 0.000 0.604 0.364 0.000 0.032
#> GSM97024     2  0.1800     0.6747 0.000 0.932 0.048 0.000 0.020
#> GSM97032     2  0.7385     0.4841 0.212 0.472 0.052 0.000 0.264
#> GSM97044     3  0.3911     0.6347 0.000 0.144 0.796 0.000 0.060
#> GSM97049     2  0.0290     0.7020 0.000 0.992 0.000 0.000 0.008
#> GSM96968     1  0.4775     0.2801 0.660 0.004 0.304 0.000 0.032
#> GSM96971     4  0.4141     0.6211 0.000 0.000 0.248 0.728 0.024
#> GSM96986     3  0.4587     0.6674 0.160 0.000 0.744 0.000 0.096
#> GSM97003     1  0.2726     0.5425 0.884 0.000 0.064 0.000 0.052
#> GSM96957     1  0.3681     0.4572 0.808 0.044 0.000 0.000 0.148
#> GSM96960     1  0.4268    -0.3766 0.556 0.000 0.000 0.000 0.444
#> GSM96975     5  0.4249     0.4827 0.432 0.000 0.000 0.000 0.568
#> GSM96998     1  0.2020     0.5787 0.900 0.000 0.000 0.000 0.100
#> GSM96999     1  0.3390     0.5696 0.840 0.000 0.060 0.000 0.100
#> GSM97001     1  0.3681     0.4572 0.808 0.044 0.000 0.000 0.148
#> GSM97005     1  0.0162     0.6120 0.996 0.000 0.004 0.000 0.000
#> GSM97006     1  0.2863     0.5340 0.876 0.000 0.060 0.000 0.064
#> GSM97021     2  0.6491     0.4750 0.244 0.492 0.000 0.000 0.264
#> GSM97028     2  0.8340     0.3389 0.236 0.360 0.152 0.000 0.252
#> GSM97031     1  0.0290     0.6119 0.992 0.000 0.008 0.000 0.000
#> GSM97037     3  0.3911     0.6347 0.000 0.144 0.796 0.000 0.060
#> GSM97018     2  0.7529     0.4605 0.232 0.448 0.056 0.000 0.264
#> GSM97014     2  0.6459     0.4834 0.244 0.500 0.000 0.000 0.256
#> GSM97042     2  0.0000     0.7004 0.000 1.000 0.000 0.000 0.000
#> GSM97040     2  0.6491     0.4750 0.244 0.492 0.000 0.000 0.264
#> GSM97041     2  0.6491     0.4750 0.244 0.492 0.000 0.000 0.264
#> GSM96955     2  0.0880     0.6929 0.000 0.968 0.000 0.000 0.032
#> GSM96990     2  0.7693     0.4433 0.240 0.432 0.068 0.000 0.260
#> GSM96991     2  0.0880     0.6929 0.000 0.968 0.000 0.000 0.032
#> GSM97048     2  0.0000     0.7004 0.000 1.000 0.000 0.000 0.000
#> GSM96963     2  0.0880     0.6929 0.000 0.968 0.000 0.000 0.032
#> GSM96953     2  0.1485     0.6840 0.000 0.948 0.032 0.000 0.020
#> GSM96966     4  0.0000     0.9679 0.000 0.000 0.000 1.000 0.000
#> GSM96979     3  0.4587     0.6674 0.160 0.000 0.744 0.000 0.096
#> GSM96983     3  0.3323     0.6419 0.000 0.056 0.844 0.000 0.100
#> GSM96984     3  0.4587     0.6674 0.160 0.000 0.744 0.000 0.096
#> GSM96994     3  0.4444     0.6485 0.020 0.088 0.788 0.000 0.104
#> GSM96996     1  0.5708    -0.0481 0.504 0.084 0.000 0.000 0.412
#> GSM96997     3  0.4587     0.6674 0.160 0.000 0.744 0.000 0.096
#> GSM97007     3  0.1608     0.6286 0.000 0.000 0.928 0.000 0.072
#> GSM96954     3  0.5559     0.4045 0.380 0.000 0.544 0.000 0.076
#> GSM96962     3  0.4587     0.6674 0.160 0.000 0.744 0.000 0.096
#> GSM96969     4  0.0000     0.9679 0.000 0.000 0.000 1.000 0.000
#> GSM96970     4  0.0000     0.9679 0.000 0.000 0.000 1.000 0.000
#> GSM96973     4  0.0000     0.9679 0.000 0.000 0.000 1.000 0.000
#> GSM96976     4  0.0000     0.9679 0.000 0.000 0.000 1.000 0.000
#> GSM96977     1  0.4397     0.3221 0.696 0.000 0.276 0.000 0.028
#> GSM96995     2  0.7625     0.4409 0.244 0.432 0.060 0.000 0.264
#> GSM97002     1  0.4305    -0.4564 0.512 0.000 0.000 0.000 0.488
#> GSM97009     1  0.6765    -0.0312 0.448 0.248 0.004 0.000 0.300
#> GSM97010     1  0.4350     0.3341 0.704 0.000 0.268 0.000 0.028
#> GSM96974     4  0.0000     0.9679 0.000 0.000 0.000 1.000 0.000
#> GSM96985     5  0.4088     0.4695 0.368 0.000 0.000 0.000 0.632
#> GSM96959     2  0.7625     0.4409 0.244 0.432 0.060 0.000 0.264
#> GSM96972     4  0.0000     0.9679 0.000 0.000 0.000 1.000 0.000
#> GSM96978     3  0.5554     0.4425 0.360 0.004 0.568 0.000 0.068
#> GSM96967     4  0.0000     0.9679 0.000 0.000 0.000 1.000 0.000
#> GSM96987     5  0.5915     0.1534 0.384 0.108 0.000 0.000 0.508
#> GSM97011     1  0.6765    -0.0312 0.448 0.248 0.004 0.000 0.300
#> GSM96964     1  0.1430     0.6061 0.944 0.000 0.004 0.000 0.052
#> GSM96965     4  0.0000     0.9679 0.000 0.000 0.000 1.000 0.000
#> GSM96981     5  0.4249     0.4827 0.432 0.000 0.000 0.000 0.568
#> GSM96982     5  0.4249     0.4827 0.432 0.000 0.000 0.000 0.568
#> GSM96988     3  0.8554    -0.1495 0.228 0.256 0.304 0.000 0.212
#> GSM97000     1  0.0671     0.6113 0.980 0.000 0.016 0.000 0.004
#> GSM97004     5  0.4307     0.3889 0.496 0.000 0.000 0.000 0.504
#> GSM97008     1  0.1365     0.6043 0.952 0.004 0.004 0.000 0.040
#> GSM96950     1  0.0162     0.6120 0.996 0.000 0.004 0.000 0.000
#> GSM96980     5  0.4559     0.4016 0.480 0.000 0.000 0.008 0.512
#> GSM96989     1  0.5884    -0.1544 0.480 0.100 0.000 0.000 0.420
#> GSM96992     1  0.2127     0.5724 0.892 0.000 0.000 0.000 0.108
#> GSM96993     5  0.6075     0.1635 0.356 0.132 0.000 0.000 0.512
#> GSM96958     1  0.1386     0.5992 0.952 0.000 0.032 0.000 0.016
#> GSM96951     1  0.0162     0.6120 0.996 0.000 0.004 0.000 0.000
#> GSM96952     1  0.2127     0.5724 0.892 0.000 0.000 0.000 0.108
#> GSM96961     1  0.2127     0.5724 0.892 0.000 0.000 0.000 0.108

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.3003    0.68828 0.016 0.812 0.000 0.000 0.172 0.000
#> GSM97045     2  0.0508    0.88884 0.004 0.984 0.000 0.000 0.012 0.000
#> GSM97047     5  0.6379    0.39498 0.196 0.376 0.024 0.000 0.404 0.000
#> GSM97025     2  0.0508    0.88884 0.004 0.984 0.000 0.000 0.012 0.000
#> GSM97030     3  0.5160    0.73437 0.000 0.084 0.680 0.000 0.044 0.192
#> GSM97027     2  0.0508    0.88884 0.004 0.984 0.000 0.000 0.012 0.000
#> GSM97033     2  0.0508    0.88884 0.004 0.984 0.000 0.000 0.012 0.000
#> GSM97034     5  0.6932    0.45750 0.240 0.312 0.060 0.000 0.388 0.000
#> GSM97020     2  0.0508    0.88884 0.004 0.984 0.000 0.000 0.012 0.000
#> GSM97026     2  0.5350    0.05481 0.068 0.548 0.020 0.000 0.364 0.000
#> GSM97012     2  0.0000    0.88988 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97015     5  0.7861    0.39206 0.184 0.300 0.144 0.000 0.348 0.024
#> GSM97016     2  0.0508    0.88884 0.004 0.984 0.000 0.000 0.012 0.000
#> GSM97017     5  0.6311    0.40135 0.196 0.372 0.020 0.000 0.412 0.000
#> GSM97019     2  0.0000    0.88988 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97022     2  0.0000    0.88988 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97035     2  0.0000    0.88988 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97036     5  0.5892    0.24503 0.292 0.024 0.112 0.000 0.564 0.008
#> GSM97039     2  0.0000    0.88988 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97046     2  0.0000    0.88988 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97023     1  0.1843    0.80751 0.912 0.000 0.004 0.000 0.080 0.004
#> GSM97029     5  0.6856    0.45832 0.244 0.312 0.052 0.000 0.392 0.000
#> GSM97043     2  0.4643    0.38766 0.028 0.660 0.028 0.000 0.284 0.000
#> GSM97013     1  0.0632    0.84055 0.976 0.000 0.000 0.000 0.000 0.024
#> GSM96956     2  0.5771    0.14436 0.000 0.544 0.332 0.000 0.040 0.084
#> GSM97024     2  0.2060    0.83074 0.000 0.900 0.084 0.000 0.016 0.000
#> GSM97032     5  0.7128    0.39338 0.184 0.352 0.100 0.000 0.364 0.000
#> GSM97044     3  0.5160    0.73437 0.000 0.084 0.680 0.000 0.044 0.192
#> GSM97049     2  0.1082    0.86884 0.000 0.956 0.004 0.000 0.040 0.000
#> GSM96968     1  0.4264    0.33113 0.604 0.000 0.008 0.000 0.012 0.376
#> GSM96971     4  0.3266    0.63630 0.000 0.000 0.000 0.728 0.000 0.272
#> GSM96986     6  0.0865    0.80604 0.036 0.000 0.000 0.000 0.000 0.964
#> GSM97003     1  0.2886    0.76788 0.836 0.000 0.004 0.000 0.016 0.144
#> GSM96957     1  0.2879    0.69073 0.816 0.004 0.004 0.000 0.176 0.000
#> GSM96960     5  0.6118   -0.12685 0.404 0.000 0.116 0.000 0.444 0.036
#> GSM96975     5  0.5625    0.01880 0.284 0.000 0.120 0.000 0.576 0.020
#> GSM96998     1  0.1806    0.81018 0.908 0.000 0.004 0.000 0.088 0.000
#> GSM96999     1  0.3208    0.80357 0.844 0.000 0.012 0.000 0.076 0.068
#> GSM97001     1  0.2879    0.69073 0.816 0.004 0.004 0.000 0.176 0.000
#> GSM97005     1  0.0632    0.84055 0.976 0.000 0.000 0.000 0.000 0.024
#> GSM97006     1  0.3035    0.76054 0.828 0.000 0.008 0.000 0.016 0.148
#> GSM97021     5  0.6311    0.40135 0.196 0.372 0.020 0.000 0.412 0.000
#> GSM97028     5  0.8172    0.34544 0.200 0.232 0.156 0.000 0.364 0.048
#> GSM97031     1  0.0713    0.84099 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM97037     3  0.5160    0.73437 0.000 0.084 0.680 0.000 0.044 0.192
#> GSM97018     5  0.7201    0.43071 0.200 0.324 0.104 0.000 0.372 0.000
#> GSM97014     5  0.6379    0.39498 0.196 0.376 0.024 0.000 0.404 0.000
#> GSM97042     2  0.0000    0.88988 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97040     5  0.6311    0.40135 0.196 0.372 0.020 0.000 0.412 0.000
#> GSM97041     5  0.6311    0.40135 0.196 0.372 0.020 0.000 0.412 0.000
#> GSM96955     2  0.1895    0.83767 0.000 0.912 0.072 0.000 0.016 0.000
#> GSM96990     5  0.7388    0.44076 0.208 0.304 0.112 0.000 0.372 0.004
#> GSM96991     2  0.1895    0.83767 0.000 0.912 0.072 0.000 0.016 0.000
#> GSM97048     2  0.0000    0.88988 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96963     2  0.1895    0.83767 0.000 0.912 0.072 0.000 0.016 0.000
#> GSM96953     2  0.1970    0.84098 0.000 0.912 0.060 0.000 0.028 0.000
#> GSM96966     4  0.0000    0.96912 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96979     6  0.0865    0.80604 0.036 0.000 0.000 0.000 0.000 0.964
#> GSM96983     3  0.3917    0.66625 0.000 0.012 0.752 0.000 0.032 0.204
#> GSM96984     6  0.0865    0.80604 0.036 0.000 0.000 0.000 0.000 0.964
#> GSM96994     3  0.5452    0.69295 0.020 0.036 0.668 0.000 0.068 0.208
#> GSM96996     5  0.5483    0.01917 0.444 0.008 0.064 0.000 0.472 0.012
#> GSM96997     6  0.0865    0.80604 0.036 0.000 0.000 0.000 0.000 0.964
#> GSM97007     3  0.3428    0.50688 0.000 0.000 0.696 0.000 0.000 0.304
#> GSM96954     6  0.4273    0.52189 0.324 0.000 0.012 0.000 0.016 0.648
#> GSM96962     6  0.0865    0.80604 0.036 0.000 0.000 0.000 0.000 0.964
#> GSM96969     4  0.0000    0.96912 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96970     4  0.0000    0.96912 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96973     4  0.0000    0.96912 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96976     4  0.0000    0.96912 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96977     1  0.4088    0.41954 0.636 0.000 0.008 0.000 0.008 0.348
#> GSM96995     5  0.7350    0.44593 0.212 0.308 0.104 0.000 0.372 0.004
#> GSM97002     5  0.6025   -0.03917 0.336 0.000 0.124 0.000 0.508 0.032
#> GSM97009     5  0.6121    0.27183 0.412 0.116 0.036 0.000 0.436 0.000
#> GSM97010     1  0.4031    0.45741 0.652 0.000 0.008 0.000 0.008 0.332
#> GSM96974     4  0.0000    0.96912 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96985     5  0.5457    0.03754 0.164 0.000 0.148 0.000 0.652 0.036
#> GSM96959     5  0.7350    0.44593 0.212 0.308 0.104 0.000 0.372 0.004
#> GSM96972     4  0.0000    0.96912 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96978     6  0.6080    0.36755 0.300 0.000 0.188 0.000 0.016 0.496
#> GSM96967     4  0.0000    0.96912 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96987     5  0.6011    0.20359 0.304 0.016 0.128 0.000 0.540 0.012
#> GSM97011     5  0.6121    0.27183 0.412 0.116 0.036 0.000 0.436 0.000
#> GSM96964     1  0.1873    0.83622 0.924 0.000 0.008 0.000 0.048 0.020
#> GSM96965     4  0.0000    0.96912 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96981     5  0.5625    0.01880 0.284 0.000 0.120 0.000 0.576 0.020
#> GSM96982     5  0.5625    0.01880 0.284 0.000 0.120 0.000 0.576 0.020
#> GSM96988     3  0.8438   -0.19149 0.196 0.160 0.300 0.000 0.276 0.068
#> GSM97000     1  0.1152    0.83944 0.952 0.000 0.000 0.000 0.004 0.044
#> GSM97004     5  0.6077   -0.02266 0.320 0.000 0.128 0.000 0.516 0.036
#> GSM97008     1  0.1536    0.83247 0.940 0.000 0.004 0.000 0.040 0.016
#> GSM96950     1  0.0790    0.84094 0.968 0.000 0.000 0.000 0.000 0.032
#> GSM96980     5  0.6311   -0.01456 0.300 0.000 0.136 0.008 0.520 0.036
#> GSM96989     5  0.5961   -0.00118 0.408 0.016 0.108 0.000 0.460 0.008
#> GSM96992     1  0.2001    0.80586 0.900 0.000 0.004 0.000 0.092 0.004
#> GSM96993     5  0.5892    0.24503 0.292 0.024 0.112 0.000 0.564 0.008
#> GSM96958     1  0.1812    0.82614 0.912 0.000 0.000 0.000 0.008 0.080
#> GSM96951     1  0.0713    0.84088 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM96952     1  0.2001    0.80586 0.900 0.000 0.004 0.000 0.092 0.004
#> GSM96961     1  0.2001    0.80586 0.900 0.000 0.004 0.000 0.092 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-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-hclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-hclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:hclust 100         5.90e-02      0.5263     4.19e-04  0.45353 2
#> ATC:hclust  89         6.61e-08      0.1775     4.27e-16  0.06201 3
#> ATC:hclust  88         6.64e-06      0.1174     1.27e-19  0.00812 4
#> ATC:hclust  61         4.28e-04      0.1236     1.61e-17  0.00533 5
#> ATC:hclust  62         5.10e-04      0.0427     9.55e-18  0.01490 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 21168 rows and 100 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 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-kmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.965       0.976         0.4972 0.495   0.495
#> 3 3 0.976           0.966       0.977         0.1960 0.899   0.800
#> 4 4 0.597           0.605       0.763         0.1931 0.829   0.604
#> 5 5 0.763           0.692       0.832         0.1012 0.805   0.429
#> 6 6 0.837           0.866       0.882         0.0536 0.923   0.658

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2

There is also optional best \(k\) = 2 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97038     2  0.0000      0.999 0.000 1.000
#> GSM97045     2  0.0000      0.999 0.000 1.000
#> GSM97047     2  0.0000      0.999 0.000 1.000
#> GSM97025     2  0.0000      0.999 0.000 1.000
#> GSM97030     2  0.0000      0.999 0.000 1.000
#> GSM97027     2  0.0000      0.999 0.000 1.000
#> GSM97033     2  0.0000      0.999 0.000 1.000
#> GSM97034     2  0.0000      0.999 0.000 1.000
#> GSM97020     2  0.0000      0.999 0.000 1.000
#> GSM97026     2  0.0000      0.999 0.000 1.000
#> GSM97012     2  0.0000      0.999 0.000 1.000
#> GSM97015     2  0.0000      0.999 0.000 1.000
#> GSM97016     2  0.0000      0.999 0.000 1.000
#> GSM97017     2  0.0000      0.999 0.000 1.000
#> GSM97019     2  0.0000      0.999 0.000 1.000
#> GSM97022     2  0.0000      0.999 0.000 1.000
#> GSM97035     2  0.0000      0.999 0.000 1.000
#> GSM97036     2  0.0000      0.999 0.000 1.000
#> GSM97039     2  0.0000      0.999 0.000 1.000
#> GSM97046     2  0.0000      0.999 0.000 1.000
#> GSM97023     1  0.2236      0.964 0.964 0.036
#> GSM97029     2  0.0000      0.999 0.000 1.000
#> GSM97043     2  0.0000      0.999 0.000 1.000
#> GSM97013     1  0.2236      0.964 0.964 0.036
#> GSM96956     2  0.0000      0.999 0.000 1.000
#> GSM97024     2  0.0000      0.999 0.000 1.000
#> GSM97032     2  0.0000      0.999 0.000 1.000
#> GSM97044     2  0.0000      0.999 0.000 1.000
#> GSM97049     2  0.0000      0.999 0.000 1.000
#> GSM96968     1  0.2236      0.964 0.964 0.036
#> GSM96971     1  0.0000      0.954 1.000 0.000
#> GSM96986     1  0.0938      0.960 0.988 0.012
#> GSM97003     1  0.0938      0.960 0.988 0.012
#> GSM96957     1  0.8499      0.675 0.724 0.276
#> GSM96960     1  0.0938      0.960 0.988 0.012
#> GSM96975     1  0.2236      0.964 0.964 0.036
#> GSM96998     1  0.2236      0.964 0.964 0.036
#> GSM96999     1  0.2236      0.964 0.964 0.036
#> GSM97001     2  0.2423      0.955 0.040 0.960
#> GSM97005     1  0.2236      0.964 0.964 0.036
#> GSM97006     1  0.0938      0.960 0.988 0.012
#> GSM97021     2  0.0000      0.999 0.000 1.000
#> GSM97028     2  0.0000      0.999 0.000 1.000
#> GSM97031     1  0.2236      0.964 0.964 0.036
#> GSM97037     2  0.0000      0.999 0.000 1.000
#> GSM97018     2  0.0000      0.999 0.000 1.000
#> GSM97014     2  0.0000      0.999 0.000 1.000
#> GSM97042     2  0.0000      0.999 0.000 1.000
#> GSM97040     2  0.0000      0.999 0.000 1.000
#> GSM97041     2  0.0000      0.999 0.000 1.000
#> GSM96955     2  0.0000      0.999 0.000 1.000
#> GSM96990     2  0.0000      0.999 0.000 1.000
#> GSM96991     2  0.0000      0.999 0.000 1.000
#> GSM97048     2  0.0000      0.999 0.000 1.000
#> GSM96963     2  0.0000      0.999 0.000 1.000
#> GSM96953     2  0.0000      0.999 0.000 1.000
#> GSM96966     1  0.0000      0.954 1.000 0.000
#> GSM96979     1  0.0938      0.960 0.988 0.012
#> GSM96983     2  0.0000      0.999 0.000 1.000
#> GSM96984     1  0.0938      0.960 0.988 0.012
#> GSM96994     2  0.0000      0.999 0.000 1.000
#> GSM96996     1  0.2423      0.961 0.960 0.040
#> GSM96997     1  0.0938      0.960 0.988 0.012
#> GSM97007     1  0.2423      0.961 0.960 0.040
#> GSM96954     1  0.2236      0.964 0.964 0.036
#> GSM96962     1  0.0938      0.960 0.988 0.012
#> GSM96969     1  0.0000      0.954 1.000 0.000
#> GSM96970     1  0.0000      0.954 1.000 0.000
#> GSM96973     1  0.0000      0.954 1.000 0.000
#> GSM96976     1  0.0000      0.954 1.000 0.000
#> GSM96977     1  0.2236      0.964 0.964 0.036
#> GSM96995     2  0.0000      0.999 0.000 1.000
#> GSM97002     1  0.2236      0.964 0.964 0.036
#> GSM97009     2  0.0000      0.999 0.000 1.000
#> GSM97010     1  0.2236      0.964 0.964 0.036
#> GSM96974     1  0.0000      0.954 1.000 0.000
#> GSM96985     1  0.2236      0.964 0.964 0.036
#> GSM96959     2  0.0000      0.999 0.000 1.000
#> GSM96972     1  0.0000      0.954 1.000 0.000
#> GSM96978     1  0.0938      0.960 0.988 0.012
#> GSM96967     1  0.0000      0.954 1.000 0.000
#> GSM96987     1  0.9087      0.590 0.676 0.324
#> GSM97011     2  0.0000      0.999 0.000 1.000
#> GSM96964     1  0.2236      0.964 0.964 0.036
#> GSM96965     1  0.0000      0.954 1.000 0.000
#> GSM96981     1  0.2236      0.964 0.964 0.036
#> GSM96982     1  0.2236      0.964 0.964 0.036
#> GSM96988     1  0.9286      0.549 0.656 0.344
#> GSM97000     1  0.2236      0.964 0.964 0.036
#> GSM97004     1  0.2236      0.964 0.964 0.036
#> GSM97008     1  0.9000      0.606 0.684 0.316
#> GSM96950     1  0.2236      0.964 0.964 0.036
#> GSM96980     1  0.0000      0.954 1.000 0.000
#> GSM96989     1  0.2236      0.964 0.964 0.036
#> GSM96992     1  0.2236      0.964 0.964 0.036
#> GSM96993     2  0.0000      0.999 0.000 1.000
#> GSM96958     1  0.2236      0.964 0.964 0.036
#> GSM96951     1  0.2236      0.964 0.964 0.036
#> GSM96952     1  0.2236      0.964 0.964 0.036
#> GSM96961     1  0.2236      0.964 0.964 0.036

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97038     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97045     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97047     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97025     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97030     2  0.1399      0.964 0.004 0.968 0.028
#> GSM97027     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97033     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97034     2  0.1399      0.964 0.004 0.968 0.028
#> GSM97020     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97026     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97012     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97015     2  0.1399      0.964 0.004 0.968 0.028
#> GSM97016     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97017     2  0.2356      0.923 0.072 0.928 0.000
#> GSM97019     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97022     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97035     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97036     2  0.2356      0.923 0.072 0.928 0.000
#> GSM97039     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97046     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97023     1  0.0237      0.977 0.996 0.000 0.004
#> GSM97029     2  0.2356      0.923 0.072 0.928 0.000
#> GSM97043     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97013     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96956     2  0.1399      0.964 0.004 0.968 0.028
#> GSM97024     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97032     2  0.0892      0.969 0.000 0.980 0.020
#> GSM97044     2  0.1399      0.964 0.004 0.968 0.028
#> GSM97049     2  0.0000      0.974 0.000 1.000 0.000
#> GSM96968     1  0.1163      0.960 0.972 0.000 0.028
#> GSM96971     3  0.0892      0.991 0.020 0.000 0.980
#> GSM96986     1  0.2537      0.923 0.920 0.000 0.080
#> GSM97003     1  0.0000      0.976 1.000 0.000 0.000
#> GSM96957     1  0.0592      0.969 0.988 0.000 0.012
#> GSM96960     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96975     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96998     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96999     1  0.0237      0.977 0.996 0.000 0.004
#> GSM97001     1  0.1163      0.955 0.972 0.028 0.000
#> GSM97005     1  0.0000      0.976 1.000 0.000 0.000
#> GSM97006     1  0.0237      0.977 0.996 0.000 0.004
#> GSM97021     2  0.2448      0.919 0.076 0.924 0.000
#> GSM97028     2  0.1399      0.964 0.004 0.968 0.028
#> GSM97031     1  0.0424      0.972 0.992 0.000 0.008
#> GSM97037     2  0.1399      0.964 0.004 0.968 0.028
#> GSM97018     2  0.0892      0.969 0.000 0.980 0.020
#> GSM97014     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97042     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97040     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97041     2  0.2448      0.919 0.076 0.924 0.000
#> GSM96955     2  0.0000      0.974 0.000 1.000 0.000
#> GSM96990     2  0.1267      0.966 0.004 0.972 0.024
#> GSM96991     2  0.0000      0.974 0.000 1.000 0.000
#> GSM97048     2  0.0000      0.974 0.000 1.000 0.000
#> GSM96963     2  0.0000      0.974 0.000 1.000 0.000
#> GSM96953     2  0.0000      0.974 0.000 1.000 0.000
#> GSM96966     3  0.1163      0.999 0.028 0.000 0.972
#> GSM96979     1  0.2537      0.923 0.920 0.000 0.080
#> GSM96983     2  0.1399      0.964 0.004 0.968 0.028
#> GSM96984     1  0.2537      0.923 0.920 0.000 0.080
#> GSM96994     2  0.1751      0.960 0.012 0.960 0.028
#> GSM96996     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96997     1  0.2537      0.923 0.920 0.000 0.080
#> GSM97007     1  0.3499      0.885 0.900 0.072 0.028
#> GSM96954     1  0.1163      0.960 0.972 0.000 0.028
#> GSM96962     1  0.2537      0.923 0.920 0.000 0.080
#> GSM96969     3  0.1163      0.999 0.028 0.000 0.972
#> GSM96970     3  0.1163      0.999 0.028 0.000 0.972
#> GSM96973     3  0.1163      0.999 0.028 0.000 0.972
#> GSM96976     3  0.1163      0.999 0.028 0.000 0.972
#> GSM96977     1  0.0000      0.976 1.000 0.000 0.000
#> GSM96995     2  0.3678      0.908 0.080 0.892 0.028
#> GSM97002     1  0.0237      0.977 0.996 0.000 0.004
#> GSM97009     2  0.3272      0.913 0.080 0.904 0.016
#> GSM97010     1  0.0000      0.976 1.000 0.000 0.000
#> GSM96974     3  0.1163      0.999 0.028 0.000 0.972
#> GSM96985     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96959     2  0.1267      0.966 0.004 0.972 0.024
#> GSM96972     3  0.1163      0.999 0.028 0.000 0.972
#> GSM96978     1  0.2537      0.923 0.920 0.000 0.080
#> GSM96967     3  0.1163      0.999 0.028 0.000 0.972
#> GSM96987     1  0.0237      0.977 0.996 0.000 0.004
#> GSM97011     2  0.2448      0.919 0.076 0.924 0.000
#> GSM96964     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96965     3  0.1163      0.999 0.028 0.000 0.972
#> GSM96981     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96982     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96988     1  0.1163      0.960 0.972 0.000 0.028
#> GSM97000     1  0.0892      0.966 0.980 0.000 0.020
#> GSM97004     1  0.0237      0.977 0.996 0.000 0.004
#> GSM97008     1  0.1163      0.960 0.972 0.000 0.028
#> GSM96950     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96980     1  0.2448      0.923 0.924 0.000 0.076
#> GSM96989     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96992     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96993     2  0.2448      0.919 0.076 0.924 0.000
#> GSM96958     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96951     1  0.0000      0.976 1.000 0.000 0.000
#> GSM96952     1  0.0237      0.977 0.996 0.000 0.004
#> GSM96961     1  0.0237      0.977 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
#> GSM97038     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97045     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97047     2  0.4941    0.17792 0.000 0.564 0.436 0.000
#> GSM97025     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97030     2  0.4585    0.48905 0.000 0.668 0.332 0.000
#> GSM97027     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97033     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97034     3  0.5256    0.14974 0.012 0.392 0.596 0.000
#> GSM97020     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97026     2  0.4933    0.18263 0.000 0.568 0.432 0.000
#> GSM97012     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97015     3  0.4898    0.10633 0.000 0.416 0.584 0.000
#> GSM97016     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97017     3  0.6013    0.45222 0.064 0.312 0.624 0.000
#> GSM97019     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97036     3  0.6058    0.58209 0.180 0.136 0.684 0.000
#> GSM97039     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97023     1  0.4454    0.63007 0.692 0.000 0.308 0.000
#> GSM97029     3  0.6231    0.59139 0.184 0.148 0.668 0.000
#> GSM97043     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97013     1  0.1389    0.71012 0.952 0.000 0.048 0.000
#> GSM96956     2  0.4585    0.48926 0.000 0.668 0.332 0.000
#> GSM97024     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97032     2  0.4925    0.24986 0.000 0.572 0.428 0.000
#> GSM97044     3  0.5256    0.08319 0.012 0.392 0.596 0.000
#> GSM97049     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM96968     1  0.3907    0.60460 0.768 0.000 0.232 0.000
#> GSM96971     4  0.0000    1.00000 0.000 0.000 0.000 1.000
#> GSM96986     1  0.3791    0.62693 0.796 0.000 0.200 0.004
#> GSM97003     1  0.2216    0.68050 0.908 0.000 0.092 0.000
#> GSM96957     3  0.4933   -0.00567 0.432 0.000 0.568 0.000
#> GSM96960     1  0.4040    0.66939 0.752 0.000 0.248 0.000
#> GSM96975     1  0.4877    0.47179 0.592 0.000 0.408 0.000
#> GSM96998     1  0.4250    0.65808 0.724 0.000 0.276 0.000
#> GSM96999     1  0.4304    0.65428 0.716 0.000 0.284 0.000
#> GSM97001     3  0.4477    0.34651 0.312 0.000 0.688 0.000
#> GSM97005     1  0.0336    0.70978 0.992 0.000 0.008 0.000
#> GSM97006     1  0.0469    0.71048 0.988 0.000 0.012 0.000
#> GSM97021     3  0.6224    0.59020 0.188 0.144 0.668 0.000
#> GSM97028     3  0.4888    0.11739 0.000 0.412 0.588 0.000
#> GSM97031     1  0.2011    0.68492 0.920 0.000 0.080 0.000
#> GSM97037     2  0.4989    0.19134 0.000 0.528 0.472 0.000
#> GSM97018     2  0.4992    0.11506 0.000 0.524 0.476 0.000
#> GSM97014     2  0.4925    0.19359 0.000 0.572 0.428 0.000
#> GSM97042     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97040     2  0.5586    0.06186 0.020 0.528 0.452 0.000
#> GSM97041     3  0.6013    0.57211 0.196 0.120 0.684 0.000
#> GSM96955     2  0.0469    0.82317 0.000 0.988 0.012 0.000
#> GSM96990     3  0.4888    0.11739 0.000 0.412 0.588 0.000
#> GSM96991     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM97048     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000    0.83366 0.000 1.000 0.000 0.000
#> GSM96966     4  0.0000    1.00000 0.000 0.000 0.000 1.000
#> GSM96979     1  0.3791    0.62693 0.796 0.000 0.200 0.004
#> GSM96983     3  0.4877    0.11971 0.000 0.408 0.592 0.000
#> GSM96984     1  0.4053    0.60550 0.768 0.000 0.228 0.004
#> GSM96994     3  0.4933    0.25446 0.016 0.296 0.688 0.000
#> GSM96996     3  0.4907    0.04011 0.420 0.000 0.580 0.000
#> GSM96997     1  0.3791    0.62693 0.796 0.000 0.200 0.004
#> GSM97007     1  0.4948    0.29477 0.560 0.000 0.440 0.000
#> GSM96954     1  0.3907    0.60460 0.768 0.000 0.232 0.000
#> GSM96962     1  0.3982    0.61214 0.776 0.000 0.220 0.004
#> GSM96969     4  0.0000    1.00000 0.000 0.000 0.000 1.000
#> GSM96970     4  0.0000    1.00000 0.000 0.000 0.000 1.000
#> GSM96973     4  0.0000    1.00000 0.000 0.000 0.000 1.000
#> GSM96976     4  0.0000    1.00000 0.000 0.000 0.000 1.000
#> GSM96977     1  0.0000    0.70851 1.000 0.000 0.000 0.000
#> GSM96995     3  0.4638    0.49603 0.044 0.180 0.776 0.000
#> GSM97002     1  0.4304    0.65428 0.716 0.000 0.284 0.000
#> GSM97009     3  0.5932    0.59518 0.172 0.132 0.696 0.000
#> GSM97010     1  0.0469    0.71025 0.988 0.000 0.012 0.000
#> GSM96974     4  0.0000    1.00000 0.000 0.000 0.000 1.000
#> GSM96985     1  0.4898    0.45476 0.584 0.000 0.416 0.000
#> GSM96959     3  0.4790    0.17877 0.000 0.380 0.620 0.000
#> GSM96972     4  0.0000    1.00000 0.000 0.000 0.000 1.000
#> GSM96978     1  0.3907    0.60460 0.768 0.000 0.232 0.000
#> GSM96967     4  0.0000    1.00000 0.000 0.000 0.000 1.000
#> GSM96987     3  0.4907    0.04011 0.420 0.000 0.580 0.000
#> GSM97011     3  0.6224    0.59020 0.188 0.144 0.668 0.000
#> GSM96964     1  0.4331    0.65180 0.712 0.000 0.288 0.000
#> GSM96965     4  0.0000    1.00000 0.000 0.000 0.000 1.000
#> GSM96981     1  0.4877    0.47179 0.592 0.000 0.408 0.000
#> GSM96982     1  0.4331    0.65180 0.712 0.000 0.288 0.000
#> GSM96988     3  0.3610    0.48940 0.200 0.000 0.800 0.000
#> GSM97000     1  0.3610    0.62858 0.800 0.000 0.200 0.000
#> GSM97004     1  0.4331    0.65180 0.712 0.000 0.288 0.000
#> GSM97008     3  0.4454    0.35475 0.308 0.000 0.692 0.000
#> GSM96950     1  0.1389    0.71012 0.952 0.000 0.048 0.000
#> GSM96980     1  0.5452    0.66082 0.736 0.000 0.156 0.108
#> GSM96989     1  0.4877    0.47179 0.592 0.000 0.408 0.000
#> GSM96992     1  0.4331    0.65180 0.712 0.000 0.288 0.000
#> GSM96993     3  0.6013    0.57211 0.196 0.120 0.684 0.000
#> GSM96958     1  0.3219    0.69405 0.836 0.000 0.164 0.000
#> GSM96951     1  0.0000    0.70851 1.000 0.000 0.000 0.000
#> GSM96952     1  0.4331    0.65180 0.712 0.000 0.288 0.000
#> GSM96961     1  0.4331    0.65180 0.712 0.000 0.288 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
#> GSM97038     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97045     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97047     3  0.5040     0.6333 0.192 0.080 0.716 0.000 0.012
#> GSM97025     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97030     3  0.4352     0.6388 0.000 0.244 0.720 0.000 0.036
#> GSM97027     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97033     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97034     3  0.2782     0.7604 0.000 0.072 0.880 0.000 0.048
#> GSM97020     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97026     3  0.6590     0.4304 0.228 0.320 0.452 0.000 0.000
#> GSM97012     2  0.0992     0.9744 0.024 0.968 0.008 0.000 0.000
#> GSM97015     3  0.2850     0.7612 0.000 0.092 0.872 0.000 0.036
#> GSM97016     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97017     1  0.5951    -0.2343 0.464 0.072 0.452 0.000 0.012
#> GSM97019     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97022     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97035     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97036     1  0.5283    -0.0668 0.540 0.028 0.420 0.000 0.012
#> GSM97039     2  0.0162     0.9894 0.004 0.996 0.000 0.000 0.000
#> GSM97046     2  0.1082     0.9734 0.028 0.964 0.008 0.000 0.000
#> GSM97023     1  0.3016     0.5877 0.848 0.000 0.020 0.000 0.132
#> GSM97029     1  0.5328    -0.1526 0.492 0.028 0.468 0.000 0.012
#> GSM97043     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97013     5  0.4054     0.7017 0.224 0.000 0.028 0.000 0.748
#> GSM96956     3  0.3810     0.7120 0.000 0.176 0.788 0.000 0.036
#> GSM97024     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM97032     3  0.2605     0.7469 0.000 0.148 0.852 0.000 0.000
#> GSM97044     3  0.3051     0.7544 0.000 0.076 0.864 0.000 0.060
#> GSM97049     2  0.0162     0.9894 0.004 0.996 0.000 0.000 0.000
#> GSM96968     5  0.0992     0.8375 0.008 0.000 0.024 0.000 0.968
#> GSM96971     4  0.0771     0.9896 0.000 0.000 0.020 0.976 0.004
#> GSM96986     5  0.1043     0.8358 0.000 0.000 0.040 0.000 0.960
#> GSM97003     5  0.1800     0.8360 0.048 0.000 0.020 0.000 0.932
#> GSM96957     1  0.4254     0.4467 0.740 0.000 0.220 0.000 0.040
#> GSM96960     1  0.4009     0.4329 0.684 0.000 0.004 0.000 0.312
#> GSM96975     1  0.1168     0.6113 0.960 0.000 0.008 0.000 0.032
#> GSM96998     1  0.4184     0.4832 0.700 0.000 0.016 0.000 0.284
#> GSM96999     1  0.4384     0.4283 0.660 0.000 0.016 0.000 0.324
#> GSM97001     1  0.4026     0.4133 0.736 0.000 0.244 0.000 0.020
#> GSM97005     5  0.3321     0.7907 0.136 0.000 0.032 0.000 0.832
#> GSM97006     5  0.4835     0.4371 0.380 0.000 0.028 0.000 0.592
#> GSM97021     3  0.5330     0.1150 0.480 0.028 0.480 0.000 0.012
#> GSM97028     3  0.2676     0.7622 0.000 0.080 0.884 0.000 0.036
#> GSM97031     5  0.1725     0.8299 0.044 0.000 0.020 0.000 0.936
#> GSM97037     3  0.2959     0.7587 0.000 0.100 0.864 0.000 0.036
#> GSM97018     3  0.2280     0.7550 0.000 0.120 0.880 0.000 0.000
#> GSM97014     3  0.6898     0.4305 0.228 0.304 0.456 0.000 0.012
#> GSM97042     2  0.0162     0.9893 0.004 0.996 0.000 0.000 0.000
#> GSM97040     3  0.5409     0.5791 0.252 0.076 0.660 0.000 0.012
#> GSM97041     1  0.5230    -0.0528 0.528 0.024 0.436 0.000 0.012
#> GSM96955     2  0.1393     0.9671 0.024 0.956 0.012 0.000 0.008
#> GSM96990     3  0.2293     0.7622 0.000 0.084 0.900 0.000 0.016
#> GSM96991     2  0.1393     0.9671 0.024 0.956 0.012 0.000 0.008
#> GSM97048     2  0.0162     0.9894 0.004 0.996 0.000 0.000 0.000
#> GSM96963     2  0.1393     0.9671 0.024 0.956 0.012 0.000 0.008
#> GSM96953     2  0.0000     0.9909 0.000 1.000 0.000 0.000 0.000
#> GSM96966     4  0.0290     0.9945 0.000 0.000 0.008 0.992 0.000
#> GSM96979     5  0.1043     0.8358 0.000 0.000 0.040 0.000 0.960
#> GSM96983     3  0.2616     0.7617 0.000 0.076 0.888 0.000 0.036
#> GSM96984     5  0.1043     0.8358 0.000 0.000 0.040 0.000 0.960
#> GSM96994     3  0.2795     0.7522 0.000 0.056 0.880 0.000 0.064
#> GSM96996     1  0.0898     0.6105 0.972 0.000 0.020 0.000 0.008
#> GSM96997     5  0.1043     0.8358 0.000 0.000 0.040 0.000 0.960
#> GSM97007     3  0.4306     0.0095 0.000 0.000 0.508 0.000 0.492
#> GSM96954     5  0.0794     0.8371 0.000 0.000 0.028 0.000 0.972
#> GSM96962     5  0.1043     0.8358 0.000 0.000 0.040 0.000 0.960
#> GSM96969     4  0.0000     0.9951 0.000 0.000 0.000 1.000 0.000
#> GSM96970     4  0.0000     0.9951 0.000 0.000 0.000 1.000 0.000
#> GSM96973     4  0.0000     0.9951 0.000 0.000 0.000 1.000 0.000
#> GSM96976     4  0.0609     0.9912 0.000 0.000 0.020 0.980 0.000
#> GSM96977     5  0.3151     0.7923 0.144 0.000 0.020 0.000 0.836
#> GSM96995     3  0.2333     0.7451 0.028 0.040 0.916 0.000 0.016
#> GSM97002     1  0.3814     0.4959 0.720 0.000 0.004 0.000 0.276
#> GSM97009     3  0.5149     0.4041 0.356 0.020 0.604 0.000 0.020
#> GSM97010     5  0.3343     0.7742 0.172 0.000 0.016 0.000 0.812
#> GSM96974     4  0.0510     0.9921 0.000 0.000 0.016 0.984 0.000
#> GSM96985     1  0.2813     0.5940 0.868 0.000 0.024 0.000 0.108
#> GSM96959     3  0.2162     0.7500 0.008 0.064 0.916 0.000 0.012
#> GSM96972     4  0.0000     0.9951 0.000 0.000 0.000 1.000 0.000
#> GSM96978     5  0.1041     0.8365 0.004 0.000 0.032 0.000 0.964
#> GSM96967     4  0.0000     0.9951 0.000 0.000 0.000 1.000 0.000
#> GSM96987     1  0.0898     0.6105 0.972 0.000 0.020 0.000 0.008
#> GSM97011     3  0.5330     0.1150 0.480 0.028 0.480 0.000 0.012
#> GSM96964     1  0.4227     0.4846 0.692 0.000 0.016 0.000 0.292
#> GSM96965     4  0.0290     0.9945 0.000 0.000 0.008 0.992 0.000
#> GSM96981     1  0.0898     0.6111 0.972 0.000 0.008 0.000 0.020
#> GSM96982     1  0.3814     0.4959 0.720 0.000 0.004 0.000 0.276
#> GSM96988     3  0.3949     0.5029 0.300 0.000 0.696 0.000 0.004
#> GSM97000     5  0.0955     0.8346 0.004 0.000 0.028 0.000 0.968
#> GSM97004     1  0.3814     0.4959 0.720 0.000 0.004 0.000 0.276
#> GSM97008     1  0.5047    -0.1144 0.496 0.000 0.472 0.000 0.032
#> GSM96950     5  0.3942     0.6977 0.232 0.000 0.020 0.000 0.748
#> GSM96980     1  0.5456     0.3257 0.608 0.000 0.004 0.072 0.316
#> GSM96989     1  0.1484     0.6098 0.944 0.000 0.008 0.000 0.048
#> GSM96992     1  0.3661     0.4959 0.724 0.000 0.000 0.000 0.276
#> GSM96993     1  0.5283    -0.0593 0.540 0.028 0.420 0.000 0.012
#> GSM96958     5  0.4723     0.2316 0.448 0.000 0.016 0.000 0.536
#> GSM96951     5  0.3106     0.7943 0.140 0.000 0.020 0.000 0.840
#> GSM96952     1  0.3661     0.4959 0.724 0.000 0.000 0.000 0.276
#> GSM96961     1  0.4138     0.4894 0.708 0.000 0.016 0.000 0.276

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.0520      0.972 0.008 0.984 0.008 0.000 0.000 0.000
#> GSM97045     2  0.0520      0.972 0.008 0.984 0.008 0.000 0.000 0.000
#> GSM97047     5  0.4287      0.804 0.008 0.024 0.312 0.000 0.656 0.000
#> GSM97025     2  0.0520      0.972 0.008 0.984 0.008 0.000 0.000 0.000
#> GSM97030     3  0.1765      0.829 0.000 0.096 0.904 0.000 0.000 0.000
#> GSM97027     2  0.0520      0.972 0.008 0.984 0.008 0.000 0.000 0.000
#> GSM97033     2  0.0520      0.972 0.008 0.984 0.008 0.000 0.000 0.000
#> GSM97034     3  0.0508      0.884 0.000 0.012 0.984 0.000 0.000 0.004
#> GSM97020     2  0.0520      0.972 0.008 0.984 0.008 0.000 0.000 0.000
#> GSM97026     5  0.4743      0.824 0.008 0.076 0.248 0.000 0.668 0.000
#> GSM97012     2  0.1382      0.947 0.008 0.948 0.008 0.000 0.036 0.000
#> GSM97015     3  0.0508      0.884 0.000 0.012 0.984 0.000 0.004 0.000
#> GSM97016     2  0.0405      0.972 0.004 0.988 0.008 0.000 0.000 0.000
#> GSM97017     5  0.4354      0.886 0.052 0.008 0.236 0.000 0.704 0.000
#> GSM97019     2  0.0260      0.972 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM97022     2  0.0260      0.972 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM97035     2  0.0405      0.971 0.000 0.988 0.008 0.000 0.004 0.000
#> GSM97036     5  0.4506      0.871 0.088 0.000 0.204 0.000 0.704 0.004
#> GSM97039     2  0.1121      0.965 0.008 0.964 0.008 0.000 0.016 0.004
#> GSM97046     2  0.2100      0.935 0.024 0.916 0.008 0.000 0.048 0.004
#> GSM97023     1  0.2531      0.861 0.856 0.000 0.000 0.000 0.132 0.012
#> GSM97029     5  0.4248      0.887 0.052 0.004 0.236 0.000 0.708 0.000
#> GSM97043     2  0.0520      0.972 0.008 0.984 0.008 0.000 0.000 0.000
#> GSM97013     6  0.4821      0.743 0.184 0.000 0.000 0.000 0.148 0.668
#> GSM96956     3  0.1765      0.830 0.000 0.096 0.904 0.000 0.000 0.000
#> GSM97024     2  0.0520      0.972 0.008 0.984 0.008 0.000 0.000 0.000
#> GSM97032     3  0.0858      0.881 0.000 0.028 0.968 0.000 0.004 0.000
#> GSM97044     3  0.1333      0.871 0.000 0.008 0.944 0.000 0.000 0.048
#> GSM97049     2  0.1223      0.965 0.016 0.960 0.008 0.000 0.012 0.004
#> GSM96968     6  0.2262      0.851 0.008 0.000 0.016 0.000 0.080 0.896
#> GSM96971     4  0.1340      0.978 0.000 0.000 0.008 0.948 0.040 0.004
#> GSM96986     6  0.0508      0.847 0.000 0.000 0.012 0.000 0.004 0.984
#> GSM97003     6  0.1313      0.852 0.028 0.000 0.004 0.000 0.016 0.952
#> GSM96957     5  0.3050      0.690 0.136 0.000 0.028 0.000 0.832 0.004
#> GSM96960     1  0.1471      0.881 0.932 0.000 0.000 0.000 0.004 0.064
#> GSM96975     1  0.2416      0.849 0.844 0.000 0.000 0.000 0.156 0.000
#> GSM96998     1  0.2794      0.857 0.860 0.000 0.000 0.000 0.080 0.060
#> GSM96999     1  0.3700      0.805 0.780 0.000 0.000 0.000 0.152 0.068
#> GSM97001     5  0.3017      0.750 0.108 0.000 0.052 0.000 0.840 0.000
#> GSM97005     6  0.4634      0.767 0.164 0.000 0.000 0.000 0.144 0.692
#> GSM97006     1  0.4200      0.697 0.720 0.000 0.000 0.000 0.072 0.208
#> GSM97021     5  0.4134      0.886 0.052 0.000 0.240 0.000 0.708 0.000
#> GSM97028     3  0.0767      0.884 0.004 0.012 0.976 0.000 0.008 0.000
#> GSM97031     6  0.3293      0.831 0.048 0.000 0.000 0.000 0.140 0.812
#> GSM97037     3  0.0790      0.881 0.000 0.032 0.968 0.000 0.000 0.000
#> GSM97018     3  0.0951      0.880 0.004 0.020 0.968 0.000 0.008 0.000
#> GSM97014     5  0.4671      0.832 0.008 0.072 0.244 0.000 0.676 0.000
#> GSM97042     2  0.0405      0.966 0.000 0.988 0.008 0.000 0.004 0.000
#> GSM97040     5  0.4029      0.845 0.012 0.012 0.288 0.000 0.688 0.000
#> GSM97041     5  0.4066      0.876 0.064 0.000 0.204 0.000 0.732 0.000
#> GSM96955     2  0.2804      0.903 0.036 0.876 0.008 0.000 0.072 0.008
#> GSM96990     3  0.0622      0.882 0.000 0.012 0.980 0.000 0.008 0.000
#> GSM96991     2  0.2804      0.903 0.036 0.876 0.008 0.000 0.072 0.008
#> GSM97048     2  0.1121      0.965 0.008 0.964 0.008 0.000 0.016 0.004
#> GSM96963     2  0.2804      0.903 0.036 0.876 0.008 0.000 0.072 0.008
#> GSM96953     2  0.0260      0.972 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM96966     4  0.0937      0.982 0.000 0.000 0.000 0.960 0.040 0.000
#> GSM96979     6  0.0508      0.847 0.000 0.000 0.012 0.000 0.004 0.984
#> GSM96983     3  0.1579      0.877 0.008 0.004 0.944 0.000 0.024 0.020
#> GSM96984     6  0.0508      0.847 0.000 0.000 0.012 0.000 0.004 0.984
#> GSM96994     3  0.1836      0.866 0.008 0.004 0.928 0.000 0.012 0.048
#> GSM96996     1  0.2048      0.843 0.880 0.000 0.000 0.000 0.120 0.000
#> GSM96997     6  0.0508      0.847 0.000 0.000 0.012 0.000 0.004 0.984
#> GSM97007     3  0.4100      0.440 0.004 0.000 0.600 0.000 0.008 0.388
#> GSM96954     6  0.0820      0.850 0.000 0.000 0.012 0.000 0.016 0.972
#> GSM96962     6  0.0508      0.847 0.000 0.000 0.012 0.000 0.004 0.984
#> GSM96969     4  0.0713      0.982 0.000 0.000 0.000 0.972 0.028 0.000
#> GSM96970     4  0.0000      0.989 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96973     4  0.0000      0.989 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96976     4  0.0622      0.987 0.000 0.000 0.008 0.980 0.012 0.000
#> GSM96977     6  0.4638      0.768 0.156 0.000 0.000 0.000 0.152 0.692
#> GSM96995     3  0.0858      0.867 0.004 0.000 0.968 0.000 0.028 0.000
#> GSM97002     1  0.1625      0.883 0.928 0.000 0.000 0.000 0.012 0.060
#> GSM97009     5  0.3855      0.867 0.024 0.000 0.272 0.000 0.704 0.000
#> GSM97010     6  0.4736      0.756 0.164 0.000 0.000 0.000 0.156 0.680
#> GSM96974     4  0.0622      0.987 0.000 0.000 0.008 0.980 0.012 0.000
#> GSM96985     1  0.2445      0.839 0.872 0.000 0.000 0.000 0.108 0.020
#> GSM96959     3  0.3384      0.522 0.004 0.008 0.760 0.000 0.228 0.000
#> GSM96972     4  0.0000      0.989 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96978     6  0.1605      0.847 0.012 0.000 0.016 0.000 0.032 0.940
#> GSM96967     4  0.0000      0.989 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96987     1  0.2003      0.844 0.884 0.000 0.000 0.000 0.116 0.000
#> GSM97011     5  0.4167      0.887 0.056 0.000 0.236 0.000 0.708 0.000
#> GSM96964     1  0.3475      0.835 0.800 0.000 0.000 0.000 0.140 0.060
#> GSM96965     4  0.0363      0.988 0.000 0.000 0.000 0.988 0.012 0.000
#> GSM96981     1  0.1910      0.857 0.892 0.000 0.000 0.000 0.108 0.000
#> GSM96982     1  0.2046      0.882 0.908 0.000 0.000 0.000 0.032 0.060
#> GSM96988     3  0.3992      0.649 0.180 0.000 0.748 0.000 0.072 0.000
#> GSM97000     6  0.2766      0.841 0.008 0.000 0.008 0.000 0.140 0.844
#> GSM97004     1  0.1524      0.883 0.932 0.000 0.000 0.000 0.008 0.060
#> GSM97008     5  0.3089      0.777 0.060 0.000 0.092 0.000 0.844 0.004
#> GSM96950     6  0.4825      0.744 0.180 0.000 0.000 0.000 0.152 0.668
#> GSM96980     1  0.2627      0.866 0.884 0.000 0.000 0.016 0.036 0.064
#> GSM96989     1  0.1714      0.861 0.908 0.000 0.000 0.000 0.092 0.000
#> GSM96992     1  0.1267      0.883 0.940 0.000 0.000 0.000 0.000 0.060
#> GSM96993     5  0.4281      0.884 0.068 0.000 0.228 0.000 0.704 0.000
#> GSM96958     1  0.5574      0.176 0.504 0.000 0.000 0.000 0.152 0.344
#> GSM96951     6  0.4602      0.770 0.160 0.000 0.000 0.000 0.144 0.696
#> GSM96952     1  0.1267      0.883 0.940 0.000 0.000 0.000 0.000 0.060
#> GSM96961     1  0.2571      0.865 0.876 0.000 0.000 0.000 0.064 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-ATC-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-kmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-kmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:kmeans 100         1.24e-07       0.714     5.25e-14    0.102 2
#> ATC:kmeans 100         1.01e-06       0.230     3.56e-15    0.224 3
#> ATC:kmeans  70         6.91e-05       0.298     8.78e-14    0.251 4
#> ATC:kmeans  73         5.03e-04       0.427     5.55e-11    0.106 5
#> ATC:kmeans  98         8.19e-05       0.582     5.47e-16    0.476 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 21168 rows and 100 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 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-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.983       0.993         0.5053 0.495   0.495
#> 3 3 0.950           0.912       0.964         0.2883 0.822   0.652
#> 4 4 0.719           0.764       0.788         0.1213 0.862   0.632
#> 5 5 0.783           0.773       0.816         0.0712 0.937   0.769
#> 6 6 0.962           0.925       0.947         0.0600 0.924   0.672

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 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
#> GSM97038     2  0.0000      0.993 0.000 1.000
#> GSM97045     2  0.0000      0.993 0.000 1.000
#> GSM97047     2  0.0000      0.993 0.000 1.000
#> GSM97025     2  0.0000      0.993 0.000 1.000
#> GSM97030     2  0.0000      0.993 0.000 1.000
#> GSM97027     2  0.0000      0.993 0.000 1.000
#> GSM97033     2  0.0000      0.993 0.000 1.000
#> GSM97034     2  0.0000      0.993 0.000 1.000
#> GSM97020     2  0.0000      0.993 0.000 1.000
#> GSM97026     2  0.0000      0.993 0.000 1.000
#> GSM97012     2  0.0000      0.993 0.000 1.000
#> GSM97015     2  0.0000      0.993 0.000 1.000
#> GSM97016     2  0.0000      0.993 0.000 1.000
#> GSM97017     2  0.0000      0.993 0.000 1.000
#> GSM97019     2  0.0000      0.993 0.000 1.000
#> GSM97022     2  0.0000      0.993 0.000 1.000
#> GSM97035     2  0.0000      0.993 0.000 1.000
#> GSM97036     2  0.0000      0.993 0.000 1.000
#> GSM97039     2  0.0000      0.993 0.000 1.000
#> GSM97046     2  0.0000      0.993 0.000 1.000
#> GSM97023     1  0.0000      0.992 1.000 0.000
#> GSM97029     2  0.0000      0.993 0.000 1.000
#> GSM97043     2  0.0000      0.993 0.000 1.000
#> GSM97013     1  0.0000      0.992 1.000 0.000
#> GSM96956     2  0.0000      0.993 0.000 1.000
#> GSM97024     2  0.0000      0.993 0.000 1.000
#> GSM97032     2  0.0000      0.993 0.000 1.000
#> GSM97044     2  0.0000      0.993 0.000 1.000
#> GSM97049     2  0.0000      0.993 0.000 1.000
#> GSM96968     1  0.0000      0.992 1.000 0.000
#> GSM96971     1  0.0000      0.992 1.000 0.000
#> GSM96986     1  0.0000      0.992 1.000 0.000
#> GSM97003     1  0.0000      0.992 1.000 0.000
#> GSM96957     1  0.0000      0.992 1.000 0.000
#> GSM96960     1  0.0000      0.992 1.000 0.000
#> GSM96975     1  0.0000      0.992 1.000 0.000
#> GSM96998     1  0.0000      0.992 1.000 0.000
#> GSM96999     1  0.0000      0.992 1.000 0.000
#> GSM97001     2  0.9044      0.527 0.320 0.680
#> GSM97005     1  0.0000      0.992 1.000 0.000
#> GSM97006     1  0.0000      0.992 1.000 0.000
#> GSM97021     2  0.0000      0.993 0.000 1.000
#> GSM97028     2  0.0000      0.993 0.000 1.000
#> GSM97031     1  0.0000      0.992 1.000 0.000
#> GSM97037     2  0.0000      0.993 0.000 1.000
#> GSM97018     2  0.0000      0.993 0.000 1.000
#> GSM97014     2  0.0000      0.993 0.000 1.000
#> GSM97042     2  0.0000      0.993 0.000 1.000
#> GSM97040     2  0.0000      0.993 0.000 1.000
#> GSM97041     2  0.0000      0.993 0.000 1.000
#> GSM96955     2  0.0000      0.993 0.000 1.000
#> GSM96990     2  0.0000      0.993 0.000 1.000
#> GSM96991     2  0.0000      0.993 0.000 1.000
#> GSM97048     2  0.0000      0.993 0.000 1.000
#> GSM96963     2  0.0000      0.993 0.000 1.000
#> GSM96953     2  0.0000      0.993 0.000 1.000
#> GSM96966     1  0.0000      0.992 1.000 0.000
#> GSM96979     1  0.0000      0.992 1.000 0.000
#> GSM96983     2  0.0000      0.993 0.000 1.000
#> GSM96984     1  0.0000      0.992 1.000 0.000
#> GSM96994     2  0.0000      0.993 0.000 1.000
#> GSM96996     1  0.0000      0.992 1.000 0.000
#> GSM96997     1  0.0000      0.992 1.000 0.000
#> GSM97007     1  0.3114      0.936 0.944 0.056
#> GSM96954     1  0.0000      0.992 1.000 0.000
#> GSM96962     1  0.0000      0.992 1.000 0.000
#> GSM96969     1  0.0000      0.992 1.000 0.000
#> GSM96970     1  0.0000      0.992 1.000 0.000
#> GSM96973     1  0.0000      0.992 1.000 0.000
#> GSM96976     1  0.0000      0.992 1.000 0.000
#> GSM96977     1  0.0000      0.992 1.000 0.000
#> GSM96995     2  0.0000      0.993 0.000 1.000
#> GSM97002     1  0.0000      0.992 1.000 0.000
#> GSM97009     2  0.0000      0.993 0.000 1.000
#> GSM97010     1  0.0000      0.992 1.000 0.000
#> GSM96974     1  0.0000      0.992 1.000 0.000
#> GSM96985     1  0.0000      0.992 1.000 0.000
#> GSM96959     2  0.0000      0.993 0.000 1.000
#> GSM96972     1  0.0000      0.992 1.000 0.000
#> GSM96978     1  0.0000      0.992 1.000 0.000
#> GSM96967     1  0.0000      0.992 1.000 0.000
#> GSM96987     1  0.0938      0.981 0.988 0.012
#> GSM97011     2  0.0000      0.993 0.000 1.000
#> GSM96964     1  0.0000      0.992 1.000 0.000
#> GSM96965     1  0.0000      0.992 1.000 0.000
#> GSM96981     1  0.0000      0.992 1.000 0.000
#> GSM96982     1  0.0000      0.992 1.000 0.000
#> GSM96988     1  0.9000      0.537 0.684 0.316
#> GSM97000     1  0.0000      0.992 1.000 0.000
#> GSM97004     1  0.0000      0.992 1.000 0.000
#> GSM97008     1  0.0000      0.992 1.000 0.000
#> GSM96950     1  0.0000      0.992 1.000 0.000
#> GSM96980     1  0.0000      0.992 1.000 0.000
#> GSM96989     1  0.0000      0.992 1.000 0.000
#> GSM96992     1  0.0000      0.992 1.000 0.000
#> GSM96993     2  0.0000      0.993 0.000 1.000
#> GSM96958     1  0.0000      0.992 1.000 0.000
#> GSM96951     1  0.0000      0.992 1.000 0.000
#> GSM96952     1  0.0000      0.992 1.000 0.000
#> GSM96961     1  0.0000      0.992 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
#> GSM97038     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97045     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97047     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97025     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97030     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97027     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97033     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97034     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97020     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97026     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97012     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97015     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97016     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97017     2  0.6008      0.396 0.372 0.628 0.000
#> GSM97019     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97022     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97035     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97036     1  0.5948      0.436 0.640 0.360 0.000
#> GSM97039     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97046     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97023     1  0.0237      0.930 0.996 0.000 0.004
#> GSM97029     2  0.6008      0.396 0.372 0.628 0.000
#> GSM97043     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97013     3  0.1860      0.946 0.052 0.000 0.948
#> GSM96956     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97024     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97032     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97044     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97049     2  0.0000      0.962 0.000 1.000 0.000
#> GSM96968     3  0.0000      0.977 0.000 0.000 1.000
#> GSM96971     3  0.0237      0.976 0.004 0.000 0.996
#> GSM96986     3  0.0000      0.977 0.000 0.000 1.000
#> GSM97003     3  0.0000      0.977 0.000 0.000 1.000
#> GSM96957     1  0.0237      0.930 0.996 0.000 0.004
#> GSM96960     1  0.0237      0.930 0.996 0.000 0.004
#> GSM96975     1  0.0000      0.930 1.000 0.000 0.000
#> GSM96998     1  0.0237      0.930 0.996 0.000 0.004
#> GSM96999     1  0.5178      0.597 0.744 0.000 0.256
#> GSM97001     1  0.0237      0.930 0.996 0.000 0.004
#> GSM97005     3  0.1860      0.946 0.052 0.000 0.948
#> GSM97006     3  0.1860      0.946 0.052 0.000 0.948
#> GSM97021     2  0.6045      0.375 0.380 0.620 0.000
#> GSM97028     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97031     3  0.2448      0.924 0.076 0.000 0.924
#> GSM97037     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97018     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97014     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97042     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97040     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97041     1  0.5926      0.446 0.644 0.356 0.000
#> GSM96955     2  0.0000      0.962 0.000 1.000 0.000
#> GSM96990     2  0.0000      0.962 0.000 1.000 0.000
#> GSM96991     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97048     2  0.0000      0.962 0.000 1.000 0.000
#> GSM96963     2  0.0000      0.962 0.000 1.000 0.000
#> GSM96953     2  0.0000      0.962 0.000 1.000 0.000
#> GSM96966     3  0.0237      0.976 0.004 0.000 0.996
#> GSM96979     3  0.0000      0.977 0.000 0.000 1.000
#> GSM96983     2  0.0000      0.962 0.000 1.000 0.000
#> GSM96984     3  0.0000      0.977 0.000 0.000 1.000
#> GSM96994     2  0.0592      0.951 0.000 0.988 0.012
#> GSM96996     1  0.0000      0.930 1.000 0.000 0.000
#> GSM96997     3  0.0000      0.977 0.000 0.000 1.000
#> GSM97007     3  0.0000      0.977 0.000 0.000 1.000
#> GSM96954     3  0.0000      0.977 0.000 0.000 1.000
#> GSM96962     3  0.0000      0.977 0.000 0.000 1.000
#> GSM96969     3  0.0237      0.976 0.004 0.000 0.996
#> GSM96970     3  0.0237      0.976 0.004 0.000 0.996
#> GSM96973     3  0.0237      0.976 0.004 0.000 0.996
#> GSM96976     3  0.0237      0.976 0.004 0.000 0.996
#> GSM96977     3  0.0000      0.977 0.000 0.000 1.000
#> GSM96995     2  0.0000      0.962 0.000 1.000 0.000
#> GSM97002     1  0.0000      0.930 1.000 0.000 0.000
#> GSM97009     2  0.0424      0.955 0.008 0.992 0.000
#> GSM97010     3  0.0000      0.977 0.000 0.000 1.000
#> GSM96974     3  0.0237      0.976 0.004 0.000 0.996
#> GSM96985     1  0.0424      0.925 0.992 0.000 0.008
#> GSM96959     2  0.0000      0.962 0.000 1.000 0.000
#> GSM96972     3  0.0237      0.976 0.004 0.000 0.996
#> GSM96978     3  0.0237      0.976 0.004 0.000 0.996
#> GSM96967     3  0.0237      0.976 0.004 0.000 0.996
#> GSM96987     1  0.0000      0.930 1.000 0.000 0.000
#> GSM97011     2  0.6008      0.396 0.372 0.628 0.000
#> GSM96964     1  0.0237      0.930 0.996 0.000 0.004
#> GSM96965     3  0.0237      0.976 0.004 0.000 0.996
#> GSM96981     1  0.0000      0.930 1.000 0.000 0.000
#> GSM96982     1  0.0000      0.930 1.000 0.000 0.000
#> GSM96988     1  0.0237      0.928 0.996 0.004 0.000
#> GSM97000     3  0.0000      0.977 0.000 0.000 1.000
#> GSM97004     1  0.0000      0.930 1.000 0.000 0.000
#> GSM97008     1  0.0237      0.930 0.996 0.000 0.004
#> GSM96950     3  0.1860      0.946 0.052 0.000 0.948
#> GSM96980     3  0.0592      0.973 0.012 0.000 0.988
#> GSM96989     1  0.0000      0.930 1.000 0.000 0.000
#> GSM96992     1  0.0237      0.930 0.996 0.000 0.004
#> GSM96993     1  0.5926      0.445 0.644 0.356 0.000
#> GSM96958     3  0.5621      0.588 0.308 0.000 0.692
#> GSM96951     3  0.1860      0.946 0.052 0.000 0.948
#> GSM96952     1  0.0237      0.930 0.996 0.000 0.004
#> GSM96961     1  0.0237      0.930 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
#> GSM97038     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97045     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97047     2  0.2469     0.7313 0.000 0.892 0.108 0.000
#> GSM97025     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97030     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM97027     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97033     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97034     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM97020     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97026     2  0.3764     0.7997 0.000 0.784 0.216 0.000
#> GSM97012     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97015     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM97016     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97017     2  0.3123     0.5484 0.156 0.844 0.000 0.000
#> GSM97019     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97022     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97035     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97036     2  0.4103     0.4314 0.256 0.744 0.000 0.000
#> GSM97039     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97046     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97023     1  0.0188     0.8888 0.996 0.004 0.000 0.000
#> GSM97029     2  0.3123     0.5484 0.156 0.844 0.000 0.000
#> GSM97043     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97013     4  0.7568     0.5755 0.280 0.004 0.208 0.508
#> GSM96956     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM97024     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97032     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM97044     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM97049     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM96968     4  0.4250     0.7931 0.000 0.000 0.276 0.724
#> GSM96971     4  0.0000     0.8102 0.000 0.000 0.000 1.000
#> GSM96986     4  0.3688     0.8203 0.000 0.000 0.208 0.792
#> GSM97003     4  0.3688     0.8203 0.000 0.000 0.208 0.792
#> GSM96957     1  0.3400     0.7779 0.820 0.180 0.000 0.000
#> GSM96960     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM96975     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM96998     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM96999     1  0.4055     0.7368 0.832 0.000 0.108 0.060
#> GSM97001     1  0.3837     0.7439 0.776 0.224 0.000 0.000
#> GSM97005     4  0.7568     0.5755 0.280 0.004 0.208 0.508
#> GSM97006     4  0.7625     0.4326 0.360 0.000 0.208 0.432
#> GSM97021     2  0.3172     0.5452 0.160 0.840 0.000 0.000
#> GSM97028     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM97031     4  0.7613     0.4425 0.352 0.000 0.208 0.440
#> GSM97037     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM97018     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM97014     2  0.0188     0.6656 0.000 0.996 0.004 0.000
#> GSM97042     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97040     2  0.0000     0.6629 0.000 1.000 0.000 0.000
#> GSM97041     2  0.4382     0.3499 0.296 0.704 0.000 0.000
#> GSM96955     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM96990     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM96991     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM97048     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM96963     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM96953     2  0.3837     0.8043 0.000 0.776 0.224 0.000
#> GSM96966     4  0.0000     0.8102 0.000 0.000 0.000 1.000
#> GSM96979     4  0.3688     0.8203 0.000 0.000 0.208 0.792
#> GSM96983     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM96984     4  0.3688     0.8203 0.000 0.000 0.208 0.792
#> GSM96994     3  0.3688     0.9372 0.000 0.208 0.792 0.000
#> GSM96996     1  0.0188     0.8888 0.996 0.004 0.000 0.000
#> GSM96997     4  0.3688     0.8203 0.000 0.000 0.208 0.792
#> GSM97007     3  0.3837     0.0573 0.000 0.000 0.776 0.224
#> GSM96954     4  0.4250     0.7931 0.000 0.000 0.276 0.724
#> GSM96962     4  0.3688     0.8203 0.000 0.000 0.208 0.792
#> GSM96969     4  0.0000     0.8102 0.000 0.000 0.000 1.000
#> GSM96970     4  0.0000     0.8102 0.000 0.000 0.000 1.000
#> GSM96973     4  0.0000     0.8102 0.000 0.000 0.000 1.000
#> GSM96976     4  0.0000     0.8102 0.000 0.000 0.000 1.000
#> GSM96977     4  0.3688     0.8203 0.000 0.000 0.208 0.792
#> GSM96995     3  0.3873     0.9131 0.000 0.228 0.772 0.000
#> GSM97002     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM97009     2  0.0469     0.6552 0.012 0.988 0.000 0.000
#> GSM97010     4  0.3688     0.8203 0.000 0.000 0.208 0.792
#> GSM96974     4  0.0000     0.8102 0.000 0.000 0.000 1.000
#> GSM96985     1  0.4776     0.4285 0.624 0.000 0.000 0.376
#> GSM96959     3  0.3942     0.9055 0.000 0.236 0.764 0.000
#> GSM96972     4  0.0000     0.8102 0.000 0.000 0.000 1.000
#> GSM96978     4  0.0188     0.8107 0.000 0.000 0.004 0.996
#> GSM96967     4  0.0000     0.8102 0.000 0.000 0.000 1.000
#> GSM96987     1  0.0188     0.8888 0.996 0.004 0.000 0.000
#> GSM97011     2  0.3172     0.5452 0.160 0.840 0.000 0.000
#> GSM96964     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM96965     4  0.0000     0.8102 0.000 0.000 0.000 1.000
#> GSM96981     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM96982     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM96988     1  0.4989     0.1995 0.528 0.000 0.472 0.000
#> GSM97000     4  0.6678     0.7022 0.172 0.000 0.208 0.620
#> GSM97004     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM97008     1  0.6296     0.6568 0.652 0.224 0.124 0.000
#> GSM96950     4  0.7399     0.5790 0.280 0.000 0.208 0.512
#> GSM96980     4  0.1792     0.7714 0.068 0.000 0.000 0.932
#> GSM96989     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM96992     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM96993     2  0.4431     0.3320 0.304 0.696 0.000 0.000
#> GSM96958     1  0.7080     0.1882 0.568 0.000 0.196 0.236
#> GSM96951     4  0.7399     0.5790 0.280 0.000 0.208 0.512
#> GSM96952     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM96961     1  0.0000     0.8904 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
#> GSM97038     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97045     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97047     2  0.4117    0.60496 0.000 0.788 0.096 0.116 0.000
#> GSM97025     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97030     3  0.0404    0.90733 0.000 0.012 0.988 0.000 0.000
#> GSM97027     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97033     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97034     3  0.0000    0.91075 0.000 0.000 1.000 0.000 0.000
#> GSM97020     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97026     2  0.3534    0.75292 0.000 0.744 0.256 0.000 0.000
#> GSM97012     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97015     3  0.0000    0.91075 0.000 0.000 1.000 0.000 0.000
#> GSM97016     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97017     2  0.4270    0.48637 0.048 0.748 0.000 0.204 0.000
#> GSM97019     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97022     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97035     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97036     2  0.6250    0.13022 0.256 0.540 0.000 0.204 0.000
#> GSM97039     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97046     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97023     1  0.0609    0.90259 0.980 0.000 0.000 0.000 0.020
#> GSM97029     2  0.4129    0.49184 0.040 0.756 0.000 0.204 0.000
#> GSM97043     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97013     5  0.1121    0.86096 0.044 0.000 0.000 0.000 0.956
#> GSM96956     3  0.0404    0.90723 0.000 0.012 0.988 0.000 0.000
#> GSM97024     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97032     3  0.0609    0.90040 0.000 0.020 0.980 0.000 0.000
#> GSM97044     3  0.0000    0.91075 0.000 0.000 1.000 0.000 0.000
#> GSM97049     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM96968     5  0.0324    0.87722 0.000 0.000 0.004 0.004 0.992
#> GSM96971     4  0.3143    0.98356 0.000 0.000 0.000 0.796 0.204
#> GSM96986     5  0.0290    0.87772 0.000 0.000 0.000 0.008 0.992
#> GSM97003     5  0.0290    0.87772 0.000 0.000 0.000 0.008 0.992
#> GSM96957     1  0.6626    0.52347 0.572 0.228 0.000 0.168 0.032
#> GSM96960     1  0.1043    0.88540 0.960 0.000 0.000 0.000 0.040
#> GSM96975     1  0.0609    0.89994 0.980 0.000 0.000 0.020 0.000
#> GSM96998     1  0.0703    0.90043 0.976 0.000 0.000 0.000 0.024
#> GSM96999     1  0.2329    0.80378 0.876 0.000 0.000 0.000 0.124
#> GSM97001     1  0.6690    0.44912 0.508 0.276 0.000 0.204 0.012
#> GSM97005     5  0.0880    0.86720 0.032 0.000 0.000 0.000 0.968
#> GSM97006     5  0.4537    0.36705 0.396 0.000 0.000 0.012 0.592
#> GSM97021     2  0.4681    0.46959 0.064 0.728 0.000 0.204 0.004
#> GSM97028     3  0.0000    0.91075 0.000 0.000 1.000 0.000 0.000
#> GSM97031     5  0.1121    0.85947 0.044 0.000 0.000 0.000 0.956
#> GSM97037     3  0.0404    0.90733 0.000 0.012 0.988 0.000 0.000
#> GSM97018     3  0.0404    0.90688 0.000 0.012 0.988 0.000 0.000
#> GSM97014     2  0.2513    0.56491 0.000 0.876 0.008 0.116 0.000
#> GSM97042     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97040     2  0.3812    0.50156 0.024 0.772 0.000 0.204 0.000
#> GSM97041     2  0.6396    0.12035 0.256 0.536 0.000 0.204 0.004
#> GSM96955     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM96990     3  0.0510    0.90421 0.000 0.016 0.984 0.000 0.000
#> GSM96991     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM97048     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM96963     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM96953     2  0.3684    0.76538 0.000 0.720 0.280 0.000 0.000
#> GSM96966     4  0.3143    0.98356 0.000 0.000 0.000 0.796 0.204
#> GSM96979     5  0.0404    0.87521 0.000 0.000 0.000 0.012 0.988
#> GSM96983     3  0.0000    0.91075 0.000 0.000 1.000 0.000 0.000
#> GSM96984     5  0.0404    0.87521 0.000 0.000 0.000 0.012 0.988
#> GSM96994     3  0.0000    0.91075 0.000 0.000 1.000 0.000 0.000
#> GSM96996     1  0.0290    0.90028 0.992 0.000 0.000 0.008 0.000
#> GSM96997     5  0.0290    0.87772 0.000 0.000 0.000 0.008 0.992
#> GSM97007     3  0.3884    0.47601 0.000 0.000 0.708 0.004 0.288
#> GSM96954     5  0.0162    0.87686 0.000 0.000 0.004 0.000 0.996
#> GSM96962     5  0.0290    0.87772 0.000 0.000 0.000 0.008 0.992
#> GSM96969     4  0.3143    0.98356 0.000 0.000 0.000 0.796 0.204
#> GSM96970     4  0.3143    0.98356 0.000 0.000 0.000 0.796 0.204
#> GSM96973     4  0.3143    0.98356 0.000 0.000 0.000 0.796 0.204
#> GSM96976     4  0.3143    0.98356 0.000 0.000 0.000 0.796 0.204
#> GSM96977     5  0.0290    0.87772 0.000 0.000 0.000 0.008 0.992
#> GSM96995     3  0.0794    0.88898 0.000 0.028 0.972 0.000 0.000
#> GSM97002     1  0.0865    0.89751 0.972 0.000 0.000 0.024 0.004
#> GSM97009     2  0.3630    0.50599 0.016 0.780 0.000 0.204 0.000
#> GSM97010     5  0.0510    0.87230 0.000 0.000 0.000 0.016 0.984
#> GSM96974     4  0.3143    0.98356 0.000 0.000 0.000 0.796 0.204
#> GSM96985     1  0.4219    0.26920 0.584 0.000 0.000 0.416 0.000
#> GSM96959     3  0.2969    0.78174 0.000 0.128 0.852 0.020 0.000
#> GSM96972     4  0.3143    0.98356 0.000 0.000 0.000 0.796 0.204
#> GSM96978     4  0.3561    0.91690 0.000 0.000 0.000 0.740 0.260
#> GSM96967     4  0.3143    0.98356 0.000 0.000 0.000 0.796 0.204
#> GSM96987     1  0.0162    0.90218 0.996 0.000 0.000 0.004 0.000
#> GSM97011     2  0.4270    0.48637 0.048 0.748 0.000 0.204 0.000
#> GSM96964     1  0.0510    0.90344 0.984 0.000 0.000 0.000 0.016
#> GSM96965     4  0.3143    0.98356 0.000 0.000 0.000 0.796 0.204
#> GSM96981     1  0.0000    0.90325 1.000 0.000 0.000 0.000 0.000
#> GSM96982     1  0.0771    0.89968 0.976 0.000 0.000 0.020 0.004
#> GSM96988     3  0.4375    0.18737 0.420 0.000 0.576 0.004 0.000
#> GSM97000     5  0.0000    0.87697 0.000 0.000 0.000 0.000 1.000
#> GSM97004     1  0.0771    0.89968 0.976 0.000 0.000 0.020 0.004
#> GSM97008     5  0.8323    0.13584 0.160 0.272 0.000 0.204 0.364
#> GSM96950     5  0.1205    0.86470 0.040 0.000 0.000 0.004 0.956
#> GSM96980     4  0.4010    0.88874 0.072 0.000 0.000 0.792 0.136
#> GSM96989     1  0.0162    0.90440 0.996 0.000 0.000 0.000 0.004
#> GSM96992     1  0.0290    0.90467 0.992 0.000 0.000 0.000 0.008
#> GSM96993     2  0.6420    0.00781 0.300 0.496 0.000 0.204 0.000
#> GSM96958     5  0.4045    0.46128 0.356 0.000 0.000 0.000 0.644
#> GSM96951     5  0.0963    0.86522 0.036 0.000 0.000 0.000 0.964
#> GSM96952     1  0.0290    0.90467 0.992 0.000 0.000 0.000 0.008
#> GSM96961     1  0.0404    0.90443 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
#> GSM97038     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97045     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97047     5  0.3464      0.614 0.000 0.312 0.000 0.000 0.688 0.000
#> GSM97025     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97030     3  0.1501      0.941 0.000 0.076 0.924 0.000 0.000 0.000
#> GSM97027     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97033     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97034     3  0.1411      0.942 0.000 0.060 0.936 0.000 0.000 0.004
#> GSM97020     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97026     2  0.0865      0.955 0.000 0.964 0.000 0.000 0.036 0.000
#> GSM97012     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97015     3  0.1327      0.942 0.000 0.064 0.936 0.000 0.000 0.000
#> GSM97016     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97017     5  0.0713      0.910 0.000 0.028 0.000 0.000 0.972 0.000
#> GSM97019     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97022     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97035     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97036     5  0.1148      0.907 0.016 0.020 0.004 0.000 0.960 0.000
#> GSM97039     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97046     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97023     1  0.1780      0.925 0.932 0.000 0.012 0.000 0.028 0.028
#> GSM97029     5  0.0713      0.910 0.000 0.028 0.000 0.000 0.972 0.000
#> GSM97043     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97013     6  0.1989      0.917 0.024 0.000 0.016 0.012 0.020 0.928
#> GSM96956     3  0.1501      0.941 0.000 0.076 0.924 0.000 0.000 0.000
#> GSM97024     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97032     3  0.1610      0.936 0.000 0.084 0.916 0.000 0.000 0.000
#> GSM97044     3  0.1349      0.941 0.000 0.056 0.940 0.000 0.000 0.004
#> GSM97049     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96968     6  0.0972      0.946 0.000 0.000 0.008 0.028 0.000 0.964
#> GSM96971     4  0.0260      0.977 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM96986     6  0.1049      0.946 0.000 0.000 0.008 0.032 0.000 0.960
#> GSM97003     6  0.0972      0.947 0.000 0.000 0.008 0.028 0.000 0.964
#> GSM96957     5  0.4083      0.743 0.140 0.000 0.024 0.008 0.784 0.044
#> GSM96960     1  0.0405      0.944 0.988 0.000 0.000 0.000 0.008 0.004
#> GSM96975     1  0.1065      0.940 0.964 0.000 0.020 0.008 0.008 0.000
#> GSM96998     1  0.1448      0.931 0.948 0.000 0.012 0.000 0.016 0.024
#> GSM96999     1  0.2308      0.893 0.896 0.000 0.012 0.000 0.016 0.076
#> GSM97001     5  0.1026      0.890 0.004 0.000 0.012 0.008 0.968 0.008
#> GSM97005     6  0.1514      0.925 0.016 0.000 0.016 0.004 0.016 0.948
#> GSM97006     1  0.4387      0.579 0.684 0.000 0.008 0.016 0.016 0.276
#> GSM97021     5  0.0458      0.908 0.000 0.016 0.000 0.000 0.984 0.000
#> GSM97028     3  0.1267      0.942 0.000 0.060 0.940 0.000 0.000 0.000
#> GSM97031     6  0.1251      0.925 0.024 0.000 0.008 0.000 0.012 0.956
#> GSM97037     3  0.1501      0.941 0.000 0.076 0.924 0.000 0.000 0.000
#> GSM97018     3  0.1556      0.939 0.000 0.080 0.920 0.000 0.000 0.000
#> GSM97014     5  0.3515      0.589 0.000 0.324 0.000 0.000 0.676 0.000
#> GSM97042     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97040     5  0.0713      0.910 0.000 0.028 0.000 0.000 0.972 0.000
#> GSM97041     5  0.0458      0.908 0.000 0.016 0.000 0.000 0.984 0.000
#> GSM96955     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96990     3  0.1501      0.941 0.000 0.076 0.924 0.000 0.000 0.000
#> GSM96991     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97048     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96963     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96953     2  0.0000      0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96966     4  0.0260      0.977 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM96979     6  0.1124      0.945 0.000 0.000 0.008 0.036 0.000 0.956
#> GSM96983     3  0.1141      0.939 0.000 0.052 0.948 0.000 0.000 0.000
#> GSM96984     6  0.1124      0.945 0.000 0.000 0.008 0.036 0.000 0.956
#> GSM96994     3  0.1401      0.919 0.000 0.028 0.948 0.000 0.004 0.020
#> GSM96996     1  0.1176      0.930 0.956 0.000 0.020 0.000 0.024 0.000
#> GSM96997     6  0.1049      0.946 0.000 0.000 0.008 0.032 0.000 0.960
#> GSM97007     3  0.2100      0.840 0.000 0.000 0.884 0.000 0.004 0.112
#> GSM96954     6  0.0972      0.946 0.000 0.000 0.008 0.028 0.000 0.964
#> GSM96962     6  0.1124      0.945 0.000 0.000 0.008 0.036 0.000 0.956
#> GSM96969     4  0.0260      0.977 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM96970     4  0.0260      0.977 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM96973     4  0.0260      0.977 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM96976     4  0.0260      0.977 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM96977     6  0.0935      0.946 0.000 0.000 0.004 0.032 0.000 0.964
#> GSM96995     3  0.1508      0.936 0.000 0.048 0.940 0.004 0.004 0.004
#> GSM97002     1  0.0508      0.943 0.984 0.000 0.012 0.000 0.000 0.004
#> GSM97009     5  0.1440      0.901 0.004 0.044 0.004 0.004 0.944 0.000
#> GSM97010     6  0.1643      0.925 0.000 0.000 0.008 0.068 0.000 0.924
#> GSM96974     4  0.0260      0.977 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM96985     1  0.3062      0.781 0.816 0.000 0.024 0.160 0.000 0.000
#> GSM96959     3  0.3642      0.824 0.000 0.080 0.800 0.004 0.116 0.000
#> GSM96972     4  0.0260      0.977 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM96978     4  0.2653      0.828 0.000 0.000 0.012 0.844 0.000 0.144
#> GSM96967     4  0.0260      0.977 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM96987     1  0.0909      0.938 0.968 0.000 0.020 0.000 0.012 0.000
#> GSM97011     5  0.1067      0.909 0.004 0.024 0.004 0.004 0.964 0.000
#> GSM96964     1  0.1364      0.933 0.952 0.000 0.012 0.000 0.016 0.020
#> GSM96965     4  0.0260      0.977 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM96981     1  0.0951      0.939 0.968 0.000 0.020 0.004 0.008 0.000
#> GSM96982     1  0.0603      0.943 0.980 0.000 0.016 0.000 0.000 0.004
#> GSM96988     3  0.3668      0.481 0.328 0.000 0.668 0.000 0.004 0.000
#> GSM97000     6  0.0146      0.939 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM97004     1  0.0508      0.943 0.984 0.000 0.012 0.000 0.000 0.004
#> GSM97008     5  0.2231      0.860 0.012 0.000 0.020 0.008 0.912 0.048
#> GSM96950     6  0.2072      0.925 0.024 0.000 0.012 0.024 0.016 0.924
#> GSM96980     4  0.1866      0.897 0.084 0.000 0.000 0.908 0.000 0.008
#> GSM96989     1  0.0458      0.942 0.984 0.000 0.016 0.000 0.000 0.000
#> GSM96992     1  0.0405      0.944 0.988 0.000 0.000 0.000 0.008 0.004
#> GSM96993     5  0.1148      0.907 0.016 0.020 0.004 0.000 0.960 0.000
#> GSM96958     6  0.4378      0.546 0.292 0.000 0.012 0.008 0.016 0.672
#> GSM96951     6  0.1325      0.929 0.016 0.000 0.012 0.004 0.012 0.956
#> GSM96952     1  0.0405      0.944 0.988 0.000 0.000 0.000 0.008 0.004
#> GSM96961     1  0.1078      0.937 0.964 0.000 0.008 0.000 0.016 0.012

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-skmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>               n disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:skmeans 100         1.24e-07       0.714     5.25e-14    0.102 2
#> ATC:skmeans  93         4.35e-06       0.515     2.47e-18    0.392 3
#> ATC:skmeans  91         6.42e-06       0.601     1.86e-17    0.250 4
#> ATC:skmeans  86         3.28e-05       0.179     7.68e-16    0.311 5
#> ATC:skmeans  99         1.82e-05       0.447     5.89e-16    0.420 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 21168 rows and 100 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 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-pam-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-pam-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.958           0.933       0.971         0.4912 0.515   0.515
#> 3 3 0.908           0.948       0.978         0.1942 0.899   0.804
#> 4 4 0.649           0.763       0.837         0.2083 0.855   0.664
#> 5 5 0.860           0.792       0.915         0.1006 0.872   0.608
#> 6 6 0.854           0.754       0.887         0.0452 0.928   0.696

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2

There is also optional best \(k\) = 2 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97038     2  0.0000      0.997 0.000 1.000
#> GSM97045     2  0.0000      0.997 0.000 1.000
#> GSM97047     2  0.0000      0.997 0.000 1.000
#> GSM97025     2  0.0000      0.997 0.000 1.000
#> GSM97030     2  0.0000      0.997 0.000 1.000
#> GSM97027     2  0.0000      0.997 0.000 1.000
#> GSM97033     2  0.0000      0.997 0.000 1.000
#> GSM97034     2  0.0672      0.989 0.008 0.992
#> GSM97020     2  0.0000      0.997 0.000 1.000
#> GSM97026     2  0.0000      0.997 0.000 1.000
#> GSM97012     2  0.0000      0.997 0.000 1.000
#> GSM97015     2  0.0000      0.997 0.000 1.000
#> GSM97016     2  0.0000      0.997 0.000 1.000
#> GSM97017     2  0.0000      0.997 0.000 1.000
#> GSM97019     2  0.0000      0.997 0.000 1.000
#> GSM97022     2  0.0000      0.997 0.000 1.000
#> GSM97035     2  0.0000      0.997 0.000 1.000
#> GSM97036     2  0.0000      0.997 0.000 1.000
#> GSM97039     2  0.0000      0.997 0.000 1.000
#> GSM97046     2  0.0000      0.997 0.000 1.000
#> GSM97023     1  0.0376      0.954 0.996 0.004
#> GSM97029     1  0.9993      0.150 0.516 0.484
#> GSM97043     2  0.0000      0.997 0.000 1.000
#> GSM97013     1  0.0376      0.954 0.996 0.004
#> GSM96956     2  0.0000      0.997 0.000 1.000
#> GSM97024     2  0.0000      0.997 0.000 1.000
#> GSM97032     2  0.0000      0.997 0.000 1.000
#> GSM97044     2  0.0000      0.997 0.000 1.000
#> GSM97049     2  0.0000      0.997 0.000 1.000
#> GSM96968     1  0.0376      0.954 0.996 0.004
#> GSM96971     1  0.0000      0.952 1.000 0.000
#> GSM96986     1  0.0376      0.954 0.996 0.004
#> GSM97003     1  0.0376      0.954 0.996 0.004
#> GSM96957     1  0.0376      0.954 0.996 0.004
#> GSM96960     1  0.0376      0.954 0.996 0.004
#> GSM96975     1  0.0376      0.954 0.996 0.004
#> GSM96998     1  0.0376      0.954 0.996 0.004
#> GSM96999     1  0.0376      0.954 0.996 0.004
#> GSM97001     1  0.0376      0.954 0.996 0.004
#> GSM97005     1  0.0376      0.954 0.996 0.004
#> GSM97006     1  0.0376      0.954 0.996 0.004
#> GSM97021     1  0.9686      0.406 0.604 0.396
#> GSM97028     2  0.0000      0.997 0.000 1.000
#> GSM97031     1  0.0376      0.954 0.996 0.004
#> GSM97037     2  0.0000      0.997 0.000 1.000
#> GSM97018     2  0.0000      0.997 0.000 1.000
#> GSM97014     2  0.0000      0.997 0.000 1.000
#> GSM97042     2  0.0000      0.997 0.000 1.000
#> GSM97040     2  0.0000      0.997 0.000 1.000
#> GSM97041     1  0.9661      0.416 0.608 0.392
#> GSM96955     2  0.0000      0.997 0.000 1.000
#> GSM96990     2  0.0000      0.997 0.000 1.000
#> GSM96991     2  0.0000      0.997 0.000 1.000
#> GSM97048     2  0.0000      0.997 0.000 1.000
#> GSM96963     2  0.0000      0.997 0.000 1.000
#> GSM96953     2  0.0000      0.997 0.000 1.000
#> GSM96966     1  0.0000      0.952 1.000 0.000
#> GSM96979     1  0.0376      0.954 0.996 0.004
#> GSM96983     2  0.2423      0.955 0.040 0.960
#> GSM96984     1  0.0376      0.954 0.996 0.004
#> GSM96994     1  0.0672      0.951 0.992 0.008
#> GSM96996     1  0.0376      0.954 0.996 0.004
#> GSM96997     1  0.0376      0.954 0.996 0.004
#> GSM97007     1  0.0376      0.954 0.996 0.004
#> GSM96954     1  0.0376      0.954 0.996 0.004
#> GSM96962     1  0.0376      0.954 0.996 0.004
#> GSM96969     1  0.0000      0.952 1.000 0.000
#> GSM96970     1  0.0000      0.952 1.000 0.000
#> GSM96973     1  0.0000      0.952 1.000 0.000
#> GSM96976     1  0.0000      0.952 1.000 0.000
#> GSM96977     1  0.0376      0.954 0.996 0.004
#> GSM96995     1  0.6623      0.784 0.828 0.172
#> GSM97002     1  0.0376      0.954 0.996 0.004
#> GSM97009     1  0.9552      0.451 0.624 0.376
#> GSM97010     1  0.0376      0.954 0.996 0.004
#> GSM96974     1  0.0000      0.952 1.000 0.000
#> GSM96985     1  0.0376      0.954 0.996 0.004
#> GSM96959     2  0.3879      0.912 0.076 0.924
#> GSM96972     1  0.0000      0.952 1.000 0.000
#> GSM96978     1  0.0376      0.954 0.996 0.004
#> GSM96967     1  0.0000      0.952 1.000 0.000
#> GSM96987     1  0.0376      0.954 0.996 0.004
#> GSM97011     1  0.9635      0.425 0.612 0.388
#> GSM96964     1  0.0376      0.954 0.996 0.004
#> GSM96965     1  0.0000      0.952 1.000 0.000
#> GSM96981     1  0.0376      0.954 0.996 0.004
#> GSM96982     1  0.0376      0.954 0.996 0.004
#> GSM96988     1  0.0376      0.954 0.996 0.004
#> GSM97000     1  0.0376      0.954 0.996 0.004
#> GSM97004     1  0.0376      0.954 0.996 0.004
#> GSM97008     1  0.0376      0.954 0.996 0.004
#> GSM96950     1  0.0376      0.954 0.996 0.004
#> GSM96980     1  0.0000      0.952 1.000 0.000
#> GSM96989     1  0.0376      0.954 0.996 0.004
#> GSM96992     1  0.0376      0.954 0.996 0.004
#> GSM96993     1  0.9661      0.416 0.608 0.392
#> GSM96958     1  0.0376      0.954 0.996 0.004
#> GSM96951     1  0.0376      0.954 0.996 0.004
#> GSM96952     1  0.0376      0.954 0.996 0.004
#> GSM96961     1  0.0376      0.954 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
#> GSM97038     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97045     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97047     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97025     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97030     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97027     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97033     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97034     2  0.3038      0.856 0.104 0.896 0.000
#> GSM97020     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97026     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97012     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97015     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97016     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97017     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97019     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97022     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97035     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97036     2  0.4121      0.766 0.168 0.832 0.000
#> GSM97039     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97046     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97023     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97029     1  0.5560      0.604 0.700 0.300 0.000
#> GSM97043     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97013     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96956     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97024     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97032     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97044     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97049     2  0.0000      0.978 0.000 1.000 0.000
#> GSM96968     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96971     3  0.0000      1.000 0.000 0.000 1.000
#> GSM96986     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97003     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96957     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96960     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96975     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96998     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96999     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97001     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97005     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97006     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97021     1  0.4887      0.715 0.772 0.228 0.000
#> GSM97028     2  0.4931      0.673 0.232 0.768 0.000
#> GSM97031     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97037     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97018     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97014     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97042     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97040     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97041     1  0.4235      0.782 0.824 0.176 0.000
#> GSM96955     2  0.0000      0.978 0.000 1.000 0.000
#> GSM96990     2  0.0000      0.978 0.000 1.000 0.000
#> GSM96991     2  0.0000      0.978 0.000 1.000 0.000
#> GSM97048     2  0.0000      0.978 0.000 1.000 0.000
#> GSM96963     2  0.0000      0.978 0.000 1.000 0.000
#> GSM96953     2  0.0000      0.978 0.000 1.000 0.000
#> GSM96966     3  0.0000      1.000 0.000 0.000 1.000
#> GSM96979     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96983     2  0.2448      0.893 0.076 0.924 0.000
#> GSM96984     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96994     1  0.3551      0.832 0.868 0.132 0.000
#> GSM96996     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96997     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97007     1  0.2356      0.893 0.928 0.072 0.000
#> GSM96954     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96962     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96969     3  0.0000      1.000 0.000 0.000 1.000
#> GSM96970     3  0.0000      1.000 0.000 0.000 1.000
#> GSM96973     3  0.0000      1.000 0.000 0.000 1.000
#> GSM96976     3  0.0000      1.000 0.000 0.000 1.000
#> GSM96977     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96995     1  0.1964      0.914 0.944 0.056 0.000
#> GSM97002     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97009     1  0.4504      0.759 0.804 0.196 0.000
#> GSM97010     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96974     3  0.0000      1.000 0.000 0.000 1.000
#> GSM96985     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96959     2  0.2448      0.890 0.076 0.924 0.000
#> GSM96972     3  0.0000      1.000 0.000 0.000 1.000
#> GSM96978     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96967     3  0.0000      1.000 0.000 0.000 1.000
#> GSM96987     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97011     1  0.4654      0.742 0.792 0.208 0.000
#> GSM96964     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96965     3  0.0000      1.000 0.000 0.000 1.000
#> GSM96981     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96982     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96988     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97000     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97004     1  0.0000      0.962 1.000 0.000 0.000
#> GSM97008     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96950     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96980     1  0.0592      0.953 0.988 0.000 0.012
#> GSM96989     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96992     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96993     1  0.3879      0.809 0.848 0.152 0.000
#> GSM96958     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96951     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96952     1  0.0000      0.962 1.000 0.000 0.000
#> GSM96961     1  0.0000      0.962 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
#> GSM97038     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97045     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97047     3  0.4713     0.6131 0.000 0.360 0.640 0.000
#> GSM97025     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97030     2  0.0188     0.8997 0.000 0.996 0.004 0.000
#> GSM97027     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97033     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97034     3  0.0707     0.5561 0.000 0.020 0.980 0.000
#> GSM97020     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97026     2  0.4843    -0.0161 0.000 0.604 0.396 0.000
#> GSM97012     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97015     3  0.4304     0.6401 0.000 0.284 0.716 0.000
#> GSM97016     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97017     3  0.6147     0.6109 0.056 0.380 0.564 0.000
#> GSM97019     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97022     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97035     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97036     3  0.7110     0.7245 0.200 0.236 0.564 0.000
#> GSM97039     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97046     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97023     1  0.1211     0.7954 0.960 0.000 0.040 0.000
#> GSM97029     3  0.7114     0.7259 0.204 0.232 0.564 0.000
#> GSM97043     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97013     1  0.2760     0.7988 0.872 0.000 0.128 0.000
#> GSM96956     2  0.2868     0.7335 0.000 0.864 0.136 0.000
#> GSM97024     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97032     2  0.3649     0.6025 0.000 0.796 0.204 0.000
#> GSM97044     2  0.4193     0.5663 0.000 0.732 0.268 0.000
#> GSM97049     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM96968     1  0.4907     0.7140 0.580 0.000 0.420 0.000
#> GSM96971     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM96986     1  0.4933     0.7075 0.568 0.000 0.432 0.000
#> GSM97003     1  0.4907     0.7134 0.580 0.000 0.420 0.000
#> GSM96957     1  0.0469     0.7924 0.988 0.000 0.012 0.000
#> GSM96960     1  0.0000     0.7897 1.000 0.000 0.000 0.000
#> GSM96975     1  0.3024     0.7787 0.852 0.000 0.148 0.000
#> GSM96998     1  0.0469     0.7925 0.988 0.000 0.012 0.000
#> GSM96999     1  0.1557     0.7988 0.944 0.000 0.056 0.000
#> GSM97001     1  0.3907     0.4656 0.768 0.000 0.232 0.000
#> GSM97005     1  0.4040     0.7707 0.752 0.000 0.248 0.000
#> GSM97006     1  0.3649     0.7752 0.796 0.000 0.204 0.000
#> GSM97021     3  0.7054     0.7274 0.196 0.232 0.572 0.000
#> GSM97028     3  0.5180     0.6834 0.064 0.196 0.740 0.000
#> GSM97031     1  0.3907     0.7711 0.768 0.000 0.232 0.000
#> GSM97037     2  0.2760     0.7443 0.000 0.872 0.128 0.000
#> GSM97018     2  0.4866    -0.0437 0.000 0.596 0.404 0.000
#> GSM97014     3  0.4941     0.5094 0.000 0.436 0.564 0.000
#> GSM97042     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97040     3  0.4907     0.5349 0.000 0.420 0.580 0.000
#> GSM97041     3  0.7082     0.7118 0.252 0.184 0.564 0.000
#> GSM96955     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM96990     3  0.4222     0.6467 0.000 0.272 0.728 0.000
#> GSM96991     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM97048     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM96963     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM96953     2  0.0000     0.9032 0.000 1.000 0.000 0.000
#> GSM96966     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM96979     1  0.4933     0.7075 0.568 0.000 0.432 0.000
#> GSM96983     2  0.6187     0.0491 0.052 0.516 0.432 0.000
#> GSM96984     1  0.4933     0.7075 0.568 0.000 0.432 0.000
#> GSM96994     1  0.6000     0.5345 0.508 0.040 0.452 0.000
#> GSM96996     1  0.0707     0.7790 0.980 0.000 0.020 0.000
#> GSM96997     1  0.4933     0.7075 0.568 0.000 0.432 0.000
#> GSM97007     1  0.4981     0.6809 0.536 0.000 0.464 0.000
#> GSM96954     1  0.4933     0.7075 0.568 0.000 0.432 0.000
#> GSM96962     1  0.4933     0.7075 0.568 0.000 0.432 0.000
#> GSM96969     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM96970     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM96973     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM96976     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM96977     1  0.4304     0.7631 0.716 0.000 0.284 0.000
#> GSM96995     3  0.4487     0.6777 0.100 0.092 0.808 0.000
#> GSM97002     1  0.0000     0.7897 1.000 0.000 0.000 0.000
#> GSM97009     3  0.5410     0.7158 0.080 0.192 0.728 0.000
#> GSM97010     1  0.3873     0.7749 0.772 0.000 0.228 0.000
#> GSM96974     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM96985     1  0.1792     0.7962 0.932 0.000 0.068 0.000
#> GSM96959     3  0.3308     0.6669 0.036 0.092 0.872 0.000
#> GSM96972     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM96978     1  0.4697     0.7308 0.644 0.000 0.356 0.000
#> GSM96967     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM96987     3  0.4999     0.3800 0.492 0.000 0.508 0.000
#> GSM97011     3  0.7058     0.7292 0.200 0.228 0.572 0.000
#> GSM96964     1  0.0000     0.7897 1.000 0.000 0.000 0.000
#> GSM96965     4  0.0000     1.0000 0.000 0.000 0.000 1.000
#> GSM96981     1  0.0592     0.7935 0.984 0.000 0.016 0.000
#> GSM96982     1  0.0188     0.7909 0.996 0.000 0.004 0.000
#> GSM96988     1  0.2408     0.7474 0.896 0.000 0.104 0.000
#> GSM97000     1  0.4933     0.7073 0.568 0.000 0.432 0.000
#> GSM97004     1  0.0000     0.7897 1.000 0.000 0.000 0.000
#> GSM97008     1  0.4454     0.7474 0.692 0.000 0.308 0.000
#> GSM96950     1  0.3486     0.7740 0.812 0.000 0.188 0.000
#> GSM96980     1  0.3554     0.7496 0.844 0.000 0.020 0.136
#> GSM96989     1  0.0000     0.7897 1.000 0.000 0.000 0.000
#> GSM96992     1  0.0000     0.7897 1.000 0.000 0.000 0.000
#> GSM96993     3  0.6201     0.5894 0.376 0.060 0.564 0.000
#> GSM96958     1  0.1792     0.7970 0.932 0.000 0.068 0.000
#> GSM96951     1  0.4134     0.7694 0.740 0.000 0.260 0.000
#> GSM96952     1  0.0000     0.7897 1.000 0.000 0.000 0.000
#> GSM96961     1  0.0000     0.7897 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
#> GSM97038     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97045     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97047     5  0.0162     0.8757 0.000 0.004 0.000 0.000 0.996
#> GSM97025     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97030     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97027     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97033     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97034     5  0.3741     0.5662 0.000 0.004 0.264 0.000 0.732
#> GSM97020     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97026     5  0.4227     0.2615 0.000 0.420 0.000 0.000 0.580
#> GSM97012     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97015     5  0.0162     0.8757 0.000 0.004 0.000 0.000 0.996
#> GSM97016     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97017     5  0.0000     0.8759 0.000 0.000 0.000 0.000 1.000
#> GSM97019     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97022     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97035     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97036     5  0.0000     0.8759 0.000 0.000 0.000 0.000 1.000
#> GSM97039     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97046     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97023     1  0.0000     0.8392 1.000 0.000 0.000 0.000 0.000
#> GSM97029     5  0.0000     0.8759 0.000 0.000 0.000 0.000 1.000
#> GSM97043     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97013     1  0.3895     0.5414 0.680 0.000 0.320 0.000 0.000
#> GSM96956     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97024     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97032     2  0.3837     0.5336 0.000 0.692 0.000 0.000 0.308
#> GSM97044     2  0.5190     0.5942 0.000 0.688 0.172 0.000 0.140
#> GSM97049     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM96968     3  0.4451    -0.2093 0.492 0.000 0.504 0.000 0.004
#> GSM96971     4  0.0290     0.9923 0.000 0.000 0.008 0.992 0.000
#> GSM96986     3  0.0000     0.8277 0.000 0.000 1.000 0.000 0.000
#> GSM97003     3  0.1270     0.7961 0.052 0.000 0.948 0.000 0.000
#> GSM96957     1  0.2230     0.8017 0.912 0.000 0.044 0.000 0.044
#> GSM96960     1  0.0000     0.8392 1.000 0.000 0.000 0.000 0.000
#> GSM96975     1  0.2890     0.7363 0.836 0.000 0.160 0.000 0.004
#> GSM96998     1  0.0000     0.8392 1.000 0.000 0.000 0.000 0.000
#> GSM96999     1  0.0566     0.8364 0.984 0.000 0.012 0.000 0.004
#> GSM97001     5  0.0880     0.8559 0.032 0.000 0.000 0.000 0.968
#> GSM97005     1  0.3949     0.5189 0.668 0.000 0.332 0.000 0.000
#> GSM97006     1  0.2852     0.7040 0.828 0.000 0.172 0.000 0.000
#> GSM97021     5  0.0162     0.8750 0.004 0.000 0.000 0.000 0.996
#> GSM97028     5  0.0162     0.8757 0.000 0.004 0.000 0.000 0.996
#> GSM97031     1  0.3816     0.5531 0.696 0.000 0.304 0.000 0.000
#> GSM97037     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97018     5  0.4182     0.3166 0.000 0.400 0.000 0.000 0.600
#> GSM97014     5  0.0162     0.8757 0.000 0.004 0.000 0.000 0.996
#> GSM97042     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97040     5  0.0162     0.8757 0.000 0.004 0.000 0.000 0.996
#> GSM97041     5  0.0000     0.8759 0.000 0.000 0.000 0.000 1.000
#> GSM96955     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM96990     5  0.0162     0.8757 0.000 0.004 0.000 0.000 0.996
#> GSM96991     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM97048     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM96963     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM96953     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000
#> GSM96966     4  0.0000     0.9992 0.000 0.000 0.000 1.000 0.000
#> GSM96979     3  0.0000     0.8277 0.000 0.000 1.000 0.000 0.000
#> GSM96983     2  0.6394     0.1465 0.000 0.476 0.180 0.000 0.344
#> GSM96984     3  0.0000     0.8277 0.000 0.000 1.000 0.000 0.000
#> GSM96994     3  0.6783     0.2143 0.012 0.200 0.476 0.000 0.312
#> GSM96996     1  0.0162     0.8385 0.996 0.000 0.000 0.000 0.004
#> GSM96997     3  0.0000     0.8277 0.000 0.000 1.000 0.000 0.000
#> GSM97007     3  0.0000     0.8277 0.000 0.000 1.000 0.000 0.000
#> GSM96954     3  0.0510     0.8229 0.016 0.000 0.984 0.000 0.000
#> GSM96962     3  0.0000     0.8277 0.000 0.000 1.000 0.000 0.000
#> GSM96969     4  0.0000     0.9992 0.000 0.000 0.000 1.000 0.000
#> GSM96970     4  0.0000     0.9992 0.000 0.000 0.000 1.000 0.000
#> GSM96973     4  0.0000     0.9992 0.000 0.000 0.000 1.000 0.000
#> GSM96976     4  0.0000     0.9992 0.000 0.000 0.000 1.000 0.000
#> GSM96977     1  0.4425     0.2688 0.544 0.000 0.452 0.000 0.004
#> GSM96995     5  0.2852     0.7089 0.000 0.000 0.172 0.000 0.828
#> GSM97002     1  0.0162     0.8385 0.996 0.000 0.000 0.000 0.004
#> GSM97009     5  0.0162     0.8739 0.004 0.000 0.000 0.000 0.996
#> GSM97010     1  0.4425     0.2688 0.544 0.000 0.452 0.000 0.004
#> GSM96974     4  0.0000     0.9992 0.000 0.000 0.000 1.000 0.000
#> GSM96985     1  0.2068     0.7982 0.904 0.000 0.092 0.000 0.004
#> GSM96959     5  0.0000     0.8759 0.000 0.000 0.000 0.000 1.000
#> GSM96972     4  0.0000     0.9992 0.000 0.000 0.000 1.000 0.000
#> GSM96978     3  0.0771     0.8211 0.020 0.000 0.976 0.000 0.004
#> GSM96967     4  0.0000     0.9992 0.000 0.000 0.000 1.000 0.000
#> GSM96987     1  0.0404     0.8330 0.988 0.000 0.000 0.000 0.012
#> GSM97011     5  0.0000     0.8759 0.000 0.000 0.000 0.000 1.000
#> GSM96964     1  0.0000     0.8392 1.000 0.000 0.000 0.000 0.000
#> GSM96965     4  0.0000     0.9992 0.000 0.000 0.000 1.000 0.000
#> GSM96981     1  0.0771     0.8341 0.976 0.000 0.020 0.000 0.004
#> GSM96982     1  0.0324     0.8385 0.992 0.000 0.004 0.000 0.004
#> GSM96988     5  0.4273     0.2427 0.448 0.000 0.000 0.000 0.552
#> GSM97000     3  0.5915     0.0889 0.384 0.000 0.508 0.000 0.108
#> GSM97004     1  0.0000     0.8392 1.000 0.000 0.000 0.000 0.000
#> GSM97008     5  0.4329     0.4254 0.016 0.000 0.312 0.000 0.672
#> GSM96950     1  0.4425     0.2688 0.544 0.000 0.452 0.000 0.004
#> GSM96980     1  0.3807     0.7054 0.792 0.000 0.028 0.176 0.004
#> GSM96989     1  0.0000     0.8392 1.000 0.000 0.000 0.000 0.000
#> GSM96992     1  0.0000     0.8392 1.000 0.000 0.000 0.000 0.000
#> GSM96993     5  0.0162     0.8750 0.004 0.000 0.000 0.000 0.996
#> GSM96958     1  0.2286     0.7914 0.888 0.000 0.108 0.000 0.004
#> GSM96951     1  0.4101     0.4515 0.628 0.000 0.372 0.000 0.000
#> GSM96952     1  0.0000     0.8392 1.000 0.000 0.000 0.000 0.000
#> GSM96961     1  0.0000     0.8392 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
#> GSM97038     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97045     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97047     5  0.0363    0.83940 0.000 0.012 0.000 0.000 0.988 0.000
#> GSM97025     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97030     2  0.0922    0.94347 0.000 0.968 0.024 0.000 0.004 0.004
#> GSM97027     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97033     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97034     5  0.5383    0.29307 0.000 0.000 0.232 0.000 0.584 0.184
#> GSM97020     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97026     5  0.3823    0.19890 0.000 0.436 0.000 0.000 0.564 0.000
#> GSM97012     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97015     5  0.0508    0.83932 0.000 0.000 0.012 0.000 0.984 0.004
#> GSM97016     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97017     5  0.0146    0.84121 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM97019     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97022     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97035     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97036     5  0.0146    0.84121 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM97039     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97046     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97023     1  0.0000    0.89544 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97029     5  0.3817    0.20423 0.000 0.000 0.432 0.000 0.568 0.000
#> GSM97043     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97013     6  0.6120    0.40982 0.316 0.000 0.320 0.000 0.000 0.364
#> GSM96956     2  0.0653    0.95060 0.000 0.980 0.012 0.000 0.004 0.004
#> GSM97024     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97032     2  0.3848    0.56152 0.000 0.692 0.012 0.000 0.292 0.004
#> GSM97044     2  0.2932    0.81013 0.000 0.840 0.024 0.000 0.132 0.004
#> GSM97049     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96968     3  0.3911    0.00114 0.008 0.000 0.624 0.000 0.000 0.368
#> GSM96971     4  0.0363    0.98789 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM96986     6  0.0146    0.70607 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM97003     6  0.3578    0.57053 0.000 0.000 0.340 0.000 0.000 0.660
#> GSM96957     3  0.3727    0.39771 0.388 0.000 0.612 0.000 0.000 0.000
#> GSM96960     1  0.0000    0.89544 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96975     3  0.1814    0.70891 0.100 0.000 0.900 0.000 0.000 0.000
#> GSM96998     1  0.0363    0.88915 0.988 0.000 0.012 0.000 0.000 0.000
#> GSM96999     3  0.3592    0.53043 0.344 0.000 0.656 0.000 0.000 0.000
#> GSM97001     5  0.3490    0.55664 0.008 0.000 0.268 0.000 0.724 0.000
#> GSM97005     6  0.6116    0.41586 0.312 0.000 0.320 0.000 0.000 0.368
#> GSM97006     1  0.0508    0.88698 0.984 0.000 0.012 0.000 0.000 0.004
#> GSM97021     5  0.0000    0.84127 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97028     5  0.0508    0.83932 0.000 0.000 0.012 0.000 0.984 0.004
#> GSM97031     1  0.4004    0.22596 0.620 0.000 0.012 0.000 0.000 0.368
#> GSM97037     2  0.0922    0.94347 0.000 0.968 0.024 0.000 0.004 0.004
#> GSM97018     5  0.4218    0.27664 0.000 0.400 0.012 0.000 0.584 0.004
#> GSM97014     5  0.0363    0.83940 0.000 0.012 0.000 0.000 0.988 0.000
#> GSM97042     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97040     5  0.0000    0.84127 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM97041     5  0.0146    0.84103 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM96955     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96990     5  0.0508    0.83932 0.000 0.000 0.012 0.000 0.984 0.004
#> GSM96991     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97048     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96963     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96953     2  0.0000    0.96400 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96966     4  0.0000    0.99867 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96979     6  0.0146    0.70607 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM96983     2  0.4498    0.45353 0.000 0.632 0.040 0.000 0.324 0.004
#> GSM96984     6  0.0146    0.70607 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM96994     3  0.2201    0.64330 0.000 0.036 0.904 0.000 0.056 0.004
#> GSM96996     3  0.3883    0.53953 0.332 0.000 0.656 0.000 0.012 0.000
#> GSM96997     6  0.0146    0.70607 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM97007     6  0.0363    0.69889 0.000 0.000 0.012 0.000 0.000 0.988
#> GSM96954     6  0.3499    0.58512 0.000 0.000 0.320 0.000 0.000 0.680
#> GSM96962     6  0.0146    0.70607 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM96969     4  0.0000    0.99867 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96970     4  0.0000    0.99867 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96973     4  0.0000    0.99867 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96976     4  0.0000    0.99867 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96977     3  0.4230    0.00786 0.024 0.000 0.612 0.000 0.000 0.364
#> GSM96995     5  0.0603    0.84062 0.000 0.000 0.016 0.000 0.980 0.004
#> GSM97002     1  0.3804   -0.08318 0.576 0.000 0.424 0.000 0.000 0.000
#> GSM97009     5  0.0547    0.83551 0.000 0.000 0.020 0.000 0.980 0.000
#> GSM97010     3  0.3134    0.49839 0.024 0.000 0.808 0.000 0.000 0.168
#> GSM96974     4  0.0000    0.99867 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96985     3  0.2092    0.71224 0.124 0.000 0.876 0.000 0.000 0.000
#> GSM96959     5  0.0405    0.84014 0.000 0.000 0.008 0.000 0.988 0.004
#> GSM96972     4  0.0000    0.99867 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96978     3  0.0632    0.66096 0.000 0.000 0.976 0.000 0.000 0.024
#> GSM96967     4  0.0000    0.99867 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96987     1  0.0000    0.89544 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97011     5  0.1204    0.81256 0.000 0.000 0.056 0.000 0.944 0.000
#> GSM96964     1  0.1501    0.80894 0.924 0.000 0.076 0.000 0.000 0.000
#> GSM96965     4  0.0000    0.99867 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96981     3  0.2793    0.68986 0.200 0.000 0.800 0.000 0.000 0.000
#> GSM96982     3  0.3531    0.55999 0.328 0.000 0.672 0.000 0.000 0.000
#> GSM96988     3  0.4795    0.50396 0.324 0.000 0.604 0.000 0.072 0.000
#> GSM97000     6  0.6230    0.42036 0.016 0.000 0.332 0.000 0.204 0.448
#> GSM97004     1  0.0000    0.89544 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97008     5  0.5583    0.06144 0.000 0.000 0.152 0.000 0.500 0.348
#> GSM96950     3  0.2662    0.57364 0.024 0.000 0.856 0.000 0.000 0.120
#> GSM96980     3  0.1957    0.70867 0.112 0.000 0.888 0.000 0.000 0.000
#> GSM96989     1  0.0000    0.89544 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96992     1  0.0363    0.88915 0.988 0.000 0.012 0.000 0.000 0.000
#> GSM96993     5  0.0146    0.84103 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM96958     3  0.1075    0.68252 0.048 0.000 0.952 0.000 0.000 0.000
#> GSM96951     6  0.6116    0.41586 0.312 0.000 0.320 0.000 0.000 0.368
#> GSM96952     1  0.0000    0.89544 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96961     1  0.0000    0.89544 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-ATC-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-pam-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>           n disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:pam  94         3.02e-09       0.472     7.85e-18   0.0110 2
#> ATC:pam 100         1.61e-07       0.221     1.13e-18   0.0321 3
#> ATC:pam  95         2.77e-06       0.545     2.06e-16   0.4184 4
#> ATC:pam  88         1.57e-04       0.490     5.32e-21   0.3015 5
#> ATC:pam  84         4.04e-04       0.937     7.19e-19   0.4925 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 21168 rows and 100 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 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-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.975       0.990          0.216 0.787   0.787
#> 3 3 0.587           0.791       0.903          1.614 0.600   0.498
#> 4 4 0.983           0.955       0.983          0.179 0.901   0.766
#> 5 5 0.736           0.785       0.882          0.112 0.881   0.673
#> 6 6 0.941           0.887       0.951          0.112 0.878   0.572

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 4

There is also optional best \(k\) = 2 4 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97038     2   0.000      0.993 0.000 1.000
#> GSM97045     2   0.000      0.993 0.000 1.000
#> GSM97047     2   0.000      0.993 0.000 1.000
#> GSM97025     2   0.000      0.993 0.000 1.000
#> GSM97030     2   0.000      0.993 0.000 1.000
#> GSM97027     2   0.000      0.993 0.000 1.000
#> GSM97033     2   0.000      0.993 0.000 1.000
#> GSM97034     2   0.000      0.993 0.000 1.000
#> GSM97020     2   0.000      0.993 0.000 1.000
#> GSM97026     2   0.000      0.993 0.000 1.000
#> GSM97012     2   0.000      0.993 0.000 1.000
#> GSM97015     2   0.000      0.993 0.000 1.000
#> GSM97016     2   0.000      0.993 0.000 1.000
#> GSM97017     2   0.000      0.993 0.000 1.000
#> GSM97019     2   0.000      0.993 0.000 1.000
#> GSM97022     2   0.000      0.993 0.000 1.000
#> GSM97035     2   0.000      0.993 0.000 1.000
#> GSM97036     2   0.000      0.993 0.000 1.000
#> GSM97039     2   0.000      0.993 0.000 1.000
#> GSM97046     2   0.000      0.993 0.000 1.000
#> GSM97023     2   0.000      0.993 0.000 1.000
#> GSM97029     2   0.000      0.993 0.000 1.000
#> GSM97043     2   0.000      0.993 0.000 1.000
#> GSM97013     2   0.000      0.993 0.000 1.000
#> GSM96956     2   0.000      0.993 0.000 1.000
#> GSM97024     2   0.000      0.993 0.000 1.000
#> GSM97032     2   0.000      0.993 0.000 1.000
#> GSM97044     2   0.000      0.993 0.000 1.000
#> GSM97049     2   0.000      0.993 0.000 1.000
#> GSM96968     2   0.000      0.993 0.000 1.000
#> GSM96971     1   0.000      0.959 1.000 0.000
#> GSM96986     2   0.295      0.945 0.052 0.948
#> GSM97003     2   0.000      0.993 0.000 1.000
#> GSM96957     2   0.000      0.993 0.000 1.000
#> GSM96960     2   0.000      0.993 0.000 1.000
#> GSM96975     2   0.000      0.993 0.000 1.000
#> GSM96998     2   0.000      0.993 0.000 1.000
#> GSM96999     2   0.000      0.993 0.000 1.000
#> GSM97001     2   0.000      0.993 0.000 1.000
#> GSM97005     2   0.000      0.993 0.000 1.000
#> GSM97006     2   0.000      0.993 0.000 1.000
#> GSM97021     2   0.000      0.993 0.000 1.000
#> GSM97028     2   0.000      0.993 0.000 1.000
#> GSM97031     2   0.000      0.993 0.000 1.000
#> GSM97037     2   0.000      0.993 0.000 1.000
#> GSM97018     2   0.000      0.993 0.000 1.000
#> GSM97014     2   0.000      0.993 0.000 1.000
#> GSM97042     2   0.000      0.993 0.000 1.000
#> GSM97040     2   0.000      0.993 0.000 1.000
#> GSM97041     2   0.000      0.993 0.000 1.000
#> GSM96955     2   0.000      0.993 0.000 1.000
#> GSM96990     2   0.000      0.993 0.000 1.000
#> GSM96991     2   0.000      0.993 0.000 1.000
#> GSM97048     2   0.000      0.993 0.000 1.000
#> GSM96963     2   0.000      0.993 0.000 1.000
#> GSM96953     2   0.000      0.993 0.000 1.000
#> GSM96966     1   0.000      0.959 1.000 0.000
#> GSM96979     2   0.295      0.945 0.052 0.948
#> GSM96983     2   0.000      0.993 0.000 1.000
#> GSM96984     2   0.295      0.945 0.052 0.948
#> GSM96994     2   0.000      0.993 0.000 1.000
#> GSM96996     2   0.000      0.993 0.000 1.000
#> GSM96997     2   0.295      0.945 0.052 0.948
#> GSM97007     2   0.204      0.964 0.032 0.968
#> GSM96954     2   0.000      0.993 0.000 1.000
#> GSM96962     2   0.295      0.945 0.052 0.948
#> GSM96969     1   0.000      0.959 1.000 0.000
#> GSM96970     1   0.000      0.959 1.000 0.000
#> GSM96973     1   0.000      0.959 1.000 0.000
#> GSM96976     1   0.000      0.959 1.000 0.000
#> GSM96977     2   0.000      0.993 0.000 1.000
#> GSM96995     2   0.000      0.993 0.000 1.000
#> GSM97002     2   0.295      0.943 0.052 0.948
#> GSM97009     2   0.000      0.993 0.000 1.000
#> GSM97010     2   0.000      0.993 0.000 1.000
#> GSM96974     1   0.000      0.959 1.000 0.000
#> GSM96985     1   0.991      0.198 0.556 0.444
#> GSM96959     2   0.000      0.993 0.000 1.000
#> GSM96972     1   0.000      0.959 1.000 0.000
#> GSM96978     2   0.141      0.976 0.020 0.980
#> GSM96967     1   0.000      0.959 1.000 0.000
#> GSM96987     2   0.000      0.993 0.000 1.000
#> GSM97011     2   0.000      0.993 0.000 1.000
#> GSM96964     2   0.000      0.993 0.000 1.000
#> GSM96965     1   0.000      0.959 1.000 0.000
#> GSM96981     2   0.000      0.993 0.000 1.000
#> GSM96982     2   0.000      0.993 0.000 1.000
#> GSM96988     2   0.000      0.993 0.000 1.000
#> GSM97000     2   0.000      0.993 0.000 1.000
#> GSM97004     2   0.745      0.720 0.212 0.788
#> GSM97008     2   0.000      0.993 0.000 1.000
#> GSM96950     2   0.000      0.993 0.000 1.000
#> GSM96980     1   0.000      0.959 1.000 0.000
#> GSM96989     2   0.000      0.993 0.000 1.000
#> GSM96992     2   0.000      0.993 0.000 1.000
#> GSM96993     2   0.000      0.993 0.000 1.000
#> GSM96958     2   0.000      0.993 0.000 1.000
#> GSM96951     2   0.000      0.993 0.000 1.000
#> GSM96952     2   0.000      0.993 0.000 1.000
#> GSM96961     2   0.000      0.993 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97038     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97045     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97047     2  0.5138     0.7517 0.252 0.748 0.000
#> GSM97025     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97030     2  0.5098     0.7551 0.248 0.752 0.000
#> GSM97027     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97033     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97034     2  0.5138     0.7517 0.252 0.748 0.000
#> GSM97020     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97026     2  0.5138     0.7517 0.252 0.748 0.000
#> GSM97012     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97015     2  0.5138     0.7517 0.252 0.748 0.000
#> GSM97016     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97017     1  0.6008     0.4203 0.628 0.372 0.000
#> GSM97019     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97022     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97035     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97036     1  0.5621     0.5739 0.692 0.308 0.000
#> GSM97039     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97046     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97023     1  0.4974     0.6753 0.764 0.236 0.000
#> GSM97029     1  0.5621     0.5739 0.692 0.308 0.000
#> GSM97043     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97013     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96956     2  0.5098     0.7551 0.248 0.752 0.000
#> GSM97024     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97032     2  0.4796     0.7688 0.220 0.780 0.000
#> GSM97044     2  0.5138     0.7517 0.252 0.748 0.000
#> GSM97049     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM96968     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96971     3  0.0000     0.9659 0.000 0.000 1.000
#> GSM96986     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM97003     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96957     1  0.5621     0.5739 0.692 0.308 0.000
#> GSM96960     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96975     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96998     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96999     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM97001     1  0.5621     0.5739 0.692 0.308 0.000
#> GSM97005     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM97006     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM97021     1  0.5650     0.5658 0.688 0.312 0.000
#> GSM97028     2  0.5138     0.7517 0.252 0.748 0.000
#> GSM97031     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM97037     2  0.5098     0.7551 0.248 0.752 0.000
#> GSM97018     2  0.5058     0.7574 0.244 0.756 0.000
#> GSM97014     2  0.5138     0.7517 0.252 0.748 0.000
#> GSM97042     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97040     2  0.5138     0.7517 0.252 0.748 0.000
#> GSM97041     1  0.5621     0.5739 0.692 0.308 0.000
#> GSM96955     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM96990     2  0.5138     0.7517 0.252 0.748 0.000
#> GSM96991     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM97048     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM96963     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM96953     2  0.0000     0.8279 0.000 1.000 0.000
#> GSM96966     3  0.0000     0.9659 0.000 0.000 1.000
#> GSM96979     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96983     2  0.5098     0.7551 0.248 0.752 0.000
#> GSM96984     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96994     2  0.5138     0.7517 0.252 0.748 0.000
#> GSM96996     1  0.0237     0.8714 0.996 0.004 0.000
#> GSM96997     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM97007     1  0.6244    -0.0444 0.560 0.440 0.000
#> GSM96954     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96962     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96969     3  0.0000     0.9659 0.000 0.000 1.000
#> GSM96970     3  0.0000     0.9659 0.000 0.000 1.000
#> GSM96973     3  0.0000     0.9659 0.000 0.000 1.000
#> GSM96976     3  0.0000     0.9659 0.000 0.000 1.000
#> GSM96977     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96995     2  0.6305     0.1134 0.484 0.516 0.000
#> GSM97002     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM97009     1  0.5926     0.4638 0.644 0.356 0.000
#> GSM97010     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96974     3  0.0000     0.9659 0.000 0.000 1.000
#> GSM96985     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96959     2  0.5138     0.7517 0.252 0.748 0.000
#> GSM96972     3  0.0000     0.9659 0.000 0.000 1.000
#> GSM96978     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96967     3  0.0000     0.9659 0.000 0.000 1.000
#> GSM96987     1  0.4452     0.7262 0.808 0.192 0.000
#> GSM97011     1  0.5621     0.5739 0.692 0.308 0.000
#> GSM96964     1  0.1860     0.8448 0.948 0.052 0.000
#> GSM96965     3  0.0000     0.9659 0.000 0.000 1.000
#> GSM96981     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96982     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96988     1  0.4346     0.7345 0.816 0.184 0.000
#> GSM97000     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM97004     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM97008     1  0.5621     0.5739 0.692 0.308 0.000
#> GSM96950     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96980     3  0.5254     0.5476 0.264 0.000 0.736
#> GSM96989     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96992     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96993     1  0.5621     0.5739 0.692 0.308 0.000
#> GSM96958     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96951     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96952     1  0.0000     0.8731 1.000 0.000 0.000
#> GSM96961     1  0.2165     0.8367 0.936 0.064 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3 p4
#> GSM97038     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97045     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97047     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97025     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97030     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97027     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97033     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97034     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97020     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97026     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97012     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97015     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97016     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97017     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97019     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97022     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97035     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97036     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97039     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97046     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97023     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97029     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97043     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97013     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96956     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97024     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97032     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97044     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97049     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM96968     3   0.000      1.000 0.000 0.000 1.000  0
#> GSM96971     4   0.000      1.000 0.000 0.000 0.000  1
#> GSM96986     3   0.000      1.000 0.000 0.000 1.000  0
#> GSM97003     1   0.450      0.547 0.684 0.000 0.316  0
#> GSM96957     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96960     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96975     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96998     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96999     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97001     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97005     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97006     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97021     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97028     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97031     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97037     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97018     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97014     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97042     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97040     1   0.473      0.436 0.636 0.364 0.000  0
#> GSM97041     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96955     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM96990     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM96991     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM97048     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM96963     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM96953     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM96966     4   0.000      1.000 0.000 0.000 0.000  1
#> GSM96979     3   0.000      1.000 0.000 0.000 1.000  0
#> GSM96983     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM96984     3   0.000      1.000 0.000 0.000 1.000  0
#> GSM96994     2   0.000      0.987 0.000 1.000 0.000  0
#> GSM96996     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96997     3   0.000      1.000 0.000 0.000 1.000  0
#> GSM97007     3   0.000      1.000 0.000 0.000 1.000  0
#> GSM96954     3   0.000      1.000 0.000 0.000 1.000  0
#> GSM96962     3   0.000      1.000 0.000 0.000 1.000  0
#> GSM96969     4   0.000      1.000 0.000 0.000 0.000  1
#> GSM96970     4   0.000      1.000 0.000 0.000 0.000  1
#> GSM96973     4   0.000      1.000 0.000 0.000 0.000  1
#> GSM96976     4   0.000      1.000 0.000 0.000 0.000  1
#> GSM96977     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96995     2   0.391      0.661 0.232 0.768 0.000  0
#> GSM97002     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97009     1   0.454      0.507 0.676 0.324 0.000  0
#> GSM97010     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96974     4   0.000      1.000 0.000 0.000 0.000  1
#> GSM96985     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96959     2   0.302      0.790 0.148 0.852 0.000  0
#> GSM96972     4   0.000      1.000 0.000 0.000 0.000  1
#> GSM96978     3   0.000      1.000 0.000 0.000 1.000  0
#> GSM96967     4   0.000      1.000 0.000 0.000 0.000  1
#> GSM96987     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97011     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96964     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96965     4   0.000      1.000 0.000 0.000 0.000  1
#> GSM96981     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96982     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96988     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97000     1   0.466      0.483 0.652 0.000 0.348  0
#> GSM97004     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM97008     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96950     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96980     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96989     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96992     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96993     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96958     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96951     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96952     1   0.000      0.962 1.000 0.000 0.000  0
#> GSM96961     1   0.000      0.962 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
#> GSM97038     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97045     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97047     5  0.2424     0.8328 0.000 0.132 0.000 0.000 0.868
#> GSM97025     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97030     5  0.2773     0.8047 0.000 0.164 0.000 0.000 0.836
#> GSM97027     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97033     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97034     5  0.2424     0.8328 0.000 0.132 0.000 0.000 0.868
#> GSM97020     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97026     5  0.6122     0.3737 0.348 0.140 0.000 0.000 0.512
#> GSM97012     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97015     5  0.2424     0.8328 0.000 0.132 0.000 0.000 0.868
#> GSM97016     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97017     1  0.4297     0.3690 0.528 0.000 0.000 0.000 0.472
#> GSM97019     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97022     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97035     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97036     1  0.4219     0.4798 0.584 0.000 0.000 0.000 0.416
#> GSM97039     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97046     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97023     1  0.2127     0.8022 0.892 0.000 0.000 0.000 0.108
#> GSM97029     1  0.4297     0.3690 0.528 0.000 0.000 0.000 0.472
#> GSM97043     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97013     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96956     5  0.2516     0.8268 0.000 0.140 0.000 0.000 0.860
#> GSM97024     2  0.4283     0.0704 0.000 0.544 0.000 0.000 0.456
#> GSM97032     5  0.2424     0.8328 0.000 0.132 0.000 0.000 0.868
#> GSM97044     5  0.2424     0.8328 0.000 0.132 0.000 0.000 0.868
#> GSM97049     5  0.4210     0.4142 0.000 0.412 0.000 0.000 0.588
#> GSM96968     1  0.4302     0.2264 0.520 0.000 0.480 0.000 0.000
#> GSM96971     4  0.1270     0.9633 0.000 0.000 0.052 0.948 0.000
#> GSM96986     3  0.0000     0.9638 0.000 0.000 1.000 0.000 0.000
#> GSM97003     1  0.4182     0.3778 0.600 0.000 0.400 0.000 0.000
#> GSM96957     1  0.2852     0.7693 0.828 0.000 0.000 0.000 0.172
#> GSM96960     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96975     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96998     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96999     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM97001     1  0.3143     0.7451 0.796 0.000 0.000 0.000 0.204
#> GSM97005     1  0.0162     0.8324 0.996 0.000 0.000 0.000 0.004
#> GSM97006     1  0.1121     0.8180 0.956 0.000 0.044 0.000 0.000
#> GSM97021     1  0.4305     0.3282 0.512 0.000 0.000 0.000 0.488
#> GSM97028     5  0.2424     0.8328 0.000 0.132 0.000 0.000 0.868
#> GSM97031     1  0.0579     0.8305 0.984 0.000 0.008 0.000 0.008
#> GSM97037     5  0.2424     0.8328 0.000 0.132 0.000 0.000 0.868
#> GSM97018     5  0.2424     0.8328 0.000 0.132 0.000 0.000 0.868
#> GSM97014     5  0.5974     0.4450 0.320 0.132 0.000 0.000 0.548
#> GSM97042     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97040     5  0.4273    -0.1904 0.448 0.000 0.000 0.000 0.552
#> GSM97041     1  0.4256     0.4435 0.564 0.000 0.000 0.000 0.436
#> GSM96955     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM96990     5  0.2424     0.8328 0.000 0.132 0.000 0.000 0.868
#> GSM96991     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM97048     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM96963     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM96953     2  0.0000     0.9741 0.000 1.000 0.000 0.000 0.000
#> GSM96966     4  0.1121     0.9690 0.000 0.000 0.044 0.956 0.000
#> GSM96979     3  0.0000     0.9638 0.000 0.000 1.000 0.000 0.000
#> GSM96983     5  0.2424     0.8328 0.000 0.132 0.000 0.000 0.868
#> GSM96984     3  0.0000     0.9638 0.000 0.000 1.000 0.000 0.000
#> GSM96994     5  0.2727     0.8181 0.000 0.116 0.016 0.000 0.868
#> GSM96996     1  0.1121     0.8232 0.956 0.000 0.000 0.000 0.044
#> GSM96997     3  0.0000     0.9638 0.000 0.000 1.000 0.000 0.000
#> GSM97007     3  0.1121     0.9180 0.000 0.000 0.956 0.000 0.044
#> GSM96954     3  0.1965     0.8556 0.096 0.000 0.904 0.000 0.000
#> GSM96962     3  0.0000     0.9638 0.000 0.000 1.000 0.000 0.000
#> GSM96969     4  0.0000     0.9798 0.000 0.000 0.000 1.000 0.000
#> GSM96970     4  0.0000     0.9798 0.000 0.000 0.000 1.000 0.000
#> GSM96973     4  0.0000     0.9798 0.000 0.000 0.000 1.000 0.000
#> GSM96976     4  0.1121     0.9690 0.000 0.000 0.044 0.956 0.000
#> GSM96977     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96995     5  0.5074     0.6949 0.168 0.132 0.000 0.000 0.700
#> GSM97002     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM97009     5  0.5889     0.1057 0.428 0.100 0.000 0.000 0.472
#> GSM97010     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96974     4  0.0000     0.9798 0.000 0.000 0.000 1.000 0.000
#> GSM96985     1  0.0703     0.8228 0.976 0.000 0.000 0.000 0.024
#> GSM96959     5  0.2424     0.8328 0.000 0.132 0.000 0.000 0.868
#> GSM96972     4  0.0000     0.9798 0.000 0.000 0.000 1.000 0.000
#> GSM96978     1  0.4306     0.1953 0.508 0.000 0.492 0.000 0.000
#> GSM96967     4  0.0000     0.9798 0.000 0.000 0.000 1.000 0.000
#> GSM96987     1  0.2648     0.7825 0.848 0.000 0.000 0.000 0.152
#> GSM97011     1  0.4294     0.3783 0.532 0.000 0.000 0.000 0.468
#> GSM96964     1  0.2127     0.8022 0.892 0.000 0.000 0.000 0.108
#> GSM96965     4  0.1121     0.9690 0.000 0.000 0.044 0.956 0.000
#> GSM96981     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96982     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96988     1  0.3366     0.6599 0.768 0.000 0.000 0.000 0.232
#> GSM97000     1  0.4341     0.4446 0.628 0.000 0.364 0.000 0.008
#> GSM97004     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM97008     1  0.3508     0.7044 0.748 0.000 0.000 0.000 0.252
#> GSM96950     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96980     1  0.1818     0.8072 0.932 0.000 0.044 0.000 0.024
#> GSM96989     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96992     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96993     1  0.4294     0.3783 0.532 0.000 0.000 0.000 0.468
#> GSM96958     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96951     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96952     1  0.0000     0.8329 1.000 0.000 0.000 0.000 0.000
#> GSM96961     1  0.2127     0.8022 0.892 0.000 0.000 0.000 0.108

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97045     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97047     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97025     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97030     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97027     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97033     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97034     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97020     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97026     5  0.2213    0.83068 0.004 0.008 0.100 0.000 0.888 0.000
#> GSM97012     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97015     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97016     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97017     5  0.0777    0.88432 0.004 0.000 0.024 0.000 0.972 0.000
#> GSM97019     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97022     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97035     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97036     5  0.0777    0.88432 0.004 0.000 0.024 0.000 0.972 0.000
#> GSM97039     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97046     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97023     1  0.0632    0.90968 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM97029     5  0.0777    0.88432 0.004 0.000 0.024 0.000 0.972 0.000
#> GSM97043     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97013     1  0.0146    0.91462 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM96956     3  0.0632    0.94388 0.000 0.024 0.976 0.000 0.000 0.000
#> GSM97024     2  0.2854    0.73530 0.000 0.792 0.208 0.000 0.000 0.000
#> GSM97032     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97044     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97049     2  0.3695    0.41371 0.000 0.624 0.376 0.000 0.000 0.000
#> GSM96968     6  0.1141    0.96056 0.052 0.000 0.000 0.000 0.000 0.948
#> GSM96971     4  0.0632    0.98387 0.000 0.000 0.000 0.976 0.000 0.024
#> GSM96986     6  0.0000    0.96981 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97003     1  0.3737    0.32693 0.608 0.000 0.000 0.000 0.000 0.392
#> GSM96957     1  0.4405   -0.00718 0.504 0.000 0.024 0.000 0.472 0.000
#> GSM96960     1  0.0632    0.90968 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM96975     1  0.2883    0.70013 0.788 0.000 0.000 0.000 0.212 0.000
#> GSM96998     1  0.0000    0.91569 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96999     1  0.0146    0.91462 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM97001     5  0.0405    0.87449 0.004 0.000 0.008 0.000 0.988 0.000
#> GSM97005     1  0.0000    0.91569 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97006     1  0.0692    0.90875 0.976 0.000 0.000 0.000 0.004 0.020
#> GSM97021     5  0.0777    0.88432 0.004 0.000 0.024 0.000 0.972 0.000
#> GSM97028     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97031     1  0.0000    0.91569 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97037     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97018     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97014     5  0.2772    0.74763 0.004 0.000 0.180 0.000 0.816 0.000
#> GSM97042     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97040     5  0.0777    0.88432 0.004 0.000 0.024 0.000 0.972 0.000
#> GSM97041     5  0.0777    0.88432 0.004 0.000 0.024 0.000 0.972 0.000
#> GSM96955     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96990     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM96991     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM97048     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96963     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96953     2  0.0000    0.96951 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM96966     4  0.0458    0.98857 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM96979     6  0.0000    0.96981 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96983     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM96984     6  0.0000    0.96981 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96994     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM96996     5  0.1556    0.82393 0.080 0.000 0.000 0.000 0.920 0.000
#> GSM96997     6  0.0000    0.96981 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM97007     6  0.0632    0.96695 0.024 0.000 0.000 0.000 0.000 0.976
#> GSM96954     6  0.1075    0.96228 0.048 0.000 0.000 0.000 0.000 0.952
#> GSM96962     6  0.0000    0.96981 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM96969     4  0.0000    0.99293 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96970     4  0.0000    0.99293 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96973     4  0.0000    0.99293 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96976     4  0.0547    0.98670 0.000 0.000 0.000 0.980 0.000 0.020
#> GSM96977     1  0.0000    0.91569 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96995     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM97002     1  0.0363    0.91406 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM97009     3  0.3601    0.50395 0.004 0.000 0.684 0.000 0.312 0.000
#> GSM97010     1  0.0000    0.91569 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96974     4  0.0000    0.99293 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96985     5  0.3864    0.05109 0.480 0.000 0.000 0.000 0.520 0.000
#> GSM96959     3  0.0000    0.97444 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM96972     4  0.0000    0.99293 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96978     6  0.1141    0.96056 0.052 0.000 0.000 0.000 0.000 0.948
#> GSM96967     4  0.0000    0.99293 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM96987     5  0.0777    0.88432 0.004 0.000 0.024 0.000 0.972 0.000
#> GSM97011     5  0.0777    0.88432 0.004 0.000 0.024 0.000 0.972 0.000
#> GSM96964     1  0.0632    0.90968 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM96965     4  0.0363    0.99013 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM96981     5  0.3789    0.25948 0.416 0.000 0.000 0.000 0.584 0.000
#> GSM96982     1  0.0363    0.91411 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM96988     5  0.2950    0.78223 0.148 0.000 0.024 0.000 0.828 0.000
#> GSM97000     6  0.1204    0.95654 0.056 0.000 0.000 0.000 0.000 0.944
#> GSM97004     1  0.0000    0.91569 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM97008     1  0.3876    0.53482 0.700 0.000 0.024 0.000 0.276 0.000
#> GSM96950     1  0.0146    0.91462 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM96980     1  0.0692    0.90875 0.976 0.000 0.000 0.000 0.004 0.020
#> GSM96989     1  0.3563    0.46204 0.664 0.000 0.000 0.000 0.336 0.000
#> GSM96992     1  0.0260    0.91500 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM96993     5  0.0777    0.88432 0.004 0.000 0.024 0.000 0.972 0.000
#> GSM96958     1  0.0146    0.91462 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM96951     1  0.0000    0.91569 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96952     1  0.0000    0.91569 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM96961     1  0.0632    0.90968 0.976 0.000 0.000 0.000 0.024 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-mclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>             n disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:mclust 99         3.22e-02       0.424     8.13e-04    0.463 2
#> ATC:mclust 96         4.68e-06       0.136     2.76e-16    0.124 3
#> ATC:mclust 98         2.37e-04       0.321     3.62e-21    0.124 4
#> ATC:mclust 83         5.25e-06       0.148     1.34e-19    0.022 5
#> ATC:mclust 94         8.30e-05       0.399     1.53e-18    0.256 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 21168 rows and 100 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.979       0.991         0.5016 0.500   0.500
#> 3 3 0.846           0.862       0.933         0.2843 0.699   0.478
#> 4 4 0.828           0.865       0.930         0.1331 0.836   0.582
#> 5 5 0.686           0.651       0.825         0.0634 0.911   0.699
#> 6 6 0.652           0.538       0.752         0.0414 0.916   0.672

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>          class entropy silhouette    p1    p2
#> GSM97038     2  0.0000      0.985 0.000 1.000
#> GSM97045     2  0.0000      0.985 0.000 1.000
#> GSM97047     2  0.0000      0.985 0.000 1.000
#> GSM97025     2  0.0000      0.985 0.000 1.000
#> GSM97030     2  0.0000      0.985 0.000 1.000
#> GSM97027     2  0.0000      0.985 0.000 1.000
#> GSM97033     2  0.0000      0.985 0.000 1.000
#> GSM97034     2  0.0000      0.985 0.000 1.000
#> GSM97020     2  0.0000      0.985 0.000 1.000
#> GSM97026     2  0.0000      0.985 0.000 1.000
#> GSM97012     2  0.0000      0.985 0.000 1.000
#> GSM97015     2  0.0000      0.985 0.000 1.000
#> GSM97016     2  0.0000      0.985 0.000 1.000
#> GSM97017     2  0.0000      0.985 0.000 1.000
#> GSM97019     2  0.0000      0.985 0.000 1.000
#> GSM97022     2  0.0000      0.985 0.000 1.000
#> GSM97035     2  0.0000      0.985 0.000 1.000
#> GSM97036     2  0.0000      0.985 0.000 1.000
#> GSM97039     2  0.0000      0.985 0.000 1.000
#> GSM97046     2  0.0000      0.985 0.000 1.000
#> GSM97023     1  0.0000      0.999 1.000 0.000
#> GSM97029     2  0.0000      0.985 0.000 1.000
#> GSM97043     2  0.0000      0.985 0.000 1.000
#> GSM97013     1  0.0000      0.999 1.000 0.000
#> GSM96956     2  0.0000      0.985 0.000 1.000
#> GSM97024     2  0.0000      0.985 0.000 1.000
#> GSM97032     2  0.0000      0.985 0.000 1.000
#> GSM97044     2  0.0000      0.985 0.000 1.000
#> GSM97049     2  0.0000      0.985 0.000 1.000
#> GSM96968     1  0.0376      0.995 0.996 0.004
#> GSM96971     1  0.0000      0.999 1.000 0.000
#> GSM96986     1  0.0000      0.999 1.000 0.000
#> GSM97003     1  0.0000      0.999 1.000 0.000
#> GSM96957     2  0.1184      0.971 0.016 0.984
#> GSM96960     1  0.0000      0.999 1.000 0.000
#> GSM96975     1  0.0938      0.988 0.988 0.012
#> GSM96998     1  0.0000      0.999 1.000 0.000
#> GSM96999     1  0.0000      0.999 1.000 0.000
#> GSM97001     2  0.0000      0.985 0.000 1.000
#> GSM97005     1  0.0000      0.999 1.000 0.000
#> GSM97006     1  0.0000      0.999 1.000 0.000
#> GSM97021     2  0.0000      0.985 0.000 1.000
#> GSM97028     2  0.0000      0.985 0.000 1.000
#> GSM97031     1  0.0000      0.999 1.000 0.000
#> GSM97037     2  0.0000      0.985 0.000 1.000
#> GSM97018     2  0.0000      0.985 0.000 1.000
#> GSM97014     2  0.0000      0.985 0.000 1.000
#> GSM97042     2  0.0000      0.985 0.000 1.000
#> GSM97040     2  0.0000      0.985 0.000 1.000
#> GSM97041     2  0.0000      0.985 0.000 1.000
#> GSM96955     2  0.0000      0.985 0.000 1.000
#> GSM96990     2  0.0000      0.985 0.000 1.000
#> GSM96991     2  0.0000      0.985 0.000 1.000
#> GSM97048     2  0.0000      0.985 0.000 1.000
#> GSM96963     2  0.0000      0.985 0.000 1.000
#> GSM96953     2  0.0000      0.985 0.000 1.000
#> GSM96966     1  0.0000      0.999 1.000 0.000
#> GSM96979     1  0.0000      0.999 1.000 0.000
#> GSM96983     2  0.0000      0.985 0.000 1.000
#> GSM96984     1  0.0000      0.999 1.000 0.000
#> GSM96994     2  0.0000      0.985 0.000 1.000
#> GSM96996     2  0.8955      0.556 0.312 0.688
#> GSM96997     1  0.0000      0.999 1.000 0.000
#> GSM97007     2  0.9686      0.359 0.396 0.604
#> GSM96954     1  0.0000      0.999 1.000 0.000
#> GSM96962     1  0.0000      0.999 1.000 0.000
#> GSM96969     1  0.0000      0.999 1.000 0.000
#> GSM96970     1  0.0000      0.999 1.000 0.000
#> GSM96973     1  0.0000      0.999 1.000 0.000
#> GSM96976     1  0.0000      0.999 1.000 0.000
#> GSM96977     1  0.0000      0.999 1.000 0.000
#> GSM96995     2  0.0000      0.985 0.000 1.000
#> GSM97002     1  0.0000      0.999 1.000 0.000
#> GSM97009     2  0.0000      0.985 0.000 1.000
#> GSM97010     1  0.0000      0.999 1.000 0.000
#> GSM96974     1  0.0000      0.999 1.000 0.000
#> GSM96985     1  0.0000      0.999 1.000 0.000
#> GSM96959     2  0.0000      0.985 0.000 1.000
#> GSM96972     1  0.0000      0.999 1.000 0.000
#> GSM96978     1  0.0000      0.999 1.000 0.000
#> GSM96967     1  0.0000      0.999 1.000 0.000
#> GSM96987     2  0.0938      0.975 0.012 0.988
#> GSM97011     2  0.0000      0.985 0.000 1.000
#> GSM96964     1  0.0000      0.999 1.000 0.000
#> GSM96965     1  0.0000      0.999 1.000 0.000
#> GSM96981     1  0.2043      0.967 0.968 0.032
#> GSM96982     1  0.0000      0.999 1.000 0.000
#> GSM96988     2  0.3274      0.928 0.060 0.940
#> GSM97000     1  0.0000      0.999 1.000 0.000
#> GSM97004     1  0.0000      0.999 1.000 0.000
#> GSM97008     2  0.1184      0.971 0.016 0.984
#> GSM96950     1  0.0000      0.999 1.000 0.000
#> GSM96980     1  0.0000      0.999 1.000 0.000
#> GSM96989     1  0.0376      0.995 0.996 0.004
#> GSM96992     1  0.0000      0.999 1.000 0.000
#> GSM96993     2  0.0000      0.985 0.000 1.000
#> GSM96958     1  0.0000      0.999 1.000 0.000
#> GSM96951     1  0.0000      0.999 1.000 0.000
#> GSM96952     1  0.0000      0.999 1.000 0.000
#> GSM96961     1  0.0000      0.999 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>          class entropy silhouette    p1    p2    p3
#> GSM97038     2  0.0592     0.9719 0.012 0.988 0.000
#> GSM97045     2  0.0592     0.9719 0.012 0.988 0.000
#> GSM97047     2  0.1643     0.9559 0.044 0.956 0.000
#> GSM97025     2  0.0424     0.9721 0.008 0.992 0.000
#> GSM97030     2  0.1182     0.9649 0.012 0.976 0.012
#> GSM97027     2  0.0892     0.9695 0.020 0.980 0.000
#> GSM97033     2  0.0424     0.9721 0.008 0.992 0.000
#> GSM97034     2  0.1751     0.9580 0.028 0.960 0.012
#> GSM97020     2  0.1031     0.9676 0.024 0.976 0.000
#> GSM97026     2  0.1163     0.9656 0.028 0.972 0.000
#> GSM97012     2  0.0000     0.9713 0.000 1.000 0.000
#> GSM97015     2  0.1878     0.9603 0.044 0.952 0.004
#> GSM97016     2  0.0000     0.9713 0.000 1.000 0.000
#> GSM97017     1  0.2625     0.8580 0.916 0.084 0.000
#> GSM97019     2  0.0000     0.9713 0.000 1.000 0.000
#> GSM97022     2  0.0237     0.9701 0.000 0.996 0.004
#> GSM97035     2  0.0237     0.9701 0.000 0.996 0.004
#> GSM97036     1  0.2356     0.8685 0.928 0.072 0.000
#> GSM97039     2  0.0424     0.9721 0.008 0.992 0.000
#> GSM97046     2  0.0237     0.9719 0.004 0.996 0.000
#> GSM97023     1  0.0000     0.9005 1.000 0.000 0.000
#> GSM97029     1  0.4235     0.7607 0.824 0.176 0.000
#> GSM97043     2  0.0592     0.9719 0.012 0.988 0.000
#> GSM97013     1  0.1163     0.9013 0.972 0.000 0.028
#> GSM96956     2  0.1647     0.9492 0.004 0.960 0.036
#> GSM97024     2  0.0000     0.9713 0.000 1.000 0.000
#> GSM97032     2  0.0424     0.9723 0.008 0.992 0.000
#> GSM97044     2  0.2434     0.9357 0.024 0.940 0.036
#> GSM97049     2  0.0592     0.9719 0.012 0.988 0.000
#> GSM96968     3  0.6244     0.2658 0.440 0.000 0.560
#> GSM96971     3  0.0237     0.8832 0.004 0.000 0.996
#> GSM96986     3  0.3816     0.8070 0.148 0.000 0.852
#> GSM97003     1  0.2625     0.8562 0.916 0.000 0.084
#> GSM96957     1  0.1163     0.8947 0.972 0.028 0.000
#> GSM96960     1  0.1163     0.8962 0.972 0.000 0.028
#> GSM96975     1  0.1163     0.9006 0.972 0.000 0.028
#> GSM96998     1  0.1031     0.9013 0.976 0.000 0.024
#> GSM96999     1  0.1860     0.8932 0.948 0.000 0.052
#> GSM97001     1  0.1529     0.8889 0.960 0.040 0.000
#> GSM97005     1  0.0747     0.8998 0.984 0.000 0.016
#> GSM97006     1  0.1289     0.8946 0.968 0.000 0.032
#> GSM97021     1  0.1860     0.8821 0.948 0.052 0.000
#> GSM97028     2  0.1031     0.9699 0.024 0.976 0.000
#> GSM97031     1  0.0892     0.8993 0.980 0.000 0.020
#> GSM97037     2  0.1315     0.9620 0.020 0.972 0.008
#> GSM97018     2  0.0747     0.9709 0.016 0.984 0.000
#> GSM97014     2  0.1289     0.9631 0.032 0.968 0.000
#> GSM97042     2  0.0237     0.9701 0.000 0.996 0.004
#> GSM97040     1  0.5327     0.6287 0.728 0.272 0.000
#> GSM97041     1  0.2066     0.8779 0.940 0.060 0.000
#> GSM96955     2  0.0592     0.9719 0.012 0.988 0.000
#> GSM96990     2  0.1163     0.9671 0.028 0.972 0.000
#> GSM96991     2  0.0000     0.9713 0.000 1.000 0.000
#> GSM97048     2  0.0592     0.9719 0.012 0.988 0.000
#> GSM96963     2  0.0000     0.9713 0.000 1.000 0.000
#> GSM96953     2  0.0592     0.9667 0.000 0.988 0.012
#> GSM96966     3  0.0892     0.8830 0.020 0.000 0.980
#> GSM96979     3  0.1860     0.8764 0.052 0.000 0.948
#> GSM96983     2  0.2414     0.9347 0.020 0.940 0.040
#> GSM96984     3  0.1529     0.8781 0.040 0.000 0.960
#> GSM96994     2  0.3370     0.9031 0.024 0.904 0.072
#> GSM96996     1  0.1170     0.8995 0.976 0.016 0.008
#> GSM96997     1  0.6215     0.1618 0.572 0.000 0.428
#> GSM97007     3  0.6066     0.6093 0.024 0.248 0.728
#> GSM96954     1  0.6302    -0.0409 0.520 0.000 0.480
#> GSM96962     3  0.1964     0.8750 0.056 0.000 0.944
#> GSM96969     3  0.1289     0.8803 0.032 0.000 0.968
#> GSM96970     3  0.0237     0.8832 0.004 0.000 0.996
#> GSM96973     3  0.0237     0.8832 0.004 0.000 0.996
#> GSM96976     3  0.0661     0.8790 0.004 0.008 0.988
#> GSM96977     1  0.6192     0.1999 0.580 0.000 0.420
#> GSM96995     2  0.2625     0.9182 0.084 0.916 0.000
#> GSM97002     1  0.1753     0.8947 0.952 0.000 0.048
#> GSM97009     2  0.4654     0.7487 0.208 0.792 0.000
#> GSM97010     3  0.6302     0.0802 0.480 0.000 0.520
#> GSM96974     3  0.0237     0.8832 0.004 0.000 0.996
#> GSM96985     3  0.5948     0.4312 0.360 0.000 0.640
#> GSM96959     2  0.3116     0.8870 0.108 0.892 0.000
#> GSM96972     3  0.1289     0.8803 0.032 0.000 0.968
#> GSM96978     3  0.0592     0.8789 0.012 0.000 0.988
#> GSM96967     3  0.0592     0.8836 0.012 0.000 0.988
#> GSM96987     1  0.1643     0.8879 0.956 0.044 0.000
#> GSM97011     1  0.4750     0.7090 0.784 0.216 0.000
#> GSM96964     1  0.0424     0.9016 0.992 0.000 0.008
#> GSM96965     3  0.0237     0.8832 0.004 0.000 0.996
#> GSM96981     1  0.1031     0.9005 0.976 0.000 0.024
#> GSM96982     1  0.1643     0.8966 0.956 0.000 0.044
#> GSM96988     1  0.4062     0.7675 0.836 0.164 0.000
#> GSM97000     1  0.0747     0.9002 0.984 0.000 0.016
#> GSM97004     1  0.1753     0.8947 0.952 0.000 0.048
#> GSM97008     1  0.0983     0.8965 0.980 0.016 0.004
#> GSM96950     1  0.1964     0.8913 0.944 0.000 0.056
#> GSM96980     3  0.3879     0.7928 0.152 0.000 0.848
#> GSM96989     1  0.1031     0.9005 0.976 0.000 0.024
#> GSM96992     1  0.1529     0.8975 0.960 0.000 0.040
#> GSM96993     1  0.2066     0.8779 0.940 0.060 0.000
#> GSM96958     1  0.1411     0.8985 0.964 0.000 0.036
#> GSM96951     1  0.1163     0.8971 0.972 0.000 0.028
#> GSM96952     1  0.1163     0.9009 0.972 0.000 0.028
#> GSM96961     1  0.0424     0.9010 0.992 0.000 0.008

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>          class entropy silhouette    p1    p2    p3    p4
#> GSM97038     2  0.0376     0.9622 0.004 0.992 0.004 0.000
#> GSM97045     2  0.0188     0.9622 0.004 0.996 0.000 0.000
#> GSM97047     2  0.4857     0.4752 0.008 0.668 0.324 0.000
#> GSM97025     2  0.0376     0.9622 0.004 0.992 0.004 0.000
#> GSM97030     3  0.4164     0.6830 0.000 0.264 0.736 0.000
#> GSM97027     2  0.0188     0.9622 0.004 0.996 0.000 0.000
#> GSM97033     2  0.0657     0.9597 0.004 0.984 0.012 0.000
#> GSM97034     3  0.1557     0.8641 0.000 0.056 0.944 0.000
#> GSM97020     2  0.0188     0.9622 0.004 0.996 0.000 0.000
#> GSM97026     2  0.0188     0.9622 0.004 0.996 0.000 0.000
#> GSM97012     2  0.0188     0.9607 0.000 0.996 0.004 0.000
#> GSM97015     3  0.1637     0.8635 0.000 0.060 0.940 0.000
#> GSM97016     2  0.0188     0.9622 0.000 0.996 0.004 0.000
#> GSM97017     1  0.1474     0.8937 0.948 0.052 0.000 0.000
#> GSM97019     2  0.0188     0.9622 0.000 0.996 0.004 0.000
#> GSM97022     2  0.0336     0.9614 0.000 0.992 0.008 0.000
#> GSM97035     2  0.0188     0.9607 0.000 0.996 0.004 0.000
#> GSM97036     1  0.1302     0.8995 0.956 0.044 0.000 0.000
#> GSM97039     2  0.0188     0.9622 0.000 0.996 0.004 0.000
#> GSM97046     2  0.0188     0.9607 0.000 0.996 0.004 0.000
#> GSM97023     1  0.0469     0.9152 0.988 0.000 0.012 0.000
#> GSM97029     1  0.3873     0.7121 0.772 0.228 0.000 0.000
#> GSM97043     2  0.0188     0.9622 0.004 0.996 0.000 0.000
#> GSM97013     1  0.0779     0.9143 0.980 0.000 0.016 0.004
#> GSM96956     2  0.3161     0.8433 0.000 0.864 0.124 0.012
#> GSM97024     2  0.0592     0.9576 0.000 0.984 0.016 0.000
#> GSM97032     2  0.0592     0.9576 0.000 0.984 0.016 0.000
#> GSM97044     3  0.0921     0.8711 0.000 0.028 0.972 0.000
#> GSM97049     2  0.0657     0.9597 0.004 0.984 0.012 0.000
#> GSM96968     3  0.0992     0.8715 0.012 0.004 0.976 0.008
#> GSM96971     4  0.0921     0.9405 0.000 0.000 0.028 0.972
#> GSM96986     3  0.1109     0.8675 0.004 0.000 0.968 0.028
#> GSM97003     3  0.1929     0.8632 0.024 0.000 0.940 0.036
#> GSM96957     1  0.1059     0.9127 0.972 0.012 0.016 0.000
#> GSM96960     1  0.0657     0.9147 0.984 0.000 0.012 0.004
#> GSM96975     1  0.1305     0.8990 0.960 0.000 0.004 0.036
#> GSM96998     1  0.0524     0.9151 0.988 0.000 0.008 0.004
#> GSM96999     1  0.0524     0.9152 0.988 0.000 0.008 0.004
#> GSM97001     1  0.0937     0.9136 0.976 0.012 0.012 0.000
#> GSM97005     1  0.5167     0.0286 0.508 0.000 0.488 0.004
#> GSM97006     1  0.1042     0.9117 0.972 0.000 0.020 0.008
#> GSM97021     1  0.1182     0.9113 0.968 0.016 0.016 0.000
#> GSM97028     2  0.3266     0.7903 0.000 0.832 0.168 0.000
#> GSM97031     3  0.2593     0.8210 0.104 0.000 0.892 0.004
#> GSM97037     3  0.2921     0.8153 0.000 0.140 0.860 0.000
#> GSM97018     2  0.0657     0.9597 0.004 0.984 0.012 0.000
#> GSM97014     2  0.0376     0.9620 0.004 0.992 0.004 0.000
#> GSM97042     2  0.0188     0.9607 0.000 0.996 0.004 0.000
#> GSM97040     1  0.5050     0.3486 0.588 0.408 0.004 0.000
#> GSM97041     1  0.0921     0.9085 0.972 0.028 0.000 0.000
#> GSM96955     2  0.0844     0.9539 0.004 0.980 0.012 0.004
#> GSM96990     3  0.3907     0.7319 0.000 0.232 0.768 0.000
#> GSM96991     2  0.0336     0.9589 0.000 0.992 0.008 0.000
#> GSM97048     2  0.0376     0.9622 0.004 0.992 0.004 0.000
#> GSM96963     2  0.0336     0.9589 0.000 0.992 0.008 0.000
#> GSM96953     2  0.0188     0.9622 0.000 0.996 0.004 0.000
#> GSM96966     4  0.0376     0.9529 0.004 0.000 0.004 0.992
#> GSM96979     3  0.1557     0.8553 0.000 0.000 0.944 0.056
#> GSM96983     3  0.2973     0.8087 0.000 0.144 0.856 0.000
#> GSM96984     3  0.1211     0.8622 0.000 0.000 0.960 0.040
#> GSM96994     3  0.1229     0.8718 0.004 0.020 0.968 0.008
#> GSM96996     1  0.0524     0.9127 0.988 0.000 0.004 0.008
#> GSM96997     3  0.1151     0.8679 0.008 0.000 0.968 0.024
#> GSM97007     3  0.0657     0.8718 0.000 0.012 0.984 0.004
#> GSM96954     3  0.0804     0.8707 0.008 0.000 0.980 0.012
#> GSM96962     3  0.0921     0.8666 0.000 0.000 0.972 0.028
#> GSM96969     4  0.0469     0.9513 0.012 0.000 0.000 0.988
#> GSM96970     4  0.0188     0.9537 0.004 0.000 0.000 0.996
#> GSM96973     4  0.0376     0.9534 0.004 0.000 0.004 0.992
#> GSM96976     4  0.0188     0.9523 0.000 0.000 0.004 0.996
#> GSM96977     3  0.2844     0.8472 0.048 0.000 0.900 0.052
#> GSM96995     3  0.3962     0.8004 0.028 0.152 0.820 0.000
#> GSM97002     1  0.0592     0.9114 0.984 0.000 0.000 0.016
#> GSM97009     2  0.5160     0.7163 0.136 0.760 0.104 0.000
#> GSM97010     3  0.7764     0.0953 0.240 0.000 0.404 0.356
#> GSM96974     4  0.0188     0.9523 0.000 0.000 0.004 0.996
#> GSM96985     4  0.4546     0.7438 0.204 0.012 0.012 0.772
#> GSM96959     3  0.5404     0.5400 0.028 0.328 0.644 0.000
#> GSM96972     4  0.0804     0.9513 0.012 0.000 0.008 0.980
#> GSM96978     4  0.3528     0.7595 0.000 0.000 0.192 0.808
#> GSM96967     4  0.0188     0.9537 0.004 0.000 0.000 0.996
#> GSM96987     1  0.0564     0.9142 0.988 0.004 0.004 0.004
#> GSM97011     1  0.4188     0.6897 0.752 0.244 0.004 0.000
#> GSM96964     1  0.0469     0.9152 0.988 0.000 0.012 0.000
#> GSM96965     4  0.0000     0.9529 0.000 0.000 0.000 1.000
#> GSM96981     1  0.0657     0.9113 0.984 0.000 0.004 0.012
#> GSM96982     1  0.0707     0.9100 0.980 0.000 0.000 0.020
#> GSM96988     1  0.4544     0.7357 0.780 0.192 0.016 0.012
#> GSM97000     3  0.1229     0.8711 0.020 0.004 0.968 0.008
#> GSM97004     1  0.0779     0.9100 0.980 0.000 0.004 0.016
#> GSM97008     1  0.4343     0.6243 0.732 0.004 0.264 0.000
#> GSM96950     1  0.1975     0.8910 0.936 0.000 0.016 0.048
#> GSM96980     4  0.1661     0.9237 0.052 0.000 0.004 0.944
#> GSM96989     1  0.0524     0.9127 0.988 0.000 0.004 0.008
#> GSM96992     1  0.0188     0.9144 0.996 0.000 0.000 0.004
#> GSM96993     1  0.0921     0.9086 0.972 0.028 0.000 0.000
#> GSM96958     1  0.0779     0.9140 0.980 0.000 0.016 0.004
#> GSM96951     3  0.3933     0.7183 0.200 0.000 0.792 0.008
#> GSM96952     1  0.0188     0.9144 0.996 0.000 0.000 0.004
#> GSM96961     1  0.0469     0.9152 0.988 0.000 0.012 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
#> GSM97038     2  0.0703     0.8458 0.000 0.976 0.000 0.000 0.024
#> GSM97045     2  0.0703     0.8424 0.000 0.976 0.000 0.000 0.024
#> GSM97047     2  0.4352     0.6794 0.148 0.772 0.004 0.000 0.076
#> GSM97025     2  0.0000     0.8469 0.000 1.000 0.000 0.000 0.000
#> GSM97030     3  0.3586     0.6689 0.000 0.188 0.792 0.000 0.020
#> GSM97027     2  0.0703     0.8424 0.000 0.976 0.000 0.000 0.024
#> GSM97033     2  0.0963     0.8376 0.000 0.964 0.000 0.000 0.036
#> GSM97034     3  0.4295     0.6421 0.008 0.200 0.760 0.004 0.028
#> GSM97020     2  0.1408     0.8289 0.008 0.948 0.000 0.000 0.044
#> GSM97026     2  0.0566     0.8451 0.004 0.984 0.000 0.000 0.012
#> GSM97012     2  0.1197     0.8343 0.000 0.952 0.000 0.000 0.048
#> GSM97015     3  0.1670     0.7874 0.000 0.052 0.936 0.000 0.012
#> GSM97016     2  0.0510     0.8470 0.000 0.984 0.000 0.000 0.016
#> GSM97017     1  0.5168     0.3212 0.592 0.356 0.000 0.000 0.052
#> GSM97019     2  0.0794     0.8444 0.000 0.972 0.000 0.000 0.028
#> GSM97022     2  0.0609     0.8464 0.000 0.980 0.000 0.000 0.020
#> GSM97035     2  0.0880     0.8424 0.000 0.968 0.000 0.000 0.032
#> GSM97036     1  0.4302     0.6349 0.744 0.048 0.000 0.000 0.208
#> GSM97039     2  0.0162     0.8465 0.000 0.996 0.000 0.000 0.004
#> GSM97046     2  0.0703     0.8458 0.000 0.976 0.000 0.000 0.024
#> GSM97023     1  0.1195     0.6953 0.960 0.000 0.012 0.000 0.028
#> GSM97029     2  0.5368     0.4123 0.332 0.596 0.000 0.000 0.072
#> GSM97043     2  0.0703     0.8458 0.000 0.976 0.000 0.000 0.024
#> GSM97013     1  0.4534     0.6084 0.796 0.032 0.004 0.080 0.088
#> GSM96956     3  0.5648     0.1495 0.000 0.448 0.476 0.000 0.076
#> GSM97024     2  0.0510     0.8471 0.000 0.984 0.000 0.000 0.016
#> GSM97032     2  0.3921     0.6770 0.000 0.784 0.044 0.000 0.172
#> GSM97044     3  0.0404     0.7981 0.000 0.000 0.988 0.000 0.012
#> GSM97049     2  0.2504     0.7955 0.040 0.896 0.000 0.000 0.064
#> GSM96968     3  0.0162     0.7996 0.004 0.000 0.996 0.000 0.000
#> GSM96971     4  0.1485     0.8910 0.000 0.000 0.020 0.948 0.032
#> GSM96986     3  0.1087     0.7971 0.008 0.000 0.968 0.016 0.008
#> GSM97003     3  0.1082     0.7932 0.028 0.000 0.964 0.008 0.000
#> GSM96957     1  0.3174     0.6518 0.868 0.036 0.016 0.000 0.080
#> GSM96960     1  0.4165     0.5564 0.672 0.000 0.008 0.000 0.320
#> GSM96975     1  0.4169     0.6234 0.732 0.000 0.000 0.028 0.240
#> GSM96998     1  0.0703     0.6933 0.976 0.000 0.000 0.000 0.024
#> GSM96999     1  0.1522     0.6881 0.944 0.000 0.000 0.044 0.012
#> GSM97001     1  0.2208     0.6629 0.908 0.020 0.000 0.000 0.072
#> GSM97005     1  0.6075     0.4946 0.680 0.012 0.172 0.048 0.088
#> GSM97006     1  0.3047     0.6896 0.868 0.000 0.024 0.012 0.096
#> GSM97021     1  0.4219     0.5772 0.772 0.156 0.000 0.000 0.072
#> GSM97028     5  0.5915     0.1792 0.000 0.108 0.384 0.000 0.508
#> GSM97031     3  0.4517     0.2364 0.436 0.000 0.556 0.000 0.008
#> GSM97037     3  0.2248     0.7688 0.000 0.088 0.900 0.000 0.012
#> GSM97018     2  0.4950     0.2415 0.008 0.552 0.016 0.000 0.424
#> GSM97014     2  0.4139     0.6934 0.132 0.784 0.000 0.000 0.084
#> GSM97042     2  0.1341     0.8292 0.000 0.944 0.000 0.000 0.056
#> GSM97040     2  0.5331     0.3322 0.372 0.568 0.000 0.000 0.060
#> GSM97041     1  0.3950     0.5981 0.796 0.136 0.000 0.000 0.068
#> GSM96955     5  0.4310     0.0985 0.004 0.392 0.000 0.000 0.604
#> GSM96990     3  0.3353     0.6730 0.000 0.196 0.796 0.000 0.008
#> GSM96991     2  0.4283     0.2199 0.000 0.544 0.000 0.000 0.456
#> GSM97048     2  0.0510     0.8447 0.000 0.984 0.000 0.000 0.016
#> GSM96963     2  0.3816     0.5433 0.000 0.696 0.000 0.000 0.304
#> GSM96953     2  0.0609     0.8464 0.000 0.980 0.000 0.000 0.020
#> GSM96966     4  0.0703     0.9100 0.000 0.000 0.000 0.976 0.024
#> GSM96979     3  0.1430     0.7872 0.000 0.000 0.944 0.052 0.004
#> GSM96983     5  0.4574     0.1721 0.000 0.012 0.412 0.000 0.576
#> GSM96984     3  0.0566     0.7991 0.000 0.000 0.984 0.012 0.004
#> GSM96994     3  0.2339     0.7547 0.000 0.004 0.892 0.004 0.100
#> GSM96996     1  0.4440     0.3169 0.528 0.000 0.000 0.004 0.468
#> GSM96997     3  0.0162     0.7996 0.000 0.000 0.996 0.004 0.000
#> GSM97007     3  0.0510     0.7971 0.000 0.000 0.984 0.000 0.016
#> GSM96954     3  0.0000     0.7992 0.000 0.000 1.000 0.000 0.000
#> GSM96962     3  0.0324     0.7996 0.000 0.000 0.992 0.004 0.004
#> GSM96969     4  0.0963     0.9073 0.000 0.000 0.000 0.964 0.036
#> GSM96970     4  0.0609     0.9106 0.000 0.000 0.000 0.980 0.020
#> GSM96973     4  0.0000     0.9098 0.000 0.000 0.000 1.000 0.000
#> GSM96976     4  0.0880     0.9024 0.000 0.000 0.000 0.968 0.032
#> GSM96977     3  0.6201     0.4251 0.272 0.000 0.596 0.104 0.028
#> GSM96995     3  0.2956     0.7499 0.012 0.020 0.872 0.000 0.096
#> GSM97002     1  0.4738     0.2994 0.520 0.000 0.000 0.016 0.464
#> GSM97009     2  0.4690     0.5922 0.240 0.708 0.004 0.000 0.048
#> GSM97010     4  0.6508     0.2361 0.188 0.000 0.312 0.496 0.004
#> GSM96974     4  0.0703     0.9102 0.000 0.000 0.000 0.976 0.024
#> GSM96985     5  0.2932     0.4775 0.104 0.000 0.000 0.032 0.864
#> GSM96959     3  0.3992     0.5625 0.000 0.268 0.720 0.000 0.012
#> GSM96972     4  0.0324     0.9084 0.004 0.000 0.000 0.992 0.004
#> GSM96978     3  0.4467     0.6193 0.000 0.000 0.752 0.084 0.164
#> GSM96967     4  0.0794     0.9092 0.000 0.000 0.000 0.972 0.028
#> GSM96987     1  0.4114     0.4934 0.624 0.000 0.000 0.000 0.376
#> GSM97011     1  0.5014     0.3082 0.592 0.368 0.000 0.000 0.040
#> GSM96964     1  0.1831     0.6948 0.920 0.000 0.004 0.000 0.076
#> GSM96965     4  0.0162     0.9092 0.000 0.000 0.000 0.996 0.004
#> GSM96981     1  0.4130     0.5840 0.696 0.000 0.000 0.012 0.292
#> GSM96982     5  0.4682    -0.1754 0.420 0.000 0.000 0.016 0.564
#> GSM96988     5  0.3477     0.4739 0.140 0.008 0.024 0.000 0.828
#> GSM97000     3  0.3368     0.6801 0.156 0.000 0.820 0.000 0.024
#> GSM97004     1  0.4708     0.3622 0.548 0.000 0.000 0.016 0.436
#> GSM97008     1  0.4411     0.6016 0.788 0.020 0.120 0.000 0.072
#> GSM96950     1  0.4436     0.5954 0.784 0.008 0.004 0.120 0.084
#> GSM96980     4  0.4054     0.7074 0.072 0.000 0.000 0.788 0.140
#> GSM96989     1  0.3816     0.5846 0.696 0.000 0.000 0.000 0.304
#> GSM96992     1  0.3336     0.6440 0.772 0.000 0.000 0.000 0.228
#> GSM96993     1  0.2971     0.6795 0.836 0.008 0.000 0.000 0.156
#> GSM96958     1  0.1365     0.6961 0.952 0.000 0.004 0.004 0.040
#> GSM96951     1  0.5390     0.3267 0.608 0.000 0.332 0.012 0.048
#> GSM96952     1  0.3336     0.6447 0.772 0.000 0.000 0.000 0.228
#> GSM96961     1  0.2338     0.6893 0.884 0.000 0.004 0.000 0.112

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>          class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM97038     2  0.1176    0.82799 0.000 0.956 0.024 0.000 0.020 0.000
#> GSM97045     2  0.1477    0.82106 0.004 0.940 0.008 0.000 0.048 0.000
#> GSM97047     2  0.4587    0.65678 0.044 0.712 0.024 0.000 0.216 0.004
#> GSM97025     2  0.1334    0.82520 0.000 0.948 0.020 0.000 0.032 0.000
#> GSM97030     6  0.3542    0.56271 0.000 0.156 0.016 0.000 0.028 0.800
#> GSM97027     2  0.1624    0.82110 0.004 0.936 0.020 0.000 0.040 0.000
#> GSM97033     2  0.1511    0.82048 0.004 0.940 0.012 0.000 0.044 0.000
#> GSM97034     6  0.6071    0.12286 0.004 0.424 0.020 0.004 0.108 0.440
#> GSM97020     2  0.1226    0.82185 0.004 0.952 0.004 0.000 0.040 0.000
#> GSM97026     2  0.1218    0.82862 0.004 0.956 0.012 0.000 0.028 0.000
#> GSM97012     2  0.2058    0.81261 0.000 0.908 0.056 0.000 0.036 0.000
#> GSM97015     6  0.2554    0.59648 0.000 0.088 0.012 0.000 0.020 0.880
#> GSM97016     2  0.1088    0.82582 0.000 0.960 0.024 0.000 0.016 0.000
#> GSM97017     1  0.4875    0.44491 0.660 0.264 0.032 0.000 0.044 0.000
#> GSM97019     2  0.1930    0.81589 0.000 0.916 0.048 0.000 0.036 0.000
#> GSM97022     2  0.1341    0.82375 0.000 0.948 0.028 0.000 0.024 0.000
#> GSM97035     2  0.2001    0.81688 0.000 0.912 0.048 0.000 0.040 0.000
#> GSM97036     1  0.2113    0.66592 0.912 0.032 0.048 0.000 0.008 0.000
#> GSM97039     2  0.0891    0.82528 0.000 0.968 0.008 0.000 0.024 0.000
#> GSM97046     2  0.2846    0.79059 0.000 0.856 0.084 0.000 0.060 0.000
#> GSM97023     1  0.1367    0.66805 0.944 0.000 0.012 0.000 0.044 0.000
#> GSM97029     2  0.5331    0.38356 0.316 0.588 0.024 0.000 0.072 0.000
#> GSM97043     2  0.1565    0.82248 0.000 0.940 0.028 0.000 0.028 0.004
#> GSM97013     5  0.5389    0.45009 0.320 0.008 0.008 0.072 0.588 0.004
#> GSM96956     6  0.5916    0.21939 0.000 0.400 0.092 0.000 0.036 0.472
#> GSM97024     2  0.2231    0.81765 0.000 0.908 0.028 0.000 0.048 0.016
#> GSM97032     2  0.5574    0.47972 0.000 0.628 0.088 0.000 0.052 0.232
#> GSM97044     6  0.0436    0.59949 0.000 0.004 0.004 0.000 0.004 0.988
#> GSM97049     2  0.2544    0.78673 0.004 0.864 0.012 0.000 0.120 0.000
#> GSM96968     6  0.4109    0.13387 0.004 0.000 0.008 0.000 0.392 0.596
#> GSM96971     4  0.2240    0.90533 0.000 0.000 0.032 0.908 0.044 0.016
#> GSM96986     6  0.4129   -0.16240 0.004 0.000 0.000 0.004 0.496 0.496
#> GSM97003     6  0.4233    0.46102 0.024 0.000 0.016 0.016 0.196 0.748
#> GSM96957     1  0.4513    0.23407 0.572 0.028 0.004 0.000 0.396 0.000
#> GSM96960     1  0.3915    0.49186 0.704 0.000 0.272 0.020 0.004 0.000
#> GSM96975     1  0.5550    0.39430 0.592 0.000 0.292 0.076 0.040 0.000
#> GSM96998     1  0.1625    0.66902 0.928 0.000 0.012 0.000 0.060 0.000
#> GSM96999     1  0.3469    0.64818 0.824 0.000 0.012 0.092 0.072 0.000
#> GSM97001     1  0.4030    0.58662 0.776 0.040 0.032 0.000 0.152 0.000
#> GSM97005     5  0.5162    0.30404 0.384 0.004 0.016 0.020 0.560 0.016
#> GSM97006     1  0.5477    0.56957 0.712 0.000 0.040 0.104 0.088 0.056
#> GSM97021     1  0.5072    0.51721 0.700 0.132 0.040 0.000 0.128 0.000
#> GSM97028     3  0.6118    0.15782 0.000 0.124 0.488 0.000 0.036 0.352
#> GSM97031     6  0.6408   -0.34900 0.308 0.000 0.012 0.000 0.320 0.360
#> GSM97037     6  0.5189    0.45933 0.000 0.280 0.036 0.000 0.056 0.628
#> GSM97018     2  0.6735    0.30422 0.008 0.520 0.188 0.000 0.068 0.216
#> GSM97014     2  0.3880    0.71314 0.024 0.772 0.028 0.000 0.176 0.000
#> GSM97042     2  0.2420    0.80293 0.000 0.884 0.076 0.000 0.040 0.000
#> GSM97040     1  0.6047    0.00961 0.444 0.432 0.036 0.000 0.080 0.008
#> GSM97041     1  0.4660    0.55286 0.736 0.108 0.032 0.000 0.124 0.000
#> GSM96955     3  0.3869    0.43473 0.008 0.236 0.736 0.004 0.016 0.000
#> GSM96990     6  0.5036    0.41675 0.000 0.332 0.036 0.000 0.032 0.600
#> GSM96991     3  0.4791    0.10192 0.000 0.384 0.564 0.000 0.048 0.004
#> GSM97048     2  0.1398    0.82211 0.000 0.940 0.008 0.000 0.052 0.000
#> GSM96963     2  0.4385    0.22997 0.000 0.532 0.444 0.000 0.024 0.000
#> GSM96953     2  0.1168    0.82780 0.000 0.956 0.028 0.000 0.016 0.000
#> GSM96966     4  0.1036    0.92898 0.004 0.000 0.008 0.964 0.024 0.000
#> GSM96979     5  0.5067    0.14887 0.000 0.000 0.000 0.076 0.488 0.436
#> GSM96983     3  0.4572    0.07248 0.000 0.012 0.512 0.000 0.016 0.460
#> GSM96984     6  0.2730    0.50917 0.000 0.000 0.000 0.000 0.192 0.808
#> GSM96994     6  0.1845    0.58988 0.000 0.004 0.072 0.000 0.008 0.916
#> GSM96996     1  0.4049    0.26644 0.580 0.000 0.412 0.004 0.004 0.000
#> GSM96997     6  0.2845    0.51210 0.000 0.000 0.004 0.004 0.172 0.820
#> GSM97007     6  0.0405    0.59796 0.000 0.000 0.008 0.000 0.004 0.988
#> GSM96954     6  0.1285    0.59037 0.000 0.000 0.004 0.000 0.052 0.944
#> GSM96962     6  0.3309    0.39068 0.000 0.000 0.000 0.000 0.280 0.720
#> GSM96969     4  0.1194    0.92829 0.000 0.000 0.008 0.956 0.032 0.004
#> GSM96970     4  0.0146    0.93205 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM96973     4  0.0458    0.93130 0.000 0.000 0.000 0.984 0.016 0.000
#> GSM96976     4  0.1908    0.91492 0.000 0.000 0.028 0.916 0.056 0.000
#> GSM96977     5  0.5159    0.54802 0.028 0.000 0.000 0.108 0.672 0.192
#> GSM96995     6  0.2302    0.58053 0.032 0.000 0.060 0.000 0.008 0.900
#> GSM97002     3  0.4111    0.00565 0.456 0.000 0.536 0.004 0.004 0.000
#> GSM97009     2  0.5797    0.48730 0.100 0.576 0.032 0.000 0.288 0.004
#> GSM97010     5  0.5876    0.52390 0.012 0.000 0.040 0.176 0.632 0.140
#> GSM96974     4  0.1578    0.92454 0.000 0.000 0.012 0.936 0.048 0.004
#> GSM96985     3  0.3544    0.47662 0.108 0.000 0.828 0.032 0.024 0.008
#> GSM96959     6  0.5040    0.51491 0.020 0.188 0.044 0.000 0.040 0.708
#> GSM96972     4  0.1364    0.92107 0.000 0.000 0.004 0.944 0.048 0.004
#> GSM96978     3  0.6481   -0.05332 0.000 0.000 0.432 0.076 0.104 0.388
#> GSM96967     4  0.0603    0.93096 0.000 0.000 0.004 0.980 0.016 0.000
#> GSM96987     1  0.2838    0.59075 0.808 0.000 0.188 0.000 0.004 0.000
#> GSM97011     2  0.6754    0.02650 0.348 0.412 0.060 0.000 0.180 0.000
#> GSM96964     1  0.4476    0.38131 0.640 0.000 0.052 0.000 0.308 0.000
#> GSM96965     4  0.1075    0.92303 0.000 0.000 0.000 0.952 0.048 0.000
#> GSM96981     3  0.4631    0.02610 0.428 0.000 0.536 0.004 0.032 0.000
#> GSM96982     3  0.3802    0.29701 0.312 0.000 0.676 0.000 0.012 0.000
#> GSM96988     3  0.6643    0.43978 0.212 0.012 0.560 0.012 0.044 0.160
#> GSM97000     5  0.4811    0.17488 0.036 0.000 0.008 0.000 0.508 0.448
#> GSM97004     1  0.4831    0.26963 0.580 0.000 0.368 0.040 0.012 0.000
#> GSM97008     1  0.6063    0.26067 0.532 0.028 0.048 0.000 0.348 0.044
#> GSM96950     5  0.5122    0.58070 0.188 0.000 0.004 0.148 0.656 0.004
#> GSM96980     4  0.5290    0.56352 0.104 0.000 0.188 0.668 0.040 0.000
#> GSM96989     1  0.2520    0.64231 0.872 0.000 0.108 0.012 0.008 0.000
#> GSM96992     1  0.2631    0.64072 0.860 0.000 0.124 0.004 0.008 0.004
#> GSM96993     1  0.1088    0.67203 0.960 0.016 0.024 0.000 0.000 0.000
#> GSM96958     1  0.5450    0.19553 0.544 0.000 0.040 0.032 0.376 0.008
#> GSM96951     5  0.5759    0.58498 0.252 0.000 0.000 0.024 0.580 0.144
#> GSM96952     1  0.2466    0.64611 0.872 0.000 0.112 0.008 0.008 0.000
#> GSM96961     1  0.0935    0.67010 0.964 0.000 0.032 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-ATC-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-NMF-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>          n disease.state(p) specimen(p) cell.type(p) other(p) k
#> ATC:NMF 99         6.29e-06      0.6173     1.57e-11   0.2857 2
#> ATC:NMF 94         9.01e-05      0.0862     1.22e-21   0.1605 3
#> ATC:NMF 96         7.69e-04      0.3426     1.63e-19   0.1058 4
#> ATC:NMF 78         1.26e-04      0.1133     1.89e-19   0.0431 5
#> ATC:NMF 61         7.20e-05      0.2446     1.92e-14   0.1045 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